diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 15ddb75ce0b340..4ed26136de4556 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -56,13 +56,6 @@ The next most important script runs all the appropriate testing. The linting is there to keep a consistent code-style across the all of the code and the testing is there to help catch bugs and check that the code behaves as expected. It is important that neither of these steps comes up with any errors due to your changes. -* If you’d like the linter to fix any errors that it can change, make the following addition to the “test-lint” script. - - { - ... - "test-lint": "eslint src --ext js --ext ts --fix && tsc -p utils/build/tsconfig.lint.json" - ... - } If you’d like to make a minified version of the build files i.e. ‘build/three.min.js’ run: diff --git a/build/three.js b/build/three.js index 8058c73a9ce0d4..90f835e8f0922e 100644 --- a/build/three.js +++ b/build/three.js @@ -295,6 +295,9 @@ var DynamicCopyUsage = 35050; var StreamCopyUsage = 35042; + var GLSL1 = "100"; + var GLSL3 = "300 es"; + /** * https://github.com/mrdoob/eventdispatcher.js/ */ @@ -594,7 +597,7 @@ }; - function Vector2( x, y ) { + var Vector2 = function Vector2( x, y ) { if ( x === void 0 ) x = 0; if ( y === void 0 ) y = 0; @@ -602,495 +605,483 @@ this.x = x; this.y = y; - } - - Object.defineProperties( Vector2.prototype, { - - "width": { - - get: function () { + }; - return this.x; + var prototypeAccessors = { width: { configurable: true },height: { configurable: true } }; - }, - - set: function ( value ) { + prototypeAccessors.width.get = function () { - this.x = value; + return this.x; - } + }; - }, + prototypeAccessors.width.set = function ( value ) { - "height": { + this.x = value; - get: function () { + }; - return this.y; + prototypeAccessors.height.get = function () { - }, + return this.y; - set: function ( value ) { + }; - this.y = value; + prototypeAccessors.height.set = function ( value ) { - } + this.y = value; - } + }; - } ); + Vector2.prototype.set = function set ( x, y ) { - Object.assign( Vector2.prototype, { - - isVector2: true, + this.x = x; + this.y = y; - set: function ( x, y ) { + return this; - this.x = x; - this.y = y; + }; - return this; + Vector2.prototype.setScalar = function setScalar ( scalar ) { - }, + this.x = scalar; + this.y = scalar; - setScalar: function ( scalar ) { + return this; - this.x = scalar; - this.y = scalar; + }; - return this; + Vector2.prototype.setX = function setX ( x ) { - }, + this.x = x; - setX: function ( x ) { + return this; - this.x = x; + }; - return this; + Vector2.prototype.setY = function setY ( y ) { - }, - - setY: function ( y ) { + this.y = y; - this.y = y; + return this; - return this; + }; - }, + Vector2.prototype.setComponent = function setComponent ( index, value ) { - setComponent: function ( index, value ) { + switch ( index ) { - switch ( index ) { + case 0: this.x = value; break; + case 1: this.y = value; break; + default: throw new Error( 'index is out of range: ' + index ); - case 0: this.x = value; break; - case 1: this.y = value; break; - default: throw new Error( 'index is out of range: ' + index ); + } - } + return this; - return this; + }; - }, + Vector2.prototype.getComponent = function getComponent ( index ) { - getComponent: function ( index ) { + switch ( index ) { - switch ( index ) { + case 0: return this.x; + case 1: return this.y; + default: throw new Error( 'index is out of range: ' + index ); - case 0: return this.x; - case 1: return this.y; - default: throw new Error( 'index is out of range: ' + index ); + } - } + }; - }, + Vector2.prototype.clone = function clone () { - clone: function () { + return new this.constructor( this.x, this.y ); - return new this.constructor( this.x, this.y ); + }; - }, + Vector2.prototype.copy = function copy ( v ) { - copy: function ( v ) { + this.x = v.x; + this.y = v.y; - this.x = v.x; - this.y = v.y; + return this; - return this; + }; - }, + Vector2.prototype.add = function add ( v, w ) { - add: function ( v, w ) { + if ( w !== undefined ) { - if ( w !== undefined ) { + console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); - console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + } - } + this.x += v.x; + this.y += v.y; - this.x += v.x; - this.y += v.y; + return this; - return this; + }; - }, + Vector2.prototype.addScalar = function addScalar ( s ) { - addScalar: function ( s ) { + this.x += s; + this.y += s; - this.x += s; - this.y += s; + return this; - return this; + }; - }, + Vector2.prototype.addVectors = function addVectors ( a, b ) { - addVectors: function ( a, b ) { + this.x = a.x + b.x; + this.y = a.y + b.y; - this.x = a.x + b.x; - this.y = a.y + b.y; + return this; - return this; + }; - }, + Vector2.prototype.addScaledVector = function addScaledVector ( v, s ) { - addScaledVector: function ( v, s ) { + this.x += v.x * s; + this.y += v.y * s; - this.x += v.x * s; - this.y += v.y * s; + return this; - return this; + }; - }, + Vector2.prototype.sub = function sub ( v, w ) { - sub: function ( v, w ) { + if ( w !== undefined ) { - if ( w !== undefined ) { + console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); - console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + } - } + this.x -= v.x; + this.y -= v.y; - this.x -= v.x; - this.y -= v.y; + return this; - return this; + }; - }, + Vector2.prototype.subScalar = function subScalar ( s ) { - subScalar: function ( s ) { + this.x -= s; + this.y -= s; - this.x -= s; - this.y -= s; + return this; - return this; + }; - }, + Vector2.prototype.subVectors = function subVectors ( a, b ) { - subVectors: function ( a, b ) { + this.x = a.x - b.x; + this.y = a.y - b.y; - this.x = a.x - b.x; - this.y = a.y - b.y; + return this; - return this; + }; - }, + Vector2.prototype.multiply = function multiply ( v ) { - multiply: function ( v ) { + this.x *= v.x; + this.y *= v.y; - this.x *= v.x; - this.y *= v.y; + return this; - return this; + }; - }, + Vector2.prototype.multiplyScalar = function multiplyScalar ( scalar ) { - multiplyScalar: function ( scalar ) { + this.x *= scalar; + this.y *= scalar; - this.x *= scalar; - this.y *= scalar; + return this; - return this; + }; - }, + Vector2.prototype.divide = function divide ( v ) { - divide: function ( v ) { + this.x /= v.x; + this.y /= v.y; - this.x /= v.x; - this.y /= v.y; + return this; - return this; + }; - }, + Vector2.prototype.divideScalar = function divideScalar ( scalar ) { - divideScalar: function ( scalar ) { + return this.multiplyScalar( 1 / scalar ); - return this.multiplyScalar( 1 / scalar ); + }; - }, + Vector2.prototype.applyMatrix3 = function applyMatrix3 ( m ) { - applyMatrix3: function ( m ) { + var x = this.x, y = this.y; + var e = m.elements; - var x = this.x, y = this.y; - var e = m.elements; + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ]; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ]; - this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ]; - this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ]; + return this; - return this; + }; - }, + Vector2.prototype.min = function min ( v ) { - min: function ( v ) { + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); + return this; - return this; + }; - }, + Vector2.prototype.max = function max ( v ) { - max: function ( v ) { + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); + return this; - return this; + }; - }, + Vector2.prototype.clamp = function clamp ( min, max ) { - clamp: function ( min, max ) { + // assumes min < max, componentwise - // assumes min < max, componentwise + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + return this; - return this; + }; - }, + Vector2.prototype.clampScalar = function clampScalar ( minVal, maxVal ) { - clampScalar: function ( minVal, maxVal ) { + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + return this; - return this; + }; - }, + Vector2.prototype.clampLength = function clampLength ( min, max ) { - clampLength: function ( min, max ) { + var length = this.length(); - var length = this.length(); + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + }; - }, + Vector2.prototype.floor = function floor () { - floor: function () { + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); + return this; - return this; + }; - }, + Vector2.prototype.ceil = function ceil () { - ceil: function () { + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); + return this; - return this; + }; - }, + Vector2.prototype.round = function round () { - round: function () { + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); + return this; - return this; + }; - }, + Vector2.prototype.roundToZero = function roundToZero () { - roundToZero: function () { + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + return this; - return this; + }; - }, + Vector2.prototype.negate = function negate () { - negate: function () { + this.x = - this.x; + this.y = - this.y; - this.x = - this.x; - this.y = - this.y; + return this; - return this; + }; - }, + Vector2.prototype.dot = function dot ( v ) { - dot: function ( v ) { + return this.x * v.x + this.y * v.y; - return this.x * v.x + this.y * v.y; + }; - }, + Vector2.prototype.cross = function cross ( v ) { - cross: function ( v ) { + return this.x * v.y - this.y * v.x; - return this.x * v.y - this.y * v.x; + }; - }, + Vector2.prototype.lengthSq = function lengthSq () { - lengthSq: function () { + return this.x * this.x + this.y * this.y; - return this.x * this.x + this.y * this.y; + }; - }, + Vector2.prototype.length = function length () { - length: function () { + return Math.sqrt( this.x * this.x + this.y * this.y ); - return Math.sqrt( this.x * this.x + this.y * this.y ); + }; - }, + Vector2.prototype.manhattanLength = function manhattanLength () { - manhattanLength: function () { + return Math.abs( this.x ) + Math.abs( this.y ); - return Math.abs( this.x ) + Math.abs( this.y ); + }; - }, + Vector2.prototype.normalize = function normalize () { - normalize: function () { + return this.divideScalar( this.length() || 1 ); - return this.divideScalar( this.length() || 1 ); + }; - }, + Vector2.prototype.angle = function angle () { - angle: function () { + // computes the angle in radians with respect to the positive x-axis - // computes the angle in radians with respect to the positive x-axis + var angle = Math.atan2( - this.y, - this.x ) + Math.PI; - var angle = Math.atan2( - this.y, - this.x ) + Math.PI; + return angle; - return angle; + }; - }, + Vector2.prototype.distanceTo = function distanceTo ( v ) { - distanceTo: function ( v ) { + return Math.sqrt( this.distanceToSquared( v ) ); - return Math.sqrt( this.distanceToSquared( v ) ); + }; - }, + Vector2.prototype.distanceToSquared = function distanceToSquared ( v ) { - distanceToSquared: function ( v ) { + var dx = this.x - v.x, dy = this.y - v.y; + return dx * dx + dy * dy; - var dx = this.x - v.x, dy = this.y - v.y; - return dx * dx + dy * dy; + }; - }, + Vector2.prototype.manhattanDistanceTo = function manhattanDistanceTo ( v ) { - manhattanDistanceTo: function ( v ) { + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); - return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); + }; - }, + Vector2.prototype.setLength = function setLength ( length ) { - setLength: function ( length ) { + return this.normalize().multiplyScalar( length ); - return this.normalize().multiplyScalar( length ); + }; - }, + Vector2.prototype.lerp = function lerp ( v, alpha ) { - lerp: function ( v, alpha ) { + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; + return this; - return this; + }; - }, + Vector2.prototype.lerpVectors = function lerpVectors ( v1, v2, alpha ) { - lerpVectors: function ( v1, v2, alpha ) { + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; - this.x = v1.x + ( v2.x - v1.x ) * alpha; - this.y = v1.y + ( v2.y - v1.y ) * alpha; + return this; - return this; + }; - }, + Vector2.prototype.equals = function equals ( v ) { - equals: function ( v ) { + return ( ( v.x === this.x ) && ( v.y === this.y ) ); - return ( ( v.x === this.x ) && ( v.y === this.y ) ); + }; - }, + Vector2.prototype.fromArray = function fromArray ( array, offset ) { - fromArray: function ( array, offset ) { + if ( offset === undefined ) { offset = 0; } - if ( offset === undefined ) { offset = 0; } + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; + return this; - return this; + }; - }, + Vector2.prototype.toArray = function toArray ( array, offset ) { - toArray: function ( array, offset ) { + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; + return array; - return array; + }; - }, + Vector2.prototype.fromBufferAttribute = function fromBufferAttribute ( attribute, index, offset ) { - fromBufferAttribute: function ( attribute, index, offset ) { + if ( offset !== undefined ) { - if ( offset !== undefined ) { + console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' ); - console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' ); + } - } + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); + return this; - return this; + }; - }, + Vector2.prototype.rotateAround = function rotateAround ( center, angle ) { - rotateAround: function ( center, angle ) { + var c = Math.cos( angle ), s = Math.sin( angle ); - var c = Math.cos( angle ), s = Math.sin( angle ); + var x = this.x - center.x; + var y = this.y - center.y; - var x = this.x - center.x; - var y = this.y - center.y; + this.x = x * c - y * s + center.x; + this.y = x * s + y * c + center.y; - this.x = x * c - y * s + center.x; - this.y = x * s + y * c + center.y; + return this; - return this; + }; - }, + Vector2.prototype.random = function random () { - random: function () { + this.x = Math.random(); + this.y = Math.random(); - this.x = Math.random(); - this.y = Math.random(); + return this; - return this; + }; - } + Object.defineProperties( Vector2.prototype, prototypeAccessors ); - } ); + Vector2.prototype.isVector2 = true; - function Matrix3() { + var Matrix3 = function Matrix3() { this.elements = [ @@ -1106,337 +1097,333 @@ } - } - - Object.assign( Matrix3.prototype, { - - isMatrix3: true, + }; - set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { + Matrix3.prototype.set = function set ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { - var te = this.elements; + var te = this.elements; - te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; - te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; - te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; + te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; + te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; + te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; - return this; + return this; - }, + }; - identity: function () { + Matrix3.prototype.identity = function identity () { - this.set( + this.set( - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 - ); + ); - return this; + return this; - }, + }; - clone: function () { + Matrix3.prototype.clone = function clone () { - return new this.constructor().fromArray( this.elements ); + return new this.constructor().fromArray( this.elements ); - }, + }; - copy: function ( m ) { + Matrix3.prototype.copy = function copy ( m ) { - var te = this.elements; - var me = m.elements; + var te = this.elements; + var me = m.elements; - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; - te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; - te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; + te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; + te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; - return this; + return this; - }, + }; - extractBasis: function ( xAxis, yAxis, zAxis ) { + Matrix3.prototype.extractBasis = function extractBasis ( xAxis, yAxis, zAxis ) { - xAxis.setFromMatrix3Column( this, 0 ); - yAxis.setFromMatrix3Column( this, 1 ); - zAxis.setFromMatrix3Column( this, 2 ); + xAxis.setFromMatrix3Column( this, 0 ); + yAxis.setFromMatrix3Column( this, 1 ); + zAxis.setFromMatrix3Column( this, 2 ); - return this; + return this; - }, + }; - setFromMatrix4: function ( m ) { + Matrix3.prototype.setFromMatrix4 = function setFromMatrix4 ( m ) { - var me = m.elements; + var me = m.elements; - this.set( + this.set( - me[ 0 ], me[ 4 ], me[ 8 ], - me[ 1 ], me[ 5 ], me[ 9 ], - me[ 2 ], me[ 6 ], me[ 10 ] + me[ 0 ], me[ 4 ], me[ 8 ], + me[ 1 ], me[ 5 ], me[ 9 ], + me[ 2 ], me[ 6 ], me[ 10 ] - ); + ); - return this; + return this; - }, + }; - multiply: function ( m ) { + Matrix3.prototype.multiply = function multiply ( m ) { - return this.multiplyMatrices( this, m ); + return this.multiplyMatrices( this, m ); - }, + }; - premultiply: function ( m ) { + Matrix3.prototype.premultiply = function premultiply ( m ) { - return this.multiplyMatrices( m, this ); + return this.multiplyMatrices( m, this ); - }, + }; - multiplyMatrices: function ( a, b ) { + Matrix3.prototype.multiplyMatrices = function multiplyMatrices ( a, b ) { - var ae = a.elements; - var be = b.elements; - var te = this.elements; + var ae = a.elements; + var be = b.elements; + var te = this.elements; - var a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; - var a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; - var a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; + var a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; + var a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; + var a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; - var b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; - var b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; - var b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; + var b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; + var b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; + var b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; - te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; - te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; + te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; + te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; - te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; - te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; + te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; + te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; - te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; - te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; + te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; + te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; - return this; + return this; - }, + }; - multiplyScalar: function ( s ) { + Matrix3.prototype.multiplyScalar = function multiplyScalar ( s ) { - var te = this.elements; + var te = this.elements; - te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; - te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; - te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; + te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; + te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; + te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; - return this; + return this; - }, + }; - determinant: function () { + Matrix3.prototype.determinant = function determinant () { - var te = this.elements; + var te = this.elements; - var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], - d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], - g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; + var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], + d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], + g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; - return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; + return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; - }, + }; - getInverse: function ( matrix, throwOnDegenerate ) { + Matrix3.prototype.getInverse = function getInverse ( matrix, throwOnDegenerate ) { - if ( throwOnDegenerate !== undefined ) { + if ( throwOnDegenerate !== undefined ) { - console.warn( "THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate." ); + console.warn( "THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate." ); - } + } - var me = matrix.elements, - te = this.elements, + var me = matrix.elements, + te = this.elements, - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], - n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ], - n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ], + n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], + n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ], + n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ], - t11 = n33 * n22 - n32 * n23, - t12 = n32 * n13 - n33 * n12, - t13 = n23 * n12 - n22 * n13, + t11 = n33 * n22 - n32 * n23, + t12 = n32 * n13 - n33 * n12, + t13 = n23 * n12 - n22 * n13, - det = n11 * t11 + n21 * t12 + n31 * t13; + det = n11 * t11 + n21 * t12 + n31 * t13; - if ( det === 0 ) { return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } + if ( det === 0 ) { return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } - var detInv = 1 / det; + var detInv = 1 / det; - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; - te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; + te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; - te[ 3 ] = t12 * detInv; - te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; - te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; + te[ 3 ] = t12 * detInv; + te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; + te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; - te[ 6 ] = t13 * detInv; - te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; - te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; + te[ 6 ] = t13 * detInv; + te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; + te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; - return this; + return this; - }, + }; - transpose: function () { + Matrix3.prototype.transpose = function transpose () { - var tmp; - var m = this.elements; + var tmp; + var m = this.elements; - tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; - tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; - tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; + tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; + tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; + tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; - return this; + return this; - }, + }; - getNormalMatrix: function ( matrix4 ) { + Matrix3.prototype.getNormalMatrix = function getNormalMatrix ( matrix4 ) { - return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); + return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); - }, + }; - transposeIntoArray: function ( r ) { + Matrix3.prototype.transposeIntoArray = function transposeIntoArray ( r ) { - var m = this.elements; + var m = this.elements; - r[ 0 ] = m[ 0 ]; - r[ 1 ] = m[ 3 ]; - r[ 2 ] = m[ 6 ]; - r[ 3 ] = m[ 1 ]; - r[ 4 ] = m[ 4 ]; - r[ 5 ] = m[ 7 ]; - r[ 6 ] = m[ 2 ]; - r[ 7 ] = m[ 5 ]; - r[ 8 ] = m[ 8 ]; + r[ 0 ] = m[ 0 ]; + r[ 1 ] = m[ 3 ]; + r[ 2 ] = m[ 6 ]; + r[ 3 ] = m[ 1 ]; + r[ 4 ] = m[ 4 ]; + r[ 5 ] = m[ 7 ]; + r[ 6 ] = m[ 2 ]; + r[ 7 ] = m[ 5 ]; + r[ 8 ] = m[ 8 ]; - return this; + return this; - }, + }; - setUvTransform: function ( tx, ty, sx, sy, rotation, cx, cy ) { + Matrix3.prototype.setUvTransform = function setUvTransform ( tx, ty, sx, sy, rotation, cx, cy ) { - var c = Math.cos( rotation ); - var s = Math.sin( rotation ); + var c = Math.cos( rotation ); + var s = Math.sin( rotation ); - this.set( - sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx, - - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty, - 0, 0, 1 - ); + this.set( + sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx, + - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty, + 0, 0, 1 + ); - }, + }; - scale: function ( sx, sy ) { + Matrix3.prototype.scale = function scale ( sx, sy ) { - var te = this.elements; + var te = this.elements; - te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx; - te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy; + te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx; + te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy; - return this; + return this; - }, + }; - rotate: function ( theta ) { + Matrix3.prototype.rotate = function rotate ( theta ) { - var c = Math.cos( theta ); - var s = Math.sin( theta ); + var c = Math.cos( theta ); + var s = Math.sin( theta ); - var te = this.elements; + var te = this.elements; - var a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ]; - var a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ]; + var a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ]; + var a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ]; - te[ 0 ] = c * a11 + s * a21; - te[ 3 ] = c * a12 + s * a22; - te[ 6 ] = c * a13 + s * a23; + te[ 0 ] = c * a11 + s * a21; + te[ 3 ] = c * a12 + s * a22; + te[ 6 ] = c * a13 + s * a23; - te[ 1 ] = - s * a11 + c * a21; - te[ 4 ] = - s * a12 + c * a22; - te[ 7 ] = - s * a13 + c * a23; + te[ 1 ] = - s * a11 + c * a21; + te[ 4 ] = - s * a12 + c * a22; + te[ 7 ] = - s * a13 + c * a23; - return this; + return this; - }, + }; - translate: function ( tx, ty ) { + Matrix3.prototype.translate = function translate ( tx, ty ) { - var te = this.elements; + var te = this.elements; - te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ]; - te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ]; + te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ]; + te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ]; - return this; + return this; - }, + }; - equals: function ( matrix ) { + Matrix3.prototype.equals = function equals ( matrix ) { - var te = this.elements; - var me = matrix.elements; + var te = this.elements; + var me = matrix.elements; - for ( var i = 0; i < 9; i ++ ) { + for ( var i = 0; i < 9; i ++ ) { - if ( te[ i ] !== me[ i ] ) { return false; } + if ( te[ i ] !== me[ i ] ) { return false; } - } + } - return true; + return true; - }, + }; - fromArray: function ( array, offset ) { + Matrix3.prototype.fromArray = function fromArray ( array, offset ) { - if ( offset === undefined ) { offset = 0; } + if ( offset === undefined ) { offset = 0; } - for ( var i = 0; i < 9; i ++ ) { + for ( var i = 0; i < 9; i ++ ) { - this.elements[ i ] = array[ i + offset ]; + this.elements[ i ] = array[ i + offset ]; - } + } - return this; + return this; - }, + }; - toArray: function ( array, offset ) { + Matrix3.prototype.toArray = function toArray ( array, offset ) { - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - var te = this.elements; + var te = this.elements; - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; - array[ offset + 3 ] = te[ 3 ]; - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; + array[ offset + 3 ] = te[ 3 ]; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; - array[ offset + 8 ] = te[ 8 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; + array[ offset + 8 ] = te[ 8 ]; - return array; + return array; - } + }; - } ); + Matrix3.prototype.isMatrix3 = true; var _canvas; @@ -1810,7 +1797,7 @@ } ); - function Vector4( x, y, z, w ) { + var Vector4 = function Vector4( x, y, z, w ) { if ( x === void 0 ) x = 0; if ( y === void 0 ) y = 0; if ( z === void 0 ) z = 0; @@ -1822,658 +1809,646 @@ this.z = z; this.w = w; - } - - Object.defineProperties( Vector4.prototype, { - - "width": { - - get: function () { - - return this.z; - - }, - - set: function ( value ) { - - this.z = value; + }; - } + var prototypeAccessors$1 = { width: { configurable: true },height: { configurable: true } }; - }, + prototypeAccessors$1.width.get = function () { - "height": { + return this.z; - get: function () { + }; - return this.w; + prototypeAccessors$1.width.set = function ( value ) { - }, + this.z = value; - set: function ( value ) { + }; - this.w = value; + prototypeAccessors$1.height.get = function () { - } + return this.w; - } + }; - } ); + prototypeAccessors$1.height.set = function ( value ) { - Object.assign( Vector4.prototype, { + this.w = value; - isVector4: true, + }; - set: function ( x, y, z, w ) { + Vector4.prototype.set = function set ( x, y, z, w ) { - this.x = x; - this.y = y; - this.z = z; - this.w = w; + this.x = x; + this.y = y; + this.z = z; + this.w = w; - return this; + return this; - }, + }; - setScalar: function ( scalar ) { + Vector4.prototype.setScalar = function setScalar ( scalar ) { - this.x = scalar; - this.y = scalar; - this.z = scalar; - this.w = scalar; + this.x = scalar; + this.y = scalar; + this.z = scalar; + this.w = scalar; - return this; + return this; - }, + }; - setX: function ( x ) { + Vector4.prototype.setX = function setX ( x ) { - this.x = x; + this.x = x; - return this; + return this; - }, + }; - setY: function ( y ) { + Vector4.prototype.setY = function setY ( y ) { - this.y = y; + this.y = y; - return this; + return this; - }, + }; - setZ: function ( z ) { + Vector4.prototype.setZ = function setZ ( z ) { - this.z = z; + this.z = z; - return this; + return this; - }, + }; - setW: function ( w ) { + Vector4.prototype.setW = function setW ( w ) { - this.w = w; + this.w = w; - return this; + return this; - }, + }; - setComponent: function ( index, value ) { + Vector4.prototype.setComponent = function setComponent ( index, value ) { - switch ( index ) { + switch ( index ) { - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - case 3: this.w = value; break; - default: throw new Error( 'index is out of range: ' + index ); + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + case 3: this.w = value; break; + default: throw new Error( 'index is out of range: ' + index ); - } + } - return this; + return this; - }, + }; - getComponent: function ( index ) { + Vector4.prototype.getComponent = function getComponent ( index ) { - switch ( index ) { + switch ( index ) { - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - case 3: return this.w; - default: throw new Error( 'index is out of range: ' + index ); + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + case 3: return this.w; + default: throw new Error( 'index is out of range: ' + index ); - } + } - }, + }; - clone: function () { + Vector4.prototype.clone = function clone () { - return new this.constructor( this.x, this.y, this.z, this.w ); + return new this.constructor( this.x, this.y, this.z, this.w ); - }, + }; - copy: function ( v ) { + Vector4.prototype.copy = function copy ( v ) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = ( v.w !== undefined ) ? v.w : 1; + this.x = v.x; + this.y = v.y; + this.z = v.z; + this.w = ( v.w !== undefined ) ? v.w : 1; - return this; + return this; - }, + }; - add: function ( v, w ) { + Vector4.prototype.add = function add ( v, w ) { - if ( w !== undefined ) { + if ( w !== undefined ) { - console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); - } + } - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; - return this; + return this; - }, + }; - addScalar: function ( s ) { + Vector4.prototype.addScalar = function addScalar ( s ) { - this.x += s; - this.y += s; - this.z += s; - this.w += s; + this.x += s; + this.y += s; + this.z += s; + this.w += s; - return this; + return this; - }, + }; - addVectors: function ( a, b ) { + Vector4.prototype.addVectors = function addVectors ( a, b ) { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - this.w = a.w + b.w; + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + this.w = a.w + b.w; - return this; + return this; - }, + }; - addScaledVector: function ( v, s ) { + Vector4.prototype.addScaledVector = function addScaledVector ( v, s ) { - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - this.w += v.w * s; + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; + this.w += v.w * s; - return this; + return this; - }, + }; - sub: function ( v, w ) { + Vector4.prototype.sub = function sub ( v, w ) { - if ( w !== undefined ) { + if ( w !== undefined ) { - console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); - } + } - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; - return this; + return this; - }, + }; - subScalar: function ( s ) { + Vector4.prototype.subScalar = function subScalar ( s ) { - this.x -= s; - this.y -= s; - this.z -= s; - this.w -= s; + this.x -= s; + this.y -= s; + this.z -= s; + this.w -= s; - return this; + return this; - }, + }; - subVectors: function ( a, b ) { + Vector4.prototype.subVectors = function subVectors ( a, b ) { - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - this.w = a.w - b.w; + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; + this.w = a.w - b.w; - return this; + return this; - }, + }; - multiplyScalar: function ( scalar ) { + Vector4.prototype.multiplyScalar = function multiplyScalar ( scalar ) { - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - this.w *= scalar; + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; + this.w *= scalar; - return this; + return this; - }, + }; - applyMatrix4: function ( m ) { + Vector4.prototype.applyMatrix4 = function applyMatrix4 ( m ) { - var x = this.x, y = this.y, z = this.z, w = this.w; - var e = m.elements; + var x = this.x, y = this.y, z = this.z, w = this.w; + var e = m.elements; - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; - this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; + this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; - return this; + return this; - }, + }; - divideScalar: function ( scalar ) { + Vector4.prototype.divideScalar = function divideScalar ( scalar ) { - return this.multiplyScalar( 1 / scalar ); + return this.multiplyScalar( 1 / scalar ); - }, + }; - setAxisAngleFromQuaternion: function ( q ) { + Vector4.prototype.setAxisAngleFromQuaternion = function setAxisAngleFromQuaternion ( q ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm - // q is assumed to be normalized + // q is assumed to be normalized - this.w = 2 * Math.acos( q.w ); + this.w = 2 * Math.acos( q.w ); - var s = Math.sqrt( 1 - q.w * q.w ); + var s = Math.sqrt( 1 - q.w * q.w ); - if ( s < 0.0001 ) { + if ( s < 0.0001 ) { - this.x = 1; - this.y = 0; - this.z = 0; + this.x = 1; + this.y = 0; + this.z = 0; - } else { + } else { - this.x = q.x / s; - this.y = q.y / s; - this.z = q.z / s; + this.x = q.x / s; + this.y = q.y / s; + this.z = q.z / s; - } + } - return this; + return this; - }, + }; - setAxisAngleFromRotationMatrix: function ( m ) { + Vector4.prototype.setAxisAngleFromRotationMatrix = function setAxisAngleFromRotationMatrix ( m ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - var angle, x, y, z; // variables for result - var epsilon = 0.01, // margin to allow for rounding errors - epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees + var angle, x, y, z; // variables for result + var epsilon = 0.01, // margin to allow for rounding errors + epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees - te = m.elements, + te = m.elements, - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - if ( ( Math.abs( m12 - m21 ) < epsilon ) && + if ( ( Math.abs( m12 - m21 ) < epsilon ) && ( Math.abs( m13 - m31 ) < epsilon ) && ( Math.abs( m23 - m32 ) < epsilon ) ) { - // singularity found - // first check for identity matrix which must have +1 for all terms - // in leading diagonal and zero in other terms + // singularity found + // first check for identity matrix which must have +1 for all terms + // in leading diagonal and zero in other terms - if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && + if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && ( Math.abs( m13 + m31 ) < epsilon2 ) && ( Math.abs( m23 + m32 ) < epsilon2 ) && ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { - // this singularity is identity matrix so angle = 0 + // this singularity is identity matrix so angle = 0 - this.set( 1, 0, 0, 0 ); + this.set( 1, 0, 0, 0 ); - return this; // zero angle, arbitrary axis - - } + return this; // zero angle, arbitrary axis - // otherwise this singularity is angle = 180 + } - angle = Math.PI; + // otherwise this singularity is angle = 180 - var xx = ( m11 + 1 ) / 2; - var yy = ( m22 + 1 ) / 2; - var zz = ( m33 + 1 ) / 2; - var xy = ( m12 + m21 ) / 4; - var xz = ( m13 + m31 ) / 4; - var yz = ( m23 + m32 ) / 4; + angle = Math.PI; - if ( ( xx > yy ) && ( xx > zz ) ) { + var xx = ( m11 + 1 ) / 2; + var yy = ( m22 + 1 ) / 2; + var zz = ( m33 + 1 ) / 2; + var xy = ( m12 + m21 ) / 4; + var xz = ( m13 + m31 ) / 4; + var yz = ( m23 + m32 ) / 4; - // m11 is the largest diagonal term + if ( ( xx > yy ) && ( xx > zz ) ) { - if ( xx < epsilon ) { + // m11 is the largest diagonal term - x = 0; - y = 0.707106781; - z = 0.707106781; + if ( xx < epsilon ) { - } else { + x = 0; + y = 0.707106781; + z = 0.707106781; - x = Math.sqrt( xx ); - y = xy / x; - z = xz / x; + } else { - } + x = Math.sqrt( xx ); + y = xy / x; + z = xz / x; - } else if ( yy > zz ) { + } - // m22 is the largest diagonal term + } else if ( yy > zz ) { - if ( yy < epsilon ) { + // m22 is the largest diagonal term - x = 0.707106781; - y = 0; - z = 0.707106781; + if ( yy < epsilon ) { - } else { + x = 0.707106781; + y = 0; + z = 0.707106781; - y = Math.sqrt( yy ); - x = xy / y; - z = yz / y; + } else { - } + y = Math.sqrt( yy ); + x = xy / y; + z = yz / y; - } else { + } - // m33 is the largest diagonal term so base result on this + } else { - if ( zz < epsilon ) { + // m33 is the largest diagonal term so base result on this - x = 0.707106781; - y = 0.707106781; - z = 0; + if ( zz < epsilon ) { - } else { + x = 0.707106781; + y = 0.707106781; + z = 0; - z = Math.sqrt( zz ); - x = xz / z; - y = yz / z; + } else { - } + z = Math.sqrt( zz ); + x = xz / z; + y = yz / z; } - this.set( x, y, z, angle ); + } - return this; // return 180 deg rotation + this.set( x, y, z, angle ); - } + return this; // return 180 deg rotation - // as we have reached here there are no singularities so we can handle normally + } - var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + - ( m13 - m31 ) * ( m13 - m31 ) + - ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize + // as we have reached here there are no singularities so we can handle normally - if ( Math.abs( s ) < 0.001 ) { s = 1; } + var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + + ( m13 - m31 ) * ( m13 - m31 ) + + ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize - // prevent divide by zero, should not happen if matrix is orthogonal and should be - // caught by singularity test above, but I've left it in just in case + if ( Math.abs( s ) < 0.001 ) { s = 1; } - this.x = ( m32 - m23 ) / s; - this.y = ( m13 - m31 ) / s; - this.z = ( m21 - m12 ) / s; - this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); + // prevent divide by zero, should not happen if matrix is orthogonal and should be + // caught by singularity test above, but I've left it in just in case - return this; + this.x = ( m32 - m23 ) / s; + this.y = ( m13 - m31 ) / s; + this.z = ( m21 - m12 ) / s; + this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); - }, + return this; - min: function ( v ) { + }; - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); - this.w = Math.min( this.w, v.w ); + Vector4.prototype.min = function min ( v ) { - return this; + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); + this.w = Math.min( this.w, v.w ); - }, + return this; - max: function ( v ) { + }; - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); - this.w = Math.max( this.w, v.w ); + Vector4.prototype.max = function max ( v ) { - return this; + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); + this.w = Math.max( this.w, v.w ); - }, + return this; - clamp: function ( min, max ) { + }; - // assumes min < max, componentwise + Vector4.prototype.clamp = function clamp ( min, max ) { - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - this.w = Math.max( min.w, Math.min( max.w, this.w ) ); + // assumes min < max, componentwise - return this; + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + this.w = Math.max( min.w, Math.min( max.w, this.w ) ); - }, + return this; - clampScalar: function ( minVal, maxVal ) { + }; - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); - this.w = Math.max( minVal, Math.min( maxVal, this.w ) ); + Vector4.prototype.clampScalar = function clampScalar ( minVal, maxVal ) { - return this; + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); + this.w = Math.max( minVal, Math.min( maxVal, this.w ) ); - }, + return this; - clampLength: function ( min, max ) { + }; - var length = this.length(); + Vector4.prototype.clampLength = function clampLength ( min, max ) { - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + var length = this.length(); - }, + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - floor: function () { + }; - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); - this.w = Math.floor( this.w ); + Vector4.prototype.floor = function floor () { - return this; + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); + this.w = Math.floor( this.w ); - }, + return this; - ceil: function () { + }; - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); - this.w = Math.ceil( this.w ); + Vector4.prototype.ceil = function ceil () { - return this; + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); + this.w = Math.ceil( this.w ); - }, + return this; - round: function () { + }; - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); - this.w = Math.round( this.w ); + Vector4.prototype.round = function round () { - return this; + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); + this.w = Math.round( this.w ); - }, + return this; - roundToZero: function () { + }; - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); + Vector4.prototype.roundToZero = function roundToZero () { - return this; + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); - }, + return this; - negate: function () { + }; - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; - this.w = - this.w; + Vector4.prototype.negate = function negate () { - return this; + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; + this.w = - this.w; - }, + return this; - dot: function ( v ) { + }; - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + Vector4.prototype.dot = function dot ( v ) { - }, + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - lengthSq: function () { + }; - return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; + Vector4.prototype.lengthSq = function lengthSq () { - }, + return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; - length: function () { + }; - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); + Vector4.prototype.length = function length () { - }, + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - manhattanLength: function () { + }; - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); + Vector4.prototype.manhattanLength = function manhattanLength () { - }, + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); - normalize: function () { + }; - return this.divideScalar( this.length() || 1 ); + Vector4.prototype.normalize = function normalize () { - }, + return this.divideScalar( this.length() || 1 ); + + }; - setLength: function ( length ) { + Vector4.prototype.setLength = function setLength ( length ) { - return this.normalize().multiplyScalar( length ); + return this.normalize().multiplyScalar( length ); - }, + }; - lerp: function ( v, alpha ) { + Vector4.prototype.lerp = function lerp ( v, alpha ) { - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; - this.w += ( v.w - this.w ) * alpha; + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; + this.w += ( v.w - this.w ) * alpha; - return this; + return this; - }, + }; - lerpVectors: function ( v1, v2, alpha ) { + Vector4.prototype.lerpVectors = function lerpVectors ( v1, v2, alpha ) { - this.x = v1.x + ( v2.x - v1.x ) * alpha; - this.y = v1.y + ( v2.y - v1.y ) * alpha; - this.z = v1.z + ( v2.z - v1.z ) * alpha; - this.w = v1.w + ( v2.w - v1.w ) * alpha; + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; + this.w = v1.w + ( v2.w - v1.w ) * alpha; - return this; + return this; - }, + }; - equals: function ( v ) { + Vector4.prototype.equals = function equals ( v ) { - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); - }, + }; - fromArray: function ( array, offset ) { + Vector4.prototype.fromArray = function fromArray ( array, offset ) { - if ( offset === undefined ) { offset = 0; } + if ( offset === undefined ) { offset = 0; } - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; - this.w = array[ offset + 3 ]; + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; + this.w = array[ offset + 3 ]; - return this; + return this; - }, + }; - toArray: function ( array, offset ) { + Vector4.prototype.toArray = function toArray ( array, offset ) { - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; - array[ offset + 3 ] = this.w; + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; + array[ offset + 3 ] = this.w; - return array; + return array; - }, + }; - fromBufferAttribute: function ( attribute, index, offset ) { + Vector4.prototype.fromBufferAttribute = function fromBufferAttribute ( attribute, index, offset ) { - if ( offset !== undefined ) { + if ( offset !== undefined ) { - console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' ); + console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' ); - } + } - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); - this.w = attribute.getW( index ); + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); + this.w = attribute.getW( index ); - return this; + return this; - }, + }; - random: function () { + Vector4.prototype.random = function random () { - this.x = Math.random(); - this.y = Math.random(); - this.z = Math.random(); - this.w = Math.random(); + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); + this.w = Math.random(); - return this; + return this; - } + }; - } ); + Object.defineProperties( Vector4.prototype, prototypeAccessors$1 ); + + Vector4.prototype.isVector4 = true; /* In options, we can specify: @@ -2502,7 +2477,7 @@ this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; - this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; + this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false; this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; } @@ -2589,7 +2564,7 @@ } ); - function Quaternion( x, y, z, w ) { + var Quaternion = function Quaternion( x, y, z, w ) { if ( x === void 0 ) x = 0; if ( y === void 0 ) y = 0; if ( z === void 0 ) z = 0; @@ -2601,5027 +2576,4901 @@ this._z = z; this._w = w; - } - - Object.assign( Quaternion, { + }; - slerp: function ( qa, qb, qm, t ) { + var prototypeAccessors$2 = { x: { configurable: true },y: { configurable: true },z: { configurable: true },w: { configurable: true } }; - return qm.copy( qa ).slerp( qb, t ); + Quaternion.slerp = function slerp ( qa, qb, qm, t ) { - }, + return qm.copy( qa ).slerp( qb, t ); - slerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { + }; - // fuzz-free, array-based Quaternion SLERP operation + Quaternion.slerpFlat = function slerpFlat ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { - var x0 = src0[ srcOffset0 + 0 ], - y0 = src0[ srcOffset0 + 1 ], - z0 = src0[ srcOffset0 + 2 ], - w0 = src0[ srcOffset0 + 3 ]; + // fuzz-free, array-based Quaternion SLERP operation - var x1 = src1[ srcOffset1 + 0 ], - y1 = src1[ srcOffset1 + 1 ], - z1 = src1[ srcOffset1 + 2 ], - w1 = src1[ srcOffset1 + 3 ]; + var x0 = src0[ srcOffset0 + 0 ], + y0 = src0[ srcOffset0 + 1 ], + z0 = src0[ srcOffset0 + 2 ], + w0 = src0[ srcOffset0 + 3 ]; - if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { + var x1 = src1[ srcOffset1 + 0 ], + y1 = src1[ srcOffset1 + 1 ], + z1 = src1[ srcOffset1 + 2 ], + w1 = src1[ srcOffset1 + 3 ]; - var s = 1 - t; - var cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, - dir = ( cos >= 0 ? 1 : - 1 ), - sqrSin = 1 - cos * cos; + if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { - // Skip the Slerp for tiny steps to avoid numeric problems: - if ( sqrSin > Number.EPSILON ) { + var s = 1 - t; + var cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, + dir = ( cos >= 0 ? 1 : - 1 ), + sqrSin = 1 - cos * cos; - var sin = Math.sqrt( sqrSin ), - len = Math.atan2( sin, cos * dir ); + // Skip the Slerp for tiny steps to avoid numeric problems: + if ( sqrSin > Number.EPSILON ) { - s = Math.sin( s * len ) / sin; - t = Math.sin( t * len ) / sin; + var sin = Math.sqrt( sqrSin ), + len = Math.atan2( sin, cos * dir ); - } + s = Math.sin( s * len ) / sin; + t = Math.sin( t * len ) / sin; - var tDir = t * dir; + } - x0 = x0 * s + x1 * tDir; - y0 = y0 * s + y1 * tDir; - z0 = z0 * s + z1 * tDir; - w0 = w0 * s + w1 * tDir; + var tDir = t * dir; - // Normalize in case we just did a lerp: - if ( s === 1 - t ) { + x0 = x0 * s + x1 * tDir; + y0 = y0 * s + y1 * tDir; + z0 = z0 * s + z1 * tDir; + w0 = w0 * s + w1 * tDir; - var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); + // Normalize in case we just did a lerp: + if ( s === 1 - t ) { - x0 *= f; - y0 *= f; - z0 *= f; - w0 *= f; + var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); - } + x0 *= f; + y0 *= f; + z0 *= f; + w0 *= f; } - dst[ dstOffset ] = x0; - dst[ dstOffset + 1 ] = y0; - dst[ dstOffset + 2 ] = z0; - dst[ dstOffset + 3 ] = w0; + } - }, + dst[ dstOffset ] = x0; + dst[ dstOffset + 1 ] = y0; + dst[ dstOffset + 2 ] = z0; + dst[ dstOffset + 3 ] = w0; - multiplyQuaternionsFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { + }; - var x0 = src0[ srcOffset0 ]; - var y0 = src0[ srcOffset0 + 1 ]; - var z0 = src0[ srcOffset0 + 2 ]; - var w0 = src0[ srcOffset0 + 3 ]; + Quaternion.multiplyQuaternionsFlat = function multiplyQuaternionsFlat ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { - var x1 = src1[ srcOffset1 ]; - var y1 = src1[ srcOffset1 + 1 ]; - var z1 = src1[ srcOffset1 + 2 ]; - var w1 = src1[ srcOffset1 + 3 ]; + var x0 = src0[ srcOffset0 ]; + var y0 = src0[ srcOffset0 + 1 ]; + var z0 = src0[ srcOffset0 + 2 ]; + var w0 = src0[ srcOffset0 + 3 ]; - dst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; - dst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; - dst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; - dst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; + var x1 = src1[ srcOffset1 ]; + var y1 = src1[ srcOffset1 + 1 ]; + var z1 = src1[ srcOffset1 + 2 ]; + var w1 = src1[ srcOffset1 + 3 ]; - return dst; + dst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; + dst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; + dst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; + dst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; - } + return dst; - } ); + }; - Object.defineProperties( Quaternion.prototype, { + prototypeAccessors$2.x.get = function () { - x: { + return this._x; - get: function () { + }; - return this._x; + prototypeAccessors$2.x.set = function ( value ) { - }, + this._x = value; + this._onChangeCallback(); - set: function ( value ) { + }; - this._x = value; - this._onChangeCallback(); + prototypeAccessors$2.y.get = function () { - } + return this._y; - }, + }; - y: { + prototypeAccessors$2.y.set = function ( value ) { - get: function () { + this._y = value; + this._onChangeCallback(); - return this._y; + }; - }, + prototypeAccessors$2.z.get = function () { - set: function ( value ) { + return this._z; - this._y = value; - this._onChangeCallback(); + }; - } + prototypeAccessors$2.z.set = function ( value ) { - }, + this._z = value; + this._onChangeCallback(); - z: { + }; - get: function () { + prototypeAccessors$2.w.get = function () { - return this._z; + return this._w; - }, + }; - set: function ( value ) { + prototypeAccessors$2.w.set = function ( value ) { - this._z = value; - this._onChangeCallback(); + this._w = value; + this._onChangeCallback(); - } + }; - }, + Quaternion.prototype.set = function set ( x, y, z, w ) { - w: { + this._x = x; + this._y = y; + this._z = z; + this._w = w; - get: function () { + this._onChangeCallback(); - return this._w; + return this; - }, + }; - set: function ( value ) { + Quaternion.prototype.clone = function clone () { - this._w = value; - this._onChangeCallback(); + return new this.constructor( this._x, this._y, this._z, this._w ); - } + }; - } + Quaternion.prototype.copy = function copy ( quaternion ) { - } ); + this._x = quaternion.x; + this._y = quaternion.y; + this._z = quaternion.z; + this._w = quaternion.w; - Object.assign( Quaternion.prototype, { + this._onChangeCallback(); - isQuaternion: true, + return this; - set: function ( x, y, z, w ) { + }; - this._x = x; - this._y = y; - this._z = z; - this._w = w; + Quaternion.prototype.setFromEuler = function setFromEuler ( euler, update ) { - this._onChangeCallback(); + if ( ! ( euler && euler.isEuler ) ) { - return this; + throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); - }, + } - clone: function () { + var x = euler._x, y = euler._y, z = euler._z, order = euler._order; - return new this.constructor( this._x, this._y, this._z, this._w ); + // http://www.mathworks.com/matlabcentral/fileexchange/ + // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ + //content/SpinCalc.m - }, + var cos = Math.cos; + var sin = Math.sin; - copy: function ( quaternion ) { + var c1 = cos( x / 2 ); + var c2 = cos( y / 2 ); + var c3 = cos( z / 2 ); - this._x = quaternion.x; - this._y = quaternion.y; - this._z = quaternion.z; - this._w = quaternion.w; + var s1 = sin( x / 2 ); + var s2 = sin( y / 2 ); + var s3 = sin( z / 2 ); - this._onChangeCallback(); + switch ( order ) { - return this; + case 'XYZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - }, + case 'YXZ': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - setFromEuler: function ( euler, update ) { + case 'ZXY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - if ( ! ( euler && euler.isEuler ) ) { + case 'ZYX': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + case 'YZX': + this._x = s1 * c2 * c3 + c1 * s2 * s3; + this._y = c1 * s2 * c3 + s1 * c2 * s3; + this._z = c1 * c2 * s3 - s1 * s2 * c3; + this._w = c1 * c2 * c3 - s1 * s2 * s3; + break; - } + case 'XZY': + this._x = s1 * c2 * c3 - c1 * s2 * s3; + this._y = c1 * s2 * c3 - s1 * c2 * s3; + this._z = c1 * c2 * s3 + s1 * s2 * c3; + this._w = c1 * c2 * c3 + s1 * s2 * s3; + break; - var x = euler._x, y = euler._y, z = euler._z, order = euler.order; + default: + console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order ); - // http://www.mathworks.com/matlabcentral/fileexchange/ - // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ - // content/SpinCalc.m + } - var cos = Math.cos; - var sin = Math.sin; + if ( update !== false ) { this._onChangeCallback(); } - var c1 = cos( x / 2 ); - var c2 = cos( y / 2 ); - var c3 = cos( z / 2 ); + return this; - var s1 = sin( x / 2 ); - var s2 = sin( y / 2 ); - var s3 = sin( z / 2 ); + }; - switch ( order ) { + Quaternion.prototype.setFromAxisAngle = function setFromAxisAngle ( axis, angle ) { - case 'XYZ': - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm - case 'YXZ': - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; + // assumes axis is normalized - case 'ZXY': - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; + var halfAngle = angle / 2, s = Math.sin( halfAngle ); - case 'ZYX': - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; + this._x = axis.x * s; + this._y = axis.y * s; + this._z = axis.z * s; + this._w = Math.cos( halfAngle ); - case 'YZX': - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; + this._onChangeCallback(); - case 'XZY': - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; + return this; - default: - console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order ); + }; - } + Quaternion.prototype.setFromRotationMatrix = function setFromRotationMatrix ( m ) { - if ( update !== false ) { this._onChangeCallback(); } + // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm - return this; + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - }, + var te = m.elements, - setFromAxisAngle: function ( axis, angle ) { + m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], + m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], + m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm + trace = m11 + m22 + m33; - // assumes axis is normalized + if ( trace > 0 ) { - var halfAngle = angle / 2, s = Math.sin( halfAngle ); + var s = 0.5 / Math.sqrt( trace + 1.0 ); - this._x = axis.x * s; - this._y = axis.y * s; - this._z = axis.z * s; - this._w = Math.cos( halfAngle ); + this._w = 0.25 / s; + this._x = ( m32 - m23 ) * s; + this._y = ( m13 - m31 ) * s; + this._z = ( m21 - m12 ) * s; - this._onChangeCallback(); + } else if ( m11 > m22 && m11 > m33 ) { - return this; + var s$1 = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); - }, + this._w = ( m32 - m23 ) / s$1; + this._x = 0.25 * s$1; + this._y = ( m12 + m21 ) / s$1; + this._z = ( m13 + m31 ) / s$1; - setFromRotationMatrix: function ( m ) { + } else if ( m22 > m33 ) { - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm + var s$2 = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + this._w = ( m13 - m31 ) / s$2; + this._x = ( m12 + m21 ) / s$2; + this._y = 0.25 * s$2; + this._z = ( m23 + m32 ) / s$2; + + } else { - var te = m.elements, + var s$3 = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], + this._w = ( m21 - m12 ) / s$3; + this._x = ( m13 + m31 ) / s$3; + this._y = ( m23 + m32 ) / s$3; + this._z = 0.25 * s$3; - trace = m11 + m22 + m33; + } - if ( trace > 0 ) { + this._onChangeCallback(); - var s = 0.5 / Math.sqrt( trace + 1.0 ); + return this; - this._w = 0.25 / s; - this._x = ( m32 - m23 ) * s; - this._y = ( m13 - m31 ) * s; - this._z = ( m21 - m12 ) * s; + }; - } else if ( m11 > m22 && m11 > m33 ) { + Quaternion.prototype.setFromUnitVectors = function setFromUnitVectors ( vFrom, vTo ) { - var s$1 = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); + // assumes direction vectors vFrom and vTo are normalized - this._w = ( m32 - m23 ) / s$1; - this._x = 0.25 * s$1; - this._y = ( m12 + m21 ) / s$1; - this._z = ( m13 + m31 ) / s$1; + var EPS = 0.000001; - } else if ( m22 > m33 ) { + var r = vFrom.dot( vTo ) + 1; - var s$2 = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); + if ( r < EPS ) { - this._w = ( m13 - m31 ) / s$2; - this._x = ( m12 + m21 ) / s$2; - this._y = 0.25 * s$2; - this._z = ( m23 + m32 ) / s$2; + r = 0; - } else { + if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { - var s$3 = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); + this._x = - vFrom.y; + this._y = vFrom.x; + this._z = 0; + this._w = r; + + } else { - this._w = ( m21 - m12 ) / s$3; - this._x = ( m13 + m31 ) / s$3; - this._y = ( m23 + m32 ) / s$3; - this._z = 0.25 * s$3; + this._x = 0; + this._y = - vFrom.z; + this._z = vFrom.y; + this._w = r; } - this._onChangeCallback(); + } else { - return this; + // crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3 - }, + this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; + this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; + this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; + this._w = r; - setFromUnitVectors: function ( vFrom, vTo ) { + } - // assumes direction vectors vFrom and vTo are normalized + return this.normalize(); - var EPS = 0.000001; + }; - var r = vFrom.dot( vTo ) + 1; + Quaternion.prototype.angleTo = function angleTo ( q ) { - if ( r < EPS ) { + return 2 * Math.acos( Math.abs( MathUtils.clamp( this.dot( q ), - 1, 1 ) ) ); - r = 0; + }; - if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { + Quaternion.prototype.rotateTowards = function rotateTowards ( q, step ) { - this._x = - vFrom.y; - this._y = vFrom.x; - this._z = 0; - this._w = r; + var angle = this.angleTo( q ); - } else { + if ( angle === 0 ) { return this; } - this._x = 0; - this._y = - vFrom.z; - this._z = vFrom.y; - this._w = r; + var t = Math.min( 1, step / angle ); - } + this.slerp( q, t ); - } else { + return this; - // crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3 + }; - this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; - this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; - this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; - this._w = r; + Quaternion.prototype.identity = function identity () { - } + return this.set( 0, 0, 0, 1 ); - return this.normalize(); + }; - }, + Quaternion.prototype.inverse = function inverse () { - angleTo: function ( q ) { + // quaternion is assumed to have unit length - return 2 * Math.acos( Math.abs( MathUtils.clamp( this.dot( q ), - 1, 1 ) ) ); + return this.conjugate(); - }, + }; - rotateTowards: function ( q, step ) { + Quaternion.prototype.conjugate = function conjugate () { - var angle = this.angleTo( q ); + this._x *= - 1; + this._y *= - 1; + this._z *= - 1; - if ( angle === 0 ) { return this; } + this._onChangeCallback(); - var t = Math.min( 1, step / angle ); + return this; - this.slerp( q, t ); + }; - return this; + Quaternion.prototype.dot = function dot ( v ) { - }, + return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; - identity: function () { + }; - return this.set( 0, 0, 0, 1 ); + Quaternion.prototype.lengthSq = function lengthSq () { - }, + return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; - inverse: function () { + }; - // quaternion is assumed to have unit length + Quaternion.prototype.length = function length () { - return this.conjugate(); + return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); - }, + }; - conjugate: function () { + Quaternion.prototype.normalize = function normalize () { - this._x *= - 1; - this._y *= - 1; - this._z *= - 1; + var l = this.length(); - this._onChangeCallback(); + if ( l === 0 ) { - return this; + this._x = 0; + this._y = 0; + this._z = 0; + this._w = 1; - }, + } else { - dot: function ( v ) { + l = 1 / l; - return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; + this._x = this._x * l; + this._y = this._y * l; + this._z = this._z * l; + this._w = this._w * l; - }, + } - lengthSq: function () { + this._onChangeCallback(); - return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; + return this; - }, + }; - length: function () { + Quaternion.prototype.multiply = function multiply ( q, p ) { - return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); + if ( p !== undefined ) { - }, + console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); + return this.multiplyQuaternions( q, p ); - normalize: function () { + } + + return this.multiplyQuaternions( this, q ); - var l = this.length(); + }; - if ( l === 0 ) { + Quaternion.prototype.premultiply = function premultiply ( q ) { - this._x = 0; - this._y = 0; - this._z = 0; - this._w = 1; + return this.multiplyQuaternions( q, this ); - } else { + }; - l = 1 / l; + Quaternion.prototype.multiplyQuaternions = function multiplyQuaternions ( a, b ) { - this._x = this._x * l; - this._y = this._y * l; - this._z = this._z * l; - this._w = this._w * l; + // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm - } + var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; + var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; - this._onChangeCallback(); + this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - return this; + this._onChangeCallback(); - }, + return this; - multiply: function ( q, p ) { + }; - if ( p !== undefined ) { + Quaternion.prototype.slerp = function slerp ( qb, t ) { - console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); - return this.multiplyQuaternions( q, p ); + if ( t === 0 ) { return this; } + if ( t === 1 ) { return this.copy( qb ); } - } + var x = this._x, y = this._y, z = this._z, w = this._w; - return this.multiplyQuaternions( this, q ); + // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ - }, + var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; - premultiply: function ( q ) { + if ( cosHalfTheta < 0 ) { - return this.multiplyQuaternions( q, this ); + this._w = - qb._w; + this._x = - qb._x; + this._y = - qb._y; + this._z = - qb._z; - }, + cosHalfTheta = - cosHalfTheta; - multiplyQuaternions: function ( a, b ) { + } else { - // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm + this.copy( qb ); - var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; - var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; + } - this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; + if ( cosHalfTheta >= 1.0 ) { - this._onChangeCallback(); + this._w = w; + this._x = x; + this._y = y; + this._z = z; return this; - }, + } - slerp: function ( qb, t ) { + var sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; - if ( t === 0 ) { return this; } - if ( t === 1 ) { return this.copy( qb ); } + if ( sqrSinHalfTheta <= Number.EPSILON ) { - var x = this._x, y = this._y, z = this._z, w = this._w; + var s = 1 - t; + this._w = s * w + t * this._w; + this._x = s * x + t * this._x; + this._y = s * y + t * this._y; + this._z = s * z + t * this._z; - // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ + this.normalize(); + this._onChangeCallback(); - var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; + return this; - if ( cosHalfTheta < 0 ) { + } - this._w = - qb._w; - this._x = - qb._x; - this._y = - qb._y; - this._z = - qb._z; + var sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); + var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); + var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, + ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; - cosHalfTheta = - cosHalfTheta; + this._w = ( w * ratioA + this._w * ratioB ); + this._x = ( x * ratioA + this._x * ratioB ); + this._y = ( y * ratioA + this._y * ratioB ); + this._z = ( z * ratioA + this._z * ratioB ); - } else { + this._onChangeCallback(); - this.copy( qb ); + return this; - } + }; - if ( cosHalfTheta >= 1.0 ) { + Quaternion.prototype.equals = function equals ( quaternion ) { - this._w = w; - this._x = x; - this._y = y; - this._z = z; + return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); - return this; + }; - } + Quaternion.prototype.fromArray = function fromArray ( array, offset ) { - var sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; + if ( offset === undefined ) { offset = 0; } - if ( sqrSinHalfTheta <= Number.EPSILON ) { + this._x = array[ offset ]; + this._y = array[ offset + 1 ]; + this._z = array[ offset + 2 ]; + this._w = array[ offset + 3 ]; - var s = 1 - t; - this._w = s * w + t * this._w; - this._x = s * x + t * this._x; - this._y = s * y + t * this._y; - this._z = s * z + t * this._z; + this._onChangeCallback(); - this.normalize(); - this._onChangeCallback(); + return this; - return this; + }; - } + Quaternion.prototype.toArray = function toArray ( array, offset ) { - var sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); - var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); - var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, - ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - this._w = ( w * ratioA + this._w * ratioB ); - this._x = ( x * ratioA + this._x * ratioB ); - this._y = ( y * ratioA + this._y * ratioB ); - this._z = ( z * ratioA + this._z * ratioB ); + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._w; - this._onChangeCallback(); + return array; - return this; + }; - }, + Quaternion.prototype.fromBufferAttribute = function fromBufferAttribute ( attribute, index ) { - equals: function ( quaternion ) { + this._x = attribute.getX( index ); + this._y = attribute.getY( index ); + this._z = attribute.getZ( index ); + this._w = attribute.getW( index ); - return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); + return this; - }, + }; - fromArray: function ( array, offset ) { + Quaternion.prototype._onChange = function _onChange ( callback ) { - if ( offset === undefined ) { offset = 0; } + this._onChangeCallback = callback; - this._x = array[ offset ]; - this._y = array[ offset + 1 ]; - this._z = array[ offset + 2 ]; - this._w = array[ offset + 3 ]; + return this; - this._onChangeCallback(); + }; - return this; + Quaternion.prototype._onChangeCallback = function _onChangeCallback () {}; - }, + Object.defineProperties( Quaternion.prototype, prototypeAccessors$2 ); - toArray: function ( array, offset ) { + Quaternion.prototype.isQuaternion = true; - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + var Vector3 = function Vector3( x, y, z ) { + if ( x === void 0 ) x = 0; + if ( y === void 0 ) y = 0; + if ( z === void 0 ) z = 0; - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._w; - return array; + this.x = x; + this.y = y; + this.z = z; - }, + }; - fromBufferAttribute: function ( attribute, index ) { + Vector3.prototype.set = function set ( x, y, z ) { - this._x = attribute.getX( index ); - this._y = attribute.getY( index ); - this._z = attribute.getZ( index ); - this._w = attribute.getW( index ); + if ( z === undefined ) { z = this.z; } // sprite.scale.set(x,y) - return this; + this.x = x; + this.y = y; + this.z = z; - }, + return this; - _onChange: function ( callback ) { + }; - this._onChangeCallback = callback; + Vector3.prototype.setScalar = function setScalar ( scalar ) { - return this; + this.x = scalar; + this.y = scalar; + this.z = scalar; - }, + return this; - _onChangeCallback: function () {} + }; - } ); + Vector3.prototype.setX = function setX ( x ) { - var _vector = new Vector3(); - var _quaternion = new Quaternion(); + this.x = x; - function Vector3( x, y, z ) { - if ( x === void 0 ) x = 0; - if ( y === void 0 ) y = 0; - if ( z === void 0 ) z = 0; + return this; + + }; + Vector3.prototype.setY = function setY ( y ) { - this.x = x; this.y = y; - this.z = z; - } + return this; - Object.assign( Vector3.prototype, { + }; - isVector3: true, + Vector3.prototype.setZ = function setZ ( z ) { - set: function ( x, y, z ) { + this.z = z; - if ( z === undefined ) { z = this.z; } // sprite.scale.set(x,y) + return this; - this.x = x; - this.y = y; - this.z = z; + }; - return this; + Vector3.prototype.setComponent = function setComponent ( index, value ) { - }, + switch ( index ) { - setScalar: function ( scalar ) { + case 0: this.x = value; break; + case 1: this.y = value; break; + case 2: this.z = value; break; + default: throw new Error( 'index is out of range: ' + index ); - this.x = scalar; - this.y = scalar; - this.z = scalar; + } - return this; + return this; - }, + }; - setX: function ( x ) { + Vector3.prototype.getComponent = function getComponent ( index ) { - this.x = x; + switch ( index ) { - return this; + case 0: return this.x; + case 1: return this.y; + case 2: return this.z; + default: throw new Error( 'index is out of range: ' + index ); - }, + } - setY: function ( y ) { + }; - this.y = y; + Vector3.prototype.clone = function clone () { - return this; + return new this.constructor( this.x, this.y, this.z ); - }, + }; - setZ: function ( z ) { + Vector3.prototype.copy = function copy ( v ) { - this.z = z; + this.x = v.x; + this.y = v.y; + this.z = v.z; - return this; + return this; - }, + }; - setComponent: function ( index, value ) { + Vector3.prototype.add = function add ( v, w ) { - switch ( index ) { + if ( w !== undefined ) { - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - default: throw new Error( 'index is out of range: ' + index ); + console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); + return this.addVectors( v, w ); - } + } - return this; + this.x += v.x; + this.y += v.y; + this.z += v.z; - }, + return this; - getComponent: function ( index ) { + }; - switch ( index ) { + Vector3.prototype.addScalar = function addScalar ( s ) { - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - default: throw new Error( 'index is out of range: ' + index ); + this.x += s; + this.y += s; + this.z += s; - } + return this; - }, + }; - clone: function () { + Vector3.prototype.addVectors = function addVectors ( a, b ) { - return new this.constructor( this.x, this.y, this.z ); + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; - }, + return this; - copy: function ( v ) { + }; - this.x = v.x; - this.y = v.y; - this.z = v.z; + Vector3.prototype.addScaledVector = function addScaledVector ( v, s ) { - return this; + this.x += v.x * s; + this.y += v.y * s; + this.z += v.z * s; - }, + return this; - add: function ( v, w ) { + }; - if ( w !== undefined ) { + Vector3.prototype.sub = function sub ( v, w ) { - console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); + if ( w !== undefined ) { - } + console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); + return this.subVectors( v, w ); - this.x += v.x; - this.y += v.y; - this.z += v.z; + } - return this; - - }, + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; - addScalar: function ( s ) { + return this; - this.x += s; - this.y += s; - this.z += s; + }; - return this; + Vector3.prototype.subScalar = function subScalar ( s ) { - }, + this.x -= s; + this.y -= s; + this.z -= s; - addVectors: function ( a, b ) { + return this; - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; + }; - return this; + Vector3.prototype.subVectors = function subVectors ( a, b ) { - }, + this.x = a.x - b.x; + this.y = a.y - b.y; + this.z = a.z - b.z; - addScaledVector: function ( v, s ) { + return this; - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; + }; - return this; + Vector3.prototype.multiply = function multiply ( v, w ) { - }, + if ( w !== undefined ) { - sub: function ( v, w ) { + console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); + return this.multiplyVectors( v, w ); - if ( w !== undefined ) { + } - console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); + this.x *= v.x; + this.y *= v.y; + this.z *= v.z; - } + return this; - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; + }; - return this; + Vector3.prototype.multiplyScalar = function multiplyScalar ( scalar ) { - }, + this.x *= scalar; + this.y *= scalar; + this.z *= scalar; - subScalar: function ( s ) { + return this; - this.x -= s; - this.y -= s; - this.z -= s; + }; - return this; + Vector3.prototype.multiplyVectors = function multiplyVectors ( a, b ) { - }, + this.x = a.x * b.x; + this.y = a.y * b.y; + this.z = a.z * b.z; - subVectors: function ( a, b ) { + return this; - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; + }; - return this; + Vector3.prototype.applyEuler = function applyEuler ( euler ) { - }, + if ( ! ( euler && euler.isEuler ) ) { - multiply: function ( v, w ) { + console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); - if ( w !== undefined ) { + } - console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); - return this.multiplyVectors( v, w ); + return this.applyQuaternion( _quaternion.setFromEuler( euler ) ); - } + }; - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; + Vector3.prototype.applyAxisAngle = function applyAxisAngle ( axis, angle ) { - return this; + return this.applyQuaternion( _quaternion.setFromAxisAngle( axis, angle ) ); - }, + }; - multiplyScalar: function ( scalar ) { + Vector3.prototype.applyMatrix3 = function applyMatrix3 ( m ) { - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; + var x = this.x, y = this.y, z = this.z; + var e = m.elements; - return this; + this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; + this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; + this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; - }, + return this; - multiplyVectors: function ( a, b ) { + }; - this.x = a.x * b.x; - this.y = a.y * b.y; - this.z = a.z * b.z; + Vector3.prototype.applyNormalMatrix = function applyNormalMatrix ( m ) { - return this; + return this.applyMatrix3( m ).normalize(); - }, + }; - applyEuler: function ( euler ) { + Vector3.prototype.applyMatrix4 = function applyMatrix4 ( m ) { - if ( ! ( euler && euler.isEuler ) ) { + var x = this.x, y = this.y, z = this.z; + var e = m.elements; - console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); + var w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); - } + this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; + this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; + this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; - return this.applyQuaternion( _quaternion.setFromEuler( euler ) ); + return this; - }, + }; - applyAxisAngle: function ( axis, angle ) { + Vector3.prototype.applyQuaternion = function applyQuaternion ( q ) { - return this.applyQuaternion( _quaternion.setFromAxisAngle( axis, angle ) ); + var x = this.x, y = this.y, z = this.z; + var qx = q.x, qy = q.y, qz = q.z, qw = q.w; - }, + // calculate quat * vector - applyMatrix3: function ( m ) { + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = - qx * x - qy * y - qz * z; - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + // calculate result * inverse quat - this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; - this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; - this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; + this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; + this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; + this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; - return this; + return this; - }, + }; - applyNormalMatrix: function ( m ) { + Vector3.prototype.project = function project ( camera ) { - return this.applyMatrix3( m ).normalize(); + return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); - }, + }; - applyMatrix4: function ( m ) { + Vector3.prototype.unproject = function unproject ( camera ) { - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); - var w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); + }; - this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; - this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; - this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; + Vector3.prototype.transformDirection = function transformDirection ( m ) { - return this; + // input: THREE.Matrix4 affine matrix + // vector interpreted as a direction - }, + var x = this.x, y = this.y, z = this.z; + var e = m.elements; - applyQuaternion: function ( q ) { + this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; + this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; + this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; - var x = this.x, y = this.y, z = this.z; - var qx = q.x, qy = q.y, qz = q.z, qw = q.w; + return this.normalize(); - // calculate quat * vector + }; - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = - qx * x - qy * y - qz * z; + Vector3.prototype.divide = function divide ( v ) { - // calculate result * inverse quat + this.x /= v.x; + this.y /= v.y; + this.z /= v.z; - this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; - this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; - this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; + return this; - return this; + }; - }, + Vector3.prototype.divideScalar = function divideScalar ( scalar ) { - project: function ( camera ) { + return this.multiplyScalar( 1 / scalar ); - return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); + }; - }, + Vector3.prototype.min = function min ( v ) { - unproject: function ( camera ) { + this.x = Math.min( this.x, v.x ); + this.y = Math.min( this.y, v.y ); + this.z = Math.min( this.z, v.z ); - return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); + return this; - }, + }; - transformDirection: function ( m ) { + Vector3.prototype.max = function max ( v ) { - // input: THREE.Matrix4 affine matrix - // vector interpreted as a direction + this.x = Math.max( this.x, v.x ); + this.y = Math.max( this.y, v.y ); + this.z = Math.max( this.z, v.z ); - var x = this.x, y = this.y, z = this.z; - var e = m.elements; + return this; - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; + }; - return this.normalize(); + Vector3.prototype.clamp = function clamp ( min, max ) { - }, + // assumes min < max, componentwise - divide: function ( v ) { + this.x = Math.max( min.x, Math.min( max.x, this.x ) ); + this.y = Math.max( min.y, Math.min( max.y, this.y ) ); + this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; + return this; - return this; + }; - }, + Vector3.prototype.clampScalar = function clampScalar ( minVal, maxVal ) { - divideScalar: function ( scalar ) { + this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); + this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); + this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); - return this.multiplyScalar( 1 / scalar ); + return this; - }, + }; - min: function ( v ) { + Vector3.prototype.clampLength = function clampLength ( min, max ) { - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); + var length = this.length(); - return this; + return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - }, + }; - max: function ( v ) { + Vector3.prototype.floor = function floor () { - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); + this.x = Math.floor( this.x ); + this.y = Math.floor( this.y ); + this.z = Math.floor( this.z ); - return this; + return this; - }, + }; - clamp: function ( min, max ) { + Vector3.prototype.ceil = function ceil () { - // assumes min < max, componentwise + this.x = Math.ceil( this.x ); + this.y = Math.ceil( this.y ); + this.z = Math.ceil( this.z ); - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); + return this; - return this; + }; - }, + Vector3.prototype.round = function round () { - clampScalar: function ( minVal, maxVal ) { + this.x = Math.round( this.x ); + this.y = Math.round( this.y ); + this.z = Math.round( this.z ); - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); + return this; - return this; + }; - }, + Vector3.prototype.roundToZero = function roundToZero () { - clampLength: function ( min, max ) { + this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); + this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); + this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - var length = this.length(); + return this; - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); + }; - }, + Vector3.prototype.negate = function negate () { - floor: function () { + this.x = - this.x; + this.y = - this.y; + this.z = - this.z; - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); + return this; - return this; + }; - }, + Vector3.prototype.dot = function dot ( v ) { - ceil: function () { + return this.x * v.x + this.y * v.y + this.z * v.z; - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); + }; - return this; + // TODO lengthSquared? - }, + Vector3.prototype.lengthSq = function lengthSq () { - round: function () { + return this.x * this.x + this.y * this.y + this.z * this.z; - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); + }; - return this; + Vector3.prototype.length = function length () { - }, + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); - roundToZero: function () { + }; - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); + Vector3.prototype.manhattanLength = function manhattanLength () { - return this; + return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); - }, + }; - negate: function () { + Vector3.prototype.normalize = function normalize () { - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; + return this.divideScalar( this.length() || 1 ); - return this; + }; - }, + Vector3.prototype.setLength = function setLength ( length ) { - dot: function ( v ) { + return this.normalize().multiplyScalar( length ); - return this.x * v.x + this.y * v.y + this.z * v.z; + }; - }, + Vector3.prototype.lerp = function lerp ( v, alpha ) { - // TODO lengthSquared? + this.x += ( v.x - this.x ) * alpha; + this.y += ( v.y - this.y ) * alpha; + this.z += ( v.z - this.z ) * alpha; - lengthSq: function () { + return this; - return this.x * this.x + this.y * this.y + this.z * this.z; + }; - }, + Vector3.prototype.lerpVectors = function lerpVectors ( v1, v2, alpha ) { - length: function () { + this.x = v1.x + ( v2.x - v1.x ) * alpha; + this.y = v1.y + ( v2.y - v1.y ) * alpha; + this.z = v1.z + ( v2.z - v1.z ) * alpha; - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); + return this; - }, + }; - manhattanLength: function () { + Vector3.prototype.cross = function cross ( v, w ) { - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); + if ( w !== undefined ) { - }, + console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); + return this.crossVectors( v, w ); - normalize: function () { + } - return this.divideScalar( this.length() || 1 ); + return this.crossVectors( this, v ); - }, + }; - setLength: function ( length ) { + Vector3.prototype.crossVectors = function crossVectors ( a, b ) { - return this.normalize().multiplyScalar( length ); + var ax = a.x, ay = a.y, az = a.z; + var bx = b.x, by = b.y, bz = b.z; - }, + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; - lerp: function ( v, alpha ) { + return this; - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; + }; - return this; + Vector3.prototype.projectOnVector = function projectOnVector ( v ) { - }, + var denominator = v.lengthSq(); - lerpVectors: function ( v1, v2, alpha ) { + if ( denominator === 0 ) { return this.set( 0, 0, 0 ); } - this.x = v1.x + ( v2.x - v1.x ) * alpha; - this.y = v1.y + ( v2.y - v1.y ) * alpha; - this.z = v1.z + ( v2.z - v1.z ) * alpha; + var scalar = v.dot( this ) / denominator; - return this; + return this.copy( v ).multiplyScalar( scalar ); - }, + }; - cross: function ( v, w ) { + Vector3.prototype.projectOnPlane = function projectOnPlane ( planeNormal ) { - if ( w !== undefined ) { + _vector.copy( this ).projectOnVector( planeNormal ); - console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); - return this.crossVectors( v, w ); + return this.sub( _vector ); - } + }; - return this.crossVectors( this, v ); + Vector3.prototype.reflect = function reflect ( normal ) { - }, + // reflect incident vector off plane orthogonal to normal + // normal is assumed to have unit length - crossVectors: function ( a, b ) { + return this.sub( _vector.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); - var ax = a.x, ay = a.y, az = a.z; - var bx = b.x, by = b.y, bz = b.z; + }; - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; + Vector3.prototype.angleTo = function angleTo ( v ) { - return this; + var denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); - }, + if ( denominator === 0 ) { return Math.PI / 2; } - projectOnVector: function ( v ) { + var theta = this.dot( v ) / denominator; - var denominator = v.lengthSq(); + // clamp, to handle numerical problems - if ( denominator === 0 ) { return this.set( 0, 0, 0 ); } + return Math.acos( MathUtils.clamp( theta, - 1, 1 ) ); - var scalar = v.dot( this ) / denominator; + }; - return this.copy( v ).multiplyScalar( scalar ); + Vector3.prototype.distanceTo = function distanceTo ( v ) { - }, + return Math.sqrt( this.distanceToSquared( v ) ); - projectOnPlane: function ( planeNormal ) { + }; - _vector.copy( this ).projectOnVector( planeNormal ); + Vector3.prototype.distanceToSquared = function distanceToSquared ( v ) { - return this.sub( _vector ); + var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; - }, + return dx * dx + dy * dy + dz * dz; - reflect: function ( normal ) { + }; - // reflect incident vector off plane orthogonal to normal - // normal is assumed to have unit length + Vector3.prototype.manhattanDistanceTo = function manhattanDistanceTo ( v ) { - return this.sub( _vector.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); + return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); - }, + }; - angleTo: function ( v ) { + Vector3.prototype.setFromSpherical = function setFromSpherical ( s ) { - var denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); + return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); - if ( denominator === 0 ) { return Math.PI / 2; } + }; - var theta = this.dot( v ) / denominator; + Vector3.prototype.setFromSphericalCoords = function setFromSphericalCoords ( radius, phi, theta ) { - // clamp, to handle numerical problems + var sinPhiRadius = Math.sin( phi ) * radius; - return Math.acos( MathUtils.clamp( theta, - 1, 1 ) ); + this.x = sinPhiRadius * Math.sin( theta ); + this.y = Math.cos( phi ) * radius; + this.z = sinPhiRadius * Math.cos( theta ); - }, + return this; - distanceTo: function ( v ) { + }; - return Math.sqrt( this.distanceToSquared( v ) ); + Vector3.prototype.setFromCylindrical = function setFromCylindrical ( c ) { - }, + return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); - distanceToSquared: function ( v ) { + }; - var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; + Vector3.prototype.setFromCylindricalCoords = function setFromCylindricalCoords ( radius, theta, y ) { - return dx * dx + dy * dy + dz * dz; + this.x = radius * Math.sin( theta ); + this.y = y; + this.z = radius * Math.cos( theta ); - }, + return this; - manhattanDistanceTo: function ( v ) { + }; - return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); + Vector3.prototype.setFromMatrixPosition = function setFromMatrixPosition ( m ) { - }, + var e = m.elements; - setFromSpherical: function ( s ) { + this.x = e[ 12 ]; + this.y = e[ 13 ]; + this.z = e[ 14 ]; - return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); + return this; - }, + }; - setFromSphericalCoords: function ( radius, phi, theta ) { + Vector3.prototype.setFromMatrixScale = function setFromMatrixScale ( m ) { - var sinPhiRadius = Math.sin( phi ) * radius; + var sx = this.setFromMatrixColumn( m, 0 ).length(); + var sy = this.setFromMatrixColumn( m, 1 ).length(); + var sz = this.setFromMatrixColumn( m, 2 ).length(); - this.x = sinPhiRadius * Math.sin( theta ); - this.y = Math.cos( phi ) * radius; - this.z = sinPhiRadius * Math.cos( theta ); + this.x = sx; + this.y = sy; + this.z = sz; - return this; + return this; - }, + }; - setFromCylindrical: function ( c ) { + Vector3.prototype.setFromMatrixColumn = function setFromMatrixColumn ( m, index ) { - return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); + return this.fromArray( m.elements, index * 4 ); - }, + }; - setFromCylindricalCoords: function ( radius, theta, y ) { + Vector3.prototype.setFromMatrix3Column = function setFromMatrix3Column ( m, index ) { - this.x = radius * Math.sin( theta ); - this.y = y; - this.z = radius * Math.cos( theta ); + return this.fromArray( m.elements, index * 3 ); - return this; + }; - }, + Vector3.prototype.equals = function equals ( v ) { - setFromMatrixPosition: function ( m ) { + return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); - var e = m.elements; + }; - this.x = e[ 12 ]; - this.y = e[ 13 ]; - this.z = e[ 14 ]; + Vector3.prototype.fromArray = function fromArray ( array, offset ) { - return this; + if ( offset === undefined ) { offset = 0; } - }, + this.x = array[ offset ]; + this.y = array[ offset + 1 ]; + this.z = array[ offset + 2 ]; - setFromMatrixScale: function ( m ) { + return this; - var sx = this.setFromMatrixColumn( m, 0 ).length(); - var sy = this.setFromMatrixColumn( m, 1 ).length(); - var sz = this.setFromMatrixColumn( m, 2 ).length(); + }; - this.x = sx; - this.y = sy; - this.z = sz; + Vector3.prototype.toArray = function toArray ( array, offset ) { - return this; + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - }, + array[ offset ] = this.x; + array[ offset + 1 ] = this.y; + array[ offset + 2 ] = this.z; - setFromMatrixColumn: function ( m, index ) { + return array; - return this.fromArray( m.elements, index * 4 ); + }; - }, + Vector3.prototype.fromBufferAttribute = function fromBufferAttribute ( attribute, index, offset ) { - setFromMatrix3Column: function ( m, index ) { + if ( offset !== undefined ) { - return this.fromArray( m.elements, index * 3 ); + console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' ); - }, + } - equals: function ( v ) { + this.x = attribute.getX( index ); + this.y = attribute.getY( index ); + this.z = attribute.getZ( index ); - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); + return this; - }, + }; - fromArray: function ( array, offset ) { + Vector3.prototype.random = function random () { - if ( offset === undefined ) { offset = 0; } + this.x = Math.random(); + this.y = Math.random(); + this.z = Math.random(); - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; + return this; - return this; + }; - }, + Vector3.prototype.isVector3 = true; - toArray: function ( array, offset ) { + var _vector = new Vector3(); + var _quaternion = new Quaternion(); - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + var Box3 = function Box3( min, max ) { - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; + this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); + this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); - return array; + }; - }, + Box3.prototype.set = function set ( min, max ) { - fromBufferAttribute: function ( attribute, index, offset ) { + this.min.copy( min ); + this.max.copy( max ); - if ( offset !== undefined ) { + return this; - console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' ); + }; - } + Box3.prototype.setFromArray = function setFromArray ( array ) { - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); + var minX = + Infinity; + var minY = + Infinity; + var minZ = + Infinity; - return this; + var maxX = - Infinity; + var maxY = - Infinity; + var maxZ = - Infinity; - }, + for ( var i = 0, l = array.length; i < l; i += 3 ) { - random: function () { + var x = array[ i ]; + var y = array[ i + 1 ]; + var z = array[ i + 2 ]; - this.x = Math.random(); - this.y = Math.random(); - this.z = Math.random(); + if ( x < minX ) { minX = x; } + if ( y < minY ) { minY = y; } + if ( z < minZ ) { minZ = z; } - return this; + if ( x > maxX ) { maxX = x; } + if ( y > maxY ) { maxY = y; } + if ( z > maxZ ) { maxZ = z; } } - } ); + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); - var _v1 = new Vector3(); - var _m1 = new Matrix4(); - var _zero = new Vector3( 0, 0, 0 ); - var _one = new Vector3( 1, 1, 1 ); - var _x = new Vector3(); - var _y = new Vector3(); - var _z = new Vector3(); + return this; - function Matrix4() { + }; - this.elements = [ + Box3.prototype.setFromBufferAttribute = function setFromBufferAttribute ( attribute ) { - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + var minX = + Infinity; + var minY = + Infinity; + var minZ = + Infinity; - ]; + var maxX = - Infinity; + var maxY = - Infinity; + var maxZ = - Infinity; - if ( arguments.length > 0 ) { + for ( var i = 0, l = attribute.count; i < l; i ++ ) { - console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + var x = attribute.getX( i ); + var y = attribute.getY( i ); + var z = attribute.getZ( i ); - } + if ( x < minX ) { minX = x; } + if ( y < minY ) { minY = y; } + if ( z < minZ ) { minZ = z; } - } + if ( x > maxX ) { maxX = x; } + if ( y > maxY ) { maxY = y; } + if ( z > maxZ ) { maxZ = z; } - Object.assign( Matrix4.prototype, { + } - isMatrix4: true, + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); - set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + return this; - var te = this.elements; + }; - te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; - te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; - te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; - te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; + Box3.prototype.setFromPoints = function setFromPoints ( points ) { - return this; + this.makeEmpty(); - }, + for ( var i = 0, il = points.length; i < il; i ++ ) { - identity: function () { + this.expandByPoint( points[ i ] ); - this.set( + } - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + return this; - ); + }; - return this; + Box3.prototype.setFromCenterAndSize = function setFromCenterAndSize ( center, size ) { - }, + var halfSize = _vector$1.copy( size ).multiplyScalar( 0.5 ); - clone: function () { + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); - return new Matrix4().fromArray( this.elements ); + return this; - }, + }; - copy: function ( m ) { + Box3.prototype.setFromObject = function setFromObject ( object ) { - var te = this.elements; - var me = m.elements; + this.makeEmpty(); - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; - te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; - te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; - te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; + return this.expandByObject( object ); - return this; + }; - }, + Box3.prototype.clone = function clone () { - copyPosition: function ( m ) { + return new this.constructor().copy( this ); - var te = this.elements, me = m.elements; + }; - te[ 12 ] = me[ 12 ]; - te[ 13 ] = me[ 13 ]; - te[ 14 ] = me[ 14 ]; + Box3.prototype.copy = function copy ( box ) { - return this; + this.min.copy( box.min ); + this.max.copy( box.max ); - }, + return this; - extractBasis: function ( xAxis, yAxis, zAxis ) { + }; - xAxis.setFromMatrixColumn( this, 0 ); - yAxis.setFromMatrixColumn( this, 1 ); - zAxis.setFromMatrixColumn( this, 2 ); + Box3.prototype.makeEmpty = function makeEmpty () { - return this; + this.min.x = this.min.y = this.min.z = + Infinity; + this.max.x = this.max.y = this.max.z = - Infinity; - }, + return this; - makeBasis: function ( xAxis, yAxis, zAxis ) { + }; - this.set( - xAxis.x, yAxis.x, zAxis.x, 0, - xAxis.y, yAxis.y, zAxis.y, 0, - xAxis.z, yAxis.z, zAxis.z, 0, - 0, 0, 0, 1 - ); + Box3.prototype.isEmpty = function isEmpty () { - return this; + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - }, + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); - extractRotation: function ( m ) { + }; - // this method does not support reflection matrices + Box3.prototype.getCenter = function getCenter ( target ) { - var te = this.elements; - var me = m.elements; + if ( target === undefined ) { - var scaleX = 1 / _v1.setFromMatrixColumn( m, 0 ).length(); - var scaleY = 1 / _v1.setFromMatrixColumn( m, 1 ).length(); - var scaleZ = 1 / _v1.setFromMatrixColumn( m, 2 ).length(); + console.warn( 'THREE.Box3: .getCenter() target is now required' ); + target = new Vector3(); - te[ 0 ] = me[ 0 ] * scaleX; - te[ 1 ] = me[ 1 ] * scaleX; - te[ 2 ] = me[ 2 ] * scaleX; - te[ 3 ] = 0; + } - te[ 4 ] = me[ 4 ] * scaleY; - te[ 5 ] = me[ 5 ] * scaleY; - te[ 6 ] = me[ 6 ] * scaleY; - te[ 7 ] = 0; + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - te[ 8 ] = me[ 8 ] * scaleZ; - te[ 9 ] = me[ 9 ] * scaleZ; - te[ 10 ] = me[ 10 ] * scaleZ; - te[ 11 ] = 0; + }; - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + Box3.prototype.getSize = function getSize ( target ) { - return this; + if ( target === undefined ) { - }, + console.warn( 'THREE.Box3: .getSize() target is now required' ); + target = new Vector3(); - makeRotationFromEuler: function ( euler ) { + } - if ( ! ( euler && euler.isEuler ) ) { + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); - console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); + }; - } + Box3.prototype.expandByPoint = function expandByPoint ( point ) { - var te = this.elements; + this.min.min( point ); + this.max.max( point ); - var x = euler.x, y = euler.y, z = euler.z; - var a = Math.cos( x ), b = Math.sin( x ); - var c = Math.cos( y ), d = Math.sin( y ); - var e = Math.cos( z ), f = Math.sin( z ); + return this; - if ( euler.order === 'XYZ' ) { + }; - var ae = a * e, af = a * f, be = b * e, bf = b * f; + Box3.prototype.expandByVector = function expandByVector ( vector ) { - te[ 0 ] = c * e; - te[ 4 ] = - c * f; - te[ 8 ] = d; + this.min.sub( vector ); + this.max.add( vector ); - te[ 1 ] = af + be * d; - te[ 5 ] = ae - bf * d; - te[ 9 ] = - b * c; + return this; - te[ 2 ] = bf - ae * d; - te[ 6 ] = be + af * d; - te[ 10 ] = a * c; + }; - } else if ( euler.order === 'YXZ' ) { + Box3.prototype.expandByScalar = function expandByScalar ( scalar ) { - var ce = c * e, cf = c * f, de = d * e, df = d * f; + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); - te[ 0 ] = ce + df * b; - te[ 4 ] = de * b - cf; - te[ 8 ] = a * d; + return this; - te[ 1 ] = a * f; - te[ 5 ] = a * e; - te[ 9 ] = - b; + }; - te[ 2 ] = cf * b - de; - te[ 6 ] = df + ce * b; - te[ 10 ] = a * c; + Box3.prototype.expandByObject = function expandByObject ( object ) { - } else if ( euler.order === 'ZXY' ) { + // Computes the world-axis-aligned bounding box of an object (including its children), + // accounting for both the object's, and children's, world transforms - var ce$1 = c * e, cf$1 = c * f, de$1 = d * e, df$1 = d * f; + object.updateWorldMatrix( false, false ); - te[ 0 ] = ce$1 - df$1 * b; - te[ 4 ] = - a * f; - te[ 8 ] = de$1 + cf$1 * b; + var geometry = object.geometry; - te[ 1 ] = cf$1 + de$1 * b; - te[ 5 ] = a * e; - te[ 9 ] = df$1 - ce$1 * b; + if ( geometry !== undefined ) { - te[ 2 ] = - a * d; - te[ 6 ] = b; - te[ 10 ] = a * c; + if ( geometry.boundingBox === null ) { - } else if ( euler.order === 'ZYX' ) { + geometry.computeBoundingBox(); - var ae$1 = a * e, af$1 = a * f, be$1 = b * e, bf$1 = b * f; + } - te[ 0 ] = c * e; - te[ 4 ] = be$1 * d - af$1; - te[ 8 ] = ae$1 * d + bf$1; + _box.copy( geometry.boundingBox ); + _box.applyMatrix4( object.matrixWorld ); - te[ 1 ] = c * f; - te[ 5 ] = bf$1 * d + ae$1; - te[ 9 ] = af$1 * d - be$1; + this.union( _box ); - te[ 2 ] = - d; - te[ 6 ] = b * c; - te[ 10 ] = a * c; + } - } else if ( euler.order === 'YZX' ) { + var children = object.children; - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; + for ( var i = 0, l = children.length; i < l; i ++ ) { - te[ 0 ] = c * e; - te[ 4 ] = bd - ac * f; - te[ 8 ] = bc * f + ad; + this.expandByObject( children[ i ] ); - te[ 1 ] = f; - te[ 5 ] = a * e; - te[ 9 ] = - b * e; + } - te[ 2 ] = - d * e; - te[ 6 ] = ad * f + bc; - te[ 10 ] = ac - bd * f; + return this; - } else if ( euler.order === 'XZY' ) { + }; - var ac$1 = a * c, ad$1 = a * d, bc$1 = b * c, bd$1 = b * d; + Box3.prototype.containsPoint = function containsPoint ( point ) { - te[ 0 ] = c * e; - te[ 4 ] = - f; - te[ 8 ] = d * e; + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y || + point.z < this.min.z || point.z > this.max.z ? false : true; - te[ 1 ] = ac$1 * f + bd$1; - te[ 5 ] = a * e; - te[ 9 ] = ad$1 * f - bc$1; + }; - te[ 2 ] = bc$1 * f - ad$1; - te[ 6 ] = b * e; - te[ 10 ] = bd$1 * f + ac$1; + Box3.prototype.containsBox = function containsBox ( box ) { - } + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y && + this.min.z <= box.min.z && box.max.z <= this.max.z; - // bottom row - te[ 3 ] = 0; - te[ 7 ] = 0; - te[ 11 ] = 0; + }; - // last column - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + Box3.prototype.getParameter = function getParameter ( point, target ) { - return this; + // This can potentially have a divide by zero if the box + // has a size dimension of 0. - }, + if ( target === undefined ) { - makeRotationFromQuaternion: function ( q ) { + console.warn( 'THREE.Box3: .getParameter() target is now required' ); + target = new Vector3(); - return this.compose( _zero, q, _one ); + } - }, + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ), + ( point.z - this.min.z ) / ( this.max.z - this.min.z ) + ); - lookAt: function ( eye, target, up ) { + }; - var te = this.elements; + Box3.prototype.intersectsBox = function intersectsBox ( box ) { - _z.subVectors( eye, target ); + // using 6 splitting planes to rule out intersections. + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y || + box.max.z < this.min.z || box.min.z > this.max.z ? false : true; - if ( _z.lengthSq() === 0 ) { + }; - // eye and target are in the same position + Box3.prototype.intersectsSphere = function intersectsSphere ( sphere ) { - _z.z = 1; + // Find the point on the AABB closest to the sphere center. + this.clampPoint( sphere.center, _vector$1 ); - } + // If that point is inside the sphere, the AABB and sphere intersect. + return _vector$1.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); - _z.normalize(); - _x.crossVectors( up, _z ); + }; - if ( _x.lengthSq() === 0 ) { + Box3.prototype.intersectsPlane = function intersectsPlane ( plane ) { - // up and z are parallel + // We compute the minimum and maximum dot product values. If those values + // are on the same side (back or front) of the plane, then there is no intersection. - if ( Math.abs( up.z ) === 1 ) { + var min, max; - _z.x += 0.0001; + if ( plane.normal.x > 0 ) { - } else { + min = plane.normal.x * this.min.x; + max = plane.normal.x * this.max.x; - _z.z += 0.0001; + } else { - } + min = plane.normal.x * this.max.x; + max = plane.normal.x * this.min.x; - _z.normalize(); - _x.crossVectors( up, _z ); + } - } + if ( plane.normal.y > 0 ) { - _x.normalize(); - _y.crossVectors( _z, _x ); + min += plane.normal.y * this.min.y; + max += plane.normal.y * this.max.y; - te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; - te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; - te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; + } else { - return this; + min += plane.normal.y * this.max.y; + max += plane.normal.y * this.min.y; - }, + } - multiply: function ( m, n ) { + if ( plane.normal.z > 0 ) { - if ( n !== undefined ) { + min += plane.normal.z * this.min.z; + max += plane.normal.z * this.max.z; - console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); - return this.multiplyMatrices( m, n ); + } else { - } + min += plane.normal.z * this.max.z; + max += plane.normal.z * this.min.z; - return this.multiplyMatrices( this, m ); + } - }, + return ( min <= - plane.constant && max >= - plane.constant ); - premultiply: function ( m ) { + }; - return this.multiplyMatrices( m, this ); + Box3.prototype.intersectsTriangle = function intersectsTriangle ( triangle ) { - }, + if ( this.isEmpty() ) { - multiplyMatrices: function ( a, b ) { + return false; - var ae = a.elements; - var be = b.elements; - var te = this.elements; + } - var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; - var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; - var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; - var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; + // compute box center and extents + this.getCenter( _center ); + _extents.subVectors( this.max, _center ); - var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; - var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; - var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; - var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; + // translate triangle to aabb origin + _v0.subVectors( triangle.a, _center ); + _v1.subVectors( triangle.b, _center ); + _v2.subVectors( triangle.c, _center ); - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + // compute edge vectors for triangle + _f0.subVectors( _v1, _v0 ); + _f1.subVectors( _v2, _v1 ); + _f2.subVectors( _v0, _v2 ); - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb + // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation + // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) + var axes = [ + 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, + _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, + - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 + ]; + if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + return false; - te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + } - return this; + // test 3 face normals from the aabb + axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - }, + return false; - multiplyScalar: function ( s ) { + } - var te = this.elements; + // finally testing the face normal of the triangle + // use already existing triangle edge vectors here + _triangleNormal.crossVectors( _f0, _f1 ); + axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; - te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; - te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; - te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; - te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; + return satForAxes( axes, _v0, _v1, _v2, _extents ); - return this; + }; - }, + Box3.prototype.clampPoint = function clampPoint ( point, target ) { - determinant: function () { + if ( target === undefined ) { - var te = this.elements; + console.warn( 'THREE.Box3: .clampPoint() target is now required' ); + target = new Vector3(); - var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; - var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; - var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; - var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; + } - //TODO: make this more efficient - //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) + return target.copy( point ).clamp( this.min, this.max ); - return ( - n41 * ( - + n14 * n23 * n32 - - n13 * n24 * n32 - - n14 * n22 * n33 - + n12 * n24 * n33 - + n13 * n22 * n34 - - n12 * n23 * n34 - ) + - n42 * ( - + n11 * n23 * n34 - - n11 * n24 * n33 - + n14 * n21 * n33 - - n13 * n21 * n34 - + n13 * n24 * n31 - - n14 * n23 * n31 - ) + - n43 * ( - + n11 * n24 * n32 - - n11 * n22 * n34 - - n14 * n21 * n32 - + n12 * n21 * n34 - + n14 * n22 * n31 - - n12 * n24 * n31 - ) + - n44 * ( - - n13 * n22 * n31 - - n11 * n23 * n32 - + n11 * n22 * n33 - + n13 * n21 * n32 - - n12 * n21 * n33 - + n12 * n23 * n31 - ) + }; - ); + Box3.prototype.distanceToPoint = function distanceToPoint ( point ) { - }, + var clampedPoint = _vector$1.copy( point ).clamp( this.min, this.max ); - transpose: function () { + return clampedPoint.sub( point ).length(); - var te = this.elements; - var tmp; + }; - tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; - tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; - tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; + Box3.prototype.getBoundingSphere = function getBoundingSphere ( target ) { - tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; - tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; - tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; + if ( target === undefined ) { - return this; + console.error( 'THREE.Box3: .getBoundingSphere() target is now required' ); + //target = new Sphere(); // removed to avoid cyclic dependency - }, + } - setPosition: function ( x, y, z ) { + this.getCenter( target.center ); - var te = this.elements; + target.radius = this.getSize( _vector$1 ).length() * 0.5; - if ( x.isVector3 ) { + return target; - te[ 12 ] = x.x; - te[ 13 ] = x.y; - te[ 14 ] = x.z; + }; - } else { + Box3.prototype.intersect = function intersect ( box ) { - te[ 12 ] = x; - te[ 13 ] = y; - te[ 14 ] = z; + this.min.max( box.min ); + this.max.min( box.max ); - } + // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. + if ( this.isEmpty() ) { this.makeEmpty(); } - return this; + return this; - }, + }; - getInverse: function ( m, throwOnDegenerate ) { + Box3.prototype.union = function union ( box ) { - if ( throwOnDegenerate !== undefined ) { + this.min.min( box.min ); + this.max.max( box.max ); - console.warn( "THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate." ); + return this; - } + }; - // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - var te = this.elements, - me = m.elements, + Box3.prototype.applyMatrix4 = function applyMatrix4 ( matrix ) { - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], - n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], - n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], - n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], + // transform of empty box is an empty box. + if ( this.isEmpty() ) { return this; } - t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, - t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, - t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, - t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + // NOTE: I am using a binary pattern to specify all 2^3 combinations below + _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 + _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 + _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 + _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 + _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 + _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 + _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 + _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 - var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + this.setFromPoints( _points ); - if ( det === 0 ) { return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } + return this; - var detInv = 1 / det; + }; - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; - te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; - te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; + Box3.prototype.translate = function translate ( offset ) { - te[ 4 ] = t12 * detInv; - te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; - te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; - te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; + this.min.add( offset ); + this.max.add( offset ); - te[ 8 ] = t13 * detInv; - te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; - te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; - te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; + return this; - te[ 12 ] = t14 * detInv; - te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; - te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; - te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; + }; - return this; + Box3.prototype.equals = function equals ( box ) { - }, + return box.min.equals( this.min ) && box.max.equals( this.max ); - scale: function ( v ) { + }; - var te = this.elements; - var x = v.x, y = v.y, z = v.z; + function satForAxes( axes, v0, v1, v2, extents ) { - te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; - te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; - te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; - te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; + for ( var i = 0, j = axes.length - 3; i <= j; i += 3 ) { - return this; + _testAxis.fromArray( axes, i ); + // project the aabb onto the seperating axis + var r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); + // project all 3 vertices of the triangle onto the seperating axis + var p0 = v0.dot( _testAxis ); + var p1 = v1.dot( _testAxis ); + var p2 = v2.dot( _testAxis ); + // actual test, basically see if either of the most extreme of the triangle points intersects r + if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { - }, + // points of the projected triangle are outside the projected half-length of the aabb + // the axis is seperating and we can exit + return false; - getMaxScaleOnAxis: function () { + } - var te = this.elements; + } - var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; - var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; - var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; + return true; - return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); + } - }, + Box3.prototype.isBox3 = true; - makeTranslation: function ( x, y, z ) { + var _points = [ + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3() + ]; - this.set( + var _vector$1 = new Vector3(); - 1, 0, 0, x, - 0, 1, 0, y, - 0, 0, 1, z, - 0, 0, 0, 1 + var _box = new Box3(); - ); + // triangle centered vertices - return this; + var _v0 = new Vector3(); + var _v1 = new Vector3(); + var _v2 = new Vector3(); - }, + // triangle edge vectors - makeRotationX: function ( theta ) { + var _f0 = new Vector3(); + var _f1 = new Vector3(); + var _f2 = new Vector3(); - var c = Math.cos( theta ), s = Math.sin( theta ); + var _center = new Vector3(); + var _extents = new Vector3(); + var _triangleNormal = new Vector3(); + var _testAxis = new Vector3(); - this.set( + var _box$1 = new Box3(); - 1, 0, 0, 0, - 0, c, - s, 0, - 0, s, c, 0, - 0, 0, 0, 1 + var Sphere = function Sphere( center, radius ) { - ); + this.center = ( center !== undefined ) ? center : new Vector3(); + this.radius = ( radius !== undefined ) ? radius : - 1; - return this; + }; - }, + Sphere.prototype.set = function set ( center, radius ) { - makeRotationY: function ( theta ) { + this.center.copy( center ); + this.radius = radius; - var c = Math.cos( theta ), s = Math.sin( theta ); + return this; - this.set( + }; - c, 0, s, 0, - 0, 1, 0, 0, - - s, 0, c, 0, - 0, 0, 0, 1 + Sphere.prototype.setFromPoints = function setFromPoints ( points, optionalCenter ) { - ); + var center = this.center; - return this; + if ( optionalCenter !== undefined ) { - }, + center.copy( optionalCenter ); - makeRotationZ: function ( theta ) { + } else { - var c = Math.cos( theta ), s = Math.sin( theta ); + _box$1.setFromPoints( points ).getCenter( center ); - this.set( + } - c, - s, 0, 0, - s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + var maxRadiusSq = 0; - ); + for ( var i = 0, il = points.length; i < il; i ++ ) { - return this; + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - }, + } - makeRotationAxis: function ( axis, angle ) { + this.radius = Math.sqrt( maxRadiusSq ); - // Based on http://www.gamedev.net/reference/articles/article1199.asp + return this; - var c = Math.cos( angle ); - var s = Math.sin( angle ); - var t = 1 - c; - var x = axis.x, y = axis.y, z = axis.z; - var tx = t * x, ty = t * y; + }; - this.set( + Sphere.prototype.clone = function clone () { - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 + return new this.constructor().copy( this ); - ); + }; - return this; + Sphere.prototype.copy = function copy ( sphere ) { - }, + this.center.copy( sphere.center ); + this.radius = sphere.radius; - makeScale: function ( x, y, z ) { + return this; - this.set( + }; - x, 0, 0, 0, - 0, y, 0, 0, - 0, 0, z, 0, - 0, 0, 0, 1 + Sphere.prototype.isEmpty = function isEmpty () { - ); + return ( this.radius < 0 ); - return this; + }; - }, + Sphere.prototype.makeEmpty = function makeEmpty () { - makeShear: function ( x, y, z ) { + this.center.set( 0, 0, 0 ); + this.radius = - 1; - this.set( + return this; - 1, y, z, 0, - x, 1, z, 0, - x, y, 1, 0, - 0, 0, 0, 1 + }; - ); + Sphere.prototype.containsPoint = function containsPoint ( point ) { - return this; + return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); - }, + }; - compose: function ( position, quaternion, scale ) { + Sphere.prototype.distanceToPoint = function distanceToPoint ( point ) { - var te = this.elements; + return ( point.distanceTo( this.center ) - this.radius ); - var x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; - var x2 = x + x, y2 = y + y, z2 = z + z; - var xx = x * x2, xy = x * y2, xz = x * z2; - var yy = y * y2, yz = y * z2, zz = z * z2; - var wx = w * x2, wy = w * y2, wz = w * z2; + }; - var sx = scale.x, sy = scale.y, sz = scale.z; + Sphere.prototype.intersectsSphere = function intersectsSphere ( sphere ) { - te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; - te[ 1 ] = ( xy + wz ) * sx; - te[ 2 ] = ( xz - wy ) * sx; - te[ 3 ] = 0; + var radiusSum = this.radius + sphere.radius; - te[ 4 ] = ( xy - wz ) * sy; - te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; - te[ 6 ] = ( yz + wx ) * sy; - te[ 7 ] = 0; + return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); - te[ 8 ] = ( xz + wy ) * sz; - te[ 9 ] = ( yz - wx ) * sz; - te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; - te[ 11 ] = 0; + }; - te[ 12 ] = position.x; - te[ 13 ] = position.y; - te[ 14 ] = position.z; - te[ 15 ] = 1; + Sphere.prototype.intersectsBox = function intersectsBox ( box ) { - return this; + return box.intersectsSphere( this ); - }, + }; - decompose: function ( position, quaternion, scale ) { + Sphere.prototype.intersectsPlane = function intersectsPlane ( plane ) { - var te = this.elements; + return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; - var sx = _v1.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); - var sy = _v1.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); - var sz = _v1.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); + }; - // if determine is negative, we need to invert one scale - var det = this.determinant(); - if ( det < 0 ) { sx = - sx; } + Sphere.prototype.clampPoint = function clampPoint ( point, target ) { - position.x = te[ 12 ]; - position.y = te[ 13 ]; - position.z = te[ 14 ]; + var deltaLengthSq = this.center.distanceToSquared( point ); - // scale the rotation part - _m1.copy( this ); + if ( target === undefined ) { - var invSX = 1 / sx; - var invSY = 1 / sy; - var invSZ = 1 / sz; + console.warn( 'THREE.Sphere: .clampPoint() target is now required' ); + target = new Vector3(); - _m1.elements[ 0 ] *= invSX; - _m1.elements[ 1 ] *= invSX; - _m1.elements[ 2 ] *= invSX; + } - _m1.elements[ 4 ] *= invSY; - _m1.elements[ 5 ] *= invSY; - _m1.elements[ 6 ] *= invSY; + target.copy( point ); - _m1.elements[ 8 ] *= invSZ; - _m1.elements[ 9 ] *= invSZ; - _m1.elements[ 10 ] *= invSZ; + if ( deltaLengthSq > ( this.radius * this.radius ) ) { - quaternion.setFromRotationMatrix( _m1 ); + target.sub( this.center ).normalize(); + target.multiplyScalar( this.radius ).add( this.center ); - scale.x = sx; - scale.y = sy; - scale.z = sz; + } - return this; + return target; - }, + }; - makePerspective: function ( left, right, top, bottom, near, far ) { + Sphere.prototype.getBoundingBox = function getBoundingBox ( target ) { - if ( far === undefined ) { + if ( target === undefined ) { - console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); + console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' ); + target = new Box3(); - } + } - var te = this.elements; - var x = 2 * near / ( right - left ); - var y = 2 * near / ( top - bottom ); + if ( this.isEmpty() ) { - var a = ( right + left ) / ( right - left ); - var b = ( top + bottom ) / ( top - bottom ); - var c = - ( far + near ) / ( far - near ); - var d = - 2 * far * near / ( far - near ); + // Empty sphere produces empty bounding box + target.makeEmpty(); + return target; - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; + } - return this; + target.set( this.center, this.center ); + target.expandByScalar( this.radius ); - }, + return target; - makeOrthographic: function ( left, right, top, bottom, near, far ) { + }; - var te = this.elements; - var w = 1.0 / ( right - left ); - var h = 1.0 / ( top - bottom ); - var p = 1.0 / ( far - near ); + Sphere.prototype.applyMatrix4 = function applyMatrix4 ( matrix ) { - var x = ( right + left ) * w; - var y = ( top + bottom ) * h; - var z = ( far + near ) * p; + this.center.applyMatrix4( matrix ); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + return this; - return this; + }; - }, + Sphere.prototype.translate = function translate ( offset ) { - equals: function ( matrix ) { + this.center.add( offset ); - var te = this.elements; - var me = matrix.elements; + return this; - for ( var i = 0; i < 16; i ++ ) { + }; - if ( te[ i ] !== me[ i ] ) { return false; } + Sphere.prototype.equals = function equals ( sphere ) { - } + return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); - return true; + }; - }, + var _vector$2 = new Vector3(); + var _segCenter = new Vector3(); + var _segDir = new Vector3(); + var _diff = new Vector3(); - fromArray: function ( array, offset ) { + var _edge1 = new Vector3(); + var _edge2 = new Vector3(); + var _normal = new Vector3(); - if ( offset === undefined ) { offset = 0; } + var Ray = function Ray( origin, direction ) { - for ( var i = 0; i < 16; i ++ ) { + this.origin = ( origin !== undefined ) ? origin : new Vector3(); + this.direction = ( direction !== undefined ) ? direction : new Vector3( 0, 0, - 1 ); - this.elements[ i ] = array[ i + offset ]; + }; - } + Ray.prototype.set = function set ( origin, direction ) { - return this; + this.origin.copy( origin ); + this.direction.copy( direction ); - }, + return this; - toArray: function ( array, offset ) { + }; - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + Ray.prototype.clone = function clone () { - var te = this.elements; + return new this.constructor().copy( this ); - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; - array[ offset + 3 ] = te[ 3 ]; + }; - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; + Ray.prototype.copy = function copy ( ray ) { - array[ offset + 8 ] = te[ 8 ]; - array[ offset + 9 ] = te[ 9 ]; - array[ offset + 10 ] = te[ 10 ]; - array[ offset + 11 ] = te[ 11 ]; + this.origin.copy( ray.origin ); + this.direction.copy( ray.direction ); - array[ offset + 12 ] = te[ 12 ]; - array[ offset + 13 ] = te[ 13 ]; - array[ offset + 14 ] = te[ 14 ]; - array[ offset + 15 ] = te[ 15 ]; + return this; - return array; + }; - } + Ray.prototype.at = function at ( t, target ) { - } ); + if ( target === undefined ) { - var _matrix = new Matrix4(); - var _quaternion$1 = new Quaternion(); + console.warn( 'THREE.Ray: .at() target is now required' ); + target = new Vector3(); - function Euler( x, y, z, order ) { - if ( x === void 0 ) x = 0; - if ( y === void 0 ) y = 0; - if ( z === void 0 ) z = 0; - if ( order === void 0 ) order = Euler.DefaultOrder; + } + return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); - this._x = x; - this._y = y; - this._z = z; - this._order = order; + }; - } + Ray.prototype.lookAt = function lookAt ( v ) { - Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; + this.direction.copy( v ).sub( this.origin ).normalize(); - Euler.DefaultOrder = 'XYZ'; + return this; - Object.defineProperties( Euler.prototype, { + }; - x: { + Ray.prototype.recast = function recast ( t ) { - get: function () { + this.origin.copy( this.at( t, _vector$2 ) ); - return this._x; + return this; - }, + }; - set: function ( value ) { + Ray.prototype.closestPointToPoint = function closestPointToPoint ( point, target ) { - this._x = value; - this._onChangeCallback(); + if ( target === undefined ) { - } + console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' ); + target = new Vector3(); - }, + } - y: { + target.subVectors( point, this.origin ); - get: function () { + var directionDistance = target.dot( this.direction ); - return this._y; + if ( directionDistance < 0 ) { - }, + return target.copy( this.origin ); - set: function ( value ) { + } - this._y = value; - this._onChangeCallback(); + return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - } + }; - }, + Ray.prototype.distanceToPoint = function distanceToPoint ( point ) { - z: { + return Math.sqrt( this.distanceSqToPoint( point ) ); - get: function () { + }; - return this._z; + Ray.prototype.distanceSqToPoint = function distanceSqToPoint ( point ) { - }, + var directionDistance = _vector$2.subVectors( point, this.origin ).dot( this.direction ); - set: function ( value ) { + // point behind the ray - this._z = value; - this._onChangeCallback(); + if ( directionDistance < 0 ) { - } + return this.origin.distanceToSquared( point ); - }, + } - order: { + _vector$2.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - get: function () { + return _vector$2.distanceToSquared( point ); - return this._order; + }; - }, + Ray.prototype.distanceSqToSegment = function distanceSqToSegment ( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { - set: function ( value ) { + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h + // It returns the min distance between the ray and the segment + // defined by v0 and v1 + // It can also set two optional targets : + // - The closest point on the ray + // - The closest point on the segment - this._order = value; - this._onChangeCallback(); + _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); + _segDir.copy( v1 ).sub( v0 ).normalize(); + _diff.copy( this.origin ).sub( _segCenter ); - } + var segExtent = v0.distanceTo( v1 ) * 0.5; + var a01 = - this.direction.dot( _segDir ); + var b0 = _diff.dot( this.direction ); + var b1 = - _diff.dot( _segDir ); + var c = _diff.lengthSq(); + var det = Math.abs( 1 - a01 * a01 ); + var s0, s1, sqrDist, extDet; - } + if ( det > 0 ) { - } ); + // The ray and segment are not parallel. - Object.assign( Euler.prototype, { + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; - isEuler: true, + if ( s0 >= 0 ) { - set: function ( x, y, z, order ) { + if ( s1 >= - extDet ) { - this._x = x; - this._y = y; - this._z = z; - this._order = order || this._order; + if ( s1 <= extDet ) { - this._onChangeCallback(); + // region 0 + // Minimum at interior points of ray and segment. - return this; + var invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; - }, + } else { - clone: function () { + // region 1 - return new this.constructor( this._x, this._y, this._z, this._order ); + s1 = segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - }, + } - copy: function ( euler ) { + } else { - this._x = euler._x; - this._y = euler._y; - this._z = euler._z; - this._order = euler._order; + // region 5 - this._onChangeCallback(); + s1 = - segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - return this; + } - }, + } else { - setFromRotationMatrix: function ( m, order, update ) { + if ( s1 <= - extDet ) { - var clamp = MathUtils.clamp; + // region 4 - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - var te = m.elements; - var m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; - var m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; - var m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + } else if ( s1 <= extDet ) { - order = order || this._order; + // region 3 - switch ( order ) { + s0 = 0; + s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = s1 * ( s1 + 2 * b1 ) + c; - case 'XYZ': + } else { - this._y = Math.asin( clamp( m13, - 1, 1 ) ); + // region 2 - if ( Math.abs( m13 ) < 0.9999999 ) { + s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - this._x = Math.atan2( - m23, m33 ); - this._z = Math.atan2( - m12, m11 ); + } - } else { + } - this._x = Math.atan2( m32, m22 ); - this._z = 0; + } else { - } + // Ray and segment are parallel. - break; + s1 = ( a01 > 0 ) ? - segExtent : segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - case 'YXZ': + } - this._x = Math.asin( - clamp( m23, - 1, 1 ) ); + if ( optionalPointOnRay ) { - if ( Math.abs( m23 ) < 0.9999999 ) { + optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); - this._y = Math.atan2( m13, m33 ); - this._z = Math.atan2( m21, m22 ); + } - } else { + if ( optionalPointOnSegment ) { - this._y = Math.atan2( - m31, m11 ); - this._z = 0; + optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); - } + } - break; + return sqrDist; - case 'ZXY': + }; - this._x = Math.asin( clamp( m32, - 1, 1 ) ); + Ray.prototype.intersectSphere = function intersectSphere ( sphere, target ) { - if ( Math.abs( m32 ) < 0.9999999 ) { + _vector$2.subVectors( sphere.center, this.origin ); + var tca = _vector$2.dot( this.direction ); + var d2 = _vector$2.dot( _vector$2 ) - tca * tca; + var radius2 = sphere.radius * sphere.radius; - this._y = Math.atan2( - m31, m33 ); - this._z = Math.atan2( - m12, m22 ); + if ( d2 > radius2 ) { return null; } - } else { + var thc = Math.sqrt( radius2 - d2 ); - this._y = 0; - this._z = Math.atan2( m21, m11 ); + // t0 = first intersect point - entrance on front of sphere + var t0 = tca - thc; - } + // t1 = second intersect point - exit point on back of sphere + var t1 = tca + thc; - break; + // test to see if both t0 and t1 are behind the ray - if so, return null + if ( t0 < 0 && t1 < 0 ) { return null; } - case 'ZYX': + // test to see if t0 is behind the ray: + // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, + // in order to always return an intersect point that is in front of the ray. + if ( t0 < 0 ) { return this.at( t1, target ); } - this._y = Math.asin( - clamp( m31, - 1, 1 ) ); + // else t0 is in front of the ray, so return the first collision point scaled by t0 + return this.at( t0, target ); - if ( Math.abs( m31 ) < 0.9999999 ) { + }; - this._x = Math.atan2( m32, m33 ); - this._z = Math.atan2( m21, m11 ); + Ray.prototype.intersectsSphere = function intersectsSphere ( sphere ) { - } else { + return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); - this._x = 0; - this._z = Math.atan2( - m12, m22 ); + }; - } + Ray.prototype.distanceToPlane = function distanceToPlane ( plane ) { - break; + var denominator = plane.normal.dot( this.direction ); - case 'YZX': + if ( denominator === 0 ) { - this._z = Math.asin( clamp( m21, - 1, 1 ) ); + // line is coplanar, return origin + if ( plane.distanceToPoint( this.origin ) === 0 ) { - if ( Math.abs( m21 ) < 0.9999999 ) { + return 0; - this._x = Math.atan2( - m23, m22 ); - this._y = Math.atan2( - m31, m11 ); + } - } else { + // Null is preferable to undefined since undefined means.... it is undefined - this._x = 0; - this._y = Math.atan2( m13, m33 ); + return null; - } + } - break; + var t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; - case 'XZY': + // Return if the ray never intersects the plane - this._z = Math.asin( - clamp( m12, - 1, 1 ) ); + return t >= 0 ? t : null; - if ( Math.abs( m12 ) < 0.9999999 ) { + }; - this._x = Math.atan2( m32, m22 ); - this._y = Math.atan2( m13, m11 ); + Ray.prototype.intersectPlane = function intersectPlane ( plane, target ) { - } else { + var t = this.distanceToPlane( plane ); - this._x = Math.atan2( - m23, m33 ); - this._y = 0; + if ( t === null ) { - } + return null; - break; + } - default: + return this.at( t, target ); - console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); + }; - } + Ray.prototype.intersectsPlane = function intersectsPlane ( plane ) { - this._order = order; + // check if the ray lies on the plane first - if ( update !== false ) { this._onChangeCallback(); } + var distToPoint = plane.distanceToPoint( this.origin ); - return this; + if ( distToPoint === 0 ) { - }, + return true; - setFromQuaternion: function ( q, order, update ) { + } - _matrix.makeRotationFromQuaternion( q ); + var denominator = plane.normal.dot( this.direction ); - return this.setFromRotationMatrix( _matrix, order, update ); + if ( denominator * distToPoint < 0 ) { - }, + return true; - setFromVector3: function ( v, order ) { + } - return this.set( v.x, v.y, v.z, order || this._order ); + // ray origin is behind the plane (and is pointing behind it) - }, + return false; - reorder: function ( newOrder ) { + }; - // WARNING: this discards revolution information -bhouston + Ray.prototype.intersectBox = function intersectBox ( box, target ) { - _quaternion$1.setFromEuler( this ); + var tmin, tmax, tymin, tymax, tzmin, tzmax; - return this.setFromQuaternion( _quaternion$1, newOrder ); + var invdirx = 1 / this.direction.x, + invdiry = 1 / this.direction.y, + invdirz = 1 / this.direction.z; - }, + var origin = this.origin; - equals: function ( euler ) { + if ( invdirx >= 0 ) { - return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); + tmin = ( box.min.x - origin.x ) * invdirx; + tmax = ( box.max.x - origin.x ) * invdirx; - }, + } else { - fromArray: function ( array ) { + tmin = ( box.max.x - origin.x ) * invdirx; + tmax = ( box.min.x - origin.x ) * invdirx; - this._x = array[ 0 ]; - this._y = array[ 1 ]; - this._z = array[ 2 ]; - if ( array[ 3 ] !== undefined ) { this._order = array[ 3 ]; } + } - this._onChangeCallback(); + if ( invdiry >= 0 ) { - return this; + tymin = ( box.min.y - origin.y ) * invdiry; + tymax = ( box.max.y - origin.y ) * invdiry; - }, + } else { - toArray: function ( array, offset ) { + tymin = ( box.max.y - origin.y ) * invdiry; + tymax = ( box.min.y - origin.y ) * invdiry; - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + } - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._order; + if ( ( tmin > tymax ) || ( tymin > tmax ) ) { return null; } - return array; + // These lines also handle the case where tmin or tmax is NaN + // (result of 0 * Infinity). x !== x returns true if x is NaN - }, + if ( tymin > tmin || tmin !== tmin ) { tmin = tymin; } - toVector3: function ( optionalResult ) { + if ( tymax < tmax || tmax !== tmax ) { tmax = tymax; } - if ( optionalResult ) { + if ( invdirz >= 0 ) { - return optionalResult.set( this._x, this._y, this._z ); + tzmin = ( box.min.z - origin.z ) * invdirz; + tzmax = ( box.max.z - origin.z ) * invdirz; - } else { + } else { - return new Vector3( this._x, this._y, this._z ); + tzmin = ( box.max.z - origin.z ) * invdirz; + tzmax = ( box.min.z - origin.z ) * invdirz; - } + } - }, + if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) { return null; } - _onChange: function ( callback ) { + if ( tzmin > tmin || tmin !== tmin ) { tmin = tzmin; } - this._onChangeCallback = callback; + if ( tzmax < tmax || tmax !== tmax ) { tmax = tzmax; } - return this; + //return point closest to the ray (positive side) - }, + if ( tmax < 0 ) { return null; } - _onChangeCallback: function () {} + return this.at( tmin >= 0 ? tmin : tmax, target ); - } ); + }; - var Layers = function Layers() { + Ray.prototype.intersectsBox = function intersectsBox ( box ) { - this.mask = 1 | 0; + return this.intersectBox( box, _vector$2 ) !== null; }; - Layers.prototype.set = function set ( channel ) { + Ray.prototype.intersectTriangle = function intersectTriangle ( a, b, c, backfaceCulling, target ) { - this.mask = 1 << channel | 0; + // Compute the offset origin, edges, and normal. - }; + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h - Layers.prototype.enable = function enable ( channel ) { + _edge1.subVectors( b, a ); + _edge2.subVectors( c, a ); + _normal.crossVectors( _edge1, _edge2 ); - this.mask |= 1 << channel | 0; + // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, + // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by + // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) + // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) + // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) + var DdN = this.direction.dot( _normal ); + var sign; - }; + if ( DdN > 0 ) { - Layers.prototype.enableAll = function enableAll () { + if ( backfaceCulling ) { return null; } + sign = 1; - this.mask = 0xffffffff | 0; + } else if ( DdN < 0 ) { - }; + sign = - 1; + DdN = - DdN; - Layers.prototype.toggle = function toggle ( channel ) { + } else { - this.mask ^= 1 << channel | 0; + return null; - }; + } - Layers.prototype.disable = function disable ( channel ) { + _diff.subVectors( this.origin, a ); + var DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); - this.mask &= ~ ( 1 << channel | 0 ); + // b1 < 0, no intersection + if ( DdQxE2 < 0 ) { - }; + return null; - Layers.prototype.disableAll = function disableAll () { + } - this.mask = 0; + var DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); - }; + // b2 < 0, no intersection + if ( DdE1xQ < 0 ) { - Layers.prototype.test = function test ( layers ) { + return null; - return ( this.mask & layers.mask ) !== 0; + } - }; + // b1+b2 > 1, no intersection + if ( DdQxE2 + DdE1xQ > DdN ) { - var _object3DId = 0; + return null; - var _v1$1 = new Vector3(); - var _q1 = new Quaternion(); - var _m1$1 = new Matrix4(); - var _target = new Vector3(); + } - var _position = new Vector3(); - var _scale = new Vector3(); - var _quaternion$2 = new Quaternion(); + // Line intersects triangle, check if ray does. + var QdN = - sign * _diff.dot( _normal ); - var _xAxis = new Vector3( 1, 0, 0 ); - var _yAxis = new Vector3( 0, 1, 0 ); - var _zAxis = new Vector3( 0, 0, 1 ); + // t < 0, no intersection + if ( QdN < 0 ) { - var _addedEvent = { type: 'added' }; - var _removedEvent = { type: 'removed' }; + return null; - function Object3D() { + } - Object.defineProperty( this, 'id', { value: _object3DId ++ } ); + // Ray intersects triangle. + return this.at( QdN / DdN, target ); - this.uuid = MathUtils.generateUUID(); + }; - this.name = ''; - this.type = 'Object3D'; + Ray.prototype.applyMatrix4 = function applyMatrix4 ( matrix4 ) { - this.parent = null; - this.children = []; + this.origin.applyMatrix4( matrix4 ); + this.direction.transformDirection( matrix4 ); - this.up = Object3D.DefaultUp.clone(); + return this; - var position = new Vector3(); - var rotation = new Euler(); - var quaternion = new Quaternion(); - var scale = new Vector3( 1, 1, 1 ); + }; - function onRotationChange() { + Ray.prototype.equals = function equals ( ray ) { - quaternion.setFromEuler( rotation, false ); + return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); - } + }; - function onQuaternionChange() { + var Matrix4 = function Matrix4() { - rotation.setFromQuaternion( quaternion, undefined, false ); + this.elements = [ - } + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - rotation._onChange( onRotationChange ); - quaternion._onChange( onQuaternionChange ); + ]; - Object.defineProperties( this, { - position: { - configurable: true, - enumerable: true, - value: position - }, - rotation: { - configurable: true, - enumerable: true, - value: rotation - }, - quaternion: { - configurable: true, - enumerable: true, - value: quaternion - }, - scale: { - configurable: true, - enumerable: true, - value: scale - }, - modelViewMatrix: { - value: new Matrix4() - }, - normalMatrix: { - value: new Matrix3() - } - } ); + if ( arguments.length > 0 ) { - this.matrix = new Matrix4(); - this.matrixWorld = new Matrix4(); + console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); - this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; - this.matrixWorldNeedsUpdate = false; + } - this.layers = new Layers(); - this.visible = true; + }; - this.castShadow = false; - this.receiveShadow = false; + Matrix4.prototype.set = function set ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - this.frustumCulled = true; - this.renderOrder = 0; + var te = this.elements; - this.userData = {}; + te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; + te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; + te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; + te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; - } + return this; - Object3D.DefaultUp = new Vector3( 0, 1, 0 ); - Object3D.DefaultMatrixAutoUpdate = true; + }; - Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { + Matrix4.prototype.identity = function identity () { - constructor: Object3D, + this.set( - isObject3D: true, + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - onBeforeRender: function () {}, - onAfterRender: function () {}, + ); - applyMatrix4: function ( matrix ) { + return this; - if ( this.matrixAutoUpdate ) { this.updateMatrix(); } + }; - this.matrix.premultiply( matrix ); + Matrix4.prototype.clone = function clone () { - this.matrix.decompose( this.position, this.quaternion, this.scale ); + return new Matrix4().fromArray( this.elements ); - }, + }; - applyQuaternion: function ( q ) { + Matrix4.prototype.copy = function copy ( m ) { - this.quaternion.premultiply( q ); + var te = this.elements; + var me = m.elements; - return this; + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; + te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; + te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; + te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; - }, + return this; - setRotationFromAxisAngle: function ( axis, angle ) { + }; - // assumes axis is normalized + Matrix4.prototype.copyPosition = function copyPosition ( m ) { - this.quaternion.setFromAxisAngle( axis, angle ); + var te = this.elements, me = m.elements; - }, + te[ 12 ] = me[ 12 ]; + te[ 13 ] = me[ 13 ]; + te[ 14 ] = me[ 14 ]; - setRotationFromEuler: function ( euler ) { + return this; - this.quaternion.setFromEuler( euler, true ); + }; - }, + Matrix4.prototype.extractBasis = function extractBasis ( xAxis, yAxis, zAxis ) { - setRotationFromMatrix: function ( m ) { + xAxis.setFromMatrixColumn( this, 0 ); + yAxis.setFromMatrixColumn( this, 1 ); + zAxis.setFromMatrixColumn( this, 2 ); - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - - this.quaternion.setFromRotationMatrix( m ); + return this; - }, + }; - setRotationFromQuaternion: function ( q ) { + Matrix4.prototype.makeBasis = function makeBasis ( xAxis, yAxis, zAxis ) { - // assumes q is normalized + this.set( + xAxis.x, yAxis.x, zAxis.x, 0, + xAxis.y, yAxis.y, zAxis.y, 0, + xAxis.z, yAxis.z, zAxis.z, 0, + 0, 0, 0, 1 + ); - this.quaternion.copy( q ); + return this; - }, + }; - rotateOnAxis: function ( axis, angle ) { + Matrix4.prototype.extractRotation = function extractRotation ( m ) { - // rotate object on axis in object space - // axis is assumed to be normalized + // this method does not support reflection matrices - _q1.setFromAxisAngle( axis, angle ); + var te = this.elements; + var me = m.elements; - this.quaternion.multiply( _q1 ); + var scaleX = 1 / _v1$1.setFromMatrixColumn( m, 0 ).length(); + var scaleY = 1 / _v1$1.setFromMatrixColumn( m, 1 ).length(); + var scaleZ = 1 / _v1$1.setFromMatrixColumn( m, 2 ).length(); - return this; + te[ 0 ] = me[ 0 ] * scaleX; + te[ 1 ] = me[ 1 ] * scaleX; + te[ 2 ] = me[ 2 ] * scaleX; + te[ 3 ] = 0; - }, + te[ 4 ] = me[ 4 ] * scaleY; + te[ 5 ] = me[ 5 ] * scaleY; + te[ 6 ] = me[ 6 ] * scaleY; + te[ 7 ] = 0; - rotateOnWorldAxis: function ( axis, angle ) { + te[ 8 ] = me[ 8 ] * scaleZ; + te[ 9 ] = me[ 9 ] * scaleZ; + te[ 10 ] = me[ 10 ] * scaleZ; + te[ 11 ] = 0; - // rotate object on axis in world space - // axis is assumed to be normalized - // method assumes no rotated parent + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - _q1.setFromAxisAngle( axis, angle ); + return this; - this.quaternion.premultiply( _q1 ); + }; - return this; + Matrix4.prototype.makeRotationFromEuler = function makeRotationFromEuler ( euler ) { - }, + if ( ! ( euler && euler.isEuler ) ) { - rotateX: function ( angle ) { + console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); - return this.rotateOnAxis( _xAxis, angle ); + } - }, + var te = this.elements; - rotateY: function ( angle ) { + var x = euler.x, y = euler.y, z = euler.z; + var a = Math.cos( x ), b = Math.sin( x ); + var c = Math.cos( y ), d = Math.sin( y ); + var e = Math.cos( z ), f = Math.sin( z ); - return this.rotateOnAxis( _yAxis, angle ); + if ( euler.order === 'XYZ' ) { - }, + var ae = a * e, af = a * f, be = b * e, bf = b * f; - rotateZ: function ( angle ) { + te[ 0 ] = c * e; + te[ 4 ] = - c * f; + te[ 8 ] = d; - return this.rotateOnAxis( _zAxis, angle ); + te[ 1 ] = af + be * d; + te[ 5 ] = ae - bf * d; + te[ 9 ] = - b * c; - }, + te[ 2 ] = bf - ae * d; + te[ 6 ] = be + af * d; + te[ 10 ] = a * c; - translateOnAxis: function ( axis, distance ) { + } else if ( euler.order === 'YXZ' ) { - // translate object by distance along axis in object space - // axis is assumed to be normalized + var ce = c * e, cf = c * f, de = d * e, df = d * f; - _v1$1.copy( axis ).applyQuaternion( this.quaternion ); + te[ 0 ] = ce + df * b; + te[ 4 ] = de * b - cf; + te[ 8 ] = a * d; - this.position.add( _v1$1.multiplyScalar( distance ) ); + te[ 1 ] = a * f; + te[ 5 ] = a * e; + te[ 9 ] = - b; - return this; + te[ 2 ] = cf * b - de; + te[ 6 ] = df + ce * b; + te[ 10 ] = a * c; - }, + } else if ( euler.order === 'ZXY' ) { - translateX: function ( distance ) { + var ce$1 = c * e, cf$1 = c * f, de$1 = d * e, df$1 = d * f; - return this.translateOnAxis( _xAxis, distance ); + te[ 0 ] = ce$1 - df$1 * b; + te[ 4 ] = - a * f; + te[ 8 ] = de$1 + cf$1 * b; - }, + te[ 1 ] = cf$1 + de$1 * b; + te[ 5 ] = a * e; + te[ 9 ] = df$1 - ce$1 * b; - translateY: function ( distance ) { + te[ 2 ] = - a * d; + te[ 6 ] = b; + te[ 10 ] = a * c; - return this.translateOnAxis( _yAxis, distance ); + } else if ( euler.order === 'ZYX' ) { - }, + var ae$1 = a * e, af$1 = a * f, be$1 = b * e, bf$1 = b * f; - translateZ: function ( distance ) { + te[ 0 ] = c * e; + te[ 4 ] = be$1 * d - af$1; + te[ 8 ] = ae$1 * d + bf$1; - return this.translateOnAxis( _zAxis, distance ); + te[ 1 ] = c * f; + te[ 5 ] = bf$1 * d + ae$1; + te[ 9 ] = af$1 * d - be$1; - }, + te[ 2 ] = - d; + te[ 6 ] = b * c; + te[ 10 ] = a * c; - localToWorld: function ( vector ) { + } else if ( euler.order === 'YZX' ) { - return vector.applyMatrix4( this.matrixWorld ); + var ac = a * c, ad = a * d, bc = b * c, bd = b * d; - }, + te[ 0 ] = c * e; + te[ 4 ] = bd - ac * f; + te[ 8 ] = bc * f + ad; - worldToLocal: function ( vector ) { + te[ 1 ] = f; + te[ 5 ] = a * e; + te[ 9 ] = - b * e; - return vector.applyMatrix4( _m1$1.getInverse( this.matrixWorld ) ); + te[ 2 ] = - d * e; + te[ 6 ] = ad * f + bc; + te[ 10 ] = ac - bd * f; - }, + } else if ( euler.order === 'XZY' ) { - lookAt: function ( x, y, z ) { + var ac$1 = a * c, ad$1 = a * d, bc$1 = b * c, bd$1 = b * d; - // This method does not support objects having non-uniformly-scaled parent(s) + te[ 0 ] = c * e; + te[ 4 ] = - f; + te[ 8 ] = d * e; - if ( x.isVector3 ) { + te[ 1 ] = ac$1 * f + bd$1; + te[ 5 ] = a * e; + te[ 9 ] = ad$1 * f - bc$1; - _target.copy( x ); + te[ 2 ] = bc$1 * f - ad$1; + te[ 6 ] = b * e; + te[ 10 ] = bd$1 * f + ac$1; - } else { + } - _target.set( x, y, z ); + // bottom row + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; - } + // last column + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - var parent = this.parent; + return this; - this.updateWorldMatrix( true, false ); + }; - _position.setFromMatrixPosition( this.matrixWorld ); + Matrix4.prototype.makeRotationFromQuaternion = function makeRotationFromQuaternion ( q ) { - if ( this.isCamera || this.isLight ) { + return this.compose( _zero, q, _one ); - _m1$1.lookAt( _position, _target, this.up ); + }; - } else { + Matrix4.prototype.lookAt = function lookAt ( eye, target, up ) { - _m1$1.lookAt( _target, _position, this.up ); + var te = this.elements; - } + _z.subVectors( eye, target ); - this.quaternion.setFromRotationMatrix( _m1$1 ); + if ( _z.lengthSq() === 0 ) { - if ( parent ) { + // eye and target are in the same position - _m1$1.extractRotation( parent.matrixWorld ); - _q1.setFromRotationMatrix( _m1$1 ); - this.quaternion.premultiply( _q1.inverse() ); + _z.z = 1; - } + } - }, + _z.normalize(); + _x.crossVectors( up, _z ); - add: function ( object ) { + if ( _x.lengthSq() === 0 ) { - if ( arguments.length > 1 ) { + // up and z are parallel - for ( var i = 0; i < arguments.length; i ++ ) { + if ( Math.abs( up.z ) === 1 ) { - this.add( arguments[ i ] ); + _z.x += 0.0001; - } + } else { - return this; + _z.z += 0.0001; } - if ( object === this ) { + _z.normalize(); + _x.crossVectors( up, _z ); - console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); - return this; + } - } + _x.normalize(); + _y.crossVectors( _z, _x ); - if ( ( object && object.isObject3D ) ) { + te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; + te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; + te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; - if ( object.parent !== null ) { + return this; - object.parent.remove( object ); + }; - } + Matrix4.prototype.multiply = function multiply ( m, n ) { - object.parent = this; - this.children.push( object ); + if ( n !== undefined ) { - object.dispatchEvent( _addedEvent ); + console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); + return this.multiplyMatrices( m, n ); - } else { + } - console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); + return this.multiplyMatrices( this, m ); - } + }; - return this; + Matrix4.prototype.premultiply = function premultiply ( m ) { - }, + return this.multiplyMatrices( m, this ); - remove: function ( object ) { + }; - if ( arguments.length > 1 ) { + Matrix4.prototype.multiplyMatrices = function multiplyMatrices ( a, b ) { - for ( var i = 0; i < arguments.length; i ++ ) { + var ae = a.elements; + var be = b.elements; + var te = this.elements; - this.remove( arguments[ i ] ); + var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; + var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; + var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; + var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; - } + var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; + var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; + var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; + var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; - return this; + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - } + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - var index = this.children.indexOf( object ); + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - if ( index !== - 1 ) { + te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - object.parent = null; - this.children.splice( index, 1 ); + return this; - object.dispatchEvent( _removedEvent ); + }; - } + Matrix4.prototype.multiplyScalar = function multiplyScalar ( s ) { - return this; + var te = this.elements; - }, + te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; + te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; + te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; + te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; - attach: function ( object ) { + return this; - // adds object as a child of this, while maintaining the object's world transform + }; - this.updateWorldMatrix( true, false ); + Matrix4.prototype.determinant = function determinant () { - _m1$1.getInverse( this.matrixWorld ); + var te = this.elements; - if ( object.parent !== null ) { + var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; + var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; + var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; + var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; - object.parent.updateWorldMatrix( true, false ); + //TODO: make this more efficient + //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) - _m1$1.multiply( object.parent.matrixWorld ); + return ( + n41 * ( + + n14 * n23 * n32 + - n13 * n24 * n32 + - n14 * n22 * n33 + + n12 * n24 * n33 + + n13 * n22 * n34 + - n12 * n23 * n34 + ) + + n42 * ( + + n11 * n23 * n34 + - n11 * n24 * n33 + + n14 * n21 * n33 + - n13 * n21 * n34 + + n13 * n24 * n31 + - n14 * n23 * n31 + ) + + n43 * ( + + n11 * n24 * n32 + - n11 * n22 * n34 + - n14 * n21 * n32 + + n12 * n21 * n34 + + n14 * n22 * n31 + - n12 * n24 * n31 + ) + + n44 * ( + - n13 * n22 * n31 + - n11 * n23 * n32 + + n11 * n22 * n33 + + n13 * n21 * n32 + - n12 * n21 * n33 + + n12 * n23 * n31 + ) - } + ); - object.applyMatrix4( _m1$1 ); + }; - object.updateWorldMatrix( false, false ); + Matrix4.prototype.transpose = function transpose () { - this.add( object ); + var te = this.elements; + var tmp; - return this; + tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; + tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; + tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; - }, + tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; + tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; + tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; - getObjectById: function ( id ) { + return this; - return this.getObjectByProperty( 'id', id ); + }; - }, + Matrix4.prototype.setPosition = function setPosition ( x, y, z ) { - getObjectByName: function ( name ) { + var te = this.elements; - return this.getObjectByProperty( 'name', name ); + if ( x.isVector3 ) { - }, + te[ 12 ] = x.x; + te[ 13 ] = x.y; + te[ 14 ] = x.z; - getObjectByProperty: function ( name, value ) { + } else { - if ( this[ name ] === value ) { return this; } + te[ 12 ] = x; + te[ 13 ] = y; + te[ 14 ] = z; - for ( var i = 0, l = this.children.length; i < l; i ++ ) { + } - var child = this.children[ i ]; - var object = child.getObjectByProperty( name, value ); + return this; - if ( object !== undefined ) { + }; - return object; + Matrix4.prototype.getInverse = function getInverse ( m, throwOnDegenerate ) { - } + if ( throwOnDegenerate !== undefined ) { - } + console.warn( "THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate." ); - return undefined; + } - }, + // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm + var te = this.elements, + me = m.elements, - getWorldPosition: function ( target ) { + n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], + n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], + n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], + n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], - if ( target === undefined ) { + t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, + t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, + t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, + t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' ); - target = new Vector3(); + var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; - } + if ( det === 0 ) { return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); } - this.updateMatrixWorld( true ); + var detInv = 1 / det; - return target.setFromMatrixPosition( this.matrixWorld ); + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; + te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; + te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; - }, + te[ 4 ] = t12 * detInv; + te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; + te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; + te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; - getWorldQuaternion: function ( target ) { + te[ 8 ] = t13 * detInv; + te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; + te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; + te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; - if ( target === undefined ) { + te[ 12 ] = t14 * detInv; + te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; + te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; + te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; - console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); - target = new Quaternion(); + return this; - } + }; - this.updateMatrixWorld( true ); + Matrix4.prototype.scale = function scale ( v ) { - this.matrixWorld.decompose( _position, target, _scale ); + var te = this.elements; + var x = v.x, y = v.y, z = v.z; - return target; + te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; + te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; + te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; + te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; - }, + return this; - getWorldScale: function ( target ) { + }; - if ( target === undefined ) { + Matrix4.prototype.getMaxScaleOnAxis = function getMaxScaleOnAxis () { - console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); - target = new Vector3(); + var te = this.elements; - } + var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; + var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; + var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; - this.updateMatrixWorld( true ); + return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); - this.matrixWorld.decompose( _position, _quaternion$2, target ); + }; - return target; + Matrix4.prototype.makeTranslation = function makeTranslation ( x, y, z ) { - }, + this.set( - getWorldDirection: function ( target ) { + 1, 0, 0, x, + 0, 1, 0, y, + 0, 0, 1, z, + 0, 0, 0, 1 - if ( target === undefined ) { + ); - console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' ); - target = new Vector3(); + return this; - } + }; - this.updateMatrixWorld( true ); + Matrix4.prototype.makeRotationX = function makeRotationX ( theta ) { - var e = this.matrixWorld.elements; + var c = Math.cos( theta ), s = Math.sin( theta ); - return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); + this.set( - }, + 1, 0, 0, 0, + 0, c, - s, 0, + 0, s, c, 0, + 0, 0, 0, 1 - raycast: function () {}, + ); - traverse: function ( callback ) { + return this; - callback( this ); + }; - var children = this.children; + Matrix4.prototype.makeRotationY = function makeRotationY ( theta ) { - for ( var i = 0, l = children.length; i < l; i ++ ) { + var c = Math.cos( theta ), s = Math.sin( theta ); - children[ i ].traverse( callback ); + this.set( - } + c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1 - }, + ); - traverseVisible: function ( callback ) { + return this; - if ( this.visible === false ) { return; } + }; - callback( this ); + Matrix4.prototype.makeRotationZ = function makeRotationZ ( theta ) { - var children = this.children; + var c = Math.cos( theta ), s = Math.sin( theta ); - for ( var i = 0, l = children.length; i < l; i ++ ) { + this.set( - children[ i ].traverseVisible( callback ); + c, - s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - } + ); - }, + return this; - traverseAncestors: function ( callback ) { + }; - var parent = this.parent; + Matrix4.prototype.makeRotationAxis = function makeRotationAxis ( axis, angle ) { - if ( parent !== null ) { + // Based on http://www.gamedev.net/reference/articles/article1199.asp - callback( parent ); + var c = Math.cos( angle ); + var s = Math.sin( angle ); + var t = 1 - c; + var x = axis.x, y = axis.y, z = axis.z; + var tx = t * x, ty = t * y; - parent.traverseAncestors( callback ); + this.set( - } + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 - }, + ); - updateMatrix: function () { + return this; - this.matrix.compose( this.position, this.quaternion, this.scale ); + }; - this.matrixWorldNeedsUpdate = true; + Matrix4.prototype.makeScale = function makeScale ( x, y, z ) { - }, + this.set( - updateMatrixWorld: function ( force ) { + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 - if ( this.matrixAutoUpdate ) { this.updateMatrix(); } + ); - if ( this.matrixWorldNeedsUpdate || force ) { + return this; - if ( this.parent === null ) { + }; - this.matrixWorld.copy( this.matrix ); + Matrix4.prototype.makeShear = function makeShear ( x, y, z ) { - } else { + this.set( - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + 1, y, z, 0, + x, 1, z, 0, + x, y, 1, 0, + 0, 0, 0, 1 - } + ); - this.matrixWorldNeedsUpdate = false; + return this; - force = true; + }; - } + Matrix4.prototype.compose = function compose ( position, quaternion, scale ) { - // update children + var te = this.elements; - var children = this.children; + var x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; + var x2 = x + x,y2 = y + y, z2 = z + z; + var xx = x * x2, xy = x * y2, xz = x * z2; + var yy = y * y2, yz = y * z2, zz = z * z2; + var wx = w * x2, wy = w * y2, wz = w * z2; - for ( var i = 0, l = children.length; i < l; i ++ ) { + var sx = scale.x, sy = scale.y, sz = scale.z; - children[ i ].updateMatrixWorld( force ); + te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; + te[ 1 ] = ( xy + wz ) * sx; + te[ 2 ] = ( xz - wy ) * sx; + te[ 3 ] = 0; - } + te[ 4 ] = ( xy - wz ) * sy; + te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; + te[ 6 ] = ( yz + wx ) * sy; + te[ 7 ] = 0; - }, + te[ 8 ] = ( xz + wy ) * sz; + te[ 9 ] = ( yz - wx ) * sz; + te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; + te[ 11 ] = 0; - updateWorldMatrix: function ( updateParents, updateChildren ) { + te[ 12 ] = position.x; + te[ 13 ] = position.y; + te[ 14 ] = position.z; + te[ 15 ] = 1; - var parent = this.parent; + return this; - if ( updateParents === true && parent !== null ) { + }; - parent.updateWorldMatrix( true, false ); + Matrix4.prototype.decompose = function decompose ( position, quaternion, scale ) { - } + var te = this.elements; - if ( this.matrixAutoUpdate ) { this.updateMatrix(); } + var sx = _v1$1.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); + var sy = _v1$1.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); + var sz = _v1$1.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); - if ( this.parent === null ) { + // if determine is negative, we need to invert one scale + var det = this.determinant(); + if ( det < 0 ) { sx = - sx; } - this.matrixWorld.copy( this.matrix ); + position.x = te[ 12 ]; + position.y = te[ 13 ]; + position.z = te[ 14 ]; - } else { + // scale the rotation part + _m1.copy( this ); - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + var invSX = 1 / sx; + var invSY = 1 / sy; + var invSZ = 1 / sz; - } + _m1.elements[ 0 ] *= invSX; + _m1.elements[ 1 ] *= invSX; + _m1.elements[ 2 ] *= invSX; - // update children + _m1.elements[ 4 ] *= invSY; + _m1.elements[ 5 ] *= invSY; + _m1.elements[ 6 ] *= invSY; - if ( updateChildren === true ) { + _m1.elements[ 8 ] *= invSZ; + _m1.elements[ 9 ] *= invSZ; + _m1.elements[ 10 ] *= invSZ; - var children = this.children; + quaternion.setFromRotationMatrix( _m1 ); - for ( var i = 0, l = children.length; i < l; i ++ ) { + scale.x = sx; + scale.y = sy; + scale.z = sz; - children[ i ].updateWorldMatrix( false, true ); + return this; - } + }; - } + Matrix4.prototype.makePerspective = function makePerspective ( left, right, top, bottom, near, far ) { - }, + if ( far === undefined ) { - toJSON: function ( meta ) { + console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); - // meta is a string when called from JSON.stringify - var isRootObject = ( meta === undefined || typeof meta === 'string' ); + } - var output = {}; + var te = this.elements; + var x = 2 * near / ( right - left ); + var y = 2 * near / ( top - bottom ); - // meta is a hash used to collect geometries, materials. - // not providing it implies that this is the root object - // being serialized. - if ( isRootObject ) { + var a = ( right + left ) / ( right - left ); + var b = ( top + bottom ) / ( top - bottom ); + var c = - ( far + near ) / ( far - near ); + var d = - 2 * far * near / ( far - near ); - // initialize meta obj - meta = { - geometries: {}, - materials: {}, - textures: {}, - images: {}, - shapes: {} - }; + te[ 0 ] = x;te[ 4 ] = 0;te[ 8 ] = a;te[ 12 ] = 0; + te[ 1 ] = 0;te[ 5 ] = y;te[ 9 ] = b;te[ 13 ] = 0; + te[ 2 ] = 0;te[ 6 ] = 0;te[ 10 ] = c;te[ 14 ] = d; + te[ 3 ] = 0;te[ 7 ] = 0;te[ 11 ] = - 1;te[ 15 ] = 0; - output.metadata = { - version: 4.5, - type: 'Object', - generator: 'Object3D.toJSON' - }; + return this; - } + }; - // standard Object3D serialization + Matrix4.prototype.makeOrthographic = function makeOrthographic ( left, right, top, bottom, near, far ) { - var object = {}; + var te = this.elements; + var w = 1.0 / ( right - left ); + var h = 1.0 / ( top - bottom ); + var p = 1.0 / ( far - near ); - object.uuid = this.uuid; - object.type = this.type; + var x = ( right + left ) * w; + var y = ( top + bottom ) * h; + var z = ( far + near ) * p; - if ( this.name !== '' ) { object.name = this.name; } - if ( this.castShadow === true ) { object.castShadow = true; } - if ( this.receiveShadow === true ) { object.receiveShadow = true; } - if ( this.visible === false ) { object.visible = false; } - if ( this.frustumCulled === false ) { object.frustumCulled = false; } - if ( this.renderOrder !== 0 ) { object.renderOrder = this.renderOrder; } - if ( JSON.stringify( this.userData ) !== '{}' ) { object.userData = this.userData; } + te[ 0 ] = 2 * w;te[ 4 ] = 0;te[ 8 ] = 0;te[ 12 ] = - x; + te[ 1 ] = 0;te[ 5 ] = 2 * h;te[ 9 ] = 0;te[ 13 ] = - y; + te[ 2 ] = 0;te[ 6 ] = 0;te[ 10 ] = - 2 * p;te[ 14 ] = - z; + te[ 3 ] = 0;te[ 7 ] = 0;te[ 11 ] = 0;te[ 15 ] = 1; - object.layers = this.layers.mask; - object.matrix = this.matrix.toArray(); + return this; - if ( this.matrixAutoUpdate === false ) { object.matrixAutoUpdate = false; } + }; - // object specific properties + Matrix4.prototype.equals = function equals ( matrix ) { - if ( this.isInstancedMesh ) { + var te = this.elements; + var me = matrix.elements; - object.type = 'InstancedMesh'; - object.count = this.count; - object.instanceMatrix = this.instanceMatrix.toJSON(); + for ( var i = 0; i < 16; i ++ ) { - } + if ( te[ i ] !== me[ i ] ) { return false; } - // + } - function serialize( library, element ) { + return true; - if ( library[ element.uuid ] === undefined ) { + }; - library[ element.uuid ] = element.toJSON( meta ); + Matrix4.prototype.fromArray = function fromArray ( array, offset ) { - } + if ( offset === undefined ) { offset = 0; } - return element.uuid; + for ( var i = 0; i < 16; i ++ ) { - } + this.elements[ i ] = array[ i + offset ]; - if ( this.isMesh || this.isLine || this.isPoints ) { + } - object.geometry = serialize( meta.geometries, this.geometry ); + return this; - var parameters = this.geometry.parameters; + }; - if ( parameters !== undefined && parameters.shapes !== undefined ) { + Matrix4.prototype.toArray = function toArray ( array, offset ) { - var shapes = parameters.shapes; + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - if ( Array.isArray( shapes ) ) { + var te = this.elements; - for ( var i = 0, l = shapes.length; i < l; i ++ ) { + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + array[ offset + 3 ] = te[ 3 ]; - var shape = shapes[ i ]; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; - serialize( meta.shapes, shape ); + array[ offset + 8 ] = te[ 8 ]; + array[ offset + 9 ] = te[ 9 ]; + array[ offset + 10 ] = te[ 10 ]; + array[ offset + 11 ] = te[ 11 ]; - } + array[ offset + 12 ] = te[ 12 ]; + array[ offset + 13 ] = te[ 13 ]; + array[ offset + 14 ] = te[ 14 ]; + array[ offset + 15 ] = te[ 15 ]; - } else { + return array; - serialize( meta.shapes, shapes ); + }; - } + Matrix4.prototype.isMatrix4 = true; - } + var _v1$1 = new Vector3(); + var _m1 = new Matrix4(); + var _zero = new Vector3( 0, 0, 0 ); + var _one = new Vector3( 1, 1, 1 ); + var _x = new Vector3(); + var _y = new Vector3(); + var _z = new Vector3(); - } + var Euler = function Euler( x, y, z, order ) { + if ( x === void 0 ) x = 0; + if ( y === void 0 ) y = 0; + if ( z === void 0 ) z = 0; + if ( order === void 0 ) order = Euler.DefaultOrder; - if ( this.material !== undefined ) { - if ( Array.isArray( this.material ) ) { + this._x = x; + this._y = y; + this._z = z; + this._order = order; - var uuids = []; + }; - for ( var i$1 = 0, l$1 = this.material.length; i$1 < l$1; i$1 ++ ) { + var prototypeAccessors$3 = { x: { configurable: true },y: { configurable: true },z: { configurable: true },order: { configurable: true } }; - uuids.push( serialize( meta.materials, this.material[ i$1 ] ) ); + prototypeAccessors$3.x.get = function () { - } + return this._x; - object.material = uuids; + }; - } else { + prototypeAccessors$3.x.set = function ( value ) { - object.material = serialize( meta.materials, this.material ); + this._x = value; + this._onChangeCallback(); - } + }; - } + prototypeAccessors$3.y.get = function () { - // + return this._y; - if ( this.children.length > 0 ) { + }; - object.children = []; + prototypeAccessors$3.y.set = function ( value ) { - for ( var i$2 = 0; i$2 < this.children.length; i$2 ++ ) { + this._y = value; + this._onChangeCallback(); - object.children.push( this.children[ i$2 ].toJSON( meta ).object ); + }; - } + prototypeAccessors$3.z.get = function () { - } + return this._z; - if ( isRootObject ) { + }; - var geometries = extractFromCache( meta.geometries ); - var materials = extractFromCache( meta.materials ); - var textures = extractFromCache( meta.textures ); - var images = extractFromCache( meta.images ); - var shapes$1 = extractFromCache( meta.shapes ); + prototypeAccessors$3.z.set = function ( value ) { - if ( geometries.length > 0 ) { output.geometries = geometries; } - if ( materials.length > 0 ) { output.materials = materials; } - if ( textures.length > 0 ) { output.textures = textures; } - if ( images.length > 0 ) { output.images = images; } - if ( shapes$1.length > 0 ) { output.shapes = shapes$1; } + this._z = value; + this._onChangeCallback(); - } + }; - output.object = object; + prototypeAccessors$3.order.get = function () { - return output; + return this._order; - // extract data from the cache hash - // remove metadata on each item - // and return as array - function extractFromCache( cache ) { + }; - var values = []; - for ( var key in cache ) { + prototypeAccessors$3.order.set = function ( value ) { - var data = cache[ key ]; - delete data.metadata; - values.push( data ); + this._order = value; + this._onChangeCallback(); - } + }; - return values; + Euler.prototype.set = function set ( x, y, z, order ) { - } + this._x = x; + this._y = y; + this._z = z; + this._order = order || this._order; - }, + this._onChangeCallback(); - clone: function ( recursive ) { + return this; - return new this.constructor().copy( this, recursive ); + }; - }, + Euler.prototype.clone = function clone () { - copy: function ( source, recursive ) { + return new this.constructor( this._x, this._y, this._z, this._order ); - if ( recursive === undefined ) { recursive = true; } + }; - this.name = source.name; + Euler.prototype.copy = function copy ( euler ) { - this.up.copy( source.up ); + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; - this.position.copy( source.position ); - this.rotation.order = source.rotation.order; - this.quaternion.copy( source.quaternion ); - this.scale.copy( source.scale ); + this._onChangeCallback(); - this.matrix.copy( source.matrix ); - this.matrixWorld.copy( source.matrixWorld ); + return this; - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; + }; - this.layers.mask = source.layers.mask; - this.visible = source.visible; + Euler.prototype.setFromRotationMatrix = function setFromRotationMatrix ( m, order, update ) { - this.castShadow = source.castShadow; - this.receiveShadow = source.receiveShadow; + var clamp = MathUtils.clamp; - this.frustumCulled = source.frustumCulled; - this.renderOrder = source.renderOrder; + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - this.userData = JSON.parse( JSON.stringify( source.userData ) ); + var te = m.elements; + var m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; + var m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; + var m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - if ( recursive === true ) { + order = order || this._order; - for ( var i = 0; i < source.children.length; i ++ ) { + switch ( order ) { - var child = source.children[ i ]; - this.add( child.clone() ); + case 'XYZ': - } + this._y = Math.asin( clamp( m13, - 1, 1 ) ); - } + if ( Math.abs( m13 ) < 0.9999999 ) { - return this; + this._x = Math.atan2( - m23, m33 ); + this._z = Math.atan2( - m12, m11 ); - } + } else { - } ); + this._x = Math.atan2( m32, m22 ); + this._z = 0; - function Scene() { + } - Object3D.call( this ); + break; - this.type = 'Scene'; + case 'YXZ': - this.background = null; - this.environment = null; - this.fog = null; + this._x = Math.asin( - clamp( m23, - 1, 1 ) ); - this.overrideMaterial = null; + if ( Math.abs( m23 ) < 0.9999999 ) { - this.autoUpdate = true; // checked by the renderer + this._y = Math.atan2( m13, m33 ); + this._z = Math.atan2( m21, m22 ); - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + } else { - __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef + this._y = Math.atan2( - m31, m11 ); + this._z = 0; - } + } - } + break; - Scene.prototype = Object.assign( Object.create( Object3D.prototype ), { + case 'ZXY': - constructor: Scene, + this._x = Math.asin( clamp( m32, - 1, 1 ) ); - isScene: true, + if ( Math.abs( m32 ) < 0.9999999 ) { - copy: function ( source, recursive ) { + this._y = Math.atan2( - m31, m33 ); + this._z = Math.atan2( - m12, m22 ); - Object3D.prototype.copy.call( this, source, recursive ); + } else { - if ( source.background !== null ) { this.background = source.background.clone(); } - if ( source.environment !== null ) { this.environment = source.environment.clone(); } - if ( source.fog !== null ) { this.fog = source.fog.clone(); } + this._y = 0; + this._z = Math.atan2( m21, m11 ); - if ( source.overrideMaterial !== null ) { this.overrideMaterial = source.overrideMaterial.clone(); } + } - this.autoUpdate = source.autoUpdate; - this.matrixAutoUpdate = source.matrixAutoUpdate; + break; - return this; + case 'ZYX': - }, + this._y = Math.asin( - clamp( m31, - 1, 1 ) ); - toJSON: function ( meta ) { + if ( Math.abs( m31 ) < 0.9999999 ) { - var data = Object3D.prototype.toJSON.call( this, meta ); + this._x = Math.atan2( m32, m33 ); + this._z = Math.atan2( m21, m11 ); - if ( this.background !== null ) { data.object.background = this.background.toJSON( meta ); } - if ( this.environment !== null ) { data.object.environment = this.environment.toJSON( meta ); } - if ( this.fog !== null ) { data.object.fog = this.fog.toJSON(); } + } else { - return data; + this._x = 0; + this._z = Math.atan2( - m12, m22 ); - } + } - } ); + break; - var _points = [ - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3() - ]; + case 'YZX': - var _vector$1 = new Vector3(); + this._z = Math.asin( clamp( m21, - 1, 1 ) ); - var _box = new Box3(); + if ( Math.abs( m21 ) < 0.9999999 ) { - // triangle centered vertices + this._x = Math.atan2( - m23, m22 ); + this._y = Math.atan2( - m31, m11 ); - var _v0 = new Vector3(); - var _v1$2 = new Vector3(); - var _v2 = new Vector3(); + } else { - // triangle edge vectors + this._x = 0; + this._y = Math.atan2( m13, m33 ); - var _f0 = new Vector3(); - var _f1 = new Vector3(); - var _f2 = new Vector3(); + } - var _center = new Vector3(); - var _extents = new Vector3(); - var _triangleNormal = new Vector3(); - var _testAxis = new Vector3(); + break; - function Box3( min, max ) { + case 'XZY': - this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); + this._z = Math.asin( - clamp( m12, - 1, 1 ) ); - } + if ( Math.abs( m12 ) < 0.9999999 ) { + this._x = Math.atan2( m32, m22 ); + this._y = Math.atan2( m13, m11 ); - Object.assign( Box3.prototype, { + } else { - isBox3: true, + this._x = Math.atan2( - m23, m33 ); + this._y = 0; - set: function ( min, max ) { + } - this.min.copy( min ); - this.max.copy( max ); + break; - return this; + default: - }, + console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); - setFromArray: function ( array ) { + } - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; + this._order = order; - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; + if ( update !== false ) { this._onChangeCallback(); } - for ( var i = 0, l = array.length; i < l; i += 3 ) { + return this; - var x = array[ i ]; - var y = array[ i + 1 ]; - var z = array[ i + 2 ]; + }; - if ( x < minX ) { minX = x; } - if ( y < minY ) { minY = y; } - if ( z < minZ ) { minZ = z; } + Euler.prototype.setFromQuaternion = function setFromQuaternion ( q, order, update ) { - if ( x > maxX ) { maxX = x; } - if ( y > maxY ) { maxY = y; } - if ( z > maxZ ) { maxZ = z; } + _matrix.makeRotationFromQuaternion( q ); - } + return this.setFromRotationMatrix( _matrix, order, update ); - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + }; - return this; + Euler.prototype.setFromVector3 = function setFromVector3 ( v, order ) { - }, + return this.set( v.x, v.y, v.z, order || this._order ); - setFromBufferAttribute: function ( attribute ) { + }; - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; + Euler.prototype.reorder = function reorder ( newOrder ) { - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; + // WARNING: this discards revolution information -bhouston - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + _quaternion$1.setFromEuler( this ); - var x = attribute.getX( i ); - var y = attribute.getY( i ); - var z = attribute.getZ( i ); + return this.setFromQuaternion( _quaternion$1, newOrder ); - if ( x < minX ) { minX = x; } - if ( y < minY ) { minY = y; } - if ( z < minZ ) { minZ = z; } + }; - if ( x > maxX ) { maxX = x; } - if ( y > maxY ) { maxY = y; } - if ( z > maxZ ) { maxZ = z; } + Euler.prototype.equals = function equals ( euler ) { - } + return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + }; - return this; + Euler.prototype.fromArray = function fromArray ( array ) { - }, + this._x = array[ 0 ]; + this._y = array[ 1 ]; + this._z = array[ 2 ]; + if ( array[ 3 ] !== undefined ) { this._order = array[ 3 ]; } - setFromPoints: function ( points ) { + this._onChangeCallback(); - this.makeEmpty(); + return this; - for ( var i = 0, il = points.length; i < il; i ++ ) { + }; - this.expandByPoint( points[ i ] ); + Euler.prototype.toArray = function toArray ( array, offset ) { - } + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - return this; + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._order; - }, + return array; - setFromCenterAndSize: function ( center, size ) { + }; - var halfSize = _vector$1.copy( size ).multiplyScalar( 0.5 ); + Euler.prototype.toVector3 = function toVector3 ( optionalResult ) { - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); + if ( optionalResult ) { - return this; + return optionalResult.set( this._x, this._y, this._z ); - }, + } else { - setFromObject: function ( object ) { + return new Vector3( this._x, this._y, this._z ); - this.makeEmpty(); + } - return this.expandByObject( object ); + }; - }, + Euler.prototype._onChange = function _onChange ( callback ) { - clone: function () { + this._onChangeCallback = callback; - return new this.constructor().copy( this ); + return this; - }, + }; - copy: function ( box ) { + Euler.prototype._onChangeCallback = function _onChangeCallback () {}; - this.min.copy( box.min ); - this.max.copy( box.max ); + Object.defineProperties( Euler.prototype, prototypeAccessors$3 ); - return this; + Euler.DefaultOrder = 'XYZ'; + Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; + Euler.prototype.isEuler = true; - }, + var _matrix = new Matrix4(); + var _quaternion$1 = new Quaternion(); - makeEmpty: function () { + var Layers = function Layers() { - this.min.x = this.min.y = this.min.z = + Infinity; - this.max.x = this.max.y = this.max.z = - Infinity; + this.mask = 1 | 0; - return this; + }; - }, + Layers.prototype.set = function set ( channel ) { - isEmpty: function () { + this.mask = 1 << channel | 0; - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + }; - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); + Layers.prototype.enable = function enable ( channel ) { - }, + this.mask |= 1 << channel | 0; - getCenter: function ( target ) { + }; - if ( target === undefined ) { + Layers.prototype.enableAll = function enableAll () { - console.warn( 'THREE.Box3: .getCenter() target is now required' ); - target = new Vector3(); + this.mask = 0xffffffff | 0; - } + }; - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + Layers.prototype.toggle = function toggle ( channel ) { - }, + this.mask ^= 1 << channel | 0; - getSize: function ( target ) { + }; - if ( target === undefined ) { + Layers.prototype.disable = function disable ( channel ) { - console.warn( 'THREE.Box3: .getSize() target is now required' ); - target = new Vector3(); + this.mask &= ~ ( 1 << channel | 0 ); - } + }; - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); + Layers.prototype.disableAll = function disableAll () { - }, + this.mask = 0; - expandByPoint: function ( point ) { + }; - this.min.min( point ); - this.max.max( point ); + Layers.prototype.test = function test ( layers ) { - return this; + return ( this.mask & layers.mask ) !== 0; - }, + }; - expandByVector: function ( vector ) { + var _object3DId = 0; - this.min.sub( vector ); - this.max.add( vector ); + var _v1$2 = new Vector3(); + var _q1 = new Quaternion(); + var _m1$1 = new Matrix4(); + var _target = new Vector3(); - return this; + var _position = new Vector3(); + var _scale = new Vector3(); + var _quaternion$2 = new Quaternion(); - }, + var _xAxis = new Vector3( 1, 0, 0 ); + var _yAxis = new Vector3( 0, 1, 0 ); + var _zAxis = new Vector3( 0, 0, 1 ); - expandByScalar: function ( scalar ) { + var _addedEvent = { type: 'added' }; + var _removedEvent = { type: 'removed' }; - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); + function Object3D() { - return this; + Object.defineProperty( this, 'id', { value: _object3DId ++ } ); - }, + this.uuid = MathUtils.generateUUID(); - expandByObject: function ( object ) { + this.name = ''; + this.type = 'Object3D'; - // Computes the world-axis-aligned bounding box of an object (including its children), - // accounting for both the object's, and children's, world transforms + this.parent = null; + this.children = []; - object.updateWorldMatrix( false, false ); + this.up = Object3D.DefaultUp.clone(); - var geometry = object.geometry; + var position = new Vector3(); + var rotation = new Euler(); + var quaternion = new Quaternion(); + var scale = new Vector3( 1, 1, 1 ); + + function onRotationChange() { - if ( geometry !== undefined ) { + quaternion.setFromEuler( rotation, false ); - if ( geometry.boundingBox === null ) { + } - geometry.computeBoundingBox(); + function onQuaternionChange() { - } + rotation.setFromQuaternion( quaternion, undefined, false ); - _box.copy( geometry.boundingBox ); - _box.applyMatrix4( object.matrixWorld ); + } - this.union( _box ); + rotation._onChange( onRotationChange ); + quaternion._onChange( onQuaternionChange ); + Object.defineProperties( this, { + position: { + configurable: true, + enumerable: true, + value: position + }, + rotation: { + configurable: true, + enumerable: true, + value: rotation + }, + quaternion: { + configurable: true, + enumerable: true, + value: quaternion + }, + scale: { + configurable: true, + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() } + } ); - var children = object.children; + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); - for ( var i = 0, l = children.length; i < l; i ++ ) { + this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; + this.matrixWorldNeedsUpdate = false; - this.expandByObject( children[ i ] ); + this.layers = new Layers(); + this.visible = true; - } + this.castShadow = false; + this.receiveShadow = false; - return this; + this.frustumCulled = true; + this.renderOrder = 0; - }, + this.userData = {}; - containsPoint: function ( point ) { + } - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y || - point.z < this.min.z || point.z > this.max.z ? false : true; + Object3D.DefaultUp = new Vector3( 0, 1, 0 ); + Object3D.DefaultMatrixAutoUpdate = true; - }, + Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - containsBox: function ( box ) { + constructor: Object3D, - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y && - this.min.z <= box.min.z && box.max.z <= this.max.z; + isObject3D: true, - }, + onBeforeRender: function () {}, + onAfterRender: function () {}, - getParameter: function ( point, target ) { + applyMatrix4: function ( matrix ) { - // This can potentially have a divide by zero if the box - // has a size dimension of 0. + if ( this.matrixAutoUpdate ) { this.updateMatrix(); } - if ( target === undefined ) { + this.matrix.premultiply( matrix ); - console.warn( 'THREE.Box3: .getParameter() target is now required' ); - target = new Vector3(); + this.matrix.decompose( this.position, this.quaternion, this.scale ); - } + }, - return target.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ), - ( point.z - this.min.z ) / ( this.max.z - this.min.z ) - ); + applyQuaternion: function ( q ) { + + this.quaternion.premultiply( q ); + + return this; }, - intersectsBox: function ( box ) { + setRotationFromAxisAngle: function ( axis, angle ) { - // using 6 splitting planes to rule out intersections. - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y || - box.max.z < this.min.z || box.min.z > this.max.z ? false : true; + // assumes axis is normalized - }, + this.quaternion.setFromAxisAngle( axis, angle ); - intersectsSphere: function ( sphere ) { + }, - // Find the point on the AABB closest to the sphere center. - this.clampPoint( sphere.center, _vector$1 ); + setRotationFromEuler: function ( euler ) { - // If that point is inside the sphere, the AABB and sphere intersect. - return _vector$1.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); + this.quaternion.setFromEuler( euler, true ); }, - intersectsPlane: function ( plane ) { + setRotationFromMatrix: function ( m ) { - // We compute the minimum and maximum dot product values. If those values - // are on the same side (back or front) of the plane, then there is no intersection. + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - var min, max; + this.quaternion.setFromRotationMatrix( m ); - if ( plane.normal.x > 0 ) { + }, - min = plane.normal.x * this.min.x; - max = plane.normal.x * this.max.x; + setRotationFromQuaternion: function ( q ) { - } else { + // assumes q is normalized - min = plane.normal.x * this.max.x; - max = plane.normal.x * this.min.x; + this.quaternion.copy( q ); - } + }, - if ( plane.normal.y > 0 ) { + rotateOnAxis: function ( axis, angle ) { - min += plane.normal.y * this.min.y; - max += plane.normal.y * this.max.y; + // rotate object on axis in object space + // axis is assumed to be normalized - } else { + _q1.setFromAxisAngle( axis, angle ); - min += plane.normal.y * this.max.y; - max += plane.normal.y * this.min.y; + this.quaternion.multiply( _q1 ); - } + return this; - if ( plane.normal.z > 0 ) { + }, - min += plane.normal.z * this.min.z; - max += plane.normal.z * this.max.z; + rotateOnWorldAxis: function ( axis, angle ) { - } else { + // rotate object on axis in world space + // axis is assumed to be normalized + // method assumes no rotated parent - min += plane.normal.z * this.max.z; - max += plane.normal.z * this.min.z; + _q1.setFromAxisAngle( axis, angle ); - } + this.quaternion.premultiply( _q1 ); - return ( min <= - plane.constant && max >= - plane.constant ); + return this; }, - intersectsTriangle: function ( triangle ) { - - if ( this.isEmpty() ) { + rotateX: function ( angle ) { - return false; + return this.rotateOnAxis( _xAxis, angle ); - } + }, - // compute box center and extents - this.getCenter( _center ); - _extents.subVectors( this.max, _center ); + rotateY: function ( angle ) { - // translate triangle to aabb origin - _v0.subVectors( triangle.a, _center ); - _v1$2.subVectors( triangle.b, _center ); - _v2.subVectors( triangle.c, _center ); + return this.rotateOnAxis( _yAxis, angle ); - // compute edge vectors for triangle - _f0.subVectors( _v1$2, _v0 ); - _f1.subVectors( _v2, _v1$2 ); - _f2.subVectors( _v0, _v2 ); + }, - // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb - // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation - // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) - var axes = [ - 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, - _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, - - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 - ]; - if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { + rotateZ: function ( angle ) { - return false; + return this.rotateOnAxis( _zAxis, angle ); - } + }, - // test 3 face normals from the aabb - axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; - if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { + translateOnAxis: function ( axis, distance ) { - return false; + // translate object by distance along axis in object space + // axis is assumed to be normalized - } + _v1$2.copy( axis ).applyQuaternion( this.quaternion ); - // finally testing the face normal of the triangle - // use already existing triangle edge vectors here - _triangleNormal.crossVectors( _f0, _f1 ); - axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; + this.position.add( _v1$2.multiplyScalar( distance ) ); - return satForAxes( axes, _v0, _v1$2, _v2, _extents ); + return this; }, - clampPoint: function ( point, target ) { + translateX: function ( distance ) { - if ( target === undefined ) { + return this.translateOnAxis( _xAxis, distance ); - console.warn( 'THREE.Box3: .clampPoint() target is now required' ); - target = new Vector3(); + }, - } + translateY: function ( distance ) { - return target.copy( point ).clamp( this.min, this.max ); + return this.translateOnAxis( _yAxis, distance ); }, - distanceToPoint: function ( point ) { - - var clampedPoint = _vector$1.copy( point ).clamp( this.min, this.max ); + translateZ: function ( distance ) { - return clampedPoint.sub( point ).length(); + return this.translateOnAxis( _zAxis, distance ); }, - getBoundingSphere: function ( target ) { - - if ( target === undefined ) { - - console.error( 'THREE.Box3: .getBoundingSphere() target is now required' ); - //target = new Sphere(); // removed to avoid cyclic dependency + localToWorld: function ( vector ) { - } + return vector.applyMatrix4( this.matrixWorld ); - this.getCenter( target.center ); + }, - target.radius = this.getSize( _vector$1 ).length() * 0.5; + worldToLocal: function ( vector ) { - return target; + return vector.applyMatrix4( _m1$1.getInverse( this.matrixWorld ) ); }, - intersect: function ( box ) { + lookAt: function ( x, y, z ) { - this.min.max( box.min ); - this.max.min( box.max ); + // This method does not support objects having non-uniformly-scaled parent(s) - // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. - if ( this.isEmpty() ) { this.makeEmpty(); } + if ( x.isVector3 ) { - return this; + _target.copy( x ); - }, + } else { - union: function ( box ) { + _target.set( x, y, z ); - this.min.min( box.min ); - this.max.max( box.max ); + } - return this; + var parent = this.parent; - }, + this.updateWorldMatrix( true, false ); - applyMatrix4: function ( matrix ) { + _position.setFromMatrixPosition( this.matrixWorld ); - // transform of empty box is an empty box. - if ( this.isEmpty() ) { return this; } + if ( this.isCamera || this.isLight ) { - // NOTE: I am using a binary pattern to specify all 2^3 combinations below - _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 - _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 - _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 - _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 - _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 - _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 - _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 - _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 + _m1$1.lookAt( _position, _target, this.up ); - this.setFromPoints( _points ); + } else { - return this; + _m1$1.lookAt( _target, _position, this.up ); - }, + } - translate: function ( offset ) { + this.quaternion.setFromRotationMatrix( _m1$1 ); - this.min.add( offset ); - this.max.add( offset ); + if ( parent ) { - return this; + _m1$1.extractRotation( parent.matrixWorld ); + _q1.setFromRotationMatrix( _m1$1 ); + this.quaternion.premultiply( _q1.inverse() ); + + } }, - equals: function ( box ) { + add: function ( object ) { - return box.min.equals( this.min ) && box.max.equals( this.max ); + if ( arguments.length > 1 ) { - } + for ( var i = 0; i < arguments.length; i ++ ) { - } ); + this.add( arguments[ i ] ); - function satForAxes( axes, v0, v1, v2, extents ) { + } - for ( var i = 0, j = axes.length - 3; i <= j; i += 3 ) { + return this; - _testAxis.fromArray( axes, i ); - // project the aabb onto the seperating axis - var r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); - // project all 3 vertices of the triangle onto the seperating axis - var p0 = v0.dot( _testAxis ); - var p1 = v1.dot( _testAxis ); - var p2 = v2.dot( _testAxis ); - // actual test, basically see if either of the most extreme of the triangle points intersects r - if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { + } - // points of the projected triangle are outside the projected half-length of the aabb - // the axis is seperating and we can exit - return false; + if ( object === this ) { - } + console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); + return this; - } + } - return true; + if ( ( object && object.isObject3D ) ) { - } + if ( object.parent !== null ) { - var _box$1 = new Box3(); + object.parent.remove( object ); - function Sphere( center, radius ) { + } - this.center = ( center !== undefined ) ? center : new Vector3(); - this.radius = ( radius !== undefined ) ? radius : - 1; + object.parent = this; + this.children.push( object ); - } + object.dispatchEvent( _addedEvent ); - Object.assign( Sphere.prototype, { + } else { - set: function ( center, radius ) { + console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); - this.center.copy( center ); - this.radius = radius; + } return this; }, - setFromPoints: function ( points, optionalCenter ) { + remove: function ( object ) { - var center = this.center; + if ( arguments.length > 1 ) { - if ( optionalCenter !== undefined ) { + for ( var i = 0; i < arguments.length; i ++ ) { - center.copy( optionalCenter ); + this.remove( arguments[ i ] ); - } else { + } - _box$1.setFromPoints( points ).getCenter( center ); + return this; } - var maxRadiusSq = 0; + var index = this.children.indexOf( object ); + + if ( index !== - 1 ) { - for ( var i = 0, il = points.length; i < il; i ++ ) { + object.parent = null; + this.children.splice( index, 1 ); - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + object.dispatchEvent( _removedEvent ); } - this.radius = Math.sqrt( maxRadiusSq ); - return this; }, - clone: function () { - - return new this.constructor().copy( this ); + attach: function ( object ) { - }, + // adds object as a child of this, while maintaining the object's world transform - copy: function ( sphere ) { + this.updateWorldMatrix( true, false ); - this.center.copy( sphere.center ); - this.radius = sphere.radius; + _m1$1.getInverse( this.matrixWorld ); - return this; + if ( object.parent !== null ) { - }, + object.parent.updateWorldMatrix( true, false ); - isEmpty: function () { + _m1$1.multiply( object.parent.matrixWorld ); - return ( this.radius < 0 ); + } - }, + object.applyMatrix4( _m1$1 ); - makeEmpty: function () { + object.updateWorldMatrix( false, false ); - this.center.set( 0, 0, 0 ); - this.radius = - 1; + this.add( object ); return this; }, - containsPoint: function ( point ) { + getObjectById: function ( id ) { - return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); + return this.getObjectByProperty( 'id', id ); }, - distanceToPoint: function ( point ) { + getObjectByName: function ( name ) { - return ( point.distanceTo( this.center ) - this.radius ); + return this.getObjectByProperty( 'name', name ); }, - intersectsSphere: function ( sphere ) { + getObjectByProperty: function ( name, value ) { - var radiusSum = this.radius + sphere.radius; + if ( this[ name ] === value ) { return this; } - return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); + for ( var i = 0, l = this.children.length; i < l; i ++ ) { - }, + var child = this.children[ i ]; + var object = child.getObjectByProperty( name, value ); - intersectsBox: function ( box ) { + if ( object !== undefined ) { - return box.intersectsSphere( this ); + return object; - }, + } - intersectsPlane: function ( plane ) { + } - return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; + return undefined; }, - clampPoint: function ( point, target ) { - - var deltaLengthSq = this.center.distanceToSquared( point ); + getWorldPosition: function ( target ) { if ( target === undefined ) { - console.warn( 'THREE.Sphere: .clampPoint() target is now required' ); + console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' ); target = new Vector3(); } - target.copy( point ); - - if ( deltaLengthSq > ( this.radius * this.radius ) ) { - - target.sub( this.center ).normalize(); - target.multiplyScalar( this.radius ).add( this.center ); - - } + this.updateMatrixWorld( true ); - return target; + return target.setFromMatrixPosition( this.matrixWorld ); }, - getBoundingBox: function ( target ) { + getWorldQuaternion: function ( target ) { if ( target === undefined ) { - console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' ); - target = new Box3(); + console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); + target = new Quaternion(); } - if ( this.isEmpty() ) { - - // Empty sphere produces empty bounding box - target.makeEmpty(); - return target; - - } + this.updateMatrixWorld( true ); - target.set( this.center, this.center ); - target.expandByScalar( this.radius ); + this.matrixWorld.decompose( _position, target, _scale ); return target; }, - applyMatrix4: function ( matrix ) { + getWorldScale: function ( target ) { - this.center.applyMatrix4( matrix ); - this.radius = this.radius * matrix.getMaxScaleOnAxis(); + if ( target === undefined ) { - return this; + console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); + target = new Vector3(); - }, + } - translate: function ( offset ) { + this.updateMatrixWorld( true ); - this.center.add( offset ); + this.matrixWorld.decompose( _position, _quaternion$2, target ); - return this; + return target; }, - equals: function ( sphere ) { - - return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); - - } - - } ); - - var _vector$2 = new Vector3(); - var _segCenter = new Vector3(); - var _segDir = new Vector3(); - var _diff = new Vector3(); - - var _edge1 = new Vector3(); - var _edge2 = new Vector3(); - var _normal = new Vector3(); - - var Ray = function Ray( origin, direction ) { - - this.origin = ( origin !== undefined ) ? origin : new Vector3(); - this.direction = ( direction !== undefined ) ? direction : new Vector3( 0, 0, - 1 ); - - }; - - Ray.prototype.set = function set ( origin, direction ) { - - this.origin.copy( origin ); - this.direction.copy( direction ); - - return this; - - }; - - Ray.prototype.clone = function clone () { - - return new this.constructor().copy( this ); - - }; - - Ray.prototype.copy = function copy ( ray ) { - - this.origin.copy( ray.origin ); - this.direction.copy( ray.direction ); - - return this; - - }; - - Ray.prototype.at = function at ( t, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Ray: .at() target is now required' ); - target = new Vector3(); - - } - - return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); - - }; - - Ray.prototype.lookAt = function lookAt ( v ) { - - this.direction.copy( v ).sub( this.origin ).normalize(); - - return this; - - }; - - Ray.prototype.recast = function recast ( t ) { - - this.origin.copy( this.at( t, _vector$2 ) ); - - return this; - - }; + getWorldDirection: function ( target ) { - Ray.prototype.closestPointToPoint = function closestPointToPoint ( point, target ) { + if ( target === undefined ) { - if ( target === undefined ) { + console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' ); + target = new Vector3(); - console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' ); - target = new Vector3(); + } - } + this.updateMatrixWorld( true ); - target.subVectors( point, this.origin ); + var e = this.matrixWorld.elements; - var directionDistance = target.dot( this.direction ); + return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); - if ( directionDistance < 0 ) { + }, - return target.copy( this.origin ); + raycast: function () {}, - } + traverse: function ( callback ) { - return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + callback( this ); - }; + var children = this.children; - Ray.prototype.distanceToPoint = function distanceToPoint ( point ) { + for ( var i = 0, l = children.length; i < l; i ++ ) { - return Math.sqrt( this.distanceSqToPoint( point ) ); + children[ i ].traverse( callback ); - }; + } - Ray.prototype.distanceSqToPoint = function distanceSqToPoint ( point ) { + }, - var directionDistance = _vector$2.subVectors( point, this.origin ).dot( this.direction ); + traverseVisible: function ( callback ) { - // point behind the ray + if ( this.visible === false ) { return; } - if ( directionDistance < 0 ) { + callback( this ); - return this.origin.distanceToSquared( point ); + var children = this.children; - } + for ( var i = 0, l = children.length; i < l; i ++ ) { - _vector$2.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + children[ i ].traverseVisible( callback ); - return _vector$2.distanceToSquared( point ); + } - }; + }, - Ray.prototype.distanceSqToSegment = function distanceSqToSegment ( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { + traverseAncestors: function ( callback ) { - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h - // It returns the min distance between the ray and the segment - // defined by v0 and v1 - // It can also set two optional targets : - // - The closest point on the ray - // - The closest point on the segment + var parent = this.parent; - _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); - _segDir.copy( v1 ).sub( v0 ).normalize(); - _diff.copy( this.origin ).sub( _segCenter ); + if ( parent !== null ) { - var segExtent = v0.distanceTo( v1 ) * 0.5; - var a01 = - this.direction.dot( _segDir ); - var b0 = _diff.dot( this.direction ); - var b1 = - _diff.dot( _segDir ); - var c = _diff.lengthSq(); - var det = Math.abs( 1 - a01 * a01 ); - var s0, s1, sqrDist, extDet; + callback( parent ); - if ( det > 0 ) { + parent.traverseAncestors( callback ); - // The ray and segment are not parallel. + } - s0 = a01 * b1 - b0; - s1 = a01 * b0 - b1; - extDet = segExtent * det; + }, - if ( s0 >= 0 ) { + updateMatrix: function () { - if ( s1 >= - extDet ) { + this.matrix.compose( this.position, this.quaternion, this.scale ); - if ( s1 <= extDet ) { + this.matrixWorldNeedsUpdate = true; - // region 0 - // Minimum at interior points of ray and segment. + }, - var invDet = 1 / det; - s0 *= invDet; - s1 *= invDet; - sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; + updateMatrixWorld: function ( force ) { - } else { + if ( this.matrixAutoUpdate ) { this.updateMatrix(); } - // region 1 + if ( this.matrixWorldNeedsUpdate || force ) { - s1 = segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + if ( this.parent === null ) { - } + this.matrixWorld.copy( this.matrix ); } else { - // region 5 - - s1 = - segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); } - } else { - - if ( s1 <= - extDet ) { - - // region 4 - - s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } else if ( s1 <= extDet ) { - - // region 3 - - s0 = 0; - s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = s1 * ( s1 + 2 * b1 ) + c; - - } else { - - // region 2 - - s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + this.matrixWorldNeedsUpdate = false; - } + force = true; } - } else { - - // Ray and segment are parallel. - - s1 = ( a01 > 0 ) ? - segExtent : segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } - - if ( optionalPointOnRay ) { - - optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); - - } - - if ( optionalPointOnSegment ) { + // update children - optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); + var children = this.children; - } + for ( var i = 0, l = children.length; i < l; i ++ ) { - return sqrDist; + children[ i ].updateMatrixWorld( force ); - }; + } - Ray.prototype.intersectSphere = function intersectSphere ( sphere, target ) { + }, - _vector$2.subVectors( sphere.center, this.origin ); - var tca = _vector$2.dot( this.direction ); - var d2 = _vector$2.dot( _vector$2 ) - tca * tca; - var radius2 = sphere.radius * sphere.radius; + updateWorldMatrix: function ( updateParents, updateChildren ) { - if ( d2 > radius2 ) { return null; } + var parent = this.parent; - var thc = Math.sqrt( radius2 - d2 ); + if ( updateParents === true && parent !== null ) { - // t0 = first intersect point - entrance on front of sphere - var t0 = tca - thc; + parent.updateWorldMatrix( true, false ); - // t1 = second intersect point - exit point on back of sphere - var t1 = tca + thc; + } - // test to see if both t0 and t1 are behind the ray - if so, return null - if ( t0 < 0 && t1 < 0 ) { return null; } + if ( this.matrixAutoUpdate ) { this.updateMatrix(); } - // test to see if t0 is behind the ray: - // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, - // in order to always return an intersect point that is in front of the ray. - if ( t0 < 0 ) { return this.at( t1, target ); } + if ( this.parent === null ) { - // else t0 is in front of the ray, so return the first collision point scaled by t0 - return this.at( t0, target ); + this.matrixWorld.copy( this.matrix ); - }; + } else { - Ray.prototype.intersectsSphere = function intersectsSphere ( sphere ) { + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); + } - }; + // update children - Ray.prototype.distanceToPlane = function distanceToPlane ( plane ) { + if ( updateChildren === true ) { - var denominator = plane.normal.dot( this.direction ); + var children = this.children; - if ( denominator === 0 ) { + for ( var i = 0, l = children.length; i < l; i ++ ) { - // line is coplanar, return origin - if ( plane.distanceToPoint( this.origin ) === 0 ) { + children[ i ].updateWorldMatrix( false, true ); - return 0; + } } - // Null is preferable to undefined since undefined means.... it is undefined - - return null; - - } - - var t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; - - // Return if the ray never intersects the plane + }, - return t >= 0 ? t : null; + toJSON: function ( meta ) { - }; + // meta is a string when called from JSON.stringify + var isRootObject = ( meta === undefined || typeof meta === 'string' ); - Ray.prototype.intersectPlane = function intersectPlane ( plane, target ) { + var output = {}; - var t = this.distanceToPlane( plane ); + // meta is a hash used to collect geometries, materials. + // not providing it implies that this is the root object + // being serialized. + if ( isRootObject ) { - if ( t === null ) { + // initialize meta obj + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {}, + shapes: {} + }; - return null; + output.metadata = { + version: 4.5, + type: 'Object', + generator: 'Object3D.toJSON' + }; - } + } - return this.at( t, target ); + // standard Object3D serialization - }; + var object = {}; - Ray.prototype.intersectsPlane = function intersectsPlane ( plane ) { + object.uuid = this.uuid; + object.type = this.type; - // check if the ray lies on the plane first + if ( this.name !== '' ) { object.name = this.name; } + if ( this.castShadow === true ) { object.castShadow = true; } + if ( this.receiveShadow === true ) { object.receiveShadow = true; } + if ( this.visible === false ) { object.visible = false; } + if ( this.frustumCulled === false ) { object.frustumCulled = false; } + if ( this.renderOrder !== 0 ) { object.renderOrder = this.renderOrder; } + if ( JSON.stringify( this.userData ) !== '{}' ) { object.userData = this.userData; } - var distToPoint = plane.distanceToPoint( this.origin ); + object.layers = this.layers.mask; + object.matrix = this.matrix.toArray(); - if ( distToPoint === 0 ) { + if ( this.matrixAutoUpdate === false ) { object.matrixAutoUpdate = false; } - return true; + // object specific properties - } + if ( this.isInstancedMesh ) { - var denominator = plane.normal.dot( this.direction ); + object.type = 'InstancedMesh'; + object.count = this.count; + object.instanceMatrix = this.instanceMatrix.toJSON(); - if ( denominator * distToPoint < 0 ) { + } - return true; + // - } + function serialize( library, element ) { - // ray origin is behind the plane (and is pointing behind it) + if ( library[ element.uuid ] === undefined ) { - return false; + library[ element.uuid ] = element.toJSON( meta ); - }; + } - Ray.prototype.intersectBox = function intersectBox ( box, target ) { + return element.uuid; - var tmin, tmax, tymin, tymax, tzmin, tzmax; + } - var invdirx = 1 / this.direction.x, - invdiry = 1 / this.direction.y, - invdirz = 1 / this.direction.z; + if ( this.isMesh || this.isLine || this.isPoints ) { - var origin = this.origin; + object.geometry = serialize( meta.geometries, this.geometry ); - if ( invdirx >= 0 ) { + var parameters = this.geometry.parameters; - tmin = ( box.min.x - origin.x ) * invdirx; - tmax = ( box.max.x - origin.x ) * invdirx; + if ( parameters !== undefined && parameters.shapes !== undefined ) { - } else { + var shapes = parameters.shapes; - tmin = ( box.max.x - origin.x ) * invdirx; - tmax = ( box.min.x - origin.x ) * invdirx; + if ( Array.isArray( shapes ) ) { - } + for ( var i = 0, l = shapes.length; i < l; i ++ ) { - if ( invdiry >= 0 ) { + var shape = shapes[ i ]; - tymin = ( box.min.y - origin.y ) * invdiry; - tymax = ( box.max.y - origin.y ) * invdiry; + serialize( meta.shapes, shape ); - } else { + } - tymin = ( box.max.y - origin.y ) * invdiry; - tymax = ( box.min.y - origin.y ) * invdiry; + } else { - } + serialize( meta.shapes, shapes ); - if ( ( tmin > tymax ) || ( tymin > tmax ) ) { return null; } + } - // These lines also handle the case where tmin or tmax is NaN - // (result of 0 * Infinity). x !== x returns true if x is NaN + } - if ( tymin > tmin || tmin !== tmin ) { tmin = tymin; } + } - if ( tymax < tmax || tmax !== tmax ) { tmax = tymax; } + if ( this.material !== undefined ) { - if ( invdirz >= 0 ) { + if ( Array.isArray( this.material ) ) { - tzmin = ( box.min.z - origin.z ) * invdirz; - tzmax = ( box.max.z - origin.z ) * invdirz; + var uuids = []; - } else { + for ( var i$1 = 0, l$1 = this.material.length; i$1 < l$1; i$1 ++ ) { - tzmin = ( box.max.z - origin.z ) * invdirz; - tzmax = ( box.min.z - origin.z ) * invdirz; + uuids.push( serialize( meta.materials, this.material[ i$1 ] ) ); - } + } - if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) { return null; } + object.material = uuids; - if ( tzmin > tmin || tmin !== tmin ) { tmin = tzmin; } + } else { - if ( tzmax < tmax || tmax !== tmax ) { tmax = tzmax; } + object.material = serialize( meta.materials, this.material ); - //return point closest to the ray (positive side) + } - if ( tmax < 0 ) { return null; } + } - return this.at( tmin >= 0 ? tmin : tmax, target ); + // - }; + if ( this.children.length > 0 ) { - Ray.prototype.intersectsBox = function intersectsBox ( box ) { + object.children = []; - return this.intersectBox( box, _vector$2 ) !== null; + for ( var i$2 = 0; i$2 < this.children.length; i$2 ++ ) { - }; + object.children.push( this.children[ i$2 ].toJSON( meta ).object ); - Ray.prototype.intersectTriangle = function intersectTriangle ( a, b, c, backfaceCulling, target ) { + } - // Compute the offset origin, edges, and normal. + } - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h + if ( isRootObject ) { - _edge1.subVectors( b, a ); - _edge2.subVectors( c, a ); - _normal.crossVectors( _edge1, _edge2 ); + var geometries = extractFromCache( meta.geometries ); + var materials = extractFromCache( meta.materials ); + var textures = extractFromCache( meta.textures ); + var images = extractFromCache( meta.images ); + var shapes$1 = extractFromCache( meta.shapes ); - // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, - // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by - // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) - // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) - // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) - var DdN = this.direction.dot( _normal ); - var sign; + if ( geometries.length > 0 ) { output.geometries = geometries; } + if ( materials.length > 0 ) { output.materials = materials; } + if ( textures.length > 0 ) { output.textures = textures; } + if ( images.length > 0 ) { output.images = images; } + if ( shapes$1.length > 0 ) { output.shapes = shapes$1; } - if ( DdN > 0 ) { + } - if ( backfaceCulling ) { return null; } - sign = 1; + output.object = object; - } else if ( DdN < 0 ) { + return output; - sign = - 1; - DdN = - DdN; + // extract data from the cache hash + // remove metadata on each item + // and return as array + function extractFromCache( cache ) { - } else { + var values = []; + for ( var key in cache ) { - return null; + var data = cache[ key ]; + delete data.metadata; + values.push( data ); - } + } - _diff.subVectors( this.origin, a ); - var DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); + return values; - // b1 < 0, no intersection - if ( DdQxE2 < 0 ) { + } - return null; + }, - } + clone: function ( recursive ) { - var DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); + return new this.constructor().copy( this, recursive ); - // b2 < 0, no intersection - if ( DdE1xQ < 0 ) { + }, - return null; + copy: function ( source, recursive ) { - } + if ( recursive === undefined ) { recursive = true; } - // b1+b2 > 1, no intersection - if ( DdQxE2 + DdE1xQ > DdN ) { + this.name = source.name; - return null; + this.up.copy( source.up ); - } + this.position.copy( source.position ); + this.rotation.order = source.rotation.order; + this.quaternion.copy( source.quaternion ); + this.scale.copy( source.scale ); - // Line intersects triangle, check if ray does. - var QdN = - sign * _diff.dot( _normal ); + this.matrix.copy( source.matrix ); + this.matrixWorld.copy( source.matrixWorld ); - // t < 0, no intersection - if ( QdN < 0 ) { + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - return null; + this.layers.mask = source.layers.mask; + this.visible = source.visible; - } + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; - // Ray intersects triangle. - return this.at( QdN / DdN, target ); + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; - }; + this.userData = JSON.parse( JSON.stringify( source.userData ) ); - Ray.prototype.applyMatrix4 = function applyMatrix4 ( matrix4 ) { + if ( recursive === true ) { - this.origin.applyMatrix4( matrix4 ); - this.direction.transformDirection( matrix4 ); + for ( var i = 0; i < source.children.length; i ++ ) { - return this; + var child = source.children[ i ]; + this.add( child.clone() ); - }; + } - Ray.prototype.equals = function equals ( ray ) { + } - return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); + return this; - }; + } + + } ); var _vector1 = new Vector3(); var _vector2 = new Vector3(); var _normalMatrix = new Matrix3(); - function Plane( normal, constant ) { + var Plane = function Plane( normal, constant ) { // normal is assumed to be normalized this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); this.constant = ( constant !== undefined ) ? constant : 0; - } - - Object.assign( Plane.prototype, { - - isPlane: true, + }; - set: function ( normal, constant ) { + Plane.prototype.set = function set ( normal, constant ) { - this.normal.copy( normal ); - this.constant = constant; + this.normal.copy( normal ); + this.constant = constant; - return this; + return this; - }, + }; - setComponents: function ( x, y, z, w ) { + Plane.prototype.setComponents = function setComponents ( x, y, z, w ) { - this.normal.set( x, y, z ); - this.constant = w; + this.normal.set( x, y, z ); + this.constant = w; - return this; + return this; - }, + }; - setFromNormalAndCoplanarPoint: function ( normal, point ) { + Plane.prototype.setFromNormalAndCoplanarPoint = function setFromNormalAndCoplanarPoint ( normal, point ) { - this.normal.copy( normal ); - this.constant = - point.dot( this.normal ); + this.normal.copy( normal ); + this.constant = - point.dot( this.normal ); - return this; + return this; - }, + }; - setFromCoplanarPoints: function ( a, b, c ) { + Plane.prototype.setFromCoplanarPoints = function setFromCoplanarPoints ( a, b, c ) { - var normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); + var normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); - // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? + // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? - this.setFromNormalAndCoplanarPoint( normal, a ); + this.setFromNormalAndCoplanarPoint( normal, a ); - return this; + return this; - }, + }; - clone: function () { + Plane.prototype.clone = function clone () { - return new this.constructor().copy( this ); + return new this.constructor().copy( this ); - }, + }; - copy: function ( plane ) { + Plane.prototype.copy = function copy ( plane ) { - this.normal.copy( plane.normal ); - this.constant = plane.constant; + this.normal.copy( plane.normal ); + this.constant = plane.constant; - return this; + return this; - }, + }; - normalize: function () { + Plane.prototype.normalize = function normalize () { - // Note: will lead to a divide by zero if the plane is invalid. + // Note: will lead to a divide by zero if the plane is invalid. - var inverseNormalLength = 1.0 / this.normal.length(); - this.normal.multiplyScalar( inverseNormalLength ); - this.constant *= inverseNormalLength; + var inverseNormalLength = 1.0 / this.normal.length(); + this.normal.multiplyScalar( inverseNormalLength ); + this.constant *= inverseNormalLength; - return this; + return this; - }, + }; - negate: function () { + Plane.prototype.negate = function negate () { - this.constant *= - 1; - this.normal.negate(); + this.constant *= - 1; + this.normal.negate(); - return this; + return this; - }, + }; - distanceToPoint: function ( point ) { + Plane.prototype.distanceToPoint = function distanceToPoint ( point ) { - return this.normal.dot( point ) + this.constant; + return this.normal.dot( point ) + this.constant; - }, + }; - distanceToSphere: function ( sphere ) { + Plane.prototype.distanceToSphere = function distanceToSphere ( sphere ) { - return this.distanceToPoint( sphere.center ) - sphere.radius; + return this.distanceToPoint( sphere.center ) - sphere.radius; - }, + }; - projectPoint: function ( point, target ) { + Plane.prototype.projectPoint = function projectPoint ( point, target ) { - if ( target === undefined ) { + if ( target === undefined ) { - console.warn( 'THREE.Plane: .projectPoint() target is now required' ); - target = new Vector3(); + console.warn( 'THREE.Plane: .projectPoint() target is now required' ); + target = new Vector3(); - } + } - return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point ); + return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point ); - }, + }; - intersectLine: function ( line, target ) { + Plane.prototype.intersectLine = function intersectLine ( line, target ) { - if ( target === undefined ) { + if ( target === undefined ) { - console.warn( 'THREE.Plane: .intersectLine() target is now required' ); - target = new Vector3(); + console.warn( 'THREE.Plane: .intersectLine() target is now required' ); + target = new Vector3(); - } + } - var direction = line.delta( _vector1 ); + var direction = line.delta( _vector1 ); - var denominator = this.normal.dot( direction ); + var denominator = this.normal.dot( direction ); - if ( denominator === 0 ) { + if ( denominator === 0 ) { - // line is coplanar, return origin - if ( this.distanceToPoint( line.start ) === 0 ) { + // line is coplanar, return origin + if ( this.distanceToPoint( line.start ) === 0 ) { - return target.copy( line.start ); + return target.copy( line.start ); - } + } - // Unsure if this is the correct method to handle this case. - return undefined; + // Unsure if this is the correct method to handle this case. + return undefined; - } + } - var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; + var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; - if ( t < 0 || t > 1 ) { + if ( t < 0 || t > 1 ) { - return undefined; + return undefined; - } + } - return target.copy( direction ).multiplyScalar( t ).add( line.start ); + return target.copy( direction ).multiplyScalar( t ).add( line.start ); - }, + }; - intersectsLine: function ( line ) { + Plane.prototype.intersectsLine = function intersectsLine ( line ) { - // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. + // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. - var startSign = this.distanceToPoint( line.start ); - var endSign = this.distanceToPoint( line.end ); + var startSign = this.distanceToPoint( line.start ); + var endSign = this.distanceToPoint( line.end ); - return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); + return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); - }, + }; - intersectsBox: function ( box ) { + Plane.prototype.intersectsBox = function intersectsBox ( box ) { - return box.intersectsPlane( this ); + return box.intersectsPlane( this ); - }, + }; - intersectsSphere: function ( sphere ) { + Plane.prototype.intersectsSphere = function intersectsSphere ( sphere ) { - return sphere.intersectsPlane( this ); + return sphere.intersectsPlane( this ); - }, + }; - coplanarPoint: function ( target ) { + Plane.prototype.coplanarPoint = function coplanarPoint ( target ) { - if ( target === undefined ) { + if ( target === undefined ) { - console.warn( 'THREE.Plane: .coplanarPoint() target is now required' ); - target = new Vector3(); + console.warn( 'THREE.Plane: .coplanarPoint() target is now required' ); + target = new Vector3(); - } + } - return target.copy( this.normal ).multiplyScalar( - this.constant ); + return target.copy( this.normal ).multiplyScalar( - this.constant ); - }, + }; - applyMatrix4: function ( matrix, optionalNormalMatrix ) { + Plane.prototype.applyMatrix4 = function applyMatrix4 ( matrix, optionalNormalMatrix ) { - var normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); + var normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); - var referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix ); + var referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix ); - var normal = this.normal.applyMatrix3( normalMatrix ).normalize(); + var normal = this.normal.applyMatrix3( normalMatrix ).normalize(); - this.constant = - referencePoint.dot( normal ); + this.constant = - referencePoint.dot( normal ); - return this; + return this; - }, + }; - translate: function ( offset ) { + Plane.prototype.translate = function translate ( offset ) { - this.constant -= offset.dot( this.normal ); + this.constant -= offset.dot( this.normal ); - return this; + return this; - }, + }; - equals: function ( plane ) { + Plane.prototype.equals = function equals ( plane ) { - return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); + return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); - } + }; - } ); + Plane.prototype.isPlane = true; var _v0$1 = new Vector3(); var _v1$3 = new Vector3(); @@ -7635,318 +7484,310 @@ var _vbp = new Vector3(); var _vcp = new Vector3(); - function Triangle( a, b, c ) { + var Triangle = function Triangle( a, b, c ) { this.a = ( a !== undefined ) ? a : new Vector3(); this.b = ( b !== undefined ) ? b : new Vector3(); this.c = ( c !== undefined ) ? c : new Vector3(); - } - - Object.assign( Triangle, { - - getNormal: function ( a, b, c, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .getNormal() target is now required' ); - target = new Vector3(); + }; - } + Triangle.getNormal = function getNormal ( a, b, c, target ) { - target.subVectors( c, b ); - _v0$1.subVectors( a, b ); - target.cross( _v0$1 ); + if ( target === undefined ) { - var targetLengthSq = target.lengthSq(); - if ( targetLengthSq > 0 ) { + console.warn( 'THREE.Triangle: .getNormal() target is now required' ); + target = new Vector3(); - return target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) ); + } - } + target.subVectors( c, b ); + _v0$1.subVectors( a, b ); + target.cross( _v0$1 ); - return target.set( 0, 0, 0 ); + var targetLengthSq = target.lengthSq(); + if ( targetLengthSq > 0 ) { - }, + return target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) ); - // static/instance method to calculate barycentric coordinates - // based on: http://www.blackpawn.com/texts/pointinpoly/default.html - getBarycoord: function ( point, a, b, c, target ) { + } - _v0$1.subVectors( c, a ); - _v1$3.subVectors( b, a ); - _v2$1.subVectors( point, a ); + return target.set( 0, 0, 0 ); - var dot00 = _v0$1.dot( _v0$1 ); - var dot01 = _v0$1.dot( _v1$3 ); - var dot02 = _v0$1.dot( _v2$1 ); - var dot11 = _v1$3.dot( _v1$3 ); - var dot12 = _v1$3.dot( _v2$1 ); + }; - var denom = ( dot00 * dot11 - dot01 * dot01 ); + // static/instance method to calculate barycentric coordinates + // based on: http://www.blackpawn.com/texts/pointinpoly/default.html + Triangle.getBarycoord = function getBarycoord ( point, a, b, c, target ) { - if ( target === undefined ) { + _v0$1.subVectors( c, a ); + _v1$3.subVectors( b, a ); + _v2$1.subVectors( point, a ); - console.warn( 'THREE.Triangle: .getBarycoord() target is now required' ); - target = new Vector3(); + var dot00 = _v0$1.dot( _v0$1 ); + var dot01 = _v0$1.dot( _v1$3 ); + var dot02 = _v0$1.dot( _v2$1 ); + var dot11 = _v1$3.dot( _v1$3 ); + var dot12 = _v1$3.dot( _v2$1 ); - } + var denom = ( dot00 * dot11 - dot01 * dot01 ); - // collinear or singular triangle - if ( denom === 0 ) { + if ( target === undefined ) { - // arbitrary location outside of triangle? - // not sure if this is the best idea, maybe should be returning undefined - return target.set( - 2, - 1, - 1 ); + console.warn( 'THREE.Triangle: .getBarycoord() target is now required' ); + target = new Vector3(); - } + } - var invDenom = 1 / denom; - var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; - var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; + // collinear or singular triangle + if ( denom === 0 ) { - // barycentric coordinates must always sum to 1 - return target.set( 1 - u - v, v, u ); + // arbitrary location outside of triangle? + // not sure if this is the best idea, maybe should be returning undefined + return target.set( - 2, - 1, - 1 ); - }, + } - containsPoint: function ( point, a, b, c ) { + var invDenom = 1 / denom; + var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; + var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; - Triangle.getBarycoord( point, a, b, c, _v3 ); + // barycentric coordinates must always sum to 1 + return target.set( 1 - u - v, v, u ); - return ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 ); + }; - }, + Triangle.containsPoint = function containsPoint ( point, a, b, c ) { - getUV: function ( point, p1, p2, p3, uv1, uv2, uv3, target ) { + this.getBarycoord( point, a, b, c, _v3 ); - this.getBarycoord( point, p1, p2, p3, _v3 ); + return ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 ); - target.set( 0, 0 ); - target.addScaledVector( uv1, _v3.x ); - target.addScaledVector( uv2, _v3.y ); - target.addScaledVector( uv3, _v3.z ); + }; - return target; + Triangle.getUV = function getUV ( point, p1, p2, p3, uv1, uv2, uv3, target ) { - }, + this.getBarycoord( point, p1, p2, p3, _v3 ); - isFrontFacing: function ( a, b, c, direction ) { + target.set( 0, 0 ); + target.addScaledVector( uv1, _v3.x ); + target.addScaledVector( uv2, _v3.y ); + target.addScaledVector( uv3, _v3.z ); - _v0$1.subVectors( c, b ); - _v1$3.subVectors( a, b ); + return target; - // strictly front facing - return ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false; + }; - } + Triangle.isFrontFacing = function isFrontFacing ( a, b, c, direction ) { - } ); + _v0$1.subVectors( c, b ); + _v1$3.subVectors( a, b ); - Object.assign( Triangle.prototype, { + // strictly front facing + return ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false; - set: function ( a, b, c ) { + }; - this.a.copy( a ); - this.b.copy( b ); - this.c.copy( c ); + Triangle.prototype.set = function set ( a, b, c ) { - return this; + this.a.copy( a ); + this.b.copy( b ); + this.c.copy( c ); - }, + return this; - setFromPointsAndIndices: function ( points, i0, i1, i2 ) { + }; - this.a.copy( points[ i0 ] ); - this.b.copy( points[ i1 ] ); - this.c.copy( points[ i2 ] ); + Triangle.prototype.setFromPointsAndIndices = function setFromPointsAndIndices ( points, i0, i1, i2 ) { - return this; + this.a.copy( points[ i0 ] ); + this.b.copy( points[ i1 ] ); + this.c.copy( points[ i2 ] ); - }, + return this; - clone: function () { + }; - return new this.constructor().copy( this ); + Triangle.prototype.clone = function clone () { - }, + return new this.constructor().copy( this ); - copy: function ( triangle ) { + }; - this.a.copy( triangle.a ); - this.b.copy( triangle.b ); - this.c.copy( triangle.c ); + Triangle.prototype.copy = function copy ( triangle ) { - return this; + this.a.copy( triangle.a ); + this.b.copy( triangle.b ); + this.c.copy( triangle.c ); - }, + return this; - getArea: function () { + }; - _v0$1.subVectors( this.c, this.b ); - _v1$3.subVectors( this.a, this.b ); + Triangle.prototype.getArea = function getArea () { - return _v0$1.cross( _v1$3 ).length() * 0.5; + _v0$1.subVectors( this.c, this.b ); + _v1$3.subVectors( this.a, this.b ); - }, + return _v0$1.cross( _v1$3 ).length() * 0.5; - getMidpoint: function ( target ) { + }; - if ( target === undefined ) { + Triangle.prototype.getMidpoint = function getMidpoint ( target ) { - console.warn( 'THREE.Triangle: .getMidpoint() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Triangle: .getMidpoint() target is now required' ); + target = new Vector3(); - return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); + } - }, + return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); - getNormal: function ( target ) { + }; - return Triangle.getNormal( this.a, this.b, this.c, target ); + Triangle.prototype.getNormal = function getNormal ( target ) { - }, + return Triangle.getNormal( this.a, this.b, this.c, target ); - getPlane: function ( target ) { + }; - if ( target === undefined ) { + Triangle.prototype.getPlane = function getPlane ( target ) { - console.warn( 'THREE.Triangle: .getPlane() target is now required' ); - target = new Plane(); + if ( target === undefined ) { - } + console.warn( 'THREE.Triangle: .getPlane() target is now required' ); + target = new Plane(); - return target.setFromCoplanarPoints( this.a, this.b, this.c ); + } - }, + return target.setFromCoplanarPoints( this.a, this.b, this.c ); - getBarycoord: function ( point, target ) { + }; - return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); + Triangle.prototype.getBarycoord = function getBarycoord ( point, target ) { - }, + return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); - getUV: function ( point, uv1, uv2, uv3, target ) { + }; - return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); + Triangle.prototype.getUV = function getUV ( point, uv1, uv2, uv3, target ) { - }, + return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); - containsPoint: function ( point ) { + }; - return Triangle.containsPoint( point, this.a, this.b, this.c ); + Triangle.prototype.containsPoint = function containsPoint ( point ) { - }, + return Triangle.containsPoint( point, this.a, this.b, this.c ); - isFrontFacing: function ( direction ) { + }; - return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); + Triangle.prototype.isFrontFacing = function isFrontFacing ( direction ) { - }, + return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); - intersectsBox: function ( box ) { + }; - return box.intersectsTriangle( this ); + Triangle.prototype.intersectsBox = function intersectsBox ( box ) { - }, + return box.intersectsTriangle( this ); - closestPointToPoint: function ( p, target ) { + }; - if ( target === undefined ) { + Triangle.prototype.closestPointToPoint = function closestPointToPoint ( p, target ) { - console.warn( 'THREE.Triangle: .closestPointToPoint() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Triangle: .closestPointToPoint() target is now required' ); + target = new Vector3(); - var a = this.a, b = this.b, c = this.c; - var v, w; + } - // algorithm thanks to Real-Time Collision Detection by Christer Ericson, - // published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc., - // under the accompanying license; see chapter 5.1.5 for detailed explanation. - // basically, we're distinguishing which of the voronoi regions of the triangle - // the point lies in with the minimum amount of redundant computation. + var a = this.a, b = this.b, c = this.c; + var v, w; - _vab.subVectors( b, a ); - _vac.subVectors( c, a ); - _vap.subVectors( p, a ); - var d1 = _vab.dot( _vap ); - var d2 = _vac.dot( _vap ); - if ( d1 <= 0 && d2 <= 0 ) { + // algorithm thanks to Real-Time Collision Detection by Christer Ericson, + // published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc., + // under the accompanying license; see chapter 5.1.5 for detailed explanation. + // basically, we're distinguishing which of the voronoi regions of the triangle + // the point lies in with the minimum amount of redundant computation. - // vertex region of A; barycentric coords (1, 0, 0) - return target.copy( a ); + _vab.subVectors( b, a ); + _vac.subVectors( c, a ); + _vap.subVectors( p, a ); + var d1 = _vab.dot( _vap ); + var d2 = _vac.dot( _vap ); + if ( d1 <= 0 && d2 <= 0 ) { - } + // vertex region of A; barycentric coords (1, 0, 0) + return target.copy( a ); - _vbp.subVectors( p, b ); - var d3 = _vab.dot( _vbp ); - var d4 = _vac.dot( _vbp ); - if ( d3 >= 0 && d4 <= d3 ) { + } - // vertex region of B; barycentric coords (0, 1, 0) - return target.copy( b ); + _vbp.subVectors( p, b ); + var d3 = _vab.dot( _vbp ); + var d4 = _vac.dot( _vbp ); + if ( d3 >= 0 && d4 <= d3 ) { - } + // vertex region of B; barycentric coords (0, 1, 0) + return target.copy( b ); - var vc = d1 * d4 - d3 * d2; - if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) { + } - v = d1 / ( d1 - d3 ); - // edge region of AB; barycentric coords (1-v, v, 0) - return target.copy( a ).addScaledVector( _vab, v ); + var vc = d1 * d4 - d3 * d2; + if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) { - } + v = d1 / ( d1 - d3 ); + // edge region of AB; barycentric coords (1-v, v, 0) + return target.copy( a ).addScaledVector( _vab, v ); - _vcp.subVectors( p, c ); - var d5 = _vab.dot( _vcp ); - var d6 = _vac.dot( _vcp ); - if ( d6 >= 0 && d5 <= d6 ) { + } - // vertex region of C; barycentric coords (0, 0, 1) - return target.copy( c ); + _vcp.subVectors( p, c ); + var d5 = _vab.dot( _vcp ); + var d6 = _vac.dot( _vcp ); + if ( d6 >= 0 && d5 <= d6 ) { - } + // vertex region of C; barycentric coords (0, 0, 1) + return target.copy( c ); - var vb = d5 * d2 - d1 * d6; - if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) { + } - w = d2 / ( d2 - d6 ); - // edge region of AC; barycentric coords (1-w, 0, w) - return target.copy( a ).addScaledVector( _vac, w ); + var vb = d5 * d2 - d1 * d6; + if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) { - } + w = d2 / ( d2 - d6 ); + // edge region of AC; barycentric coords (1-w, 0, w) + return target.copy( a ).addScaledVector( _vac, w ); - var va = d3 * d6 - d5 * d4; - if ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) { + } - _vbc.subVectors( c, b ); - w = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) ); - // edge region of BC; barycentric coords (0, 1-w, w) - return target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC + var va = d3 * d6 - d5 * d4; + if ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) { - } + _vbc.subVectors( c, b ); + w = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) ); + // edge region of BC; barycentric coords (0, 1-w, w) + return target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC - // face region - var denom = 1 / ( va + vb + vc ); - // u = va * denom - v = vb * denom; - w = vc * denom; + } - return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); + // face region + var denom = 1 / ( va + vb + vc ); + // u = va * denom + v = vb * denom; + w = vc * denom; - }, + return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); - equals: function ( triangle ) { + }; - return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); + Triangle.prototype.equals = function equals ( triangle ) { - } + return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); - } ); + }; var _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, @@ -7976,19 +7817,6 @@ var _hslA = { h: 0, s: 0, l: 0 }; var _hslB = { h: 0, s: 0, l: 0 }; - function Color( r, g, b ) { - - if ( g === undefined && b === undefined ) { - - // r is THREE.Color, hex or string - return this.set( r ); - - } - - return this.setRGB( r, g, b ); - - } - function hue2rgb( p, q, t ) { if ( t < 0 ) { t += 1; } @@ -8012,547 +7840,556 @@ } - Object.assign( Color.prototype, { + var Color = function Color( r, g, b ) { - isColor: true, + if ( g === undefined && b === undefined ) { - r: 1, g: 1, b: 1, + // r is THREE.Color, hex or string + return this.set( r ); - set: function ( value ) { + } - if ( value && value.isColor ) { + return this.setRGB( r, g, b ); - this.copy( value ); + }; - } else if ( typeof value === 'number' ) { + Color.prototype.set = function set ( value ) { - this.setHex( value ); + if ( value && value.isColor ) { - } else if ( typeof value === 'string' ) { + this.copy( value ); - this.setStyle( value ); + } else if ( typeof value === 'number' ) { - } + this.setHex( value ); - return this; + } else if ( typeof value === 'string' ) { - }, + this.setStyle( value ); + + } - setScalar: function ( scalar ) { + return this; - this.r = scalar; - this.g = scalar; - this.b = scalar; + }; - return this; + Color.prototype.setScalar = function setScalar ( scalar ) { - }, + this.r = scalar; + this.g = scalar; + this.b = scalar; - setHex: function ( hex ) { + return this; - hex = Math.floor( hex ); + }; - this.r = ( hex >> 16 & 255 ) / 255; - this.g = ( hex >> 8 & 255 ) / 255; - this.b = ( hex & 255 ) / 255; + Color.prototype.setHex = function setHex ( hex ) { - return this; + hex = Math.floor( hex ); - }, + this.r = ( hex >> 16 & 255 ) / 255; + this.g = ( hex >> 8 & 255 ) / 255; + this.b = ( hex & 255 ) / 255; - setRGB: function ( r, g, b ) { + return this; - this.r = r; - this.g = g; - this.b = b; + }; - return this; + Color.prototype.setRGB = function setRGB ( r, g, b ) { - }, + this.r = r; + this.g = g; + this.b = b; - setHSL: function ( h, s, l ) { + return this; - // h,s,l ranges are in 0.0 - 1.0 - h = MathUtils.euclideanModulo( h, 1 ); - s = MathUtils.clamp( s, 0, 1 ); - l = MathUtils.clamp( l, 0, 1 ); + }; - if ( s === 0 ) { + Color.prototype.setHSL = function setHSL ( h, s, l ) { - this.r = this.g = this.b = l; + // h,s,l ranges are in 0.0 - 1.0 + h = MathUtils.euclideanModulo( h, 1 ); + s = MathUtils.clamp( s, 0, 1 ); + l = MathUtils.clamp( l, 0, 1 ); - } else { + if ( s === 0 ) { - var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); - var q = ( 2 * l ) - p; + this.r = this.g = this.b = l; - this.r = hue2rgb( q, p, h + 1 / 3 ); - this.g = hue2rgb( q, p, h ); - this.b = hue2rgb( q, p, h - 1 / 3 ); + } else { - } + var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); + var q = ( 2 * l ) - p; - return this; + this.r = hue2rgb( q, p, h + 1 / 3 ); + this.g = hue2rgb( q, p, h ); + this.b = hue2rgb( q, p, h - 1 / 3 ); - }, + } - setStyle: function ( style ) { + return this; - function handleAlpha( string ) { + }; - if ( string === undefined ) { return; } + Color.prototype.setStyle = function setStyle ( style ) { - if ( parseFloat( string ) < 1 ) { + function handleAlpha( string ) { - console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); + if ( string === undefined ) { return; } - } + if ( parseFloat( string ) < 1 ) { + + console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); } + } - var m; - if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) { + var m; - // rgb / hsl + if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) { - var color; - var name = m[ 1 ]; - var components = m[ 2 ]; + // rgb / hsl - switch ( name ) { + var color; + var name = m[ 1 ]; + var components = m[ 2 ]; - case 'rgb': - case 'rgba': + switch ( name ) { - if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + case 'rgb': + case 'rgba': - // rgb(255,0,0) rgba(255,0,0,0.5) - this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; - this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; - this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; + if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - handleAlpha( color[ 5 ] ); + // rgb(255,0,0) rgba(255,0,0,0.5) + this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; + this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; + this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; - return this; + handleAlpha( color[ 5 ] ); - } + return this; - if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + } - // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) - this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; - this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; - this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; + if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - handleAlpha( color[ 5 ] ); + // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) + this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; + this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; + this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; - return this; + handleAlpha( color[ 5 ] ); - } + return this; - break; + } - case 'hsl': - case 'hsla': + break; - if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { + case 'hsl': + case 'hsla': - // hsl(120,50%,50%) hsla(120,50%,50%,0.5) - var h = parseFloat( color[ 1 ] ) / 360; - var s = parseInt( color[ 2 ], 10 ) / 100; - var l = parseInt( color[ 3 ], 10 ) / 100; + if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - handleAlpha( color[ 5 ] ); + // hsl(120,50%,50%) hsla(120,50%,50%,0.5) + var h = parseFloat( color[ 1 ] ) / 360; + var s = parseInt( color[ 2 ], 10 ) / 100; + var l = parseInt( color[ 3 ], 10 ) / 100; - return this.setHSL( h, s, l ); + handleAlpha( color[ 5 ] ); - } + return this.setHSL( h, s, l ); - break; + } - } + break; - } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) { + } - // hex color + } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) { - var hex = m[ 1 ]; - var size = hex.length; + // hex color - if ( size === 3 ) { + var hex = m[ 1 ]; + var size = hex.length; - // #ff0 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; + if ( size === 3 ) { - return this; + // #ff0 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; - } else if ( size === 6 ) { + return this; - // #ff0000 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; + } else if ( size === 6 ) { - return this; + // #ff0000 + this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; + this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; + this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; - } + return this; } - if ( style && style.length > 0 ) { - - return this.setColorName( style ); + } - } + if ( style && style.length > 0 ) { - return this; + return this.setColorName( style ); - }, + } - setColorName: function ( style ) { + return this; - // color keywords - var hex = _colorKeywords[ style ]; + }; - if ( hex !== undefined ) { + Color.prototype.setColorName = function setColorName ( style ) { - // red - this.setHex( hex ); + // color keywords + var hex = _colorKeywords[ style ]; - } else { + if ( hex !== undefined ) { - // unknown color - console.warn( 'THREE.Color: Unknown color ' + style ); + // red + this.setHex( hex ); - } + } else { - return this; + // unknown color + console.warn( 'THREE.Color: Unknown color ' + style ); - }, + } - clone: function () { + return this; - return new this.constructor( this.r, this.g, this.b ); + }; - }, + Color.prototype.clone = function clone () { - copy: function ( color ) { + return new this.constructor( this.r, this.g, this.b ); - this.r = color.r; - this.g = color.g; - this.b = color.b; + }; - return this; + Color.prototype.copy = function copy ( color ) { - }, + this.r = color.r; + this.g = color.g; + this.b = color.b; - copyGammaToLinear: function ( color, gammaFactor ) { + return this; - if ( gammaFactor === undefined ) { gammaFactor = 2.0; } + }; - this.r = Math.pow( color.r, gammaFactor ); - this.g = Math.pow( color.g, gammaFactor ); - this.b = Math.pow( color.b, gammaFactor ); + Color.prototype.copyGammaToLinear = function copyGammaToLinear ( color, gammaFactor ) { - return this; + if ( gammaFactor === undefined ) { gammaFactor = 2.0; } - }, + this.r = Math.pow( color.r, gammaFactor ); + this.g = Math.pow( color.g, gammaFactor ); + this.b = Math.pow( color.b, gammaFactor ); - copyLinearToGamma: function ( color, gammaFactor ) { + return this; - if ( gammaFactor === undefined ) { gammaFactor = 2.0; } + }; - var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0; + Color.prototype.copyLinearToGamma = function copyLinearToGamma ( color, gammaFactor ) { - this.r = Math.pow( color.r, safeInverse ); - this.g = Math.pow( color.g, safeInverse ); - this.b = Math.pow( color.b, safeInverse ); + if ( gammaFactor === undefined ) { gammaFactor = 2.0; } - return this; + var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0; - }, + this.r = Math.pow( color.r, safeInverse ); + this.g = Math.pow( color.g, safeInverse ); + this.b = Math.pow( color.b, safeInverse ); - convertGammaToLinear: function ( gammaFactor ) { + return this; - this.copyGammaToLinear( this, gammaFactor ); + }; - return this; + Color.prototype.convertGammaToLinear = function convertGammaToLinear ( gammaFactor ) { - }, + this.copyGammaToLinear( this, gammaFactor ); - convertLinearToGamma: function ( gammaFactor ) { + return this; - this.copyLinearToGamma( this, gammaFactor ); + }; - return this; + Color.prototype.convertLinearToGamma = function convertLinearToGamma ( gammaFactor ) { - }, + this.copyLinearToGamma( this, gammaFactor ); - copySRGBToLinear: function ( color ) { + return this; - this.r = SRGBToLinear( color.r ); - this.g = SRGBToLinear( color.g ); - this.b = SRGBToLinear( color.b ); + }; - return this; + Color.prototype.copySRGBToLinear = function copySRGBToLinear ( color ) { - }, + this.r = SRGBToLinear( color.r ); + this.g = SRGBToLinear( color.g ); + this.b = SRGBToLinear( color.b ); - copyLinearToSRGB: function ( color ) { + return this; - this.r = LinearToSRGB( color.r ); - this.g = LinearToSRGB( color.g ); - this.b = LinearToSRGB( color.b ); + }; - return this; + Color.prototype.copyLinearToSRGB = function copyLinearToSRGB ( color ) { - }, + this.r = LinearToSRGB( color.r ); + this.g = LinearToSRGB( color.g ); + this.b = LinearToSRGB( color.b ); - convertSRGBToLinear: function () { + return this; - this.copySRGBToLinear( this ); + }; - return this; + Color.prototype.convertSRGBToLinear = function convertSRGBToLinear () { - }, + this.copySRGBToLinear( this ); - convertLinearToSRGB: function () { + return this; - this.copyLinearToSRGB( this ); + }; - return this; + Color.prototype.convertLinearToSRGB = function convertLinearToSRGB () { - }, + this.copyLinearToSRGB( this ); - getHex: function () { + return this; - return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; + }; - }, + Color.prototype.getHex = function getHex () { - getHexString: function () { + return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; - return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); + }; - }, + Color.prototype.getHexString = function getHexString () { - getHSL: function ( target ) { + return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); - // h,s,l ranges are in 0.0 - 1.0 + }; - if ( target === undefined ) { + Color.prototype.getHSL = function getHSL ( target ) { - console.warn( 'THREE.Color: .getHSL() target is now required' ); - target = { h: 0, s: 0, l: 0 }; + // h,s,l ranges are in 0.0 - 1.0 - } + if ( target === undefined ) { - var r = this.r, g = this.g, b = this.b; + console.warn( 'THREE.Color: .getHSL() target is now required' ); + target = { h: 0, s: 0, l: 0 }; - var max = Math.max( r, g, b ); - var min = Math.min( r, g, b ); + } - var hue, saturation; - var lightness = ( min + max ) / 2.0; + var r = this.r, g = this.g, b = this.b; - if ( min === max ) { + var max = Math.max( r, g, b ); + var min = Math.min( r, g, b ); - hue = 0; - saturation = 0; + var hue, saturation; + var lightness = ( min + max ) / 2.0; - } else { + if ( min === max ) { - var delta = max - min; + hue = 0; + saturation = 0; - saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); + } else { - switch ( max ) { + var delta = max - min; - case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; - case g: hue = ( b - r ) / delta + 2; break; - case b: hue = ( r - g ) / delta + 4; break; + saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); - } + switch ( max ) { - hue /= 6; + case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; + case g: hue = ( b - r ) / delta + 2; break; + case b: hue = ( r - g ) / delta + 4; break; } - target.h = hue; - target.s = saturation; - target.l = lightness; + hue /= 6; - return target; + } - }, + target.h = hue; + target.s = saturation; + target.l = lightness; - getStyle: function () { + return target; - return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; + }; - }, + Color.prototype.getStyle = function getStyle () { - offsetHSL: function ( h, s, l ) { + return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; - this.getHSL( _hslA ); + }; - _hslA.h += h; _hslA.s += s; _hslA.l += l; + Color.prototype.offsetHSL = function offsetHSL ( h, s, l ) { - this.setHSL( _hslA.h, _hslA.s, _hslA.l ); + this.getHSL( _hslA ); - return this; + _hslA.h += h; _hslA.s += s; _hslA.l += l; - }, + this.setHSL( _hslA.h, _hslA.s, _hslA.l ); - add: function ( color ) { + return this; - this.r += color.r; - this.g += color.g; - this.b += color.b; + }; - return this; + Color.prototype.add = function add ( color ) { - }, + this.r += color.r; + this.g += color.g; + this.b += color.b; - addColors: function ( color1, color2 ) { + return this; - this.r = color1.r + color2.r; - this.g = color1.g + color2.g; - this.b = color1.b + color2.b; + }; - return this; + Color.prototype.addColors = function addColors ( color1, color2 ) { - }, + this.r = color1.r + color2.r; + this.g = color1.g + color2.g; + this.b = color1.b + color2.b; - addScalar: function ( s ) { + return this; - this.r += s; - this.g += s; - this.b += s; + }; - return this; + Color.prototype.addScalar = function addScalar ( s ) { - }, + this.r += s; + this.g += s; + this.b += s; - sub: function ( color ) { + return this; - this.r = Math.max( 0, this.r - color.r ); - this.g = Math.max( 0, this.g - color.g ); - this.b = Math.max( 0, this.b - color.b ); + }; - return this; + Color.prototype.sub = function sub ( color ) { - }, + this.r = Math.max( 0, this.r - color.r ); + this.g = Math.max( 0, this.g - color.g ); + this.b = Math.max( 0, this.b - color.b ); - multiply: function ( color ) { + return this; - this.r *= color.r; - this.g *= color.g; - this.b *= color.b; + }; - return this; + Color.prototype.multiply = function multiply ( color ) { - }, + this.r *= color.r; + this.g *= color.g; + this.b *= color.b; - multiplyScalar: function ( s ) { + return this; - this.r *= s; - this.g *= s; - this.b *= s; + }; - return this; + Color.prototype.multiplyScalar = function multiplyScalar ( s ) { - }, + this.r *= s; + this.g *= s; + this.b *= s; - lerp: function ( color, alpha ) { + return this; - this.r += ( color.r - this.r ) * alpha; - this.g += ( color.g - this.g ) * alpha; - this.b += ( color.b - this.b ) * alpha; + }; - return this; + Color.prototype.lerp = function lerp ( color, alpha ) { - }, + this.r += ( color.r - this.r ) * alpha; + this.g += ( color.g - this.g ) * alpha; + this.b += ( color.b - this.b ) * alpha; - lerpHSL: function ( color, alpha ) { + return this; - this.getHSL( _hslA ); - color.getHSL( _hslB ); + }; - var h = MathUtils.lerp( _hslA.h, _hslB.h, alpha ); - var s = MathUtils.lerp( _hslA.s, _hslB.s, alpha ); - var l = MathUtils.lerp( _hslA.l, _hslB.l, alpha ); + Color.prototype.lerpHSL = function lerpHSL ( color, alpha ) { - this.setHSL( h, s, l ); + this.getHSL( _hslA ); + color.getHSL( _hslB ); - return this; + var h = MathUtils.lerp( _hslA.h, _hslB.h, alpha ); + var s = MathUtils.lerp( _hslA.s, _hslB.s, alpha ); + var l = MathUtils.lerp( _hslA.l, _hslB.l, alpha ); - }, + this.setHSL( h, s, l ); - equals: function ( c ) { + return this; - return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); + }; - }, + Color.prototype.equals = function equals ( c ) { - fromArray: function ( array, offset ) { + return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); - if ( offset === undefined ) { offset = 0; } + }; - this.r = array[ offset ]; - this.g = array[ offset + 1 ]; - this.b = array[ offset + 2 ]; + Color.prototype.fromArray = function fromArray ( array, offset ) { - return this; + if ( offset === undefined ) { offset = 0; } - }, + this.r = array[ offset ]; + this.g = array[ offset + 1 ]; + this.b = array[ offset + 2 ]; + + return this; - toArray: function ( array, offset ) { + }; - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + Color.prototype.toArray = function toArray ( array, offset ) { - array[ offset ] = this.r; - array[ offset + 1 ] = this.g; - array[ offset + 2 ] = this.b; + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - return array; + array[ offset ] = this.r; + array[ offset + 1 ] = this.g; + array[ offset + 2 ] = this.b; - }, + return array; - fromBufferAttribute: function ( attribute, index ) { + }; - this.r = attribute.getX( index ); - this.g = attribute.getY( index ); - this.b = attribute.getZ( index ); + Color.prototype.fromBufferAttribute = function fromBufferAttribute ( attribute, index ) { - if ( attribute.normalized === true ) { + this.r = attribute.getX( index ); + this.g = attribute.getY( index ); + this.b = attribute.getZ( index ); - // assuming Uint8Array + if ( attribute.normalized === true ) { - this.r /= 255; - this.g /= 255; - this.b /= 255; + // assuming Uint8Array - } + this.r /= 255; + this.g /= 255; + this.b /= 255; - return this; + } - }, + return this; - toJSON: function () { + }; - return this.getHex(); + Color.prototype.toJSON = function toJSON () { - } + return this.getHex(); - } ); + }; Color.NAMES = _colorKeywords; + Color.prototype.isColor = true; + Color.prototype.r = 1; + Color.prototype.g = 1; + Color.prototype.b = 1; var Face3 = function Face3( a, b, c, normal, color, materialIndex ) { @@ -10485,6 +10322,19 @@ var position = this.attributes.position; var morphAttributesPosition = this.morphAttributes.position; + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingBox.set( + new Vector3( - Infinity, - Infinity, - Infinity ), + new Vector3( + Infinity, + Infinity, + Infinity ) + ); + + return; + + } + if ( position !== undefined ) { this.boundingBox.setFromBufferAttribute( position ); @@ -10525,7 +10375,7 @@ if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); + console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); } @@ -10542,6 +10392,16 @@ var position = this.attributes.position; var morphAttributesPosition = this.morphAttributes.position; + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingSphere.set( new Vector3(), Infinity ); + + return; + + } + if ( position ) { // first, find the center of the bounding sphere @@ -13284,6 +13144,8 @@ this.index0AttributeName = undefined; this.uniformsNeedUpdate = false; + this.glslVersion = null; + if ( parameters !== undefined ) { if ( parameters.attributes !== undefined ) { @@ -13327,6 +13189,8 @@ this.extensions = Object.assign( {}, source.extensions ); + this.glslVersion = source.glslVersion; + return this; }; @@ -13335,6 +13199,7 @@ var data = Material.prototype.toJSON.call( this, meta ); + data.glslVersion = this.glslVersion; data.uniforms = {}; for ( var name in this.uniforms ) { @@ -13851,6 +13716,8 @@ WebGLRenderTarget.call( this, size, size, options ); + this.texture.isWebGLCubeRenderTargetTexture = true; // HACK Why is texture not a CubeTexture? + } WebGLCubeRenderTarget.prototype = Object.create( WebGLRenderTarget.prototype ); @@ -13868,8 +13735,6 @@ this.texture.minFilter = texture.minFilter; this.texture.magFilter = texture.magFilter; - var scene = new Scene(); - var shader = { uniforms: { @@ -13881,6 +13746,8 @@ fragmentShader: /* glsl */"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t" }; + var geometry = new BoxBufferGeometry( 5, 5, 5 ); + var material = new ShaderMaterial( { name: 'CubemapFromEquirect', @@ -13895,12 +13762,24 @@ material.uniforms.tEquirect.value = texture; - var mesh = new Mesh( new BoxBufferGeometry( 5, 5, 5 ), material ); + var mesh = new Mesh( geometry, material ); - scene.add( mesh ); + var currentMinFilter = texture.minFilter; + var currentRenderList = renderer.getRenderList(); + var currentRenderTarget = renderer.getRenderTarget(); + var currentRenderState = renderer.getRenderState(); + + // Avoid blurred poles + if ( texture.minFilter === LinearMipmapLinearFilter ) { texture.minFilter = LinearFilter; } var camera = new CubeCamera( 1, 10, this ); - camera.update( renderer, scene ); + camera.update( renderer, mesh ); + + texture.minFilter = currentMinFilter; + + renderer.setRenderTarget( currentRenderTarget ); + renderer.setRenderList( currentRenderList ); + renderer.setRenderState( currentRenderState ); mesh.geometry.dispose(); mesh.material.dispose(); @@ -13934,7 +13813,7 @@ var _sphere$1 = new Sphere(); var _vector$5 = new Vector3(); - function Frustum( p0, p1, p2, p3, p4, p5 ) { + var Frustum = function Frustum( p0, p1, p2, p3, p4, p5 ) { this.planes = [ @@ -13947,358 +13826,148 @@ ]; - } - - Object.assign( Frustum.prototype, { - - set: function ( p0, p1, p2, p3, p4, p5 ) { + }; - var planes = this.planes; + Frustum.prototype.set = function set ( p0, p1, p2, p3, p4, p5 ) { - planes[ 0 ].copy( p0 ); - planes[ 1 ].copy( p1 ); - planes[ 2 ].copy( p2 ); - planes[ 3 ].copy( p3 ); - planes[ 4 ].copy( p4 ); - planes[ 5 ].copy( p5 ); + var planes = this.planes; - return this; + planes[ 0 ].copy( p0 ); + planes[ 1 ].copy( p1 ); + planes[ 2 ].copy( p2 ); + planes[ 3 ].copy( p3 ); + planes[ 4 ].copy( p4 ); + planes[ 5 ].copy( p5 ); - }, + return this; - clone: function () { + }; - return new this.constructor().copy( this ); + Frustum.prototype.clone = function clone () { - }, + return new this.constructor().copy( this ); - copy: function ( frustum ) { + }; - var planes = this.planes; + Frustum.prototype.copy = function copy ( frustum ) { - for ( var i = 0; i < 6; i ++ ) { + var planes = this.planes; - planes[ i ].copy( frustum.planes[ i ] ); + for ( var i = 0; i < 6; i ++ ) { - } + planes[ i ].copy( frustum.planes[ i ] ); - return this; + } - }, + return this; - setFromProjectionMatrix: function ( m ) { + }; - var planes = this.planes; - var me = m.elements; - var me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; - var me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; - var me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; - var me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; + Frustum.prototype.setFromProjectionMatrix = function setFromProjectionMatrix ( m ) { - planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); - planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); - planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); - planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); - planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); + var planes = this.planes; + var me = m.elements; + var me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; + var me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; + var me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; + var me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; - return this; + planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); + planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); + planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); + planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); + planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); + planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); - }, + return this; - intersectsObject: function ( object ) { + }; - var geometry = object.geometry; + Frustum.prototype.intersectsObject = function intersectsObject ( object ) { - if ( geometry.boundingSphere === null ) { geometry.computeBoundingSphere(); } + var geometry = object.geometry; - _sphere$1.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld ); + if ( geometry.boundingSphere === null ) { geometry.computeBoundingSphere(); } - return this.intersectsSphere( _sphere$1 ); + _sphere$1.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld ); - }, + return this.intersectsSphere( _sphere$1 ); - intersectsSprite: function ( sprite ) { + }; - _sphere$1.center.set( 0, 0, 0 ); - _sphere$1.radius = 0.7071067811865476; - _sphere$1.applyMatrix4( sprite.matrixWorld ); + Frustum.prototype.intersectsSprite = function intersectsSprite ( sprite ) { - return this.intersectsSphere( _sphere$1 ); + _sphere$1.center.set( 0, 0, 0 ); + _sphere$1.radius = 0.7071067811865476; + _sphere$1.applyMatrix4( sprite.matrixWorld ); - }, + return this.intersectsSphere( _sphere$1 ); - intersectsSphere: function ( sphere ) { + }; - var planes = this.planes; - var center = sphere.center; - var negRadius = - sphere.radius; + Frustum.prototype.intersectsSphere = function intersectsSphere ( sphere ) { - for ( var i = 0; i < 6; i ++ ) { + var planes = this.planes; + var center = sphere.center; + var negRadius = - sphere.radius; - var distance = planes[ i ].distanceToPoint( center ); + for ( var i = 0; i < 6; i ++ ) { - if ( distance < negRadius ) { + var distance = planes[ i ].distanceToPoint( center ); - return false; + if ( distance < negRadius ) { - } + return false; } - return true; + } - }, + return true; - intersectsBox: function ( box ) { + }; - var planes = this.planes; + Frustum.prototype.intersectsBox = function intersectsBox ( box ) { - for ( var i = 0; i < 6; i ++ ) { + var planes = this.planes; - var plane = planes[ i ]; + for ( var i = 0; i < 6; i ++ ) { - // corner at max distance + var plane = planes[ i ]; - _vector$5.x = plane.normal.x > 0 ? box.max.x : box.min.x; - _vector$5.y = plane.normal.y > 0 ? box.max.y : box.min.y; - _vector$5.z = plane.normal.z > 0 ? box.max.z : box.min.z; + // corner at max distance - if ( plane.distanceToPoint( _vector$5 ) < 0 ) { + _vector$5.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$5.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$5.z = plane.normal.z > 0 ? box.max.z : box.min.z; - return false; + if ( plane.distanceToPoint( _vector$5 ) < 0 ) { - } + return false; } - return true; + } - }, + return true; - containsPoint: function ( point ) { + }; - var planes = this.planes; + Frustum.prototype.containsPoint = function containsPoint ( point ) { - for ( var i = 0; i < 6; i ++ ) { + var planes = this.planes; - if ( planes[ i ].distanceToPoint( point ) < 0 ) { + for ( var i = 0; i < 6; i ++ ) { - return false; + if ( planes[ i ].distanceToPoint( point ) < 0 ) { - } + return false; } - return true; - } - } ); - - /** - * Uniforms library for shared webgl shaders - */ - - var UniformsLib = { - - common: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - - map: { value: null }, - uvTransform: { value: new Matrix3() }, - uv2Transform: { value: new Matrix3() }, - - alphaMap: { value: null }, - - }, - - specularmap: { - - specularMap: { value: null }, - - }, - - envmap: { - - envMap: { value: null }, - flipEnvMap: { value: - 1 }, - reflectivity: { value: 1.0 }, - refractionRatio: { value: 0.98 }, - maxMipLevel: { value: 0 } - - }, - - aomap: { - - aoMap: { value: null }, - aoMapIntensity: { value: 1 } - - }, - - lightmap: { - - lightMap: { value: null }, - lightMapIntensity: { value: 1 } - - }, - - emissivemap: { - - emissiveMap: { value: null } - - }, - - bumpmap: { - - bumpMap: { value: null }, - bumpScale: { value: 1 } - - }, - - normalmap: { - - normalMap: { value: null }, - normalScale: { value: new Vector2( 1, 1 ) } - - }, - - displacementmap: { - - displacementMap: { value: null }, - displacementScale: { value: 1 }, - displacementBias: { value: 0 } - - }, - - roughnessmap: { - - roughnessMap: { value: null } - - }, - - metalnessmap: { - - metalnessMap: { value: null } - - }, - - gradientmap: { - - gradientMap: { value: null } - - }, - - fog: { - - fogDensity: { value: 0.00025 }, - fogNear: { value: 1 }, - fogFar: { value: 2000 }, - fogColor: { value: new Color( 0xffffff ) } - - }, - - lights: { - - ambientLightColor: { value: [] }, - - lightProbe: { value: [] }, - - directionalLights: { value: [], properties: { - direction: {}, - color: {} - } }, - - directionalLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - directionalShadowMap: { value: [] }, - directionalShadowMatrix: { value: [] }, - - spotLights: { value: [], properties: { - color: {}, - position: {}, - direction: {}, - distance: {}, - coneCos: {}, - penumbraCos: {}, - decay: {} - } }, - - spotLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - spotShadowMap: { value: [] }, - spotShadowMatrix: { value: [] }, - - pointLights: { value: [], properties: { - color: {}, - position: {}, - decay: {}, - distance: {} - } }, - - pointLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {}, - shadowCameraNear: {}, - shadowCameraFar: {} - } }, - - pointShadowMap: { value: [] }, - pointShadowMatrix: { value: [] }, - - hemisphereLights: { value: [], properties: { - direction: {}, - skyColor: {}, - groundColor: {} - } }, - - // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src - rectAreaLights: { value: [], properties: { - color: {}, - position: {}, - width: {}, - height: {} - } } - - }, - - points: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - size: { value: 1.0 }, - scale: { value: 1.0 }, - map: { value: null }, - alphaMap: { value: null }, - uvTransform: { value: new Matrix3() } - - }, - - sprite: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - center: { value: new Vector2( 0.5, 0.5 ) }, - rotation: { value: 0.0 }, - map: { value: null }, - alphaMap: { value: null }, - uvTransform: { value: new Matrix3() } - - } + return true; }; @@ -14478,6 +14147,25 @@ function update( attribute, bufferType ) { + if ( attribute.isGLBufferAttribute ) { + + var cached = buffers.get( attribute ); + + if ( ! cached || cached.version < attribute.version ) { + + buffers.set( attribute, { + buffer: attribute.buffer, + type: attribute.type, + bytesPerElement: attribute.elementSize, + version: attribute.version + } ); + + } + + return; + + } + if ( attribute.isInterleavedBufferAttribute ) { attribute = attribute.data; } var data = buffers.get( attribute ); @@ -14508,116 +14196,115 @@ // PlaneGeometry - function PlaneGeometry( width, height, widthSegments, heightSegments ) { + function PlaneGeometry( width, height, widthSegments, heightSegments ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'PlaneGeometry'; + this.type = 'PlaneGeometry'; - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; - this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); - this.mergeVertices(); + this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); + this.mergeVertices(); - } + } - PlaneGeometry.prototype = Object.create( Geometry.prototype ); - PlaneGeometry.prototype.constructor = PlaneGeometry; + PlaneGeometry.prototype = Object.create( Geometry.prototype ); + PlaneGeometry.prototype.constructor = PlaneGeometry; // PlaneBufferGeometry - function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { + function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'PlaneBufferGeometry'; - this.type = 'PlaneBufferGeometry'; + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + width = width || 1; + height = height || 1; - width = width || 1; - height = height || 1; + var width_half = width / 2; + var height_half = height / 2; - var width_half = width / 2; - var height_half = height / 2; + var gridX = Math.floor( widthSegments ) || 1; + var gridY = Math.floor( heightSegments ) || 1; - var gridX = Math.floor( widthSegments ) || 1; - var gridY = Math.floor( heightSegments ) || 1; + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; - var gridX1 = gridX + 1; - var gridY1 = gridY + 1; + var segment_width = width / gridX; + var segment_height = height / gridY; - var segment_width = width / gridX; - var segment_height = height / gridY; + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // generate vertices, normals and uvs - // generate vertices, normals and uvs + for ( var iy = 0; iy < gridY1; iy ++ ) { - for ( var iy = 0; iy < gridY1; iy ++ ) { + var y = iy * segment_height - height_half; - var y = iy * segment_height - height_half; + for ( var ix = 0; ix < gridX1; ix ++ ) { - for ( var ix = 0; ix < gridX1; ix ++ ) { + var x = ix * segment_width - width_half; - var x = ix * segment_width - width_half; + vertices.push( x, - y, 0 ); - vertices.push( x, - y, 0 ); + normals.push( 0, 0, 1 ); - normals.push( 0, 0, 1 ); + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); + } } - } + // indices - // indices + for ( var iy$1 = 0; iy$1 < gridY; iy$1 ++ ) { - for ( var iy$1 = 0; iy$1 < gridY; iy$1 ++ ) { + for ( var ix$1 = 0; ix$1 < gridX; ix$1 ++ ) { - for ( var ix$1 = 0; ix$1 < gridX; ix$1 ++ ) { + var a = ix$1 + gridX1 * iy$1; + var b = ix$1 + gridX1 * ( iy$1 + 1 ); + var c = ( ix$1 + 1 ) + gridX1 * ( iy$1 + 1 ); + var d = ( ix$1 + 1 ) + gridX1 * iy$1; - var a = ix$1 + gridX1 * iy$1; - var b = ix$1 + gridX1 * ( iy$1 + 1 ); - var c = ( ix$1 + 1 ) + gridX1 * ( iy$1 + 1 ); - var d = ( ix$1 + 1 ) + gridX1 * iy$1; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } - - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + } - PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; + PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif"; @@ -14671,7 +14358,7 @@ var encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}"; - var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; + var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif"; @@ -14699,7 +14386,7 @@ var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif"; - var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif"; + var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif"; var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; @@ -15010,6 +14697,215 @@ sprite_vert: sprite_vert }; + /** + * Uniforms library for shared webgl shaders + */ + + var UniformsLib = { + + common: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + + map: { value: null }, + uvTransform: { value: new Matrix3() }, + uv2Transform: { value: new Matrix3() }, + + alphaMap: { value: null }, + + }, + + specularmap: { + + specularMap: { value: null }, + + }, + + envmap: { + + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + reflectivity: { value: 1.0 }, + refractionRatio: { value: 0.98 }, + maxMipLevel: { value: 0 } + + }, + + aomap: { + + aoMap: { value: null }, + aoMapIntensity: { value: 1 } + + }, + + lightmap: { + + lightMap: { value: null }, + lightMapIntensity: { value: 1 } + + }, + + emissivemap: { + + emissiveMap: { value: null } + + }, + + bumpmap: { + + bumpMap: { value: null }, + bumpScale: { value: 1 } + + }, + + normalmap: { + + normalMap: { value: null }, + normalScale: { value: new Vector2( 1, 1 ) } + + }, + + displacementmap: { + + displacementMap: { value: null }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } + + }, + + roughnessmap: { + + roughnessMap: { value: null } + + }, + + metalnessmap: { + + metalnessMap: { value: null } + + }, + + gradientmap: { + + gradientMap: { value: null } + + }, + + fog: { + + fogDensity: { value: 0.00025 }, + fogNear: { value: 1 }, + fogFar: { value: 2000 }, + fogColor: { value: new Color( 0xffffff ) } + + }, + + lights: { + + ambientLightColor: { value: [] }, + + lightProbe: { value: [] }, + + directionalLights: { value: [], properties: { + direction: {}, + color: {} + } }, + + directionalLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, + + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {} + } }, + + spotLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + spotShadowMap: { value: [] }, + spotShadowMatrix: { value: [] }, + + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {} + } }, + + pointLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {}, + shadowCameraNear: {}, + shadowCameraFar: {} + } }, + + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, + + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } }, + + // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src + rectAreaLights: { value: [], properties: { + color: {}, + position: {}, + width: {}, + height: {} + } }, + + ltc_1: { value: null }, + ltc_2: { value: null } + + }, + + points: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + size: { value: 1.0 }, + scale: { value: 1.0 }, + map: { value: null }, + alphaMap: { value: null }, + uvTransform: { value: new Matrix3() } + + }, + + sprite: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + center: { value: new Vector2( 0.5, 0.5 ) }, + rotation: { value: 0.0 }, + map: { value: null }, + alphaMap: { value: null }, + uvTransform: { value: new Matrix3() } + + } + + }; + var ShaderLib = { basic: { @@ -15310,7 +15206,7 @@ }; - function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { + function WebGLBackground( renderer, cubemaps, state, objects, premultipliedAlpha ) { var clearColor = new Color( 0x000000 ); var clearAlpha = 0; @@ -15326,6 +15222,12 @@ var background = scene.isScene === true ? scene.background : null; + if ( background && background.isTexture ) { + + background = cubemaps.get( background ); + + } + // Ignore background in AR // TODO: Reconsider this. @@ -15355,7 +15257,7 @@ } - if ( background && ( background.isCubeTexture || background.isWebGLCubeRenderTarget || background.mapping === CubeUVReflectionMapping ) ) { + if ( background && ( background.isCubeTexture || background.isWebGLCubeRenderTarget || background.isWebGLCubeRenderTargetTexture || background.mapping === CubeUVReflectionMapping ) ) { if ( boxMesh === undefined ) { @@ -15397,19 +15299,25 @@ } - var texture = background.isWebGLCubeRenderTarget ? background.texture : background; + if ( background.isWebGLCubeRenderTarget ) { + + // TODO Deprecate + + background = background.texture; - boxMesh.material.uniforms.envMap.value = texture; - boxMesh.material.uniforms.flipEnvMap.value = texture.isCubeTexture ? - 1 : 1; + } + + boxMesh.material.uniforms.envMap.value = background; + boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture ? - 1 : 1; if ( currentBackground !== background || - currentBackgroundVersion !== texture.version || + currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping ) { boxMesh.material.needsUpdate = true; currentBackground = background; - currentBackgroundVersion = texture.version; + currentBackgroundVersion = background.version; currentTonemapping = renderer.toneMapping; } @@ -15546,9 +15454,9 @@ } - updateBuffers = needsUpdate( geometry ); + updateBuffers = needsUpdate( geometry, index ); - if ( updateBuffers ) { saveCache( geometry ); } + if ( updateBuffers ) { saveCache( geometry, index ); } } else { @@ -15678,13 +15586,14 @@ enabledAttributes: enabledAttributes, attributeDivisors: attributeDivisors, object: vao, - attributes: {} + attributes: {}, + index: null }; } - function needsUpdate( geometry ) { + function needsUpdate( geometry, index ) { var cachedAttributes = currentState.attributes; var geometryAttributes = geometry.attributes; @@ -15696,17 +15605,23 @@ var cachedAttribute = cachedAttributes[ key ]; var geometryAttribute = geometryAttributes[ key ]; + if ( geometryAttribute.isGLBufferAttribute ) { return true; } + + if ( cachedAttribute === undefined ) { return true; } + if ( cachedAttribute.attribute !== geometryAttribute ) { return true; } if ( cachedAttribute.data !== geometryAttribute.data ) { return true; } } + if ( currentState.index !== index ) { return true; } + return false; } - function saveCache( geometry ) { + function saveCache( geometry, index ) { var cache = {}; var attributes = geometry.attributes; @@ -15730,6 +15645,8 @@ currentState.attributes = cache; + currentState.index = index; + } function initAttributes() { @@ -16266,7 +16183,7 @@ } - function WebGLClipping() { + function WebGLClipping( properties ) { var scope = this; @@ -16317,7 +16234,13 @@ }; - this.setState = function ( planes, clipIntersection, clipShadows, camera, cache, fromCache ) { + this.setState = function ( material, camera, useCache ) { + + var planes = material.clippingPlanes, + clipIntersection = material.clipIntersection, + clipShadows = material.clipShadows; + + var materialProperties = properties.get( material ); if ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) { @@ -16340,11 +16263,11 @@ var nGlobal = renderingShadows ? 0 : numGlobalPlanes, lGlobal = nGlobal * 4; - var dstArray = cache.clippingState || null; + var dstArray = materialProperties.clippingState || null; uniform.value = dstArray; // ensure unique state - dstArray = projectPlanes( planes, camera, lGlobal, fromCache ); + dstArray = projectPlanes( planes, camera, lGlobal, useCache ); for ( var i = 0; i !== lGlobal; ++ i ) { @@ -16352,7 +16275,7 @@ } - cache.clippingState = dstArray; + materialProperties.clippingState = dstArray; this.numIntersection = clipIntersection ? this.numPlanes : 0; this.numPlanes += nGlobal; @@ -16422,6 +16345,82 @@ } + function WebGLCubeMaps( renderer ) { + + var cubemaps = new WeakMap(); + + function mapTextureMapping( texture, mapping ) { + + if ( mapping === EquirectangularReflectionMapping ) { + + texture.mapping = CubeReflectionMapping; + + } else if ( mapping === EquirectangularRefractionMapping ) { + + texture.mapping = CubeRefractionMapping; + + } + + return texture; + + } + + function get( texture ) { + + if ( texture && texture.isTexture ) { + + var mapping = texture.mapping; + + if ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) { + + if ( cubemaps.has( texture ) ) { + + var cubemap = cubemaps.get( texture ).texture; + return mapTextureMapping( cubemap, texture.mapping ); + + } else { + + var image = texture.image; + + if ( image && image.height > 0 ) { + + var renderTarget = new WebGLCubeRenderTarget( image.height / 2 ); + renderTarget.fromEquirectangularTexture( renderer, texture ); + cubemaps.set( texture, renderTarget ); + + return mapTextureMapping( renderTarget.texture, texture.mapping ); + + } else { + + // image not yet ready. try the conversion next frame + + return null; + + } + + } + + } + + } + + return texture; + + } + + function dispose() { + + cubemaps = new WeakMap(); + + } + + return { + get: get, + dispose: dispose + }; + + } + function WebGLExtensions( gl ) { var extensions = {}; @@ -18239,7 +18238,7 @@ // Unroll Loops var deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; - var unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g; + var unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for\s*\(\s*int i \= (\d+)\; i < (\d+)\; i\s*\+\+\s*\)\s*{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g; function unrollLoops( string ) { @@ -18336,11 +18335,6 @@ envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; break; - case EquirectangularReflectionMapping: - case EquirectangularRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_EQUIREC'; - break; - } } @@ -18358,7 +18352,6 @@ switch ( parameters.envMapMode ) { case CubeRefractionMapping: - case EquirectangularRefractionMapping: case CubeUVRefractionMapping: envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; @@ -18424,6 +18417,7 @@ var program = gl.createProgram(); var prefixVertex, prefixFragment; + var versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + "\n" : ''; if ( parameters.isRawShaderMaterial ) { @@ -18693,20 +18687,20 @@ if ( parameters.isWebGL2 && ! parameters.isRawShaderMaterial ) { - // GLSL 3.0 conversion + // GLSL 3.0 conversion for built-in materials and ShaderMaterial + + versionString = '#version 300 es\n'; prefixVertex = [ - '#version 300 es\n', '#define attribute in', '#define varying out', '#define texture2D texture' ].join( '\n' ) + '\n' + prefixVertex; prefixFragment = [ - '#version 300 es\n', '#define varying in', - 'out highp vec4 pc_fragColor;', - '#define gl_FragColor pc_fragColor', + ( parameters.glslVersion === GLSL3 ) ? '' : 'out highp vec4 pc_fragColor;', + ( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor', '#define gl_FragDepthEXT gl_FragDepth', '#define texture2D texture', '#define textureCube texture', @@ -18721,8 +18715,8 @@ } - var vertexGlsl = prefixVertex + vertexShader; - var fragmentGlsl = prefixFragment + fragmentShader; + var vertexGlsl = versionString + prefixVertex + vertexShader; + var fragmentGlsl = versionString + prefixFragment + fragmentShader; // console.log( '*VERTEX*', vertexGlsl ); // console.log( '*FRAGMENT*', fragmentGlsl ); @@ -18871,7 +18865,7 @@ } - function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { + function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingStates, clipping ) { var programs = []; @@ -18917,7 +18911,7 @@ "sheen", "transmissionMap" ]; - function allocateBones( object ) { + function getMaxBones( object ) { var skeleton = object.skeleton; var bones = skeleton.bones; @@ -18976,19 +18970,19 @@ } - function getParameters( material, lights, shadows, scene, nClipPlanes, nClipIntersection, object ) { + function getParameters( material, lights, shadows, scene, object ) { var fog = scene.fog; var environment = material.isMeshStandardMaterial ? scene.environment : null; - var envMap = material.envMap || environment; + var envMap = cubemaps.get( material.envMap || environment ); var shaderID = shaderIDs[ material.type ]; // heuristics to create shader parameters according to lights in the scene // (not to blow over maxLights budget) - var maxBones = object.isSkinnedMesh ? allocateBones( object ) : 0; + var maxBones = object.isSkinnedMesh ? getMaxBones( object ) : 0; if ( material.precision !== null ) { @@ -19108,8 +19102,8 @@ numPointLightShadows: lights.pointShadowMap.length, numSpotLightShadows: lights.spotShadowMap.length, - numClippingPlanes: nClipPlanes, - numClipIntersection: nClipIntersection, + numClippingPlanes: clipping.numPlanes, + numClipIntersection: clipping.numIntersection, dithering: material.dithering, @@ -19138,7 +19132,9 @@ rendererExtensionDrawBuffers: isWebGL2 || extensions.get( 'WEBGL_draw_buffers' ) !== null, rendererExtensionShaderTextureLod: isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) !== null, - customProgramCacheKey: material.customProgramCacheKey() + customProgramCacheKey: material.customProgramCacheKey(), + + glslVersion: material.glslVersion }; @@ -19711,6 +19707,8 @@ spotShadowMap: [], spotShadowMatrix: [], rectArea: [], + rectAreaLTC1: null, + rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], @@ -19931,6 +19929,13 @@ } + if ( rectAreaLength > 0 ) { + + state.rectAreaLTC1 = UniformsLib.LTC_1; + state.rectAreaLTC2 = UniformsLib.LTC_2; + + } + state.ambient[ 0 ] = r; state.ambient[ 1 ] = g; state.ambient[ 2 ] = b; @@ -23853,7 +23858,7 @@ } - function refreshMaterialUniforms( uniforms, material, environment, pixelRatio, height ) { + function refreshMaterialUniforms( uniforms, material, pixelRatio, height ) { if ( material.isMeshBasicMaterial ) { @@ -23876,15 +23881,15 @@ } else if ( material.isMeshStandardMaterial ) { - refreshUniformsCommon( uniforms, material, environment ); + refreshUniformsCommon( uniforms, material ); if ( material.isMeshPhysicalMaterial ) { - refreshUniformsPhysical( uniforms, material, environment ); + refreshUniformsPhysical( uniforms, material ); } else { - refreshUniformsStandard( uniforms, material, environment ); + refreshUniformsStandard( uniforms, material ); } @@ -23939,7 +23944,7 @@ } - function refreshUniformsCommon( uniforms, material, environment ) { + function refreshUniformsCommon( uniforms, material ) { uniforms.opacity.value = material.opacity; @@ -23973,7 +23978,7 @@ } - var envMap = material.envMap || environment; + var envMap = properties.get( material ).envMap; if ( envMap ) { @@ -24311,7 +24316,7 @@ } - function refreshUniformsStandard( uniforms, material, environment ) { + function refreshUniformsStandard( uniforms, material ) { uniforms.roughness.value = material.roughness; uniforms.metalness.value = material.metalness; @@ -24358,7 +24363,9 @@ } - if ( material.envMap || environment ) { + var envMap = properties.get( material ).envMap; + + if ( envMap ) { //uniforms.envMap.value = material.envMap; // part of uniforms common uniforms.envMapIntensity.value = material.envMapIntensity; @@ -24367,9 +24374,9 @@ } - function refreshUniformsPhysical( uniforms, material, environment ) { + function refreshUniformsPhysical( uniforms, material ) { - refreshUniformsStandard( uniforms, material, environment ); + refreshUniformsStandard( uniforms, material ); uniforms.reflectivity.value = material.reflectivity; // also part of uniforms common @@ -24619,7 +24626,6 @@ // clipping - var _clipping = new WebGLClipping(); var _clippingEnabled = false; var _localClippingEnabled = false; @@ -24721,8 +24727,8 @@ } var extensions, capabilities, state, info; - var properties, textures, attributes, geometries, objects; - var programCache, materials, renderLists, renderStates; + var properties, textures, cubemaps, attributes, geometries, objects; + var programCache, materials, renderLists, renderStates, clipping; var background, morphtargets, bufferRenderer, indexedBufferRenderer; @@ -24758,17 +24764,18 @@ info = new WebGLInfo( _gl ); properties = new WebGLProperties(); textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ); + cubemaps = new WebGLCubeMaps( _this ); attributes = new WebGLAttributes( _gl, capabilities ); bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities ); geometries = new WebGLGeometries( _gl, attributes, info, bindingStates ); objects = new WebGLObjects( _gl, geometries, attributes, info ); morphtargets = new WebGLMorphtargets( _gl ); - programCache = new WebGLPrograms( _this, extensions, capabilities, bindingStates ); + clipping = new WebGLClipping( properties ); + programCache = new WebGLPrograms( _this, cubemaps, extensions, capabilities, bindingStates, clipping ); materials = new WebGLMaterials( properties ); renderLists = new WebGLRenderLists( properties ); renderStates = new WebGLRenderStates(); - - background = new WebGLBackground( _this, state, objects, _premultipliedAlpha ); + background = new WebGLBackground( _this, cubemaps, state, objects, _premultipliedAlpha ); bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities ); indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities ); @@ -25058,6 +25065,7 @@ renderLists.dispose(); renderStates.dispose(); properties.dispose(); + cubemaps.dispose(); objects.dispose(); bindingStates.dispose(); @@ -25480,7 +25488,7 @@ _frustum.setFromProjectionMatrix( _projScreenMatrix ); _localClippingEnabled = this.localClippingEnabled; - _clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); + _clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); currentRenderList = renderLists.get( scene, camera ); currentRenderList.init(); @@ -25497,7 +25505,7 @@ // - if ( _clippingEnabled === true ) { _clipping.beginShadows(); } + if ( _clippingEnabled === true ) { clipping.beginShadows(); } var shadowsArray = currentRenderState.state.shadowsArray; @@ -25505,7 +25513,7 @@ currentRenderState.setupLights( camera ); - if ( _clippingEnabled === true ) { _clipping.endShadows(); } + if ( _clippingEnabled === true ) { clipping.endShadows(); } // @@ -25774,7 +25782,7 @@ var lightsStateVersion = lights.state.version; - var parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, _clipping.numPlanes, _clipping.numIntersection, object ); + var parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object ); var programCacheKey = programCache.getProgramCacheKey( parameters ); var program = materialProperties.program; @@ -25798,7 +25806,11 @@ } else if ( parameters.shaderID !== undefined ) { - // same glsl and uniform list + // same glsl and uniform list, envMap still needs the update here to avoid a frame-late effect + + var environment = material.isMeshStandardMaterial ? scene.environment : null; + materialProperties.envMap = cubemaps.get( material.envMap || environment ); + return; } else { @@ -25862,14 +25874,15 @@ ! material.isRawShaderMaterial || material.clipping === true ) { - materialProperties.numClippingPlanes = _clipping.numPlanes; - materialProperties.numIntersection = _clipping.numIntersection; - uniforms.clippingPlanes = _clipping.uniform; + materialProperties.numClippingPlanes = clipping.numPlanes; + materialProperties.numIntersection = clipping.numIntersection; + uniforms.clippingPlanes = clipping.uniform; } materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; materialProperties.fog = scene.fog; + materialProperties.envMap = cubemaps.get( material.envMap || materialProperties.environment ); // store the light setup it was created for @@ -25887,6 +25900,8 @@ uniforms.spotLights.value = lights.state.spot; uniforms.spotLightShadows.value = lights.state.spotShadow; uniforms.rectAreaLights.value = lights.state.rectArea; + uniforms.ltc_1.value = lights.state.rectAreaLTC1; + uniforms.ltc_2.value = lights.state.rectAreaLTC2; uniforms.pointLights.value = lights.state.point; uniforms.pointLightShadows.value = lights.state.pointShadow; uniforms.hemisphereLights.value = lights.state.hemi; @@ -25901,9 +25916,8 @@ } - var progUniforms = materialProperties.program.getUniforms(), - uniformsList = - WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); + var progUniforms = materialProperties.program.getUniforms(); + var uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); materialProperties.uniformsList = uniformsList; @@ -25918,6 +25932,7 @@ var fog = scene.fog; var environment = material.isMeshStandardMaterial ? scene.environment : null; var encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : _currentRenderTarget.texture.encoding; + var envMap = cubemaps.get( material.envMap || environment ); var materialProperties = properties.get( material ); var lights = currentRenderState.state.lights; @@ -25933,9 +25948,7 @@ // we might want to call this function with some ClippingGroup // object instead of the material, once it becomes feasible // (#8465, #8379) - _clipping.setState( - material.clippingPlanes, material.clipIntersection, material.clipShadows, - camera, materialProperties, useCache ); + clipping.setState( material, camera, useCache ); } @@ -25943,11 +25956,7 @@ if ( material.version === materialProperties.__version ) { - if ( materialProperties.program === undefined ) { - - initMaterial( material, scene, object ); - - } else if ( material.fog && materialProperties.fog !== fog ) { + if ( material.fog && materialProperties.fog !== fog ) { initMaterial( material, scene, object ); @@ -25960,8 +25969,8 @@ initMaterial( material, scene, object ); } else if ( materialProperties.numClippingPlanes !== undefined && - ( materialProperties.numClippingPlanes !== _clipping.numPlanes || - materialProperties.numIntersection !== _clipping.numIntersection ) ) { + ( materialProperties.numClippingPlanes !== clipping.numPlanes || + materialProperties.numIntersection !== clipping.numIntersection ) ) { initMaterial( material, scene, object ); @@ -25969,6 +25978,10 @@ initMaterial( material, scene, object ); + } else if ( materialProperties.envMap !== envMap ) { + + initMaterial( material, scene, object ); + } } else { @@ -26161,13 +26174,7 @@ } - materials.refreshMaterialUniforms( m_uniforms, material, environment, _pixelRatio, _height ); - - // RectAreaLight Texture - // TODO (mrdoob): Find a nicer implementation - - if ( m_uniforms.ltc_1 !== undefined ) { m_uniforms.ltc_1.value = UniformsLib.LTC_1; } - if ( m_uniforms.ltc_2 !== undefined ) { m_uniforms.ltc_2.value = UniformsLib.LTC_2; } + materials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height ); WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); @@ -26243,6 +26250,30 @@ }; + this.getRenderList = function () { + + return currentRenderList; + + }; + + this.setRenderList = function ( renderList ) { + + currentRenderList = renderList; + + }; + + this.getRenderState = function () { + + return currentRenderState; + + }; + + this.setRenderState = function ( renderState ) { + + currentRenderState = renderState; + + }; + this.getRenderTarget = function () { return _currentRenderTarget; @@ -26485,38 +26516,34 @@ } ); - function FogExp2( color, density ) { + var FogExp2 = function FogExp2( color, density ) { this.name = ''; this.color = new Color( color ); this.density = ( density !== undefined ) ? density : 0.00025; - } - - Object.assign( FogExp2.prototype, { - - isFogExp2: true, + }; - clone: function () { + FogExp2.prototype.clone = function clone () { - return new FogExp2( this.color, this.density ); + return new FogExp2( this.color, this.density ); - }, + }; - toJSON: function ( /* meta */ ) { + FogExp2.prototype.toJSON = function toJSON ( /* meta */ ) { - return { - type: 'FogExp2', - color: this.color.getHex(), - density: this.density - }; + return { + type: 'FogExp2', + color: this.color.getHex(), + density: this.density + }; - } + }; - } ); + FogExp2.prototype.isFogExp2 = true; - function Fog( color, near, far ) { + var Fog = function Fog( color, near, far ) { this.name = ''; @@ -26525,30 +26552,81 @@ this.near = ( near !== undefined ) ? near : 1; this.far = ( far !== undefined ) ? far : 1000; - } + }; - Object.assign( Fog.prototype, { + Fog.prototype.clone = function clone () { - isFog: true, + return new Fog( this.color, this.near, this.far ); - clone: function () { + }; - return new Fog( this.color, this.near, this.far ); + Fog.prototype.toJSON = function toJSON ( /* meta */ ) { - }, + return { + type: 'Fog', + color: this.color.getHex(), + near: this.near, + far: this.far + }; - toJSON: function ( /* meta */ ) { + }; - return { - type: 'Fog', - color: this.color.getHex(), - near: this.near, - far: this.far - }; + Fog.prototype.isFog = true; + + function Scene() { + + Object3D.call(this); + this.type = 'Scene'; + + this.background = null; + this.environment = null; + this.fog = null; + + this.overrideMaterial = null; + + this.autoUpdate = true; // checked by the renderer + + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef + + } } - } ); + Scene.prototype = Object.create( Object3D.prototype ); + Scene.prototype.constructor = Scene; + + Scene.prototype.copy = function copy ( source, recursive ) { + + Object3D.prototype.copy.call( this, source, recursive ); + + if ( source.background !== null ) { this.background = source.background.clone(); } + if ( source.environment !== null ) { this.environment = source.environment.clone(); } + if ( source.fog !== null ) { this.fog = source.fog.clone(); } + + if ( source.overrideMaterial !== null ) { this.overrideMaterial = source.overrideMaterial.clone(); } + + this.autoUpdate = source.autoUpdate; + this.matrixAutoUpdate = source.matrixAutoUpdate; + + return this; + + }; + + Scene.prototype.toJSON = function toJSON ( meta ) { + + var data = Object3D.prototype.toJSON.call( this, meta ); + + if ( this.background !== null ) { data.object.background = this.background.toJSON( meta ); } + if ( this.environment !== null ) { data.object.environment = this.environment.toJSON( meta ); } + if ( this.fog !== null ) { data.object.fog = this.fog.toJSON(); } + + return data; + + }; + + Scene.prototype.isScene = true; function InterleavedBuffer( array, stride ) { @@ -28615,105 +28693,106 @@ function WireframeGeometry( geometry ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'WireframeGeometry'; - this.type = 'WireframeGeometry'; + // buffer - // buffer + var vertices = []; - var vertices = []; + // helper variables - // helper variables + var edge = [ 0, 0 ], edges = {}; + var keys = [ 'a', 'b', 'c' ]; - var edge = [ 0, 0 ], edges = {}; - var keys = [ 'a', 'b', 'c' ]; + // different logic for Geometry and BufferGeometry - // different logic for Geometry and BufferGeometry + if ( geometry && geometry.isGeometry ) { - if ( geometry && geometry.isGeometry ) { + // create a data structure that contains all edges without duplicates - // create a data structure that contains all edges without duplicates + var faces = geometry.faces; - var faces = geometry.faces; + for ( var i = 0, l = faces.length; i < l; i ++ ) { - for ( var i = 0, l = faces.length; i < l; i ++ ) { + var face = faces[ i ]; - var face = faces[ i ]; + for ( var j = 0; j < 3; j ++ ) { - for ( var j = 0; j < 3; j ++ ) { + var edge1 = face[ keys[ j ] ]; + var edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; + edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates + edge[ 1 ] = Math.max( edge1, edge2 ); - var edge1 = face[ keys[ j ] ]; - var edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); + var key = edge[ 0 ] + ',' + edge[ 1 ]; - var key = edge[ 0 ] + ',' + edge[ 1 ]; + if ( edges[ key ] === undefined ) { - if ( edges[ key ] === undefined ) { + edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + } } } - } + // generate vertices - // generate vertices + for ( var key$1 in edges ) { - for ( var key$1 in edges ) { + var e = edges[ key$1 ]; - var e = edges[ key$1 ]; + var vertex = geometry.vertices[ e.index1 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - var vertex = geometry.vertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex = geometry.vertices[ e.index2 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex = geometry.vertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + } - } + } else if ( geometry && geometry.isBufferGeometry ) { - } else if ( geometry && geometry.isBufferGeometry ) { + var vertex$1 = new Vector3(); - var vertex$1 = new Vector3(); + if ( geometry.index !== null ) { - if ( geometry.index !== null ) { + // indexed BufferGeometry - // indexed BufferGeometry + var position = geometry.attributes.position; + var indices = geometry.index; + var groups = geometry.groups; - var position = geometry.attributes.position; - var indices = geometry.index; - var groups = geometry.groups; + if ( groups.length === 0 ) { - if ( groups.length === 0 ) { + groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; - groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; + } - } + // create a data structure that contains all eges without duplicates - // create a data structure that contains all eges without duplicates + for ( var o = 0, ol = groups.length; o < ol; ++ o ) { - for ( var o = 0, ol = groups.length; o < ol; ++ o ) { + var group = groups[ o ]; - var group = groups[ o ]; + var start = group.start; + var count = group.count; - var start = group.start; - var count = group.count; + for ( var i$1 = start, l$1 = ( start + count ); i$1 < l$1; i$1 += 3 ) { - for ( var i$1 = start, l$1 = ( start + count ); i$1 < l$1; i$1 += 3 ) { + for ( var j$1 = 0; j$1 < 3; j$1 ++ ) { - for ( var j$1 = 0; j$1 < 3; j$1 ++ ) { + var edge1$1 = indices.getX( i$1 + j$1 ); + var edge2$1 = indices.getX( i$1 + ( j$1 + 1 ) % 3 ); + edge[ 0 ] = Math.min( edge1$1, edge2$1 ); // sorting prevents duplicates + edge[ 1 ] = Math.max( edge1$1, edge2$1 ); - var edge1$1 = indices.getX( i$1 + j$1 ); - var edge2$1 = indices.getX( i$1 + ( j$1 + 1 ) % 3 ); - edge[ 0 ] = Math.min( edge1$1, edge2$1 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1$1, edge2$1 ); + var key$2 = edge[ 0 ] + ',' + edge[ 1 ]; - var key$2 = edge[ 0 ] + ',' + edge[ 1 ]; + if ( edges[ key$2 ] === undefined ) { - if ( edges[ key$2 ] === undefined ) { + edges[ key$2 ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - edges[ key$2 ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + } } @@ -28721,42 +28800,42 @@ } - } + // generate vertices - // generate vertices + for ( var key$3 in edges ) { - for ( var key$3 in edges ) { + var e$1 = edges[ key$3 ]; - var e$1 = edges[ key$3 ]; + vertex$1.fromBufferAttribute( position, e$1.index1 ); + vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); - vertex$1.fromBufferAttribute( position, e$1.index1 ); - vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); + vertex$1.fromBufferAttribute( position, e$1.index2 ); + vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); - vertex$1.fromBufferAttribute( position, e$1.index2 ); - vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); + } - } + } else { - } else { + // non-indexed BufferGeometry - // non-indexed BufferGeometry + var position$1 = geometry.attributes.position; - var position$1 = geometry.attributes.position; + for ( var i$2 = 0, l$2 = ( position$1.count / 3 ); i$2 < l$2; i$2 ++ ) { - for ( var i$2 = 0, l$2 = ( position$1.count / 3 ); i$2 < l$2; i$2 ++ ) { + for ( var j$2 = 0; j$2 < 3; j$2 ++ ) { - for ( var j$2 = 0; j$2 < 3; j$2 ++ ) { + // three edges per triangle, an edge is represented as (index1, index2) + // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) - // three edges per triangle, an edge is represented as (index1, index2) - // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) + var index1 = 3 * i$2 + j$2; + vertex$1.fromBufferAttribute( position$1, index1 ); + vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); - var index1 = 3 * i$2 + j$2; - vertex$1.fromBufferAttribute( position$1, index1 ); - vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); + var index2 = 3 * i$2 + ( ( j$2 + 1 ) % 3 ); + vertex$1.fromBufferAttribute( position$1, index2 ); + vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); - var index2 = 3 * i$2 + ( ( j$2 + 1 ) % 3 ); - vertex$1.fromBufferAttribute( position$1, index2 ); - vertices.push( vertex$1.x, vertex$1.y, vertex$1.z ); + } } @@ -28764,16 +28843,14 @@ } - } - - // build geometry + // build geometry - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - } + } - WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); - WireframeGeometry.prototype.constructor = WireframeGeometry; + WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); + WireframeGeometry.prototype.constructor = WireframeGeometry; /** * Parametric Surfaces Geometry @@ -28928,158 +29005,160 @@ // PolyhedronGeometry - function PolyhedronGeometry( vertices, indices, radius, detail ) { + function PolyhedronGeometry( vertices, indices, radius, detail ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'PolyhedronGeometry'; + this.type = 'PolyhedronGeometry'; - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); + this.mergeVertices(); - } + } - PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); - PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; + PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); + PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; // PolyhedronBufferGeometry - function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { + function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'PolyhedronBufferGeometry'; + this.type = 'PolyhedronBufferGeometry'; - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; - radius = radius || 1; - detail = detail || 0; + radius = radius || 1; + detail = detail || 0; - // default buffer data + // default buffer data - var vertexBuffer = []; - var uvBuffer = []; + var vertexBuffer = []; + var uvBuffer = []; - // the subdivision creates the vertex buffer data + // the subdivision creates the vertex buffer data - subdivide( detail ); + subdivide( detail ); - // all vertices should lie on a conceptual sphere with a given radius + // all vertices should lie on a conceptual sphere with a given radius - applyRadius( radius ); + applyRadius( radius ); - // finally, create the uv data + // finally, create the uv data - generateUVs(); + generateUVs(); - // build non-indexed geometry + // build non-indexed geometry - this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); + this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); - if ( detail === 0 ) { + if ( detail === 0 ) { - this.computeVertexNormals(); // flat normals + this.computeVertexNormals(); // flat normals - } else { + } else { - this.normalizeNormals(); // smooth normals + this.normalizeNormals(); // smooth normals - } + } + + // helper functions - // helper functions + function subdivide( detail ) { - function subdivide( detail ) { + var a = new Vector3(); + var b = new Vector3(); + var c = new Vector3(); - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); + // iterate over all faces and apply a subdivison with the given detail value - // iterate over all faces and apply a subdivison with the given detail value + for ( var i = 0; i < indices.length; i += 3 ) { - for ( var i = 0; i < indices.length; i += 3 ) { + // get the vertices of the face - // get the vertices of the face + getVertexByIndex( indices[ i + 0 ], a ); + getVertexByIndex( indices[ i + 1 ], b ); + getVertexByIndex( indices[ i + 2 ], c ); - getVertexByIndex( indices[ i + 0 ], a ); - getVertexByIndex( indices[ i + 1 ], b ); - getVertexByIndex( indices[ i + 2 ], c ); + // perform subdivision - // perform subdivision + subdivideFace( a, b, c, detail ); - subdivideFace( a, b, c, detail ); + } } - } + function subdivideFace( a, b, c, detail ) { - function subdivideFace( a, b, c, detail ) { + var cols = Math.pow( 2, detail ); - var cols = Math.pow( 2, detail ); + // we use this multidimensional array as a data structure for creating the subdivision - // we use this multidimensional array as a data structure for creating the subdivision + var v = []; - var v = []; + // construct all of the vertices for this subdivision - // construct all of the vertices for this subdivision + for ( var i = 0; i <= cols; i ++ ) { - for ( var i = 0; i <= cols; i ++ ) { + v[ i ] = []; - v[ i ] = []; + var aj = a.clone().lerp( c, i / cols ); + var bj = b.clone().lerp( c, i / cols ); - var aj = a.clone().lerp( c, i / cols ); - var bj = b.clone().lerp( c, i / cols ); + var rows = cols - i; - var rows = cols - i; + for ( var j = 0; j <= rows; j ++ ) { - for ( var j = 0; j <= rows; j ++ ) { + if ( j === 0 && i === cols ) { - if ( j === 0 && i === cols ) { + v[ i ][ j ] = aj; - v[ i ][ j ] = aj; + } else { - } else { + v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); - v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); + } } } - } + // construct all of the faces - // construct all of the faces + for ( var i$1 = 0; i$1 < cols; i$1 ++ ) { - for ( var i$1 = 0; i$1 < cols; i$1 ++ ) { + for ( var j$1 = 0; j$1 < 2 * ( cols - i$1 ) - 1; j$1 ++ ) { - for ( var j$1 = 0; j$1 < 2 * ( cols - i$1 ) - 1; j$1 ++ ) { + var k = Math.floor( j$1 / 2 ); - var k = Math.floor( j$1 / 2 ); + if ( j$1 % 2 === 0 ) { - if ( j$1 % 2 === 0 ) { + pushVertex( v[ i$1 ][ k + 1 ] ); + pushVertex( v[ i$1 + 1 ][ k ] ); + pushVertex( v[ i$1 ][ k ] ); - pushVertex( v[ i$1 ][ k + 1 ] ); - pushVertex( v[ i$1 + 1 ][ k ] ); - pushVertex( v[ i$1 ][ k ] ); + } else { - } else { + pushVertex( v[ i$1 ][ k + 1 ] ); + pushVertex( v[ i$1 + 1 ][ k + 1 ] ); + pushVertex( v[ i$1 + 1 ][ k ] ); - pushVertex( v[ i$1 ][ k + 1 ] ); - pushVertex( v[ i$1 + 1 ][ k + 1 ] ); - pushVertex( v[ i$1 + 1 ][ k ] ); + } } @@ -29087,589 +29166,587 @@ } - } + function applyRadius( radius ) { - function applyRadius( radius ) { + var vertex = new Vector3(); - var vertex = new Vector3(); + // iterate over the entire buffer and apply the radius to each vertex - // iterate over the entire buffer and apply the radius to each vertex + for ( var i = 0; i < vertexBuffer.length; i += 3 ) { - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; + vertex.normalize().multiplyScalar( radius ); - vertex.normalize().multiplyScalar( radius ); + vertexBuffer[ i + 0 ] = vertex.x; + vertexBuffer[ i + 1 ] = vertex.y; + vertexBuffer[ i + 2 ] = vertex.z; - vertexBuffer[ i + 0 ] = vertex.x; - vertexBuffer[ i + 1 ] = vertex.y; - vertexBuffer[ i + 2 ] = vertex.z; + } } - } + function generateUVs() { - function generateUVs() { + var vertex = new Vector3(); - var vertex = new Vector3(); + for ( var i = 0; i < vertexBuffer.length; i += 3 ) { - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; + var u = azimuth( vertex ) / 2 / Math.PI + 0.5; + var v = inclination( vertex ) / Math.PI + 0.5; + uvBuffer.push( u, 1 - v ); - var u = azimuth( vertex ) / 2 / Math.PI + 0.5; - var v = inclination( vertex ) / Math.PI + 0.5; - uvBuffer.push( u, 1 - v ); + } - } + correctUVs(); - correctUVs(); + correctSeam(); - correctSeam(); + } - } + function correctSeam() { - function correctSeam() { + // handle case when face straddles the seam, see #3269 - // handle case when face straddles the seam, see #3269 + for ( var i = 0; i < uvBuffer.length; i += 6 ) { - for ( var i = 0; i < uvBuffer.length; i += 6 ) { + // uv data of a single face - // uv data of a single face + var x0 = uvBuffer[ i + 0 ]; + var x1 = uvBuffer[ i + 2 ]; + var x2 = uvBuffer[ i + 4 ]; - var x0 = uvBuffer[ i + 0 ]; - var x1 = uvBuffer[ i + 2 ]; - var x2 = uvBuffer[ i + 4 ]; + var max = Math.max( x0, x1, x2 ); + var min = Math.min( x0, x1, x2 ); - var max = Math.max( x0, x1, x2 ); - var min = Math.min( x0, x1, x2 ); + // 0.9 is somewhat arbitrary - // 0.9 is somewhat arbitrary + if ( max > 0.9 && min < 0.1 ) { - if ( max > 0.9 && min < 0.1 ) { + if ( x0 < 0.2 ) { uvBuffer[ i + 0 ] += 1; } + if ( x1 < 0.2 ) { uvBuffer[ i + 2 ] += 1; } + if ( x2 < 0.2 ) { uvBuffer[ i + 4 ] += 1; } - if ( x0 < 0.2 ) { uvBuffer[ i + 0 ] += 1; } - if ( x1 < 0.2 ) { uvBuffer[ i + 2 ] += 1; } - if ( x2 < 0.2 ) { uvBuffer[ i + 4 ] += 1; } + } } } - } + function pushVertex( vertex ) { - function pushVertex( vertex ) { + vertexBuffer.push( vertex.x, vertex.y, vertex.z ); - vertexBuffer.push( vertex.x, vertex.y, vertex.z ); + } - } + function getVertexByIndex( index, vertex ) { - function getVertexByIndex( index, vertex ) { + var stride = index * 3; - var stride = index * 3; + vertex.x = vertices[ stride + 0 ]; + vertex.y = vertices[ stride + 1 ]; + vertex.z = vertices[ stride + 2 ]; - vertex.x = vertices[ stride + 0 ]; - vertex.y = vertices[ stride + 1 ]; - vertex.z = vertices[ stride + 2 ]; + } - } + function correctUVs() { - function correctUVs() { + var a = new Vector3(); + var b = new Vector3(); + var c = new Vector3(); - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); + var centroid = new Vector3(); - var centroid = new Vector3(); + var uvA = new Vector2(); + var uvB = new Vector2(); + var uvC = new Vector2(); - var uvA = new Vector2(); - var uvB = new Vector2(); - var uvC = new Vector2(); + for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { - for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { + a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); + b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); + c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); - a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); - b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); - c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); + uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); + uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); + uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); - uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); - uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); - uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); + centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); - centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); + var azi = azimuth( centroid ); - var azi = azimuth( centroid ); + correctUV( uvA, j + 0, a, azi ); + correctUV( uvB, j + 2, b, azi ); + correctUV( uvC, j + 4, c, azi ); - correctUV( uvA, j + 0, a, azi ); - correctUV( uvB, j + 2, b, azi ); - correctUV( uvC, j + 4, c, azi ); + } } - } + function correctUV( uv, stride, vector, azimuth ) { - function correctUV( uv, stride, vector, azimuth ) { + if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { - if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { + uvBuffer[ stride ] = uv.x - 1; - uvBuffer[ stride ] = uv.x - 1; + } - } + if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { - if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { + uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; - uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; + } } - } + // Angle around the Y axis, counter-clockwise when looking from above. - // Angle around the Y axis, counter-clockwise when looking from above. + function azimuth( vector ) { - function azimuth( vector ) { + return Math.atan2( vector.z, - vector.x ); - return Math.atan2( vector.z, - vector.x ); + } - } + // Angle above the XZ plane. - // Angle above the XZ plane. + function inclination( vector ) { - function inclination( vector ) { + return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); - return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); + } } - } - - PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; + PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; // TetrahedronGeometry - function TetrahedronGeometry( radius, detail ) { + function TetrahedronGeometry( radius, detail ) { - Geometry.call( this ); + Geometry.call(this); + this.type = 'TetrahedronGeometry'; - this.type = 'TetrahedronGeometry'; + this.parameters = { + radius: radius, + detail: detail + }; - this.parameters = { - radius: radius, - detail: detail - }; + this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); - this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + } - } + TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); + TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; - TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); - TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; // TetrahedronBufferGeometry - function TetrahedronBufferGeometry( radius, detail ) { + function TetrahedronBufferGeometry( radius, detail ) { - var vertices = [ - 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 - ]; + var vertices = [ + 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 + ]; - var indices = [ - 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 - ]; + var indices = [ + 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - this.type = 'TetrahedronBufferGeometry'; + this.type = 'TetrahedronBufferGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - } + } - TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; + TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; // OctahedronGeometry - function OctahedronGeometry( radius, detail ) { + function OctahedronGeometry( radius, detail ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'OctahedronGeometry'; + this.type = 'OctahedronGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); - } + } - OctahedronGeometry.prototype = Object.create( Geometry.prototype ); - OctahedronGeometry.prototype.constructor = OctahedronGeometry; + OctahedronGeometry.prototype = Object.create( Geometry.prototype ); + OctahedronGeometry.prototype.constructor = OctahedronGeometry; // OctahedronBufferGeometry - function OctahedronBufferGeometry( radius, detail ) { + function OctahedronBufferGeometry( radius, detail ) { - var vertices = [ - 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, - 1, 0, 0, 0, 1, 0, 0, - 1 - ]; + var vertices = [ + 1, 0, 0, - 1, 0, 0, 0, 1, 0, + 0, - 1, 0, 0, 0, 1, 0, 0, - 1 + ]; - var indices = [ - 0, 2, 4, 0, 4, 3, 0, 3, 5, - 0, 5, 2, 1, 2, 5, 1, 5, 3, - 1, 3, 4, 1, 4, 2 - ]; + var indices = [ + 0, 2, 4, 0, 4, 3, 0, 3, 5, + 0, 5, 2, 1, 2, 5, 1, 5, 3, + 1, 3, 4, 1, 4, 2 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - this.type = 'OctahedronBufferGeometry'; + this.type = 'OctahedronBufferGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - } + } - OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; + OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; // IcosahedronGeometry - function IcosahedronGeometry( radius, detail ) { + function IcosahedronGeometry( radius, detail ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'IcosahedronGeometry'; + this.type = 'IcosahedronGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); - } + } - IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); - IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; + IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); + IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; // IcosahedronBufferGeometry - function IcosahedronBufferGeometry( radius, detail ) { + function IcosahedronBufferGeometry( radius, detail ) { - var t = ( 1 + Math.sqrt( 5 ) ) / 2; + var t = ( 1 + Math.sqrt( 5 ) ) / 2; - var vertices = [ - - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, - 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, - t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 - ]; + var vertices = [ + - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, + 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, + t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 + ]; - var indices = [ - 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, - 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, - 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, - 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 - ]; + var indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, + 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, + 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, + 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - this.type = 'IcosahedronBufferGeometry'; + this.type = 'IcosahedronBufferGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - } + } - IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; + IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; // DodecahedronGeometry - function DodecahedronGeometry( radius, detail ) { + function DodecahedronGeometry( radius, detail ) { - Geometry.call( this ); - - this.type = 'DodecahedronGeometry'; + Geometry.call(this); + this.type = 'DodecahedronGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); - } + } - DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); - DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; + DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); + DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; // DodecahedronBufferGeometry - function DodecahedronBufferGeometry( radius, detail ) { + function DodecahedronBufferGeometry( radius, detail ) { - var t = ( 1 + Math.sqrt( 5 ) ) / 2; - var r = 1 / t; + var t = ( 1 + Math.sqrt( 5 ) ) / 2; + var r = 1 / t; - var vertices = [ + var vertices = [ - // (±1, ±1, ±1) - - 1, - 1, - 1, - 1, - 1, 1, - - 1, 1, - 1, - 1, 1, 1, - 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, 1, 1, 1, + // (±1, ±1, ±1) + - 1, - 1, - 1, - 1, - 1, 1, + - 1, 1, - 1, - 1, 1, 1, + 1, - 1, - 1, 1, - 1, 1, + 1, 1, - 1, 1, 1, 1, - // (0, ±1/φ, ±φ) - 0, - r, - t, 0, - r, t, - 0, r, - t, 0, r, t, + // (0, ±1/φ, ±φ) + 0, - r, - t, 0, - r, t, + 0, r, - t, 0, r, t, - // (±1/φ, ±φ, 0) - - r, - t, 0, - r, t, 0, - r, - t, 0, r, t, 0, + // (±1/φ, ±φ, 0) + - r, - t, 0, - r, t, 0, + r, - t, 0, r, t, 0, - // (±φ, 0, ±1/φ) - - t, 0, - r, t, 0, - r, - - t, 0, r, t, 0, r - ]; + // (±φ, 0, ±1/φ) + - t, 0, - r, t, 0, - r, + - t, 0, r, t, 0, r + ]; - var indices = [ - 3, 11, 7, 3, 7, 15, 3, 15, 13, - 7, 19, 17, 7, 17, 6, 7, 6, 15, - 17, 4, 8, 17, 8, 10, 17, 10, 6, - 8, 0, 16, 8, 16, 2, 8, 2, 10, - 0, 12, 1, 0, 1, 18, 0, 18, 16, - 6, 10, 2, 6, 2, 13, 6, 13, 15, - 2, 16, 18, 2, 18, 3, 2, 3, 13, - 18, 1, 9, 18, 9, 11, 18, 11, 3, - 4, 14, 12, 4, 12, 0, 4, 0, 8, - 11, 9, 5, 11, 5, 19, 11, 19, 7, - 19, 5, 14, 19, 14, 4, 19, 4, 17, - 1, 12, 14, 1, 14, 5, 1, 5, 9 - ]; + var indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - this.type = 'DodecahedronBufferGeometry'; + this.type = 'DodecahedronBufferGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - } + } - DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); - DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; + DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); + DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; // TubeGeometry - function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { + function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { - Geometry.call( this ); + Geometry.call(this); + this.type = 'TubeGeometry'; - this.type = 'TubeGeometry'; + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + if ( taper !== undefined ) { console.warn( 'THREE.TubeGeometry: taper has been removed.' ); } - if ( taper !== undefined ) { console.warn( 'THREE.TubeGeometry: taper has been removed.' ); } + var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); - var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); + // expose internals - // expose internals + this.tangents = bufferGeometry.tangents; + this.normals = bufferGeometry.normals; + this.binormals = bufferGeometry.binormals; - this.tangents = bufferGeometry.tangents; - this.normals = bufferGeometry.normals; - this.binormals = bufferGeometry.binormals; + // create geometry - // create geometry + this.fromBufferGeometry( bufferGeometry ); + this.mergeVertices(); - this.fromBufferGeometry( bufferGeometry ); - this.mergeVertices(); + } - } + TubeGeometry.prototype = Object.create( Geometry.prototype ); + TubeGeometry.prototype.constructor = TubeGeometry; - TubeGeometry.prototype = Object.create( Geometry.prototype ); - TubeGeometry.prototype.constructor = TubeGeometry; // TubeBufferGeometry - function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { + function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'TubeBufferGeometry'; - this.type = 'TubeBufferGeometry'; + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + tubularSegments = tubularSegments || 64; + radius = radius || 1; + radialSegments = radialSegments || 8; + closed = closed || false; - tubularSegments = tubularSegments || 64; - radius = radius || 1; - radialSegments = radialSegments || 8; - closed = closed || false; + var frames = path.computeFrenetFrames( tubularSegments, closed ); - var frames = path.computeFrenetFrames( tubularSegments, closed ); + // expose internals - // expose internals + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; - this.tangents = frames.tangents; - this.normals = frames.normals; - this.binormals = frames.binormals; + // helper variables - // helper variables + var vertex = new Vector3(); + var normal = new Vector3(); + var uv = new Vector2(); + var P = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); - var uv = new Vector2(); - var P = new Vector3(); + // buffer - // buffer + var vertices = []; + var normals = []; + var uvs = []; + var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - var indices = []; + // create buffer data - // create buffer data + generateBufferData(); - generateBufferData(); + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // functions - // functions + function generateBufferData() { - function generateBufferData() { + for ( var i = 0; i < tubularSegments; i ++ ) { - for ( var i = 0; i < tubularSegments; i ++ ) { + generateSegment( i ); - generateSegment( i ); + } - } + // if the geometry is not closed, generate the last row of vertices and normals + // at the regular position on the given path + // + // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) - // if the geometry is not closed, generate the last row of vertices and normals - // at the regular position on the given path - // - // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) + generateSegment( ( closed === false ) ? tubularSegments : 0 ); - generateSegment( ( closed === false ) ? tubularSegments : 0 ); + // uvs are generated in a separate function. + // this makes it easy compute correct values for closed geometries - // uvs are generated in a separate function. - // this makes it easy compute correct values for closed geometries + generateUVs(); - generateUVs(); + // finally create faces - // finally create faces + generateIndices(); - generateIndices(); + } - } + function generateSegment( i ) { - function generateSegment( i ) { + // we use getPointAt to sample evenly distributed points from the given path - // we use getPointAt to sample evenly distributed points from the given path + P = path.getPointAt( i / tubularSegments, P ); - P = path.getPointAt( i / tubularSegments, P ); + // retrieve corresponding normal and binormal - // retrieve corresponding normal and binormal + var N = frames.normals[ i ]; + var B = frames.binormals[ i ]; - var N = frames.normals[ i ]; - var B = frames.binormals[ i ]; + // generate normals and vertices for the current segment - // generate normals and vertices for the current segment + for ( var j = 0; j <= radialSegments; j ++ ) { - for ( var j = 0; j <= radialSegments; j ++ ) { + var v = j / radialSegments * Math.PI * 2; - var v = j / radialSegments * Math.PI * 2; + var sin = Math.sin( v ); + var cos = - Math.cos( v ); - var sin = Math.sin( v ); - var cos = - Math.cos( v ); + // normal - // normal + normal.x = ( cos * N.x + sin * B.x ); + normal.y = ( cos * N.y + sin * B.y ); + normal.z = ( cos * N.z + sin * B.z ); + normal.normalize(); - normal.x = ( cos * N.x + sin * B.x ); - normal.y = ( cos * N.y + sin * B.y ); - normal.z = ( cos * N.z + sin * B.z ); - normal.normalize(); + normals.push( normal.x, normal.y, normal.z ); - normals.push( normal.x, normal.y, normal.z ); + // vertex - // vertex + vertex.x = P.x + radius * normal.x; + vertex.y = P.y + radius * normal.y; + vertex.z = P.z + radius * normal.z; - vertex.x = P.x + radius * normal.x; - vertex.y = P.y + radius * normal.y; - vertex.z = P.z + radius * normal.z; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + } } - } + function generateIndices() { - function generateIndices() { + for ( var j = 1; j <= tubularSegments; j ++ ) { - for ( var j = 1; j <= tubularSegments; j ++ ) { + for ( var i = 1; i <= radialSegments; i ++ ) { - for ( var i = 1; i <= radialSegments; i ++ ) { + var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + var b = ( radialSegments + 1 ) * j + ( i - 1 ); + var c = ( radialSegments + 1 ) * j + i; + var d = ( radialSegments + 1 ) * ( j - 1 ) + i; - var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - var b = ( radialSegments + 1 ) * j + ( i - 1 ); - var c = ( radialSegments + 1 ) * j + i; - var d = ( radialSegments + 1 ) * ( j - 1 ) + i; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } } - } + function generateUVs() { - function generateUVs() { + for ( var i = 0; i <= tubularSegments; i ++ ) { - for ( var i = 0; i <= tubularSegments; i ++ ) { + for ( var j = 0; j <= radialSegments; j ++ ) { - for ( var j = 0; j <= radialSegments; j ++ ) { + uv.x = i / tubularSegments; + uv.y = j / radialSegments; - uv.x = i / tubularSegments; - uv.y = j / radialSegments; + uvs.push( uv.x, uv.y ); - uvs.push( uv.x, uv.y ); + } } @@ -29677,325 +29754,320 @@ } - } - - TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; + TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; + TubeBufferGeometry.prototype.toJSON = function toJSON () { - TubeBufferGeometry.prototype.toJSON = function () { - - var data = BufferGeometry.prototype.toJSON.call( this ); + var data = BufferGeometry.prototype.toJSON.call( this ); - data.path = this.parameters.path.toJSON(); + data.path = this.parameters.path.toJSON(); - return data; + return data; - }; + }; // TorusKnotGeometry - function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { + function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { - Geometry.call( this ); + Geometry.call(this); + this.type = 'TorusKnotGeometry'; - this.type = 'TorusKnotGeometry'; + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + if ( heightScale !== undefined ) { console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); } - if ( heightScale !== undefined ) { console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); } + this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); + this.mergeVertices(); - this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); - this.mergeVertices(); + } - } + TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); + TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; - TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); - TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; // TorusKnotBufferGeometry - function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { + function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'TorusKnotBufferGeometry'; - this.type = 'TorusKnotBufferGeometry'; + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + radius = radius || 1; + tube = tube || 0.4; + tubularSegments = Math.floor( tubularSegments ) || 64; + radialSegments = Math.floor( radialSegments ) || 8; + p = p || 2; + q = q || 3; - radius = radius || 1; - tube = tube || 0.4; - tubularSegments = Math.floor( tubularSegments ) || 64; - radialSegments = Math.floor( radialSegments ) || 8; - p = p || 2; - q = q || 3; + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // helper variables - // helper variables + var vertex = new Vector3(); + var normal = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); + var P1 = new Vector3(); + var P2 = new Vector3(); - var P1 = new Vector3(); - var P2 = new Vector3(); + var B = new Vector3(); + var T = new Vector3(); + var N = new Vector3(); - var B = new Vector3(); - var T = new Vector3(); - var N = new Vector3(); + // generate vertices, normals and uvs - // generate vertices, normals and uvs + for ( var i = 0; i <= tubularSegments; ++ i ) { - for ( var i = 0; i <= tubularSegments; ++ i ) { + // the radian "u" is used to calculate the position on the torus curve of the current tubular segement - // the radian "u" is used to calculate the position on the torus curve of the current tubular segement + var u = i / tubularSegments * p * Math.PI * 2; - var u = i / tubularSegments * p * Math.PI * 2; + // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. + // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions - // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. - // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions + calculatePositionOnCurve( u, p, q, radius, P1 ); + calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); - calculatePositionOnCurve( u, p, q, radius, P1 ); - calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); + // calculate orthonormal basis - // calculate orthonormal basis + T.subVectors( P2, P1 ); + N.addVectors( P2, P1 ); + B.crossVectors( T, N ); + N.crossVectors( B, T ); - T.subVectors( P2, P1 ); - N.addVectors( P2, P1 ); - B.crossVectors( T, N ); - N.crossVectors( B, T ); + // normalize B, N. T can be ignored, we don't use it - // normalize B, N. T can be ignored, we don't use it + B.normalize(); + N.normalize(); - B.normalize(); - N.normalize(); + for ( var j = 0; j <= radialSegments; ++ j ) { - for ( var j = 0; j <= radialSegments; ++ j ) { + // now calculate the vertices. they are nothing more than an extrusion of the torus curve. + // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. - // now calculate the vertices. they are nothing more than an extrusion of the torus curve. - // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. + var v = j / radialSegments * Math.PI * 2; + var cx = - tube * Math.cos( v ); + var cy = tube * Math.sin( v ); - var v = j / radialSegments * Math.PI * 2; - var cx = - tube * Math.cos( v ); - var cy = tube * Math.sin( v ); + // now calculate the final vertex position. + // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve - // now calculate the final vertex position. - // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve + vertex.x = P1.x + ( cx * N.x + cy * B.x ); + vertex.y = P1.y + ( cx * N.y + cy * B.y ); + vertex.z = P1.z + ( cx * N.z + cy * B.z ); - vertex.x = P1.x + ( cx * N.x + cy * B.x ); - vertex.y = P1.y + ( cx * N.y + cy * B.y ); - vertex.z = P1.z + ( cx * N.z + cy * B.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) - // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) + normal.subVectors( vertex, P1 ).normalize(); - normal.subVectors( vertex, P1 ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - normals.push( normal.x, normal.y, normal.z ); + // uv - // uv + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + } } - } + // generate indices - // generate indices + for ( var j$1 = 1; j$1 <= tubularSegments; j$1 ++ ) { - for ( var j$1 = 1; j$1 <= tubularSegments; j$1 ++ ) { + for ( var i$1 = 1; i$1 <= radialSegments; i$1 ++ ) { - for ( var i$1 = 1; i$1 <= radialSegments; i$1 ++ ) { + // indices - // indices + var a = ( radialSegments + 1 ) * ( j$1 - 1 ) + ( i$1 - 1 ); + var b = ( radialSegments + 1 ) * j$1 + ( i$1 - 1 ); + var c = ( radialSegments + 1 ) * j$1 + i$1; + var d = ( radialSegments + 1 ) * ( j$1 - 1 ) + i$1; - var a = ( radialSegments + 1 ) * ( j$1 - 1 ) + ( i$1 - 1 ); - var b = ( radialSegments + 1 ) * j$1 + ( i$1 - 1 ); - var c = ( radialSegments + 1 ) * j$1 + i$1; - var d = ( radialSegments + 1 ) * ( j$1 - 1 ) + i$1; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // this function calculates the current position on the torus curve - // this function calculates the current position on the torus curve + function calculatePositionOnCurve( u, p, q, radius, position ) { - function calculatePositionOnCurve( u, p, q, radius, position ) { + var cu = Math.cos( u ); + var su = Math.sin( u ); + var quOverP = q / p * u; + var cs = Math.cos( quOverP ); - var cu = Math.cos( u ); - var su = Math.sin( u ); - var quOverP = q / p * u; - var cs = Math.cos( quOverP ); + position.x = radius * ( 2 + cs ) * 0.5 * cu; + position.y = radius * ( 2 + cs ) * su * 0.5; + position.z = radius * Math.sin( quOverP ) * 0.5; - position.x = radius * ( 2 + cs ) * 0.5 * cu; - position.y = radius * ( 2 + cs ) * su * 0.5; - position.z = radius * Math.sin( quOverP ) * 0.5; + } } - } - - TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; + TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; // TorusGeometry - function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { - Geometry.call( this ); + Geometry.call(this); + this.type = 'TorusGeometry'; - this.type = 'TorusGeometry'; + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); + this.mergeVertices(); - this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); - this.mergeVertices(); + } - } + TorusGeometry.prototype = Object.create( Geometry.prototype ); + TorusGeometry.prototype.constructor = TorusGeometry; - TorusGeometry.prototype = Object.create( Geometry.prototype ); - TorusGeometry.prototype.constructor = TorusGeometry; // TorusBufferGeometry - function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { + function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'TorusBufferGeometry'; - this.type = 'TorusBufferGeometry'; + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + radius = radius || 1; + tube = tube || 0.4; + radialSegments = Math.floor( radialSegments ) || 8; + tubularSegments = Math.floor( tubularSegments ) || 6; + arc = arc || Math.PI * 2; - radius = radius || 1; - tube = tube || 0.4; - radialSegments = Math.floor( radialSegments ) || 8; - tubularSegments = Math.floor( tubularSegments ) || 6; - arc = arc || Math.PI * 2; + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // helper variables - // helper variables + var center = new Vector3(); + var vertex = new Vector3(); + var normal = new Vector3(); - var center = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); + // generate vertices, normals and uvs - // generate vertices, normals and uvs + for ( var j = 0; j <= radialSegments; j ++ ) { - for ( var j = 0; j <= radialSegments; j ++ ) { + for ( var i = 0; i <= tubularSegments; i ++ ) { - for ( var i = 0; i <= tubularSegments; i ++ ) { + var u = i / tubularSegments * arc; + var v = j / radialSegments * Math.PI * 2; - var u = i / tubularSegments * arc; - var v = j / radialSegments * Math.PI * 2; + // vertex - // vertex + vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + vertex.z = tube * Math.sin( v ); - vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); - vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); - vertex.z = tube * Math.sin( v ); + vertices.push( vertex.x, vertex.y, vertex.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal - // normal + center.x = radius * Math.cos( u ); + center.y = radius * Math.sin( u ); + normal.subVectors( vertex, center ).normalize(); - center.x = radius * Math.cos( u ); - center.y = radius * Math.sin( u ); - normal.subVectors( vertex, center ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - normals.push( normal.x, normal.y, normal.z ); + // uv - // uv + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + } } - } + // generate indices - // generate indices + for ( var j$1 = 1; j$1 <= radialSegments; j$1 ++ ) { - for ( var j$1 = 1; j$1 <= radialSegments; j$1 ++ ) { + for ( var i$1 = 1; i$1 <= tubularSegments; i$1 ++ ) { - for ( var i$1 = 1; i$1 <= tubularSegments; i$1 ++ ) { + // indices - // indices + var a = ( tubularSegments + 1 ) * j$1 + i$1 - 1; + var b = ( tubularSegments + 1 ) * ( j$1 - 1 ) + i$1 - 1; + var c = ( tubularSegments + 1 ) * ( j$1 - 1 ) + i$1; + var d = ( tubularSegments + 1 ) * j$1 + i$1; - var a = ( tubularSegments + 1 ) * j$1 + i$1 - 1; - var b = ( tubularSegments + 1 ) * ( j$1 - 1 ) + i$1 - 1; - var c = ( tubularSegments + 1 ) * ( j$1 - 1 ) + i$1; - var d = ( tubularSegments + 1 ) * j$1 + i$1; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } - - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + } - TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; + TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; /** * Port from https://github.com/mapbox/earcut (v2.2.2) @@ -30900,493 +30972,496 @@ // ExtrudeGeometry - function ExtrudeGeometry( shapes, options ) { + function ExtrudeGeometry( shapes, options ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'ExtrudeGeometry'; + this.type = 'ExtrudeGeometry'; - this.parameters = { - shapes: shapes, - options: options - }; + this.parameters = { + shapes: shapes, + options: options + }; - this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); - this.mergeVertices(); + this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); + this.mergeVertices(); - } + } - ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); - ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; + ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); + ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; - ExtrudeGeometry.prototype.toJSON = function () { + ExtrudeGeometry.prototype.toJSON = function toJSON$1 () { - var data = Geometry.prototype.toJSON.call( this ); + var data = Geometry.prototype.toJSON.call(this); - var shapes = this.parameters.shapes; - var options = this.parameters.options; + var shapes = this.parameters.shapes; + var options = this.parameters.options; - return toJSON( shapes, options, data ); + return toJSON( shapes, options, data ); + + }; - }; // ExtrudeBufferGeometry - function ExtrudeBufferGeometry( shapes, options ) { + function ExtrudeBufferGeometry( shapes, options ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'ExtrudeBufferGeometry'; + this.type = 'ExtrudeBufferGeometry'; - this.parameters = { - shapes: shapes, - options: options - }; + this.parameters = { + shapes: shapes, + options: options + }; - shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; - var scope = this; + var scope = this; - var verticesArray = []; - var uvArray = []; + var verticesArray = []; + var uvArray = []; - for ( var i = 0, l = shapes.length; i < l; i ++ ) { + for ( var i = 0, l = shapes.length; i < l; i ++ ) { - var shape = shapes[ i ]; - addShape( shape ); + var shape = shapes[ i ]; + addShape( shape ); - } + } - // build geometry + // build geometry - this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); + this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); - this.computeVertexNormals(); + this.computeVertexNormals(); - // functions + // functions - function addShape( shape ) { + function addShape( shape ) { - var placeholder = []; + var placeholder = []; - // options + // options - var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; - var steps = options.steps !== undefined ? options.steps : 1; - var depth = options.depth !== undefined ? options.depth : 100; + var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + var steps = options.steps !== undefined ? options.steps : 1; + var depth = options.depth !== undefined ? options.depth : 100; - var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; - var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; - var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; - var bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; - var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; + var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; + var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; + var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; + var bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; + var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; - var extrudePath = options.extrudePath; + var extrudePath = options.extrudePath; - var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; + var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; - // deprecated options + // deprecated options - if ( options.amount !== undefined ) { + if ( options.amount !== undefined ) { - console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); - depth = options.amount; + console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); + depth = options.amount; - } + } - // + // - var extrudePts, extrudeByPath = false; - var splineTube, binormal, normal, position2; + var extrudePts, extrudeByPath = false; + var splineTube, binormal, normal, position2; - if ( extrudePath ) { + if ( extrudePath ) { - extrudePts = extrudePath.getSpacedPoints( steps ); + extrudePts = extrudePath.getSpacedPoints( steps ); - extrudeByPath = true; - bevelEnabled = false; // bevels not supported for path extrusion + extrudeByPath = true; + bevelEnabled = false; // bevels not supported for path extrusion - // SETUP TNB variables + // SETUP TNB variables - // TODO1 - have a .isClosed in spline? + // TODO1 - have a .isClosed in spline? - splineTube = extrudePath.computeFrenetFrames( steps, false ); + splineTube = extrudePath.computeFrenetFrames( steps, false ); - // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); + // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); - binormal = new Vector3(); - normal = new Vector3(); - position2 = new Vector3(); + binormal = new Vector3(); + normal = new Vector3(); + position2 = new Vector3(); - } + } - // Safeguards if bevels are not enabled + // Safeguards if bevels are not enabled - if ( ! bevelEnabled ) { + if ( ! bevelEnabled ) { - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; - bevelOffset = 0; + bevelSegments = 0; + bevelThickness = 0; + bevelSize = 0; + bevelOffset = 0; - } + } + + // Variables initialization - // Variables initialization + var shapePoints = shape.extractPoints( curveSegments ); - var shapePoints = shape.extractPoints( curveSegments ); + var vertices = shapePoints.shape; + var holes = shapePoints.holes; - var vertices = shapePoints.shape; - var holes = shapePoints.holes; + var reverse = ! ShapeUtils.isClockWise( vertices ); - var reverse = ! ShapeUtils.isClockWise( vertices ); + if ( reverse ) { - if ( reverse ) { + vertices = vertices.reverse(); - vertices = vertices.reverse(); + // Maybe we should also check if holes are in the opposite direction, just to be safe ... - // Maybe we should also check if holes are in the opposite direction, just to be safe ... + for ( var h = 0, hl = holes.length; h < hl; h ++ ) { - for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + var ahole = holes[ h ]; - var ahole = holes[ h ]; + if ( ShapeUtils.isClockWise( ahole ) ) { - if ( ShapeUtils.isClockWise( ahole ) ) { + holes[ h ] = ahole.reverse(); - holes[ h ] = ahole.reverse(); + } } } - } + var faces = ShapeUtils.triangulateShape( vertices, holes ); - var faces = ShapeUtils.triangulateShape( vertices, holes ); + /* Vertices */ - /* Vertices */ + var contour = vertices; // vertices has all points but contour has only points of circumference - var contour = vertices; // vertices has all points but contour has only points of circumference + for ( var h$1 = 0, hl$1 = holes.length; h$1 < hl$1; h$1 ++ ) { - for ( var h$1 = 0, hl$1 = holes.length; h$1 < hl$1; h$1 ++ ) { + var ahole$1 = holes[ h$1 ]; - var ahole$1 = holes[ h$1 ]; + vertices = vertices.concat( ahole$1 ); - vertices = vertices.concat( ahole$1 ); + } - } + function scalePt2( pt, vec, size ) { - function scalePt2( pt, vec, size ) { + if ( ! vec ) { console.error( "THREE.ExtrudeGeometry: vec does not exist" ); } - if ( ! vec ) { console.error( "THREE.ExtrudeGeometry: vec does not exist" ); } + return vec.clone().multiplyScalar( size ).add( pt ); - return vec.clone().multiplyScalar( size ).add( pt ); + } - } + var vlen = vertices.length, flen = faces.length; - var vlen = vertices.length, flen = faces.length; + // Find directions for point movement - // Find directions for point movement + function getBevelVec( inPt, inPrev, inNext ) { - function getBevelVec( inPt, inPrev, inNext ) { + // computes for inPt the corresponding point inPt' on a new contour + // shifted by 1 unit (length of normalized vector) to the left + // if we walk along contour clockwise, this new contour is outside the old one + // + // inPt' is the intersection of the two lines parallel to the two + // adjacent edges of inPt at a distance of 1 unit on the left side. - // computes for inPt the corresponding point inPt' on a new contour - // shifted by 1 unit (length of normalized vector) to the left - // if we walk along contour clockwise, this new contour is outside the old one - // - // inPt' is the intersection of the two lines parallel to the two - // adjacent edges of inPt at a distance of 1 unit on the left side. + var v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt - var v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt + // good reading for geometry algorithms (here: line-line intersection) + // http://geomalgorithms.com/a05-_intersect-1.html - // good reading for geometry algorithms (here: line-line intersection) - // http://geomalgorithms.com/a05-_intersect-1.html + var v_prev_x = inPt.x - inPrev.x, + v_prev_y = inPt.y - inPrev.y; + var v_next_x = inNext.x - inPt.x, + v_next_y = inNext.y - inPt.y; - var v_prev_x = inPt.x - inPrev.x, - v_prev_y = inPt.y - inPrev.y; - var v_next_x = inNext.x - inPt.x, - v_next_y = inNext.y - inPt.y; + var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); - var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); + // check for collinear edges + var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - // check for collinear edges - var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + if ( Math.abs( collinear0 ) > Number.EPSILON ) { - if ( Math.abs( collinear0 ) > Number.EPSILON ) { + // not collinear - // not collinear + // length of vectors for normalizing - // length of vectors for normalizing + var v_prev_len = Math.sqrt( v_prev_lensq ); + var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); - var v_prev_len = Math.sqrt( v_prev_lensq ); - var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); + // shift adjacent points by unit vectors to the left - // shift adjacent points by unit vectors to the left + var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); + var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); - var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); - var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); + var ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); + var ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); - var ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); - var ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); + // scaling factor for v_prev to intersection point - // scaling factor for v_prev to intersection point + var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - + ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / + ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - - ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / - ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + // vector from inPt to intersection point - // vector from inPt to intersection point + v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); + v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); - v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); - v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); + // Don't normalize!, otherwise sharp corners become ugly + // but prevent crazy spikes + var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); + if ( v_trans_lensq <= 2 ) { - // Don't normalize!, otherwise sharp corners become ugly - // but prevent crazy spikes - var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); - if ( v_trans_lensq <= 2 ) { + return new Vector2( v_trans_x, v_trans_y ); - return new Vector2( v_trans_x, v_trans_y ); + } else { - } else { + shrink_by = Math.sqrt( v_trans_lensq / 2 ); - shrink_by = Math.sqrt( v_trans_lensq / 2 ); + } - } + } else { - } else { + // handle special case of collinear edges - // handle special case of collinear edges + var direction_eq = false; // assumes: opposite - var direction_eq = false; // assumes: opposite + if ( v_prev_x > Number.EPSILON ) { - if ( v_prev_x > Number.EPSILON ) { + if ( v_next_x > Number.EPSILON ) { - if ( v_next_x > Number.EPSILON ) { + direction_eq = true; - direction_eq = true; + } - } + } else { - } else { + if ( v_prev_x < - Number.EPSILON ) { - if ( v_prev_x < - Number.EPSILON ) { + if ( v_next_x < - Number.EPSILON ) { - if ( v_next_x < - Number.EPSILON ) { + direction_eq = true; - direction_eq = true; + } - } + } else { - } else { + if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { - if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { + direction_eq = true; - direction_eq = true; + } } } - } + if ( direction_eq ) { - if ( direction_eq ) { + // console.log("Warning: lines are a straight sequence"); + v_trans_x = - v_prev_y; + v_trans_y = v_prev_x; + shrink_by = Math.sqrt( v_prev_lensq ); - // console.log("Warning: lines are a straight sequence"); - v_trans_x = - v_prev_y; - v_trans_y = v_prev_x; - shrink_by = Math.sqrt( v_prev_lensq ); + } else { - } else { + // console.log("Warning: lines are a straight spike"); + v_trans_x = v_prev_x; + v_trans_y = v_prev_y; + shrink_by = Math.sqrt( v_prev_lensq / 2 ); - // console.log("Warning: lines are a straight spike"); - v_trans_x = v_prev_x; - v_trans_y = v_prev_y; - shrink_by = Math.sqrt( v_prev_lensq / 2 ); + } } + return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); + } - return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); - } + var contourMovements = []; + for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - var contourMovements = []; + if ( j === il ) { j = 0; } + if ( k === il ) { k = 0; } - for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + // (j)---(i)---(k) + // console.log('i,j,k', i, j , k) - if ( j === il ) { j = 0; } - if ( k === il ) { k = 0; } + contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); - // (j)---(i)---(k) - // console.log('i,j,k', i, j , k) + } - contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); + var holesMovements = []; + var oneHoleMovements, verticesMovements = contourMovements.concat(); - } + for ( var h$2 = 0, hl$2 = holes.length; h$2 < hl$2; h$2 ++ ) { - var holesMovements = []; - var oneHoleMovements, verticesMovements = contourMovements.concat(); + var ahole$2 = holes[ h$2 ]; - for ( var h$2 = 0, hl$2 = holes.length; h$2 < hl$2; h$2 ++ ) { + oneHoleMovements = []; - var ahole$2 = holes[ h$2 ]; + for ( var i$1 = 0, il$1 = ahole$2.length, j$1 = il$1 - 1, k$1 = i$1 + 1; i$1 < il$1; i$1 ++, j$1 ++, k$1 ++ ) { - oneHoleMovements = []; + if ( j$1 === il$1 ) { j$1 = 0; } + if ( k$1 === il$1 ) { k$1 = 0; } - for ( var i$1 = 0, il$1 = ahole$2.length, j$1 = il$1 - 1, k$1 = i$1 + 1; i$1 < il$1; i$1 ++, j$1 ++, k$1 ++ ) { + // (j)---(i)---(k) + oneHoleMovements[ i$1 ] = getBevelVec( ahole$2[ i$1 ], ahole$2[ j$1 ], ahole$2[ k$1 ] ); - if ( j$1 === il$1 ) { j$1 = 0; } - if ( k$1 === il$1 ) { k$1 = 0; } + } - // (j)---(i)---(k) - oneHoleMovements[ i$1 ] = getBevelVec( ahole$2[ i$1 ], ahole$2[ j$1 ], ahole$2[ k$1 ] ); + holesMovements.push( oneHoleMovements ); + verticesMovements = verticesMovements.concat( oneHoleMovements ); } - holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); - - } + // Loop bevelSegments, 1 for the front, 1 for the back - // Loop bevelSegments, 1 for the front, 1 for the back + for ( var b = 0; b < bevelSegments; b ++ ) { - for ( var b = 0; b < bevelSegments; b ++ ) { + //for ( b = bevelSegments; b > 0; b -- ) { - //for ( b = bevelSegments; b > 0; b -- ) { + var t = b / bevelSegments; + var z = bevelThickness * Math.cos( t * Math.PI / 2 ); + var bs$1 = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - var t = b / bevelSegments; - var z = bevelThickness * Math.cos( t * Math.PI / 2 ); - var bs$1 = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; + // contract shape - // contract shape + for ( var i$2 = 0, il$2 = contour.length; i$2 < il$2; i$2 ++ ) { - for ( var i$2 = 0, il$2 = contour.length; i$2 < il$2; i$2 ++ ) { + var vert = scalePt2( contour[ i$2 ], contourMovements[ i$2 ], bs$1 ); - var vert = scalePt2( contour[ i$2 ], contourMovements[ i$2 ], bs$1 ); + v( vert.x, vert.y, - z ); - v( vert.x, vert.y, - z ); + } - } + // expand holes - // expand holes + for ( var h$3 = 0, hl$3 = holes.length; h$3 < hl$3; h$3 ++ ) { - for ( var h$3 = 0, hl$3 = holes.length; h$3 < hl$3; h$3 ++ ) { + var ahole$3 = holes[ h$3 ]; + oneHoleMovements = holesMovements[ h$3 ]; - var ahole$3 = holes[ h$3 ]; - oneHoleMovements = holesMovements[ h$3 ]; + for ( var i$3 = 0, il$3 = ahole$3.length; i$3 < il$3; i$3 ++ ) { - for ( var i$3 = 0, il$3 = ahole$3.length; i$3 < il$3; i$3 ++ ) { + var vert$1 = scalePt2( ahole$3[ i$3 ], oneHoleMovements[ i$3 ], bs$1 ); - var vert$1 = scalePt2( ahole$3[ i$3 ], oneHoleMovements[ i$3 ], bs$1 ); + v( vert$1.x, vert$1.y, - z ); - v( vert$1.x, vert$1.y, - z ); + } } } - } + var bs = bevelSize + bevelOffset; - var bs = bevelSize + bevelOffset; + // Back facing vertices - // Back facing vertices + for ( var i$4 = 0; i$4 < vlen; i$4 ++ ) { - for ( var i$4 = 0; i$4 < vlen; i$4 ++ ) { + var vert$2 = bevelEnabled ? scalePt2( vertices[ i$4 ], verticesMovements[ i$4 ], bs ) : vertices[ i$4 ]; - var vert$2 = bevelEnabled ? scalePt2( vertices[ i$4 ], verticesMovements[ i$4 ], bs ) : vertices[ i$4 ]; + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert$2.x, vert$2.y, 0 ); - v( vert$2.x, vert$2.y, 0 ); + } else { - } else { + // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); - // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); + normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert$2.x ); + binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert$2.y ); - normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert$2.x ); - binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert$2.y ); + position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); - position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); + v( position2.x, position2.y, position2.z ); - v( position2.x, position2.y, position2.z ); + } } - } + // Add stepped vertices... + // Including front facing vertices - // Add stepped vertices... - // Including front facing vertices + for ( var s = 1; s <= steps; s ++ ) { - for ( var s = 1; s <= steps; s ++ ) { + for ( var i$5 = 0; i$5 < vlen; i$5 ++ ) { - for ( var i$5 = 0; i$5 < vlen; i$5 ++ ) { + var vert$3 = bevelEnabled ? scalePt2( vertices[ i$5 ], verticesMovements[ i$5 ], bs ) : vertices[ i$5 ]; - var vert$3 = bevelEnabled ? scalePt2( vertices[ i$5 ], verticesMovements[ i$5 ], bs ) : vertices[ i$5 ]; + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert$3.x, vert$3.y, depth / steps * s ); - v( vert$3.x, vert$3.y, depth / steps * s ); + } else { - } else { + // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); - // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); + normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert$3.x ); + binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert$3.y ); - normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert$3.x ); - binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert$3.y ); + position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); - position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); + v( position2.x, position2.y, position2.z ); - v( position2.x, position2.y, position2.z ); + } } } - } + // Add bevel segments planes - // Add bevel segments planes + //for ( b = 1; b <= bevelSegments; b ++ ) { + for ( var b$1 = bevelSegments - 1; b$1 >= 0; b$1 -- ) { - //for ( b = 1; b <= bevelSegments; b ++ ) { - for ( var b$1 = bevelSegments - 1; b$1 >= 0; b$1 -- ) { + var t$1 = b$1 / bevelSegments; + var z$1 = bevelThickness * Math.cos( t$1 * Math.PI / 2 ); + var bs$2 = bevelSize * Math.sin( t$1 * Math.PI / 2 ) + bevelOffset; - var t$1 = b$1 / bevelSegments; - var z$1 = bevelThickness * Math.cos( t$1 * Math.PI / 2 ); - var bs$2 = bevelSize * Math.sin( t$1 * Math.PI / 2 ) + bevelOffset; + // contract shape - // contract shape + for ( var i$6 = 0, il$4 = contour.length; i$6 < il$4; i$6 ++ ) { - for ( var i$6 = 0, il$4 = contour.length; i$6 < il$4; i$6 ++ ) { + var vert$4 = scalePt2( contour[ i$6 ], contourMovements[ i$6 ], bs$2 ); + v( vert$4.x, vert$4.y, depth + z$1 ); - var vert$4 = scalePt2( contour[ i$6 ], contourMovements[ i$6 ], bs$2 ); - v( vert$4.x, vert$4.y, depth + z$1 ); + } - } + // expand holes - // expand holes + for ( var h$4 = 0, hl$4 = holes.length; h$4 < hl$4; h$4 ++ ) { - for ( var h$4 = 0, hl$4 = holes.length; h$4 < hl$4; h$4 ++ ) { + var ahole$4 = holes[ h$4 ]; + oneHoleMovements = holesMovements[ h$4 ]; - var ahole$4 = holes[ h$4 ]; - oneHoleMovements = holesMovements[ h$4 ]; + for ( var i$7 = 0, il$5 = ahole$4.length; i$7 < il$5; i$7 ++ ) { - for ( var i$7 = 0, il$5 = ahole$4.length; i$7 < il$5; i$7 ++ ) { + var vert$5 = scalePt2( ahole$4[ i$7 ], oneHoleMovements[ i$7 ], bs$2 ); - var vert$5 = scalePt2( ahole$4[ i$7 ], oneHoleMovements[ i$7 ], bs$2 ); + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert$5.x, vert$5.y, depth + z$1 ); - v( vert$5.x, vert$5.y, depth + z$1 ); + } else { - } else { + v( vert$5.x, vert$5.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z$1 ); - v( vert$5.x, vert$5.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z$1 ); + } } @@ -31394,215 +31469,211 @@ } - } + /* Faces */ - /* Faces */ + // Top and bottom faces - // Top and bottom faces + buildLidFaces(); - buildLidFaces(); + // Sides faces - // Sides faces + buildSideFaces(); - buildSideFaces(); + ///// Internal functions - ///// Internal functions + function buildLidFaces() { - function buildLidFaces() { + var start = verticesArray.length / 3; - var start = verticesArray.length / 3; + if ( bevelEnabled ) { - if ( bevelEnabled ) { + var layer = 0; // steps + 1 + var offset = vlen * layer; - var layer = 0; // steps + 1 - var offset = vlen * layer; + // Bottom faces - // Bottom faces + for ( var i = 0; i < flen; i ++ ) { - for ( var i = 0; i < flen; i ++ ) { + var face = faces[ i ]; + f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); - var face = faces[ i ]; - f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); + } - } + layer = steps + bevelSegments * 2; + offset = vlen * layer; - layer = steps + bevelSegments * 2; - offset = vlen * layer; + // Top faces - // Top faces + for ( var i$1 = 0; i$1 < flen; i$1 ++ ) { - for ( var i$1 = 0; i$1 < flen; i$1 ++ ) { + var face$1 = faces[ i$1 ]; + f3( face$1[ 0 ] + offset, face$1[ 1 ] + offset, face$1[ 2 ] + offset ); - var face$1 = faces[ i$1 ]; - f3( face$1[ 0 ] + offset, face$1[ 1 ] + offset, face$1[ 2 ] + offset ); + } - } + } else { - } else { + // Bottom faces - // Bottom faces + for ( var i$2 = 0; i$2 < flen; i$2 ++ ) { - for ( var i$2 = 0; i$2 < flen; i$2 ++ ) { + var face$2 = faces[ i$2 ]; + f3( face$2[ 2 ], face$2[ 1 ], face$2[ 0 ] ); - var face$2 = faces[ i$2 ]; - f3( face$2[ 2 ], face$2[ 1 ], face$2[ 0 ] ); + } - } + // Top faces - // Top faces + for ( var i$3 = 0; i$3 < flen; i$3 ++ ) { - for ( var i$3 = 0; i$3 < flen; i$3 ++ ) { + var face$3 = faces[ i$3 ]; + f3( face$3[ 0 ] + vlen * steps, face$3[ 1 ] + vlen * steps, face$3[ 2 ] + vlen * steps ); - var face$3 = faces[ i$3 ]; - f3( face$3[ 0 ] + vlen * steps, face$3[ 1 ] + vlen * steps, face$3[ 2 ] + vlen * steps ); + } } - } + scope.addGroup( start, verticesArray.length / 3 - start, 0 ); - scope.addGroup( start, verticesArray.length / 3 - start, 0 ); + } - } + // Create faces for the z-sides of the shape - // Create faces for the z-sides of the shape + function buildSideFaces() { - function buildSideFaces() { + var start = verticesArray.length / 3; + var layeroffset = 0; + sidewalls( contour, layeroffset ); + layeroffset += contour.length; - var start = verticesArray.length / 3; - var layeroffset = 0; - sidewalls( contour, layeroffset ); - layeroffset += contour.length; + for ( var h = 0, hl = holes.length; h < hl; h ++ ) { - for ( var h = 0, hl = holes.length; h < hl; h ++ ) { + var ahole = holes[ h ]; + sidewalls( ahole, layeroffset ); - var ahole = holes[ h ]; - sidewalls( ahole, layeroffset ); + //, true + layeroffset += ahole.length; - //, true - layeroffset += ahole.length; + } - } + scope.addGroup( start, verticesArray.length / 3 - start, 1 ); - scope.addGroup( start, verticesArray.length / 3 - start, 1 ); + } - } + function sidewalls( contour, layeroffset ) { - function sidewalls( contour, layeroffset ) { + var i = contour.length; - var i = contour.length; + while ( -- i >= 0 ) { - while ( -- i >= 0 ) { + var j = i; + var k = i - 1; + if ( k < 0 ) { k = contour.length - 1; } - var j = i; - var k = i - 1; - if ( k < 0 ) { k = contour.length - 1; } + //console.log('b', i,j, i-1, k,vertices.length); - //console.log('b', i,j, i-1, k,vertices.length); + for ( var s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { - for ( var s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { + var slen1 = vlen * s; + var slen2 = vlen * ( s + 1 ); - var slen1 = vlen * s; - var slen2 = vlen * ( s + 1 ); + var a = layeroffset + j + slen1, + b = layeroffset + k + slen1, + c = layeroffset + k + slen2, + d = layeroffset + j + slen2; - var a = layeroffset + j + slen1, - b = layeroffset + k + slen1, - c = layeroffset + k + slen2, - d = layeroffset + j + slen2; + f4( a, b, c, d ); - f4( a, b, c, d ); + } } } - } + function v( x, y, z ) { - function v( x, y, z ) { + placeholder.push( x ); + placeholder.push( y ); + placeholder.push( z ); - placeholder.push( x ); - placeholder.push( y ); - placeholder.push( z ); + } - } + function f3( a, b, c ) { - function f3( a, b, c ) { + addVertex( a ); + addVertex( b ); + addVertex( c ); - addVertex( a ); - addVertex( b ); - addVertex( c ); + var nextIndex = verticesArray.length / 3; + var uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); + } - } + function f4( a, b, c, d ) { - function f4( a, b, c, d ) { + addVertex( a ); + addVertex( b ); + addVertex( d ); - addVertex( a ); - addVertex( b ); - addVertex( d ); + addVertex( b ); + addVertex( c ); + addVertex( d ); - addVertex( b ); - addVertex( c ); - addVertex( d ); + var nextIndex = verticesArray.length / 3; + var uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 3 ] ); - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 3 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); + addUV( uvs[ 3 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); - addUV( uvs[ 3 ] ); + } - } + function addVertex( index ) { - function addVertex( index ) { + verticesArray.push( placeholder[ index * 3 + 0 ] ); + verticesArray.push( placeholder[ index * 3 + 1 ] ); + verticesArray.push( placeholder[ index * 3 + 2 ] ); - verticesArray.push( placeholder[ index * 3 + 0 ] ); - verticesArray.push( placeholder[ index * 3 + 1 ] ); - verticesArray.push( placeholder[ index * 3 + 2 ] ); + } - } + function addUV( vector2 ) { - function addUV( vector2 ) { + uvArray.push( vector2.x ); + uvArray.push( vector2.y ); - uvArray.push( vector2.x ); - uvArray.push( vector2.y ); + } } } - } - - ExtrudeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - ExtrudeBufferGeometry.prototype.constructor = ExtrudeBufferGeometry; + ExtrudeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + ExtrudeBufferGeometry.prototype.constructor = ExtrudeBufferGeometry; - ExtrudeBufferGeometry.prototype.toJSON = function () { + ExtrudeBufferGeometry.prototype.toJSON = function toJSON$2 () { - var data = BufferGeometry.prototype.toJSON.call( this ); - - var shapes = this.parameters.shapes; - var options = this.parameters.options; + var data = BufferGeometry.prototype.toJSON.call( this ); - return toJSON( shapes, options, data ); + var shapes = this.parameters.shapes; + var options = this.parameters.options; - }; + return toJSON( shapes, options, data ); - // + }; var WorldUVGenerator = { @@ -31663,8 +31734,6 @@ function toJSON( shapes, options, data ) { - // - data.shapes = []; if ( Array.isArray( shapes ) ) { @@ -31683,8 +31752,6 @@ } - // - if ( options.extrudePath !== undefined ) { data.options.extrudePath = options.extrudePath.toJSON(); } return data; @@ -31710,697 +31777,693 @@ // TextGeometry - function TextGeometry( text, parameters ) { + function TextGeometry( text, parameters ) { - Geometry.call( this ); + Geometry.call(this); + this.type = 'TextGeometry'; - this.type = 'TextGeometry'; + this.parameters = { + text: text, + parameters: parameters + }; - this.parameters = { - text: text, - parameters: parameters - }; + this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); + this.mergeVertices(); - this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); - this.mergeVertices(); + } - } + TextGeometry.prototype = Object.create( Geometry.prototype ); + TextGeometry.prototype.constructor = TextGeometry; - TextGeometry.prototype = Object.create( Geometry.prototype ); - TextGeometry.prototype.constructor = TextGeometry; // TextBufferGeometry - function TextBufferGeometry( text, parameters ) { + function TextBufferGeometry( text, parameters ) { - parameters = parameters || {}; + parameters = parameters || {}; - var font = parameters.font; + var font = parameters.font; - if ( ! ( font && font.isFont ) ) { + if ( ! ( font && font.isFont ) ) { - console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); - return new Geometry(); + console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); + return new Geometry(); - } + } - var shapes = font.generateShapes( text, parameters.size ); + var shapes = font.generateShapes( text, parameters.size ); - // translate parameters to ExtrudeGeometry API + // translate parameters to ExtrudeGeometry API - parameters.depth = parameters.height !== undefined ? parameters.height : 50; + parameters.depth = parameters.height !== undefined ? parameters.height : 50; - // defaults + // defaults - if ( parameters.bevelThickness === undefined ) { parameters.bevelThickness = 10; } - if ( parameters.bevelSize === undefined ) { parameters.bevelSize = 8; } - if ( parameters.bevelEnabled === undefined ) { parameters.bevelEnabled = false; } + if ( parameters.bevelThickness === undefined ) { parameters.bevelThickness = 10; } + if ( parameters.bevelSize === undefined ) { parameters.bevelSize = 8; } + if ( parameters.bevelEnabled === undefined ) { parameters.bevelEnabled = false; } - ExtrudeBufferGeometry.call( this, shapes, parameters ); + ExtrudeBufferGeometry.call( this, shapes, parameters ); - this.type = 'TextBufferGeometry'; + this.type = 'TextBufferGeometry'; - } + } - TextBufferGeometry.prototype = Object.create( ExtrudeBufferGeometry.prototype ); - TextBufferGeometry.prototype.constructor = TextBufferGeometry; + TextBufferGeometry.prototype = Object.create( ExtrudeBufferGeometry.prototype ); + TextBufferGeometry.prototype.constructor = TextBufferGeometry; // SphereGeometry - function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - Geometry.call( this ); + function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - this.type = 'SphereGeometry'; + Geometry.call(this); + this.type = 'SphereGeometry'; - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); + this.mergeVertices(); - } + } - SphereGeometry.prototype = Object.create( Geometry.prototype ); - SphereGeometry.prototype.constructor = SphereGeometry; + SphereGeometry.prototype = Object.create( Geometry.prototype ); + SphereGeometry.prototype.constructor = SphereGeometry; // SphereBufferGeometry - function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { + function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'SphereBufferGeometry'; - this.type = 'SphereBufferGeometry'; + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + radius = radius || 1; - radius = radius || 1; + widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); + heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); - widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); - heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); + phiStart = phiStart !== undefined ? phiStart : 0; + phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; - phiStart = phiStart !== undefined ? phiStart : 0; - phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; + var thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); - var thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); + var index = 0; + var grid = []; - var index = 0; - var grid = []; + var vertex = new Vector3(); + var normal = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // generate vertices, normals and uvs - // generate vertices, normals and uvs + for ( var iy = 0; iy <= heightSegments; iy ++ ) { - for ( var iy = 0; iy <= heightSegments; iy ++ ) { + var verticesRow = []; - var verticesRow = []; + var v = iy / heightSegments; - var v = iy / heightSegments; + // special case for the poles - // special case for the poles + var uOffset = 0; - var uOffset = 0; + if ( iy == 0 && thetaStart == 0 ) { - if ( iy == 0 && thetaStart == 0 ) { + uOffset = 0.5 / widthSegments; - uOffset = 0.5 / widthSegments; + } else if ( iy == heightSegments && thetaEnd == Math.PI ) { - } else if ( iy == heightSegments && thetaEnd == Math.PI ) { + uOffset = - 0.5 / widthSegments; - uOffset = - 0.5 / widthSegments; + } - } + for ( var ix = 0; ix <= widthSegments; ix ++ ) { - for ( var ix = 0; ix <= widthSegments; ix ++ ) { + var u = ix / widthSegments; - var u = ix / widthSegments; + // vertex - // vertex + vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); + vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); - vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertices.push( vertex.x, vertex.y, vertex.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal - // normal + normal.copy( vertex ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - normal.copy( vertex ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + // uv - // uv + uvs.push( u + uOffset, 1 - v ); + + verticesRow.push( index ++ ); - uvs.push( u + uOffset, 1 - v ); + } - verticesRow.push( index ++ ); + grid.push( verticesRow ); } - grid.push( verticesRow ); - - } + // indices - // indices + for ( var iy$1 = 0; iy$1 < heightSegments; iy$1 ++ ) { - for ( var iy$1 = 0; iy$1 < heightSegments; iy$1 ++ ) { + for ( var ix$1 = 0; ix$1 < widthSegments; ix$1 ++ ) { - for ( var ix$1 = 0; ix$1 < widthSegments; ix$1 ++ ) { + var a = grid[ iy$1 ][ ix$1 + 1 ]; + var b = grid[ iy$1 ][ ix$1 ]; + var c = grid[ iy$1 + 1 ][ ix$1 ]; + var d = grid[ iy$1 + 1 ][ ix$1 + 1 ]; - var a = grid[ iy$1 ][ ix$1 + 1 ]; - var b = grid[ iy$1 ][ ix$1 ]; - var c = grid[ iy$1 + 1 ][ ix$1 ]; - var d = grid[ iy$1 + 1 ][ ix$1 + 1 ]; + if ( iy$1 !== 0 || thetaStart > 0 ) { indices.push( a, b, d ); } + if ( iy$1 !== heightSegments - 1 || thetaEnd < Math.PI ) { indices.push( b, c, d ); } - if ( iy$1 !== 0 || thetaStart > 0 ) { indices.push( a, b, d ); } - if ( iy$1 !== heightSegments - 1 || thetaEnd < Math.PI ) { indices.push( b, c, d ); } + } } - } - - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + } - SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; + SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; // RingGeometry - function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'RingGeometry'; + this.type = 'RingGeometry'; - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); + this.mergeVertices(); - } + } - RingGeometry.prototype = Object.create( Geometry.prototype ); - RingGeometry.prototype.constructor = RingGeometry; + RingGeometry.prototype = Object.create( Geometry.prototype ); + RingGeometry.prototype.constructor = RingGeometry; // RingBufferGeometry - function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { + function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'RingBufferGeometry'; + this.type = 'RingBufferGeometry'; - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - innerRadius = innerRadius || 0.5; - outerRadius = outerRadius || 1; + innerRadius = innerRadius || 0.5; + outerRadius = outerRadius || 1; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; - phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; + thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; + phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; - // buffers + // buffers - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - // some helper variables + // some helper variables - var radius = innerRadius; - var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); - var vertex = new Vector3(); - var uv = new Vector2(); + var radius = innerRadius; + var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); + var vertex = new Vector3(); + var uv = new Vector2(); - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( var j = 0; j <= phiSegments; j ++ ) { + for ( var j = 0; j <= phiSegments; j ++ ) { - for ( var i = 0; i <= thetaSegments; i ++ ) { + for ( var i = 0; i <= thetaSegments; i ++ ) { - // values are generate from the inside of the ring to the outside + // values are generate from the inside of the ring to the outside - var segment = thetaStart + i / thetaSegments * thetaLength; + var segment = thetaStart + i / thetaSegments * thetaLength; - // vertex + // vertex - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal + // normal - normals.push( 0, 0, 1 ); + normals.push( 0, 0, 1 ); - // uv + // uv - uv.x = ( vertex.x / outerRadius + 1 ) / 2; - uv.y = ( vertex.y / outerRadius + 1 ) / 2; + uv.x = ( vertex.x / outerRadius + 1 ) / 2; + uv.y = ( vertex.y / outerRadius + 1 ) / 2; - uvs.push( uv.x, uv.y ); + uvs.push( uv.x, uv.y ); - } + } - // increase the radius for next row of vertices + // increase the radius for next row of vertices - radius += radiusStep; + radius += radiusStep; - } + } - // indices + // indices - for ( var j$1 = 0; j$1 < phiSegments; j$1 ++ ) { + for ( var j$1 = 0; j$1 < phiSegments; j$1 ++ ) { - var thetaSegmentLevel = j$1 * ( thetaSegments + 1 ); + var thetaSegmentLevel = j$1 * ( thetaSegments + 1 ); - for ( var i$1 = 0; i$1 < thetaSegments; i$1 ++ ) { + for ( var i$1 = 0; i$1 < thetaSegments; i$1 ++ ) { - var segment$1 = i$1 + thetaSegmentLevel; + var segment$1 = i$1 + thetaSegmentLevel; - var a = segment$1; - var b = segment$1 + thetaSegments + 1; - var c = segment$1 + thetaSegments + 2; - var d = segment$1 + 1; + var a = segment$1; + var b = segment$1 + thetaSegments + 1; + var c = segment$1 + thetaSegments + 2; + var d = segment$1 + 1; - // faces + // faces - indices.push( a, b, d ); - indices.push( b, c, d ); + indices.push( a, b, d ); + indices.push( b, c, d ); - } + } - } + } - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + } - RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - RingBufferGeometry.prototype.constructor = RingBufferGeometry; + RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + RingBufferGeometry.prototype.constructor = RingBufferGeometry; // LatheGeometry - function LatheGeometry( points, segments, phiStart, phiLength ) { + function LatheGeometry( points, segments, phiStart, phiLength ) { - Geometry.call( this ); + Geometry.call(this); - this.type = 'LatheGeometry'; + this.type = 'LatheGeometry'; - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; - this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); + this.mergeVertices(); - } + } - LatheGeometry.prototype = Object.create( Geometry.prototype ); - LatheGeometry.prototype.constructor = LatheGeometry; + LatheGeometry.prototype = Object.create( Geometry.prototype ); + LatheGeometry.prototype.constructor = LatheGeometry; // LatheBufferGeometry - function LatheBufferGeometry( points, segments, phiStart, phiLength ) { + function LatheBufferGeometry( points, segments, phiStart, phiLength ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'LatheBufferGeometry'; + this.type = 'LatheBufferGeometry'; - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; - segments = Math.floor( segments ) || 12; - phiStart = phiStart || 0; - phiLength = phiLength || Math.PI * 2; + segments = Math.floor( segments ) || 12; + phiStart = phiStart || 0; + phiLength = phiLength || Math.PI * 2; - // clamp phiLength so it's in range of [ 0, 2PI ] + // clamp phiLength so it's in range of [ 0, 2PI ] - phiLength = MathUtils.clamp( phiLength, 0, Math.PI * 2 ); + phiLength = MathUtils.clamp( phiLength, 0, Math.PI * 2 ); - // buffers + // buffers - var indices = []; - var vertices = []; - var uvs = []; + var indices = []; + var vertices = []; + var uvs = []; - // helper variables + // helper variables - var inverseSegments = 1.0 / segments; - var vertex = new Vector3(); - var uv = new Vector2(); + var inverseSegments = 1.0 / segments; + var vertex = new Vector3(); + var uv = new Vector2(); - // generate vertices and uvs + // generate vertices and uvs - for ( var i = 0; i <= segments; i ++ ) { + for ( var i = 0; i <= segments; i ++ ) { - var phi = phiStart + i * inverseSegments * phiLength; + var phi = phiStart + i * inverseSegments * phiLength; - var sin = Math.sin( phi ); - var cos = Math.cos( phi ); + var sin = Math.sin( phi ); + var cos = Math.cos( phi ); - for ( var j = 0; j <= ( points.length - 1 ); j ++ ) { + for ( var j = 0; j <= ( points.length - 1 ); j ++ ) { - // vertex + // vertex - vertex.x = points[ j ].x * sin; - vertex.y = points[ j ].y; - vertex.z = points[ j ].x * cos; + vertex.x = points[ j ].x * sin; + vertex.y = points[ j ].y; + vertex.z = points[ j ].x * cos; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // uv + // uv - uv.x = i / segments; - uv.y = j / ( points.length - 1 ); + uv.x = i / segments; + uv.y = j / ( points.length - 1 ); - uvs.push( uv.x, uv.y ); + uvs.push( uv.x, uv.y ); + } + } - } + // indices - // indices + for ( var i$1 = 0; i$1 < segments; i$1 ++ ) { - for ( var i$1 = 0; i$1 < segments; i$1 ++ ) { + for ( var j$1 = 0; j$1 < ( points.length - 1 ); j$1 ++ ) { - for ( var j$1 = 0; j$1 < ( points.length - 1 ); j$1 ++ ) { + var base = j$1 + i$1 * points.length; - var base = j$1 + i$1 * points.length; + var a = base; + var b = base + points.length; + var c = base + points.length + 1; + var d = base + 1; - var a = base; - var b = base + points.length; - var c = base + points.length + 1; - var d = base + 1; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // generate normals - // generate normals + this.computeVertexNormals(); - this.computeVertexNormals(); + // if the geometry is closed, we need to average the normals along the seam. + // because the corresponding vertices are identical (but still have different UVs). - // if the geometry is closed, we need to average the normals along the seam. - // because the corresponding vertices are identical (but still have different UVs). + if ( phiLength === Math.PI * 2 ) { - if ( phiLength === Math.PI * 2 ) { + var normals = this.attributes.normal.array; + var n1 = new Vector3(); + var n2 = new Vector3(); + var n = new Vector3(); - var normals = this.attributes.normal.array; - var n1 = new Vector3(); - var n2 = new Vector3(); - var n = new Vector3(); + // this is the buffer offset for the last line of vertices - // this is the buffer offset for the last line of vertices + var base$1 = segments * points.length * 3; - var base$1 = segments * points.length * 3; + for ( var i$2 = 0, j$2 = 0; i$2 < points.length; i$2 ++, j$2 += 3 ) { - for ( var i$2 = 0, j$2 = 0; i$2 < points.length; i$2 ++, j$2 += 3 ) { + // select the normal of the vertex in the first line - // select the normal of the vertex in the first line + n1.x = normals[ j$2 + 0 ]; + n1.y = normals[ j$2 + 1 ]; + n1.z = normals[ j$2 + 2 ]; - n1.x = normals[ j$2 + 0 ]; - n1.y = normals[ j$2 + 1 ]; - n1.z = normals[ j$2 + 2 ]; + // select the normal of the vertex in the last line - // select the normal of the vertex in the last line + n2.x = normals[ base$1 + j$2 + 0 ]; + n2.y = normals[ base$1 + j$2 + 1 ]; + n2.z = normals[ base$1 + j$2 + 2 ]; - n2.x = normals[ base$1 + j$2 + 0 ]; - n2.y = normals[ base$1 + j$2 + 1 ]; - n2.z = normals[ base$1 + j$2 + 2 ]; + // average normals - // average normals + n.addVectors( n1, n2 ).normalize(); - n.addVectors( n1, n2 ).normalize(); + // assign the new values to both normals - // assign the new values to both normals + normals[ j$2 + 0 ] = normals[ base$1 + j$2 + 0 ] = n.x; + normals[ j$2 + 1 ] = normals[ base$1 + j$2 + 1 ] = n.y; + normals[ j$2 + 2 ] = normals[ base$1 + j$2 + 2 ] = n.z; - normals[ j$2 + 0 ] = normals[ base$1 + j$2 + 0 ] = n.x; - normals[ j$2 + 1 ] = normals[ base$1 + j$2 + 1 ] = n.y; - normals[ j$2 + 2 ] = normals[ base$1 + j$2 + 2 ] = n.z; + } } } - } - - LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; + LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; // ShapeGeometry - function ShapeGeometry( shapes, curveSegments ) { + function ShapeGeometry( shapes, curveSegments ) { - Geometry.call( this ); - - this.type = 'ShapeGeometry'; + Geometry.call(this); + this.type = 'ShapeGeometry'; - if ( typeof curveSegments === 'object' ) { + if ( typeof curveSegments === 'object' ) { - console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); + console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); - curveSegments = curveSegments.curveSegments; + curveSegments = curveSegments.curveSegments; - } + } - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; - this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); - this.mergeVertices(); + this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); + this.mergeVertices(); - } + } - ShapeGeometry.prototype = Object.create( Geometry.prototype ); - ShapeGeometry.prototype.constructor = ShapeGeometry; + ShapeGeometry.prototype = Object.create( Geometry.prototype ); + ShapeGeometry.prototype.constructor = ShapeGeometry; - ShapeGeometry.prototype.toJSON = function () { + ShapeGeometry.prototype.toJSON = function toJSON$1$1 () { - var data = Geometry.prototype.toJSON.call( this ); + var data = Geometry.prototype.toJSON.call( this ); - var shapes = this.parameters.shapes; + var shapes = this.parameters.shapes; - return toJSON$1( shapes, data ); + return toJSON$1( shapes, data ); - }; + }; // ShapeBufferGeometry - function ShapeBufferGeometry( shapes, curveSegments ) { + function ShapeBufferGeometry( shapes, curveSegments ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'ShapeBufferGeometry'; - this.type = 'ShapeBufferGeometry'; + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + curveSegments = curveSegments || 12; - curveSegments = curveSegments || 12; + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // helper variables - // helper variables + var groupStart = 0; + var groupCount = 0; - var groupStart = 0; - var groupCount = 0; + // allow single and array values for "shapes" parameter - // allow single and array values for "shapes" parameter + if ( Array.isArray( shapes ) === false ) { - if ( Array.isArray( shapes ) === false ) { + addShape( shapes ); - addShape( shapes ); + } else { - } else { + for ( var i = 0; i < shapes.length; i ++ ) { - for ( var i = 0; i < shapes.length; i ++ ) { + addShape( shapes[ i ] ); - addShape( shapes[ i ] ); + this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support - this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support + groupStart += groupCount; + groupCount = 0; - groupStart += groupCount; - groupCount = 0; + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // helper functions - // helper functions + function addShape( shape ) { - function addShape( shape ) { + var indexOffset = vertices.length / 3; + var points = shape.extractPoints( curveSegments ); - var indexOffset = vertices.length / 3; - var points = shape.extractPoints( curveSegments ); + var shapeVertices = points.shape; + var shapeHoles = points.holes; - var shapeVertices = points.shape; - var shapeHoles = points.holes; + // check direction of vertices - // check direction of vertices + if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { - if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { + shapeVertices = shapeVertices.reverse(); - shapeVertices = shapeVertices.reverse(); + } - } + for ( var i = 0, l = shapeHoles.length; i < l; i ++ ) { - for ( var i = 0, l = shapeHoles.length; i < l; i ++ ) { + var shapeHole = shapeHoles[ i ]; - var shapeHole = shapeHoles[ i ]; + if ( ShapeUtils.isClockWise( shapeHole ) === true ) { - if ( ShapeUtils.isClockWise( shapeHole ) === true ) { + shapeHoles[ i ] = shapeHole.reverse(); - shapeHoles[ i ] = shapeHole.reverse(); + } } - } + var faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); - var faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); + // join vertices of inner and outer paths to a single array - // join vertices of inner and outer paths to a single array + for ( var i$1 = 0, l$1 = shapeHoles.length; i$1 < l$1; i$1 ++ ) { - for ( var i$1 = 0, l$1 = shapeHoles.length; i$1 < l$1; i$1 ++ ) { + var shapeHole$1 = shapeHoles[ i$1 ]; + shapeVertices = shapeVertices.concat( shapeHole$1 ); - var shapeHole$1 = shapeHoles[ i$1 ]; - shapeVertices = shapeVertices.concat( shapeHole$1 ); + } - } + // vertices, normals, uvs - // vertices, normals, uvs + for ( var i$2 = 0, l$2 = shapeVertices.length; i$2 < l$2; i$2 ++ ) { - for ( var i$2 = 0, l$2 = shapeVertices.length; i$2 < l$2; i$2 ++ ) { + var vertex = shapeVertices[ i$2 ]; - var vertex = shapeVertices[ i$2 ]; + vertices.push( vertex.x, vertex.y, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( vertex.x, vertex.y ); // world uvs - vertices.push( vertex.x, vertex.y, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( vertex.x, vertex.y ); // world uvs + } - } + // incides - // incides + for ( var i$3 = 0, l$3 = faces.length; i$3 < l$3; i$3 ++ ) { - for ( var i$3 = 0, l$3 = faces.length; i$3 < l$3; i$3 ++ ) { + var face = faces[ i$3 ]; - var face = faces[ i$3 ]; + var a = face[ 0 ] + indexOffset; + var b = face[ 1 ] + indexOffset; + var c = face[ 2 ] + indexOffset; - var a = face[ 0 ] + indexOffset; - var b = face[ 1 ] + indexOffset; - var c = face[ 2 ] + indexOffset; + indices.push( a, b, c ); + groupCount += 3; - indices.push( a, b, c ); - groupCount += 3; + } } } - } - - ShapeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - ShapeBufferGeometry.prototype.constructor = ShapeBufferGeometry; + ShapeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + ShapeBufferGeometry.prototype.constructor = ShapeBufferGeometry; - ShapeBufferGeometry.prototype.toJSON = function () { + ShapeBufferGeometry.prototype.toJSON = function toJSON$2 () { - var data = BufferGeometry.prototype.toJSON.call( this ); + var data = BufferGeometry.prototype.toJSON.call( this ); - var shapes = this.parameters.shapes; + var shapes = this.parameters.shapes; - return toJSON$1( shapes, data ); + return toJSON$1( shapes, data ); - }; + }; // @@ -32430,556 +32493,551 @@ function EdgesGeometry( geometry, thresholdAngle ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'EdgesGeometry'; + this.type = 'EdgesGeometry'; - this.parameters = { - thresholdAngle: thresholdAngle - }; + this.parameters = { + thresholdAngle: thresholdAngle + }; - thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; + thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; - // buffer + // buffer - var vertices = []; + var vertices = []; - // helper variables + // helper variables - var thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle ); - var edge = [ 0, 0 ], edges = {}; - var edge1, edge2, key; - var keys = [ 'a', 'b', 'c' ]; + var thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle ); + var edge = [ 0, 0 ], edges = {}; + var edge1, edge2, key; + var keys = [ 'a', 'b', 'c' ]; - // prepare source geometry + // prepare source geometry - var geometry2; + var geometry2; - if ( geometry.isBufferGeometry ) { + if ( geometry.isBufferGeometry ) { - geometry2 = new Geometry(); - geometry2.fromBufferGeometry( geometry ); + geometry2 = new Geometry(); + geometry2.fromBufferGeometry( geometry ); - } else { + } else { - geometry2 = geometry.clone(); + geometry2 = geometry.clone(); - } + } - geometry2.mergeVertices(); - geometry2.computeFaceNormals(); + geometry2.mergeVertices(); + geometry2.computeFaceNormals(); - var sourceVertices = geometry2.vertices; - var faces = geometry2.faces; + var sourceVertices = geometry2.vertices; + var faces = geometry2.faces; - // now create a data structure where each entry represents an edge with its adjoining faces + // now create a data structure where each entry represents an edge with its adjoining faces - for ( var i = 0, l = faces.length; i < l; i ++ ) { + for ( var i = 0, l = faces.length; i < l; i ++ ) { - var face = faces[ i ]; + var face = faces[ i ]; - for ( var j = 0; j < 3; j ++ ) { + for ( var j = 0; j < 3; j ++ ) { - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); - edge[ 1 ] = Math.max( edge1, edge2 ); + edge1 = face[ keys[ j ] ]; + edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; + edge[ 0 ] = Math.min( edge1, edge2 ); + edge[ 1 ] = Math.max( edge1, edge2 ); - key = edge[ 0 ] + ',' + edge[ 1 ]; + key = edge[ 0 ] + ',' + edge[ 1 ]; - if ( edges[ key ] === undefined ) { + if ( edges[ key ] === undefined ) { - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; + edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; - } else { + } else { - edges[ key ].face2 = i; + edges[ key ].face2 = i; + + } } } - } + // generate vertices - // generate vertices + for ( key in edges ) { - for ( key in edges ) { + var e = edges[ key ]; - var e = edges[ key ]; + // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. - // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. + if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { - if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { + var vertex = sourceVertices[ e.index1 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - var vertex = sourceVertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex = sourceVertices[ e.index2 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex = sourceVertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + } } - } - - // build geometry + // build geometry - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - } + } - EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); - EdgesGeometry.prototype.constructor = EdgesGeometry; + EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); + EdgesGeometry.prototype.constructor = EdgesGeometry; // CylinderGeometry - function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - Geometry.call( this ); + function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'CylinderGeometry'; + Geometry.call(this); + this.type = 'CylinderGeometry'; - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); + this.mergeVertices(); - } + } - CylinderGeometry.prototype = Object.create( Geometry.prototype ); - CylinderGeometry.prototype.constructor = CylinderGeometry; + CylinderGeometry.prototype = Object.create( Geometry.prototype ); + CylinderGeometry.prototype.constructor = CylinderGeometry; // CylinderBufferGeometry - function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); + this.type = 'CylinderBufferGeometry'; - this.type = 'CylinderBufferGeometry'; + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + var scope = this; - var scope = this; + radiusTop = radiusTop !== undefined ? radiusTop : 1; + radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; + height = height || 1; - radiusTop = radiusTop !== undefined ? radiusTop : 1; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; - height = height || 1; + radialSegments = Math.floor( radialSegments ) || 8; + heightSegments = Math.floor( heightSegments ) || 1; - radialSegments = Math.floor( radialSegments ) || 8; - heightSegments = Math.floor( heightSegments ) || 1; + openEnded = openEnded !== undefined ? openEnded : false; + thetaStart = thetaStart !== undefined ? thetaStart : 0.0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - openEnded = openEnded !== undefined ? openEnded : false; - thetaStart = thetaStart !== undefined ? thetaStart : 0.0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + // buffers - // buffers + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + // helper variables - // helper variables + var index = 0; + var indexArray = []; + var halfHeight = height / 2; + var groupStart = 0; - var index = 0; - var indexArray = []; - var halfHeight = height / 2; - var groupStart = 0; + // generate geometry - // generate geometry + generateTorso(); - generateTorso(); + if ( openEnded === false ) { - if ( openEnded === false ) { + if ( radiusTop > 0 ) { generateCap( true ); } + if ( radiusBottom > 0 ) { generateCap( false ); } - if ( radiusTop > 0 ) { generateCap( true ); } - if ( radiusBottom > 0 ) { generateCap( false ); } + } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + function generateTorso() { - function generateTorso() { + var normal = new Vector3(); + var vertex = new Vector3(); - var normal = new Vector3(); - var vertex = new Vector3(); + var groupCount = 0; - var groupCount = 0; + // this will be used to calculate the normal + var slope = ( radiusBottom - radiusTop ) / height; - // this will be used to calculate the normal - var slope = ( radiusBottom - radiusTop ) / height; + // generate vertices, normals and uvs - // generate vertices, normals and uvs + for ( var y = 0; y <= heightSegments; y ++ ) { - for ( var y = 0; y <= heightSegments; y ++ ) { + var indexRow = []; - var indexRow = []; + var v = y / heightSegments; - var v = y / heightSegments; + // calculate the radius of the current row - // calculate the radius of the current row + var radius = v * ( radiusBottom - radiusTop ) + radiusTop; - var radius = v * ( radiusBottom - radiusTop ) + radiusTop; + for ( var x = 0; x <= radialSegments; x ++ ) { - for ( var x = 0; x <= radialSegments; x ++ ) { + var u = x / radialSegments; - var u = x / radialSegments; + var theta = u * thetaLength + thetaStart; - var theta = u * thetaLength + thetaStart; + var sinTheta = Math.sin( theta ); + var cosTheta = Math.cos( theta ); - var sinTheta = Math.sin( theta ); - var cosTheta = Math.cos( theta ); + // vertex - // vertex + vertex.x = radius * sinTheta; + vertex.y = - v * height + halfHeight; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex.x = radius * sinTheta; - vertex.y = - v * height + halfHeight; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal - // normal + normal.set( sinTheta, slope, cosTheta ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - normal.set( sinTheta, slope, cosTheta ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + // uv - // uv + uvs.push( u, 1 - v ); - uvs.push( u, 1 - v ); + // save index of vertex in respective row - // save index of vertex in respective row + indexRow.push( index ++ ); - indexRow.push( index ++ ); + } - } + // now save vertices of the row in our index array - // now save vertices of the row in our index array + indexArray.push( indexRow ); - indexArray.push( indexRow ); + } - } + // generate indices - // generate indices + for ( var x$1 = 0; x$1 < radialSegments; x$1 ++ ) { - for ( var x$1 = 0; x$1 < radialSegments; x$1 ++ ) { + for ( var y$1 = 0; y$1 < heightSegments; y$1 ++ ) { - for ( var y$1 = 0; y$1 < heightSegments; y$1 ++ ) { + // we use the index array to access the correct indices - // we use the index array to access the correct indices + var a = indexArray[ y$1 ][ x$1 ]; + var b = indexArray[ y$1 + 1 ][ x$1 ]; + var c = indexArray[ y$1 + 1 ][ x$1 + 1 ]; + var d = indexArray[ y$1 ][ x$1 + 1 ]; - var a = indexArray[ y$1 ][ x$1 ]; - var b = indexArray[ y$1 + 1 ][ x$1 ]; - var c = indexArray[ y$1 + 1 ][ x$1 + 1 ]; - var d = indexArray[ y$1 ][ x$1 + 1 ]; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + // update group counter - // update group counter + groupCount += 6; - groupCount += 6; + } } - } + // add a group to the geometry. this will ensure multi material support - // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, 0 ); - scope.addGroup( groupStart, groupCount, 0 ); + // calculate new start value for groups - // calculate new start value for groups + groupStart += groupCount; - groupStart += groupCount; + } - } + function generateCap( top ) { - function generateCap( top ) { + // save the index of the first center vertex + var centerIndexStart = index; - // save the index of the first center vertex - var centerIndexStart = index; + var uv = new Vector2(); + var vertex = new Vector3(); - var uv = new Vector2(); - var vertex = new Vector3(); + var groupCount = 0; - var groupCount = 0; + var radius = ( top === true ) ? radiusTop : radiusBottom; + var sign = ( top === true ) ? 1 : - 1; - var radius = ( top === true ) ? radiusTop : radiusBottom; - var sign = ( top === true ) ? 1 : - 1; + // first we generate the center vertex data of the cap. + // because the geometry needs one set of uvs per face, + // we must generate a center vertex per face/segment - // first we generate the center vertex data of the cap. - // because the geometry needs one set of uvs per face, - // we must generate a center vertex per face/segment + for ( var x = 1; x <= radialSegments; x ++ ) { - for ( var x = 1; x <= radialSegments; x ++ ) { + // vertex - // vertex + vertices.push( 0, halfHeight * sign, 0 ); - vertices.push( 0, halfHeight * sign, 0 ); + // normal - // normal + normals.push( 0, sign, 0 ); - normals.push( 0, sign, 0 ); + // uv - // uv + uvs.push( 0.5, 0.5 ); - uvs.push( 0.5, 0.5 ); + // increase index - // increase index + index ++; - index ++; + } - } + // save the index of the last center vertex + var centerIndexEnd = index; - // save the index of the last center vertex - var centerIndexEnd = index; + // now we generate the surrounding vertices, normals and uvs - // now we generate the surrounding vertices, normals and uvs + for ( var x$1 = 0; x$1 <= radialSegments; x$1 ++ ) { - for ( var x$1 = 0; x$1 <= radialSegments; x$1 ++ ) { + var u = x$1 / radialSegments; + var theta = u * thetaLength + thetaStart; - var u = x$1 / radialSegments; - var theta = u * thetaLength + thetaStart; + var cosTheta = Math.cos( theta ); + var sinTheta = Math.sin( theta ); - var cosTheta = Math.cos( theta ); - var sinTheta = Math.sin( theta ); + // vertex - // vertex + vertex.x = radius * sinTheta; + vertex.y = halfHeight * sign; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex.x = radius * sinTheta; - vertex.y = halfHeight * sign; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal - // normal + normals.push( 0, sign, 0 ); - normals.push( 0, sign, 0 ); + // uv - // uv + uv.x = ( cosTheta * 0.5 ) + 0.5; + uv.y = ( sinTheta * 0.5 * sign ) + 0.5; + uvs.push( uv.x, uv.y ); - uv.x = ( cosTheta * 0.5 ) + 0.5; - uv.y = ( sinTheta * 0.5 * sign ) + 0.5; - uvs.push( uv.x, uv.y ); + // increase index + + index ++; - // increase index + } - index ++; + // generate indices - } + for ( var x$2 = 0; x$2 < radialSegments; x$2 ++ ) { - // generate indices + var c = centerIndexStart + x$2; + var i = centerIndexEnd + x$2; - for ( var x$2 = 0; x$2 < radialSegments; x$2 ++ ) { + if ( top === true ) { - var c = centerIndexStart + x$2; - var i = centerIndexEnd + x$2; + // face top - if ( top === true ) { + indices.push( i, i + 1, c ); - // face top + } else { - indices.push( i, i + 1, c ); + // face bottom - } else { + indices.push( i + 1, i, c ); - // face bottom + } - indices.push( i + 1, i, c ); + groupCount += 3; } - groupCount += 3; - - } + // add a group to the geometry. this will ensure multi material support - // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); - scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + // calculate new start value for groups - // calculate new start value for groups + groupStart += groupCount; - groupStart += groupCount; + } } - } - - CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; + CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; // ConeGeometry - function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { + function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + this.type = 'ConeGeometry'; - this.type = 'ConeGeometry'; - - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - } + } - ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); - ConeGeometry.prototype.constructor = ConeGeometry; + ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); + ConeGeometry.prototype.constructor = ConeGeometry; // ConeBufferGeometry - function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'ConeBufferGeometry'; + CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + this.type = 'ConeBufferGeometry'; - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - } + } - ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); - ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; + ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); + ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; // CircleGeometry - function CircleGeometry( radius, segments, thetaStart, thetaLength ) { + function CircleGeometry( radius, segments, thetaStart, thetaLength ) { - Geometry.call( this ); - - this.type = 'CircleGeometry'; + Geometry.call(this); + this.type = 'CircleGeometry'; - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); + this.mergeVertices(); - } + } - CircleGeometry.prototype = Object.create( Geometry.prototype ); - CircleGeometry.prototype.constructor = CircleGeometry; + CircleGeometry.prototype = Object.create( Geometry.prototype ); + CircleGeometry.prototype.constructor = CircleGeometry; // CircleBufferGeometry - function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { + function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { - BufferGeometry.call( this ); + BufferGeometry.call(this); - this.type = 'CircleBufferGeometry'; + this.type = 'CircleBufferGeometry'; - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - radius = radius || 1; - segments = segments !== undefined ? Math.max( 3, segments ) : 8; + radius = radius || 1; + segments = segments !== undefined ? Math.max( 3, segments ) : 8; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - // buffers + // buffers - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; + var indices = []; + var vertices = []; + var normals = []; + var uvs = []; - // helper variables + // helper variables - var vertex = new Vector3(); - var uv = new Vector2(); + var vertex = new Vector3(); + var uv = new Vector2(); - // center point + // center point - vertices.push( 0, 0, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( 0.5, 0.5 ); + vertices.push( 0, 0, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( 0.5, 0.5 ); - for ( var s = 0, i = 3; s <= segments; s ++, i += 3 ) { + for ( var s = 0, i = 3; s <= segments; s ++, i += 3 ) { - var segment = thetaStart + s / segments * thetaLength; + var segment = thetaStart + s / segments * thetaLength; - // vertex + // vertex - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal + // normal - normals.push( 0, 0, 1 ); + normals.push( 0, 0, 1 ); - // uvs + // uvs - uv.x = ( vertices[ i ] / radius + 1 ) / 2; - uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; + uv.x = ( vertices[ i ] / radius + 1 ) / 2; + uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; - uvs.push( uv.x, uv.y ); + uvs.push( uv.x, uv.y ); - } + } - // indices + // indices - for ( var i$1 = 1; i$1 <= segments; i$1 ++ ) { + for ( var i$1 = 1; i$1 <= segments; i$1 ++ ) { - indices.push( i$1, i$1 + 1, 0 ); + indices.push( i$1, i$1 + 1, 0 ); - } + } - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - } + } - CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); - CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; + CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); + CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; var Geometries = /*#__PURE__*/Object.freeze({ __proto__: null, @@ -34264,13 +34322,30 @@ var targetTrack = targetClip.tracks.find( function ( track ) { return track.name === referenceTrack.name - && track.ValueTypeName === referenceTrackType; + && track.ValueTypeName === referenceTrackType; } ); if ( targetTrack === undefined ) { return; } - var valueSize = referenceTrack.getValueSize(); + var referenceOffset = 0; + var referenceValueSize = referenceTrack.getValueSize(); + + if ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + referenceOffset = referenceValueSize / 3; + + } + + var targetOffset = 0; + var targetValueSize = targetTrack.getValueSize(); + + if ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + targetOffset = targetValueSize / 3; + + } + var lastIndex = referenceTrack.times.length - 1; var referenceValue = (void 0); @@ -34278,32 +34353,32 @@ if ( referenceTime <= referenceTrack.times[ 0 ] ) { // Reference frame is earlier than the first keyframe, so just use the first keyframe - referenceValue = AnimationUtils.arraySlice( referenceTrack.values, 0, referenceTrack.valueSize ); + var startIndex = referenceOffset; + var endIndex = referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex ); } else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) { // Reference frame is after the last keyframe, so just use the last keyframe - var startIndex = lastIndex * valueSize; - referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex ); + var startIndex$1 = lastIndex * referenceValueSize + referenceOffset; + var endIndex$1 = startIndex$1 + referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex$1, endIndex$1 ); } else { // Interpolate to the reference value var interpolant = referenceTrack.createInterpolant(); + var startIndex$2 = referenceOffset; + var endIndex$2 = referenceValueSize - referenceOffset; interpolant.evaluate( referenceTime ); - referenceValue = interpolant.resultBuffer; + referenceValue = AnimationUtils.arraySlice( interpolant.resultBuffer, startIndex$2, endIndex$2 ); } // Conjugate the quaternion if ( referenceTrackType === 'quaternion' ) { - var referenceQuat = new Quaternion( - referenceValue[ 0 ], - referenceValue[ 1 ], - referenceValue[ 2 ], - referenceValue[ 3 ] - ).normalize().conjugate(); + var referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate(); referenceQuat.toArray( referenceValue ); } @@ -34313,7 +34388,7 @@ var numTimes = targetTrack.times.length; for ( var j = 0; j < numTimes; ++ j ) { - var valueStart = j * valueSize; + var valueStart = j * targetValueSize + targetOffset; if ( referenceTrackType === 'quaternion' ) { @@ -34329,8 +34404,10 @@ } else { + var valueEnd = targetValueSize - targetOffset * 2; + // Subtract each value for all other numeric track types - for ( var k = 0; k < valueSize; ++ k ) { + for ( var k = 0; k < valueEnd; ++ k ) { targetTrack.values[ valueStart + k ] -= referenceValue[ k ]; @@ -36644,96 +36721,6 @@ } ); - /** - * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) - * - * Sub classes have to implement the parse() method which will be used in load(). - */ - - function DataTextureLoader( manager ) { - - Loader.call( this, manager ); - - } - - DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: DataTextureLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var texture = new DataTexture(); - - var loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); - loader.setRequestHeader( this.requestHeader ); - loader.setPath( this.path ); - loader.load( url, function ( buffer ) { - - var texData = scope.parse( buffer ); - - if ( ! texData ) { return; } - - if ( texData.image !== undefined ) { - - texture.image = texData.image; - - } else if ( texData.data !== undefined ) { - - texture.image.width = texData.width; - texture.image.height = texData.height; - texture.image.data = texData.data; - - } - - texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; - texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; - - texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; - texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; - - texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; - - if ( texData.format !== undefined ) { - - texture.format = texData.format; - - } - - if ( texData.type !== undefined ) { - - texture.type = texData.type; - - } - - if ( texData.mipmaps !== undefined ) { - - texture.mipmaps = texData.mipmaps; - texture.minFilter = LinearMipmapLinearFilter; // presumably... - - } - - if ( texData.mipmapCount === 1 ) { - - texture.minFilter = LinearFilter; - - } - - texture.needsUpdate = true; - - if ( onLoad ) { onLoad( texture, texData ); } - - }, onProgress, onError ); - - - return texture; - - } - - } ); - function ImageLoader( manager ) { Loader.call( this, manager ); @@ -36868,6 +36855,96 @@ } ); + /** + * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). + */ + + function DataTextureLoader( manager ) { + + Loader.call( this, manager ); + + } + + DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { + + constructor: DataTextureLoader, + + load: function ( url, onLoad, onProgress, onError ) { + + var scope = this; + + var texture = new DataTexture(); + + var loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setPath( this.path ); + loader.load( url, function ( buffer ) { + + var texData = scope.parse( buffer ); + + if ( ! texData ) { return; } + + if ( texData.image !== undefined ) { + + texture.image = texData.image; + + } else if ( texData.data !== undefined ) { + + texture.image.width = texData.width; + texture.image.height = texData.height; + texture.image.data = texData.data; + + } + + texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; + texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; + + texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; + texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; + + texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; + + if ( texData.format !== undefined ) { + + texture.format = texData.format; + + } + + if ( texData.type !== undefined ) { + + texture.type = texData.type; + + } + + if ( texData.mipmaps !== undefined ) { + + texture.mipmaps = texData.mipmaps; + texture.minFilter = LinearMipmapLinearFilter; // presumably... + + } + + if ( texData.mipmapCount === 1 ) { + + texture.minFilter = LinearFilter; + + } + + texture.needsUpdate = true; + + if ( onLoad ) { onLoad( texture, texData ); } + + }, onProgress, onError ); + + + return texture; + + } + + } ); + function TextureLoader( manager ) { Loader.call( this, manager ); @@ -39609,7 +39686,7 @@ // 3-band SH defined by 9 coefficients - function SphericalHarmonics3() { + var SphericalHarmonics3 = function SphericalHarmonics3() { this.coefficients = []; @@ -39619,234 +39696,226 @@ } - } - - Object.assign( SphericalHarmonics3.prototype, { - - isSphericalHarmonics3: true, + }; - set: function ( coefficients ) { + SphericalHarmonics3.prototype.set = function set ( coefficients ) { - for ( var i = 0; i < 9; i ++ ) { + for ( var i = 0; i < 9; i ++ ) { - this.coefficients[ i ].copy( coefficients[ i ] ); + this.coefficients[ i ].copy( coefficients[ i ] ); - } - - return this; + } - }, + return this; - zero: function () { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.zero = function zero () { - this.coefficients[ i ].set( 0, 0, 0 ); + for ( var i = 0; i < 9; i ++ ) { - } + this.coefficients[ i ].set( 0, 0, 0 ); - return this; + } - }, + return this; - // get the radiance in the direction of the normal - // target is a Vector3 - getAt: function ( normal, target ) { + }; - // normal is assumed to be unit length + // get the radiance in the direction of the normal + // target is a Vector3 + SphericalHarmonics3.prototype.getAt = function getAt ( normal, target ) { - var x = normal.x, y = normal.y, z = normal.z; + // normal is assumed to be unit length - var coeff = this.coefficients; + var x = normal.x, y = normal.y, z = normal.z; - // band 0 - target.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 ); + var coeff = this.coefficients; - // band 1 - target.addScaledVector( coeff[ 1 ], 0.488603 * y ); - target.addScaledVector( coeff[ 2 ], 0.488603 * z ); - target.addScaledVector( coeff[ 3 ], 0.488603 * x ); + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 ); - // band 2 - target.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) ); - target.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) ); - target.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) ); - target.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) ); - target.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) ); + // band 1 + target.addScaledVector( coeff[ 1 ], 0.488603 * y ); + target.addScaledVector( coeff[ 2 ], 0.488603 * z ); + target.addScaledVector( coeff[ 3 ], 0.488603 * x ); - return target; + // band 2 + target.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) ); + target.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) ); + target.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) ); + target.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) ); + target.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) ); - }, + return target; - // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal - // target is a Vector3 - // https://graphics.stanford.edu/papers/envmap/envmap.pdf - getIrradianceAt: function ( normal, target ) { + }; - // normal is assumed to be unit length + // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal + // target is a Vector3 + // https://graphics.stanford.edu/papers/envmap/envmap.pdf + SphericalHarmonics3.prototype.getIrradianceAt = function getIrradianceAt ( normal, target ) { - var x = normal.x, y = normal.y, z = normal.z; + // normal is assumed to be unit length - var coeff = this.coefficients; + var x = normal.x, y = normal.y, z = normal.z; - // band 0 - target.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095 + var coeff = this.coefficients; - // band 1 - target.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603 - target.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z ); - target.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x ); + // band 0 + target.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095 - // band 2 - target.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548 - target.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z ); - target.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3 - target.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z ); - target.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274 + // band 1 + target.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603 + target.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z ); + target.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x ); - return target; + // band 2 + target.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548 + target.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z ); + target.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3 + target.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z ); + target.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274 - }, + return target; - add: function ( sh ) { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.add = function add ( sh ) { - this.coefficients[ i ].add( sh.coefficients[ i ] ); + for ( var i = 0; i < 9; i ++ ) { - } + this.coefficients[ i ].add( sh.coefficients[ i ] ); - return this; + } - }, + return this; - addScaledSH: function ( sh, s ) { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.addScaledSH = function addScaledSH ( sh, s ) { - this.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s ); + for ( var i = 0; i < 9; i ++ ) { - } + this.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s ); - return this; + } - }, + return this; - scale: function ( s ) { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.scale = function scale ( s ) { - this.coefficients[ i ].multiplyScalar( s ); + for ( var i = 0; i < 9; i ++ ) { - } + this.coefficients[ i ].multiplyScalar( s ); - return this; + } - }, + return this; - lerp: function ( sh, alpha ) { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.lerp = function lerp ( sh, alpha ) { - this.coefficients[ i ].lerp( sh.coefficients[ i ], alpha ); + for ( var i = 0; i < 9; i ++ ) { - } + this.coefficients[ i ].lerp( sh.coefficients[ i ], alpha ); - return this; + } - }, + return this; - equals: function ( sh ) { + }; - for ( var i = 0; i < 9; i ++ ) { + SphericalHarmonics3.prototype.equals = function equals ( sh ) { - if ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) { + for ( var i = 0; i < 9; i ++ ) { - return false; + if ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) { - } + return false; } - return true; - - }, + } - copy: function ( sh ) { + return true; - return this.set( sh.coefficients ); + }; - }, + SphericalHarmonics3.prototype.copy = function copy ( sh ) { - clone: function () { + return this.set( sh.coefficients ); - return new this.constructor().copy( this ); + }; - }, + SphericalHarmonics3.prototype.clone = function clone () { - fromArray: function ( array, offset ) { + return new this.constructor().copy( this ); - if ( offset === undefined ) { offset = 0; } + }; - var coefficients = this.coefficients; + SphericalHarmonics3.prototype.fromArray = function fromArray ( array, offset ) { - for ( var i = 0; i < 9; i ++ ) { + if ( offset === undefined ) { offset = 0; } - coefficients[ i ].fromArray( array, offset + ( i * 3 ) ); + var coefficients = this.coefficients; - } + for ( var i = 0; i < 9; i ++ ) { - return this; + coefficients[ i ].fromArray( array, offset + ( i * 3 ) ); - }, + } - toArray: function ( array, offset ) { + return this; - if ( array === undefined ) { array = []; } - if ( offset === undefined ) { offset = 0; } + }; - var coefficients = this.coefficients; + SphericalHarmonics3.prototype.toArray = function toArray ( array, offset ) { - for ( var i = 0; i < 9; i ++ ) { + if ( array === undefined ) { array = []; } + if ( offset === undefined ) { offset = 0; } - coefficients[ i ].toArray( array, offset + ( i * 3 ) ); + var coefficients = this.coefficients; - } + for ( var i = 0; i < 9; i ++ ) { - return array; + coefficients[ i ].toArray( array, offset + ( i * 3 ) ); } - } ); + return array; - Object.assign( SphericalHarmonics3, { + }; - // evaluate the basis functions - // shBasis is an Array[ 9 ] - getBasisAt: function ( normal, shBasis ) { + // evaluate the basis functions + // shBasis is an Array[ 9 ] + SphericalHarmonics3.getBasisAt = function getBasisAt ( normal, shBasis ) { - // normal is assumed to be unit length + // normal is assumed to be unit length - var x = normal.x, y = normal.y, z = normal.z; + var x = normal.x, y = normal.y, z = normal.z; - // band 0 - shBasis[ 0 ] = 0.282095; + // band 0 + shBasis[ 0 ] = 0.282095; - // band 1 - shBasis[ 1 ] = 0.488603 * y; - shBasis[ 2 ] = 0.488603 * z; - shBasis[ 3 ] = 0.488603 * x; + // band 1 + shBasis[ 1 ] = 0.488603 * y; + shBasis[ 2 ] = 0.488603 * z; + shBasis[ 3 ] = 0.488603 * x; - // band 2 - shBasis[ 4 ] = 1.092548 * x * y; - shBasis[ 5 ] = 1.092548 * y * z; - shBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 ); - shBasis[ 7 ] = 1.092548 * x * z; - shBasis[ 8 ] = 0.546274 * ( x * x - y * y ); + // band 2 + shBasis[ 4 ] = 1.092548 * x * y; + shBasis[ 5 ] = 1.092548 * y * z; + shBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 ); + shBasis[ 7 ] = 1.092548 * x * z; + shBasis[ 8 ] = 0.546274 * ( x * x - y * y ); - } + }; - } ); + SphericalHarmonics3.prototype.isSphericalHarmonics3 = true; function LightProbe( sh, intensity ) { @@ -40067,6 +40136,7 @@ case 'm3': material.uniforms[ name ].value = new Matrix3().fromArray( uniform.value ); + break; case 'm4': material.uniforms[ name ].value = new Matrix4().fromArray( uniform.value ); @@ -42376,38 +42446,37 @@ var _scale$1 = new Vector3(); var _orientation = new Vector3(); - function AudioListener() { + function AudioListener() { - Object3D.call( this ); + Object3D.call(this); - this.type = 'AudioListener'; + this.type = 'AudioListener'; - this.context = AudioContext.getContext(); + this.context = AudioContext.getContext(); - this.gain = this.context.createGain(); - this.gain.connect( this.context.destination ); + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); - this.filter = null; + this.filter = null; - this.timeDelta = 0; + this.timeDelta = 0; - // private + // private - this._clock = new Clock(); + this._clock = new Clock(); - } - - AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { + } - constructor: AudioListener, + AudioListener.prototype = Object.create( Object3D.prototype ); + AudioListener.prototype.constructor = AudioListener; - getInput: function () { + AudioListener.prototype.getInput = function getInput () { return this.gain; - }, + }; - removeFilter: function ( ) { + AudioListener.prototype.removeFilter = function removeFilter () { if ( this.filter !== null ) { @@ -42420,15 +42489,15 @@ return this; - }, + }; - getFilter: function () { + AudioListener.prototype.getFilter = function getFilter () { return this.filter; - }, + }; - setFilter: function ( value ) { + AudioListener.prototype.setFilter = function setFilter ( value ) { if ( this.filter !== null ) { @@ -42447,23 +42516,23 @@ return this; - }, + }; - getMasterVolume: function () { + AudioListener.prototype.getMasterVolume = function getMasterVolume () { return this.gain.gain.value; - }, + }; - setMasterVolume: function ( value ) { + AudioListener.prototype.setMasterVolume = function setMasterVolume ( value ) { this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); return this; - }, + }; - updateMatrixWorld: function ( force ) { + AudioListener.prototype.updateMatrixWorld = function updateMatrixWorld ( force ) { Object3D.prototype.updateMatrixWorld.call( this, force ); @@ -42499,54 +42568,53 @@ } - } - - } ); + }; function Audio( listener ) { - Object3D.call( this ); + Object3D.call(this); - this.type = 'Audio'; + this.type = 'Audio'; - this.listener = listener; - this.context = listener.context; + this.listener = listener; + this.context = listener.context; - this.gain = this.context.createGain(); - this.gain.connect( listener.getInput() ); + this.gain = this.context.createGain(); + this.gain.connect( listener.getInput() ); - this.autoplay = false; + this.autoplay = false; - this.buffer = null; - this.detune = 0; - this.loop = false; - this.loopStart = 0; - this.loopEnd = 0; - this.offset = 0; - this.duration = undefined; - this.playbackRate = 1; - this.isPlaying = false; - this.hasPlaybackControl = true; - this.sourceType = 'empty'; + this.buffer = null; + this.detune = 0; + this.loop = false; + this.loopStart = 0; + this.loopEnd = 0; + this.offset = 0; + this.duration = undefined; + this.playbackRate = 1; + this.isPlaying = false; + this.hasPlaybackControl = true; + this.source = null; + this.sourceType = 'empty'; - this._startedAt = 0; - this._progress = 0; + this._startedAt = 0; + this._progress = 0; + this._connected = false; - this.filters = []; + this.filters = []; - } - - Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { + } - constructor: Audio, + Audio.prototype = Object.create( Object3D.prototype ); + Audio.prototype.constructor = Audio; - getOutput: function () { + Audio.prototype.getOutput = function getOutput () { return this.gain; - }, + }; - setNodeSource: function ( audioNode ) { + Audio.prototype.setNodeSource = function setNodeSource ( audioNode ) { this.hasPlaybackControl = false; this.sourceType = 'audioNode'; @@ -42555,9 +42623,9 @@ return this; - }, + }; - setMediaElementSource: function ( mediaElement ) { + Audio.prototype.setMediaElementSource = function setMediaElementSource ( mediaElement ) { this.hasPlaybackControl = false; this.sourceType = 'mediaNode'; @@ -42566,9 +42634,9 @@ return this; - }, + }; - setMediaStreamSource: function ( mediaStream ) { + Audio.prototype.setMediaStreamSource = function setMediaStreamSource ( mediaStream ) { this.hasPlaybackControl = false; this.sourceType = 'mediaStreamNode'; @@ -42577,9 +42645,9 @@ return this; - }, + }; - setBuffer: function ( audioBuffer ) { + Audio.prototype.setBuffer = function setBuffer ( audioBuffer ) { this.buffer = audioBuffer; this.sourceType = 'buffer'; @@ -42588,9 +42656,9 @@ return this; - }, + }; - play: function ( delay ) { + Audio.prototype.play = function play ( delay ) { if ( delay === undefined ) { delay = 0; } @@ -42627,9 +42695,9 @@ return this.connect(); - }, + }; - pause: function () { + Audio.prototype.pause = function pause () { if ( this.hasPlaybackControl === false ) { @@ -42661,9 +42729,9 @@ return this; - }, + }; - stop: function () { + Audio.prototype.stop = function stop () { if ( this.hasPlaybackControl === false ) { @@ -42680,9 +42748,9 @@ return this; - }, + }; - connect: function () { + Audio.prototype.connect = function connect () { if ( this.filters.length > 0 ) { @@ -42702,11 +42770,13 @@ } + this._connected = true; + return this; - }, + }; - disconnect: function () { + Audio.prototype.disconnect = function disconnect () { if ( this.filters.length > 0 ) { @@ -42726,21 +42796,23 @@ } + this._connected = false; + return this; - }, + }; - getFilters: function () { + Audio.prototype.getFilters = function getFilters () { return this.filters; - }, + }; - setFilters: function ( value ) { + Audio.prototype.setFilters = function setFilters ( value ) { if ( ! value ) { value = []; } - if ( this.isPlaying === true ) { + if ( this._connected === true ) { this.disconnect(); this.filters = value; @@ -42754,9 +42826,9 @@ return this; - }, + }; - setDetune: function ( value ) { + Audio.prototype.setDetune = function setDetune ( value ) { this.detune = value; @@ -42770,27 +42842,27 @@ return this; - }, + }; - getDetune: function () { + Audio.prototype.getDetune = function getDetune () { return this.detune; - }, + }; - getFilter: function () { + Audio.prototype.getFilter = function getFilter () { return this.getFilters()[ 0 ]; - }, + }; - setFilter: function ( filter ) { + Audio.prototype.setFilter = function setFilter ( filter ) { return this.setFilters( filter ? [ filter ] : [] ); - }, + }; - setPlaybackRate: function ( value ) { + Audio.prototype.setPlaybackRate = function setPlaybackRate ( value ) { if ( this.hasPlaybackControl === false ) { @@ -42809,21 +42881,21 @@ return this; - }, + }; - getPlaybackRate: function () { + Audio.prototype.getPlaybackRate = function getPlaybackRate () { return this.playbackRate; - }, + }; - onEnded: function () { + Audio.prototype.onEnded = function onEnded () { this.isPlaying = false; - }, + }; - getLoop: function () { + Audio.prototype.getLoop = function getLoop () { if ( this.hasPlaybackControl === false ) { @@ -42834,9 +42906,9 @@ return this.loop; - }, + }; - setLoop: function ( value ) { + Audio.prototype.setLoop = function setLoop ( value ) { if ( this.hasPlaybackControl === false ) { @@ -42855,122 +42927,119 @@ return this; - }, + }; - setLoopStart: function ( value ) { + Audio.prototype.setLoopStart = function setLoopStart ( value ) { this.loopStart = value; return this; - }, + }; - setLoopEnd: function ( value ) { + Audio.prototype.setLoopEnd = function setLoopEnd ( value ) { this.loopEnd = value; return this; - }, + }; - getVolume: function () { + Audio.prototype.getVolume = function getVolume () { return this.gain.gain.value; - }, + }; - setVolume: function ( value ) { + Audio.prototype.setVolume = function setVolume ( value ) { this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); return this; - } - - } ); + }; var _position$3 = new Vector3(); var _quaternion$4 = new Quaternion(); var _scale$2 = new Vector3(); var _orientation$1 = new Vector3(); - function PositionalAudio( listener ) { + function PositionalAudio( listener ) { - Audio.call( this, listener ); + Audio.call( this, listener ); - this.panner = this.context.createPanner(); - this.panner.panningModel = 'HRTF'; - this.panner.connect( this.gain ); + this.panner = this.context.createPanner(); + this.panner.panningModel = 'HRTF'; + this.panner.connect( this.gain ); - } - - PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { + } - constructor: PositionalAudio, + PositionalAudio.prototype = Object.create( Audio.prototype ); + PositionalAudio.prototype.constructor = PositionalAudio; - getOutput: function () { + PositionalAudio.prototype.getOutput = function getOutput () { return this.panner; - }, + }; - getRefDistance: function () { + PositionalAudio.prototype.getRefDistance = function getRefDistance () { return this.panner.refDistance; - }, + }; - setRefDistance: function ( value ) { + PositionalAudio.prototype.setRefDistance = function setRefDistance ( value ) { this.panner.refDistance = value; return this; - }, + }; - getRolloffFactor: function () { + PositionalAudio.prototype.getRolloffFactor = function getRolloffFactor () { return this.panner.rolloffFactor; - }, + }; - setRolloffFactor: function ( value ) { + PositionalAudio.prototype.setRolloffFactor = function setRolloffFactor ( value ) { this.panner.rolloffFactor = value; return this; - }, + }; - getDistanceModel: function () { + PositionalAudio.prototype.getDistanceModel = function getDistanceModel () { return this.panner.distanceModel; - }, + }; - setDistanceModel: function ( value ) { + PositionalAudio.prototype.setDistanceModel = function setDistanceModel ( value ) { this.panner.distanceModel = value; return this; - }, + }; - getMaxDistance: function () { + PositionalAudio.prototype.getMaxDistance = function getMaxDistance () { return this.panner.maxDistance; - }, + }; - setMaxDistance: function ( value ) { + PositionalAudio.prototype.setMaxDistance = function setMaxDistance ( value ) { this.panner.maxDistance = value; return this; - }, + }; - setDirectionalCone: function ( coneInnerAngle, coneOuterAngle, coneOuterGain ) { + PositionalAudio.prototype.setDirectionalCone = function setDirectionalCone ( coneInnerAngle, coneOuterAngle, coneOuterGain ) { this.panner.coneInnerAngle = coneInnerAngle; this.panner.coneOuterAngle = coneOuterAngle; @@ -42978,11 +43047,11 @@ return this; - }, + }; - updateMatrixWorld: function ( force ) { + PositionalAudio.prototype.updateMatrixWorld = function updateMatrixWorld ( force ) { - Object3D.prototype.updateMatrixWorld.call( this, force ); + Audio.prototype.updateMatrixWorld.call( this, force ); if ( this.hasPlaybackControl === true && this.isPlaying === false ) { return; } @@ -43012,9 +43081,7 @@ } - } - - } ); + }; var AudioAnalyser = function AudioAnalyser( audio, fftSize ) { @@ -43285,7 +43352,7 @@ _setAdditiveIdentityQuaternion: function () { this._setAdditiveIdentityNumeric(); - this.buffer[ this._addIndex * 4 + 3 ] = 1; + this.buffer[ this._addIndex * this.valueSize + 3 ] = 1; }, @@ -45942,6 +46009,81 @@ } ); + /** + * @author raub / https://github.com/raub + */ + + /** + * Element size is one of: + * 5126: 4 + * 5123: 2 + * 5122: 2 + * 5125: 4 + * 5124: 4 + * 5120: 1 + * 5121: 1 + */ + function GLBufferAttribute( buffer, type, itemSize, elementSize, count ) { + + this.buffer = buffer; + this.type = type; + this.itemSize = itemSize; + this.elementSize = elementSize; + this.count = count; + + this.version = 0; + + } + + Object.defineProperty( GLBufferAttribute.prototype, 'needsUpdate', { + + set: function ( value ) { + + if ( value === true ) { this.version ++; } + + } + + } ); + + Object.assign( GLBufferAttribute.prototype, { + + isGLBufferAttribute: true, + + setBuffer: function ( buffer ) { + + this.buffer = buffer; + + return this; + + }, + + setType: function ( type, elementSize ) { + + this.type = type; + this.elementSize = elementSize; + + return this; + + }, + + setItemSize: function ( itemSize ) { + + this.itemSize = itemSize; + + return this; + + }, + + setCount: function ( count ) { + + this.count = count; + + return this; + + }, + + } ); + function Raycaster( origin, direction, near, far ) { this.ray = new Ray( origin, direction ); @@ -46157,7 +46299,7 @@ * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system */ - function Cylindrical( radius, theta, y ) { + var Cylindrical = function Cylindrical( radius, theta, y ) { this.radius = ( radius !== undefined ) ? radius : 1.0; // distance from the origin to a point in the x-z plane this.theta = ( theta !== undefined ) ? theta : 0; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis @@ -46165,418 +46307,406 @@ return this; - } - - Object.assign( Cylindrical.prototype, { - - set: function ( radius, theta, y ) { + }; - this.radius = radius; - this.theta = theta; - this.y = y; + Cylindrical.prototype.set = function set ( radius, theta, y ) { - return this; + this.radius = radius; + this.theta = theta; + this.y = y; - }, + return this; - clone: function () { + }; - return new this.constructor().copy( this ); + Cylindrical.prototype.clone = function clone () { - }, + return new this.constructor().copy( this ); - copy: function ( other ) { + }; - this.radius = other.radius; - this.theta = other.theta; - this.y = other.y; + Cylindrical.prototype.copy = function copy ( other ) { - return this; + this.radius = other.radius; + this.theta = other.theta; + this.y = other.y; - }, + return this; - setFromVector3: function ( v ) { + }; - return this.setFromCartesianCoords( v.x, v.y, v.z ); + Cylindrical.prototype.setFromVector3 = function setFromVector3 ( v ) { - }, + return this.setFromCartesianCoords( v.x, v.y, v.z ); - setFromCartesianCoords: function ( x, y, z ) { + }; - this.radius = Math.sqrt( x * x + z * z ); - this.theta = Math.atan2( x, z ); - this.y = y; + Cylindrical.prototype.setFromCartesianCoords = function setFromCartesianCoords ( x, y, z ) { - return this; + this.radius = Math.sqrt( x * x + z * z ); + this.theta = Math.atan2( x, z ); + this.y = y; - } + return this; - } ); + }; var _vector$7 = new Vector2(); - function Box2( min, max ) { + var Box2 = function Box2( min, max ) { this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); - } - - Object.assign( Box2.prototype, { - - set: function ( min, max ) { + }; - this.min.copy( min ); - this.max.copy( max ); + Box2.prototype.set = function set ( min, max ) { - return this; + this.min.copy( min ); + this.max.copy( max ); - }, + return this; - setFromPoints: function ( points ) { + }; - this.makeEmpty(); + Box2.prototype.setFromPoints = function setFromPoints ( points ) { - for ( var i = 0, il = points.length; i < il; i ++ ) { + this.makeEmpty(); - this.expandByPoint( points[ i ] ); + for ( var i = 0, il = points.length; i < il; i ++ ) { - } + this.expandByPoint( points[ i ] ); - return this; + } - }, + return this; - setFromCenterAndSize: function ( center, size ) { + }; - var halfSize = _vector$7.copy( size ).multiplyScalar( 0.5 ); - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); + Box2.prototype.setFromCenterAndSize = function setFromCenterAndSize ( center, size ) { - return this; + var halfSize = _vector$7.copy( size ).multiplyScalar( 0.5 ); + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); - }, + return this; - clone: function () { + }; - return new this.constructor().copy( this ); + Box2.prototype.clone = function clone () { - }, + return new this.constructor().copy( this ); - copy: function ( box ) { + }; - this.min.copy( box.min ); - this.max.copy( box.max ); + Box2.prototype.copy = function copy ( box ) { - return this; + this.min.copy( box.min ); + this.max.copy( box.max ); - }, + return this; - makeEmpty: function () { + }; - this.min.x = this.min.y = + Infinity; - this.max.x = this.max.y = - Infinity; + Box2.prototype.makeEmpty = function makeEmpty () { - return this; + this.min.x = this.min.y = + Infinity; + this.max.x = this.max.y = - Infinity; - }, + return this; - isEmpty: function () { + }; - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + Box2.prototype.isEmpty = function isEmpty () { - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - }, + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); - getCenter: function ( target ) { + }; - if ( target === undefined ) { + Box2.prototype.getCenter = function getCenter ( target ) { - console.warn( 'THREE.Box2: .getCenter() target is now required' ); - target = new Vector2(); + if ( target === undefined ) { - } + console.warn( 'THREE.Box2: .getCenter() target is now required' ); + target = new Vector2(); - return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + } - }, + return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - getSize: function ( target ) { + }; - if ( target === undefined ) { + Box2.prototype.getSize = function getSize ( target ) { - console.warn( 'THREE.Box2: .getSize() target is now required' ); - target = new Vector2(); + if ( target === undefined ) { - } + console.warn( 'THREE.Box2: .getSize() target is now required' ); + target = new Vector2(); - return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); + } - }, + return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); - expandByPoint: function ( point ) { + }; - this.min.min( point ); - this.max.max( point ); + Box2.prototype.expandByPoint = function expandByPoint ( point ) { - return this; + this.min.min( point ); + this.max.max( point ); - }, + return this; - expandByVector: function ( vector ) { + }; - this.min.sub( vector ); - this.max.add( vector ); + Box2.prototype.expandByVector = function expandByVector ( vector ) { - return this; + this.min.sub( vector ); + this.max.add( vector ); - }, + return this; - expandByScalar: function ( scalar ) { + }; - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); + Box2.prototype.expandByScalar = function expandByScalar ( scalar ) { - return this; + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); - }, + return this; - containsPoint: function ( point ) { + }; - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y ? false : true; + Box2.prototype.containsPoint = function containsPoint ( point ) { - }, + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y ? false : true; - containsBox: function ( box ) { + }; - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y; + Box2.prototype.containsBox = function containsBox ( box ) { - }, + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y; - getParameter: function ( point, target ) { + }; - // This can potentially have a divide by zero if the box - // has a size dimension of 0. + Box2.prototype.getParameter = function getParameter ( point, target ) { - if ( target === undefined ) { + // This can potentially have a divide by zero if the box + // has a size dimension of 0. - console.warn( 'THREE.Box2: .getParameter() target is now required' ); - target = new Vector2(); + if ( target === undefined ) { - } + console.warn( 'THREE.Box2: .getParameter() target is now required' ); + target = new Vector2(); - return target.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ) - ); + } - }, + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ) + ); - intersectsBox: function ( box ) { + }; - // using 4 splitting planes to rule out intersections + Box2.prototype.intersectsBox = function intersectsBox ( box ) { - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y ? false : true; + // using 4 splitting planes to rule out intersections - }, + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y ? false : true; - clampPoint: function ( point, target ) { + }; - if ( target === undefined ) { + Box2.prototype.clampPoint = function clampPoint ( point, target ) { - console.warn( 'THREE.Box2: .clampPoint() target is now required' ); - target = new Vector2(); + if ( target === undefined ) { - } + console.warn( 'THREE.Box2: .clampPoint() target is now required' ); + target = new Vector2(); - return target.copy( point ).clamp( this.min, this.max ); + } - }, + return target.copy( point ).clamp( this.min, this.max ); - distanceToPoint: function ( point ) { + }; - var clampedPoint = _vector$7.copy( point ).clamp( this.min, this.max ); - return clampedPoint.sub( point ).length(); + Box2.prototype.distanceToPoint = function distanceToPoint ( point ) { - }, + var clampedPoint = _vector$7.copy( point ).clamp( this.min, this.max ); + return clampedPoint.sub( point ).length(); - intersect: function ( box ) { + }; - this.min.max( box.min ); - this.max.min( box.max ); + Box2.prototype.intersect = function intersect ( box ) { - return this; + this.min.max( box.min ); + this.max.min( box.max ); - }, + return this; - union: function ( box ) { + }; - this.min.min( box.min ); - this.max.max( box.max ); + Box2.prototype.union = function union ( box ) { - return this; + this.min.min( box.min ); + this.max.max( box.max ); - }, + return this; - translate: function ( offset ) { + }; - this.min.add( offset ); - this.max.add( offset ); + Box2.prototype.translate = function translate ( offset ) { - return this; + this.min.add( offset ); + this.max.add( offset ); - }, + return this; - equals: function ( box ) { + }; - return box.min.equals( this.min ) && box.max.equals( this.max ); + Box2.prototype.equals = function equals ( box ) { - } + return box.min.equals( this.min ) && box.max.equals( this.max ); - } ); + }; var _startP = new Vector3(); var _startEnd = new Vector3(); - function Line3( start, end ) { + var Line3 = function Line3( start, end ) { this.start = ( start !== undefined ) ? start : new Vector3(); this.end = ( end !== undefined ) ? end : new Vector3(); - } - - Object.assign( Line3.prototype, { + }; - set: function ( start, end ) { + Line3.prototype.set = function set ( start, end ) { - this.start.copy( start ); - this.end.copy( end ); + this.start.copy( start ); + this.end.copy( end ); - return this; + return this; - }, + }; - clone: function () { + Line3.prototype.clone = function clone () { - return new this.constructor().copy( this ); - - }, + return new this.constructor().copy( this ); - copy: function ( line ) { + }; - this.start.copy( line.start ); - this.end.copy( line.end ); + Line3.prototype.copy = function copy ( line ) { - return this; + this.start.copy( line.start ); + this.end.copy( line.end ); - }, + return this; - getCenter: function ( target ) { + }; - if ( target === undefined ) { + Line3.prototype.getCenter = function getCenter ( target ) { - console.warn( 'THREE.Line3: .getCenter() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Line3: .getCenter() target is now required' ); + target = new Vector3(); - return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); + } - }, + return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); - delta: function ( target ) { + }; - if ( target === undefined ) { + Line3.prototype.delta = function delta ( target ) { - console.warn( 'THREE.Line3: .delta() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Line3: .delta() target is now required' ); + target = new Vector3(); - return target.subVectors( this.end, this.start ); + } - }, + return target.subVectors( this.end, this.start ); - distanceSq: function () { + }; - return this.start.distanceToSquared( this.end ); + Line3.prototype.distanceSq = function distanceSq () { - }, + return this.start.distanceToSquared( this.end ); - distance: function () { + }; - return this.start.distanceTo( this.end ); + Line3.prototype.distance = function distance () { - }, + return this.start.distanceTo( this.end ); - at: function ( t, target ) { + }; - if ( target === undefined ) { + Line3.prototype.at = function at ( t, target ) { - console.warn( 'THREE.Line3: .at() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Line3: .at() target is now required' ); + target = new Vector3(); - return this.delta( target ).multiplyScalar( t ).add( this.start ); + } - }, + return this.delta( target ).multiplyScalar( t ).add( this.start ); - closestPointToPointParameter: function ( point, clampToLine ) { + }; - _startP.subVectors( point, this.start ); - _startEnd.subVectors( this.end, this.start ); + Line3.prototype.closestPointToPointParameter = function closestPointToPointParameter ( point, clampToLine ) { - var startEnd2 = _startEnd.dot( _startEnd ); - var startEnd_startP = _startEnd.dot( _startP ); + _startP.subVectors( point, this.start ); + _startEnd.subVectors( this.end, this.start ); - var t = startEnd_startP / startEnd2; + var startEnd2 = _startEnd.dot( _startEnd ); + var startEnd_startP = _startEnd.dot( _startP ); - if ( clampToLine ) { + var t = startEnd_startP / startEnd2; - t = MathUtils.clamp( t, 0, 1 ); + if ( clampToLine ) { - } + t = MathUtils.clamp( t, 0, 1 ); - return t; + } - }, + return t; - closestPointToPoint: function ( point, clampToLine, target ) { + }; - var t = this.closestPointToPointParameter( point, clampToLine ); + Line3.prototype.closestPointToPoint = function closestPointToPoint ( point, clampToLine, target ) { - if ( target === undefined ) { + var t = this.closestPointToPointParameter( point, clampToLine ); - console.warn( 'THREE.Line3: .closestPointToPoint() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Line3: .closestPointToPoint() target is now required' ); + target = new Vector3(); - return this.delta( target ).multiplyScalar( t ).add( this.start ); + } - }, + return this.delta( target ).multiplyScalar( t ).add( this.start ); - applyMatrix4: function ( matrix ) { + }; - this.start.applyMatrix4( matrix ); - this.end.applyMatrix4( matrix ); + Line3.prototype.applyMatrix4 = function applyMatrix4 ( matrix ) { - return this; + this.start.applyMatrix4( matrix ); + this.end.applyMatrix4( matrix ); - }, + return this; - equals: function ( line ) { + }; - return line.start.equals( this.start ) && line.end.equals( this.end ); + Line3.prototype.equals = function equals ( line ) { - } + return line.start.equals( this.start ) && line.end.equals( this.end ); - } ); + }; function ImmediateRenderObject( material ) { @@ -46606,215 +46736,216 @@ var _vector$8 = new Vector3(); - function SpotLightHelper( light, color ) { - - Object3D.call( this ); + function SpotLightHelper( light, color ) { - this.light = light; - this.light.updateMatrixWorld(); + Object3D.call(this); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - var geometry = new BufferGeometry(); + var geometry = new BufferGeometry(); - var positions = [ - 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 1, - 0, 0, 0, - 1, 0, 1, - 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, - 1, 1 - ]; + var positions = [ + 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, - 1, 0, 1, + 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, - 1, 1 + ]; - for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { - var p1 = ( i / l ) * Math.PI * 2; - var p2 = ( j / l ) * Math.PI * 2; + var p1 = ( i / l ) * Math.PI * 2; + var p2 = ( j / l ) * Math.PI * 2; - positions.push( - Math.cos( p1 ), Math.sin( p1 ), 1, - Math.cos( p2 ), Math.sin( p2 ), 1 - ); + positions.push( + Math.cos( p1 ), Math.sin( p1 ), 1, + Math.cos( p2 ), Math.sin( p2 ), 1 + ); - } + } - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - var material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + var material = new LineBasicMaterial( { fog: false, toneMapped: false } ); - this.cone = new LineSegments( geometry, material ); - this.add( this.cone ); + this.cone = new LineSegments( geometry, material ); + this.add( this.cone ); - this.update(); + this.update(); - } + } - SpotLightHelper.prototype = Object.create( Object3D.prototype ); - SpotLightHelper.prototype.constructor = SpotLightHelper; + SpotLightHelper.prototype = Object.create( Object3D.prototype ); + SpotLightHelper.prototype.constructor = SpotLightHelper; - SpotLightHelper.prototype.dispose = function () { + SpotLightHelper.prototype.dispose = function dispose () { - this.cone.geometry.dispose(); - this.cone.material.dispose(); + this.cone.geometry.dispose(); + this.cone.material.dispose(); - }; + }; - SpotLightHelper.prototype.update = function () { + SpotLightHelper.prototype.update = function update () { - this.light.updateMatrixWorld(); + this.light.updateMatrixWorld(); - var coneLength = this.light.distance ? this.light.distance : 1000; - var coneWidth = coneLength * Math.tan( this.light.angle ); + var coneLength = this.light.distance ? this.light.distance : 1000; + var coneWidth = coneLength * Math.tan( this.light.angle ); - this.cone.scale.set( coneWidth, coneWidth, coneLength ); + this.cone.scale.set( coneWidth, coneWidth, coneLength ); - _vector$8.setFromMatrixPosition( this.light.target.matrixWorld ); + _vector$8.setFromMatrixPosition( this.light.target.matrixWorld ); - this.cone.lookAt( _vector$8 ); + this.cone.lookAt( _vector$8 ); - if ( this.color !== undefined ) { + if ( this.color !== undefined ) { - this.cone.material.color.set( this.color ); + this.cone.material.color.set( this.color ); - } else { + } else { - this.cone.material.color.copy( this.light.color ); + this.cone.material.color.copy( this.light.color ); - } + } - }; + }; var _vector$9 = new Vector3(); var _boneMatrix = new Matrix4(); var _matrixWorldInv = new Matrix4(); - function getBoneList( object ) { - var boneList = []; + function SkeletonHelper( object ) { - if ( object && object.isBone ) { + var bones = getBoneList( object ); - boneList.push( object ); + var geometry = new BufferGeometry(); - } - - for ( var i = 0; i < object.children.length; i ++ ) { + var vertices = []; + var colors = []; - boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); + var color1 = new Color( 0, 0, 1 ); + var color2 = new Color( 0, 1, 0 ); - } + for ( var i = 0; i < bones.length; i ++ ) { - return boneList; + var bone = bones[ i ]; - } + if ( bone.parent && bone.parent.isBone ) { - function SkeletonHelper( object ) { + vertices.push( 0, 0, 0 ); + vertices.push( 0, 0, 0 ); + colors.push( color1.r, color1.g, color1.b ); + colors.push( color2.r, color2.g, color2.b ); - var bones = getBoneList( object ); + } - var geometry = new BufferGeometry(); + } - var vertices = []; - var colors = []; + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - var color1 = new Color( 0, 0, 1 ); - var color2 = new Color( 0, 1, 0 ); + var material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); - for ( var i = 0; i < bones.length; i ++ ) { + LineSegments.call( this, geometry, material ); - var bone = bones[ i ]; + this.type = 'SkeletonHelper'; + this.isSkeletonHelper = true; - if ( bone.parent && bone.parent.isBone ) { + this.root = object; + this.bones = bones; - vertices.push( 0, 0, 0 ); - vertices.push( 0, 0, 0 ); - colors.push( color1.r, color1.g, color1.b ); - colors.push( color2.r, color2.g, color2.b ); - - } + this.matrix = object.matrixWorld; + this.matrixAutoUpdate = false; } - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + SkeletonHelper.prototype = Object.create( LineSegments.prototype ); + SkeletonHelper.prototype.constructor = SkeletonHelper; - var material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); + SkeletonHelper.prototype.updateMatrixWorld = function updateMatrixWorld ( force ) { - LineSegments.call( this, geometry, material ); + var bones = this.bones; - this.type = 'SkeletonHelper'; + var geometry = this.geometry; + var position = geometry.getAttribute( 'position' ); - this.root = object; - this.bones = bones; + _matrixWorldInv.getInverse( this.root.matrixWorld ); - this.matrix = object.matrixWorld; - this.matrixAutoUpdate = false; + for ( var i = 0, j = 0; i < bones.length; i ++ ) { - } + var bone = bones[ i ]; - SkeletonHelper.prototype = Object.create( LineSegments.prototype ); - SkeletonHelper.prototype.constructor = SkeletonHelper; + if ( bone.parent && bone.parent.isBone ) { - SkeletonHelper.prototype.isSkeletonHelper = true; + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); + _vector$9.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$9.x, _vector$9.y, _vector$9.z ); - SkeletonHelper.prototype.updateMatrixWorld = function ( force ) { + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); + _vector$9.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$9.x, _vector$9.y, _vector$9.z ); - var bones = this.bones; + j += 2; - var geometry = this.geometry; - var position = geometry.getAttribute( 'position' ); + } - _matrixWorldInv.getInverse( this.root.matrixWorld ); + } - for ( var i = 0, j = 0; i < bones.length; i ++ ) { + geometry.getAttribute( 'position' ).needsUpdate = true; - var bone = bones[ i ]; + LineSegments.prototype.updateMatrixWorld.call( this, force ); + + }; - if ( bone.parent && bone.parent.isBone ) { - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); - _vector$9.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j, _vector$9.x, _vector$9.y, _vector$9.z ); + function getBoneList( object ) { - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); - _vector$9.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j + 1, _vector$9.x, _vector$9.y, _vector$9.z ); + var boneList = []; - j += 2; + if ( object && object.isBone ) { - } + boneList.push( object ); } - geometry.getAttribute( 'position' ).needsUpdate = true; + for ( var i = 0; i < object.children.length; i ++ ) { - Object3D.prototype.updateMatrixWorld.call( this, force ); + boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); - }; + } + + return boneList; + + } function PointLightHelper( light, sphereSize, color ) { - this.light = light; - this.light.updateMatrixWorld(); + var geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); + var material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); - this.color = color; + Mesh.call( this, geometry, material ); - var geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); - var material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + this.light = light; + this.light.updateMatrixWorld(); - Mesh.call( this, geometry, material ); + this.color = color; - this.type = 'PointLightHelper'; + this.type = 'PointLightHelper'; - this.matrix = this.light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = this.light.matrixWorld; + this.matrixAutoUpdate = false; - this.update(); + this.update(); - /* + /* + // TODO: delete this comment? const distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 ); const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); @@ -46836,321 +46967,319 @@ this.add( this.lightDistance ); */ - } + } - PointLightHelper.prototype = Object.create( Mesh.prototype ); - PointLightHelper.prototype.constructor = PointLightHelper; + PointLightHelper.prototype = Object.create( Mesh.prototype ); + PointLightHelper.prototype.constructor = PointLightHelper; - PointLightHelper.prototype.dispose = function () { + PointLightHelper.prototype.dispose = function dispose () { - this.geometry.dispose(); - this.material.dispose(); + this.geometry.dispose(); + this.material.dispose(); - }; + }; - PointLightHelper.prototype.update = function () { + PointLightHelper.prototype.update = function update () { - if ( this.color !== undefined ) { + if ( this.color !== undefined ) { - this.material.color.set( this.color ); + this.material.color.set( this.color ); - } else { + } else { - this.material.color.copy( this.light.color ); + this.material.color.copy( this.light.color ); - } + } - /* - const d = this.light.distance; + /* + const d = this.light.distance; - if ( d === 0.0 ) { + if ( d === 0.0 ) { - this.lightDistance.visible = false; + this.lightDistance.visible = false; - } else { + } else { - this.lightDistance.visible = true; - this.lightDistance.scale.set( d, d, d ); + this.lightDistance.visible = true; + this.lightDistance.scale.set( d, d, d ); - } - */ + } + */ - }; + }; var _vector$a = new Vector3(); var _color1 = new Color(); var _color2 = new Color(); - function HemisphereLightHelper( light, size, color ) { - - Object3D.call( this ); + function HemisphereLightHelper( light, size, color ) { - this.light = light; - this.light.updateMatrixWorld(); + Object3D.call(this); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - var geometry = new OctahedronBufferGeometry( size ); - geometry.rotateY( Math.PI * 0.5 ); + var geometry = new OctahedronBufferGeometry( size ); + geometry.rotateY( Math.PI * 0.5 ); - this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); - if ( this.color === undefined ) { this.material.vertexColors = true; } + this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + if ( this.color === undefined ) { this.material.vertexColors = true; } - var position = geometry.getAttribute( 'position' ); - var colors = new Float32Array( position.count * 3 ); + var position = geometry.getAttribute( 'position' ); + var colors = new Float32Array( position.count * 3 ); - geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); + geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); - this.add( new Mesh( geometry, this.material ) ); + this.add( new Mesh( geometry, this.material ) ); - this.update(); + this.update(); - } + } - HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); - HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; + HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); + HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; - HemisphereLightHelper.prototype.dispose = function () { + HemisphereLightHelper.prototype.dispose = function dispose () { - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); + this.children[ 0 ].geometry.dispose(); + this.children[ 0 ].material.dispose(); - }; + }; - HemisphereLightHelper.prototype.update = function () { + HemisphereLightHelper.prototype.update = function update () { - var mesh = this.children[ 0 ]; + var mesh = this.children[ 0 ]; - if ( this.color !== undefined ) { + if ( this.color !== undefined ) { - this.material.color.set( this.color ); + this.material.color.set( this.color ); - } else { + } else { - var colors = mesh.geometry.getAttribute( 'color' ); + var colors = mesh.geometry.getAttribute( 'color' ); - _color1.copy( this.light.color ); - _color2.copy( this.light.groundColor ); + _color1.copy( this.light.color ); + _color2.copy( this.light.groundColor ); - for ( var i = 0, l = colors.count; i < l; i ++ ) { + for ( var i = 0, l = colors.count; i < l; i ++ ) { - var color = ( i < ( l / 2 ) ) ? _color1 : _color2; + var color = ( i < ( l / 2 ) ) ? _color1 : _color2; - colors.setXYZ( i, color.r, color.g, color.b ); + colors.setXYZ( i, color.r, color.g, color.b ); - } + } - colors.needsUpdate = true; + colors.needsUpdate = true; - } + } - mesh.lookAt( _vector$a.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + mesh.lookAt( _vector$a.setFromMatrixPosition( this.light.matrixWorld ).negate() ); - }; + }; function GridHelper( size, divisions, color1, color2 ) { - size = size || 10; - divisions = divisions || 10; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + size = size || 10; + divisions = divisions || 10; + color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); + color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - var center = divisions / 2; - var step = size / divisions; - var halfSize = size / 2; + var center = divisions / 2; + var step = size / divisions; + var halfSize = size / 2; - var vertices = [], colors = []; + var vertices = [], colors = []; - for ( var i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { + for ( var i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { - vertices.push( - halfSize, 0, k, halfSize, 0, k ); - vertices.push( k, 0, - halfSize, k, 0, halfSize ); + vertices.push( - halfSize, 0, k, halfSize, 0, k ); + vertices.push( k, 0, - halfSize, k, 0, halfSize ); - var color = i === center ? color1 : color2; + var color = i === center ? color1 : color2; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; - } + } - var geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + var geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - LineSegments.call( this, geometry, material ); + LineSegments.call( this, geometry, material ); - this.type = 'GridHelper'; + this.type = 'GridHelper'; - } + } - GridHelper.prototype = Object.create( LineSegments.prototype ); - GridHelper.prototype.constructor = GridHelper; + GridHelper.prototype = Object.create( LineSegments.prototype ); + GridHelper.prototype.constructor = GridHelper; function PolarGridHelper( radius, radials, circles, divisions, color1, color2 ) { - radius = radius || 10; - radials = radials || 16; - circles = circles || 8; - divisions = divisions || 64; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + radius = radius || 10; + radials = radials || 16; + circles = circles || 8; + divisions = divisions || 64; + color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); + color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - var vertices = []; - var colors = []; + var vertices = []; + var colors = []; - // create the radials + // create the radials - for ( var i = 0; i <= radials; i ++ ) { + for ( var i = 0; i <= radials; i ++ ) { - var v = ( i / radials ) * ( Math.PI * 2 ); + var v = ( i / radials ) * ( Math.PI * 2 ); - var x = Math.sin( v ) * radius; - var z = Math.cos( v ) * radius; + var x = Math.sin( v ) * radius; + var z = Math.cos( v ) * radius; - vertices.push( 0, 0, 0 ); - vertices.push( x, 0, z ); + vertices.push( 0, 0, 0 ); + vertices.push( x, 0, z ); - var color = ( i & 1 ) ? color1 : color2; + var color = ( i & 1 ) ? color1 : color2; - colors.push( color.r, color.g, color.b ); - colors.push( color.r, color.g, color.b ); + colors.push( color.r, color.g, color.b ); + colors.push( color.r, color.g, color.b ); - } + } - // create the circles + // create the circles - for ( var i$1 = 0; i$1 <= circles; i$1 ++ ) { + for ( var i$1 = 0; i$1 <= circles; i$1 ++ ) { - var color$1 = ( i$1 & 1 ) ? color1 : color2; + var color$1 = ( i$1 & 1 ) ? color1 : color2; - var r = radius - ( radius / circles * i$1 ); + var r = radius - ( radius / circles * i$1 ); - for ( var j = 0; j < divisions; j ++ ) { + for ( var j = 0; j < divisions; j ++ ) { - // first vertex + // first vertex - var v$1 = ( j / divisions ) * ( Math.PI * 2 ); + var v$1 = ( j / divisions ) * ( Math.PI * 2 ); - var x$1 = Math.sin( v$1 ) * r; - var z$1 = Math.cos( v$1 ) * r; + var x$1 = Math.sin( v$1 ) * r; + var z$1 = Math.cos( v$1 ) * r; - vertices.push( x$1, 0, z$1 ); - colors.push( color$1.r, color$1.g, color$1.b ); + vertices.push( x$1, 0, z$1 ); + colors.push( color$1.r, color$1.g, color$1.b ); - // second vertex + // second vertex - v$1 = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); + v$1 = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); - x$1 = Math.sin( v$1 ) * r; - z$1 = Math.cos( v$1 ) * r; + x$1 = Math.sin( v$1 ) * r; + z$1 = Math.cos( v$1 ) * r; - vertices.push( x$1, 0, z$1 ); - colors.push( color$1.r, color$1.g, color$1.b ); + vertices.push( x$1, 0, z$1 ); + colors.push( color$1.r, color$1.g, color$1.b ); - } + } - } + } - var geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + var geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - LineSegments.call( this, geometry, material ); + LineSegments.call( this, geometry, material ); - this.type = 'PolarGridHelper'; + this.type = 'PolarGridHelper'; - } + } - PolarGridHelper.prototype = Object.create( LineSegments.prototype ); - PolarGridHelper.prototype.constructor = PolarGridHelper; + PolarGridHelper.prototype = Object.create( LineSegments.prototype ); + PolarGridHelper.prototype.constructor = PolarGridHelper; var _v1$5 = new Vector3(); var _v2$3 = new Vector3(); var _v3$1 = new Vector3(); - function DirectionalLightHelper( light, size, color ) { - - Object3D.call( this ); + function DirectionalLightHelper( light, size, color ) { - this.light = light; - this.light.updateMatrixWorld(); + Object3D.call(this); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - if ( size === undefined ) { size = 1; } + if ( size === undefined ) { size = 1; } - var geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( [ - - size, size, 0, - size, size, 0, - size, - size, 0, - - size, - size, 0, - - size, size, 0 - ], 3 ) ); + var geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ + - size, size, 0, + size, size, 0, + size, - size, 0, + - size, - size, 0, + - size, size, 0 + ], 3 ) ); - var material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + var material = new LineBasicMaterial( { fog: false, toneMapped: false } ); - this.lightPlane = new Line( geometry, material ); - this.add( this.lightPlane ); + this.lightPlane = new Line( geometry, material ); + this.add( this.lightPlane ); - geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); - this.targetLine = new Line( geometry, material ); - this.add( this.targetLine ); + this.targetLine = new Line( geometry, material ); + this.add( this.targetLine ); - this.update(); + this.update(); - } + } - DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); - DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; + DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); + DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; - DirectionalLightHelper.prototype.dispose = function () { + DirectionalLightHelper.prototype.dispose = function dispose () { - this.lightPlane.geometry.dispose(); - this.lightPlane.material.dispose(); - this.targetLine.geometry.dispose(); - this.targetLine.material.dispose(); + this.lightPlane.geometry.dispose(); + this.lightPlane.material.dispose(); + this.targetLine.geometry.dispose(); + this.targetLine.material.dispose(); - }; + }; - DirectionalLightHelper.prototype.update = function () { + DirectionalLightHelper.prototype.update = function update () { - _v1$5.setFromMatrixPosition( this.light.matrixWorld ); - _v2$3.setFromMatrixPosition( this.light.target.matrixWorld ); - _v3$1.subVectors( _v2$3, _v1$5 ); + _v1$5.setFromMatrixPosition( this.light.matrixWorld ); + _v2$3.setFromMatrixPosition( this.light.target.matrixWorld ); + _v3$1.subVectors( _v2$3, _v1$5 ); - this.lightPlane.lookAt( _v2$3 ); + this.lightPlane.lookAt( _v2$3 ); - if ( this.color !== undefined ) { + if ( this.color !== undefined ) { - this.lightPlane.material.color.set( this.color ); - this.targetLine.material.color.set( this.color ); + this.lightPlane.material.color.set( this.color ); + this.targetLine.material.color.set( this.color ); - } else { + } else { - this.lightPlane.material.color.copy( this.light.color ); - this.targetLine.material.color.copy( this.light.color ); + this.lightPlane.material.color.copy( this.light.color ); + this.targetLine.material.color.copy( this.light.color ); - } + } - this.targetLine.lookAt( _v2$3 ); - this.targetLine.scale.z = _v3$1.length(); + this.targetLine.lookAt( _v2$3 ); + this.targetLine.scale.z = _v3$1.length(); - }; + }; var _vector$b = new Vector3(); var _camera = new Camera(); @@ -47162,167 +47291,168 @@ * http://evanw.github.com/lightgl.js/tests/shadowmap.html */ - function CameraHelper( camera ) { + function CameraHelper( camera ) { - var geometry = new BufferGeometry(); - var material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); + var geometry = new BufferGeometry(); + var material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); - var vertices = []; - var colors = []; + var vertices = []; + var colors = []; - var pointMap = {}; + var pointMap = {}; - // colors + // colors - var colorFrustum = new Color( 0xffaa00 ); - var colorCone = new Color( 0xff0000 ); - var colorUp = new Color( 0x00aaff ); - var colorTarget = new Color( 0xffffff ); - var colorCross = new Color( 0x333333 ); + var colorFrustum = new Color( 0xffaa00 ); + var colorCone = new Color( 0xff0000 ); + var colorUp = new Color( 0x00aaff ); + var colorTarget = new Color( 0xffffff ); + var colorCross = new Color( 0x333333 ); - // near + // near - addLine( 'n1', 'n2', colorFrustum ); - addLine( 'n2', 'n4', colorFrustum ); - addLine( 'n4', 'n3', colorFrustum ); - addLine( 'n3', 'n1', colorFrustum ); + addLine( 'n1', 'n2', colorFrustum ); + addLine( 'n2', 'n4', colorFrustum ); + addLine( 'n4', 'n3', colorFrustum ); + addLine( 'n3', 'n1', colorFrustum ); - // far + // far - addLine( 'f1', 'f2', colorFrustum ); - addLine( 'f2', 'f4', colorFrustum ); - addLine( 'f4', 'f3', colorFrustum ); - addLine( 'f3', 'f1', colorFrustum ); + addLine( 'f1', 'f2', colorFrustum ); + addLine( 'f2', 'f4', colorFrustum ); + addLine( 'f4', 'f3', colorFrustum ); + addLine( 'f3', 'f1', colorFrustum ); - // sides + // sides - addLine( 'n1', 'f1', colorFrustum ); - addLine( 'n2', 'f2', colorFrustum ); - addLine( 'n3', 'f3', colorFrustum ); - addLine( 'n4', 'f4', colorFrustum ); + addLine( 'n1', 'f1', colorFrustum ); + addLine( 'n2', 'f2', colorFrustum ); + addLine( 'n3', 'f3', colorFrustum ); + addLine( 'n4', 'f4', colorFrustum ); - // cone + // cone - addLine( 'p', 'n1', colorCone ); - addLine( 'p', 'n2', colorCone ); - addLine( 'p', 'n3', colorCone ); - addLine( 'p', 'n4', colorCone ); + addLine( 'p', 'n1', colorCone ); + addLine( 'p', 'n2', colorCone ); + addLine( 'p', 'n3', colorCone ); + addLine( 'p', 'n4', colorCone ); - // up + // up - addLine( 'u1', 'u2', colorUp ); - addLine( 'u2', 'u3', colorUp ); - addLine( 'u3', 'u1', colorUp ); + addLine( 'u1', 'u2', colorUp ); + addLine( 'u2', 'u3', colorUp ); + addLine( 'u3', 'u1', colorUp ); - // target + // target - addLine( 'c', 't', colorTarget ); - addLine( 'p', 'c', colorCross ); + addLine( 'c', 't', colorTarget ); + addLine( 'p', 'c', colorCross ); - // cross + // cross - addLine( 'cn1', 'cn2', colorCross ); - addLine( 'cn3', 'cn4', colorCross ); + addLine( 'cn1', 'cn2', colorCross ); + addLine( 'cn3', 'cn4', colorCross ); - addLine( 'cf1', 'cf2', colorCross ); - addLine( 'cf3', 'cf4', colorCross ); + addLine( 'cf1', 'cf2', colorCross ); + addLine( 'cf3', 'cf4', colorCross ); - function addLine( a, b, color ) { + function addLine( a, b, color ) { - addPoint( a, color ); - addPoint( b, color ); + addPoint( a, color ); + addPoint( b, color ); - } + } - function addPoint( id, color ) { + function addPoint( id, color ) { - vertices.push( 0, 0, 0 ); - colors.push( color.r, color.g, color.b ); + vertices.push( 0, 0, 0 ); + colors.push( color.r, color.g, color.b ); - if ( pointMap[ id ] === undefined ) { + if ( pointMap[ id ] === undefined ) { - pointMap[ id ] = []; + pointMap[ id ] = []; - } + } - pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); + pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); - } + } - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - LineSegments.call( this, geometry, material ); + LineSegments.call( this, geometry, material ); - this.type = 'CameraHelper'; + this.type = 'CameraHelper'; - this.camera = camera; - if ( this.camera.updateProjectionMatrix ) { this.camera.updateProjectionMatrix(); } + this.camera = camera; + if ( this.camera.updateProjectionMatrix ) { this.camera.updateProjectionMatrix(); } - this.matrix = camera.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = camera.matrixWorld; + this.matrixAutoUpdate = false; - this.pointMap = pointMap; + this.pointMap = pointMap; - this.update(); + this.update(); - } + } + + CameraHelper.prototype = Object.create( LineSegments.prototype ); + CameraHelper.prototype.constructor = CameraHelper; - CameraHelper.prototype = Object.create( LineSegments.prototype ); - CameraHelper.prototype.constructor = CameraHelper; + CameraHelper.prototype.update = function update () { - CameraHelper.prototype.update = function () { + var geometry = this.geometry; + var pointMap = this.pointMap; - var geometry = this.geometry; - var pointMap = this.pointMap; + var w = 1, h = 1; - var w = 1, h = 1; + // we need just camera projection matrix inverse + // world matrix must be identity - // we need just camera projection matrix inverse - // world matrix must be identity + _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); - _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); + // center / target - // center / target + setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); + setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); - setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); - setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); + // near - // near + setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); + setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); + setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); + setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); - setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); - setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); - setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); - setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); + // far - // far + setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); + setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); + setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); + setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); - setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); - setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); - setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); - setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); + // up - // up + setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); + setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); + setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); - setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); - setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); - setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); + // cross - // cross + setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); + setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); + setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); + setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); - setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); - setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); - setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); - setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); + setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); + setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); + setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); + setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); - setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); - setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); - setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); - setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); + geometry.getAttribute( 'position' ).needsUpdate = true; - geometry.getAttribute( 'position' ).needsUpdate = true; + }; - }; function setPoint( point, pointMap, geometry, camera, x, y, z ) { @@ -47346,331 +47476,326 @@ var _box$3 = new Box3(); - function BoxHelper( object, color ) { + function BoxHelper( object, color ) { - this.object = object; + if ( color === undefined ) { color = 0xffff00; } - if ( color === undefined ) { color = 0xffff00; } + var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + var positions = new Float32Array( 8 * 3 ); - var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - var positions = new Float32Array( 8 * 3 ); + var geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); - var geometry = new BufferGeometry(); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); + LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.object = object; + this.type = 'BoxHelper'; - this.type = 'BoxHelper'; + this.matrixAutoUpdate = false; - this.matrixAutoUpdate = false; - - this.update(); - - } - - BoxHelper.prototype = Object.create( LineSegments.prototype ); - BoxHelper.prototype.constructor = BoxHelper; - - BoxHelper.prototype.update = function ( object ) { - - if ( object !== undefined ) { - - console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); + this.update(); } - if ( this.object !== undefined ) { + BoxHelper.prototype = Object.create( LineSegments.prototype ); + BoxHelper.prototype.constructor = BoxHelper; - _box$3.setFromObject( this.object ); + BoxHelper.prototype.update = function update ( object ) { - } + if ( object !== undefined ) { - if ( _box$3.isEmpty() ) { return; } + console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); - var min = _box$3.min; - var max = _box$3.max; + } - /* - 5____4 - 1/___0/| - | 6__|_7 - 2/___3/ - - 0: max.x, max.y, max.z - 1: min.x, max.y, max.z - 2: min.x, min.y, max.z - 3: max.x, min.y, max.z - 4: max.x, max.y, min.z - 5: min.x, max.y, min.z - 6: min.x, min.y, min.z - 7: max.x, min.y, min.z - */ + if ( this.object !== undefined ) { - var position = this.geometry.attributes.position; - var array = position.array; + _box$3.setFromObject( this.object ); - array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; - array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; - array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; - array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; - array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; - array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; - array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; - array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + } - position.needsUpdate = true; + if ( _box$3.isEmpty() ) { return; } - this.geometry.computeBoundingSphere(); + var min = _box$3.min; + var max = _box$3.max; + /* + 5____4 + 1/___0/| + | 6__|_7 + 2/___3/ + + 0: max.x, max.y, max.z + 1: min.x, max.y, max.z + 2: min.x, min.y, max.z + 3: max.x, min.y, max.z + 4: max.x, max.y, min.z + 5: min.x, max.y, min.z + 6: min.x, min.y, min.z + 7: max.x, min.y, min.z + */ + + var position = this.geometry.attributes.position; + var array = position.array; + + array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; + array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; + array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; + array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; + array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; + array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; + array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; + array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + + position.needsUpdate = true; + + this.geometry.computeBoundingSphere(); - }; - BoxHelper.prototype.setFromObject = function ( object ) { + }; - this.object = object; - this.update(); + BoxHelper.prototype.setFromObject = function setFromObject ( object ) { - return this; + this.object = object; + this.update(); - }; + return this; - BoxHelper.prototype.copy = function ( source ) { + }; - LineSegments.prototype.copy.call( this, source ); + BoxHelper.prototype.copy = function copy ( source ) { - this.object = source.object; + LineSegments.prototype.copy.call( this, source ); - return this; + this.object = source.object; - }; + return this; - function Box3Helper( box, color ) { + }; - this.type = 'Box3Helper'; + function Box3Helper( box, color ) { - this.box = box; + if ( color === undefined ) { color = 0xffff00; } - if ( color === undefined ) { color = 0xffff00; } + var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + var positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; - var positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; + var geometry = new BufferGeometry(); - var geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.box = box; - this.type = 'Box3Helper'; + this.type = 'Box3Helper'; - this.geometry.computeBoundingSphere(); + this.geometry.computeBoundingSphere(); - } + } - Box3Helper.prototype = Object.create( LineSegments.prototype ); - Box3Helper.prototype.constructor = Box3Helper; + Box3Helper.prototype = Object.create( LineSegments.prototype ); + Box3Helper.prototype.constructor = Box3Helper; - Box3Helper.prototype.updateMatrixWorld = function ( force ) { + Box3Helper.prototype.updateMatrixWorld = function updateMatrixWorld ( force ) { - var box = this.box; + var box = this.box; - if ( box.isEmpty() ) { return; } + if ( box.isEmpty() ) { return; } - box.getCenter( this.position ); + box.getCenter( this.position ); - box.getSize( this.scale ); + box.getSize( this.scale ); - this.scale.multiplyScalar( 0.5 ); + this.scale.multiplyScalar( 0.5 ); - Object3D.prototype.updateMatrixWorld.call( this, force ); + LineSegments.prototype.updateMatrixWorld.call( this, force ); - }; + }; function PlaneHelper( plane, size, hex ) { - this.plane = plane; - this.size = ( size === undefined ) ? 1 : size; + var color = ( hex !== undefined ) ? hex : 0xffff00; - var color = ( hex !== undefined ) ? hex : 0xffff00; + var positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; - var positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; + var geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.computeBoundingSphere(); - var geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.computeBoundingSphere(); + Line.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - Line.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.type = 'PlaneHelper'; - this.type = 'PlaneHelper'; + this.plane = plane; - // + this.size = ( size === undefined ) ? 1 : size; - var positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; + var positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; - var geometry2 = new BufferGeometry(); - geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); - geometry2.computeBoundingSphere(); + var geometry2 = new BufferGeometry(); + geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); + geometry2.computeBoundingSphere(); - this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); + this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); - } + } - PlaneHelper.prototype = Object.create( Line.prototype ); - PlaneHelper.prototype.constructor = PlaneHelper; + PlaneHelper.prototype = Object.create( Line.prototype ); + PlaneHelper.prototype.constructor = PlaneHelper; - PlaneHelper.prototype.updateMatrixWorld = function ( force ) { + PlaneHelper.prototype.updateMatrixWorld = function updateMatrixWorld ( force ) { - var scale = - this.plane.constant; + var scale = - this.plane.constant; - if ( Math.abs( scale ) < 1e-8 ) { scale = 1e-8; } // sign does not matter + if ( Math.abs( scale ) < 1e-8 ) { scale = 1e-8; } // sign does not matter - this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); + this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); - this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here + this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here - this.lookAt( this.plane.normal ); + this.lookAt( this.plane.normal ); - Object3D.prototype.updateMatrixWorld.call( this, force ); + Line.prototype.updateMatrixWorld.call( this, force ); - }; + }; var _axis = new Vector3(); var _lineGeometry, _coneGeometry; - function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { - - // dir is assumed to be normalized + function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { - Object3D.call( this ); + Object3D.call(this); + // dir is assumed to be normalized - this.type = 'ArrowHelper'; + this.type = 'ArrowHelper'; - if ( dir === undefined ) { dir = new Vector3( 0, 0, 1 ); } - if ( origin === undefined ) { origin = new Vector3( 0, 0, 0 ); } - if ( length === undefined ) { length = 1; } - if ( color === undefined ) { color = 0xffff00; } - if ( headLength === undefined ) { headLength = 0.2 * length; } - if ( headWidth === undefined ) { headWidth = 0.2 * headLength; } + if ( dir === undefined ) { dir = new Vector3( 0, 0, 1 ); } + if ( origin === undefined ) { origin = new Vector3( 0, 0, 0 ); } + if ( length === undefined ) { length = 1; } + if ( color === undefined ) { color = 0xffff00; } + if ( headLength === undefined ) { headLength = 0.2 * length; } + if ( headWidth === undefined ) { headWidth = 0.2 * headLength; } - if ( _lineGeometry === undefined ) { + if ( _lineGeometry === undefined ) { - _lineGeometry = new BufferGeometry(); - _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + _lineGeometry = new BufferGeometry(); + _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); - _coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); - _coneGeometry.translate( 0, - 0.5, 0 ); + _coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); + _coneGeometry.translate( 0, - 0.5, 0 ); - } + } - this.position.copy( origin ); + this.position.copy( origin ); - this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - this.line.matrixAutoUpdate = false; - this.add( this.line ); + this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.line.matrixAutoUpdate = false; + this.add( this.line ); - this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); - this.cone.matrixAutoUpdate = false; - this.add( this.cone ); + this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); + this.cone.matrixAutoUpdate = false; + this.add( this.cone ); - this.setDirection( dir ); - this.setLength( length, headLength, headWidth ); + this.setDirection( dir ); + this.setLength( length, headLength, headWidth ); - } + } - ArrowHelper.prototype = Object.create( Object3D.prototype ); - ArrowHelper.prototype.constructor = ArrowHelper; + ArrowHelper.prototype = Object.create( Object3D.prototype ); + ArrowHelper.prototype.constructor = ArrowHelper; - ArrowHelper.prototype.setDirection = function ( dir ) { + ArrowHelper.prototype.setDirection = function setDirection ( dir ) { - // dir is assumed to be normalized + // dir is assumed to be normalized - if ( dir.y > 0.99999 ) { + if ( dir.y > 0.99999 ) { - this.quaternion.set( 0, 0, 0, 1 ); + this.quaternion.set( 0, 0, 0, 1 ); - } else if ( dir.y < - 0.99999 ) { + } else if ( dir.y < - 0.99999 ) { - this.quaternion.set( 1, 0, 0, 0 ); + this.quaternion.set( 1, 0, 0, 0 ); - } else { + } else { - _axis.set( dir.z, 0, - dir.x ).normalize(); + _axis.set( dir.z, 0, - dir.x ).normalize(); - var radians = Math.acos( dir.y ); + var radians = Math.acos( dir.y ); - this.quaternion.setFromAxisAngle( _axis, radians ); + this.quaternion.setFromAxisAngle( _axis, radians ); - } + } - }; + }; - ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { + ArrowHelper.prototype.setLength = function setLength ( length, headLength, headWidth ) { - if ( headLength === undefined ) { headLength = 0.2 * length; } - if ( headWidth === undefined ) { headWidth = 0.2 * headLength; } + if ( headLength === undefined ) { headLength = 0.2 * length; } + if ( headWidth === undefined ) { headWidth = 0.2 * headLength; } - this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 - this.line.updateMatrix(); + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 + this.line.updateMatrix(); - this.cone.scale.set( headWidth, headLength, headWidth ); - this.cone.position.y = length; - this.cone.updateMatrix(); + this.cone.scale.set( headWidth, headLength, headWidth ); + this.cone.position.y = length; + this.cone.updateMatrix(); - }; + }; - ArrowHelper.prototype.setColor = function ( color ) { + ArrowHelper.prototype.setColor = function setColor ( color ) { - this.line.material.color.set( color ); - this.cone.material.color.set( color ); + this.line.material.color.set( color ); + this.cone.material.color.set( color ); - }; + }; - ArrowHelper.prototype.copy = function ( source ) { + ArrowHelper.prototype.copy = function copy ( source ) { - Object3D.prototype.copy.call( this, source, false ); + Object3D.prototype.copy.call( this, source, false ); - this.line.copy( source.line ); - this.cone.copy( source.cone ); + this.line.copy( source.line ); + this.cone.copy( source.cone ); - return this; + return this; - }; + }; function AxesHelper( size ) { - size = size || 1; + size = size || 1; - var vertices = [ - 0, 0, 0, size, 0, 0, - 0, 0, 0, 0, size, 0, - 0, 0, 0, 0, 0, size - ]; + var vertices = [ + 0, 0, 0, size, 0, 0, + 0, 0, 0, 0, size, 0, + 0, 0, 0, 0, 0, size + ]; - var colors = [ - 1, 0, 0, 1, 0.6, 0, - 0, 1, 0, 0.6, 1, 0, - 0, 0, 1, 0, 0.6, 1 - ]; + var colors = [ + 1, 0, 0, 1, 0.6, 0, + 0, 1, 0, 0.6, 1, 0, + 0, 0, 1, 0, 0.6, 1 + ]; - var geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + var geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + var material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - LineSegments.call( this, geometry, material ); + LineSegments.call( this, geometry, material ); - this.type = 'AxesHelper'; + this.type = 'AxesHelper'; - } + } - AxesHelper.prototype = Object.create( LineSegments.prototype ); - AxesHelper.prototype.constructor = AxesHelper; + AxesHelper.prototype = Object.create( LineSegments.prototype ); + AxesHelper.prototype.constructor = AxesHelper; var LOD_MIN = 4; var LOD_MAX = 8; @@ -50636,6 +50761,9 @@ exports.FontLoader = FontLoader; exports.FrontSide = FrontSide; exports.Frustum = Frustum; + exports.GLBufferAttribute = GLBufferAttribute; + exports.GLSL1 = GLSL1; + exports.GLSL3 = GLSL3; exports.GammaEncoding = GammaEncoding; exports.Geometry = Geometry; exports.GeometryUtils = GeometryUtils; diff --git a/build/three.min.js b/build/three.min.js index ddbb9c1f9498b9..6cd6c496b227e0 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,608 +1,613 @@ // threejs.org/license -(function(k,va){"object"===typeof exports&&"undefined"!==typeof module?va(exports):"function"===typeof define&&define.amd?define(["exports"],va):(k=k||self,va(k.THREE={}))})(this,function(k){function va(){}function u(a,b){void 0===a&&(a=0);void 0===b&&(b=0);this.x=a;this.y=b}function za(){this.elements=[1,0,0,0,1,0,0,0,1];0h)return!1}return!0}function gb(a,b){this.center=void 0!==a?a:new m;this.radius=void 0!==b?b:-1}function Wa(a,b){this.normal=void 0!==a?a:new m(1,0,0);this.constant=void 0!==b?b:0}function ya(a,b,c){this.a=void 0!==a?a:new m;this.b=void 0!==b?b:new m;this.c=void 0!==c?c:new m}function J(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function fg(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function gg(a){return.04045>a?.0773993808* -a:Math.pow(.9478672986*a+.0521327014,2.4)}function hg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function L(){Object.defineProperty(this,"id",{value:fj++});this.uuid=P.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexColors=this.flatShading=!1;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.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=!1;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.toneMapped=this.visible=!0;this.userData={};this.version= -0}function Qa(a){L.call(this);this.type="MeshBasicMaterial";this.color=new J(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.morphTargets=this.skinning=!1;this.setValues(a)}function K(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.usage=35044;this.updateRange={offset:0,count:-1};this.version=0}function Ed(a,b,c){K.call(this,new Int8Array(a),b,c)}function Fd(a,b,c){K.call(this,new Uint8Array(a),b,c)}function Gd(a,b,c){K.call(this,new Uint8ClampedArray(a),b,c)}function Hd(a,b,c){K.call(this,new Int16Array(a),b,c)}function ac(a,b,c){K.call(this,new Uint16Array(a),b,c)}function Id(a,b,c){K.call(this,new Int32Array(a),b,c)}function bc(a, -b,c){K.call(this,new Uint32Array(a),b,c)}function z(a,b,c){K.call(this,new Float32Array(a),b,c)}function Jd(a,b,c){K.call(this,new Float64Array(a),b,c)}function uh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;cb&&(b=a[c]);return b}function F(){Object.defineProperty(this,"id",{value:gj+=2});this.uuid=P.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere= -this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function ea(a,b){C.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new F;this.material=void 0!==b?b:new Qa;this.updateMorphTargets()}function vh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==b.side,h)))return null;Ke.copy(h);Ke.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ke);return bc.far?null:{distance:b,point:Ke.clone(),object:a}}function Le(a, -b,c,d,e,f,g,h,l,n,q,p){Cb.fromBufferAttribute(e,n);Db.fromBufferAttribute(e,q);Eb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Me.set(0,0,0);Ne.set(0,0,0);Oe.set(0,0,0);for(var A=0,k=f.length;Ag;g++)a.setRenderTarget(c,g),a.clear(b,d,e);a.setRenderTarget(f)}}}function dc(a,b,c){Number.isInteger(b)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),b=c);Ja.call(this,a,a,b)}function ec(a,b,c,d,e,f,g,h,l,n,q,p){aa.call(this,null,f,g,h,l,n,d,e,q,p);this.image={data:a||null,width:b||1,height:c||1};this.magFilter= -void 0!==l?l:1003;this.minFilter=void 0!==n?n:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Mc(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Wa,void 0!==b?b:new Wa,void 0!==c?c:new Wa,void 0!==d?d:new Wa,void 0!==e?e:new Wa,void 0!==f?f:new Wa]}function wh(){function a(c,g){d(c,g);e=b.requestAnimationFrame(a)}var b=null,c=!1,d=null,e=null;return{start:function(){!0!==c&&null!==d&&(e=b.requestAnimationFrame(a),c=!0)},stop:function(){b.cancelAnimationFrame(e); -c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function jj(a,b){function c(b,c){var d=b.array,e=b.usage,f=a.createBuffer();a.bindBuffer(c,f);a.bufferData(c,d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof Uint32Array?c=5125:d instanceof Int32Array?c=5124:d instanceof Int8Array? -c=5120:d instanceof Uint8Array&&(c=5121);return{buffer:f,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var d=b.isWebGL2,e=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return e.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var c=e.get(b);c&&(a.deleteBuffer(c.buffer),e.delete(b))},update:function(b,g){b.isInterleavedBufferAttribute&&(b=b.data);var f=e.get(b);if(void 0===f)e.set(b,c(b,g));else if(f.versione;e++)d[e]=[e,0];return{update:function(e,g,h,l){var f=e.morphTargetInfluences;e=void 0===f?0:f.length;var q=b[g.id];if(void 0===q){q=[];for(var p=0;pf;f++)ff;f++)k=d[f],p=k[0],k=k[1],p!==Number.MAX_SAFE_INTEGER&&k?(e&&g.getAttribute("morphTarget"+f)!==e[p]&&g.setAttribute("morphTarget"+f,e[p]),h&&g.getAttribute("morphNormal"+f)!==h[p]&&g.setAttribute("morphNormal"+f,h[p]),c[f]=k,q+=k):(e&&void 0!==g.getAttribute("morphTarget"+ -f)&&g.deleteAttribute("morphTarget"+f),h&&void 0!==g.getAttribute("morphNormal"+f)&&g.deleteAttribute("morphNormal"+f),c[f]=0);g=g.morphTargetsRelative?1:1-q;l.getUniforms().setValue(a,"morphTargetBaseInfluence",g);l.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function wj(a,b,c,d){var e=new WeakMap;return{update:function(a){var f=d.render.frame,h=a.geometry,l=b.get(a,h);e.get(l)!==f&&(h.isGeometry&&l.updateFromObject(a),b.update(l),e.set(l,f));a.isInstancedMesh&&(c.update(a.instanceMatrix, -34962),null!==a.instanceColor&&c.update(a.instanceColor,34962));return l},dispose:function(){e=new WeakMap}}}function sb(a,b,c,d,e,f,g,h,l,n){a=void 0!==a?a:[];aa.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,n);this.flipY=!1}function Nc(a,b,c,d){aa.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Oc(a,b,c,d){aa.call(this,null);this.image={data:a|| -null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Pc(a,b,c){var d=a[0];if(0>=d||0");return a.replace(ng,mg)}function Mh(a,b,c,d){console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."); -return og(a,b,c,d)}function og(a,b,c,d){a="";for(b=parseInt(b);bd;d++)c.probe.push(new m);var e=new m,f=new R,g=new R;return{setup:function(d,l,n){for(var h=l=0,p=0,k=0;9>k;k++)c.probe[k].set(0,0,0);var r=k=0,t=0,v=0,m=0,B=0,w=0,da=0;n=n.matrixWorldInverse;d.sort(vk);for(var Q=0,M=d.length;Qha;ha++)c.probe[ha].addScaledVector(y.sh.coefficients[ha],u);else if(y.isDirectionalLight){u=a.get(y);u.color.copy(y.color).multiplyScalar(y.intensity);u.direction.setFromMatrixPosition(y.matrixWorld);e.setFromMatrixPosition(y.target.matrixWorld);u.direction.sub(e);u.direction.transformDirection(n);if(y.castShadow){var wa=y.shadow;I=b.get(y);I.shadowBias=wa.bias;I.shadowNormalBias=wa.normalBias;I.shadowRadius=wa.radius; -I.shadowMapSize=wa.mapSize;c.directionalShadow[k]=I;c.directionalShadowMap[k]=ha;c.directionalShadowMatrix[k]=y.shadow.matrix;B++}c.directional[k]=u;k++}else y.isSpotLight?(wa=a.get(y),wa.position.setFromMatrixPosition(y.matrixWorld),wa.position.applyMatrix4(n),wa.color.copy(I).multiplyScalar(u),wa.distance=D,wa.direction.setFromMatrixPosition(y.matrixWorld),e.setFromMatrixPosition(y.target.matrixWorld),wa.direction.sub(e),wa.direction.transformDirection(n),wa.coneCos=Math.cos(y.angle),wa.penumbraCos= -Math.cos(y.angle*(1-y.penumbra)),wa.decay=y.decay,y.castShadow&&(u=y.shadow,I=b.get(y),I.shadowBias=u.bias,I.shadowNormalBias=u.normalBias,I.shadowRadius=u.radius,I.shadowMapSize=u.mapSize,c.spotShadow[t]=I,c.spotShadowMap[t]=ha,c.spotShadowMatrix[t]=y.shadow.matrix,da++),c.spot[t]=wa,t++):y.isRectAreaLight?(ha=a.get(y),ha.color.copy(I).multiplyScalar(u),ha.position.setFromMatrixPosition(y.matrixWorld),ha.position.applyMatrix4(n),g.identity(),f.copy(y.matrixWorld),f.premultiply(n),g.extractRotation(f), -ha.halfWidth.set(.5*y.width,0,0),ha.halfHeight.set(0,.5*y.height,0),ha.halfWidth.applyMatrix4(g),ha.halfHeight.applyMatrix4(g),c.rectArea[v]=ha,v++):y.isPointLight?(u=a.get(y),u.position.setFromMatrixPosition(y.matrixWorld),u.position.applyMatrix4(n),u.color.copy(y.color).multiplyScalar(y.intensity),u.distance=y.distance,u.decay=y.decay,y.castShadow&&(wa=y.shadow,I=b.get(y),I.shadowBias=wa.bias,I.shadowNormalBias=wa.normalBias,I.shadowRadius=wa.radius,I.shadowMapSize=wa.mapSize,I.shadowCameraNear= -wa.camera.near,I.shadowCameraFar=wa.camera.far,c.pointShadow[r]=I,c.pointShadowMap[r]=ha,c.pointShadowMatrix[r]=y.shadow.matrix,w++),c.point[r]=u,r++):y.isHemisphereLight&&(ha=a.get(y),ha.direction.setFromMatrixPosition(y.matrixWorld),ha.direction.transformDirection(n),ha.direction.normalize(),ha.skyColor.copy(y.color).multiplyScalar(u),ha.groundColor.copy(y.groundColor).multiplyScalar(u),c.hemi[m]=ha,m++)}c.ambient[0]=l;c.ambient[1]=h;c.ambient[2]=p;d=c.hash;if(d.directionalLength!==k||d.pointLength!== -r||d.spotLength!==t||d.rectAreaLength!==v||d.hemiLength!==m||d.numDirectionalShadows!==B||d.numPointShadows!==w||d.numSpotShadows!==da)c.directional.length=k,c.spot.length=t,c.rectArea.length=v,c.point.length=r,c.hemi.length=m,c.directionalShadow.length=B,c.directionalShadowMap.length=B,c.pointShadow.length=w,c.pointShadowMap.length=w,c.spotShadow.length=da,c.spotShadowMap.length=da,c.directionalShadowMatrix.length=B,c.pointShadowMatrix.length=w,c.spotShadowMatrix.length=da,d.directionalLength=k, -d.pointLength=r,d.spotLength=t,d.rectAreaLength=v,d.hemiLength=m,d.numDirectionalShadows=B,d.numPointShadows=w,d.numSpotShadows=da,c.version=xk++},state:c}}function Sh(){var a=new wk,b=[],c=[];return{init:function(){b.length=0;c.length=0},state:{lightsArray:b,shadowsArray:c,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)}}}function yk(){var a=new WeakMap;return{get:function(b,c){if(!1===a.has(b)){var d=new Sh;a.set(b,new WeakMap); -a.get(b).set(c,d)}else!1===a.get(b).has(c)?(d=new Sh,a.get(b).set(c,d)):d=a.get(b).get(c);return d},dispose:function(){a=new WeakMap}}}function Hb(a){L.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.fog=!1;this.setValues(a)}function Ib(a){L.call(this);this.type="MeshDistanceMaterial";this.referencePosition= -new m;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.fog=!1;this.setValues(a)}function Th(a,b,c){function d(a,b,c){c=a<<0|b<<1|c<<2;var d=p[c];void 0===d&&(d=new Hb({depthPacking:3201,morphTargets:a,skinning:b}),p[c]=d);return d}function e(a,b,c){c=a<<0|b<<1|c<<2;var d=k[c];void 0===d&&(d=new Ib({morphTargets:a,skinning:b}),k[c]=d);return d}function f(b,c,f,g,h,l,n){var q= -d,p=b.customDepthMaterial;!0===g.isPointLight&&(q=e,p=b.customDistanceMaterial);void 0===p?(p=!1,!0===f.morphTargets&&(p=c.morphAttributes&&c.morphAttributes.position&&0\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}), -x=m.clone();x.defines.HORIZONAL_PASS=1;var B=new F;B.setAttribute("position",new K(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var w=new ea(B,m),da=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==da.enabled&&(!1!==da.autoUpdate||!1!==da.needsUpdate)&&0!==d.length){var p=a.getRenderTarget(),k=a.getActiveCubeFace(),A=a.getActiveMipmapLevel(),r=a.state;r.setBlending(0);r.buffers.color.setClear(1,1,1,1);r.buffers.depth.setTest(!0);r.setScissorTest(!1); -for(var t=0,v=d.length;tc||l.y>c)l.x>c&&(n.x=Math.floor(c/u.x),l.x=n.x*u.x,y.mapSize.x=n.x),l.y>c&&(n.y=Math.floor(c/u.y),l.y=n.y*u.y,y.mapSize.y=n.y);null!==y.map||y.isPointLightShadow||3!==this.type||(u={minFilter:1006,magFilter:1006,format:1023,stencilBuffer:!1},y.map= -new Ja(l.x,l.y,u),y.map.texture.name=B.name+".shadowMap",y.mapPass=new Ja(l.x,l.y,u),y.camera.updateProjectionMatrix());null===y.map&&(y.map=new Ja(l.x,l.y,{minFilter:1003,magFilter:1003,format:1023,stencilBuffer:!1}),y.map.texture.name=B.name+".shadowMap",y.camera.updateProjectionMatrix());a.setRenderTarget(y.map);a.clear();u=y.getViewportCount();for(var M=0;Md||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?P.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===K&&(K=h(b,e)),c=c?h(b,e):K,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ -a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function n(a){return P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function q(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function p(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(c,d,e){if(!1===D)return d;if(null!==c){if(void 0!==a[c])return a[c];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ -c+"'")}c=d;6403===d&&(5126===e&&(c=33326),5131===e&&(c=33325),5121===e&&(c=33321));6407===d&&(5126===e&&(c=34837),5131===e&&(c=34843),5121===e&&(c=32849));6408===d&&(5126===e&&(c=34836),5131===e&&(c=34842),5121===e&&(c=32856));33325!==c&&33326!==c&&34842!==c&&34836!==c||b.get("EXT_color_buffer_float");return c}function r(a){return 1003===a||1004===a||1005===a?9728:9729}function t(b){b=b.target;b.removeEventListener("dispose",t);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture), -d.remove(b));b.isVideoTexture&&J.delete(b);g.memory.textures--}function m(b){b=b.target;b.removeEventListener("dispose",m);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.isWebGLCubeRenderTarget)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), -c.__webglMultisampledFramebuffer&&a.deleteFramebuffer(c.__webglMultisampledFramebuffer),c.__webglColorRenderbuffer&&a.deleteRenderbuffer(c.__webglColorRenderbuffer),c.__webglDepthRenderbuffer&&a.deleteRenderbuffer(c.__webglDepthRenderbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function x(a,b){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;J.get(a)!==f&&(J.set(a,f),a.update())}if(0r;r++)e[r]=h||A?A?b.image[r].image:b.image[r]:l(b.image[r],!1,!0,C);r=e[0];var t=n(r)||D,m=f.convert(b.format),v=f.convert(b.type),x=k(b.internalFormat,m,v);u(34067,b,t);if(h){for(A=0;6>A;A++){var w=e[A].mipmaps;for(h=0;hh;h++)if(A)for(c.texImage2D(34069+h,0,x,e[h].width,e[h].height,0,m,v,e[h].data),y=0;y=ha&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+ha);L+=1;return a};this.resetTextureUnits=function(){L=0};this.setTexture2D=x;this.setTexture2DArray=function(a,b){var e=d.get(a);0A;A++)e.__webglFramebuffer[A]=a.createFramebuffer();else if(e.__webglFramebuffer=a.createFramebuffer(),A)if(D){e.__webglMultisampledFramebuffer=a.createFramebuffer();e.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,e.__webglColorRenderbuffer);A=f.convert(b.texture.format);var t=f.convert(b.texture.type);A=k(b.texture.internalFormat,A,t);t=z(b);a.renderbufferStorageMultisample(36161,t,A,b.width,b.height);a.bindFramebuffer(36160,e.__webglMultisampledFramebuffer); -a.framebufferRenderbuffer(36160,36064,36161,e.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);b.depthBuffer&&(e.__webglDepthRenderbuffer=a.createRenderbuffer(),I(e.__webglDepthRenderbuffer,b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){c.bindTexture(34067,h.__webglTexture);u(34067,b.texture,r);for(h=0;6>h;h++)y(e.__webglFramebuffer[h],b,36064,34069+h);q(b.texture,r)&&p(34067,b.texture,b.width, -b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,h.__webglTexture),u(3553,b.texture,r),y(e.__webglFramebuffer,b,36064,3553),q(b.texture,r)&&p(3553,b.texture,b.width,b.height),c.bindTexture(3553,null);if(b.depthBuffer){e=d.get(b);r=!0===b.isWebGLCubeRenderTarget;if(b.depthTexture){if(r)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,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);x(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,e,0);else if(1027=== -b.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,e,0);else throw Error("Unknown depthTexture format");}else if(r)for(e.__webglDepthbuffer=[],r=0;6>r;r++)a.bindFramebuffer(36160,e.__webglFramebuffer[r]),e.__webglDepthbuffer[r]=a.createRenderbuffer(),I(e.__webglDepthbuffer[r],b,!1);else a.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),I(e.__webglDepthbuffer,b,!1);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture, -e=n(a)||D;if(q(b,e)){e=a.isWebGLCubeRenderTarget?34067:3553;var f=d.get(b).__webglTexture;c.bindTexture(e,f);p(e,b,a.width,a.height);c.bindTexture(e,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(D){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);var e=b.width,f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0,0,e,f,0,0,e,f,g,9728);a.bindFramebuffer(36160, -c.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),O=!0),a=a.texture);x(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLCubeRenderTarget&&(!1===V&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), -V=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?B(a,b):w(a,b)}}function Uh(a,b,c){var d=c.isWebGL2;return{convert:function(a){if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(d)return 5131;var c=b.get("OES_texture_half_float");return null!==c?c.HALF_FLOAT_OES: -null}if(1021===a)return 6406;if(1022===a)return 6407;if(1023===a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(1029===a)return 36244;if(1030===a)return 33319;if(1031===a)return 33320;if(1032===a)return 36248;if(1033===a)return 36249;if(33776===a||33777===a||33778===a||33779===a)if(c=b.get("WEBGL_compressed_texture_s3tc"),null!==c){if(33776===a)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT; -if(33778===a)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(35840===a||35841===a||35842===a||35843===a)if(c=b.get("WEBGL_compressed_texture_pvrtc"),null!==c){if(35840===a)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(36196===a)return c=b.get("WEBGL_compressed_texture_etc1"), -null!==c?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===a||37496===a)if(c=b.get("WEBGL_compressed_texture_etc"),null!==c){if(37492===a)return c.COMPRESSED_RGB8_ETC2;if(37496===a)return c.COMPRESSED_RGBA8_ETC2_EAC}if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a||37840===a||37841===a||37842===a||37843===a||37844===a||37845===a||37846===a||37847===a||37848===a||37849===a||37850===a||37851===a||37852=== -a||37853===a)return c=b.get("WEBGL_compressed_texture_astc"),null!==c?a:null;if(36492===a)return c=b.get("EXT_texture_compression_bptc"),null!==c?a:null;if(1020===a){if(d)return 34042;c=b.get("WEBGL_depth_texture");return null!==c?c.UNSIGNED_INT_24_8_WEBGL:null}}}}function Pe(a){Y.call(this);this.cameras=a||[]}function Kb(){C.call(this);this.type="Group"}function Pd(){this._hand=this._grip=this._targetRay=null}function Vh(a,b){function c(a){var b=t.get(a.inputSource);b&&b.dispatchEvent({type:a.type})} -function d(){t.forEach(function(a,b){a.disconnect(b)});t.clear();a.setFramebuffer(null);a.setRenderTarget(a.getRenderTarget());z.stop();h.isPresenting=!1;h.dispatchEvent({type:"sessionend"})}function e(a){q=a;z.setContext(l);z.start();h.isPresenting=!0;h.dispatchEvent({type:"sessionstart"})}function f(a){for(var b=l.inputSources,c=0;ce.matrixWorld.determinant();a=k(a,b,d,e);qa.setMaterial(d,g);g=c.index;b=c.attributes.position;if(null===g){if(void 0===b||0===b.count)return}else if(0===g.count)return;var h=1;!0===d.wireframe&&(g=ya.getWireframeAttribute(c),h=2);(d.morphTargets||d.morphNormals)&&Ca.update(e,c,d,a);ka.setup(e,d,a,c,g);a=Da;if(null!==g){var l=oa.get(g);a=Ea;a.setIndex(l)}var n=c.drawRange.start*h,q=null!==f?f.start* -h:0;l=Math.max(n,q);f=Math.max(0,Math.min(null!==g?g.count:b.count,n+c.drawRange.count*h,q+(null!==f?f.count*h:Infinity))-1-l+1);0!==f&&(e.isMesh?!0===d.wireframe?(qa.setLineWidth(d.wireframeLinewidth*(null===E?S:1)),a.setMode(1)):a.setMode(4):e.isLine?(d=d.linewidth,void 0===d&&(d=1),qa.setLineWidth(d*(null===E?S:1)),e.isLineSegments?a.setMode(1):e.isLineLoop?a.setMode(2):a.setMode(3)):e.isPoints?a.setMode(0):e.isSprite&&a.setMode(4),e.isInstancedMesh?a.renderInstances(l,f,e.count):c.isInstancedBufferGeometry? -a.renderInstances(l,f,Math.min(c.instanceCount,c._maxInstanceCount)):a.render(l,f))};this.compile=function(a,b){z=xa.get(a,b);z.init();a.traverse(function(a){a.isLight&&(z.pushLight(a),a.castShadow&&z.pushShadow(a))});z.setupLights(b);var c=new WeakMap;a.traverse(function(b){var d=b.material;if(d)if(Array.isArray(d))for(var e=0;ee.far||f.push({distance:a,distanceToRay:Math.sqrt(h),point:c,index:b,face:null,object:g}))}function vg(a,b,c,d,e,f,g,h,l){function n(){q.needsUpdate=!0;a.requestVideoFrameCallback(n)}aa.call(this,a,b,c,d,e,f,g,h,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1;var q=this; -"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n)}function Tc(a,b,c,d,e,f,g,h,l,n,q,p){aa.call(this,null,f,g,h,l,n,d,e,q,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Ud(a,b,c,d,e,f,g,h,l){aa.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Vd(a,b,c,d,e,f,g,h,l,n){n=void 0!==n?n:1026;if(1026!==n&&1027!==n)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===n&&(c=1012); -void 0===c&&1027===n&&(c=1020);aa.call(this,null,d,e,f,g,h,n,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Uc(a){F.call(this);this.type="WireframeGeometry";var b=[],c=[0,0],d={},e=["a","b","c"];if(a&&a.isGeometry){for(var f=a.faces,g=0,h=f.length;gn;n++){var q=l[e[n]],p=l[e[(n+1)%3]];c[0]=Math.min(q,p);c[1]=Math.max(q,p);q=c[0]+","+c[1];void 0===d[q]&&(d[q]={index1:c[0],index2:c[1]})}for(var k in d)c= -d[k],f=a.vertices[c.index1],b.push(f.x,f.y,f.z),f=a.vertices[c.index2],b.push(f.x,f.y,f.z)}else if(a&&a.isBufferGeometry)if(k=new m,null!==a.index){e=a.attributes.position;g=a.index;a=a.groups;0===a.length&&(a=[{start:0,count:g.count,materialIndex:0}]);h=0;for(l=a.length;hp;p++){var r=g.getX(n+p),t=g.getX(n+(p+1)%3);c[0]=Math.min(r,t);c[1]=Math.max(r,t);r=c[0]+","+c[1];void 0===d[r]&&(d[r]={index1:c[0],index2:c[1]})}for(f in d)c=d[f],k.fromBufferAttribute(e, -c.index1),b.push(k.x,k.y,k.z),k.fromBufferAttribute(e,c.index2),b.push(k.x,k.y,k.z)}else for(d=a.attributes.position,c=0,f=d.count/3;ca;a++)k.fromBufferAttribute(d,3*c+a),b.push(k.x,k.y,k.z),k.fromBufferAttribute(d,3*c+(a+1)%3),b.push(k.x,k.y,k.z);this.setAttribute("position",new z(b,3))}function Wd(a,b,c){G.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Vc(a,b,c));this.mergeVertices()}function Vc(a,b,c){F.call(this); -this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new m,l=new m,n=new m,q=new m,k=new m;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var A=b+1,r=0;r<=c;r++)for(var t=r/c,v=0;v<=b;v++){var x=v/b;a(x,t,l);e.push(l.x,l.y,l.z);0<=x-1E-5?(a(x-1E-5,t,n),q.subVectors(l,n)):(a(x+1E-5,t,n),q.subVectors(n,l));0<=t-1E-5?(a(x,t-1E-5,n),k.subVectors(l,n)):(a(x,t+1E-5,n),k.subVectors(n,l)); -h.crossVectors(q,k).normalize();f.push(h.x,h.y,h.z);g.push(x,t)}for(a=0;ad&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}F.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new m,d=new m,g=new m,h=0;he&&(.2>b&&(l[a+0]+=1), -.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position",new z(h,3));this.setAttribute("normal",new z(h.slice(),3));this.setAttribute("uv",new z(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Yd(a,b){G.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Wc(a,b));this.mergeVertices()}function Wc(a,b){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry"; -this.parameters={radius:a,detail:b}}function Zd(a,b){G.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new hc(a,b));this.mergeVertices()}function hc(a,b){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function $d(a,b){G.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Xc(a, -b));this.mergeVertices()}function Xc(a,b){var c=(1+Math.sqrt(5))/2;Ga.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function ae(a,b){G.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Yc(a, -b));this.mergeVertices()}function Yc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Ga.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a, -b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function be(a,b,c,d,e,f){G.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new ic(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function ic(a,b,c,d,e){function f(e){q=a.getPointAt(e/b,q);var f=g.normals[e]; -e=g.binormals[e];for(var n=0;n<=d;n++){var p=n/d*Math.PI*2,r=Math.sin(p);p=-Math.cos(p);l.x=p*f.x+r*e.x;l.y=p*f.y+r*e.y;l.z=p*f.z+r*e.z;l.normalize();A.push(l.x,l.y,l.z);h.x=q.x+c*l.x;h.y=q.y+c*l.y;h.z=q.z+c*l.z;k.push(h.x,h.y,h.z)}}F.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new m, -l=new m,n=new u,q=new m,k=[],A=[],r=[],t=[];(function(){for(var a=0;a=b;e-=d)f=Zh(e,a[e],a[e+1],f);f&&Xe(f,f.next)&&(ee(f),f=f.next); -return f}function Nb(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!Xe(a,a.next)&&0!==la(a.prev,a,a.next))a=a.next;else{ee(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function fe(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=wg(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var n,k,p,A,r=1;do{l=h;var t=h=null;for(k=0;l;){k++;var m=l;for(n=p=0;nr!==t.next.y>r&&t.next.y!==t.y&&p<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(k=!k),t=t.next;while(t!==l);t=k}t=t&&(la(l.prev,l,m.prev)||la(l,m.prev,m))||Xe(l,m)&&0a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,h=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y, -l=wg(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&ad(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=la(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&ad(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=la(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&ad(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=la(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<= -b;){if(d!==a.prev&&d!==a.next&&ad(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=la(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Dk(a,b){return a.x-b.x}function Ek(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x=c.x&& -c.x>=g&&d!==c.x&&ad(eh.x)&&(p=c.x===h.x)){p=h;var m=c;p=0>la(p.prev,p,m.prev)&&0>la(m.next,p,p.next)}p&&(h=c,n=k)}c=c.next}while(c!==b);return h}function wg(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Fk(a){var b= -a,c=a;do{if(b.x=Math.min(a.x,c.x)&&b.y<=Math.max(a.y,c.y)&&b.y>=Math.min(a.y,c.y)}function Ye(a){return 0a?-1:0}function ge(a,b){return 0>la(a.prev,a,a.next)?0<=la(a,b,a.next)&&0<=la(a,a.prev,b):0>la(a,b,a.prev)||0>la(a,a.next,b)}function ai(a,b){var c=new xg(a.i,a.x,a.y),d=new xg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function Zh(a,b,c,d){a=new xg(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev= -a,d.next=a):(a.prev=a,a.next=a);return a}function ee(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function xg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function bi(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(h),n=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/n-h)*g-(c.y+f/n-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new u(f,d);e=Math.sqrt(e/ -2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new u(f/e,d/e)}function h(a,b){for(var c=a.length;0<=--c;){var f=c,g=c-1;0>g&&(g=a.length-1);for(var h=0,l=w+2*C;hk;k++){var p=n[f[k]];var m=n[f[(k+1)%3]];d[0]=Math.min(p,m);d[1]=Math.max(p,m);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[p].face2=h}for(p in e)if(d=e[p],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.setAttribute("position",new z(c,3))}function nc(a, -b,c,d,e,f,g,h){G.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new ub(a,b,c,d,e,f,g,h));this.mergeVertices()}function ub(a,b,c,d,e,f,g,h){function l(c){for(var e=t,f=new u,l=new m,q=0,v=!0===c?a:b,w=!0===c?1:-1,z=1;z<=d;z++)p.push(0,x*w,0),A.push(0,w,0),r.push(.5,.5),t++;z=t;for(var C=0;C<=d;C++){var E=C/d*h+g,F=Math.cos(E);E=Math.sin(E);l.x=v*E;l.y=x*w; -l.z=v*F;p.push(l.x,l.y,l.z);A.push(0,w,0);f.x=.5*F+.5;f.y=.5*E*w+.5;r.push(f.x,f.y);t++}for(f=0;fthis.duration&& -this.resetDuration()}function Hk(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return gd;case "vector":case "vector2":case "vector3":case "vector4":return hd;case "color":return cf;case "quaternion":return pe;case "bool":case "boolean":return bf;case "string":return ef}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function Ik(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=Hk(a.type); -if(void 0===a.times){var c=[],d=[];Z.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function yg(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0,l=[];this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; -this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this};this.addHandler=function(a,b){l.push(a,b);return this};this.removeHandler=function(a){a=l.indexOf(a);-1!==a&&l.splice(a,2);return this};this.getHandler=function(a){for(var b=0,c=l.length;ba;a++)this.coefficients.push(new m)}function Ua(a,b){T.call(this,void 0,b);this.type="LightProbe";this.sh=void 0!==a?a:new rf}function sf(a){W.call(this,a);this.textures={}}function se(){F.call(this);this.type="InstancedBufferGeometry"; -this.instanceCount=Infinity}function tf(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));K.call(this,a,b,c);this.meshPerAttribute=d||1}function uf(a){W.call(this,a)}function vf(a){W.call(this,a)}function Dg(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."); -W.call(this,a);this.options={premultiplyAlpha:"none"}}function Eg(){this.type="ShapePath";this.color=new J;this.subPaths=[];this.currentPath=null}function Fg(a){this.type="Font";this.data=a}function Gg(a){W.call(this,a)}function wf(a){W.call(this,a)}function Hg(a,b,c){Ua.call(this,void 0,c);a=(new J).set(a);c=(new J).set(b);b=new m(a.r,a.g,a.b);a=new m(c.r,c.g,c.b);c=Math.sqrt(Math.PI);var d=c*Math.sqrt(.75);this.sh.coefficients[0].copy(b).add(a).multiplyScalar(c);this.sh.coefficients[1].copy(b).sub(a).multiplyScalar(d)} -function Ig(a,b){Ua.call(this,void 0,b);a=(new J).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function hi(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new Y;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Y;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Jg(){C.call(this);this.type="AudioListener"; -this.context=Kg.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=new ld}function md(a){C.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.loopEnd=this.loopStart=0;this.duration=void 0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl= -!0;this.sourceType="empty";this._progress=this._startedAt=0;this.filters=[]}function Lg(a){md.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function Mg(a,b,c){this.binding=a;this.valueSize=c;switch(b){case "quaternion":a=this._slerp;b=this._slerpAdditive;var d=this._setAdditiveIdentityQuaternion;this.buffer=new Float64Array(6*c);this._workIndex=5;break;case "string":case "bool":b=a=this._select;d=this._setAdditiveIdentityOther; -this.buffer=Array(5*c);break;default:a=this._lerp,b=this._lerpAdditive,d=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*c)}this._mixBufferRegion=a;this._mixBufferRegionAdditive=b;this._setIdentity=d;this._origIndex=3;this._addIndex=4;this.referenceCount=this.useCount=this.cumulativeWeightAdditive=this.cumulativeWeight=0}function ii(a,b,c){c=c||Ca.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function Ca(a,b,c){this.path=b;this.parsedPath=c||Ca.parseTrackName(b); -this.node=Ca.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function ji(){this.uuid=P.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}} -function Ng(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Og(a,b,c){La.call(this,a,b);this.meshPerAttribute=c||1}function Pg(a,b,c,d){this.ray=new ia(a,b);this.near=c||0;this.far=d||Infinity;this.camera=null;this.layers=new fb;this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."); -return this.Points}}})}function ki(a,b){return a.distance-b.distance}function Qg(a,b,c,d){a.layers.test(b.layers)&&a.raycast(b,c);if(!0===d){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1, -Math.cos(f),Math.sin(f),1)}a.setAttribute("position",new z(b,3));b=new ba({fog:!1,toneMapped:!1});this.cone=new ma(a,b);this.add(this.cone);this.update()}function mi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", -blending:0,depthTest:!1,depthWrite:!1})}function pi(){return new vb({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ob[3E3]},outputEncoding:{value:ob[3E3]}},vertexShader:Ug(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t"+Vg()+"\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", -blending:0,depthTest:!1,depthWrite:!1})}function Ug(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"} -function Vg(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"} -function qi(a){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");sa.call(this,a);this.type="catmullrom";this.closed=!0}function ri(a){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");sa.call(this,a);this.type="catmullrom"}function Wg(a){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.");sa.call(this,a);this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2, --52));void 0===Number.isInteger&&(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0ze;ze++)Aa[ze]=(16>ze?"0":"")+ze.toString(16);var Bf=1234567,P={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var a=4294967295*Math.random()|0,b=4294967295*Math.random()|0,c=4294967295* -Math.random()|0,d=4294967295*Math.random()|0;return(Aa[a&255]+Aa[a>>8&255]+Aa[a>>16&255]+Aa[a>>24&255]+"-"+Aa[b&255]+Aa[b>>8&255]+"-"+Aa[b>>16&15|64]+Aa[b>>24&255]+"-"+Aa[c&63|128]+Aa[c>>8&255]+"-"+Aa[c>>16&255]+Aa[c>>24&255]+Aa[d&255]+Aa[d>>8&255]+Aa[d>>16&255]+Aa[d>>24&255]).toUpperCase()},clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a, -b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},seededRandom:function(a){void 0!==a&&(Bf=a%2147483647);Bf=16807*Bf%2147483647;return(Bf-1)/2147483646},degToRad:function(a){return a*P.DEG2RAD}, -radToDeg:function(a){return a*P.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))},setQuaternionFromProperEuler:function(a,b,c,d,e){var f=Math.cos,g=Math.sin,h=f(c/2);c=g(c/2);var l=f((b+d)/2),n=g((b+d)/2),k=f((b-d)/2),p=g((b-d)/2);f=f((d-b)/2);b=g((d-b)/2);switch(e){case "XYX":a.set(h*n,c*k,c*p,h*l);break;case "YZY":a.set(c*p,h* -n,c*k,h*l);break;case "ZXZ":a.set(c*k,c*p,h*n,h*l);break;case "XZX":a.set(h*n,c*b,c*f,h*l);break;case "YXY":a.set(c*f,h*n,c*b,h*l);break;case "ZYZ":a.set(c*b,c*f,h*n,h*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+e)}}};Object.defineProperties(u.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(u.prototype,{isVector2:!0,set:function(a, -b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x= -a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), -this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y= -a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));return this},clampScalar:function(a,b){this.x=Math.max(a,Math.min(b,this.x));this.y=Math.max(a,Math.min(b,this.y));return this},clampLength:function(a,b){var c=this.length();return this.divideScalar(c|| -1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x* -a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y- -a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){this.x=a.x+(b.x-a.x)*c;this.y=a.y+(b.y-a.y)*c;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&& -(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this},random:function(){this.x=Math.random();this.y=Math.random();return this}});Object.assign(za.prototype,{isMatrix3:!0,set:function(a, -b,c,d,e,f,g,h,l){var n=this.elements;n[0]=a;n[1]=d;n[2]=g;n[3]=b;n[4]=e;n[5]=h;n[6]=c;n[7]=f;n[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},extractBasis:function(a,b,c){a.setFromMatrix3Column(this,0);b.setFromMatrix3Column(this,1);c.setFromMatrix3Column(this, -2);return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},multiply:function(a){return this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[3],f=c[6],g=c[1],h=c[4],l=c[7],n=c[2],k=c[5];c=c[8];var p=d[0],m=d[3],r=d[6],t=d[1],v=d[4],x=d[7],u=d[2],w=d[5];d=d[8];b[0]=a*p+e*t+f*u;b[3]=a*m+e*v+f*w;b[6]=a*r+e* -x+f*d;b[1]=g*p+h*t+l*u;b[4]=g*m+h*v+l*w;b[7]=g*r+h*x+l*d;b[2]=n*p+k*t+c*u;b[5]=n*m+k*v+c*w;b[8]=n*r+k*x+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],l=a[7];a=a[8];return b*f*a-b*g*l-c*e*a+c*g*h+d*e*l-d*f*h},getInverse:function(a,b){void 0!==b&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate."); -var c=a.elements;a=this.elements;b=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],n=c[7];c=c[8];var k=c*g-h*n,p=h*l-c*f,m=n*f-g*l,r=b*k+d*p+e*m;if(0===r)return this.set(0,0,0,0,0,0,0,0,0);r=1/r;a[0]=k*r;a[1]=(e*n-c*d)*r;a[2]=(h*d-e*g)*r;a[3]=p*r;a[4]=(c*b-e*l)*r;a[5]=(e*f-h*b)*r;a[6]=m*r;a[7]=(d*l-n*b)*r;a[8]=(g*b-d*f)*r;return this},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[3];a[3]=b;b=a[2];a[2]=a[6];a[6]=b;b=a[5];a[5]=a[7];a[7]=b;return this},getNormalMatrix:function(a){return this.setFromMatrix4(a).getInverse(this).transpose()}, -transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},setUvTransform:function(a,b,c,d,e,f,g){var h=Math.cos(e);e=Math.sin(e);this.set(c*h,c*e,-c*(h*f+e*g)+f+a,-d*e,d*h,-d*(-e*f+h*g)+g+b,0,0,1)},scale:function(a,b){var c=this.elements;c[0]*=a;c[3]*=a;c[6]*=a;c[1]*=b;c[4]*=b;c[7]*=b;return this},rotate:function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.elements,d=c[0],e=c[3],f=c[6],g=c[1],h=c[4], -l=c[7];c[0]=b*d+a*g;c[3]=b*e+a*h;c[6]=b*f+a*l;c[1]=-a*d+b*g;c[4]=-a*e+b*h;c[7]=-a*f+b*l;return this},translate:function(a,b){var c=this.elements;c[0]+=a*c[2];c[3]+=a*c[5];c[6]+=a*c[8];c[1]+=b*c[2];c[4]+=b*c[5];c[7]+=b*c[8];return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;9>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c= -this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var rd,Tb={getDataURL:function(a){if(/^data:/i.test(a.src)||"undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===rd&&(rd=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));rd.width=a.width;rd.height=a.height;var b=rd.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height); -a=rd}return 2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)- -a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(aa.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.defineProperties(fa.prototype,{width:{get:function(){return this.z},set:function(a){this.z=a}},height:{get:function(){return this.w},set:function(a){this.w=a}}});Object.assign(fa.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x= -a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x, -this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this}, -addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*= -a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/ -b);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var n=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+n-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;n=(n+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>n?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>n?.01>f?(l=.707106781,h=0,c=.707106781): -(h=Math.sqrt(f),l=c/h,c=g/h):.01>n?(h=l=.707106781,c=0):(c=Math.sqrt(n),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a;this.w=Math.acos((b+f+n-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z, -a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w,this.w));return this},clampScalar:function(a,b){this.x=Math.max(a,Math.min(b,this.x));this.y=Math.max(a,Math.min(b,this.y));this.z=Math.max(a,Math.min(b,this.z));this.w=Math.max(a,Math.min(b,this.w));return this},clampLength:function(a,b){var c=this.length();return this.divideScalar(c|| -1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x); -this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}, -manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){this.x=a.x+(b.x-a.x)*c;this.y=a.y+(b.y-a.y)*c;this.z=a.z+(b.z-a.z)*c;this.w=a.w+(b.w-a.w)*c;return this},equals:function(a){return a.x=== -this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this},random:function(){this.x= -Math.random();this.y=Math.random();this.z=Math.random();this.w=Math.random();return this}});Ja.prototype=Object.assign(Object.create(va.prototype),{constructor:Ja,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.texture.image.width=a,this.texture.image.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height; -this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});dg.prototype=Object.assign(Object.create(Ja.prototype),{constructor:dg,isWebGLMultisampleRenderTarget:!0,copy:function(a){Ja.prototype.copy.call(this,a);this.samples=a.samples;return this}});Object.assign(oa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a, -b,c,d,e,f,g){var h=c[d+0],l=c[d+1],n=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],p=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||n!==p){f=1-g;var m=h*d+l*k+n*p+c*e,r=0<=m?1:-1,t=1-m*m;t>Number.EPSILON&&(t=Math.sqrt(t),m=Math.atan2(t,m*r),f=Math.sin(f*m)/t,g=Math.sin(g*m)/t);r*=g;h=h*f+d*r;l=l*f+k*r;n=n*f+p*r;c=c*f+e*r;f===1-g&&(g=1/Math.sqrt(h*h+l*l+n*n+c*c),h*=g,l*=g,n*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=n;a[b+3]=c},multiplyQuaternionsFlat:function(a,b,c,d,e,f){var g=c[d],h=c[d+1],l=c[d+2];c=c[d+3];d=e[f];var n= -e[f+1],k=e[f+2];e=e[f+3];a[b]=g*e+c*d+h*k-l*n;a[b+1]=h*e+c*n+l*d-g*k;a[b+2]=l*e+c*k+g*n-h*d;a[b+3]=c*e-g*d-h*n-l*k;return a}});Object.defineProperties(oa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this._onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this._onChangeCallback()}}}); -Object.assign(oa.prototype,{isQuaternion:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this._onChangeCallback();return this},setFromEuler:function(a,b){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y, -e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);switch(a){case "XYZ":this._x=c*l*f+h*d*e;this._y=h*d*f-c*l*e;this._z=h*l*e+c*d*f;this._w=h*l*f-c*d*e;break;case "YXZ":this._x=c*l*f+h*d*e;this._y=h*d*f-c*l*e;this._z=h*l*e-c*d*f;this._w=h*l*f+c*d*e;break;case "ZXY":this._x=c*l*f-h*d*e;this._y=h*d*f+c*l*e;this._z=h*l*e+c*d*f;this._w=h*l*f-c*d*e;break;case "ZYX":this._x=c*l*f-h*d*e;this._y=h*d*f+c*l*e;this._z=h*l*e-c*d*f;this._w=h*l*f+c*d*e;break;case "YZX":this._x= -c*l*f+h*d*e;this._y=h*d*f+c*l*e;this._z=h*l*e-c*d*f;this._w=h*l*f-c*d*e;break;case "XZY":this._x=c*l*f-h*d*e;this._y=h*d*f-c*l*e;this._z=h*l*e+c*d*f;this._w=h*l*f+c*d*e;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}!1!==b&&this._onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this._onChangeCallback();return this},setFromRotationMatrix:function(a){var b= -a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var n=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this._onChangeCallback();return this},setFromUnitVectors:function(a, -b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(P.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},identity:function(){return this.set(0,0,0,1)},inverse:function(){return this.conjugate()}, -conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a); -this._onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w= -a*b-c*f-d*g-e*h;this._onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize(),this._onChangeCallback(), -this;a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this._onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x; -a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},fromBufferAttribute:function(a,b){this._x=a.getX(b);this._y=a.getY(b);this._z=a.getZ(b);this._w=a.getW(b);return this},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});var Xg=new m,si=new oa;Object.assign(m.prototype,{isVector3:!0,set:function(a,b,c){void 0===c&&(c=this.z);this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this}, -setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y; -this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), -this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*= -a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(a){a&&a.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(si.setFromEuler(a))},applyAxisAngle:function(a,b){return this.applyQuaternion(si.setFromAxisAngle(a,b))},applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]* -d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyNormalMatrix:function(a){return this.applyMatrix3(a).normalize()},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,l=a*c+g*b-e*d,n=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h* -a+b*-e+l*-g-n*-f;this.y=l*a+b*-f+n*-e-h*-g;this.z=n*a+b*-g+h*-f-l*-e;return this},project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x; -this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(a, -b){this.x=Math.max(a,Math.min(b,this.x));this.y=Math.max(a,Math.min(b,this.y));this.z=Math.max(a,Math.min(b,this.z));return this},clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x); -this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){this.x=a.x+(b.x-a.x)*c;this.y=a.y+(b.y-a.y)*c;this.z=a.z+(b.z-a.z)*c;return this},cross:function(a,b){return void 0!==b? -(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.lengthSq();if(0===b)return this.set(0,0,0);b=a.dot(this)/b;return this.copy(a).multiplyScalar(b)},projectOnPlane:function(a){Xg.copy(this).projectOnVector(a);return this.sub(Xg)}, -reflect:function(a){return this.sub(Xg.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){var b=Math.sqrt(this.lengthSq()*a.lengthSq());if(0===b)return Math.PI/2;a=this.dot(a)/b;return Math.acos(P.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius, -a.phi,a.theta)},setFromSphericalCoords:function(a,b,c){var d=Math.sin(b)*a;this.x=d*Math.sin(c);this.y=Math.cos(b)*a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)},setFromCylindricalCoords:function(a,b,c){this.x=a*Math.sin(b);this.y=c;this.z=a*Math.cos(b);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a, -0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},setFromMatrix3Column:function(a,b){return this.fromArray(a.elements,3*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0); -a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this},random:function(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this}});var sd=new m,X=new R,Jk=new m(0,0,0),Kk=new m(1,1,1),Ub=new m,Cf=new m,ta=new m;Object.assign(R.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,n,k,p,m, -r,t,v){var q=this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=g;q[13]=h;q[2]=l;q[6]=n;q[10]=k;q[14]=p;q[3]=m;q[7]=r;q[11]=t;q[15]=v;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new R).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]= -a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(a){var b=this.elements,c=a.elements,d=1/sd.setFromMatrixColumn(a,0).length(),e=1/sd.setFromMatrixColumn(a,1).length();a= -1/sd.setFromMatrixColumn(a,2).length();b[0]=c[0]*d;b[1]=c[1]*d;b[2]=c[2]*d;b[3]=0;b[4]=c[4]*e;b[5]=c[5]*e;b[6]=c[6]*e;b[7]=0;b[8]=c[8]*a;b[9]=c[9]*a;b[10]=c[10]*a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var h=Math.cos(e);e= -Math.sin(e);if("XYZ"===a.order){a=f*h;var l=f*e,n=c*h,k=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+n*d;b[5]=a-k*d;b[9]=-c*g;b[2]=k-a*d;b[6]=n+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,l=g*e,n=d*h,k=d*e,b[0]=a+k*c,b[4]=n*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-n,b[6]=k+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,l=g*e,n=d*h,k=d*e,b[0]=a-k*c,b[4]=-f*e,b[8]=n+l*c,b[1]=l+n*c,b[5]=f*h,b[9]=k-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,l=f*e,n=c*h,k=c*e,b[0]=g*h,b[4]=n*d-l,b[8]=a*d+k,b[1]=g*e,b[5]= -k*d+a,b[9]=l*d-n,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,n=c*g,k=c*d,b[0]=g*h,b[4]=k-a*e,b[8]=n*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+n,b[10]=a-k*e):"XZY"===a.order&&(a=f*g,l=f*d,n=c*g,k=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+k,b[5]=f*h,b[9]=l*e-n,b[2]=n*e-l,b[6]=c*h,b[10]=k*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){return this.compose(Jk,a,Kk)},lookAt:function(a,b,c){var d=this.elements;ta.subVectors(a, -b);0===ta.lengthSq()&&(ta.z=1);ta.normalize();Ub.crossVectors(c,ta);0===Ub.lengthSq()&&(1===Math.abs(c.z)?ta.x+=1E-4:ta.z+=1E-4,ta.normalize(),Ub.crossVectors(c,ta));Ub.normalize();Cf.crossVectors(ta,Ub);d[0]=Ub.x;d[4]=Cf.x;d[8]=ta.x;d[1]=Ub.y;d[5]=Cf.y;d[9]=ta.y;d[2]=Ub.z;d[6]=Cf.z;d[10]=ta.z;return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this, -a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],l=c[5],k=c[9],q=c[13],p=c[2],m=c[6],r=c[10],t=c[14],v=c[3],x=c[7],u=c[11];c=c[15];var w=d[0],z=d[4],C=d[8],M=d[12],y=d[1],I=d[5],E=d[9],D=d[13],F=d[2],G=d[6],H=d[10],J=d[14],K=d[3],L=d[7],O=d[11];d=d[15];b[0]=a*w+e*y+f*F+g*K;b[4]=a*z+e*I+f*G+g*L;b[8]=a*C+e*E+f*H+g*O;b[12]=a*M+e*D+f*J+g*d;b[1]=h*w+l*y+k*F+q*K;b[5]=h*z+ -l*I+k*G+q*L;b[9]=h*C+l*E+k*H+q*O;b[13]=h*M+l*D+k*J+q*d;b[2]=p*w+m*y+r*F+t*K;b[6]=p*z+m*I+r*G+t*L;b[10]=p*C+m*E+r*H+t*O;b[14]=p*M+m*D+r*J+t*d;b[3]=v*w+x*y+u*F+c*K;b[7]=v*z+x*I+u*G+c*L;b[11]=v*C+x*E+u*H+c*O;b[15]=v*M+x*D+u*J+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12], -f=a[1],g=a[5],h=a[9],l=a[13],k=a[2],q=a[6],p=a[10],m=a[14];return a[3]*(+e*h*q-d*l*q-e*g*p+c*l*p+d*g*m-c*h*m)+a[7]*(+b*h*m-b*l*p+e*f*p-d*f*m+d*l*k-e*h*k)+a[11]*(+b*l*q-b*g*m-e*f*q+c*f*m+e*g*k-c*l*k)+a[15]*(-d*g*k-b*h*q+b*g*p+d*f*q-c*f*p+c*h*k)},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},setPosition:function(a,b,c){var d=this.elements; -a.isVector3?(d[12]=a.x,d[13]=a.y,d[14]=a.z):(d[12]=a,d[13]=b,d[14]=c);return this},getInverse:function(a,b){void 0!==b&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");b=this.elements;var c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],q=c[8],p=c[9],m=c[10],r=c[11],t=c[12],v=c[13],x=c[14];c=c[15];var u=p*x*k-v*m*k+v*l*r-h*x*r-p*l*c+h*m*c,w=t*m*k-q*x*k-t*l*r+g*x*r+q*l*c-g*m*c,z=q*v*k-t*p*k+t*h*r-g*v*r-q*h*c+g*p*c,C=t*p*l-q*v* -l-t*h*m+g*v*m+q*h*x-g*p*x,M=a*u+d*w+e*z+f*C;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);M=1/M;b[0]=u*M;b[1]=(v*m*f-p*x*f-v*e*r+d*x*r+p*e*c-d*m*c)*M;b[2]=(h*x*f-v*l*f+v*e*k-d*x*k-h*e*c+d*l*c)*M;b[3]=(p*l*f-h*m*f-p*e*k+d*m*k+h*e*r-d*l*r)*M;b[4]=w*M;b[5]=(q*x*f-t*m*f+t*e*r-a*x*r-q*e*c+a*m*c)*M;b[6]=(t*l*f-g*x*f-t*e*k+a*x*k+g*e*c-a*l*c)*M;b[7]=(g*m*f-q*l*f+q*e*k-a*m*k-g*e*r+a*l*r)*M;b[8]=z*M;b[9]=(t*p*f-q*v*f-t*d*r+a*v*r+q*d*c-a*p*c)*M;b[10]=(g*v*f-t*h*f+t*d*k-a*v*k-g*d*c+a*h*c)*M;b[11]= -(q*h*f-g*p*f-q*d*k+a*p*k+g*d*r-a*h*r)*M;b[12]=C*M;b[13]=(q*v*e-t*p*e+t*d*m-a*v*m-q*d*x+a*p*x)*M;b[14]=(t*h*e-g*v*e-t*d*l+a*v*l+g*d*x-a*h*x)*M;b[15]=(g*p*e-q*h*e+q*d*l-a*p*l-g*d*m+a*h*m)*M;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6], -a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c= -Math.cos(b);b=Math.sin(b);var d=1-c,e=a.x,f=a.y;a=a.z;var g=d*e,h=d*f;this.set(g*e+c,g*f-b*a,g*a+b*f,0,g*f+b*a,h*f+c,h*a-b*e,0,g*a-b*f,h*a+b*e,d*a*a+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeShear:function(a,b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,l=e+e,k=f+f,q=g+g;b=e*l;var p=e*k;e*=q;var m=f*k;f*=q;g*=q;l*=h;k*=h;h*=q;q=c.x;var r=c.y;c= -c.z;d[0]=(1-(m+g))*q;d[1]=(p+h)*q;d[2]=(e-k)*q;d[3]=0;d[4]=(p-h)*r;d[5]=(1-(b+g))*r;d[6]=(f+l)*r;d[7]=0;d[8]=(e+k)*c;d[9]=(f-l)*c;d[10]=(1-(b+m))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(a,b,c){var d=this.elements,e=sd.set(d[0],d[1],d[2]).length(),f=sd.set(d[4],d[5],d[6]).length(),g=sd.set(d[8],d[9],d[10]).length();0>this.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];X.copy(this);a=1/e;d=1/f;var h=1/g;X.elements[0]*=a;X.elements[1]*=a;X.elements[2]*=a; -X.elements[4]*=d;X.elements[5]*=d;X.elements[6]*=d;X.elements[8]*=h;X.elements[9]*=h;X.elements[10]*=h;b.setFromRotationMatrix(X);c.x=e;c.y=f;c.z=g;return this},makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0; -g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),l=1/(c-d),k=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*k;g[14]=-((f+e)*k);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a, -b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var ti=new R,ui=new oa;Zb.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");Zb.DefaultOrder="XYZ";Object.defineProperties(Zb.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y}, -set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this._onChangeCallback()}},order:{get:function(){return this._order},set:function(a){this._order=a;this._onChangeCallback()}}});Object.assign(Zb.prototype,{isEuler:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x= -a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=P.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],l=e[5],k=e[9],q=e[2],p=e[6];e=e[10];b=b||this._order;switch(b){case "XYZ":this._y=Math.asin(d(g,-1,1));.9999999>Math.abs(g)?(this._x=Math.atan2(-k,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,l),this._z=0);break;case "YXZ":this._x=Math.asin(-d(k,-1,1));.9999999>Math.abs(k)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h, -l)):(this._y=Math.atan2(-q,a),this._z=0);break;case "ZXY":this._x=Math.asin(d(p,-1,1));.9999999>Math.abs(p)?(this._y=Math.atan2(-q,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(h,a));break;case "ZYX":this._y=Math.asin(-d(q,-1,1));.9999999>Math.abs(q)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,l));break;case "YZX":this._z=Math.asin(d(h,-1,1));.9999999>Math.abs(h)?(this._x=Math.atan2(-k,l),this._y=Math.atan2(-q,a)):(this._x=0,this._y=Math.atan2(g, -e));break;case "XZY":this._z=Math.asin(-d(f,-1,1));.9999999>Math.abs(f)?(this._x=Math.atan2(p,l),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-k,e),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+b)}this._order=b;!1!==c&&this._onChangeCallback();return this},setFromQuaternion:function(a,b,c){ti.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(ti,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)}, -reorder:function(a){ui.setFromEuler(this);return this.setFromQuaternion(ui,a)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z): -new m(this._x,this._y,this._z)},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});var fb=function(){this.mask=1};fb.prototype.set=function(a){this.mask=1<e&&(e=k);q>f&&(f=q);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;he&&(e=k);q>f&&(f=q);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g);return this}, -setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box3: .getParameter() target is now required"),b=new m);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y- -this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(a){this.clampPoint(a.center,Be);return Be.distanceToSquared(a.center)<=a.radius*a.radius},intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(a){if(this.isEmpty())return!1;this.getCenter(Ce);Ef.subVectors(this.max,Ce);ud.subVectors(a.a,Ce);vd.subVectors(a.b,Ce);wd.subVectors(a.c,Ce);Vb.subVectors(vd,ud);Wb.subVectors(wd,vd);vc.subVectors(ud,wd);a=[0,-Vb.z,Vb.y, -0,-Wb.z,Wb.y,0,-vc.z,vc.y,Vb.z,0,-Vb.x,Wb.z,0,-Wb.x,vc.z,0,-vc.x,-Vb.y,Vb.x,0,-Wb.y,Wb.x,0,-vc.y,vc.x,0];if(!eg(a,ud,vd,wd,Ef))return!1;a=[1,0,0,0,1,0,0,0,1];if(!eg(a,ud,vd,wd,Ef))return!1;Ff.crossVectors(Vb,Wb);a=[Ff.x,Ff.y,Ff.z];return eg(a,ud,vd,wd,Ef)},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new m);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return Be.copy(a).clamp(this.min,this.max).sub(a).length()},getBoundingSphere:function(a){void 0=== -a&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(a.center);a.radius=.5*this.getSize(Be).length();return a},intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){if(this.isEmpty())return this;yb[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a);yb[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a); -yb[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a);yb[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a);yb[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a);yb[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a);yb[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a);yb[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a);this.setFromPoints(yb);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& -a.max.equals(this.max)}});var Pk=new Va;Object.assign(gb.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a,b){var c=this.center;void 0!==b?c.copy(b):Pk.setFromPoints(a).getCenter(c);for(var d=b=0,e=a.length;d -this.radius},makeEmpty:function(){this.center.set(0,0,0);this.radius=-1;return this},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius}, -clampPoint:function(a,b){var c=this.center.distanceToSquared(a);void 0===b&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),b=new m);b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new Va);if(this.isEmpty())return a.makeEmpty(),a;a.set(this.center,this.center);a.expandByScalar(this.radius); -return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});var zb=new m,Zg=new m,Gf=new m,Xb=new m,$g=new m,Hf=new m,ah=new m,ia=function(a,b){this.origin=void 0!==a?a:new m;this.direction=void 0!==b?b:new m(0,0,-1)};ia.prototype.set=function(a,b){this.origin.copy(a);this.direction.copy(b);return this};ia.prototype.clone= -function(){return(new this.constructor).copy(this)};ia.prototype.copy=function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this};ia.prototype.at=function(a,b){void 0===b&&(console.warn("THREE.Ray: .at() target is now required"),b=new m);return b.copy(this.direction).multiplyScalar(a).add(this.origin)};ia.prototype.lookAt=function(a){this.direction.copy(a).sub(this.origin).normalize();return this};ia.prototype.recast=function(a){this.origin.copy(this.at(a,zb));return this}; -ia.prototype.closestPointToPoint=function(a,b){void 0===b&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),b=new m);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)};ia.prototype.distanceToPoint=function(a){return Math.sqrt(this.distanceSqToPoint(a))};ia.prototype.distanceSqToPoint=function(a){var b=zb.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a); -zb.copy(this.direction).multiplyScalar(b).add(this.origin);return zb.distanceToSquared(a)};ia.prototype.distanceSqToSegment=function(a,b,c,d){Zg.copy(a).add(b).multiplyScalar(.5);Gf.copy(b).sub(a).normalize();Xb.copy(this.origin).sub(Zg);var e=.5*a.distanceTo(b),f=-this.direction.dot(Gf),g=Xb.dot(this.direction),h=-Xb.dot(Gf),l=Xb.lengthSq(),k=Math.abs(1-f*f);if(0=-q?b<=q?(e=1/k,a*=e,b*=e,f=a*(a+f*b+2*g)+b*(f*a+b+2*h)+l):(b=e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+ -2*h)+l):(b=-e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+2*h)+l):b<=-q?(a=Math.max(0,-(-f*e+g)),b=0a)return null;a=Math.sqrt(a-d);d=c-a;c+=a;return 0>d&&0>c?null:0>d?this.at(c,b):this.at(d,b)};ia.prototype.intersectsSphere=function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius};ia.prototype.distanceToPlane=function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null};ia.prototype.intersectPlane= -function(a,b){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)};ia.prototype.intersectsPlane=function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1};ia.prototype.intersectBox=function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y; -if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)};ia.prototype.intersectsBox=function(a){return null!==this.intersectBox(a,zb)};ia.prototype.intersectTriangle=function(a,b,c,d,e){$g.subVectors(b,a);Hf.subVectors(c,a);ah.crossVectors($g,Hf);b=this.direction.dot(ah);if(0b)d=-1,b= --b;else return null;Xb.subVectors(this.origin,a);a=d*this.direction.dot(Hf.crossVectors(Xb,Hf));if(0>a)return null;c=d*this.direction.dot($g.cross(Xb));if(0>c||a+c>b)return null;a=-d*Xb.dot(ah);return 0>a?null:this.at(a/b,e)};ia.prototype.applyMatrix4=function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this};ia.prototype.equals=function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)};var bh=new m,Qk=new m,Rk=new za;Object.assign(Wa.prototype, -{isPlane:!0,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(a,b,c){b=bh.subVectors(c,b).cross(Qk.subVectors(a,b)).normalize();this.setFromNormalAndCoplanarPoint(b,a);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal); -this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0===b&&(console.warn("THREE.Plane: .projectPoint() target is now required"),b=new m);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)}, -intersectLine:function(a,b){void 0===b&&(console.warn("THREE.Plane: .intersectLine() target is now required"),b=new m);var c=a.delta(bh),d=this.normal.dot(c);if(0===d){if(0===this.distanceToPoint(a.start))return b.copy(a.start)}else if(d=-(a.start.dot(this.normal)+this.constant)/d,!(0>d||1b&&0a&&0=Bb.x+Bb.y},getUV:function(a,b,c,d,e,f,g,h){this.getBarycoord(a,b,c,d,Bb);h.set(0,0);h.addScaledVector(e,Bb.x);h.addScaledVector(f,Bb.y);h.addScaledVector(g,Bb.z);return h},isFrontFacing:function(a, -b,c,d){db.subVectors(c,b);Ab.subVectors(a,b);return 0>db.cross(Ab).dot(d)?!0:!1}});Object.assign(ya.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){db.subVectors(this.c,this.b);Ab.subVectors(this.a, -this.b);return.5*db.cross(Ab).length()},getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new m);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ya.getNormal(this.a,this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new Wa);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ya.getBarycoord(a, -this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return ya.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return ya.containsPoint(a,this.a,this.b,this.c)},isFrontFacing:function(a){return ya.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),b=new m);var c=this.a,d=this.b,e=this.c;xd.subVectors(d,c);yd.subVectors(e, -c);dh.subVectors(a,c);var f=xd.dot(dh),g=yd.dot(dh);if(0>=f&&0>=g)return b.copy(c);eh.subVectors(a,d);var h=xd.dot(eh),l=yd.dot(eh);if(0<=h&&l<=h)return b.copy(d);var k=f*l-h*g;if(0>=k&&0<=f&&0>=h)return d=f/(f-h),b.copy(c).addScaledVector(xd,d);fh.subVectors(a,e);a=xd.dot(fh);var q=yd.dot(fh);if(0<=q&&a<=q)return b.copy(e);f=a*g-f*q;if(0>=f&&0<=g&&0>=q)return k=g/(g-q),b.copy(c).addScaledVector(yd,k);g=h*q-a*l;if(0>=g&&0<=l-h&&0<=a-q)return zi.subVectors(e,d),k=(l-h)/(l-h+(a-q)),b.copy(d).addScaledVector(zi, -k);e=1/(g+f+k);d=f*e;k*=e;return b.copy(c).addScaledVector(xd,d).addScaledVector(yd,k)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});var Ai={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388, -crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146, -floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323, -lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273, -moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638, -sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ba={h:0,s:0,l:0},If={h:0,s:0,l:0};Object.assign(J.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"=== -typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){a=P.euclideanModulo(a,1);b=P.clamp(b,0,1);c=P.clamp(c,0,1);0===b?this.r=this.g=this.b=c:(b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=fg(c,b,a+1/3),this.g=fg(c,b,a),this.b=fg(c,b,a-1/3));return this},setStyle:function(a){function b(b){void 0!== -b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r= -Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){d=parseFloat(c[1])/360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+ -c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return a&&0=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-d)/l+(cthis.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;d.stencilWrite=this.stencilWrite;d.stencilWriteMask=this.stencilWriteMask;d.stencilFunc=this.stencilFunc;d.stencilRef=this.stencilRef;d.stencilFuncMask= -this.stencilFuncMask;d.stencilFail=this.stencilFail;d.stencilZFail=this.stencilZFail;d.stencilZPass=this.stencilZPass;this.rotation&&0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(d.polygonOffsetUnits=this.polygonOffsetUnits);this.linewidth&&1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!== -this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0g;g++)if(f[g]===f[(g+1)%3]){a.push(d);break}for(c=a.length-1;0<=c;c--)for(d=a[c],this.faces.splice(d,1),e=0,f=this.faceVertexUvs.length;e\n\t\t\t\t#include \n\n\t\t\t}\n\t\t", -fragmentShader:"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",side:1,blending:0});d.uniforms.tEquirect.value=b;b=new ea(new Fb(5,5,5),d);c.add(b);(new Lc(1,10,this)).update(a,c);b.geometry.dispose();b.material.dispose();return this}; -ec.prototype=Object.create(aa.prototype);ec.prototype.constructor=ec;ec.prototype.isDataTexture=!0;var Ad=new gb,Lf=new m;Object.assign(Mc.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromProjectionMatrix:function(a){var b=this.planes,c=a.elements;a=c[0]; -var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],q=c[8],p=c[9],m=c[10],r=c[11],t=c[12],v=c[13],x=c[14];c=c[15];b[0].setComponents(f-a,k-g,r-q,c-t).normalize();b[1].setComponents(f+a,k+g,r+q,c+t).normalize();b[2].setComponents(f+d,k+h,r+p,c+v).normalize();b[3].setComponents(f-d,k-h,r-p,c-v).normalize();b[4].setComponents(f-e,k-l,r-m,c-x).normalize();b[5].setComponents(f+e,k+l,r+m,c+x).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere(); -Ad.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(Ad)},intersectsSprite:function(a){Ad.center.set(0,0,0);Ad.radius=.7071067811865476;Ad.applyMatrix4(a.matrixWorld);return this.intersectsSphere(Ad)},intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)c;c++){var d=b[c];Lf.x=0d.distanceToPoint(Lf))return!1}return!0},containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var H={common:{diffuse:{value:new J(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new za},uv2Transform:{value:new za},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}}, -aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new u(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4}, -fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new J(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[], -properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[], -properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new J(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new za}},sprite:{diffuse:{value:new J(15658734)},opacity:{value:1},center:{value:new u(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new za}}};Ld.prototype=Object.create(G.prototype);Ld.prototype.constructor=Ld;fc.prototype=Object.create(F.prototype);fc.prototype.constructor= -fc;var O={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", +(function(k,La){"object"===typeof exports&&"undefined"!==typeof module?La(exports):"function"===typeof define&&define.amd?define(["exports"],La):(k=k||self,La(k.THREE={}))})(this,function(k){function La(){}function fa(c,a,b,d,e,f,g,h,l,n){Object.defineProperty(this,"id",{value:gj++});this.uuid=T.generateUUID();this.name="";this.image=void 0!==c?c:fa.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==a?a:fa.DEFAULT_MAPPING;this.wrapS=void 0!==b?b: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.internalFormat=null;this.type=void 0!==h?h:1009;this.offset=new p(0,0);this.repeat=new p(1,1);this.center=new p(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new X;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==n?n:3E3;this.version=0;this.onUpdate=null}function Sa(c,a,b){this.width=c;this.height=a;this.scissor=new B(0, +0,c,a);this.scissorTest=!1;this.viewport=new B(0,0,c,a);b=b||{};this.texture=new fa(void 0,b.mapping,b.wrapS,b.wrapT,b.magFilter,b.minFilter,b.format,b.type,b.anisotropy,b.encoding);this.texture.image={};this.texture.image.width=c;this.texture.image.height=a;this.texture.generateMipmaps=void 0!==b.generateMipmaps?b.generateMipmaps:!1;this.texture.minFilter=void 0!==b.minFilter?b.minFilter:1006;this.depthBuffer=void 0!==b.depthBuffer?b.depthBuffer:!0;this.stencilBuffer=void 0!==b.stencilBuffer?b.stencilBuffer: +!1;this.depthTexture=void 0!==b.depthTexture?b.depthTexture:null}function lg(c,a,b){Sa.call(this,c,a,b);this.samples=4}function mg(c,a,b,d,e){for(var f=0,g=c.length-3;f<=g;f+=3){jc.fromArray(c,f);var h=e.x*Math.abs(jc.x)+e.y*Math.abs(jc.y)+e.z*Math.abs(jc.z),l=a.dot(jc),n=b.dot(jc),r=d.dot(jc);if(Math.max(-Math.max(l,n,r),Math.min(l,n,r))>h)return!1}return!0}function F(){Object.defineProperty(this,"id",{value:hj++});this.uuid=T.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children= +[];this.up=F.DefaultUp.clone();var c=new m,a=new ra,b=new O,d=new m(1,1,1);a._onChange(function(){b.setFromEuler(a,!1)});b._onChange(function(){a.setFromQuaternion(b,void 0,!1)});Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:c},rotation:{configurable:!0,enumerable:!0,value:a},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new z},normalMatrix:{value:new X}});this.matrix=new z;this.matrixWorld=new z; +this.matrixAutoUpdate=F.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new nb;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function ng(c,a,b){0>b&&(b+=1);1b?a:b<2/3?c+6*(a-c)*(2/3-b):c}function og(c){return.04045>c?.0773993808*c:Math.pow(.9478672986*c+.0521327014,2.4)}function pg(c){return.0031308>c?12.92*c:1.055*Math.pow(c,.41666)-.055}function L(){Object.defineProperty(this, +"id",{value:ij++});this.uuid=T.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexColors=this.flatShading=!1;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.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail= +7680;this.stencilWrite=!1;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.toneMapped=this.visible=!0;this.userData={};this.version=0}function Za(c){L.call(this);this.type="MeshBasicMaterial";this.color=new x(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.morphTargets=this.skinning=!1;this.setValues(c)}function N(c,a,b){if(Array.isArray(c))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=c;this.itemSize=a;this.count=void 0!==c?c.length/a:0;this.normalized=!0===b;this.usage= +35044;this.updateRange={offset:0,count:-1};this.version=0}function Nd(c,a,b){N.call(this,new Int8Array(c),a,b)}function Od(c,a,b){N.call(this,new Uint8Array(c),a,b)}function Pd(c,a,b){N.call(this,new Uint8ClampedArray(c),a,b)}function Qd(c,a,b){N.call(this,new Int16Array(c),a,b)}function kc(c,a,b){N.call(this,new Uint16Array(c),a,b)}function Rd(c,a,b){N.call(this,new Int32Array(c),a,b)}function lc(c,a,b){N.call(this,new Uint32Array(c),a,b)}function I(c,a,b){N.call(this,new Float32Array(c),a,b)}function Sd(c, +a,b){N.call(this,new Float64Array(c),a,b)}function yh(c){if(0===c.length)return-Infinity;for(var a=c[0],b=1,d=c.length;ba&&(a=c[b]);return a}function G(){Object.defineProperty(this,"id",{value:jj+=2});this.uuid=T.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function na(c,a){F.call(this); +this.type="Mesh";this.geometry=void 0!==c?c:new G;this.material=void 0!==a?a:new Za;this.updateMorphTargets()}function zh(c,a,b,d,e,f,g,h){if(null===(1===a.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==a.side,h)))return null;Ve.copy(h);Ve.applyMatrix4(c.matrixWorld);a=b.ray.origin.distanceTo(Ve);return ab.far?null:{distance:a,point:Ve.clone(),object:c}}function We(c,a,b,d,e,f,g,h,l,n,r,u){Mb.fromBufferAttribute(e,n);Nb.fromBufferAttribute(e,r);Ob.fromBufferAttribute(e, +u);e=c.morphTargetInfluences;if(a.morphTargets&&f&&e){Xe.set(0,0,0);Ye.set(0,0,0);Ze.set(0,0,0);for(var q=0,k=f.length;qg;g++)a.setRenderTarget(b,g),a.clear(c,d,e);a.setRenderTarget(f)}}}function Qb(c,a,b){Number.isInteger(a)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),a=b);Sa.call(this,c,c,a);this.texture.isWebGLCubeRenderTargetTexture=!0}function nc(c,a,b,d,e,f,g,h,l,n,r,u){fa.call(this,null,f,g,h,l,n,d,e,r,u);this.image={data:c||null,width:a||1,height:b||1};this.magFilter= +void 0!==l?l:1003;this.minFilter=void 0!==n?n:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Ah(){function c(b,g){d(b,g);e=a.requestAnimationFrame(c)}var a=null,b=!1,d=null,e=null;return{start:function(){!0!==b&&null!==d&&(e=a.requestAnimationFrame(c),b=!0)},stop:function(){a.cancelAnimationFrame(e);b=!1},setAnimationLoop:function(a){d=a},setContext:function(b){a=b}}}function lj(c,a){function b(a,b){var d=a.array,e=a.usage,f=c.createBuffer();c.bindBuffer(b, +f);c.bufferData(b,d,e);a.onUploadCallback();b=5126;d instanceof Float32Array?b=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?b=5123:d instanceof Int16Array?b=5122:d instanceof Uint32Array?b=5125:d instanceof Int32Array?b=5124:d instanceof Int8Array?b=5120:d instanceof Uint8Array&&(b=5121);return{buffer:f,type:b,bytesPerElement:d.BYTES_PER_ELEMENT,version:a.version}}var d=a.isWebGL2,e=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&& +(a=a.data);return e.get(a)},remove:function(a){a.isInterleavedBufferAttribute&&(a=a.data);var b=e.get(a);b&&(c.deleteBuffer(b.buffer),e.delete(a))},update:function(a,g){if(a.isGLBufferAttribute)g=e.get(a),(!g||g.versione;e++)d[e]=[e,0];return{update:function(e,g,h,l){var f=e.morphTargetInfluences;e=void 0===f?0:f.length;var r=a[g.id];if(void 0===r){r=[];for(var u=0;uf;f++)ff;f++)q=d[f],u=q[0],q=q[1],u!==Number.MAX_SAFE_INTEGER&&q?(e&&g.getAttribute("morphTarget"+f)!==e[u]&&g.setAttribute("morphTarget"+f,e[u]),h&&g.getAttribute("morphNormal"+f)!==h[u]&&g.setAttribute("morphNormal"+f,h[u]),b[f]=q,r+=q):(e&&void 0!==g.getAttribute("morphTarget"+f)&&g.deleteAttribute("morphTarget"+f),h&&void 0!==g.getAttribute("morphNormal"+f)&&g.deleteAttribute("morphNormal"+f),b[f]=0); +g=g.morphTargetsRelative?1:1-r;l.getUniforms().setValue(c,"morphTargetBaseInfluence",g);l.getUniforms().setValue(c,"morphTargetInfluences",b)}}}function zj(c,a,b,d){var e=new WeakMap;return{update:function(c){var f=d.render.frame,h=c.geometry,l=a.get(c,h);e.get(l)!==f&&(h.isGeometry&&l.updateFromObject(c),a.update(l),e.set(l,f));c.isInstancedMesh&&(b.update(c.instanceMatrix,34962),null!==c.instanceColor&&b.update(c.instanceColor,34962));return l},dispose:function(){e=new WeakMap}}}function zb(c,a, +b,d,e,f,g,h,l,n){c=void 0!==c?c:[];fa.call(this,c,void 0!==a?a:301,b,d,e,f,void 0!==g?g:1022,h,l,n);this.flipY=!1}function Tc(c,a,b,d){fa.call(this,null);this.image={data:c||null,width:a||1,height:b||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Uc(c,a,b,d){fa.call(this,null);this.image={data:c||null,width:a||1,height:b||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps= +!1;this.needsUpdate=!0}function Vc(c,a,b){var d=c[0];if(0>=d||0");return c.replace(vg,ug)}function Qh(c,a,b,d){console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.");return wg(c,a,b,d)}function wg(c,a,b,d){c="";for(a=parseInt(a);a< +parseInt(b);a++)c+=d.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return c}function Rh(c){var a="precision "+c.precision+" float;\nprecision "+c.precision+" int;";"highp"===c.precision?a+="\n#define HIGH_PRECISION":"mediump"===c.precision?a+="\n#define MEDIUM_PRECISION":"lowp"===c.precision&&(a+="\n#define LOW_PRECISION");return a}function lk(c){var a="SHADOWMAP_TYPE_BASIC";1===c.shadowMapType?a="SHADOWMAP_TYPE_PCF":2===c.shadowMapType?a="SHADOWMAP_TYPE_PCF_SOFT":3===c.shadowMapType&& +(a="SHADOWMAP_TYPE_VSM");return a}function mk(c){var a="ENVMAP_TYPE_CUBE";if(c.envMap)switch(c.envMapMode){case 301:case 302:a="ENVMAP_TYPE_CUBE";break;case 306:case 307:a="ENVMAP_TYPE_CUBE_UV"}return a}function nk(c){var a="ENVMAP_MODE_REFLECTION";if(c.envMap)switch(c.envMapMode){case 302:case 307:a="ENVMAP_MODE_REFRACTION"}return a}function ok(c){var a="ENVMAP_BLENDING_NONE";if(c.envMap)switch(c.combine){case 0:a="ENVMAP_BLENDING_MULTIPLY";break;case 1:a="ENVMAP_BLENDING_MIX";break;case 2:a="ENVMAP_BLENDING_ADD"}return a} +function pk(c,a,b,d){var e=c.getContext(),f=b.defines,g=b.vertexShader,h=b.fragmentShader,l=lk(b),n=mk(b),r=nk(b),u=ok(b),q=0d;d++)b.probe.push(new m);var e=new m,f=new z,g=new z;return{setup:function(d,l,n){for(var h=l=0,u=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var m=k=0,t=0,w=0,C=0,y=0,E=0,p=0;n=n.matrixWorldInverse;d.sort(yk);for(var Ga=0,H=d.length;Ga< +H;Ga++){var A=d[Ga],M=A.color,Q=A.intensity,ca=A.distance,ja=A.shadow&&A.shadow.map?A.shadow.map.texture:null;if(A.isAmbientLight)l+=M.r*Q,h+=M.g*Q,u+=M.b*Q;else if(A.isLightProbe)for(ja=0;9>ja;ja++)b.probe[ja].addScaledVector(A.sh.coefficients[ja],Q);else if(A.isDirectionalLight){Q=c.get(A);Q.color.copy(A.color).multiplyScalar(A.intensity);Q.direction.setFromMatrixPosition(A.matrixWorld);e.setFromMatrixPosition(A.target.matrixWorld);Q.direction.sub(e);Q.direction.transformDirection(n);if(A.castShadow){var x= +A.shadow;M=a.get(A);M.shadowBias=x.bias;M.shadowNormalBias=x.normalBias;M.shadowRadius=x.radius;M.shadowMapSize=x.mapSize;b.directionalShadow[k]=M;b.directionalShadowMap[k]=ja;b.directionalShadowMatrix[k]=A.shadow.matrix;y++}b.directional[k]=Q;k++}else A.isSpotLight?(x=c.get(A),x.position.setFromMatrixPosition(A.matrixWorld),x.position.applyMatrix4(n),x.color.copy(M).multiplyScalar(Q),x.distance=ca,x.direction.setFromMatrixPosition(A.matrixWorld),e.setFromMatrixPosition(A.target.matrixWorld),x.direction.sub(e), +x.direction.transformDirection(n),x.coneCos=Math.cos(A.angle),x.penumbraCos=Math.cos(A.angle*(1-A.penumbra)),x.decay=A.decay,A.castShadow&&(Q=A.shadow,M=a.get(A),M.shadowBias=Q.bias,M.shadowNormalBias=Q.normalBias,M.shadowRadius=Q.radius,M.shadowMapSize=Q.mapSize,b.spotShadow[t]=M,b.spotShadowMap[t]=ja,b.spotShadowMatrix[t]=A.shadow.matrix,p++),b.spot[t]=x,t++):A.isRectAreaLight?(ja=c.get(A),ja.color.copy(M).multiplyScalar(Q),ja.position.setFromMatrixPosition(A.matrixWorld),ja.position.applyMatrix4(n), +g.identity(),f.copy(A.matrixWorld),f.premultiply(n),g.extractRotation(f),ja.halfWidth.set(.5*A.width,0,0),ja.halfHeight.set(0,.5*A.height,0),ja.halfWidth.applyMatrix4(g),ja.halfHeight.applyMatrix4(g),b.rectArea[w]=ja,w++):A.isPointLight?(Q=c.get(A),Q.position.setFromMatrixPosition(A.matrixWorld),Q.position.applyMatrix4(n),Q.color.copy(A.color).multiplyScalar(A.intensity),Q.distance=A.distance,Q.decay=A.decay,A.castShadow&&(x=A.shadow,M=a.get(A),M.shadowBias=x.bias,M.shadowNormalBias=x.normalBias, +M.shadowRadius=x.radius,M.shadowMapSize=x.mapSize,M.shadowCameraNear=x.camera.near,M.shadowCameraFar=x.camera.far,b.pointShadow[m]=M,b.pointShadowMap[m]=ja,b.pointShadowMatrix[m]=A.shadow.matrix,E++),b.point[m]=Q,m++):A.isHemisphereLight&&(ja=c.get(A),ja.direction.setFromMatrixPosition(A.matrixWorld),ja.direction.transformDirection(n),ja.direction.normalize(),ja.skyColor.copy(A.color).multiplyScalar(Q),ja.groundColor.copy(A.groundColor).multiplyScalar(Q),b.hemi[C]=ja,C++)}0\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}), +C=w.clone();C.defines.HORIZONAL_PASS=1;var y=new G;y.setAttribute("position",new N(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var E=new na(y,w),D=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==D.enabled&&(!1!==D.autoUpdate||!1!==D.needsUpdate)&&0!==d.length){var u=c.getRenderTarget(),k=c.getActiveCubeFace(),q=c.getActiveMipmapLevel(),m=c.state;m.setBlending(0);m.buffers.color.setClear(1,1,1,1);m.buffers.depth.setTest(!0);m.setScissorTest(!1); +for(var t=0,v=d.length;tb||l.y>b)l.x>b&&(n.x=Math.floor(b/A.x),l.x=n.x*A.x,p.mapSize.x=n.x),l.y>b&&(n.y=Math.floor(b/A.y),l.y=n.y*A.y,p.mapSize.y=n.y);null!==p.map||p.isPointLightShadow||3!==this.type||(A={minFilter:1006,magFilter:1006,format:1023,stencilBuffer:!1},p.map= +new Sa(l.x,l.y,A),p.map.texture.name=y.name+".shadowMap",p.mapPass=new Sa(l.x,l.y,A),p.camera.updateProjectionMatrix());null===p.map&&(p.map=new Sa(l.x,l.y,{minFilter:1003,magFilter:1003,format:1023,stencilBuffer:!1}),p.map.texture.name=y.name+".shadowMap",p.camera.updateProjectionMatrix());c.setRenderTarget(p.map);c.clear();A=p.getViewportCount();for(var x=0;xd||a.height>d)e=d/Math.max(a.width, +a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?T.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===F&&(F=h(b,e)),c=c?h(b,e):F,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+ +e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function n(a){return T.isPowerOfTwo(a.width)&&T.isPowerOfTwo(a.height)}function r(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function u(a,b,e,f){c.generateMipmap(a);d.get(b).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(b,d,e){if(!1===ca)return d;if(null!==b){if(void 0!==c[b])return c[b];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ +b+"'")}b=d;6403===d&&(5126===e&&(b=33326),5131===e&&(b=33325),5121===e&&(b=33321));6407===d&&(5126===e&&(b=34837),5131===e&&(b=34843),5121===e&&(b=32849));6408===d&&(5126===e&&(b=34836),5131===e&&(b=34842),5121===e&&(b=32856));33325!==b&&33326!==b&&34842!==b&&34836!==b||a.get("EXT_color_buffer_float");return b}function m(a){return 1003===a||1004===a||1005===a?9728:9729}function t(a){a=a.target;a.removeEventListener("dispose",t);var b=d.get(a);void 0!==b.__webglInit&&(c.deleteTexture(b.__webglTexture), +d.remove(a));a.isVideoTexture&&J.delete(a);g.memory.textures--}function w(a){a=a.target;a.removeEventListener("dispose",w);var b=d.get(a),e=d.get(a.texture);if(a){void 0!==e.__webglTexture&&c.deleteTexture(e.__webglTexture);a.depthTexture&&a.depthTexture.dispose();if(a.isWebGLCubeRenderTarget)for(e=0;6>e;e++)c.deleteFramebuffer(b.__webglFramebuffer[e]),b.__webglDepthbuffer&&c.deleteRenderbuffer(b.__webglDepthbuffer[e]);else c.deleteFramebuffer(b.__webglFramebuffer),b.__webglDepthbuffer&&c.deleteRenderbuffer(b.__webglDepthbuffer), +b.__webglMultisampledFramebuffer&&c.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer&&c.deleteRenderbuffer(b.__webglColorRenderbuffer),b.__webglDepthRenderbuffer&&c.deleteRenderbuffer(b.__webglDepthRenderbuffer);d.remove(a.texture);d.remove(a)}g.memory.textures--}function C(a,c){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;J.get(a)!==f&&(J.set(a,f),a.update())}if(0m;m++)e[m]=h||q?q?a.image[m].image:a.image[m]:l(a.image[m],!1,!0,B);m=e[0];var t=n(m)||ca,v=f.convert(a.format),w=f.convert(a.type),C=k(a.internalFormat,v,w);D(34067,a,t);if(h){for(q=0;6>q;q++){var y=e[q].mipmaps;for(h=0;hh;h++)if(q)for(b.texImage2D(34069+h,0,C,e[h].width,e[h].height,0,v,w,e[h].data),p=0;p=ja&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+ja);K+=1;return a};this.resetTextureUnits=function(){K=0};this.setTexture2D=C;this.setTexture2DArray=function(a,c){var e=d.get(a);0q;q++)e.__webglFramebuffer[q]=c.createFramebuffer();else if(e.__webglFramebuffer=c.createFramebuffer(),q)if(ca){e.__webglMultisampledFramebuffer=c.createFramebuffer();e.__webglColorRenderbuffer=c.createRenderbuffer();c.bindRenderbuffer(36161,e.__webglColorRenderbuffer);q=f.convert(a.texture.format);var t=f.convert(a.texture.type);q=k(a.texture.internalFormat,q,t);t=Q(a);c.renderbufferStorageMultisample(36161,t,q,a.width,a.height);c.bindFramebuffer(36160,e.__webglMultisampledFramebuffer); +c.framebufferRenderbuffer(36160,36064,36161,e.__webglColorRenderbuffer);c.bindRenderbuffer(36161,null);a.depthBuffer&&(e.__webglDepthRenderbuffer=c.createRenderbuffer(),M(e.__webglDepthRenderbuffer,a,!0));c.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){b.bindTexture(34067,h.__webglTexture);D(34067,a.texture,m);for(h=0;6>h;h++)A(e.__webglFramebuffer[h],a,36064,34069+h);r(a.texture,m)&&u(34067,a.texture,a.width, +a.height);b.bindTexture(34067,null)}else b.bindTexture(3553,h.__webglTexture),D(3553,a.texture,m),A(e.__webglFramebuffer,a,36064,3553),r(a.texture,m)&&u(3553,a.texture,a.width,a.height),b.bindTexture(3553,null);if(a.depthBuffer){e=d.get(a);m=!0===a.isWebGLCubeRenderTarget;if(a.depthTexture){if(m)throw Error("target.depthTexture not supported in Cube render targets");if(a&&a.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");c.bindFramebuffer(36160,e.__webglFramebuffer); +if(!a.depthTexture||!a.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(a.depthTexture).__webglTexture&&a.depthTexture.image.width===a.width&&a.depthTexture.image.height===a.height||(a.depthTexture.image.width=a.width,a.depthTexture.image.height=a.height,a.depthTexture.needsUpdate=!0);C(a.depthTexture,0);e=d.get(a.depthTexture).__webglTexture;if(1026===a.depthTexture.format)c.framebufferTexture2D(36160,36096,3553,e,0);else if(1027=== +a.depthTexture.format)c.framebufferTexture2D(36160,33306,3553,e,0);else throw Error("Unknown depthTexture format");}else if(m)for(e.__webglDepthbuffer=[],m=0;6>m;m++)c.bindFramebuffer(36160,e.__webglFramebuffer[m]),e.__webglDepthbuffer[m]=c.createRenderbuffer(),M(e.__webglDepthbuffer[m],a,!1);else c.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=c.createRenderbuffer(),M(e.__webglDepthbuffer,a,!1);c.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var c=a.texture, +e=n(a)||ca;if(r(c,e)){e=a.isWebGLCubeRenderTarget?34067:3553;var f=d.get(c).__webglTexture;b.bindTexture(e,f);u(e,c,a.width,a.height);b.bindTexture(e,null)}};this.updateMultisampleRenderTarget=function(a){if(a.isWebGLMultisampleRenderTarget)if(ca){var b=d.get(a);c.bindFramebuffer(36008,b.__webglMultisampledFramebuffer);c.bindFramebuffer(36009,b.__webglFramebuffer);var e=a.width,f=a.height,g=16384;a.depthBuffer&&(g|=256);a.stencilBuffer&&(g|=1024);c.blitFramebuffer(0,0,e,f,0,0,e,f,g,9728);c.bindFramebuffer(36160, +b.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),P=!0),a=a.texture);C(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLCubeRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), +O=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?y(a,b):p(a,b)}}function Yh(c,a,b){var d=b.isWebGL2;return{convert:function(b){if(1009===b)return 5121;if(1017===b)return 32819;if(1018===b)return 32820;if(1019===b)return 33635;if(1010===b)return 5120;if(1011===b)return 5122;if(1012===b)return 5123;if(1013===b)return 5124;if(1014===b)return 5125;if(1015===b)return 5126;if(1016===b){if(d)return 5131;var c=a.get("OES_texture_half_float");return null!==c?c.HALF_FLOAT_OES: +null}if(1021===b)return 6406;if(1022===b)return 6407;if(1023===b)return 6408;if(1024===b)return 6409;if(1025===b)return 6410;if(1026===b)return 6402;if(1027===b)return 34041;if(1028===b)return 6403;if(1029===b)return 36244;if(1030===b)return 33319;if(1031===b)return 33320;if(1032===b)return 36248;if(1033===b)return 36249;if(33776===b||33777===b||33778===b||33779===b)if(c=a.get("WEBGL_compressed_texture_s3tc"),null!==c){if(33776===b)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===b)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT; +if(33778===b)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===b)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(35840===b||35841===b||35842===b||35843===b)if(c=a.get("WEBGL_compressed_texture_pvrtc"),null!==c){if(35840===b)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===b)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===b)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===b)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(36196===b)return c=a.get("WEBGL_compressed_texture_etc1"), +null!==c?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===b||37496===b)if(c=a.get("WEBGL_compressed_texture_etc"),null!==c){if(37492===b)return c.COMPRESSED_RGB8_ETC2;if(37496===b)return c.COMPRESSED_RGBA8_ETC2_EAC}if(37808===b||37809===b||37810===b||37811===b||37812===b||37813===b||37814===b||37815===b||37816===b||37817===b||37818===b||37819===b||37820===b||37821===b||37840===b||37841===b||37842===b||37843===b||37844===b||37845===b||37846===b||37847===b||37848===b||37849===b||37850===b||37851===b||37852=== +b||37853===b)return c=a.get("WEBGL_compressed_texture_astc"),null!==c?b:null;if(36492===b)return c=a.get("EXT_texture_compression_bptc"),null!==c?b:null;if(1020===b){if(d)return 34042;c=a.get("WEBGL_depth_texture");return null!==c?c.UNSIGNED_INT_24_8_WEBGL:null}}}}function $e(c){ta.call(this);this.cameras=c||[]}function Vb(){F.call(this);this.type="Group"}function Yd(){this._hand=this._grip=this._targetRay=null}function Zh(c,a){function b(a){var b=t.get(a.inputSource);b&&b.dispatchEvent({type:a.type})} +function d(){t.forEach(function(a,b){a.disconnect(b)});t.clear();c.setFramebuffer(null);c.setRenderTarget(c.getRenderTarget());Q.stop();h.isPresenting=!1;h.dispatchEvent({type:"sessionend"})}function e(a){r=a;Q.setContext(l);Q.start();h.isPresenting=!0;h.dispatchEvent({type:"sessionstart"})}function f(a){for(var b=l.inputSources,c=0;ce.matrixWorld.determinant();a=k(a,b,d,e);ya.setMaterial(d,g);g=c.index;b=c.attributes.position;if(null===g){if(void 0===b||0===b.count)return}else if(0===g.count)return;var h=1;!0===d.wireframe&&(g=sa.getWireframeAttribute(c), +h=2);(d.morphTargets||d.morphNormals)&&Ba.update(e,c,d,a);oa.setup(e,d,a,c,g);a=Ca;if(null!==g){var l=pa.get(g);a=Da;a.setIndex(l)}var n=c.drawRange.start*h,r=null!==f?f.start*h:0;l=Math.max(n,r);f=Math.max(0,Math.min(null!==g?g.count:b.count,n+c.drawRange.count*h,r+(null!==f?f.count*h:Infinity))-1-l+1);0!==f&&(e.isMesh?!0===d.wireframe?(ya.setLineWidth(d.wireframeLinewidth*(null===K?Y:1)),a.setMode(1)):a.setMode(4):e.isLine?(d=d.linewidth,void 0===d&&(d=1),ya.setLineWidth(d*(null===K?Y:1)),e.isLineSegments? +a.setMode(1):e.isLineLoop?a.setMode(2):a.setMode(3)):e.isPoints?a.setMode(0):e.isSprite&&a.setMode(4),e.isInstancedMesh?a.renderInstances(l,f,e.count):c.isInstancedBufferGeometry?a.renderInstances(l,f,Math.min(c.instanceCount,c._maxInstanceCount)):a.render(l,f))};this.compile=function(a,b){Q=ta.get(a,b);Q.init();a.traverse(function(a){a.isLight&&(Q.pushLight(a),a.castShadow&&Q.pushShadow(a))});Q.setupLights(b);var c=new WeakMap;a.traverse(function(b){var d=b.material;if(d)if(Array.isArray(d))for(var e= +0;ee.far||f.push({distance:c,distanceToRay:Math.sqrt(h),point:b,index:a,face:null,object:g}))}function Cg(c,a,b,d,e,f,g,h,l){function n(){r.needsUpdate=!0;c.requestVideoFrameCallback(n)}fa.call(this,c,a,b,d,e,f,g,h,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1;var r=this; +"requestVideoFrameCallback"in c&&c.requestVideoFrameCallback(n)}function Zc(c,a,b,d,e,f,g,h,l,n,r,u){fa.call(this,null,f,g,h,l,n,d,e,r,u);this.image={width:a,height:b};this.mipmaps=c;this.generateMipmaps=this.flipY=!1}function ce(c,a,b,d,e,f,g,h,l){fa.call(this,c,a,b,d,e,f,g,h,l);this.needsUpdate=!0}function de(c,a,b,d,e,f,g,h,l,n){n=void 0!==n?n:1026;if(1026!==n&&1027!==n)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===b&&1026===n&&(b=1012); +void 0===b&&1027===n&&(b=1020);fa.call(this,null,d,e,f,g,h,n,b,l);this.image={width:c,height:a};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function $c(c){G.call(this);this.type="WireframeGeometry";var a=[],b=[0,0],d={},e=["a","b","c"];if(c&&c.isGeometry){for(var f=c.faces,g=0,h=f.length;gn;n++){var r=l[e[n]],u=l[e[(n+1)%3]];b[0]=Math.min(r,u);b[1]=Math.max(r,u);r=b[0]+","+b[1];void 0===d[r]&&(d[r]={index1:b[0],index2:b[1]})}for(var k in d)b= +d[k],f=c.vertices[b.index1],a.push(f.x,f.y,f.z),f=c.vertices[b.index2],a.push(f.x,f.y,f.z)}else if(c&&c.isBufferGeometry)if(k=new m,null!==c.index){e=c.attributes.position;g=c.index;c=c.groups;0===c.length&&(c=[{start:0,count:g.count,materialIndex:0}]);h=0;for(l=c.length;hu;u++){var v=g.getX(n+u),t=g.getX(n+(u+1)%3);b[0]=Math.min(v,t);b[1]=Math.max(v,t);v=b[0]+","+b[1];void 0===d[v]&&(d[v]={index1:b[0],index2:b[1]})}for(f in d)b=d[f],k.fromBufferAttribute(e, +b.index1),a.push(k.x,k.y,k.z),k.fromBufferAttribute(e,b.index2),a.push(k.x,k.y,k.z)}else for(d=c.attributes.position,b=0,f=d.count/3;bc;c++)k.fromBufferAttribute(d,3*b+c),a.push(k.x,k.y,k.z),k.fromBufferAttribute(d,3*b+(c+1)%3),a.push(k.x,k.y,k.z);this.setAttribute("position",new I(a,3))}function ee(c,a,b){P.call(this);this.type="ParametricGeometry";this.parameters={func:c,slices:a,stacks:b};this.fromBufferGeometry(new ad(c,a,b));this.mergeVertices()}function ad(c,a,b){G.call(this); +this.type="ParametricBufferGeometry";this.parameters={func:c,slices:a,stacks:b};var d=[],e=[],f=[],g=[],h=new m,l=new m,n=new m,r=new m,u=new m;3>c.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var k=a+1,v=0;v<=b;v++)for(var t=v/b,w=0;w<=a;w++){var C=w/a;c(C,t,l);e.push(l.x,l.y,l.z);0<=C-1E-5?(c(C-1E-5,t,n),r.subVectors(l,n)):(c(C+1E-5,t,n),r.subVectors(n,l));0<=t-1E-5?(c(C,t-1E-5,n),u.subVectors(l,n)):(c(C,t+1E-5,n),u.subVectors(n,l)); +h.crossVectors(r,u).normalize();f.push(h.x,h.y,h.z);g.push(C,t)}for(c=0;cd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}G.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:c,indices:a,radius:b,detail:d};b=b||1;d=d||0;var h=[],l=[];(function(b){for(var c=new m,d=new m,g=new m,h=0;he&&(.2>b&&(l[a+0]+=1), +.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position",new I(h,3));this.setAttribute("normal",new I(h.slice(),3));this.setAttribute("uv",new I(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function ge(c,a){P.call(this);this.type="TetrahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new bd(c,a));this.mergeVertices()}function bd(c,a){Oa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],c,a);this.type="TetrahedronBufferGeometry"; +this.parameters={radius:c,detail:a}}function he(c,a){P.call(this);this.type="OctahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new qc(c,a));this.mergeVertices()}function qc(c,a){Oa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],c,a);this.type="OctahedronBufferGeometry";this.parameters={radius:c,detail:a}}function ie(c,a){P.call(this);this.type="IcosahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new cd(c, +a));this.mergeVertices()}function cd(c,a){var b=(1+Math.sqrt(5))/2;Oa.call(this,[-1,b,0,1,b,0,-1,-b,0,1,-b,0,0,-1,b,0,1,b,0,-1,-b,0,1,-b,b,0,-1,b,0,1,-b,0,-1,-b,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],c,a);this.type="IcosahedronBufferGeometry";this.parameters={radius:c,detail:a}}function je(c,a){P.call(this);this.type="DodecahedronGeometry";this.parameters={radius:c,detail:a};this.fromBufferGeometry(new dd(c, +a));this.mergeVertices()}function dd(c,a){var b=(1+Math.sqrt(5))/2,d=1/b;Oa.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-b,0,-d,b,0,d,-b,0,d,b,-d,-b,0,-d,b,0,d,-b,0,d,b,0,-b,0,-d,b,0,-d,-b,0,d,b,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],c, +a);this.type="DodecahedronBufferGeometry";this.parameters={radius:c,detail:a}}function ke(c,a,b,d,e,f){P.call(this);this.type="TubeGeometry";this.parameters={path:c,tubularSegments:a,radius:b,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");c=new rc(c,a,b,d,e);this.tangents=c.tangents;this.normals=c.normals;this.binormals=c.binormals;this.fromBufferGeometry(c);this.mergeVertices()}function rc(c,a,b,d,e){function f(e){r=c.getPointAt(e/a,r);var f=g.normals[e]; +e=g.binormals[e];for(var n=0;n<=d;n++){var u=n/d*Math.PI*2,m=Math.sin(u);u=-Math.cos(u);l.x=u*f.x+m*e.x;l.y=u*f.y+m*e.y;l.z=u*f.z+m*e.z;l.normalize();q.push(l.x,l.y,l.z);h.x=r.x+b*l.x;h.y=r.y+b*l.y;h.z=r.z+b*l.z;k.push(h.x,h.y,h.z)}}G.call(this);this.type="TubeBufferGeometry";this.parameters={path:c,tubularSegments:a,radius:b,radialSegments:d,closed:e};a=a||64;b=b||1;d=d||8;e=e||!1;var g=c.computeFrenetFrames(a,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new m, +l=new m,n=new p,r=new m,k=[],q=[],v=[],t=[];(function(){for(var b=0;b=a;e-=d)f=ci(e,c[e],c[e+1],f);f&&ff(f,f.next)&&(ne(f),f=f.next); +return f}function Yb(c,a){if(!c)return c;a||(a=c);do{var b=!1;if(c.steiner||!ff(c,c.next)&&0!==ka(c.prev,c,c.next))c=c.next;else{ne(c);c=a=c.prev;if(c===c.next)break;b=!0}}while(b||c!==a);return a}function oe(c,a,b,d,e,f,g){if(c){if(!g&&f){var h=c,l=h;do null===l.z&&(l.z=Dg(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var n,r,k,m,v=1;do{l=h;var t=h=null;for(r=0;l;){r++;var w=l;for(n=k=0;nv!==t.next.y>v&&t.next.y!==t.y&&k<(t.next.x-t.x)*(v-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==l);t=r}t=t&&(ka(l.prev,l,w.prev)||ka(l,w.prev,w))||ff(l,w)&&0c.x?e.x>f.x?e.x:f.x:c.x>f.x?c.x:f.x,h=e.y>c.y?e.y>f.y?e.y:f.y:c.y>f.y?c.y:f.y, +l=Dg(e.x=l&&d&&d.z<=a;){if(b!==c.prev&&b!==c.next&&gd(e.x,e.y,c.x,c.y,f.x,f.y,b.x,b.y)&&0<=ka(b.prev,b,b.next))return!1;b=b.prevZ;if(d!==c.prev&&d!==c.next&&gd(e.x,e.y,c.x,c.y,f.x,f.y,d.x,d.y)&&0<=ka(d.prev,d,d.next))return!1;d=d.nextZ}for(;b&&b.z>=l;){if(b!==c.prev&&b!==c.next&&gd(e.x,e.y,c.x,c.y,f.x,f.y,b.x,b.y)&&0<=ka(b.prev,b,b.next))return!1;b=b.prevZ}for(;d&&d.z<= +a;){if(d!==c.prev&&d!==c.next&&gd(e.x,e.y,c.x,c.y,f.x,f.y,d.x,d.y)&&0<=ka(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Gk(c,a){return c.x-a.x}function Hk(c,a){var b=a,d=c.x,e=c.y,f=-Infinity;do{if(e<=b.y&&e>=b.next.y&&b.next.y!==b.y){var g=b.x+(e-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(g<=d&&g>f){f=g;if(g===d){if(e===b.y)return b;if(e===b.next.y)return b.next}var h=b.x=b.x&& +b.x>=g&&d!==b.x&&gd(eh.x)&&(k=b.x===h.x)){k=h;var m=b;k=0>ka(k.prev,k,m.prev)&&0>ka(m.next,k,k.next)}k&&(h=b,n=r)}b=b.next}while(b!==a);return h}function Dg(c,a,b,d,e){c=32767*(c-b)*e;a=32767*(a-d)*e;c=(c|c<<8)&16711935;c=(c|c<<4)&252645135;c=(c|c<<2)&858993459;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;return(c|c<<1)&1431655765|((a|a<<1)&1431655765)<<1}function Ik(c){var a= +c,b=c;do{if(a.x=Math.min(c.x,b.x)&&a.y<=Math.max(c.y,b.y)&&a.y>=Math.min(c.y,b.y)}function gf(c){return 0c?-1:0}function pe(c,a){return 0>ka(c.prev,c,c.next)?0<=ka(c,a,c.next)&&0<=ka(c,c.prev,a):0>ka(c,a,c.prev)||0>ka(c,c.next,a)}function ei(c,a){var b=new Eg(c.i,c.x,c.y),d=new Eg(a.i,a.x,a.y),e=c.next,f=a.prev;c.next=a;a.prev=c;b.next=e;e.prev=b;d.next=b;b.prev=d;f.next=d;d.prev=f;return d}function ci(c,a,b,d){c=new Eg(c,a,b);d?(c.next=d.next,c.prev=d,d.next.prev= +c,d.next=c):(c.prev=c,c.next=c);return c}function ne(c){c.next.prev=c.prev;c.prev.next=c.next;c.prevZ&&(c.prevZ.nextZ=c.nextZ);c.nextZ&&(c.nextZ.prevZ=c.prevZ)}function Eg(c,a,b){this.i=c;this.x=a;this.y=b;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function fi(c){var a=c.length;2Number.EPSILON){var l=Math.sqrt(h),n=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/n-h)*g-(c.y+f/n-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new p(f,d);e=Math.sqrt(e/ +2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new p(f/e,d/e)}function h(a,b){for(var c=a.length;0<=--c;){var f=c,g=c-1;0>g&&(g=a.length-1);for(var h=0,l=E+2*Q;hr;r++){var k=n[f[r]];var m=n[f[(r+1)%3]];d[0]=Math.min(k,m);d[1]=Math.max(k,m);k=d[0]+","+d[1];void 0===e[k]?e[k]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[k].face2=h}for(k in e)if(d=e[k],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=a)f=c[d.index1],b.push(f.x,f.y,f.z),f=c[d.index2],b.push(f.x,f.y,f.z);this.setAttribute("position",new I(b,3))}function wc(c, +a,b,d,e,f,g,h){P.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:c,radiusBottom:a,height:b,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new Cb(c,a,b,d,e,f,g,h));this.mergeVertices()}function Cb(c,a,b,d,e,f,g,h){function l(b){for(var e=t,f=new p,l=new m,u=0,w=!0===b?c:a,E=!0===b?1:-1,x=1;x<=d;x++)k.push(0,C*E,0),q.push(0,E,0),v.push(.5,.5),t++;x=t;for(var z=0;z<=d;z++){var B=z/d*h+g,F=Math.cos(B);B=Math.sin(B);l.x=w*B;l.y=C*E; +l.z=w*F;k.push(l.x,l.y,l.z);q.push(0,E,0);f.x=.5*F+.5;f.y=.5*B*E+.5;v.push(f.x,f.y);t++}for(f=0;fthis.duration&& +this.resetDuration()}function Kk(c){switch(c.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return md;case "vector":case "vector2":case "vector3":case "vector4":return nd;case "color":return mf;case "quaternion":return ye;case "bool":case "boolean":return lf;case "string":return of}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+c);}function Lk(c){if(void 0===c.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var a=Kk(c.type); +if(void 0===c.times){var b=[],d=[];Z.flattenJSON(c.keys,b,d,"value");c.times=b;c.values=d}return void 0!==a.parse?a.parse(c):new a(c.name,c.times,c.values,c.interpolation)}function Fg(c,a,b){var d=this,e=!1,f=0,g=0,h=void 0,l=[];this.onStart=void 0;this.onLoad=c;this.onProgress=a;this.onError=b;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; +this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this};this.addHandler=function(a,b){l.push(a,b);return this};this.removeHandler=function(a){a=l.indexOf(a);-1!==a&&l.splice(a,2);return this};this.getHandler=function(a){for(var b=0,c=l.length;bb;b++,d++){var e=b/32*Math.PI*2,f=d/32*Math.PI*2;a.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}c.setAttribute("position",new I(a,3));a=new pa({fog:!1,toneMapped:!1});this.cone=new sa(c,a);this.add(this.cone);this.update()}function td(c){for(var a=pi(c),b=new G,d=[],e=[],f=new x(0,0,1),g=new x(0,1,0),h=0;h\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", +blending:0,depthTest:!1,depthWrite:!1})}function si(){return new Db({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:wb[3E3]},outputEncoding:{value:wb[3E3]}},vertexShader:Yg(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t"+Zg()+"\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", +blending:0,depthTest:!1,depthWrite:!1})}function Yg(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"} +function Zg(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"} +function ti(c){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");za.call(this,c);this.type="catmullrom";this.closed=!0}function ui(c){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");za.call(this,c);this.type="catmullrom"}function $g(c){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.");za.call(this,c);this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2, +-52));void 0===Number.isInteger&&(Number.isInteger=function(c){return"number"===typeof c&&isFinite(c)&&Math.floor(c)===c});void 0===Math.sign&&(Math.sign=function(c){return 0>c?-1:0Ie;Ie++)ua[Ie]=(16>Ie?"0":"")+Ie.toString(16);var Jf=1234567,T={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var c=4294967295*Math.random()|0,a=4294967295*Math.random()|0,b=4294967295* +Math.random()|0,d=4294967295*Math.random()|0;return(ua[c&255]+ua[c>>8&255]+ua[c>>16&255]+ua[c>>24&255]+"-"+ua[a&255]+ua[a>>8&255]+"-"+ua[a>>16&15|64]+ua[a>>24&255]+"-"+ua[b&63|128]+ua[b>>8&255]+"-"+ua[b>>16&255]+ua[b>>24&255]+ua[d&255]+ua[d>>8&255]+ua[d>>16&255]+ua[d>>24&255]).toUpperCase()},clamp:function(c,a,b){return Math.max(a,Math.min(b,c))},euclideanModulo:function(c,a){return(c%a+a)%a},mapLinear:function(c,a,b,d,e){return d+(c-a)*(e-d)/(b-a)},lerp:function(c,a,b){return(1-b)*c+b*a},smoothstep:function(c, +a,b){if(c<=a)return 0;if(c>=b)return 1;c=(c-a)/(b-a);return c*c*(3-2*c)},smootherstep:function(c,a,b){if(c<=a)return 0;if(c>=b)return 1;c=(c-a)/(b-a);return c*c*c*(c*(6*c-15)+10)},randInt:function(c,a){return c+Math.floor(Math.random()*(a-c+1))},randFloat:function(c,a){return c+Math.random()*(a-c)},randFloatSpread:function(c){return c*(.5-Math.random())},seededRandom:function(c){void 0!==c&&(Jf=c%2147483647);Jf=16807*Jf%2147483647;return(Jf-1)/2147483646},degToRad:function(c){return c*T.DEG2RAD}, +radToDeg:function(c){return c*T.RAD2DEG},isPowerOfTwo:function(c){return 0===(c&c-1)&&0!==c},ceilPowerOfTwo:function(c){return Math.pow(2,Math.ceil(Math.log(c)/Math.LN2))},floorPowerOfTwo:function(c){return Math.pow(2,Math.floor(Math.log(c)/Math.LN2))},setQuaternionFromProperEuler:function(c,a,b,d,e){var f=Math.cos,g=Math.sin,h=f(b/2);b=g(b/2);var l=f((a+d)/2),n=g((a+d)/2),k=f((a-d)/2),m=g((a-d)/2);f=f((d-a)/2);a=g((d-a)/2);switch(e){case "XYX":c.set(h*n,b*k,b*m,h*l);break;case "YZY":c.set(b*m,h* +n,b*k,h*l);break;case "ZXZ":c.set(b*k,b*m,h*n,h*l);break;case "XZX":c.set(h*n,b*a,b*f,h*l);break;case "YXY":c.set(b*f,h*n,b*a,h*l);break;case "ZYZ":c.set(b*a,b*f,h*n,h*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+e)}}},p=function(c,a){void 0===c&&(c=0);void 0===a&&(a=0);this.x=c;this.y=a},Je={width:{configurable:!0},height:{configurable:!0}};Je.width.get=function(){return this.x};Je.width.set=function(c){this.x=c};Je.height.get=function(){return this.y}; +Je.height.set=function(c){this.y=c};p.prototype.set=function(c,a){this.x=c;this.y=a;return this};p.prototype.setScalar=function(c){this.y=this.x=c;return this};p.prototype.setX=function(c){this.x=c;return this};p.prototype.setY=function(c){this.y=c;return this};p.prototype.setComponent=function(c,a){switch(c){case 0:this.x=a;break;case 1:this.y=a;break;default:throw Error("index is out of range: "+c);}return this};p.prototype.getComponent=function(c){switch(c){case 0:return this.x;case 1:return this.y; +default:throw Error("index is out of range: "+c);}};p.prototype.clone=function(){return new this.constructor(this.x,this.y)};p.prototype.copy=function(c){this.x=c.x;this.y=c.y;return this};p.prototype.add=function(c,a){if(void 0!==a)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(c,a);this.x+=c.x;this.y+=c.y;return this};p.prototype.addScalar=function(c){this.x+=c;this.y+=c;return this};p.prototype.addVectors=function(c, +a){this.x=c.x+a.x;this.y=c.y+a.y;return this};p.prototype.addScaledVector=function(c,a){this.x+=c.x*a;this.y+=c.y*a;return this};p.prototype.sub=function(c,a){if(void 0!==a)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(c,a);this.x-=c.x;this.y-=c.y;return this};p.prototype.subScalar=function(c){this.x-=c;this.y-=c;return this};p.prototype.subVectors=function(c,a){this.x=c.x-a.x;this.y=c.y-a.y;return this};p.prototype.multiply= +function(c){this.x*=c.x;this.y*=c.y;return this};p.prototype.multiplyScalar=function(c){this.x*=c;this.y*=c;return this};p.prototype.divide=function(c){this.x/=c.x;this.y/=c.y;return this};p.prototype.divideScalar=function(c){return this.multiplyScalar(1/c)};p.prototype.applyMatrix3=function(c){var a=this.x,b=this.y;c=c.elements;this.x=c[0]*a+c[3]*b+c[6];this.y=c[1]*a+c[4]*b+c[7];return this};p.prototype.min=function(c){this.x=Math.min(this.x,c.x);this.y=Math.min(this.y,c.y);return this};p.prototype.max= +function(c){this.x=Math.max(this.x,c.x);this.y=Math.max(this.y,c.y);return this};p.prototype.clamp=function(c,a){this.x=Math.max(c.x,Math.min(a.x,this.x));this.y=Math.max(c.y,Math.min(a.y,this.y));return this};p.prototype.clampScalar=function(c,a){this.x=Math.max(c,Math.min(a,this.x));this.y=Math.max(c,Math.min(a,this.y));return this};p.prototype.clampLength=function(c,a){var b=this.length();return this.divideScalar(b||1).multiplyScalar(Math.max(c,Math.min(a,b)))};p.prototype.floor=function(){this.x= +Math.floor(this.x);this.y=Math.floor(this.y);return this};p.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};p.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};p.prototype.roundToZero=function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this};p.prototype.negate=function(){this.x=-this.x;this.y=-this.y;return this};p.prototype.dot=function(c){return this.x* +c.x+this.y*c.y};p.prototype.cross=function(c){return this.x*c.y-this.y*c.x};p.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y};p.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};p.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)};p.prototype.normalize=function(){return this.divideScalar(this.length()||1)};p.prototype.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI};p.prototype.distanceTo=function(c){return Math.sqrt(this.distanceToSquared(c))}; +p.prototype.distanceToSquared=function(c){var a=this.x-c.x;c=this.y-c.y;return a*a+c*c};p.prototype.manhattanDistanceTo=function(c){return Math.abs(this.x-c.x)+Math.abs(this.y-c.y)};p.prototype.setLength=function(c){return this.normalize().multiplyScalar(c)};p.prototype.lerp=function(c,a){this.x+=(c.x-this.x)*a;this.y+=(c.y-this.y)*a;return this};p.prototype.lerpVectors=function(c,a,b){this.x=c.x+(a.x-c.x)*b;this.y=c.y+(a.y-c.y)*b;return this};p.prototype.equals=function(c){return c.x===this.x&&c.y=== +this.y};p.prototype.fromArray=function(c,a){void 0===a&&(a=0);this.x=c[a];this.y=c[a+1];return this};p.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);c[a]=this.x;c[a+1]=this.y;return c};p.prototype.fromBufferAttribute=function(c,a,b){void 0!==b&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=c.getX(a);this.y=c.getY(a);return this};p.prototype.rotateAround=function(c,a){var b=Math.cos(a);a=Math.sin(a);var d=this.x-c.x,e=this.y-c.y;this.x= +d*b-e*a+c.x;this.y=d*a+e*b+c.y;return this};p.prototype.random=function(){this.x=Math.random();this.y=Math.random();return this};Object.defineProperties(p.prototype,Je);p.prototype.isVector2=!0;var X=function(){this.elements=[1,0,0,0,1,0,0,0,1];0b;b++)if(a[b]!==c[b])return!1;return!0};X.prototype.fromArray= +function(c,a){void 0===a&&(a=0);for(var b=0;9>b;b++)this.elements[b]=c[b+a];return this};X.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);var b=this.elements;c[a]=b[0];c[a+1]=b[1];c[a+2]=b[2];c[a+3]=b[3];c[a+4]=b[4];c[a+5]=b[5];c[a+6]=b[6];c[a+7]=b[7];c[a+8]=b[8];return c};X.prototype.isMatrix3=!0;var xd,dc={getDataURL:function(c){if(/^data:/i.test(c.src)||"undefined"==typeof HTMLCanvasElement)return c.src;if(!(c instanceof HTMLCanvasElement)){void 0===xd&&(xd=document.createElementNS("http://www.w3.org/1999/xhtml", +"canvas"));xd.width=c.width;xd.height=c.height;var a=xd.getContext("2d");c instanceof ImageData?a.putImageData(c,0,0):a.drawImage(c,0,0,c.width,c.height);c=xd}return 2048c.x||1c.x?0:1;break;case 1002:c.x=1===Math.abs(Math.floor(c.x)%2)?Math.ceil(c.x)-c.x:c.x-Math.floor(c.x)}if(0> +c.y||1c.y?0:1;break;case 1002:c.y=1===Math.abs(Math.floor(c.y)%2)?Math.ceil(c.y)-c.y:c.y-Math.floor(c.y)}this.flipY&&(c.y=1-c.y);return c}});Object.defineProperty(fa.prototype,"needsUpdate",{set:function(c){!0===c&&this.version++}});var B=function(c,a,b,d){void 0===c&&(c=0);void 0===a&&(a=0);void 0===b&&(b=0);void 0===d&&(d=1);this.x=c;this.y=a;this.z=b;this.w=d},Ke={width:{configurable:!0},height:{configurable:!0}};Ke.width.get= +function(){return this.z};Ke.width.set=function(c){this.z=c};Ke.height.get=function(){return this.w};Ke.height.set=function(c){this.w=c};B.prototype.set=function(c,a,b,d){this.x=c;this.y=a;this.z=b;this.w=d;return this};B.prototype.setScalar=function(c){this.w=this.z=this.y=this.x=c;return this};B.prototype.setX=function(c){this.x=c;return this};B.prototype.setY=function(c){this.y=c;return this};B.prototype.setZ=function(c){this.z=c;return this};B.prototype.setW=function(c){this.w=c;return this}; +B.prototype.setComponent=function(c,a){switch(c){case 0:this.x=a;break;case 1:this.y=a;break;case 2:this.z=a;break;case 3:this.w=a;break;default:throw Error("index is out of range: "+c);}return this};B.prototype.getComponent=function(c){switch(c){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+c);}};B.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)};B.prototype.copy=function(c){this.x= +c.x;this.y=c.y;this.z=c.z;this.w=void 0!==c.w?c.w:1;return this};B.prototype.add=function(c,a){if(void 0!==a)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(c,a);this.x+=c.x;this.y+=c.y;this.z+=c.z;this.w+=c.w;return this};B.prototype.addScalar=function(c){this.x+=c;this.y+=c;this.z+=c;this.w+=c;return this};B.prototype.addVectors=function(c,a){this.x=c.x+a.x;this.y=c.y+a.y;this.z=c.z+a.z;this.w=c.w+a.w;return this};B.prototype.addScaledVector= +function(c,a){this.x+=c.x*a;this.y+=c.y*a;this.z+=c.z*a;this.w+=c.w*a;return this};B.prototype.sub=function(c,a){if(void 0!==a)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(c,a);this.x-=c.x;this.y-=c.y;this.z-=c.z;this.w-=c.w;return this};B.prototype.subScalar=function(c){this.x-=c;this.y-=c;this.z-=c;this.w-=c;return this};B.prototype.subVectors=function(c,a){this.x=c.x-a.x;this.y=c.y-a.y;this.z=c.z-a.z;this.w=c.w-a.w; +return this};B.prototype.multiplyScalar=function(c){this.x*=c;this.y*=c;this.z*=c;this.w*=c;return this};B.prototype.applyMatrix4=function(c){var a=this.x,b=this.y,d=this.z,e=this.w;c=c.elements;this.x=c[0]*a+c[4]*b+c[8]*d+c[12]*e;this.y=c[1]*a+c[5]*b+c[9]*d+c[13]*e;this.z=c[2]*a+c[6]*b+c[10]*d+c[14]*e;this.w=c[3]*a+c[7]*b+c[11]*d+c[15]*e;return this};B.prototype.divideScalar=function(c){return this.multiplyScalar(1/c)};B.prototype.setAxisAngleFromQuaternion=function(c){this.w=2*Math.acos(c.w);var a= +Math.sqrt(1-c.w*c.w);1E-4>a?(this.x=1,this.z=this.y=0):(this.x=c.x/a,this.y=c.y/a,this.z=c.z/a);return this};B.prototype.setAxisAngleFromRotationMatrix=function(c){c=c.elements;var a=c[0];var b=c[4];var d=c[8],e=c[1],f=c[5],g=c[9];var h=c[2];var l=c[6];var n=c[10];if(.01>Math.abs(b-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(b+e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(a+f+n-3))return this.set(1,0,0,0),this;c=Math.PI;a=(a+1)/2;f=(f+1)/2;n=(n+1)/2;b=(b+e)/4;d=(d+h)/4;g=(g+l)/ +4;a>f&&a>n?.01>a?(l=0,b=h=.707106781):(l=Math.sqrt(a),h=b/l,b=d/l):f>n?.01>f?(l=.707106781,h=0,b=.707106781):(h=Math.sqrt(f),l=b/h,b=g/h):.01>n?(h=l=.707106781,b=0):(b=Math.sqrt(n),l=d/b,h=g/b);this.set(l,h,b,c);return this}c=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-b)*(e-b));.001>Math.abs(c)&&(c=1);this.x=(l-g)/c;this.y=(d-h)/c;this.z=(e-b)/c;this.w=Math.acos((a+f+n-1)/2);return this};B.prototype.min=function(c){this.x=Math.min(this.x,c.x);this.y=Math.min(this.y,c.y);this.z=Math.min(this.z,c.z);this.w= +Math.min(this.w,c.w);return this};B.prototype.max=function(c){this.x=Math.max(this.x,c.x);this.y=Math.max(this.y,c.y);this.z=Math.max(this.z,c.z);this.w=Math.max(this.w,c.w);return this};B.prototype.clamp=function(c,a){this.x=Math.max(c.x,Math.min(a.x,this.x));this.y=Math.max(c.y,Math.min(a.y,this.y));this.z=Math.max(c.z,Math.min(a.z,this.z));this.w=Math.max(c.w,Math.min(a.w,this.w));return this};B.prototype.clampScalar=function(c,a){this.x=Math.max(c,Math.min(a,this.x));this.y=Math.max(c,Math.min(a, +this.y));this.z=Math.max(c,Math.min(a,this.z));this.w=Math.max(c,Math.min(a,this.w));return this};B.prototype.clampLength=function(c,a){var b=this.length();return this.divideScalar(b||1).multiplyScalar(Math.max(c,Math.min(a,b)))};B.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this};B.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w); +return this};B.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this};B.prototype.roundToZero=function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this};B.prototype.negate=function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w= +-this.w;return this};B.prototype.dot=function(c){return this.x*c.x+this.y*c.y+this.z*c.z+this.w*c.w};B.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w};B.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)};B.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)};B.prototype.normalize=function(){return this.divideScalar(this.length()||1)};B.prototype.setLength= +function(c){return this.normalize().multiplyScalar(c)};B.prototype.lerp=function(c,a){this.x+=(c.x-this.x)*a;this.y+=(c.y-this.y)*a;this.z+=(c.z-this.z)*a;this.w+=(c.w-this.w)*a;return this};B.prototype.lerpVectors=function(c,a,b){this.x=c.x+(a.x-c.x)*b;this.y=c.y+(a.y-c.y)*b;this.z=c.z+(a.z-c.z)*b;this.w=c.w+(a.w-c.w)*b;return this};B.prototype.equals=function(c){return c.x===this.x&&c.y===this.y&&c.z===this.z&&c.w===this.w};B.prototype.fromArray=function(c,a){void 0===a&&(a=0);this.x=c[a];this.y= +c[a+1];this.z=c[a+2];this.w=c[a+3];return this};B.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);c[a]=this.x;c[a+1]=this.y;c[a+2]=this.z;c[a+3]=this.w;return c};B.prototype.fromBufferAttribute=function(c,a,b){void 0!==b&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");this.x=c.getX(a);this.y=c.getY(a);this.z=c.getZ(a);this.w=c.getW(a);return this};B.prototype.random=function(){this.x=Math.random();this.y=Math.random();this.z=Math.random(); +this.w=Math.random();return this};Object.defineProperties(B.prototype,Ke);B.prototype.isVector4=!0;Sa.prototype=Object.assign(Object.create(La.prototype),{constructor:Sa,isWebGLRenderTarget:!0,setSize:function(c,a){if(this.width!==c||this.height!==a)this.width=c,this.height=a,this.texture.image.width=c,this.texture.image.height=a,this.dispose();this.viewport.set(0,0,c,a);this.scissor.set(0,0,c,a)},clone:function(){return(new this.constructor).copy(this)},copy:function(c){this.width=c.width;this.height= +c.height;this.viewport.copy(c.viewport);this.texture=c.texture.clone();this.depthBuffer=c.depthBuffer;this.stencilBuffer=c.stencilBuffer;this.depthTexture=c.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});lg.prototype=Object.assign(Object.create(Sa.prototype),{constructor:lg,isWebGLMultisampleRenderTarget:!0,copy:function(c){Sa.prototype.copy.call(this,c);this.samples=c.samples;return this}});var O=function(c,a,b,d){void 0===c&&(c=0);void 0===a&&(a=0);void 0=== +b&&(b=0);void 0===d&&(d=1);this._x=c;this._y=a;this._z=b;this._w=d},Fb={x:{configurable:!0},y:{configurable:!0},z:{configurable:!0},w:{configurable:!0}};O.slerp=function(c,a,b,d){return b.copy(c).slerp(a,d)};O.slerpFlat=function(c,a,b,d,e,f,g){var h=b[d+0],l=b[d+1],n=b[d+2];b=b[d+3];d=e[f+0];var k=e[f+1],m=e[f+2];e=e[f+3];if(b!==e||h!==d||l!==k||n!==m){f=1-g;var q=h*d+l*k+n*m+b*e,v=0<=q?1:-1,t=1-q*q;t>Number.EPSILON&&(t=Math.sqrt(t),q=Math.atan2(t,q*v),f=Math.sin(f*q)/t,g=Math.sin(g*q)/t);v*=g;h= +h*f+d*v;l=l*f+k*v;n=n*f+m*v;b=b*f+e*v;f===1-g&&(g=1/Math.sqrt(h*h+l*l+n*n+b*b),h*=g,l*=g,n*=g,b*=g)}c[a]=h;c[a+1]=l;c[a+2]=n;c[a+3]=b};O.multiplyQuaternionsFlat=function(c,a,b,d,e,f){var g=b[d],h=b[d+1],l=b[d+2];b=b[d+3];d=e[f];var n=e[f+1],k=e[f+2];e=e[f+3];c[a]=g*e+b*d+h*k-l*n;c[a+1]=h*e+b*n+l*d-g*k;c[a+2]=l*e+b*k+g*n-h*d;c[a+3]=b*e-g*d-h*n-l*k;return c};Fb.x.get=function(){return this._x};Fb.x.set=function(c){this._x=c;this._onChangeCallback()};Fb.y.get=function(){return this._y};Fb.y.set=function(c){this._y= +c;this._onChangeCallback()};Fb.z.get=function(){return this._z};Fb.z.set=function(c){this._z=c;this._onChangeCallback()};Fb.w.get=function(){return this._w};Fb.w.set=function(c){this._w=c;this._onChangeCallback()};O.prototype.set=function(c,a,b,d){this._x=c;this._y=a;this._z=b;this._w=d;this._onChangeCallback();return this};O.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)};O.prototype.copy=function(c){this._x=c.x;this._y=c.y;this._z=c.z;this._w=c.w;this._onChangeCallback(); +return this};O.prototype.setFromEuler=function(c,a){if(!c||!c.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var b=c._x,d=c._y,e=c._z;c=c._order;var f=Math.cos,g=Math.sin,h=f(b/2),l=f(d/2);f=f(e/2);b=g(b/2);d=g(d/2);e=g(e/2);switch(c){case "XYZ":this._x=b*l*f+h*d*e;this._y=h*d*f-b*l*e;this._z=h*l*e+b*d*f;this._w=h*l*f-b*d*e;break;case "YXZ":this._x=b*l*f+h*d*e;this._y=h*d*f-b*l*e;this._z=h*l*e-b*d*f;this._w=h*l*f+b*d*e;break; +case "ZXY":this._x=b*l*f-h*d*e;this._y=h*d*f+b*l*e;this._z=h*l*e+b*d*f;this._w=h*l*f-b*d*e;break;case "ZYX":this._x=b*l*f-h*d*e;this._y=h*d*f+b*l*e;this._z=h*l*e-b*d*f;this._w=h*l*f+b*d*e;break;case "YZX":this._x=b*l*f+h*d*e;this._y=h*d*f+b*l*e;this._z=h*l*e-b*d*f;this._w=h*l*f-b*d*e;break;case "XZY":this._x=b*l*f-h*d*e;this._y=h*d*f-b*l*e;this._z=h*l*e+b*d*f;this._w=h*l*f+b*d*e;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+c)}!1!==a&&this._onChangeCallback(); +return this};O.prototype.setFromAxisAngle=function(c,a){a/=2;var b=Math.sin(a);this._x=c.x*b;this._y=c.y*b;this._z=c.z*b;this._w=Math.cos(a);this._onChangeCallback();return this};O.prototype.setFromRotationMatrix=function(c){var a=c.elements,b=a[0];c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9],h=a[2],l=a[6];a=a[10];var n=b+f+a;0f&&b>a?(b=2*Math.sqrt(1+b-f-a),this._w=(l-g)/b,this._x=.25*b,this._y=(c+e)/b,this._z=(d+h)/ +b):f>a?(b=2*Math.sqrt(1+f-b-a),this._w=(d-h)/b,this._x=(c+e)/b,this._y=.25*b,this._z=(g+l)/b):(b=2*Math.sqrt(1+a-b-f),this._w=(e-c)/b,this._x=(d+h)/b,this._y=(g+l)/b,this._z=.25*b);this._onChangeCallback();return this};O.prototype.setFromUnitVectors=function(c,a){var b=c.dot(a)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?(this._x=-c.y,this._y=c.x,this._z=0):(this._x=0,this._y=-c.z,this._z=c.y)):(this._x=c.y*a.z-c.z*a.y,this._y=c.z*a.x-c.x*a.z,this._z=c.x*a.y-c.y*a.x);this._w=b;return this.normalize()}; +O.prototype.angleTo=function(c){return 2*Math.acos(Math.abs(T.clamp(this.dot(c),-1,1)))};O.prototype.rotateTowards=function(c,a){var b=this.angleTo(c);if(0===b)return this;this.slerp(c,Math.min(1,a/b));return this};O.prototype.identity=function(){return this.set(0,0,0,1)};O.prototype.inverse=function(){return this.conjugate()};O.prototype.conjugate=function(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this};O.prototype.dot=function(c){return this._x*c._x+this._y*c._y+this._z* +c._z+this._w*c._w};O.prototype.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w};O.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)};O.prototype.normalize=function(){var c=this.length();0===c?(this._z=this._y=this._x=0,this._w=1):(c=1/c,this._x*=c,this._y*=c,this._z*=c,this._w*=c);this._onChangeCallback();return this};O.prototype.multiply=function(c,a){return void 0!==a?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), +this.multiplyQuaternions(c,a)):this.multiplyQuaternions(this,c)};O.prototype.premultiply=function(c){return this.multiplyQuaternions(c,this)};O.prototype.multiplyQuaternions=function(c,a){var b=c._x,d=c._y,e=c._z;c=c._w;var f=a._x,g=a._y,h=a._z;a=a._w;this._x=b*a+c*f+d*h-e*g;this._y=d*a+c*g+e*f-b*h;this._z=e*a+c*h+b*g-d*f;this._w=c*a-b*f-d*g-e*h;this._onChangeCallback();return this};O.prototype.slerp=function(c,a){if(0===a)return this;if(1===a)return this.copy(c);var b=this._x,d=this._y,e=this._z, +f=this._w,g=f*c._w+b*c._x+d*c._y+e*c._z;0>g?(this._w=-c._w,this._x=-c._x,this._y=-c._y,this._z=-c._z,g=-g):this.copy(c);if(1<=g)return this._w=f,this._x=b,this._y=d,this._z=e,this;c=1-g*g;if(c<=Number.EPSILON)return g=1-a,this._w=g*f+a*this._w,this._x=g*b+a*this._x,this._y=g*d+a*this._y,this._z=g*e+a*this._z,this.normalize(),this._onChangeCallback(),this;c=Math.sqrt(c);var h=Math.atan2(c,g);g=Math.sin((1-a)*h)/c;a=Math.sin(a*h)/c;this._w=f*g+this._w*a;this._x=b*g+this._x*a;this._y=d*g+this._y*a;this._z= +e*g+this._z*a;this._onChangeCallback();return this};O.prototype.equals=function(c){return c._x===this._x&&c._y===this._y&&c._z===this._z&&c._w===this._w};O.prototype.fromArray=function(c,a){void 0===a&&(a=0);this._x=c[a];this._y=c[a+1];this._z=c[a+2];this._w=c[a+3];this._onChangeCallback();return this};O.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);c[a]=this._x;c[a+1]=this._y;c[a+2]=this._z;c[a+3]=this._w;return c};O.prototype.fromBufferAttribute=function(c,a){this._x=c.getX(a); +this._y=c.getY(a);this._z=c.getZ(a);this._w=c.getW(a);return this};O.prototype._onChange=function(c){this._onChangeCallback=c;return this};O.prototype._onChangeCallback=function(){};Object.defineProperties(O.prototype,Fb);O.prototype.isQuaternion=!0;var m=function(c,a,b){void 0===c&&(c=0);void 0===a&&(a=0);void 0===b&&(b=0);this.x=c;this.y=a;this.z=b};m.prototype.set=function(c,a,b){void 0===b&&(b=this.z);this.x=c;this.y=a;this.z=b;return this};m.prototype.setScalar=function(c){this.z=this.y=this.x= +c;return this};m.prototype.setX=function(c){this.x=c;return this};m.prototype.setY=function(c){this.y=c;return this};m.prototype.setZ=function(c){this.z=c;return this};m.prototype.setComponent=function(c,a){switch(c){case 0:this.x=a;break;case 1:this.y=a;break;case 2:this.z=a;break;default:throw Error("index is out of range: "+c);}return this};m.prototype.getComponent=function(c){switch(c){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ +c);}};m.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z)};m.prototype.copy=function(c){this.x=c.x;this.y=c.y;this.z=c.z;return this};m.prototype.add=function(c,a){if(void 0!==a)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(c,a);this.x+=c.x;this.y+=c.y;this.z+=c.z;return this};m.prototype.addScalar=function(c){this.x+=c;this.y+=c;this.z+=c;return this};m.prototype.addVectors=function(c,a){this.x= +c.x+a.x;this.y=c.y+a.y;this.z=c.z+a.z;return this};m.prototype.addScaledVector=function(c,a){this.x+=c.x*a;this.y+=c.y*a;this.z+=c.z*a;return this};m.prototype.sub=function(c,a){if(void 0!==a)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(c,a);this.x-=c.x;this.y-=c.y;this.z-=c.z;return this};m.prototype.subScalar=function(c){this.x-=c;this.y-=c;this.z-=c;return this};m.prototype.subVectors=function(c,a){this.x=c.x-a.x;this.y= +c.y-a.y;this.z=c.z-a.z;return this};m.prototype.multiply=function(c,a){if(void 0!==a)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(c,a);this.x*=c.x;this.y*=c.y;this.z*=c.z;return this};m.prototype.multiplyScalar=function(c){this.x*=c;this.y*=c;this.z*=c;return this};m.prototype.multiplyVectors=function(c,a){this.x=c.x*a.x;this.y=c.y*a.y;this.z=c.z*a.z;return this};m.prototype.applyEuler=function(c){c&&c.isEuler|| +console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(vi.setFromEuler(c))};m.prototype.applyAxisAngle=function(c,a){return this.applyQuaternion(vi.setFromAxisAngle(c,a))};m.prototype.applyMatrix3=function(c){var a=this.x,b=this.y,d=this.z;c=c.elements;this.x=c[0]*a+c[3]*b+c[6]*d;this.y=c[1]*a+c[4]*b+c[7]*d;this.z=c[2]*a+c[5]*b+c[8]*d;return this};m.prototype.applyNormalMatrix=function(c){return this.applyMatrix3(c).normalize()}; +m.prototype.applyMatrix4=function(c){var a=this.x,b=this.y,d=this.z;c=c.elements;var e=1/(c[3]*a+c[7]*b+c[11]*d+c[15]);this.x=(c[0]*a+c[4]*b+c[8]*d+c[12])*e;this.y=(c[1]*a+c[5]*b+c[9]*d+c[13])*e;this.z=(c[2]*a+c[6]*b+c[10]*d+c[14])*e;return this};m.prototype.applyQuaternion=function(c){var a=this.x,b=this.y,d=this.z,e=c.x,f=c.y,g=c.z;c=c.w;var h=c*a+f*d-g*b,l=c*b+g*a-e*d,n=c*d+e*b-f*a;a=-e*a-f*b-g*d;this.x=h*c+a*-e+l*-g-n*-f;this.y=l*c+a*-f+n*-e-h*-g;this.z=n*c+a*-g+h*-f-l*-e;return this};m.prototype.project= +function(c){return this.applyMatrix4(c.matrixWorldInverse).applyMatrix4(c.projectionMatrix)};m.prototype.unproject=function(c){return this.applyMatrix4(c.projectionMatrixInverse).applyMatrix4(c.matrixWorld)};m.prototype.transformDirection=function(c){var a=this.x,b=this.y,d=this.z;c=c.elements;this.x=c[0]*a+c[4]*b+c[8]*d;this.y=c[1]*a+c[5]*b+c[9]*d;this.z=c[2]*a+c[6]*b+c[10]*d;return this.normalize()};m.prototype.divide=function(c){this.x/=c.x;this.y/=c.y;this.z/=c.z;return this};m.prototype.divideScalar= +function(c){return this.multiplyScalar(1/c)};m.prototype.min=function(c){this.x=Math.min(this.x,c.x);this.y=Math.min(this.y,c.y);this.z=Math.min(this.z,c.z);return this};m.prototype.max=function(c){this.x=Math.max(this.x,c.x);this.y=Math.max(this.y,c.y);this.z=Math.max(this.z,c.z);return this};m.prototype.clamp=function(c,a){this.x=Math.max(c.x,Math.min(a.x,this.x));this.y=Math.max(c.y,Math.min(a.y,this.y));this.z=Math.max(c.z,Math.min(a.z,this.z));return this};m.prototype.clampScalar=function(c, +a){this.x=Math.max(c,Math.min(a,this.x));this.y=Math.max(c,Math.min(a,this.y));this.z=Math.max(c,Math.min(a,this.z));return this};m.prototype.clampLength=function(c,a){var b=this.length();return this.divideScalar(b||1).multiplyScalar(Math.max(c,Math.min(a,b)))};m.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this};m.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this};m.prototype.round= +function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this};m.prototype.roundToZero=function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this};m.prototype.negate=function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this};m.prototype.dot=function(c){return this.x*c.x+this.y*c.y+this.z*c.z};m.prototype.lengthSq=function(){return this.x* +this.x+this.y*this.y+this.z*this.z};m.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)};m.prototype.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)};m.prototype.normalize=function(){return this.divideScalar(this.length()||1)};m.prototype.setLength=function(c){return this.normalize().multiplyScalar(c)};m.prototype.lerp=function(c,a){this.x+=(c.x-this.x)*a;this.y+=(c.y-this.y)*a;this.z+=(c.z-this.z)*a;return this};m.prototype.lerpVectors= +function(c,a,b){this.x=c.x+(a.x-c.x)*b;this.y=c.y+(a.y-c.y)*b;this.z=c.z+(a.z-c.z)*b;return this};m.prototype.cross=function(c,a){return void 0!==a?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(c,a)):this.crossVectors(this,c)};m.prototype.crossVectors=function(c,a){var b=c.x,d=c.y;c=c.z;var e=a.x,f=a.y;a=a.z;this.x=d*a-c*f;this.y=c*e-b*a;this.z=b*f-d*e;return this};m.prototype.projectOnVector=function(c){var a=c.lengthSq(); +if(0===a)return this.set(0,0,0);a=c.dot(this)/a;return this.copy(c).multiplyScalar(a)};m.prototype.projectOnPlane=function(c){ah.copy(this).projectOnVector(c);return this.sub(ah)};m.prototype.reflect=function(c){return this.sub(ah.copy(c).multiplyScalar(2*this.dot(c)))};m.prototype.angleTo=function(c){var a=Math.sqrt(this.lengthSq()*c.lengthSq());if(0===a)return Math.PI/2;c=this.dot(c)/a;return Math.acos(T.clamp(c,-1,1))};m.prototype.distanceTo=function(c){return Math.sqrt(this.distanceToSquared(c))}; +m.prototype.distanceToSquared=function(c){var a=this.x-c.x,b=this.y-c.y;c=this.z-c.z;return a*a+b*b+c*c};m.prototype.manhattanDistanceTo=function(c){return Math.abs(this.x-c.x)+Math.abs(this.y-c.y)+Math.abs(this.z-c.z)};m.prototype.setFromSpherical=function(c){return this.setFromSphericalCoords(c.radius,c.phi,c.theta)};m.prototype.setFromSphericalCoords=function(c,a,b){var d=Math.sin(a)*c;this.x=d*Math.sin(b);this.y=Math.cos(a)*c;this.z=d*Math.cos(b);return this};m.prototype.setFromCylindrical=function(c){return this.setFromCylindricalCoords(c.radius, +c.theta,c.y)};m.prototype.setFromCylindricalCoords=function(c,a,b){this.x=c*Math.sin(a);this.y=b;this.z=c*Math.cos(a);return this};m.prototype.setFromMatrixPosition=function(c){c=c.elements;this.x=c[12];this.y=c[13];this.z=c[14];return this};m.prototype.setFromMatrixScale=function(c){var a=this.setFromMatrixColumn(c,0).length(),b=this.setFromMatrixColumn(c,1).length();c=this.setFromMatrixColumn(c,2).length();this.x=a;this.y=b;this.z=c;return this};m.prototype.setFromMatrixColumn=function(c,a){return this.fromArray(c.elements, +4*a)};m.prototype.setFromMatrix3Column=function(c,a){return this.fromArray(c.elements,3*a)};m.prototype.equals=function(c){return c.x===this.x&&c.y===this.y&&c.z===this.z};m.prototype.fromArray=function(c,a){void 0===a&&(a=0);this.x=c[a];this.y=c[a+1];this.z=c[a+2];return this};m.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);c[a]=this.x;c[a+1]=this.y;c[a+2]=this.z;return c};m.prototype.fromBufferAttribute=function(c,a,b){void 0!==b&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."); +this.x=c.getX(a);this.y=c.getY(a);this.z=c.getZ(a);return this};m.prototype.random=function(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this};m.prototype.isVector3=!0;var ah=new m,vi=new O,V=function(c,a){this.min=void 0!==c?c:new m(Infinity,Infinity,Infinity);this.max=void 0!==a?a:new m(-Infinity,-Infinity,-Infinity)};V.prototype.set=function(c,a){this.min.copy(c);this.max.copy(a);return this};V.prototype.setFromArray=function(c){for(var a=Infinity,b=Infinity,d=Infinity, +e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=c.length;he&&(e=n);k>f&&(f=k);m>g&&(g=m)}this.min.set(a,b,d);this.max.set(e,f,g);return this};V.prototype.setFromBufferAttribute=function(c){for(var a=Infinity,b=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=c.count;he&&(e=n);k>f&&(f=k);m>g&&(g=m)}this.min.set(a,b,d);this.max.set(e,f,g); +return this};V.prototype.setFromPoints=function(c){this.makeEmpty();for(var a=0,b=c.length;athis.max.x||c.ythis.max.y||c.zthis.max.z?!1:!0};V.prototype.containsBox=function(c){return this.min.x<=c.min.x&&c.max.x<=this.max.x&&this.min.y<=c.min.y&&c.max.y<=this.max.y&&this.min.z<=c.min.z&&c.max.z<=this.max.z}; +V.prototype.getParameter=function(c,a){void 0===a&&(console.warn("THREE.Box3: .getParameter() target is now required"),a=new m);return a.set((c.x-this.min.x)/(this.max.x-this.min.x),(c.y-this.min.y)/(this.max.y-this.min.y),(c.z-this.min.z)/(this.max.z-this.min.z))};V.prototype.intersectsBox=function(c){return c.max.xthis.max.x||c.max.ythis.max.y||c.max.zthis.max.z?!1:!0};V.prototype.intersectsSphere=function(c){this.clampPoint(c.center, +Le);return Le.distanceToSquared(c.center)<=c.radius*c.radius};V.prototype.intersectsPlane=function(c){if(0=-c.constant}; +V.prototype.intersectsTriangle=function(c){if(this.isEmpty())return!1;this.getCenter(Me);Kf.subVectors(this.max,Me);yd.subVectors(c.a,Me);zd.subVectors(c.b,Me);Ad.subVectors(c.c,Me);ec.subVectors(zd,yd);fc.subVectors(Ad,zd);Dc.subVectors(yd,Ad);c=[0,-ec.z,ec.y,0,-fc.z,fc.y,0,-Dc.z,Dc.y,ec.z,0,-ec.x,fc.z,0,-fc.x,Dc.z,0,-Dc.x,-ec.y,ec.x,0,-fc.y,fc.x,0,-Dc.y,Dc.x,0];if(!mg(c,yd,zd,Ad,Kf))return!1;c=[1,0,0,0,1,0,0,0,1];if(!mg(c,yd,zd,Ad,Kf))return!1;Lf.crossVectors(ec,fc);c=[Lf.x,Lf.y,Lf.z];return mg(c, +yd,zd,Ad,Kf)};V.prototype.clampPoint=function(c,a){void 0===a&&(console.warn("THREE.Box3: .clampPoint() target is now required"),a=new m);return a.copy(c).clamp(this.min,this.max)};V.prototype.distanceToPoint=function(c){return Le.copy(c).clamp(this.min,this.max).sub(c).length()};V.prototype.getBoundingSphere=function(c){void 0===c&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(c.center);c.radius=.5*this.getSize(Le).length();return c};V.prototype.intersect= +function(c){this.min.max(c.min);this.max.min(c.max);this.isEmpty()&&this.makeEmpty();return this};V.prototype.union=function(c){this.min.min(c.min);this.max.max(c.max);return this};V.prototype.applyMatrix4=function(c){if(this.isEmpty())return this;Gb[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(c);Gb[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(c);Gb[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(c);Gb[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(c);Gb[4].set(this.max.x, +this.min.y,this.min.z).applyMatrix4(c);Gb[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(c);Gb[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(c);Gb[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(c);this.setFromPoints(Gb);return this};V.prototype.translate=function(c){this.min.add(c);this.max.add(c);return this};V.prototype.equals=function(c){return c.min.equals(this.min)&&c.max.equals(this.max)};V.prototype.isBox3=!0;var Gb=[new m,new m,new m,new m,new m,new m,new m,new m],Le= +new m,bh=new V,yd=new m,zd=new m,Ad=new m,ec=new m,fc=new m,Dc=new m,Me=new m,Kf=new m,Lf=new m,jc=new m,Mk=new V,ha=function(c,a){this.center=void 0!==c?c:new m;this.radius=void 0!==a?a:-1};ha.prototype.set=function(c,a){this.center.copy(c);this.radius=a;return this};ha.prototype.setFromPoints=function(c,a){var b=this.center;void 0!==a?b.copy(a):Mk.setFromPoints(c).getCenter(b);for(var d=a=0,e=c.length;dthis.radius};ha.prototype.makeEmpty=function(){this.center.set(0,0,0);this.radius=-1;return this};ha.prototype.containsPoint=function(c){return c.distanceToSquared(this.center)<=this.radius*this.radius};ha.prototype.distanceToPoint=function(c){return c.distanceTo(this.center)-this.radius};ha.prototype.intersectsSphere= +function(c){var a=this.radius+c.radius;return c.center.distanceToSquared(this.center)<=a*a};ha.prototype.intersectsBox=function(c){return c.intersectsSphere(this)};ha.prototype.intersectsPlane=function(c){return Math.abs(c.distanceToPoint(this.center))<=this.radius};ha.prototype.clampPoint=function(c,a){var b=this.center.distanceToSquared(c);void 0===a&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),a=new m);a.copy(c);b>this.radius*this.radius&&(a.sub(this.center).normalize(), +a.multiplyScalar(this.radius).add(this.center));return a};ha.prototype.getBoundingBox=function(c){void 0===c&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),c=new V);if(this.isEmpty())return c.makeEmpty(),c;c.set(this.center,this.center);c.expandByScalar(this.radius);return c};ha.prototype.applyMatrix4=function(c){this.center.applyMatrix4(c);this.radius*=c.getMaxScaleOnAxis();return this};ha.prototype.translate=function(c){this.center.add(c);return this};ha.prototype.equals= +function(c){return c.center.equals(this.center)&&c.radius===this.radius};var Hb=new m,ch=new m,Mf=new m,gc=new m,dh=new m,Nf=new m,eh=new m,qa=function(c,a){this.origin=void 0!==c?c:new m;this.direction=void 0!==a?a:new m(0,0,-1)};qa.prototype.set=function(c,a){this.origin.copy(c);this.direction.copy(a);return this};qa.prototype.clone=function(){return(new this.constructor).copy(this)};qa.prototype.copy=function(c){this.origin.copy(c.origin);this.direction.copy(c.direction);return this};qa.prototype.at= +function(c,a){void 0===a&&(console.warn("THREE.Ray: .at() target is now required"),a=new m);return a.copy(this.direction).multiplyScalar(c).add(this.origin)};qa.prototype.lookAt=function(c){this.direction.copy(c).sub(this.origin).normalize();return this};qa.prototype.recast=function(c){this.origin.copy(this.at(c,Hb));return this};qa.prototype.closestPointToPoint=function(c,a){void 0===a&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),a=new m);a.subVectors(c,this.origin); +c=a.dot(this.direction);return 0>c?a.copy(this.origin):a.copy(this.direction).multiplyScalar(c).add(this.origin)};qa.prototype.distanceToPoint=function(c){return Math.sqrt(this.distanceSqToPoint(c))};qa.prototype.distanceSqToPoint=function(c){var a=Hb.subVectors(c,this.origin).dot(this.direction);if(0>a)return this.origin.distanceToSquared(c);Hb.copy(this.direction).multiplyScalar(a).add(this.origin);return Hb.distanceToSquared(c)};qa.prototype.distanceSqToSegment=function(c,a,b,d){ch.copy(c).add(a).multiplyScalar(.5); +Mf.copy(a).sub(c).normalize();gc.copy(this.origin).sub(ch);var e=.5*c.distanceTo(a),f=-this.direction.dot(Mf),g=gc.dot(this.direction),h=-gc.dot(Mf),l=gc.lengthSq(),n=Math.abs(1-f*f);if(0=-k?a<=k?(e=1/n,c*=e,a*=e,f=c*(c+f*a+2*g)+a*(f*c+a+2*h)+l):(a=e,c=Math.max(0,-(f*a+g)),f=-c*c+a*(a+2*h)+l):(a=-e,c=Math.max(0,-(f*a+g)),f=-c*c+a*(a+2*h)+l):a<=-k?(c=Math.max(0,-(-f*e+g)),a=0c)return null;c=Math.sqrt(c-d);d=b-c;b+=c;return 0>d&&0>b?null:0>d?this.at(b,a): +this.at(d,a)};qa.prototype.intersectsSphere=function(c){return this.distanceSqToPoint(c.center)<=c.radius*c.radius};qa.prototype.distanceToPlane=function(c){var a=c.normal.dot(this.direction);if(0===a)return 0===c.distanceToPoint(this.origin)?0:null;c=-(this.origin.dot(c.normal)+c.constant)/a;return 0<=c?c:null};qa.prototype.intersectPlane=function(c,a){c=this.distanceToPlane(c);return null===c?null:this.at(c,a)};qa.prototype.intersectsPlane=function(c){var a=c.distanceToPoint(this.origin);return 0=== +a||0>c.normal.dot(this.direction)*a?!0:!1};qa.prototype.intersectBox=function(c,a){var b=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=b){var g=(c.min.x-f.x)*b;b*=c.max.x-f.x}else g=(c.max.x-f.x)*b,b*=c.min.x-f.x;if(0<=d){var h=(c.min.y-f.y)*d;d*=c.max.y-f.y}else h=(c.max.y-f.y)*d,d*=c.min.y-f.y;if(g>d||h>b)return null;if(h>g||g!==g)g=h;if(dc||h>b)return null; +if(h>g||g!==g)g=h;if(cb?null:this.at(0<=g?g:b,a)};qa.prototype.intersectsBox=function(c){return null!==this.intersectBox(c,Hb)};qa.prototype.intersectTriangle=function(c,a,b,d,e){dh.subVectors(a,c);Nf.subVectors(b,c);eh.crossVectors(dh,Nf);a=this.direction.dot(eh);if(0a)d=-1,a=-a;else return null;gc.subVectors(this.origin,c);c=d*this.direction.dot(Nf.crossVectors(gc,Nf));if(0>c)return null;b=d*this.direction.dot(dh.cross(gc));if(0>b||c+b>a)return null; +c=-d*gc.dot(eh);return 0>c?null:this.at(c/a,e)};qa.prototype.applyMatrix4=function(c){this.origin.applyMatrix4(c);this.direction.transformDirection(c);return this};qa.prototype.equals=function(c){return c.origin.equals(this.origin)&&c.direction.equals(this.direction)};var z=function(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0this.determinant()&&(e=-e);c.x=d[12];c.y=d[13];c.z=d[14];ia.copy(this);c=1/e;d=1/f;var h=1/g;ia.elements[0]*=c;ia.elements[1]*=c;ia.elements[2]*=c;ia.elements[4]*=d;ia.elements[5]*=d;ia.elements[6]*=d;ia.elements[8]*=h;ia.elements[9]*=h;ia.elements[10]*=h;a.setFromRotationMatrix(ia);b.x=e;b.y=f;b.z=g;return this};z.prototype.makePerspective=function(c,a,b,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); +var g=this.elements;g[0]=2*e/(a-c);g[4]=0;g[8]=(a+c)/(a-c);g[12]=0;g[1]=0;g[5]=2*e/(b-d);g[9]=(b+d)/(b-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this};z.prototype.makeOrthographic=function(c,a,b,d,e,f){var g=this.elements,h=1/(a-c),l=1/(b-d),k=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((a+c)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((b+d)*l);g[2]=0;g[6]=0;g[10]=-2*k;g[14]=-((f+e)*k);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this};z.prototype.equals=function(c){var a= +this.elements;c=c.elements;for(var b=0;16>b;b++)if(a[b]!==c[b])return!1;return!0};z.prototype.fromArray=function(c,a){void 0===a&&(a=0);for(var b=0;16>b;b++)this.elements[b]=c[b+a];return this};z.prototype.toArray=function(c,a){void 0===c&&(c=[]);void 0===a&&(a=0);var b=this.elements;c[a]=b[0];c[a+1]=b[1];c[a+2]=b[2];c[a+3]=b[3];c[a+4]=b[4];c[a+5]=b[5];c[a+6]=b[6];c[a+7]=b[7];c[a+8]=b[8];c[a+9]=b[9];c[a+10]=b[10];c[a+11]=b[11];c[a+12]=b[12];c[a+13]=b[13];c[a+14]=b[14];c[a+15]=b[15];return c};z.prototype.isMatrix4= +!0;var Bd=new m,ia=new z,Nk=new m(0,0,0),Ok=new m(1,1,1),hc=new m,Of=new m,Ja=new m,ra=function f(a,b,d,e){void 0===a&&(a=0);void 0===b&&(b=0);void 0===d&&(d=0);void 0===e&&(e=f.DefaultOrder);this._x=a;this._y=b;this._z=d;this._order=e},Ib={x:{configurable:!0},y:{configurable:!0},z:{configurable:!0},order:{configurable:!0}};Ib.x.get=function(){return this._x};Ib.x.set=function(a){this._x=a;this._onChangeCallback()};Ib.y.get=function(){return this._y};Ib.y.set=function(a){this._y=a;this._onChangeCallback()}; +Ib.z.get=function(){return this._z};Ib.z.set=function(a){this._z=a;this._onChangeCallback()};Ib.order.get=function(){return this._order};Ib.order.set=function(a){this._order=a;this._onChangeCallback()};ra.prototype.set=function(a,b,d,e){this._x=a;this._y=b;this._z=d;this._order=e||this._order;this._onChangeCallback();return this};ra.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)};ra.prototype.copy=function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order= +a._order;this._onChangeCallback();return this};ra.prototype.setFromRotationMatrix=function(a,b,d){var e=T.clamp,f=a.elements;a=f[0];var g=f[4],h=f[8],l=f[1],k=f[5],r=f[9],m=f[2],q=f[6];f=f[10];b=b||this._order;switch(b){case "XYZ":this._y=Math.asin(e(h,-1,1));.9999999>Math.abs(h)?(this._x=Math.atan2(-r,f),this._z=Math.atan2(-g,a)):(this._x=Math.atan2(q,k),this._z=0);break;case "YXZ":this._x=Math.asin(-e(r,-1,1));.9999999>Math.abs(r)?(this._y=Math.atan2(h,f),this._z=Math.atan2(l,k)):(this._y=Math.atan2(-m, +a),this._z=0);break;case "ZXY":this._x=Math.asin(e(q,-1,1));.9999999>Math.abs(q)?(this._y=Math.atan2(-m,f),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(l,a));break;case "ZYX":this._y=Math.asin(-e(m,-1,1));.9999999>Math.abs(m)?(this._x=Math.atan2(q,f),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-g,k));break;case "YZX":this._z=Math.asin(e(l,-1,1));.9999999>Math.abs(l)?(this._x=Math.atan2(-r,k),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(h,f));break;case "XZY":this._z= +Math.asin(-e(g,-1,1));.9999999>Math.abs(g)?(this._x=Math.atan2(q,k),this._y=Math.atan2(h,a)):(this._x=Math.atan2(-r,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+b)}this._order=b;!1!==d&&this._onChangeCallback();return this};ra.prototype.setFromQuaternion=function(a,b,d){wi.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(wi,b,d)};ra.prototype.setFromVector3=function(a,b){return this.set(a.x,a.y,a.z,b||this._order)}; +ra.prototype.reorder=function(a){xi.setFromEuler(this);return this.setFromQuaternion(xi,a)};ra.prototype.equals=function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order};ra.prototype.fromArray=function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this._onChangeCallback();return this};ra.prototype.toArray=function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a};ra.prototype.toVector3= +function(a){return a?a.set(this._x,this._y,this._z):new m(this._x,this._y,this._z)};ra.prototype._onChange=function(a){this._onChangeCallback=a;return this};ra.prototype._onChangeCallback=function(){};Object.defineProperties(ra.prototype,Ib);ra.DefaultOrder="XYZ";ra.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");ra.prototype.isEuler=!0;var wi=new z,xi=new O,nb=function(){this.mask=1};nb.prototype.set=function(a){this.mask=1<e||1b&&0a&&0=Lb.x+Lb.y};S.getUV=function(a,b,d,e,f,g,h,l){this.getBarycoord(a,b,d,e,Lb);l.set(0,0);l.addScaledVector(f,Lb.x);l.addScaledVector(g,Lb.y);l.addScaledVector(h,Lb.z);return l};S.isFrontFacing=function(a,b,d,e){lb.subVectors(d,b);Kb.subVectors(a,b);return 0>lb.cross(Kb).dot(e)?!0:!1};S.prototype.set=function(a,b,d){this.a.copy(a);this.b.copy(b);this.c.copy(d);return this};S.prototype.setFromPointsAndIndices=function(a,b,d,e){this.a.copy(a[b]); +this.b.copy(a[d]);this.c.copy(a[e]);return this};S.prototype.clone=function(){return(new this.constructor).copy(this)};S.prototype.copy=function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this};S.prototype.getArea=function(){lb.subVectors(this.c,this.b);Kb.subVectors(this.a,this.b);return.5*lb.cross(Kb).length()};S.prototype.getMidpoint=function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new m);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/ +3)};S.prototype.getNormal=function(a){return S.getNormal(this.a,this.b,this.c,a)};S.prototype.getPlane=function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new W);return a.setFromCoplanarPoints(this.a,this.b,this.c)};S.prototype.getBarycoord=function(a,b){return S.getBarycoord(a,this.a,this.b,this.c,b)};S.prototype.getUV=function(a,b,d,e,f){return S.getUV(a,this.a,this.b,this.c,b,d,e,f)};S.prototype.containsPoint=function(a){return S.containsPoint(a,this.a, +this.b,this.c)};S.prototype.isFrontFacing=function(a){return S.isFrontFacing(this.a,this.b,this.c,a)};S.prototype.intersectsBox=function(a){return a.intersectsTriangle(this)};S.prototype.closestPointToPoint=function(a,b){void 0===b&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),b=new m);var d=this.a,e=this.b,f=this.c;Dd.subVectors(e,d);Ed.subVectors(f,d);hh.subVectors(a,d);var g=Dd.dot(hh),h=Ed.dot(hh);if(0>=g&&0>=h)return b.copy(d);ih.subVectors(a,e);var l=Dd.dot(ih), +k=Ed.dot(ih);if(0<=l&&k<=l)return b.copy(e);var r=g*k-l*h;if(0>=r&&0<=g&&0>=l)return e=g/(g-l),b.copy(d).addScaledVector(Dd,e);jh.subVectors(a,f);a=Dd.dot(jh);var u=Ed.dot(jh);if(0<=u&&a<=u)return b.copy(f);g=a*h-g*u;if(0>=g&&0<=h&&0>=u)return r=h/(h-u),b.copy(d).addScaledVector(Ed,r);h=l*u-a*k;if(0>=h&&0<=k-l&&0<=a-u)return Ci.subVectors(f,e),r=(k-l)/(k-l+(a-u)),b.copy(e).addScaledVector(Ci,r);f=1/(h+g+r);e=g*f;r*=f;return b.copy(d).addScaledVector(Dd,e).addScaledVector(Ed,r)};S.prototype.equals= +function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)};var Di={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017, +darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671, +gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753, +lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739, +orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944, +slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Qa={h:0,s:0,l:0},Qf={h:0,s:0,l:0},x=function(a,b,d){return void 0===b&&void 0===d?this.set(a):this.setRGB(a,b,d)};x.prototype.set=function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this}; +x.prototype.setScalar=function(a){this.b=this.g=this.r=a;return this};x.prototype.setHex=function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this};x.prototype.setRGB=function(a,b,d){this.r=a;this.g=b;this.b=d;return this};x.prototype.setHSL=function(a,b,d){a=T.euclideanModulo(a,1);b=T.clamp(b,0,1);d=T.clamp(d,0,1);0===b?this.r=this.g=this.b=d:(b=.5>=d?d*(1+b):d+b-d*b,d=2*d-b,this.r=ng(d,b,a+1/3),this.g=ng(d,b,a),this.b=ng(d,b,a-1/3));return this};x.prototype.setStyle= +function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var d;if(d=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var e=d[2];switch(d[1]){case "rgb":case "rgba":if(d=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(e))return this.r=Math.min(255,parseInt(d[1],10))/255,this.g=Math.min(255,parseInt(d[2],10))/255,this.b=Math.min(255,parseInt(d[3],10))/255,b(d[5]),this;if(d=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(e))return this.r= +Math.min(100,parseInt(d[1],10))/100,this.g=Math.min(100,parseInt(d[2],10))/100,this.b=Math.min(100,parseInt(d[3],10))/100,b(d[5]),this;break;case "hsl":case "hsla":if(d=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(e)){e=parseFloat(d[1])/360;var f=parseInt(d[2],10)/100,g=parseInt(d[3],10)/100;b(d[5]);return this.setHSL(e,f,g)}}}else if(d=/^#([A-Fa-f0-9]+)$/.exec(a)){d=d[1];e=d.length;if(3===e)return this.r=parseInt(d.charAt(0)+d.charAt(0),16)/255,this.g=parseInt(d.charAt(1)+ +d.charAt(1),16)/255,this.b=parseInt(d.charAt(2)+d.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(d.charAt(0)+d.charAt(1),16)/255,this.g=parseInt(d.charAt(2)+d.charAt(3),16)/255,this.b=parseInt(d.charAt(4)+d.charAt(5),16)/255,this}return a&&0=l?k/(f+g):k/(2-f-g);switch(f){case b:h=(d-e)/k+(dthis.opacity&&(e.opacity=this.opacity);!0===this.transparent&&(e.transparent=this.transparent);e.depthFunc=this.depthFunc;e.depthTest=this.depthTest;e.depthWrite=this.depthWrite;e.stencilWrite=this.stencilWrite;e.stencilWriteMask=this.stencilWriteMask;e.stencilFunc=this.stencilFunc;e.stencilRef=this.stencilRef;e.stencilFuncMask=this.stencilFuncMask;e.stencilFail=this.stencilFail;e.stencilZFail=this.stencilZFail;e.stencilZPass=this.stencilZPass;this.rotation&& +0!==this.rotation&&(e.rotation=this.rotation);!0===this.polygonOffset&&(e.polygonOffset=!0);0!==this.polygonOffsetFactor&&(e.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(e.polygonOffsetUnits=this.polygonOffsetUnits);this.linewidth&&1!==this.linewidth&&(e.linewidth=this.linewidth);void 0!==this.dashSize&&(e.dashSize=this.dashSize);void 0!==this.gapSize&&(e.gapSize=this.gapSize);void 0!==this.scale&&(e.scale=this.scale);!0===this.dithering&&(e.dithering=!0);0h;h++)if(g[h]===g[(h+1)%3]){a.push(e);break}for(d=a.length-1;0<=d;d--)for(e=a[d],this.faces.splice(e,1),f=0,g=this.faceVertexUvs.length;f\n\t\t\t\t#include \n\n\t\t\t}\n\t\t", +fragmentShader:"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",side:1,blending:0});e.uniforms.tEquirect.value=b;d=new na(d,e);e=b.minFilter;var f=a.getRenderList(),g=a.getRenderTarget(),h=a.getRenderState();1008===b.minFilter&&(b.minFilter= +1006);(new Sc(1,10,this)).update(a,d);b.minFilter=e;a.setRenderTarget(g);a.setRenderList(f);a.setRenderState(h);d.geometry.dispose();d.material.dispose();return this};nc.prototype=Object.create(fa.prototype);nc.prototype.constructor=nc;nc.prototype.isDataTexture=!0;var Gd=new ha,Tf=new m,Ma=function(a,b,d,e,f,g){this.planes=[void 0!==a?a:new W,void 0!==b?b:new W,void 0!==d?d:new W,void 0!==e?e:new W,void 0!==f?f:new W,void 0!==g?g:new W]};Ma.prototype.set=function(a,b,d,e,f,g){var h=this.planes;h[0].copy(a); +h[1].copy(b);h[2].copy(d);h[3].copy(e);h[4].copy(f);h[5].copy(g);return this};Ma.prototype.clone=function(){return(new this.constructor).copy(this)};Ma.prototype.copy=function(a){for(var b=this.planes,d=0;6>d;d++)b[d].copy(a.planes[d]);return this};Ma.prototype.setFromProjectionMatrix=function(a){var b=this.planes,d=a.elements;a=d[0];var e=d[1],f=d[2],g=d[3],h=d[4],l=d[5],k=d[6],m=d[7],u=d[8],q=d[9],v=d[10],t=d[11],p=d[12],x=d[13],y=d[14];d=d[15];b[0].setComponents(g-a,m-h,t-u,d-p).normalize();b[1].setComponents(g+ +a,m+h,t+u,d+p).normalize();b[2].setComponents(g+e,m+l,t+q,d+x).normalize();b[3].setComponents(g-e,m-l,t-q,d-x).normalize();b[4].setComponents(g-f,m-k,t-v,d-y).normalize();b[5].setComponents(g+f,m+k,t+v,d+y).normalize();return this};Ma.prototype.intersectsObject=function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();Gd.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(Gd)};Ma.prototype.intersectsSprite=function(a){Gd.center.set(0,0,0);Gd.radius= +.7071067811865476;Gd.applyMatrix4(a.matrixWorld);return this.intersectsSphere(Gd)};Ma.prototype.intersectsSphere=function(a){var b=this.planes,d=a.center;a=-a.radius;for(var e=0;6>e;e++)if(b[e].distanceToPoint(d)d;d++){var e=b[d];Tf.x=0e.distanceToPoint(Tf))return!1}return!0};Ma.prototype.containsPoint=function(a){for(var b= +this.planes,d=0;6>d;d++)if(0>b[d].distanceToPoint(a))return!1;return!0};Ud.prototype=Object.create(P.prototype);Ud.prototype.constructor=Ud;oc.prototype=Object.create(G.prototype);oc.prototype.constructor=oc;var U={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif", bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif", clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif", @@ -612,9 +617,9 @@ cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMip defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif", displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif", emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}", -envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif", +envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif", envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif", -envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif", +envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif", envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif", fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif", @@ -674,400 +679,410 @@ points_vert:"uniform float size;\nuniform float scale;\n#include \n#incl shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}", sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * 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\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"}, -Xa={basic:{uniforms:xa([H.common,H.specularmap,H.envmap,H.aomap,H.lightmap,H.fog]),vertexShader:O.meshbasic_vert,fragmentShader:O.meshbasic_frag},lambert:{uniforms:xa([H.common,H.specularmap,H.envmap,H.aomap,H.lightmap,H.emissivemap,H.fog,H.lights,{emissive:{value:new J(0)}}]),vertexShader:O.meshlambert_vert,fragmentShader:O.meshlambert_frag},phong:{uniforms:xa([H.common,H.specularmap,H.envmap,H.aomap,H.lightmap,H.emissivemap,H.bumpmap,H.normalmap,H.displacementmap,H.fog,H.lights,{emissive:{value:new J(0)}, -specular:{value:new J(1118481)},shininess:{value:30}}]),vertexShader:O.meshphong_vert,fragmentShader:O.meshphong_frag},standard:{uniforms:xa([H.common,H.envmap,H.aomap,H.lightmap,H.emissivemap,H.bumpmap,H.normalmap,H.displacementmap,H.roughnessmap,H.metalnessmap,H.fog,H.lights,{emissive:{value:new J(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:O.meshphysical_vert,fragmentShader:O.meshphysical_frag},toon:{uniforms:xa([H.common,H.aomap,H.lightmap,H.emissivemap, -H.bumpmap,H.normalmap,H.displacementmap,H.gradientmap,H.fog,H.lights,{emissive:{value:new J(0)}}]),vertexShader:O.meshtoon_vert,fragmentShader:O.meshtoon_frag},matcap:{uniforms:xa([H.common,H.bumpmap,H.normalmap,H.displacementmap,H.fog,{matcap:{value:null}}]),vertexShader:O.meshmatcap_vert,fragmentShader:O.meshmatcap_frag},points:{uniforms:xa([H.points,H.fog]),vertexShader:O.points_vert,fragmentShader:O.points_frag},dashed:{uniforms:xa([H.common,H.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]), -vertexShader:O.linedashed_vert,fragmentShader:O.linedashed_frag},depth:{uniforms:xa([H.common,H.displacementmap]),vertexShader:O.depth_vert,fragmentShader:O.depth_frag},normal:{uniforms:xa([H.common,H.bumpmap,H.normalmap,H.displacementmap,{opacity:{value:1}}]),vertexShader:O.normal_vert,fragmentShader:O.normal_frag},sprite:{uniforms:xa([H.sprite,H.fog]),vertexShader:O.sprite_vert,fragmentShader:O.sprite_frag},background:{uniforms:{uvTransform:{value:new za},t2D:{value:null}},vertexShader:O.background_vert, -fragmentShader:O.background_frag},cube:{uniforms:xa([H.envmap,{opacity:{value:1}}]),vertexShader:O.cube_vert,fragmentShader:O.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:O.equirect_vert,fragmentShader:O.equirect_frag},distanceRGBA:{uniforms:xa([H.common,H.displacementmap,{referencePosition:{value:new m},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:O.distanceRGBA_vert,fragmentShader:O.distanceRGBA_frag},shadow:{uniforms:xa([H.lights,H.fog,{color:{value:new J(0)}, -opacity:{value:1}}]),vertexShader:O.shadow_vert,fragmentShader:O.shadow_frag}};Xa.physical={uniforms:xa([Xa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new u(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new J(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:O.meshphysical_vert,fragmentShader:O.meshphysical_frag};sb.prototype=Object.create(aa.prototype);sb.prototype.constructor= -sb;sb.prototype.isCubeTexture=!0;Object.defineProperty(sb.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Nc.prototype=Object.create(aa.prototype);Nc.prototype.constructor=Nc;Nc.prototype.isDataTexture2DArray=!0;Oc.prototype=Object.create(aa.prototype);Oc.prototype.constructor=Oc;Oc.prototype.isDataTexture3D=!0;var Dh=new aa,Gj=new Nc,Ij=new Oc,Eh=new sb,xh=[],zh=[],Ch=new Float32Array(16),Bh=new Float32Array(9),Ah=new Float32Array(4);Fh.prototype.updateCache= -function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ka(b,a)};Gh.prototype.setValue=function(a,b,c){for(var d=this.seq,e=0,f=d.length;e!==f;++e){var g=d[e];g.setValue(a,b[g.id],c)}};var lg=/([\w\d_]+)(\])?(\[|\.)?/g;Gb.prototype.setValue=function(a,b,c,d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Gb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Gb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!== -f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Gb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var nk=0,ng=/^[ \t]*#include +<([\w\d./]+)>/gm,Ph=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Oh=/#pragma unroll_loop_start[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,xk=0;Hb.prototype=Object.create(L.prototype); -Hb.prototype.constructor=Hb;Hb.prototype.isMeshDepthMaterial=!0;Hb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};Ib.prototype=Object.create(L.prototype); -Ib.prototype.constructor=Ib;Ib.prototype.isMeshDistanceMaterial=!0;Ib.prototype.copy=function(a){L.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};Pe.prototype=Object.assign(Object.create(Y.prototype), -{constructor:Pe,isArrayCamera:!0});Kb.prototype=Object.assign(Object.create(C.prototype),{constructor:Kb,isGroup:!0});Object.assign(Pd.prototype,{constructor:Pd,getHandSpace:function(){if(null===this._hand&&(this._hand=new Kb,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var a=0;a<=window.XRHand.LITTLE_PHALANX_TIP;a++){var b=new Kb;b.matrixAutoUpdate=!1;b.visible=!1;this._hand.joints.push(b);this._hand.add(b)}return this._hand}, -getTargetRaySpace:function(){null===this._targetRay&&(this._targetRay=new Kb,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1);return this._targetRay},getGripSpace:function(){null===this._grip&&(this._grip=new Kb,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1);return this._grip},dispatchEvent:function(a){null!==this._targetRay&&this._targetRay.dispatchEvent(a);null!==this._grip&&this._grip.dispatchEvent(a);null!==this._hand&&this._hand.dispatchEvent(a);return this},disconnect:function(a){this.dispatchEvent({type:"disconnected", -data:a});null!==this._targetRay&&(this._targetRay.visible=!1);null!==this._grip&&(this._grip.visible=!1);null!==this._hand&&(this._hand.visible=!1);return this},update:function(a,b,c){var d=null,e=null,f=null,g=this._targetRay,h=this._grip,l=this._hand;if(a)if(l&&a.hand){f=!0;for(var k=0;k<=window.XRHand.LITTLE_PHALANX_TIP;k++)if(a.hand[k]){var q=b.getJointPose(a.hand[k],c),p=l.joints[k];null!==q&&(p.matrix.fromArray(q.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius= -q.radius);p.visible=null!==q;q=l.joints[window.XRHand.INDEX_PHALANX_TIP].position.distanceTo(l.joints[window.XRHand.THUMB_PHALANX_TIP].position);l.inputState.pinching&&.025=q&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:a.handedness,target:this}))}}else null!==g&&(d=b.getPose(a.targetRaySpace,c),null!==d&&(g.matrix.fromArray(d.transform.matrix), -g.matrix.decompose(g.position,g.rotation,g.scale))),null!==h&&a.gripSpace&&(e=b.getPose(a.gripSpace,c),null!==e&&(h.matrix.fromArray(e.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale)));null!==g&&(g.visible=null!==d);null!==h&&(h.visible=null!==e);null!==l&&(l.visible=null!==f);return this}});Object.assign(Vh.prototype,va.prototype);rg.prototype=Object.assign(Object.create(Qd.prototype),{constructor:rg,isWebGL1Renderer:!0});Object.assign(Qe.prototype,{isFogExp2:!0,clone:function(){return new Qe(this.color, -this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Re.prototype,{isFog:!0,clone:function(){return new Re(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(La.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(La.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(a){this.usage= -a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.usage=a.usage;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;da.far||b.push({distance:e,point:Ee.clone(),uv:ya.getUV(Ee,Mf,Fe,Nf,Ci,kh,Di,new u),face:null,object:this})},copy:function(a){C.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);this.material=a.material;return this}});var Of=new m,Ei=new m;Td.prototype=Object.assign(Object.create(C.prototype),{constructor:Td, -isLOD:!0,copy:function(a){C.prototype.copy.call(this,a,!1);for(var b=a.levels,c=0,d=b.length;c=b[d].distance)b[d-1].object.visible= -!1,b[d].object.visible=!0;else break;for(this._currentLevel=d-1;df;f++)if(l=c.getComponent(f),0!==l){var k=b.getComponent(f);e.multiplyMatrices(h.bones[k].matrixWorld,h.boneInverses[k]);g.addScaledVector(d.copy(a).applyMatrix4(e),l)}return g.applyMatrix4(this.bindMatrixInverse)}}()});var Fi=new R,Sk=new R;Object.assign(Ue.prototype, -{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;ad||(h.applyMatrix4(this.matrixWorld),A=a.ray.origin.distanceTo(h),Aa.far||b.push({distance:A,point:e.clone().applyMatrix4(this.matrixWorld),index:q,face:null,faceIndex:null,object:this}))}}else for(k=0,q=c.length/3-1;kd||(h.applyMatrix4(this.matrixWorld), -p=a.ray.origin.distanceTo(h),pa.far||b.push({distance:p,point:e.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}else if(c.isGeometry)for(f=c.vertices,g=f.length,c=0;cd||(h.applyMatrix4(this.matrixWorld),k=a.ray.origin.distanceTo(h),ka.far||b.push({distance:k,point:e.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}))}},updateMorphTargets:function(){var a= -this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Tc.prototype=Object.create(aa.prototype);Tc.prototype.constructor=Tc;Tc.prototype.isCompressedTexture=!0;Ud.prototype=Object.create(aa.prototype);Ud.prototype.constructor=Ud;Ud.prototype.isCanvasTexture=!0;Vd.prototype=Object.create(aa.prototype);Vd.prototype.constructor=Vd;Vd.prototype.isDepthTexture=!0;Uc.prototype=Object.create(F.prototype); -Uc.prototype.constructor=Uc;Wd.prototype=Object.create(G.prototype);Wd.prototype.constructor=Wd;Vc.prototype=Object.create(F.prototype);Vc.prototype.constructor=Vc;Xd.prototype=Object.create(G.prototype);Xd.prototype.constructor=Xd;Ga.prototype=Object.create(F.prototype);Ga.prototype.constructor=Ga;Yd.prototype=Object.create(G.prototype);Yd.prototype.constructor=Yd;Wc.prototype=Object.create(Ga.prototype);Wc.prototype.constructor=Wc;Zd.prototype=Object.create(G.prototype);Zd.prototype.constructor= -Zd;hc.prototype=Object.create(Ga.prototype);hc.prototype.constructor=hc;$d.prototype=Object.create(G.prototype);$d.prototype.constructor=$d;Xc.prototype=Object.create(Ga.prototype);Xc.prototype.constructor=Xc;ae.prototype=Object.create(G.prototype);ae.prototype.constructor=ae;Yc.prototype=Object.create(Ga.prototype);Yc.prototype.constructor=Yc;be.prototype=Object.create(G.prototype);be.prototype.constructor=be;ic.prototype=Object.create(F.prototype);ic.prototype.constructor=ic;ic.prototype.toJSON= -function(){var a=F.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};ce.prototype=Object.create(G.prototype);ce.prototype.constructor=ce;Zc.prototype=Object.create(F.prototype);Zc.prototype.constructor=Zc;de.prototype=Object.create(G.prototype);de.prototype.constructor=de;$c.prototype=Object.create(F.prototype);$c.prototype.constructor=$c;var Tk={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=Yh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g; -var h;if(d){var l=c;d=[];var k;var q=0;for(k=b.length;q80*c){var r=h=a[0];var t=d=a[1];for(l=c;lh&&(h=q),b>d&&(d=b);h=Math.max(h-r,d-t);h=0!==h?1/h:0}fe(f,g,c,r,t,h);return g}},tb={area:function(a){for(var b=a.length,c=0, -d=b-1,e=0;etb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];bi(a);ci(c,a);a=a.length;b.forEach(bi);for(var f=0;fMath.abs(g-l)?[new u(a,1-c),new u(h,1-d),new u(k,1-e),new u(p,1-b)]:[new u(g,1-c),new u(l,1-d),new u(q,1-e),new u(m,1-b)]}};he.prototype=Object.create(G.prototype);he.prototype.constructor=he;bd.prototype=Object.create(ib.prototype);bd.prototype.constructor=bd;ie.prototype=Object.create(G.prototype);ie.prototype.constructor=ie;kc.prototype=Object.create(F.prototype);kc.prototype.constructor=kc;je.prototype=Object.create(G.prototype);je.prototype.constructor= -je;cd.prototype=Object.create(F.prototype);cd.prototype.constructor=cd;ke.prototype=Object.create(G.prototype);ke.prototype.constructor=ke;dd.prototype=Object.create(F.prototype);dd.prototype.constructor=dd;lc.prototype=Object.create(G.prototype);lc.prototype.constructor=lc;lc.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this);return ei(this.parameters.shapes,a)};mc.prototype=Object.create(F.prototype);mc.prototype.constructor=mc;mc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this); -return ei(this.parameters.shapes,a)};ed.prototype=Object.create(F.prototype);ed.prototype.constructor=ed;nc.prototype=Object.create(G.prototype);nc.prototype.constructor=nc;ub.prototype=Object.create(F.prototype);ub.prototype.constructor=ub;le.prototype=Object.create(nc.prototype);le.prototype.constructor=le;me.prototype=Object.create(ub.prototype);me.prototype.constructor=me;ne.prototype=Object.create(G.prototype);ne.prototype.constructor=ne;fd.prototype=Object.create(F.prototype);fd.prototype.constructor= -fd;var ka=Object.freeze({__proto__:null,WireframeGeometry:Uc,ParametricGeometry:Wd,ParametricBufferGeometry:Vc,TetrahedronGeometry:Yd,TetrahedronBufferGeometry:Wc,OctahedronGeometry:Zd,OctahedronBufferGeometry:hc,IcosahedronGeometry:$d,IcosahedronBufferGeometry:Xc,DodecahedronGeometry:ae,DodecahedronBufferGeometry:Yc,PolyhedronGeometry:Xd,PolyhedronBufferGeometry:Ga,TubeGeometry:be,TubeBufferGeometry:ic,TorusKnotGeometry:ce,TorusKnotBufferGeometry:Zc,TorusGeometry:de,TorusBufferGeometry:$c,TextGeometry:he, -TextBufferGeometry:bd,SphereGeometry:ie,SphereBufferGeometry:kc,RingGeometry:je,RingBufferGeometry:cd,PlaneGeometry:Ld,PlaneBufferGeometry:fc,LatheGeometry:ke,LatheBufferGeometry:dd,ShapeGeometry:lc,ShapeBufferGeometry:mc,ExtrudeGeometry:jc,ExtrudeBufferGeometry:ib,EdgesGeometry:ed,ConeGeometry:le,ConeBufferGeometry:me,CylinderGeometry:nc,CylinderBufferGeometry:ub,CircleGeometry:ne,CircleBufferGeometry:fd,BoxGeometry:Jc,BoxBufferGeometry:Fb});oc.prototype=Object.create(L.prototype);oc.prototype.constructor= -oc;oc.prototype.isShadowMaterial=!0;oc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);return this};vb.prototype=Object.create(Ea.prototype);vb.prototype.constructor=vb;vb.prototype.isRawShaderMaterial=!0;jb.prototype=Object.create(L.prototype);jb.prototype.constructor=jb;jb.prototype.isMeshStandardMaterial=!0;jb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness; +J={common:{diffuse:{value:new x(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new X},uv2Transform:{value:new X},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}}, +normalmap:{normalMap:{value:null},normalScale:{value:new p(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new x(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{}, +color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{}, +position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new x(15658734)},opacity:{value:1},size:{value:1}, +scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new X}},sprite:{diffuse:{value:new x(15658734)},opacity:{value:1},center:{value:new p(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new X}}},db={basic:{uniforms:oa([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.fog]),vertexShader:U.meshbasic_vert,fragmentShader:U.meshbasic_frag},lambert:{uniforms:oa([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.fog,J.lights, +{emissive:{value:new x(0)}}]),vertexShader:U.meshlambert_vert,fragmentShader:U.meshlambert_frag},phong:{uniforms:oa([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.bumpmap,J.normalmap,J.displacementmap,J.fog,J.lights,{emissive:{value:new x(0)},specular:{value:new x(1118481)},shininess:{value:30}}]),vertexShader:U.meshphong_vert,fragmentShader:U.meshphong_frag},standard:{uniforms:oa([J.common,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.bumpmap,J.normalmap,J.displacementmap,J.roughnessmap, +J.metalnessmap,J.fog,J.lights,{emissive:{value:new x(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:U.meshphysical_vert,fragmentShader:U.meshphysical_frag},toon:{uniforms:oa([J.common,J.aomap,J.lightmap,J.emissivemap,J.bumpmap,J.normalmap,J.displacementmap,J.gradientmap,J.fog,J.lights,{emissive:{value:new x(0)}}]),vertexShader:U.meshtoon_vert,fragmentShader:U.meshtoon_frag},matcap:{uniforms:oa([J.common,J.bumpmap,J.normalmap,J.displacementmap,J.fog,{matcap:{value:null}}]), +vertexShader:U.meshmatcap_vert,fragmentShader:U.meshmatcap_frag},points:{uniforms:oa([J.points,J.fog]),vertexShader:U.points_vert,fragmentShader:U.points_frag},dashed:{uniforms:oa([J.common,J.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:U.linedashed_vert,fragmentShader:U.linedashed_frag},depth:{uniforms:oa([J.common,J.displacementmap]),vertexShader:U.depth_vert,fragmentShader:U.depth_frag},normal:{uniforms:oa([J.common,J.bumpmap,J.normalmap,J.displacementmap,{opacity:{value:1}}]), +vertexShader:U.normal_vert,fragmentShader:U.normal_frag},sprite:{uniforms:oa([J.sprite,J.fog]),vertexShader:U.sprite_vert,fragmentShader:U.sprite_frag},background:{uniforms:{uvTransform:{value:new X},t2D:{value:null}},vertexShader:U.background_vert,fragmentShader:U.background_frag},cube:{uniforms:oa([J.envmap,{opacity:{value:1}}]),vertexShader:U.cube_vert,fragmentShader:U.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:U.equirect_vert,fragmentShader:U.equirect_frag},distanceRGBA:{uniforms:oa([J.common, +J.displacementmap,{referencePosition:{value:new m},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:U.distanceRGBA_vert,fragmentShader:U.distanceRGBA_frag},shadow:{uniforms:oa([J.lights,J.fog,{color:{value:new x(0)},opacity:{value:1}}]),vertexShader:U.shadow_vert,fragmentShader:U.shadow_frag}};db.physical={uniforms:oa([db.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new p(1, +1)},clearcoatNormalMap:{value:null},sheen:{value:new x(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:U.meshphysical_vert,fragmentShader:U.meshphysical_frag};zb.prototype=Object.create(fa.prototype);zb.prototype.constructor=zb;zb.prototype.isCubeTexture=!0;Object.defineProperty(zb.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Tc.prototype=Object.create(fa.prototype);Tc.prototype.constructor=Tc;Tc.prototype.isDataTexture2DArray=!0;Uc.prototype= +Object.create(fa.prototype);Uc.prototype.constructor=Uc;Uc.prototype.isDataTexture3D=!0;var Hh=new fa,Jj=new Tc,Lj=new Uc,Ih=new zb,Bh=[],Dh=[],Gh=new Float32Array(16),Fh=new Float32Array(9),Eh=new Float32Array(4);Jh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ta(b,a)};Kh.prototype.setValue=function(a,b,d){for(var e=this.seq,f=0,g=e.length;f!==g;++f){var h=e[f];h.setValue(a,b[h.id],d)}};var tg=/([\w\d_]+)(\])?(\[|\.)?/g; +Rb.prototype.setValue=function(a,b,d,e){b=this.map[b];void 0!==b&&b.setValue(a,d,e)};Rb.prototype.setOptional=function(a,b,d){b=b[d];void 0!==b&&this.setValue(a,d,b)};Rb.upload=function(a,b,d,e){for(var f=0,g=b.length;f!==g;++f){var h=b[f],l=d[h.id];!1!==l.needsUpdate&&h.setValue(a,l.value,e)}};Rb.seqWithValue=function(a,b){for(var d=[],e=0,f=a.length;e!==f;++e){var g=a[e];g.id in b&&d.push(g)}return d};var qk=0,vg=/^[ \t]*#include +<([\w\d./]+)>/gm,Th=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, +Sh=/#pragma unroll_loop_start[\s]+?for\s*\(\s*int i = (\d+); i < (\d+); i\s*\+\+\s*\)\s*{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,Ak=0;Sb.prototype=Object.create(L.prototype);Sb.prototype.constructor=Sb;Sb.prototype.isMeshDepthMaterial=!0;Sb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale= +a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};Tb.prototype=Object.create(L.prototype);Tb.prototype.constructor=Tb;Tb.prototype.isMeshDistanceMaterial=!0;Tb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap= +a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};$e.prototype=Object.assign(Object.create(ta.prototype),{constructor:$e,isArrayCamera:!0});Vb.prototype=Object.assign(Object.create(F.prototype),{constructor:Vb,isGroup:!0});Object.assign(Yd.prototype,{constructor:Yd,getHandSpace:function(){if(null===this._hand&&(this._hand=new Vb,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[], +this._hand.inputState={pinching:!1},window.XRHand))for(var a=0;a<=window.XRHand.LITTLE_PHALANX_TIP;a++){var b=new Vb;b.matrixAutoUpdate=!1;b.visible=!1;this._hand.joints.push(b);this._hand.add(b)}return this._hand},getTargetRaySpace:function(){null===this._targetRay&&(this._targetRay=new Vb,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1);return this._targetRay},getGripSpace:function(){null===this._grip&&(this._grip=new Vb,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1);return this._grip}, +dispatchEvent:function(a){null!==this._targetRay&&this._targetRay.dispatchEvent(a);null!==this._grip&&this._grip.dispatchEvent(a);null!==this._hand&&this._hand.dispatchEvent(a);return this},disconnect:function(a){this.dispatchEvent({type:"disconnected",data:a});null!==this._targetRay&&(this._targetRay.visible=!1);null!==this._grip&&(this._grip.visible=!1);null!==this._hand&&(this._hand.visible=!1);return this},update:function(a,b,d){var e=null,f=null,g=null,h=this._targetRay,l=this._grip,k=this._hand; +if(a)if(k&&a.hand){g=!0;for(var m=0;m<=window.XRHand.LITTLE_PHALANX_TIP;m++)if(a.hand[m]){var u=b.getJointPose(a.hand[m],d),q=k.joints[m];null!==u&&(q.matrix.fromArray(u.transform.matrix),q.matrix.decompose(q.position,q.rotation,q.scale),q.jointRadius=u.radius);q.visible=null!==u;u=k.joints[window.XRHand.INDEX_PHALANX_TIP].position.distanceTo(k.joints[window.XRHand.THUMB_PHALANX_TIP].position);k.inputState.pinching&&.025=u&&(k.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:a.handedness,target:this}))}}else null!==h&&(e=b.getPose(a.targetRaySpace,d),null!==e&&(h.matrix.fromArray(e.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale))),null!==l&&a.gripSpace&&(f=b.getPose(a.gripSpace,d),null!==f&&(l.matrix.fromArray(f.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale)));null!==h&&(h.visible=null!==e);null!==l&&(l.visible= +null!==f);null!==k&&(k.visible=null!==g);return this}});Object.assign(Zh.prototype,La.prototype);yg.prototype=Object.assign(Object.create(Zd.prototype),{constructor:yg,isWebGL1Renderer:!0});var Hd=function(a,b){this.name="";this.color=new x(a);this.density=void 0!==b?b:2.5E-4};Hd.prototype.clone=function(){return new Hd(this.color,this.density)};Hd.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}};Hd.prototype.isFogExp2=!0;var Id=function(a,b,d){this.name= +"";this.color=new x(a);this.near=void 0!==b?b:1;this.far=void 0!==d?d:1E3};Id.prototype.clone=function(){return new Id(this.color,this.near,this.far)};Id.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}};Id.prototype.isFog=!0;Ab.prototype=Object.create(F.prototype);Ab.prototype.constructor=Ab;Ab.prototype.copy=function(a,b){F.prototype.copy.call(this,a,b);null!==a.background&&(this.background=a.background.clone());null!==a.environment&&(this.environment= +a.environment.clone());null!==a.fog&&(this.fog=a.fog.clone());null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone());this.autoUpdate=a.autoUpdate;this.matrixAutoUpdate=a.matrixAutoUpdate;return this};Ab.prototype.toJSON=function(a){var b=F.prototype.toJSON.call(this,a);null!==this.background&&(b.object.background=this.background.toJSON(a));null!==this.environment&&(b.object.environment=this.environment.toJSON(a));null!==this.fog&&(b.object.fog=this.fog.toJSON());return b};Ab.prototype.isScene= +!0;Object.defineProperty(Va.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(Va.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(a){this.usage=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.usage=a.usage;return this},copyAt:function(a,b,d){a*=this.stride;d*=b.stride;for(var e=0,f=this.stride;ea.far||b.push({distance:f,point:Pe.clone(),uv:S.getUV(Pe,Uf,Qe,Vf,Fi,oh,Gi,new p),face:null,object:this})},copy:function(a){F.prototype.copy.call(this,a);void 0!== +a.center&&this.center.copy(a.center);this.material=a.material;return this}});var Wf=new m,Hi=new m;be.prototype=Object.assign(Object.create(F.prototype),{constructor:be,isLOD:!0,copy:function(a){F.prototype.copy.call(this,a,!1);for(var b=a.levels,d=0,e=b.length;d=b[e].distance)b[e-1].object.visible=!1,b[e].object.visible=!0;else break;for(this._currentLevel=e-1;eg;g++)if(k=d.getComponent(g),0!==k){var m=b.getComponent(g);f.multiplyMatrices(l.bones[m].matrixWorld,l.boneInverses[m]); +h.addScaledVector(e.copy(a).applyMatrix4(f),k)}return h.applyMatrix4(this.bindMatrixInverse)}}()});var Ii=new z,Vk=new z;Object.assign(cf.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;ae||(l.applyMatrix4(this.matrixWorld),v=a.ray.origin.distanceTo(l),va.far||b.push({distance:v,point:f.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}}else for(r=0,u=d.length/3-1;re||(l.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(l),qa.far||b.push({distance:q,point:f.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this}))}else if(d.isGeometry)for(g=d.vertices,h=g.length,d=0;de||(l.applyMatrix4(this.matrixWorld),r=a.ray.origin.distanceTo(l),ra.far||b.push({distance:r,point:f.clone().applyMatrix4(this.matrixWorld), +index:d,face:null,faceIndex:null,object:this}))}},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Zc.prototype=Object.create(fa.prototype);Zc.prototype.constructor=Zc;Zc.prototype.isCompressedTexture=!0;ce.prototype=Object.create(fa.prototype);ce.prototype.constructor=ce;ce.prototype.isCanvasTexture=!0;de.prototype=Object.create(fa.prototype);de.prototype.constructor=de;de.prototype.isDepthTexture=!0;$c.prototype=Object.create(G.prototype); +$c.prototype.constructor=$c;ee.prototype=Object.create(P.prototype);ee.prototype.constructor=ee;ad.prototype=Object.create(G.prototype);ad.prototype.constructor=ad;fe.prototype=Object.create(P.prototype);fe.prototype.constructor=fe;Oa.prototype=Object.create(G.prototype);Oa.prototype.constructor=Oa;ge.prototype=Object.create(P.prototype);ge.prototype.constructor=ge;bd.prototype=Object.create(Oa.prototype);bd.prototype.constructor=bd;he.prototype=Object.create(P.prototype);he.prototype.constructor= +he;qc.prototype=Object.create(Oa.prototype);qc.prototype.constructor=qc;ie.prototype=Object.create(P.prototype);ie.prototype.constructor=ie;cd.prototype=Object.create(Oa.prototype);cd.prototype.constructor=cd;je.prototype=Object.create(P.prototype);je.prototype.constructor=je;dd.prototype=Object.create(Oa.prototype);dd.prototype.constructor=dd;ke.prototype=Object.create(P.prototype);ke.prototype.constructor=ke;rc.prototype=Object.create(G.prototype);rc.prototype.constructor=rc;rc.prototype.toJSON= +function(){var a=G.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};le.prototype=Object.create(P.prototype);le.prototype.constructor=le;ed.prototype=Object.create(G.prototype);ed.prototype.constructor=ed;me.prototype=Object.create(P.prototype);me.prototype.constructor=me;fd.prototype=Object.create(G.prototype);fd.prototype.constructor=fd;var Wk={triangulate:function(a,b,d){d=d||2;var e=b&&b.length,f=e?b[0]*d:a.length,g=bi(a,0,f,d,!0),h=[];if(!g||g.next===g.prev)return h; +var l;if(e){var k=d;e=[];var m;var u=0;for(m=b.length;u80*d){var t=l=a[0];var p=e=a[1];for(k=d;kl&&(l=u),b>e&&(e=b);l=Math.max(l-t,e-p);l=0!==l?1/l:0}oe(g,h,d,t,p,l);return h}},Bb={area:function(a){for(var b=a.length,d=0, +e=b-1,f=0;fBb.area(a)},triangulateShape:function(a,b){var d=[],e=[],f=[];fi(a);gi(d,a);a=a.length;b.forEach(fi);for(var g=0;gMath.abs(h-k)?[new p(a,1-d),new p(l,1-e),new p(m,1-f),new p(q,1-b)]:[new p(h,1-d),new p(k,1-e),new p(u,1-f),new p(v,1-b)]}};qe.prototype=Object.create(P.prototype);qe.prototype.constructor=qe;hd.prototype=Object.create(qb.prototype);hd.prototype.constructor=hd;re.prototype=Object.create(P.prototype);re.prototype.constructor=re;tc.prototype=Object.create(G.prototype);tc.prototype.constructor=tc;se.prototype=Object.create(P.prototype);se.prototype.constructor= +se;id.prototype=Object.create(G.prototype);id.prototype.constructor=id;te.prototype=Object.create(P.prototype);te.prototype.constructor=te;jd.prototype=Object.create(G.prototype);jd.prototype.constructor=jd;uc.prototype=Object.create(P.prototype);uc.prototype.constructor=uc;uc.prototype.toJSON=function(){var a=P.prototype.toJSON.call(this);return ii(this.parameters.shapes,a)};vc.prototype=Object.create(G.prototype);vc.prototype.constructor=vc;vc.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this); +return ii(this.parameters.shapes,a)};kd.prototype=Object.create(G.prototype);kd.prototype.constructor=kd;wc.prototype=Object.create(P.prototype);wc.prototype.constructor=wc;Cb.prototype=Object.create(G.prototype);Cb.prototype.constructor=Cb;ue.prototype=Object.create(wc.prototype);ue.prototype.constructor=ue;ve.prototype=Object.create(Cb.prototype);ve.prototype.constructor=ve;we.prototype=Object.create(P.prototype);we.prototype.constructor=we;ld.prototype=Object.create(G.prototype);ld.prototype.constructor= +ld;var Ka=Object.freeze({__proto__:null,WireframeGeometry:$c,ParametricGeometry:ee,ParametricBufferGeometry:ad,TetrahedronGeometry:ge,TetrahedronBufferGeometry:bd,OctahedronGeometry:he,OctahedronBufferGeometry:qc,IcosahedronGeometry:ie,IcosahedronBufferGeometry:cd,DodecahedronGeometry:je,DodecahedronBufferGeometry:dd,PolyhedronGeometry:fe,PolyhedronBufferGeometry:Oa,TubeGeometry:ke,TubeBufferGeometry:rc,TorusKnotGeometry:le,TorusKnotBufferGeometry:ed,TorusGeometry:me,TorusBufferGeometry:fd,TextGeometry:qe, +TextBufferGeometry:hd,SphereGeometry:re,SphereBufferGeometry:tc,RingGeometry:se,RingBufferGeometry:id,PlaneGeometry:Ud,PlaneBufferGeometry:oc,LatheGeometry:te,LatheBufferGeometry:jd,ShapeGeometry:uc,ShapeBufferGeometry:vc,ExtrudeGeometry:sc,ExtrudeBufferGeometry:qb,EdgesGeometry:kd,ConeGeometry:ue,ConeBufferGeometry:ve,CylinderGeometry:wc,CylinderBufferGeometry:Cb,CircleGeometry:we,CircleBufferGeometry:ld,BoxGeometry:Qc,BoxBufferGeometry:Pb});xc.prototype=Object.create(L.prototype);xc.prototype.constructor= +xc;xc.prototype.isShadowMaterial=!0;xc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);return this};Db.prototype=Object.create(Aa.prototype);Db.prototype.constructor=Db;Db.prototype.isRawShaderMaterial=!0;rb.prototype=Object.create(L.prototype);rb.prototype.constructor=rb;rb.prototype.isMeshStandardMaterial=!0;rb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness; this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias; -this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.vertexTangents=a.vertexTangents;return this};Ob.prototype=Object.create(jb.prototype); -Ob.prototype.constructor=Ob;Ob.prototype.isMeshPhysicalMaterial=!0;Ob.prototype.copy=function(a){jb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.clearcoat=a.clearcoat;this.clearcoatMap=a.clearcoatMap;this.clearcoatRoughness=a.clearcoatRoughness;this.clearcoatRoughnessMap=a.clearcoatRoughnessMap;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.reflectivity=a.reflectivity;this.sheen=a.sheen?(this.sheen||new J).copy(a.sheen): -null;this.transmission=a.transmission;this.transmissionMap=a.transmissionMap;return this};Pb.prototype=Object.create(L.prototype);Pb.prototype.constructor=Pb;Pb.prototype.isMeshPhongMaterial=!0;Pb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); +this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.vertexTangents=a.vertexTangents;return this};Zb.prototype=Object.create(rb.prototype); +Zb.prototype.constructor=Zb;Zb.prototype.isMeshPhysicalMaterial=!0;Zb.prototype.copy=function(a){rb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.clearcoat=a.clearcoat;this.clearcoatMap=a.clearcoatMap;this.clearcoatRoughness=a.clearcoatRoughness;this.clearcoatRoughnessMap=a.clearcoatRoughnessMap;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.reflectivity=a.reflectivity;this.sheen=a.sheen?(this.sheen||new x).copy(a.sheen): +null;this.transmission=a.transmission;this.transmissionMap=a.transmissionMap;return this};$b.prototype=Object.create(L.prototype);$b.prototype.constructor=$b;$b.prototype.isMeshPhongMaterial=!0;$b.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio; -this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};pc.prototype=Object.create(L.prototype);pc.prototype.constructor=pc;pc.prototype.isMeshToonMaterial=!0;pc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.gradientMap=a.gradientMap;this.lightMap= +this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};yc.prototype=Object.create(L.prototype);yc.prototype.constructor=yc;yc.prototype.isMeshToonMaterial=!0;yc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.gradientMap=a.gradientMap;this.lightMap= a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap= -a.alphaMap;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};qc.prototype=Object.create(L.prototype);qc.prototype.constructor=qc;qc.prototype.isMeshNormalMaterial=!0;qc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap= -a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};rc.prototype=Object.create(L.prototype);rc.prototype.constructor=rc;rc.prototype.isMeshLambertMaterial=!0;rc.prototype.copy= +a.alphaMap;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};zc.prototype=Object.create(L.prototype);zc.prototype.constructor=zc;zc.prototype.isMeshNormalMaterial=!0;zc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap= +a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Ac.prototype=Object.create(L.prototype);Ac.prototype.constructor=Ac;Ac.prototype.isMeshLambertMaterial=!0;Ac.prototype.copy= function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe; -this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};sc.prototype=Object.create(L.prototype);sc.prototype.constructor=sc;sc.prototype.isMeshMatcapMaterial=!0;sc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap; -this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};tc.prototype=Object.create(ba.prototype);tc.prototype.constructor=tc;tc.prototype.isLineDashedMaterial=!0;tc.prototype.copy= -function(a){ba.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Uk=Object.freeze({__proto__:null,ShadowMaterial:oc,SpriteMaterial:Mb,RawShaderMaterial:vb,ShaderMaterial:Ea,PointsMaterial:Ya,MeshPhysicalMaterial:Ob,MeshStandardMaterial:jb,MeshPhongMaterial:Pb,MeshToonMaterial:pc,MeshNormalMaterial:qc,MeshLambertMaterial:rc,MeshDepthMaterial:Hb,MeshDistanceMaterial:Ib,MeshBasicMaterial:Qa,MeshMatcapMaterial:sc,LineDashedMaterial:tc,LineBasicMaterial:ba, -Material:L}),Z={arraySlice:function(a,b,c){return Z.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a, -b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=a[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time), -c.push(g)),f=a[e++];while(void 0!==f)}}},subclip:function(a,b,c,d,e){e=e||30;a=a.clone();a.name=b;b=[];for(var f=0;f=d))for(l.push(g.times[q]),p=0;pa.tracks[d].times[0]&& -(c=a.tracks[d].times[0]);for(d=0;d=d)d=30;var e=a.tracks.length,f=b/d;b=function(b){var d=c.tracks[b],e=d.ValueTypeName;if("bool"!==e&&"string"!==e&&(b=a.tracks.find(function(a){return a.name===d.name&&a.ValueTypeName===e}),void 0!==b)){var g=d.getValueSize(),k=d.times.length-1,p=void 0;f<=d.times[0]?p=Z.arraySlice(d.values,0,d.valueSize): -f>=d.times[k]?p=Z.arraySlice(d.values,k*g):(p=d.createInterpolant(),p.evaluate(f),p=p.resultBuffer);"quaternion"===e&&(new oa(p[0],p[1],p[2],p[3])).normalize().conjugate().toArray(p);k=b.times.length;for(var m=0;m=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=Z.arraySlice(c,e,f),this.values=Z.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times; -b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&Z.isTypedArray(b))for(c=0,d=b.length;c!==d;++c)if(e=b[c],isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.", -this,c,e);a=!1;break}return a},optimize:function(){for(var a=Z.arraySlice(this.times),b=Z.arraySlice(this.values),c=this.getValueSize(),d=2302===this.getInterpolation(),e=a.length-1,f=1,g=1;gg)e=a+1;else if(0c&&(c=0);1Number.EPSILON&&(g.normalize(),k=Math.acos(P.clamp(d[c-1].dot(d[c]),-1,1)),e[c].applyMatrix4(h.makeRotationAxis(g,k))),f[c].crossVectors(d[c],e[c]);if(!0===b)for(b=Math.acos(P.clamp(e[0].dot(e[a]),-1,1)),b/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>k&&(k=e);lh.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,k);mh.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,k);nh.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,k)}else"catmullrom"===this.curveType&&(lh.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),mh.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),nh.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(lh.calc(a),mh.calc(a),nh.calc(a));return b};sa.prototype.copy=function(a){E.prototype.copy.call(this, -a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(gi(d,e.x,f.x,g.x,c.x),gi(d,e.y,f.y,g.y,c.y));return b};bb.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length- -1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cb;b++)this.coefficients[b].copy(a[b]);return this},zero:function(){for(var a=0;9>a;a++)this.coefficients[a].set(0,0,0);return this},getAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.282095);b.addScaledVector(e[1],.488603*d);b.addScaledVector(e[2],.488603*a);b.addScaledVector(e[3], -.488603*c);b.addScaledVector(e[4],1.092548*c*d);b.addScaledVector(e[5],1.092548*d*a);b.addScaledVector(e[6],.315392*(3*a*a-1));b.addScaledVector(e[7],1.092548*c*a);b.addScaledVector(e[8],.546274*(c*c-d*d));return b},getIrradianceAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.886227);b.addScaledVector(e[1],1.023328*d);b.addScaledVector(e[2],1.023328*a);b.addScaledVector(e[3],1.023328*c);b.addScaledVector(e[4],.858086*c*d);b.addScaledVector(e[5],.858086* -d*a);b.addScaledVector(e[6],.743125*a*a-.247708);b.addScaledVector(e[7],.858086*c*a);b.addScaledVector(e[8],.429043*(c*c-d*d));return b},add:function(a){for(var b=0;9>b;b++)this.coefficients[b].add(a.coefficients[b]);return this},addScaledSH:function(a,b){for(var c=0;9>c;c++)this.coefficients[c].addScaledVector(a.coefficients[c],b);return this},scale:function(a){for(var b=0;9>b;b++)this.coefficients[b].multiplyScalar(a);return this},lerp:function(a,b){for(var c=0;9>c;c++)this.coefficients[c].lerp(a.coefficients[c], -b);return this},equals:function(a){for(var b=0;9>b;b++)if(!this.coefficients[b].equals(a.coefficients[b]))return!1;return!0},copy:function(a){return this.set(a.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(a,b){void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].fromArray(a,b+3*d);return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].toArray(a,b+3*d);return a}});Object.assign(rf, -{getBasisAt:function(a,b){var c=a.x,d=a.y;a=a.z;b[0]=.282095;b[1]=.488603*d;b[2]=.488603*a;b[3]=.488603*c;b[4]=1.092548*c*d;b[5]=1.092548*d*a;b[6]=.315392*(3*a*a-1);b[7]=1.092548*c*a;b[8]=.546274*(c*c-d*d)}});Ua.prototype=Object.assign(Object.create(T.prototype),{constructor:Ua,isLightProbe:!0,copy:function(a){T.prototype.copy.call(this,a);this.sh.copy(a.sh);return this},fromJSON:function(a){this.intensity=a.intensity;this.sh.fromArray(a.sh);return this},toJSON:function(a){a=T.prototype.toJSON.call(this, -a);a.object.sh=this.sh.toArray();return a}});sf.prototype=Object.assign(Object.create(W.prototype),{constructor:sf,load:function(a,b,c,d){var e=this,f=new Ta(e.manager);f.setPath(e.path);f.setRequestHeader(e.requestHeader);f.load(a,function(c){try{b(e.parse(JSON.parse(c)))}catch(h){d?d(h):console.error(h),e.manager.itemError(a)}},c,d)},parse:function(a){function b(a){void 0===c[a]&&console.warn("THREE.MaterialLoader: Undefined texture",a);return c[a]}var c=this.textures,d=new Uk[a.type];void 0!== -a.uuid&&(d.uuid=a.uuid);void 0!==a.name&&(d.name=a.name);void 0!==a.color&&d.color.setHex(a.color);void 0!==a.roughness&&(d.roughness=a.roughness);void 0!==a.metalness&&(d.metalness=a.metalness);void 0!==a.sheen&&(d.sheen=(new J).setHex(a.sheen));void 0!==a.emissive&&d.emissive.setHex(a.emissive);void 0!==a.specular&&d.specular.setHex(a.specular);void 0!==a.shininess&&(d.shininess=a.shininess);void 0!==a.clearcoat&&(d.clearcoat=a.clearcoat);void 0!==a.clearcoatRoughness&&(d.clearcoatRoughness=a.clearcoatRoughness); -void 0!==a.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatShading=a.flatShading);void 0!==a.blending&&(d.blending=a.blending);void 0!==a.combine&&(d.combine=a.combine);void 0!==a.side&&(d.side=a.side);void 0!==a.opacity&&(d.opacity=a.opacity);void 0!==a.transparent&&(d.transparent=a.transparent);void 0!==a.alphaTest&&(d.alphaTest=a.alphaTest);void 0!==a.depthTest&&(d.depthTest=a.depthTest);void 0!==a.depthWrite&&(d.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(d.colorWrite=a.colorWrite);void 0!== -a.stencilWrite&&(d.stencilWrite=a.stencilWrite);void 0!==a.stencilWriteMask&&(d.stencilWriteMask=a.stencilWriteMask);void 0!==a.stencilFunc&&(d.stencilFunc=a.stencilFunc);void 0!==a.stencilRef&&(d.stencilRef=a.stencilRef);void 0!==a.stencilFuncMask&&(d.stencilFuncMask=a.stencilFuncMask);void 0!==a.stencilFail&&(d.stencilFail=a.stencilFail);void 0!==a.stencilZFail&&(d.stencilZFail=a.stencilZFail);void 0!==a.stencilZPass&&(d.stencilZPass=a.stencilZPass);void 0!==a.wireframe&&(d.wireframe=a.wireframe); -void 0!==a.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&&(d.rotation=a.rotation);1!==a.linewidth&&(d.linewidth=a.linewidth);void 0!==a.dashSize&&(d.dashSize=a.dashSize);void 0!==a.gapSize&&(d.gapSize=a.gapSize);void 0!==a.scale&&(d.scale=a.scale);void 0!==a.polygonOffset&&(d.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&& -(d.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(d.skinning=a.skinning);void 0!==a.morphTargets&&(d.morphTargets=a.morphTargets);void 0!==a.morphNormals&&(d.morphNormals=a.morphNormals);void 0!==a.dithering&&(d.dithering=a.dithering);void 0!==a.vertexTangents&&(d.vertexTangents=a.vertexTangents);void 0!==a.visible&&(d.visible=a.visible);void 0!==a.toneMapped&&(d.toneMapped=a.toneMapped);void 0!==a.userData&& -(d.userData=a.userData);void 0!==a.vertexColors&&(d.vertexColors="number"===typeof a.vertexColors?0Number.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=tb.isClockWise,f=this.subPaths;if(0===f.length)return[]; -if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new Qb;h.curves=g.curves;b.push(h);return b}var k=!e(f[0].getPoints());k=a?!k:k;h=[];var n=[],m=[],p=0;n[p]=void 0;m[p]=[];for(var u=0,r=f.length;ud&&this._mixBufferRegion(c,a,b*this._origIndex,1-d,b);0=e){var m=e++,p=a[m];b[p.uuid]=n;a[n]=p;b[k]=m;a[m]=h;h=0;for(k=d;h!==k;++h){p=c[h];var u=p[n];p[n]=p[m];p[m]=u}}}this.nCachedObjects_=e},uncache:function(){for(var a=this._objects,b=this._indicesByUUID,c=this._bindings,d=c.length,e=this.nCachedObjects_,f=a.length,g=0,h=arguments.length;g!==h;++g){var k= -arguments[g].uuid,n=b[k];if(void 0!==n)if(delete b[k],nb||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b};V.prototype._updateTimeScale=function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0];b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale= -b};V.prototype._updateTime=function(a){var b=this._clip.duration,c=this.loop,d=this.time+a,e=this._loopCount,f=2202===c;if(0===a)return-1===e?d:f&&1===(e&1)?b-d:d;if(2200===c)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),d>=b)d=b;else if(0>d)d=0;else{this.time=d;break a}this.clampWhenFinished?this.paused=!0:this.enabled=!1;this.time=d;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0=== -this.repetitions,!0,f));if(d>=b||0>d){c=Math.floor(d/b);d-=b*c;e+=Math.abs(c);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=d=0a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this.time=d,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c}))}else this.time=d;if(f&&1===(e&1))return b-d}return d};V.prototype._setEndings=function(a, -b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)};V.prototype._scheduleFading=function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this};Ng.prototype=Object.assign(Object.create(va.prototype),{constructor:Ng,_bindAction:function(a, -b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var n=d[h],m=n.name,p=k[m];if(void 0===p){p=f[h];if(void 0!==p){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,g,m));continue}p=new Mg(Ca.create(c,m,b&&b._propertyBindings[h].binding.parsedPath),n.ValueTypeName,n.getValueSize());++p.referenceCount;this._addInactiveBinding(p,g,m)}f[h]= -p;a[h].resultBuffer=p.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c= -0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length}, -get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&athis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a, -b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new u);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new u);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return Si.copy(a).clamp(this.min, -this.max).sub(a).length()},intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});var Ti=new m,Zf=new m;Object.assign(Sg.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start); -this.end.copy(a.end);return this},getCenter:function(a){void 0===a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new m);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new m);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0=== -b&&(console.warn("THREE.Line3: .at() target is now required"),b=new m);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(a,b){Ti.subVectors(a,this.start);Zf.subVectors(this.end,this.start);a=Zf.dot(Zf);a=Zf.dot(Ti)/a;b&&(a=P.clamp(a,0,1));return a},closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new m);return this.delta(c).multiplyScalar(a).add(this.start)}, -applyMatrix4:function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});te.prototype=Object.create(C.prototype);te.prototype.constructor=te;te.prototype.isImmediateRenderObject=!0;var Ui=new m;nd.prototype=Object.create(C.prototype);nd.prototype.constructor=nd;nd.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};nd.prototype.update=function(){this.light.updateMatrixWorld(); -var a=this.light.distance?this.light.distance:1E3,b=a*Math.tan(this.light.angle);this.cone.scale.set(b,b,a);Ui.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(Ui);void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Yb=new m,$f=new R,qh=new R;uc.prototype=Object.create(ma.prototype);uc.prototype.constructor=uc;uc.prototype.isSkeletonHelper=!0;uc.prototype.updateMatrixWorld=function(a){var b=this.bones,c=this.geometry, -d=c.getAttribute("position");qh.getInverse(this.root.matrixWorld);for(var e=0,f=0;e -Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this,a)};var Zi=new m,zf,Tg;Sb.prototype=Object.create(C.prototype);Sb.prototype.constructor=Sb;Sb.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(Zi.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(Zi,Math.acos(a.y)))};Sb.prototype.setLength=function(a, -b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(1E-4,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};Sb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};Sb.prototype.copy=function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};ye.prototype=Object.create(ma.prototype);ye.prototype.constructor=ye;var nb=Math.pow(2,8), -$i=[.125,.215,.35,.446,.526,.582],aj=5+$i.length,ob={3E3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},rh=new kd,sh=function(){for(var a=[],b=[],c=[],d=8,e=0;en;n++){var m=n%3*2/3-1,p=2\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", -blending:0,depthTest:!1,depthWrite:!1});this._cubemapShader=this._equirectShader=null;this._compileMaterial(this._blurMaterial)};Da.prototype.fromScene=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=.1);void 0===d&&(d=100);th=this._renderer.getRenderTarget();var e=this._allocateTargets();this._sceneToCubeUV(a,c,d,e);0q;q++)p=q%3,0==p?(b.up.set(0,c[q],0),b.lookAt(e[q],0,0)):1==p?(b.up.set(0,0,c[q]),b.lookAt(0,e[q],0)):(b.up.set(0,c[q],0),b.lookAt(0,0,e[q])),Af(d,p*nb,2t;++t){var v=t/p;v=Math.exp(-v*v/2);e.push(v);0==t?r+=v:t=e))for(k.push(h.times[u]),q=0;qa.tracks[e].times[0]&& +(d=a.tracks[e].times[0]);for(e=0;e=e)e=30;var f=a.tracks.length,g=b/e;b=function(b){var e=d.tracks[b],f=e.ValueTypeName;if("bool"!==f&&"string"!==f&&(b=a.tracks.find(function(a){return a.name===e.name&&a.ValueTypeName===f}),void 0!==b)){var h=0,k=e.getValueSize();e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=k/3);var m= +0,v=b.getValueSize();b.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=v/3);var t=e.times.length-1,p=void 0;g<=e.times[0]?p=Z.arraySlice(e.values,h,k-h):g>=e.times[t]?(p=t*k+h,p=Z.arraySlice(e.values,p,p+k-h)):(p=e.createInterpolant(),t=h,h=k-h,p.evaluate(g),p=Z.arraySlice(p.resultBuffer,t,h));"quaternion"===f&&(new O).fromArray(p).normalize().conjugate().toArray(p);h=b.times.length;for(k=0;k=f)break a;else{g=b[1];a=f)break b}e=d;d=0}}for(;d>>1,ab;)--g;++g;if(0!==f||g!==e)f>=g&&(g=Math.max(g,1),f=g-1),a=this.getValueSize(),this.times=Z.arraySlice(d,f,g),this.values=Z.arraySlice(this.values,f*a,g*a);return this},validate:function(){var a=!0, +b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var d=this.times;b=this.values;var e=d.length;0===e&&(console.error("THREE.KeyframeTrack: Track is empty.",this),a=!1);for(var f=null,g=0;g!==e;g++){var h=d[g];if("number"===typeof h&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,g,h);a=!1;break}if(null!==f&&f>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,g,h,f);a=!1;break}f= +h}if(void 0!==b&&Z.isTypedArray(b))for(d=0,e=b.length;d!==e;++d)if(f=b[d],isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,d,f);a=!1;break}return a},optimize:function(){for(var a=Z.arraySlice(this.times),b=Z.arraySlice(this.values),d=this.getValueSize(),e=2302===this.getInterpolation(),f=a.length-1,g=1,h=1;hh)f=a+1;else if(0d&&(d=0);1Number.EPSILON&&(h.normalize(),k=Math.acos(T.clamp(e[d-1].dot(e[d]),-1,1)),f[d].applyMatrix4(l.makeRotationAxis(h,k))),g[d].crossVectors(e[d],f[d]);if(!0===b)for(b=Math.acos(T.clamp(f[0].dot(f[a]),-1,1)),b/=a,0e;)e+=d;for(;e>d;)e-=d;ef&&(f=1);1E-4>e&&(e=f);1E-4>k&&(k=f);ph.initNonuniformCatmullRom(g.x,h.x,l.x,d.x,e,f,k);qh.initNonuniformCatmullRom(g.y,h.y,l.y,d.y,e,f,k);rh.initNonuniformCatmullRom(g.z,h.z,l.z,d.z,e,f,k)}else"catmullrom"===this.curveType&&(ph.initCatmullRom(g.x,h.x,l.x,d.x,this.tension),qh.initCatmullRom(g.y,h.y,l.y,d.y,this.tension),rh.initCatmullRom(g.z,h.z,l.z,d.z,this.tension));b.set(ph.calc(a), +qh.calc(a),rh.calc(a));return b};za.prototype.copy=function(a){K.prototype.copy.call(this,a);this.points=[];for(var b=0,d=a.points.length;bd.length-2?d.length-1:a+1];d=d[a>d.length-3?d.length-1:a+2];b.set(ki(e,f.x,g.x,h.x,d.x),ki(e,f.y,g.y,h.y,d.y));return b};ib.prototype.copy=function(a){K.prototype.copy.call(this,a);this.points=[];for(var b=0,d=a.points.length;b=b)return b=d[a]-b,a=this.curves[a],d=a.getLength(),a.getPointAt(0=== +d?0:1-b/d);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,d=0,e=this.curves.length;da;a++)this.coefficients.push(new m)};Da.prototype.set=function(a){for(var b=0;9>b;b++)this.coefficients[b].copy(a[b]);return this};Da.prototype.zero=function(){for(var a=0;9>a;a++)this.coefficients[a].set(0,0,0);return this};Da.prototype.getAt= +function(a,b){var d=a.x,e=a.y;a=a.z;var f=this.coefficients;b.copy(f[0]).multiplyScalar(.282095);b.addScaledVector(f[1],.488603*e);b.addScaledVector(f[2],.488603*a);b.addScaledVector(f[3],.488603*d);b.addScaledVector(f[4],1.092548*d*e);b.addScaledVector(f[5],1.092548*e*a);b.addScaledVector(f[6],.315392*(3*a*a-1));b.addScaledVector(f[7],1.092548*d*a);b.addScaledVector(f[8],.546274*(d*d-e*e));return b};Da.prototype.getIrradianceAt=function(a,b){var d=a.x,e=a.y;a=a.z;var f=this.coefficients;b.copy(f[0]).multiplyScalar(.886227); +b.addScaledVector(f[1],1.023328*e);b.addScaledVector(f[2],1.023328*a);b.addScaledVector(f[3],1.023328*d);b.addScaledVector(f[4],.858086*d*e);b.addScaledVector(f[5],.858086*e*a);b.addScaledVector(f[6],.743125*a*a-.247708);b.addScaledVector(f[7],.858086*d*a);b.addScaledVector(f[8],.429043*(d*d-e*e));return b};Da.prototype.add=function(a){for(var b=0;9>b;b++)this.coefficients[b].add(a.coefficients[b]);return this};Da.prototype.addScaledSH=function(a,b){for(var d=0;9>d;d++)this.coefficients[d].addScaledVector(a.coefficients[d], +b);return this};Da.prototype.scale=function(a){for(var b=0;9>b;b++)this.coefficients[b].multiplyScalar(a);return this};Da.prototype.lerp=function(a,b){for(var d=0;9>d;d++)this.coefficients[d].lerp(a.coefficients[d],b);return this};Da.prototype.equals=function(a){for(var b=0;9>b;b++)if(!this.coefficients[b].equals(a.coefficients[b]))return!1;return!0};Da.prototype.copy=function(a){return this.set(a.coefficients)};Da.prototype.clone=function(){return(new this.constructor).copy(this)};Da.prototype.fromArray= +function(a,b){void 0===b&&(b=0);for(var d=this.coefficients,e=0;9>e;e++)d[e].fromArray(a,b+3*e);return this};Da.prototype.toArray=function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);for(var d=this.coefficients,e=0;9>e;e++)d[e].toArray(a,b+3*e);return a};Da.getBasisAt=function(a,b){var d=a.x,e=a.y;a=a.z;b[0]=.282095;b[1]=.488603*e;b[2]=.488603*a;b[3]=.488603*d;b[4]=1.092548*d*e;b[5]=1.092548*e*a;b[6]=.315392*(3*a*a-1);b[7]=1.092548*d*a;b[8]=.546274*(d*d-e*e)};Da.prototype.isSphericalHarmonics3=!0;cb.prototype= +Object.assign(Object.create(la.prototype),{constructor:cb,isLightProbe:!0,copy:function(a){la.prototype.copy.call(this,a);this.sh.copy(a.sh);return this},fromJSON:function(a){this.intensity=a.intensity;this.sh.fromArray(a.sh);return this},toJSON:function(a){a=la.prototype.toJSON.call(this,a);a.object.sh=this.sh.toArray();return a}});Af.prototype=Object.assign(Object.create(ba.prototype),{constructor:Af,load:function(a,b,d,e){var f=this,g=new bb(f.manager);g.setPath(f.path);g.setRequestHeader(f.requestHeader); +g.load(a,function(d){try{b(f.parse(JSON.parse(d)))}catch(l){e?e(l):console.error(l),f.manager.itemError(a)}},d,e)},parse:function(a){function b(a){void 0===d[a]&&console.warn("THREE.MaterialLoader: Undefined texture",a);return d[a]}var d=this.textures,e=new Xk[a.type];void 0!==a.uuid&&(e.uuid=a.uuid);void 0!==a.name&&(e.name=a.name);void 0!==a.color&&e.color.setHex(a.color);void 0!==a.roughness&&(e.roughness=a.roughness);void 0!==a.metalness&&(e.metalness=a.metalness);void 0!==a.sheen&&(e.sheen=(new x).setHex(a.sheen)); +void 0!==a.emissive&&e.emissive.setHex(a.emissive);void 0!==a.specular&&e.specular.setHex(a.specular);void 0!==a.shininess&&(e.shininess=a.shininess);void 0!==a.clearcoat&&(e.clearcoat=a.clearcoat);void 0!==a.clearcoatRoughness&&(e.clearcoatRoughness=a.clearcoatRoughness);void 0!==a.fog&&(e.fog=a.fog);void 0!==a.flatShading&&(e.flatShading=a.flatShading);void 0!==a.blending&&(e.blending=a.blending);void 0!==a.combine&&(e.combine=a.combine);void 0!==a.side&&(e.side=a.side);void 0!==a.opacity&&(e.opacity= +a.opacity);void 0!==a.transparent&&(e.transparent=a.transparent);void 0!==a.alphaTest&&(e.alphaTest=a.alphaTest);void 0!==a.depthTest&&(e.depthTest=a.depthTest);void 0!==a.depthWrite&&(e.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(e.colorWrite=a.colorWrite);void 0!==a.stencilWrite&&(e.stencilWrite=a.stencilWrite);void 0!==a.stencilWriteMask&&(e.stencilWriteMask=a.stencilWriteMask);void 0!==a.stencilFunc&&(e.stencilFunc=a.stencilFunc);void 0!==a.stencilRef&&(e.stencilRef=a.stencilRef);void 0!== +a.stencilFuncMask&&(e.stencilFuncMask=a.stencilFuncMask);void 0!==a.stencilFail&&(e.stencilFail=a.stencilFail);void 0!==a.stencilZFail&&(e.stencilZFail=a.stencilZFail);void 0!==a.stencilZPass&&(e.stencilZPass=a.stencilZPass);void 0!==a.wireframe&&(e.wireframe=a.wireframe);void 0!==a.wireframeLinewidth&&(e.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(e.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(e.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&& +(e.rotation=a.rotation);1!==a.linewidth&&(e.linewidth=a.linewidth);void 0!==a.dashSize&&(e.dashSize=a.dashSize);void 0!==a.gapSize&&(e.gapSize=a.gapSize);void 0!==a.scale&&(e.scale=a.scale);void 0!==a.polygonOffset&&(e.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&(e.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(e.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(e.skinning=a.skinning);void 0!==a.morphTargets&&(e.morphTargets=a.morphTargets); +void 0!==a.morphNormals&&(e.morphNormals=a.morphNormals);void 0!==a.dithering&&(e.dithering=a.dithering);void 0!==a.vertexTangents&&(e.vertexTangents=a.vertexTangents);void 0!==a.visible&&(e.visible=a.visible);void 0!==a.toneMapped&&(e.toneMapped=a.toneMapped);void 0!==a.userData&&(e.userData=a.userData);void 0!==a.vertexColors&&(e.vertexColors="number"===typeof a.vertexColors?0Number.EPSILON){if(0>m&&(h=b[g],k=-k,l=b[f],m=-m),!(a.yl.y))if(a.y===h.y){if(a.x===h.x)return!0}else{f=m*(a.x-h.x)- +k*(a.y-h.y);if(0===f)return!0;0>f||(e=!e)}}else if(a.y===h.y&&(l.x<=a.x&&a.x<=h.x||h.x<=a.x&&a.x<=l.x))return!0}return e}var f=Bb.isClockWise,g=this.subPaths;if(0===g.length)return[];if(!0===b)return d(g);b=[];if(1===g.length){var h=g[0];var l=new ac;l.curves=h.curves;b.push(l);return b}var k=!f(g[0].getPoints());k=a?!k:k;l=[];var m=[],p=[],q=0;m[q]=void 0;p[q]=[];for(var v=0,t=g.length;ve&&this._mixBufferRegion(d,a,b*this._origIndex,1-e,b);0=f){var p=f++,q=a[p];b[q.uuid]=m;a[m]=q;b[k]=p;a[p]=l;l=0;for(k=e;l!==k;++l){q=d[l];var v=q[m];q[m]=q[p];q[p]=v}}}this.nCachedObjects_=f},uncache:function(){for(var a=this._objects,b=this._indicesByUUID,d=this._bindings,e=d.length,f=this.nCachedObjects_,g=a.length,h=0,l=arguments.length;h!==l;++h){var k=arguments[h].uuid,m=b[k];if(void 0!==m)if(delete b[k],mb||0=== +d)return;this._startTime=null;b*=d}b*=this._updateTimeScale(a);d=this._updateTime(b);a=this._updateWeight(a);if(0d.parameterPositions[1]&&(this.stopFading(),0===e&&(this.enabled=!1))}}return this._effectiveWeight=b};ea.prototype._updateTimeScale=function(a){var b=0;if(!this.paused){b=this.timeScale;var d=this._timeScaleInterpolant;if(null!==d){var e=d.evaluate(a)[0];b*=e;a>d.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b};ea.prototype._updateTime=function(a){var b=this._clip.duration,d=this.loop,e=this.time+ +a,f=this._loopCount,g=2202===d;if(0===a)return-1===f?e:g&&1===(f&1)?b-e:e;if(2200===d)a:{if(-1===f&&(this._loopCount=0,this._setEndings(!0,!0,!1)),e>=b)e=b;else if(0>e)e=0;else{this.time=e;break a}this.clampWhenFinished?this.paused=!0:this.enabled=!1;this.time=e;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{-1===f&&(0<=a?(f=0,this._setEndings(!0,0===this.repetitions,g)):this._setEndings(0===this.repetitions,!0,g));if(e>=b||0>e){d=Math.floor(e/b);e-=b*d;f+=Math.abs(d); +var h=this.repetitions-f;0>=h?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e=0a,this._setEndings(a,!a,g)):this._setEndings(!1,!1,g),this._loopCount=f,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d}))}else this.time=e;if(g&&1===(f&1))return b-e}return e};ea.prototype._setEndings=function(a,b,d){var e=this._interpolantSettings;d?(e.endingStart=2401,e.endingEnd= +2401):(e.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,e.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)};ea.prototype._scheduleFading=function(a,b,d){var e=this._mixer,f=e.time,g=this._weightInterpolant;null===g&&(this._weightInterpolant=g=e._lendControlInterpolant());e=g.parameterPositions;g=g.sampleValues;e[0]=f;g[0]=b;e[1]=f+a;g[1]=d;return this};Sg.prototype=Object.assign(Object.create(La.prototype),{constructor:Sg,_bindAction:function(a,b){var d=a._localRoot||this._root,e=a._clip.tracks, +f=e.length,g=a._propertyBindings;a=a._interpolants;var h=d.uuid,l=this._bindingsByRootAndName,k=l[h];void 0===k&&(k={},l[h]=k);for(l=0;l!==f;++l){var m=e[l],p=m.name,q=k[p];if(void 0===q){q=g[l];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,h,p));continue}q=new Rg(Fa.create(d,p,b&&b._propertyBindings[l].binding.parsedPath),m.ValueTypeName,m.getValueSize());++q.referenceCount;this._addInactiveBinding(q,h,p)}g[l]=q;a[l].resultBuffer=q.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null=== +a._cacheIndex){var b=(a._localRoot||this._root).uuid,d=a._clip.uuid,e=this._actionsByClip[d];this._bindAction(a,e&&e.knownActions[0]);this._addInactiveAction(a,d,b)}b=a._propertyBindings;d=0;for(e=b.length;d!==e;++d){var f=b[d];0===f.useCount++&&(this._lendBinding(f),f.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,d=0,e=b.length;d!==e;++d){var f=b[d];0===--f.useCount&&(f.restoreOriginalState(),this._takeBackBinding(f))}this._takeBackAction(a)}}, +_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}}, +_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&athis.max.x||a.ythis.max.y?!1:!0};ma.prototype.containsBox=function(a){return this.min.x<= +a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y};ma.prototype.getParameter=function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new p);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))};ma.prototype.intersectsBox=function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0};ma.prototype.clampPoint=function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"), +b=new p);return b.copy(a).clamp(this.min,this.max)};ma.prototype.distanceToPoint=function(a){return Vi.copy(a).clamp(this.min,this.max).sub(a).length()};ma.prototype.intersect=function(a){this.min.max(a.min);this.max.min(a.max);return this};ma.prototype.union=function(a){this.min.min(a.min);this.max.max(a.max);return this};ma.prototype.translate=function(a){this.min.add(a);this.max.add(a);return this};ma.prototype.equals=function(a){return a.min.equals(this.min)&&a.max.equals(this.max)};var Wi=new m, +gg=new m,Ra=function(a,b){this.start=void 0!==a?a:new m;this.end=void 0!==b?b:new m};Ra.prototype.set=function(a,b){this.start.copy(a);this.end.copy(b);return this};Ra.prototype.clone=function(){return(new this.constructor).copy(this)};Ra.prototype.copy=function(a){this.start.copy(a.start);this.end.copy(a.end);return this};Ra.prototype.getCenter=function(a){void 0===a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new m);return a.addVectors(this.start,this.end).multiplyScalar(.5)}; +Ra.prototype.delta=function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new m);return a.subVectors(this.end,this.start)};Ra.prototype.distanceSq=function(){return this.start.distanceToSquared(this.end)};Ra.prototype.distance=function(){return this.start.distanceTo(this.end)};Ra.prototype.at=function(a,b){void 0===b&&(console.warn("THREE.Line3: .at() target is now required"),b=new m);return this.delta(b).multiplyScalar(a).add(this.start)};Ra.prototype.closestPointToPointParameter= +function(a,b){Wi.subVectors(a,this.start);gg.subVectors(this.end,this.start);a=gg.dot(gg);a=gg.dot(Wi)/a;b&&(a=T.clamp(a,0,1));return a};Ra.prototype.closestPointToPoint=function(a,b,d){a=this.closestPointToPointParameter(a,b);void 0===d&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),d=new m);return this.delta(d).multiplyScalar(a).add(this.start)};Ra.prototype.applyMatrix4=function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this};Ra.prototype.equals= +function(a){return a.start.equals(this.start)&&a.end.equals(this.end)};Ce.prototype=Object.create(F.prototype);Ce.prototype.constructor=Ce;Ce.prototype.isImmediateRenderObject=!0;var Xi=new m;sd.prototype=Object.create(F.prototype);sd.prototype.constructor=sd;sd.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};sd.prototype.update=function(){this.light.updateMatrixWorld();var a=this.light.distance?this.light.distance:1E3,b=a*Math.tan(this.light.angle);this.cone.scale.set(b, +b,a);Xi.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(Xi);void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var ic=new m,hg=new z,uh=new z;td.prototype=Object.create(sa.prototype);td.prototype.constructor=td;td.prototype.updateMatrixWorld=function(a){var b=this.bones,d=this.geometry,e=d.getAttribute("position");uh.getInverse(this.root.matrixWorld);for(var f=0,g=0;fMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side= +0>b?1:0;this.lookAt(this.plane.normal);Na.prototype.updateMatrixWorld.call(this,a)};var bj=new m,Hf,Xg;cc.prototype=Object.create(F.prototype);cc.prototype.constructor=cc;cc.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(bj.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(bj,Math.acos(a.y)))};cc.prototype.setLength=function(a,b,d){void 0===b&&(b=.2*a);void 0===d&&(d=.2*b);this.line.scale.set(1,Math.max(1E-4,a-b),1); +this.line.updateMatrix();this.cone.scale.set(d,b,d);this.cone.position.y=a;this.cone.updateMatrix()};cc.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};cc.prototype.copy=function(a){F.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};He.prototype=Object.create(sa.prototype);He.prototype.constructor=He;var vb=Math.pow(2,8),cj=[.125,.215,.35,.446,.526,.582],dj=5+cj.length,wb={3E3:0,3001:1,3002:2,3004:3,3005:4,3006:5, +3007:6},vh=new qd,wh=function(){for(var a=[],b=[],d=[],e=8,f=0;fm;m++){var p=m%3*2/3-1,q=2\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t", +blending:0,depthTest:!1,depthWrite:!1});this._cubemapShader=this._equirectShader=null;this._compileMaterial(this._blurMaterial)};Ea.prototype.fromScene=function(a,b,d,e){void 0===b&&(b=0);void 0===d&&(d=.1);void 0===e&&(e=100);xh=this._renderer.getRenderTarget();var f=this._allocateTargets();this._sceneToCubeUV(a,d,e,f);0p;p++)q=p%3,0==q?(b.up.set(0,d[p],0),b.lookAt(f[p],0,0)):1==q?(b.up.set(0,0,d[p]),b.lookAt(0,f[p],0)):(b.up.set(0,d[p],0),b.lookAt(0,0,f[p])),If(e,q*vb,2w;++w){var x=w/q;x=Math.exp(-x*x/2);f.push(x);0==w?t+=x:w 0 ) { + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 - console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); + ]; - } + if ( arguments.length > 0 ) { -} + console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); -Object.assign( Matrix3.prototype, { + } - isMatrix3: true, + } - set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { + set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { const te = this.elements; @@ -1113,9 +1102,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - identity: function () { + identity() { this.set( @@ -1127,15 +1116,15 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().fromArray( this.elements ); - }, + } - copy: function ( m ) { + copy( m ) { const te = this.elements; const me = m.elements; @@ -1146,9 +1135,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - extractBasis: function ( xAxis, yAxis, zAxis ) { + extractBasis( xAxis, yAxis, zAxis ) { xAxis.setFromMatrix3Column( this, 0 ); yAxis.setFromMatrix3Column( this, 1 ); @@ -1156,9 +1145,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - setFromMatrix4: function ( m ) { + setFromMatrix4( m ) { const me = m.elements; @@ -1172,21 +1161,21 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - multiply: function ( m ) { + multiply( m ) { return this.multiplyMatrices( this, m ); - }, + } - premultiply: function ( m ) { + premultiply( m ) { return this.multiplyMatrices( m, this ); - }, + } - multiplyMatrices: function ( a, b ) { + multiplyMatrices( a, b ) { const ae = a.elements; const be = b.elements; @@ -1214,9 +1203,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - multiplyScalar: function ( s ) { + multiplyScalar( s ) { const te = this.elements; @@ -1226,9 +1215,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - determinant: function () { + determinant() { const te = this.elements; @@ -1238,9 +1227,9 @@ Object.assign( Matrix3.prototype, { return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; - }, + } - getInverse: function ( matrix, throwOnDegenerate ) { + getInverse( matrix, throwOnDegenerate ) { if ( throwOnDegenerate !== undefined ) { @@ -1279,9 +1268,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - transpose: function () { + transpose() { let tmp; const m = this.elements; @@ -1292,15 +1281,15 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - getNormalMatrix: function ( matrix4 ) { + getNormalMatrix( matrix4 ) { return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); - }, + } - transposeIntoArray: function ( r ) { + transposeIntoArray( r ) { const m = this.elements; @@ -1316,9 +1305,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - setUvTransform: function ( tx, ty, sx, sy, rotation, cx, cy ) { + setUvTransform( tx, ty, sx, sy, rotation, cx, cy ) { const c = Math.cos( rotation ); const s = Math.sin( rotation ); @@ -1329,9 +1318,9 @@ Object.assign( Matrix3.prototype, { 0, 0, 1 ); - }, + } - scale: function ( sx, sy ) { + scale( sx, sy ) { const te = this.elements; @@ -1340,9 +1329,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - rotate: function ( theta ) { + rotate( theta ) { const c = Math.cos( theta ); const s = Math.sin( theta ); @@ -1362,9 +1351,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - translate: function ( tx, ty ) { + translate( tx, ty ) { const te = this.elements; @@ -1373,9 +1362,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - equals: function ( matrix ) { + equals( matrix ) { const te = this.elements; const me = matrix.elements; @@ -1388,9 +1377,9 @@ Object.assign( Matrix3.prototype, { return true; - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -1402,9 +1391,9 @@ Object.assign( Matrix3.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -1427,7 +1416,9 @@ Object.assign( Matrix3.prototype, { } -} ); +} + +Matrix3.prototype.isMatrix3 = true; let _canvas; @@ -1801,56 +1792,42 @@ Object.defineProperty( Texture.prototype, "needsUpdate", { } ); -function Vector4( x = 0, y = 0, z = 0, w = 1 ) { - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - -} - -Object.defineProperties( Vector4.prototype, { - - "width": { +class Vector4 { - get: function () { - - return this.z; + constructor( x = 0, y = 0, z = 0, w = 1 ) { - }, - - set: function ( value ) { - - this.z = value; + this.x = x; + this.y = y; + this.z = z; + this.w = w; - } + } - }, + get width() { - "height": { + return this.z; - get: function () { + } - return this.w; + set width( value ) { - }, + this.z = value; - set: function ( value ) { + } - this.w = value; + get height() { - } + return this.w; } -} ); + set height( value ) { -Object.assign( Vector4.prototype, { + this.w = value; - isVector4: true, + } - set: function ( x, y, z, w ) { + set( x, y, z, w ) { this.x = x; this.y = y; @@ -1859,9 +1836,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - setScalar: function ( scalar ) { + setScalar( scalar ) { this.x = scalar; this.y = scalar; @@ -1870,41 +1847,41 @@ Object.assign( Vector4.prototype, { return this; - }, + } - setX: function ( x ) { + setX( x ) { this.x = x; return this; - }, + } - setY: function ( y ) { + setY( y ) { this.y = y; return this; - }, + } - setZ: function ( z ) { + setZ( z ) { this.z = z; return this; - }, + } - setW: function ( w ) { + setW( w ) { this.w = w; return this; - }, + } - setComponent: function ( index, value ) { + setComponent( index, value ) { switch ( index ) { @@ -1918,9 +1895,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - getComponent: function ( index ) { + getComponent( index ) { switch ( index ) { @@ -1932,15 +1909,15 @@ Object.assign( Vector4.prototype, { } - }, + } - clone: function () { + clone() { return new this.constructor( this.x, this.y, this.z, this.w ); - }, + } - copy: function ( v ) { + copy( v ) { this.x = v.x; this.y = v.y; @@ -1949,9 +1926,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - add: function ( v, w ) { + add( v, w ) { if ( w !== undefined ) { @@ -1967,9 +1944,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - addScalar: function ( s ) { + addScalar( s ) { this.x += s; this.y += s; @@ -1978,9 +1955,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - addVectors: function ( a, b ) { + addVectors( a, b ) { this.x = a.x + b.x; this.y = a.y + b.y; @@ -1989,9 +1966,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - addScaledVector: function ( v, s ) { + addScaledVector( v, s ) { this.x += v.x * s; this.y += v.y * s; @@ -2000,9 +1977,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - sub: function ( v, w ) { + sub( v, w ) { if ( w !== undefined ) { @@ -2018,9 +1995,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - subScalar: function ( s ) { + subScalar( s ) { this.x -= s; this.y -= s; @@ -2029,9 +2006,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - subVectors: function ( a, b ) { + subVectors( a, b ) { this.x = a.x - b.x; this.y = a.y - b.y; @@ -2040,9 +2017,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - multiplyScalar: function ( scalar ) { + multiplyScalar( scalar ) { this.x *= scalar; this.y *= scalar; @@ -2051,9 +2028,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - applyMatrix4: function ( m ) { + applyMatrix4( m ) { const x = this.x, y = this.y, z = this.z, w = this.w; const e = m.elements; @@ -2065,15 +2042,15 @@ Object.assign( Vector4.prototype, { return this; - }, + } - divideScalar: function ( scalar ) { + divideScalar( scalar ) { return this.multiplyScalar( 1 / scalar ); - }, + } - setAxisAngleFromQuaternion: function ( q ) { + setAxisAngleFromQuaternion( q ) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm @@ -2099,9 +2076,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - setAxisAngleFromRotationMatrix: function ( m ) { + setAxisAngleFromRotationMatrix( m ) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm @@ -2229,9 +2206,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - min: function ( v ) { + min( v ) { this.x = Math.min( this.x, v.x ); this.y = Math.min( this.y, v.y ); @@ -2240,9 +2217,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - max: function ( v ) { + max( v ) { this.x = Math.max( this.x, v.x ); this.y = Math.max( this.y, v.y ); @@ -2251,9 +2228,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - clamp: function ( min, max ) { + clamp( min, max ) { // assumes min < max, componentwise @@ -2264,9 +2241,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - clampScalar: function ( minVal, maxVal ) { + clampScalar( minVal, maxVal ) { this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); @@ -2275,17 +2252,17 @@ Object.assign( Vector4.prototype, { return this; - }, + } - clampLength: function ( min, max ) { + clampLength( min, max ) { const length = this.length(); return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - }, + } - floor: function () { + floor() { this.x = Math.floor( this.x ); this.y = Math.floor( this.y ); @@ -2294,9 +2271,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - ceil: function () { + ceil() { this.x = Math.ceil( this.x ); this.y = Math.ceil( this.y ); @@ -2305,9 +2282,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - round: function () { + round() { this.x = Math.round( this.x ); this.y = Math.round( this.y ); @@ -2316,9 +2293,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - roundToZero: function () { + roundToZero() { this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); @@ -2327,9 +2304,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - negate: function () { + negate() { this.x = - this.x; this.y = - this.y; @@ -2338,45 +2315,45 @@ Object.assign( Vector4.prototype, { return this; - }, + } - dot: function ( v ) { + dot( v ) { return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, + } - lengthSq: function () { + lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; - }, + } - length: function () { + length() { return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - }, + } - manhattanLength: function () { + manhattanLength() { return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); - }, + } - normalize: function () { + normalize() { return this.divideScalar( this.length() || 1 ); - }, + } - setLength: function ( length ) { + setLength( length ) { return this.normalize().multiplyScalar( length ); - }, + } - lerp: function ( v, alpha ) { + lerp( v, alpha ) { this.x += ( v.x - this.x ) * alpha; this.y += ( v.y - this.y ) * alpha; @@ -2385,9 +2362,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - lerpVectors: function ( v1, v2, alpha ) { + lerpVectors( v1, v2, alpha ) { this.x = v1.x + ( v2.x - v1.x ) * alpha; this.y = v1.y + ( v2.y - v1.y ) * alpha; @@ -2396,15 +2373,15 @@ Object.assign( Vector4.prototype, { return this; - }, + } - equals: function ( v ) { + equals( v ) { return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -2415,9 +2392,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -2429,9 +2406,9 @@ Object.assign( Vector4.prototype, { return array; - }, + } - fromBufferAttribute: function ( attribute, index, offset ) { + fromBufferAttribute( attribute, index, offset ) { if ( offset !== undefined ) { @@ -2446,9 +2423,9 @@ Object.assign( Vector4.prototype, { return this; - }, + } - random: function () { + random() { this.x = Math.random(); this.y = Math.random(); @@ -2459,7 +2436,9 @@ Object.assign( Vector4.prototype, { } -} ); +} + +Vector4.prototype.isVector4 = true; /* In options, we can specify: @@ -2488,7 +2467,7 @@ function WebGLRenderTarget( width, height, options ) { this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; - this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; + this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false; this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; } @@ -2575,24 +2554,24 @@ WebGLMultisampleRenderTarget.prototype = Object.assign( Object.create( WebGLRend } ); -function Quaternion( x = 0, y = 0, z = 0, w = 1 ) { +class Quaternion { - this._x = x; - this._y = y; - this._z = z; - this._w = w; + constructor( x = 0, y = 0, z = 0, w = 1 ) { -} + this._x = x; + this._y = y; + this._z = z; + this._w = w; -Object.assign( Quaternion, { + } - slerp: function ( qa, qb, qm, t ) { + static slerp( qa, qb, qm, t ) { return qm.copy( qa ).slerp( qb, t ); - }, + } - slerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { + static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { // fuzz-free, array-based Quaternion SLERP operation @@ -2650,9 +2629,9 @@ Object.assign( Quaternion, { dst[ dstOffset + 2 ] = z0; dst[ dstOffset + 3 ] = w0; - }, + } - multiplyQuaternionsFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { + static multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) { const x0 = src0[ srcOffset0 ]; const y0 = src0[ srcOffset0 + 1 ]; @@ -2673,85 +2652,59 @@ Object.assign( Quaternion, { } -} ); - -Object.defineProperties( Quaternion.prototype, { + get x() { - x: { + return this._x; - get: function () { - - return this._x; - - }, - - set: function ( value ) { - - this._x = value; - this._onChangeCallback(); - - } - - }, - - y: { - - get: function () { - - return this._y; - - }, - - set: function ( value ) { - - this._y = value; - this._onChangeCallback(); + } - } + set x( value ) { - }, + this._x = value; + this._onChangeCallback(); - z: { + } - get: function () { + get y() { - return this._z; + return this._y; - }, + } - set: function ( value ) { + set y( value ) { - this._z = value; - this._onChangeCallback(); + this._y = value; + this._onChangeCallback(); - } + } - }, + get z() { - w: { + return this._z; - get: function () { + } - return this._w; + set z( value ) { - }, + this._z = value; + this._onChangeCallback(); - set: function ( value ) { + } - this._w = value; - this._onChangeCallback(); + get w() { - } + return this._w; } -} ); + set w( value ) { -Object.assign( Quaternion.prototype, { + this._w = value; + this._onChangeCallback(); - isQuaternion: true, + } - set: function ( x, y, z, w ) { + set( x, y, z, w ) { this._x = x; this._y = y; @@ -2762,15 +2715,15 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor( this._x, this._y, this._z, this._w ); - }, + } - copy: function ( quaternion ) { + copy( quaternion ) { this._x = quaternion.x; this._y = quaternion.y; @@ -2781,9 +2734,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - setFromEuler: function ( euler, update ) { + setFromEuler( euler, update ) { if ( ! ( euler && euler.isEuler ) ) { @@ -2791,7 +2744,7 @@ Object.assign( Quaternion.prototype, { } - const x = euler._x, y = euler._y, z = euler._z, order = euler.order; + const x = euler._x, y = euler._y, z = euler._z, order = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/ // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ @@ -2861,9 +2814,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - setFromAxisAngle: function ( axis, angle ) { + setFromAxisAngle( axis, angle ) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm @@ -2880,9 +2833,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - setFromRotationMatrix: function ( m ) { + setFromRotationMatrix( m ) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm @@ -2938,9 +2891,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - setFromUnitVectors: function ( vFrom, vTo ) { + setFromUnitVectors( vFrom, vTo ) { // assumes direction vectors vFrom and vTo are normalized @@ -2981,15 +2934,15 @@ Object.assign( Quaternion.prototype, { return this.normalize(); - }, + } - angleTo: function ( q ) { + angleTo( q ) { return 2 * Math.acos( Math.abs( MathUtils.clamp( this.dot( q ), - 1, 1 ) ) ); - }, + } - rotateTowards: function ( q, step ) { + rotateTowards( q, step ) { const angle = this.angleTo( q ); @@ -3001,23 +2954,23 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - identity: function () { + identity() { return this.set( 0, 0, 0, 1 ); - }, + } - inverse: function () { + inverse() { // quaternion is assumed to have unit length return this.conjugate(); - }, + } - conjugate: function () { + conjugate() { this._x *= - 1; this._y *= - 1; @@ -3027,27 +2980,27 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - dot: function ( v ) { + dot( v ) { return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; - }, + } - lengthSq: function () { + lengthSq() { return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; - }, + } - length: function () { + length() { return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); - }, + } - normalize: function () { + normalize() { let l = this.length(); @@ -3073,9 +3026,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - multiply: function ( q, p ) { + multiply( q, p ) { if ( p !== undefined ) { @@ -3086,15 +3039,15 @@ Object.assign( Quaternion.prototype, { return this.multiplyQuaternions( this, q ); - }, + } - premultiply: function ( q ) { + premultiply( q ) { return this.multiplyQuaternions( q, this ); - }, + } - multiplyQuaternions: function ( a, b ) { + multiplyQuaternions( a, b ) { // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm @@ -3110,9 +3063,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - slerp: function ( qb, t ) { + slerp( qb, t ) { if ( t === 0 ) return this; if ( t === 1 ) return this.copy( qb ); @@ -3180,15 +3133,15 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - equals: function ( quaternion ) { + equals( quaternion ) { return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -3201,9 +3154,9 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -3215,9 +3168,9 @@ Object.assign( Quaternion.prototype, { return array; - }, + } - fromBufferAttribute: function ( attribute, index ) { + fromBufferAttribute( attribute, index ) { this._x = attribute.getX( index ); this._y = attribute.getY( index ); @@ -3226,36 +3179,33 @@ Object.assign( Quaternion.prototype, { return this; - }, + } - _onChange: function ( callback ) { + _onChange( callback ) { this._onChangeCallback = callback; return this; - }, - - _onChangeCallback: function () {} + } -} ); + _onChangeCallback() {} -const _vector = new Vector3(); -const _quaternion = new Quaternion(); +} -function Vector3( x = 0, y = 0, z = 0 ) { +Quaternion.prototype.isQuaternion = true; - this.x = x; - this.y = y; - this.z = z; +class Vector3 { -} + constructor( x = 0, y = 0, z = 0 ) { -Object.assign( Vector3.prototype, { + this.x = x; + this.y = y; + this.z = z; - isVector3: true, + } - set: function ( x, y, z ) { + set( x, y, z ) { if ( z === undefined ) z = this.z; // sprite.scale.set(x,y) @@ -3265,9 +3215,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setScalar: function ( scalar ) { + setScalar( scalar ) { this.x = scalar; this.y = scalar; @@ -3275,33 +3225,33 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setX: function ( x ) { + setX( x ) { this.x = x; return this; - }, + } - setY: function ( y ) { + setY( y ) { this.y = y; return this; - }, + } - setZ: function ( z ) { + setZ( z ) { this.z = z; return this; - }, + } - setComponent: function ( index, value ) { + setComponent( index, value ) { switch ( index ) { @@ -3314,9 +3264,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - getComponent: function ( index ) { + getComponent( index ) { switch ( index ) { @@ -3327,15 +3277,15 @@ Object.assign( Vector3.prototype, { } - }, + } - clone: function () { + clone() { return new this.constructor( this.x, this.y, this.z ); - }, + } - copy: function ( v ) { + copy( v ) { this.x = v.x; this.y = v.y; @@ -3343,9 +3293,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - add: function ( v, w ) { + add( v, w ) { if ( w !== undefined ) { @@ -3360,9 +3310,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - addScalar: function ( s ) { + addScalar( s ) { this.x += s; this.y += s; @@ -3370,9 +3320,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - addVectors: function ( a, b ) { + addVectors( a, b ) { this.x = a.x + b.x; this.y = a.y + b.y; @@ -3380,9 +3330,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - addScaledVector: function ( v, s ) { + addScaledVector( v, s ) { this.x += v.x * s; this.y += v.y * s; @@ -3390,9 +3340,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - sub: function ( v, w ) { + sub( v, w ) { if ( w !== undefined ) { @@ -3407,9 +3357,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - subScalar: function ( s ) { + subScalar( s ) { this.x -= s; this.y -= s; @@ -3417,9 +3367,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - subVectors: function ( a, b ) { + subVectors( a, b ) { this.x = a.x - b.x; this.y = a.y - b.y; @@ -3427,9 +3377,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - multiply: function ( v, w ) { + multiply( v, w ) { if ( w !== undefined ) { @@ -3444,9 +3394,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - multiplyScalar: function ( scalar ) { + multiplyScalar( scalar ) { this.x *= scalar; this.y *= scalar; @@ -3454,9 +3404,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - multiplyVectors: function ( a, b ) { + multiplyVectors( a, b ) { this.x = a.x * b.x; this.y = a.y * b.y; @@ -3464,9 +3414,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - applyEuler: function ( euler ) { + applyEuler( euler ) { if ( ! ( euler && euler.isEuler ) ) { @@ -3476,15 +3426,15 @@ Object.assign( Vector3.prototype, { return this.applyQuaternion( _quaternion.setFromEuler( euler ) ); - }, + } - applyAxisAngle: function ( axis, angle ) { + applyAxisAngle( axis, angle ) { return this.applyQuaternion( _quaternion.setFromAxisAngle( axis, angle ) ); - }, + } - applyMatrix3: function ( m ) { + applyMatrix3( m ) { const x = this.x, y = this.y, z = this.z; const e = m.elements; @@ -3495,15 +3445,15 @@ Object.assign( Vector3.prototype, { return this; - }, + } - applyNormalMatrix: function ( m ) { + applyNormalMatrix( m ) { return this.applyMatrix3( m ).normalize(); - }, + } - applyMatrix4: function ( m ) { + applyMatrix4( m ) { const x = this.x, y = this.y, z = this.z; const e = m.elements; @@ -3516,9 +3466,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - applyQuaternion: function ( q ) { + applyQuaternion( q ) { const x = this.x, y = this.y, z = this.z; const qx = q.x, qy = q.y, qz = q.z, qw = q.w; @@ -3538,21 +3488,21 @@ Object.assign( Vector3.prototype, { return this; - }, + } - project: function ( camera ) { + project( camera ) { return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); - }, + } - unproject: function ( camera ) { + unproject( camera ) { return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); - }, + } - transformDirection: function ( m ) { + transformDirection( m ) { // input: THREE.Matrix4 affine matrix // vector interpreted as a direction @@ -3566,9 +3516,9 @@ Object.assign( Vector3.prototype, { return this.normalize(); - }, + } - divide: function ( v ) { + divide( v ) { this.x /= v.x; this.y /= v.y; @@ -3576,15 +3526,15 @@ Object.assign( Vector3.prototype, { return this; - }, + } - divideScalar: function ( scalar ) { + divideScalar( scalar ) { return this.multiplyScalar( 1 / scalar ); - }, + } - min: function ( v ) { + min( v ) { this.x = Math.min( this.x, v.x ); this.y = Math.min( this.y, v.y ); @@ -3592,9 +3542,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - max: function ( v ) { + max( v ) { this.x = Math.max( this.x, v.x ); this.y = Math.max( this.y, v.y ); @@ -3602,9 +3552,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - clamp: function ( min, max ) { + clamp( min, max ) { // assumes min < max, componentwise @@ -3614,9 +3564,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - clampScalar: function ( minVal, maxVal ) { + clampScalar( minVal, maxVal ) { this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); @@ -3624,17 +3574,17 @@ Object.assign( Vector3.prototype, { return this; - }, + } - clampLength: function ( min, max ) { + clampLength( min, max ) { const length = this.length(); return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - }, + } - floor: function () { + floor() { this.x = Math.floor( this.x ); this.y = Math.floor( this.y ); @@ -3642,9 +3592,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - ceil: function () { + ceil() { this.x = Math.ceil( this.x ); this.y = Math.ceil( this.y ); @@ -3652,9 +3602,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - round: function () { + round() { this.x = Math.round( this.x ); this.y = Math.round( this.y ); @@ -3662,9 +3612,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - roundToZero: function () { + roundToZero() { this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); @@ -3672,9 +3622,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - negate: function () { + negate() { this.x = - this.x; this.y = - this.y; @@ -3682,47 +3632,47 @@ Object.assign( Vector3.prototype, { return this; - }, + } - dot: function ( v ) { + dot( v ) { return this.x * v.x + this.y * v.y + this.z * v.z; - }, + } // TODO lengthSquared? - lengthSq: function () { + lengthSq() { return this.x * this.x + this.y * this.y + this.z * this.z; - }, + } - length: function () { + length() { return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); - }, + } - manhattanLength: function () { + manhattanLength() { return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); - }, + } - normalize: function () { + normalize() { return this.divideScalar( this.length() || 1 ); - }, + } - setLength: function ( length ) { + setLength( length ) { return this.normalize().multiplyScalar( length ); - }, + } - lerp: function ( v, alpha ) { + lerp( v, alpha ) { this.x += ( v.x - this.x ) * alpha; this.y += ( v.y - this.y ) * alpha; @@ -3730,9 +3680,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - lerpVectors: function ( v1, v2, alpha ) { + lerpVectors( v1, v2, alpha ) { this.x = v1.x + ( v2.x - v1.x ) * alpha; this.y = v1.y + ( v2.y - v1.y ) * alpha; @@ -3740,9 +3690,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - cross: function ( v, w ) { + cross( v, w ) { if ( w !== undefined ) { @@ -3753,9 +3703,9 @@ Object.assign( Vector3.prototype, { return this.crossVectors( this, v ); - }, + } - crossVectors: function ( a, b ) { + crossVectors( a, b ) { const ax = a.x, ay = a.y, az = a.z; const bx = b.x, by = b.y, bz = b.z; @@ -3766,9 +3716,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - projectOnVector: function ( v ) { + projectOnVector( v ) { const denominator = v.lengthSq(); @@ -3778,26 +3728,26 @@ Object.assign( Vector3.prototype, { return this.copy( v ).multiplyScalar( scalar ); - }, + } - projectOnPlane: function ( planeNormal ) { + projectOnPlane( planeNormal ) { _vector.copy( this ).projectOnVector( planeNormal ); return this.sub( _vector ); - }, + } - reflect: function ( normal ) { + reflect( normal ) { // reflect incident vector off plane orthogonal to normal // normal is assumed to have unit length return this.sub( _vector.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); - }, + } - angleTo: function ( v ) { + angleTo( v ) { const denominator = Math.sqrt( this.lengthSq() * v.lengthSq() ); @@ -3809,35 +3759,35 @@ Object.assign( Vector3.prototype, { return Math.acos( MathUtils.clamp( theta, - 1, 1 ) ); - }, + } - distanceTo: function ( v ) { + distanceTo( v ) { return Math.sqrt( this.distanceToSquared( v ) ); - }, + } - distanceToSquared: function ( v ) { + distanceToSquared( v ) { const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; return dx * dx + dy * dy + dz * dz; - }, + } - manhattanDistanceTo: function ( v ) { + manhattanDistanceTo( v ) { return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); - }, + } - setFromSpherical: function ( s ) { + setFromSpherical( s ) { return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); - }, + } - setFromSphericalCoords: function ( radius, phi, theta ) { + setFromSphericalCoords( radius, phi, theta ) { const sinPhiRadius = Math.sin( phi ) * radius; @@ -3847,15 +3797,15 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setFromCylindrical: function ( c ) { + setFromCylindrical( c ) { return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); - }, + } - setFromCylindricalCoords: function ( radius, theta, y ) { + setFromCylindricalCoords( radius, theta, y ) { this.x = radius * Math.sin( theta ); this.y = y; @@ -3863,9 +3813,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setFromMatrixPosition: function ( m ) { + setFromMatrixPosition( m ) { const e = m.elements; @@ -3875,9 +3825,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setFromMatrixScale: function ( m ) { + setFromMatrixScale( m ) { const sx = this.setFromMatrixColumn( m, 0 ).length(); const sy = this.setFromMatrixColumn( m, 1 ).length(); @@ -3889,27 +3839,27 @@ Object.assign( Vector3.prototype, { return this; - }, + } - setFromMatrixColumn: function ( m, index ) { + setFromMatrixColumn( m, index ) { return this.fromArray( m.elements, index * 4 ); - }, + } - setFromMatrix3Column: function ( m, index ) { + setFromMatrix3Column( m, index ) { return this.fromArray( m.elements, index * 3 ); - }, + } - equals: function ( v ) { + equals( v ) { return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -3919,9 +3869,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -3932,9 +3882,9 @@ Object.assign( Vector3.prototype, { return array; - }, + } - fromBufferAttribute: function ( attribute, index, offset ) { + fromBufferAttribute( attribute, index, offset ) { if ( offset !== undefined ) { @@ -3948,9 +3898,9 @@ Object.assign( Vector3.prototype, { return this; - }, + } - random: function () { + random() { this.x = Math.random(); this.y = Math.random(); @@ -3960,2118 +3910,2080 @@ Object.assign( Vector3.prototype, { } -} ); - -const _v1 = new Vector3(); -const _m1 = new Matrix4(); -const _zero = new Vector3( 0, 0, 0 ); -const _one = new Vector3( 1, 1, 1 ); -const _x = new Vector3(); -const _y = new Vector3(); -const _z = new Vector3(); - -function Matrix4() { +} - this.elements = [ +Vector3.prototype.isVector3 = true; - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 +const _vector = new Vector3(); +const _quaternion = new Quaternion(); - ]; +class Box3 { - if ( arguments.length > 0 ) { + constructor( min, max ) { - console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); + this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); + this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); } -} + set( min, max ) { -Object.assign( Matrix4.prototype, { + this.min.copy( min ); + this.max.copy( max ); - isMatrix4: true, + return this; - set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { + } - const te = this.elements; + setFromArray( array ) { - te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; - te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; - te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; - te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; + let minX = + Infinity; + let minY = + Infinity; + let minZ = + Infinity; - return this; + let maxX = - Infinity; + let maxY = - Infinity; + let maxZ = - Infinity; - }, + for ( let i = 0, l = array.length; i < l; i += 3 ) { - identity: function () { + const x = array[ i ]; + const y = array[ i + 1 ]; + const z = array[ i + 2 ]; - this.set( + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( z < minZ ) minZ = z; - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + if ( z > maxZ ) maxZ = z; - ); + } + + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); return this; - }, + } - clone: function () { + setFromBufferAttribute( attribute ) { - return new Matrix4().fromArray( this.elements ); + let minX = + Infinity; + let minY = + Infinity; + let minZ = + Infinity; - }, + let maxX = - Infinity; + let maxY = - Infinity; + let maxZ = - Infinity; - copy: function ( m ) { + for ( let i = 0, l = attribute.count; i < l; i ++ ) { - const te = this.elements; - const me = m.elements; + const x = attribute.getX( i ); + const y = attribute.getY( i ); + const z = attribute.getZ( i ); - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; - te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; - te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; - te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; + if ( x < minX ) minX = x; + if ( y < minY ) minY = y; + if ( z < minZ ) minZ = z; - return this; + if ( x > maxX ) maxX = x; + if ( y > maxY ) maxY = y; + if ( z > maxZ ) maxZ = z; - }, + } - copyPosition: function ( m ) { + this.min.set( minX, minY, minZ ); + this.max.set( maxX, maxY, maxZ ); - const te = this.elements, me = m.elements; + return this; - te[ 12 ] = me[ 12 ]; - te[ 13 ] = me[ 13 ]; - te[ 14 ] = me[ 14 ]; + } - return this; + setFromPoints( points ) { - }, + this.makeEmpty(); - extractBasis: function ( xAxis, yAxis, zAxis ) { + for ( let i = 0, il = points.length; i < il; i ++ ) { - xAxis.setFromMatrixColumn( this, 0 ); - yAxis.setFromMatrixColumn( this, 1 ); - zAxis.setFromMatrixColumn( this, 2 ); + this.expandByPoint( points[ i ] ); + + } return this; - }, + } - makeBasis: function ( xAxis, yAxis, zAxis ) { + setFromCenterAndSize( center, size ) { - this.set( - xAxis.x, yAxis.x, zAxis.x, 0, - xAxis.y, yAxis.y, zAxis.y, 0, - xAxis.z, yAxis.z, zAxis.z, 0, - 0, 0, 0, 1 - ); + const halfSize = _vector$1.copy( size ).multiplyScalar( 0.5 ); + + this.min.copy( center ).sub( halfSize ); + this.max.copy( center ).add( halfSize ); return this; - }, + } - extractRotation: function ( m ) { + setFromObject( object ) { - // this method does not support reflection matrices + this.makeEmpty(); - const te = this.elements; - const me = m.elements; + return this.expandByObject( object ); - const scaleX = 1 / _v1.setFromMatrixColumn( m, 0 ).length(); - const scaleY = 1 / _v1.setFromMatrixColumn( m, 1 ).length(); - const scaleZ = 1 / _v1.setFromMatrixColumn( m, 2 ).length(); + } - te[ 0 ] = me[ 0 ] * scaleX; - te[ 1 ] = me[ 1 ] * scaleX; - te[ 2 ] = me[ 2 ] * scaleX; - te[ 3 ] = 0; + clone() { - te[ 4 ] = me[ 4 ] * scaleY; - te[ 5 ] = me[ 5 ] * scaleY; - te[ 6 ] = me[ 6 ] * scaleY; - te[ 7 ] = 0; + return new this.constructor().copy( this ); - te[ 8 ] = me[ 8 ] * scaleZ; - te[ 9 ] = me[ 9 ] * scaleZ; - te[ 10 ] = me[ 10 ] * scaleZ; - te[ 11 ] = 0; + } - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + copy( box ) { + + this.min.copy( box.min ); + this.max.copy( box.max ); return this; - }, + } - makeRotationFromEuler: function ( euler ) { + makeEmpty() { - if ( ! ( euler && euler.isEuler ) ) { + this.min.x = this.min.y = this.min.z = + Infinity; + this.max.x = this.max.y = this.max.z = - Infinity; - console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); + return this; - } + } - const te = this.elements; + isEmpty() { - const x = euler.x, y = euler.y, z = euler.z; - const a = Math.cos( x ), b = Math.sin( x ); - const c = Math.cos( y ), d = Math.sin( y ); - const e = Math.cos( z ), f = Math.sin( z ); + // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - if ( euler.order === 'XYZ' ) { + return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); - const ae = a * e, af = a * f, be = b * e, bf = b * f; + } - te[ 0 ] = c * e; - te[ 4 ] = - c * f; - te[ 8 ] = d; + getCenter( target ) { - te[ 1 ] = af + be * d; - te[ 5 ] = ae - bf * d; - te[ 9 ] = - b * c; + if ( target === undefined ) { - te[ 2 ] = bf - ae * d; - te[ 6 ] = be + af * d; - te[ 10 ] = a * c; + console.warn( 'THREE.Box3: .getCenter() target is now required' ); + target = new Vector3(); - } else if ( euler.order === 'YXZ' ) { + } - const ce = c * e, cf = c * f, de = d * e, df = d * f; + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - te[ 0 ] = ce + df * b; - te[ 4 ] = de * b - cf; - te[ 8 ] = a * d; + } - te[ 1 ] = a * f; - te[ 5 ] = a * e; - te[ 9 ] = - b; + getSize( target ) { - te[ 2 ] = cf * b - de; - te[ 6 ] = df + ce * b; - te[ 10 ] = a * c; + if ( target === undefined ) { - } else if ( euler.order === 'ZXY' ) { - - const ce = c * e, cf = c * f, de = d * e, df = d * f; + console.warn( 'THREE.Box3: .getSize() target is now required' ); + target = new Vector3(); - te[ 0 ] = ce - df * b; - te[ 4 ] = - a * f; - te[ 8 ] = de + cf * b; + } - te[ 1 ] = cf + de * b; - te[ 5 ] = a * e; - te[ 9 ] = df - ce * b; + return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); - te[ 2 ] = - a * d; - te[ 6 ] = b; - te[ 10 ] = a * c; + } - } else if ( euler.order === 'ZYX' ) { + expandByPoint( point ) { - const ae = a * e, af = a * f, be = b * e, bf = b * f; + this.min.min( point ); + this.max.max( point ); - te[ 0 ] = c * e; - te[ 4 ] = be * d - af; - te[ 8 ] = ae * d + bf; + return this; - te[ 1 ] = c * f; - te[ 5 ] = bf * d + ae; - te[ 9 ] = af * d - be; + } - te[ 2 ] = - d; - te[ 6 ] = b * c; - te[ 10 ] = a * c; + expandByVector( vector ) { - } else if ( euler.order === 'YZX' ) { + this.min.sub( vector ); + this.max.add( vector ); - const ac = a * c, ad = a * d, bc = b * c, bd = b * d; + return this; - te[ 0 ] = c * e; - te[ 4 ] = bd - ac * f; - te[ 8 ] = bc * f + ad; + } - te[ 1 ] = f; - te[ 5 ] = a * e; - te[ 9 ] = - b * e; + expandByScalar( scalar ) { - te[ 2 ] = - d * e; - te[ 6 ] = ad * f + bc; - te[ 10 ] = ac - bd * f; + this.min.addScalar( - scalar ); + this.max.addScalar( scalar ); - } else if ( euler.order === 'XZY' ) { + return this; - const ac = a * c, ad = a * d, bc = b * c, bd = b * d; + } - te[ 0 ] = c * e; - te[ 4 ] = - f; - te[ 8 ] = d * e; + expandByObject( object ) { - te[ 1 ] = ac * f + bd; - te[ 5 ] = a * e; - te[ 9 ] = ad * f - bc; + // Computes the world-axis-aligned bounding box of an object (including its children), + // accounting for both the object's, and children's, world transforms - te[ 2 ] = bc * f - ad; - te[ 6 ] = b * e; - te[ 10 ] = bd * f + ac; + object.updateWorldMatrix( false, false ); - } + const geometry = object.geometry; - // bottom row - te[ 3 ] = 0; - te[ 7 ] = 0; - te[ 11 ] = 0; + if ( geometry !== undefined ) { - // last column - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; + if ( geometry.boundingBox === null ) { - return this; + geometry.computeBoundingBox(); - }, + } - makeRotationFromQuaternion: function ( q ) { + _box.copy( geometry.boundingBox ); + _box.applyMatrix4( object.matrixWorld ); - return this.compose( _zero, q, _one ); + this.union( _box ); - }, + } - lookAt: function ( eye, target, up ) { + const children = object.children; - const te = this.elements; + for ( let i = 0, l = children.length; i < l; i ++ ) { - _z.subVectors( eye, target ); + this.expandByObject( children[ i ] ); - if ( _z.lengthSq() === 0 ) { + } - // eye and target are in the same position + return this; - _z.z = 1; + } - } + containsPoint( point ) { - _z.normalize(); - _x.crossVectors( up, _z ); + return point.x < this.min.x || point.x > this.max.x || + point.y < this.min.y || point.y > this.max.y || + point.z < this.min.z || point.z > this.max.z ? false : true; - if ( _x.lengthSq() === 0 ) { + } - // up and z are parallel + containsBox( box ) { - if ( Math.abs( up.z ) === 1 ) { + return this.min.x <= box.min.x && box.max.x <= this.max.x && + this.min.y <= box.min.y && box.max.y <= this.max.y && + this.min.z <= box.min.z && box.max.z <= this.max.z; - _z.x += 0.0001; + } - } else { + getParameter( point, target ) { - _z.z += 0.0001; + // This can potentially have a divide by zero if the box + // has a size dimension of 0. - } + if ( target === undefined ) { - _z.normalize(); - _x.crossVectors( up, _z ); + console.warn( 'THREE.Box3: .getParameter() target is now required' ); + target = new Vector3(); } - _x.normalize(); - _y.crossVectors( _z, _x ); + return target.set( + ( point.x - this.min.x ) / ( this.max.x - this.min.x ), + ( point.y - this.min.y ) / ( this.max.y - this.min.y ), + ( point.z - this.min.z ) / ( this.max.z - this.min.z ) + ); - te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; - te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; - te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; + } - return this; + intersectsBox( box ) { - }, + // using 6 splitting planes to rule out intersections. + return box.max.x < this.min.x || box.min.x > this.max.x || + box.max.y < this.min.y || box.min.y > this.max.y || + box.max.z < this.min.z || box.min.z > this.max.z ? false : true; - multiply: function ( m, n ) { + } - if ( n !== undefined ) { + intersectsSphere( sphere ) { - console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); - return this.multiplyMatrices( m, n ); + // Find the point on the AABB closest to the sphere center. + this.clampPoint( sphere.center, _vector$1 ); - } + // If that point is inside the sphere, the AABB and sphere intersect. + return _vector$1.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); - return this.multiplyMatrices( this, m ); + } - }, + intersectsPlane( plane ) { - premultiply: function ( m ) { + // We compute the minimum and maximum dot product values. If those values + // are on the same side (back or front) of the plane, then there is no intersection. - return this.multiplyMatrices( m, this ); + let min, max; - }, + if ( plane.normal.x > 0 ) { - multiplyMatrices: function ( a, b ) { + min = plane.normal.x * this.min.x; + max = plane.normal.x * this.max.x; - const ae = a.elements; - const be = b.elements; - const te = this.elements; + } else { - const a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; - const a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; - const a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; - const a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; + min = plane.normal.x * this.max.x; + max = plane.normal.x * this.min.x; - const b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; - const b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; - const b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; - const b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; + } - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; + if ( plane.normal.y > 0 ) { - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; + min += plane.normal.y * this.min.y; + max += plane.normal.y * this.max.y; - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; + } else { - te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; + min += plane.normal.y * this.max.y; + max += plane.normal.y * this.min.y; - return this; + } - }, + if ( plane.normal.z > 0 ) { - multiplyScalar: function ( s ) { + min += plane.normal.z * this.min.z; + max += plane.normal.z * this.max.z; - const te = this.elements; + } else { - te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; - te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; - te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; - te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; + min += plane.normal.z * this.max.z; + max += plane.normal.z * this.min.z; - return this; + } - }, + return ( min <= - plane.constant && max >= - plane.constant ); - determinant: function () { + } - const te = this.elements; + intersectsTriangle( triangle ) { - const n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; - const n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; - const n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; - const n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; + if ( this.isEmpty() ) { - //TODO: make this more efficient - //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) + return false; - return ( - n41 * ( - + n14 * n23 * n32 - - n13 * n24 * n32 - - n14 * n22 * n33 - + n12 * n24 * n33 - + n13 * n22 * n34 - - n12 * n23 * n34 - ) + - n42 * ( - + n11 * n23 * n34 - - n11 * n24 * n33 - + n14 * n21 * n33 - - n13 * n21 * n34 - + n13 * n24 * n31 - - n14 * n23 * n31 - ) + - n43 * ( - + n11 * n24 * n32 - - n11 * n22 * n34 - - n14 * n21 * n32 - + n12 * n21 * n34 - + n14 * n22 * n31 - - n12 * n24 * n31 - ) + - n44 * ( - - n13 * n22 * n31 - - n11 * n23 * n32 - + n11 * n22 * n33 - + n13 * n21 * n32 - - n12 * n21 * n33 - + n12 * n23 * n31 - ) + } - ); + // compute box center and extents + this.getCenter( _center ); + _extents.subVectors( this.max, _center ); - }, + // translate triangle to aabb origin + _v0.subVectors( triangle.a, _center ); + _v1.subVectors( triangle.b, _center ); + _v2.subVectors( triangle.c, _center ); - transpose: function () { + // compute edge vectors for triangle + _f0.subVectors( _v1, _v0 ); + _f1.subVectors( _v2, _v1 ); + _f2.subVectors( _v0, _v2 ); - const te = this.elements; - let tmp; + // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb + // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation + // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) + let axes = [ + 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, + _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, + - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 + ]; + if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; - tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; - tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; + return false; - tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; - tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; - tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; + } - return this; + // test 3 face normals from the aabb + axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; + if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - }, + return false; - setPosition: function ( x, y, z ) { + } - const te = this.elements; + // finally testing the face normal of the triangle + // use already existing triangle edge vectors here + _triangleNormal.crossVectors( _f0, _f1 ); + axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; - if ( x.isVector3 ) { + return satForAxes( axes, _v0, _v1, _v2, _extents ); - te[ 12 ] = x.x; - te[ 13 ] = x.y; - te[ 14 ] = x.z; + } - } else { + clampPoint( point, target ) { - te[ 12 ] = x; - te[ 13 ] = y; - te[ 14 ] = z; + if ( target === undefined ) { + + console.warn( 'THREE.Box3: .clampPoint() target is now required' ); + target = new Vector3(); } - return this; + return target.copy( point ).clamp( this.min, this.max ); - }, + } + + distanceToPoint( point ) { - getInverse: function ( m, throwOnDegenerate ) { + const clampedPoint = _vector$1.copy( point ).clamp( this.min, this.max ); - if ( throwOnDegenerate !== undefined ) { + return clampedPoint.sub( point ).length(); - console.warn( "THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate." ); + } - } + getBoundingSphere( target ) { - // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - const te = this.elements, - me = m.elements, + if ( target === undefined ) { - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], - n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], - n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], - n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], + console.error( 'THREE.Box3: .getBoundingSphere() target is now required' ); + //target = new Sphere(); // removed to avoid cyclic dependency - t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, - t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, - t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, - t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + } - const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; + this.getCenter( target.center ); - if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); + target.radius = this.getSize( _vector$1 ).length() * 0.5; - const detInv = 1 / det; + return target; - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; - te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; - te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; + } - te[ 4 ] = t12 * detInv; - te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; - te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; - te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; + intersect( box ) { - te[ 8 ] = t13 * detInv; - te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; - te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; - te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; + this.min.max( box.min ); + this.max.min( box.max ); - te[ 12 ] = t14 * detInv; - te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; - te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; - te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; + // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. + if ( this.isEmpty() ) this.makeEmpty(); return this; - }, - - scale: function ( v ) { + } - const te = this.elements; - const x = v.x, y = v.y, z = v.z; + union( box ) { - te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; - te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; - te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; - te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; + this.min.min( box.min ); + this.max.max( box.max ); return this; - }, - - getMaxScaleOnAxis: function () { + } - const te = this.elements; + applyMatrix4( matrix ) { - const scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; - const scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; - const scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; + // transform of empty box is an empty box. + if ( this.isEmpty() ) return this; - return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); + // NOTE: I am using a binary pattern to specify all 2^3 combinations below + _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 + _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 + _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 + _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 + _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 + _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 + _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 + _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 - }, + this.setFromPoints( _points ); - makeTranslation: function ( x, y, z ) { + return this; - this.set( + } - 1, 0, 0, x, - 0, 1, 0, y, - 0, 0, 1, z, - 0, 0, 0, 1 + translate( offset ) { - ); + this.min.add( offset ); + this.max.add( offset ); return this; - }, + } - makeRotationX: function ( theta ) { + equals( box ) { - const c = Math.cos( theta ), s = Math.sin( theta ); + return box.min.equals( this.min ) && box.max.equals( this.max ); - this.set( + } - 1, 0, 0, 0, - 0, c, - s, 0, - 0, s, c, 0, - 0, 0, 0, 1 +} - ); +function satForAxes( axes, v0, v1, v2, extents ) { - return this; + for ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) { - }, + _testAxis.fromArray( axes, i ); + // project the aabb onto the seperating axis + const r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); + // project all 3 vertices of the triangle onto the seperating axis + const p0 = v0.dot( _testAxis ); + const p1 = v1.dot( _testAxis ); + const p2 = v2.dot( _testAxis ); + // actual test, basically see if either of the most extreme of the triangle points intersects r + if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { - makeRotationY: function ( theta ) { + // points of the projected triangle are outside the projected half-length of the aabb + // the axis is seperating and we can exit + return false; - const c = Math.cos( theta ), s = Math.sin( theta ); + } - this.set( + } - c, 0, s, 0, - 0, 1, 0, 0, - - s, 0, c, 0, - 0, 0, 0, 1 + return true; - ); +} - return this; +Box3.prototype.isBox3 = true; - }, +const _points = [ + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3(), + new Vector3() +]; - makeRotationZ: function ( theta ) { +const _vector$1 = new Vector3(); - const c = Math.cos( theta ), s = Math.sin( theta ); +const _box = new Box3(); - this.set( +// triangle centered vertices - c, - s, 0, 0, - s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 +const _v0 = new Vector3(); +const _v1 = new Vector3(); +const _v2 = new Vector3(); - ); +// triangle edge vectors - return this; +const _f0 = new Vector3(); +const _f1 = new Vector3(); +const _f2 = new Vector3(); - }, +const _center = new Vector3(); +const _extents = new Vector3(); +const _triangleNormal = new Vector3(); +const _testAxis = new Vector3(); - makeRotationAxis: function ( axis, angle ) { +const _box$1 = new Box3(); - // Based on http://www.gamedev.net/reference/articles/article1199.asp +class Sphere { - const c = Math.cos( angle ); - const s = Math.sin( angle ); - const t = 1 - c; - const x = axis.x, y = axis.y, z = axis.z; - const tx = t * x, ty = t * y; + constructor( center, radius ) { - this.set( + this.center = ( center !== undefined ) ? center : new Vector3(); + this.radius = ( radius !== undefined ) ? radius : - 1; - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 + } - ); + set( center, radius ) { - return this; + this.center.copy( center ); + this.radius = radius; - }, + return this; - makeScale: function ( x, y, z ) { + } - this.set( + setFromPoints( points, optionalCenter ) { - x, 0, 0, 0, - 0, y, 0, 0, - 0, 0, z, 0, - 0, 0, 0, 1 + const center = this.center; - ); + if ( optionalCenter !== undefined ) { - return this; + center.copy( optionalCenter ); - }, + } else { - makeShear: function ( x, y, z ) { + _box$1.setFromPoints( points ).getCenter( center ); - this.set( + } - 1, y, z, 0, - x, 1, z, 0, - x, y, 1, 0, - 0, 0, 0, 1 + let maxRadiusSq = 0; - ); + for ( let i = 0, il = points.length; i < il; i ++ ) { - return this; + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - }, + } - compose: function ( position, quaternion, scale ) { + this.radius = Math.sqrt( maxRadiusSq ); - const te = this.elements; + return this; - const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; - const x2 = x + x, y2 = y + y, z2 = z + z; - const xx = x * x2, xy = x * y2, xz = x * z2; - const yy = y * y2, yz = y * z2, zz = z * z2; - const wx = w * x2, wy = w * y2, wz = w * z2; + } - const sx = scale.x, sy = scale.y, sz = scale.z; + clone() { - te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; - te[ 1 ] = ( xy + wz ) * sx; - te[ 2 ] = ( xz - wy ) * sx; - te[ 3 ] = 0; + return new this.constructor().copy( this ); - te[ 4 ] = ( xy - wz ) * sy; - te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; - te[ 6 ] = ( yz + wx ) * sy; - te[ 7 ] = 0; + } - te[ 8 ] = ( xz + wy ) * sz; - te[ 9 ] = ( yz - wx ) * sz; - te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; - te[ 11 ] = 0; + copy( sphere ) { - te[ 12 ] = position.x; - te[ 13 ] = position.y; - te[ 14 ] = position.z; - te[ 15 ] = 1; + this.center.copy( sphere.center ); + this.radius = sphere.radius; return this; - }, + } - decompose: function ( position, quaternion, scale ) { + isEmpty() { - const te = this.elements; + return ( this.radius < 0 ); - let sx = _v1.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); - const sy = _v1.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); - const sz = _v1.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); + } - // if determine is negative, we need to invert one scale - const det = this.determinant(); - if ( det < 0 ) sx = - sx; + makeEmpty() { - position.x = te[ 12 ]; - position.y = te[ 13 ]; - position.z = te[ 14 ]; + this.center.set( 0, 0, 0 ); + this.radius = - 1; - // scale the rotation part - _m1.copy( this ); + return this; - const invSX = 1 / sx; - const invSY = 1 / sy; - const invSZ = 1 / sz; + } - _m1.elements[ 0 ] *= invSX; - _m1.elements[ 1 ] *= invSX; - _m1.elements[ 2 ] *= invSX; + containsPoint( point ) { - _m1.elements[ 4 ] *= invSY; - _m1.elements[ 5 ] *= invSY; - _m1.elements[ 6 ] *= invSY; + return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); - _m1.elements[ 8 ] *= invSZ; - _m1.elements[ 9 ] *= invSZ; - _m1.elements[ 10 ] *= invSZ; + } - quaternion.setFromRotationMatrix( _m1 ); + distanceToPoint( point ) { - scale.x = sx; - scale.y = sy; - scale.z = sz; + return ( point.distanceTo( this.center ) - this.radius ); - return this; + } - }, + intersectsSphere( sphere ) { - makePerspective: function ( left, right, top, bottom, near, far ) { + const radiusSum = this.radius + sphere.radius; - if ( far === undefined ) { + return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); - console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); + } - } + intersectsBox( box ) { - const te = this.elements; - const x = 2 * near / ( right - left ); - const y = 2 * near / ( top - bottom ); + return box.intersectsSphere( this ); - const a = ( right + left ) / ( right - left ); - const b = ( top + bottom ) / ( top - bottom ); - const c = - ( far + near ) / ( far - near ); - const d = - 2 * far * near / ( far - near ); + } - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; + intersectsPlane( plane ) { - return this; + return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; - }, + } - makeOrthographic: function ( left, right, top, bottom, near, far ) { + clampPoint( point, target ) { - const te = this.elements; - const w = 1.0 / ( right - left ); - const h = 1.0 / ( top - bottom ); - const p = 1.0 / ( far - near ); + const deltaLengthSq = this.center.distanceToSquared( point ); - const x = ( right + left ) * w; - const y = ( top + bottom ) * h; - const z = ( far + near ) * p; + if ( target === undefined ) { - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; + console.warn( 'THREE.Sphere: .clampPoint() target is now required' ); + target = new Vector3(); - return this; + } - }, + target.copy( point ); - equals: function ( matrix ) { + if ( deltaLengthSq > ( this.radius * this.radius ) ) { - const te = this.elements; - const me = matrix.elements; + target.sub( this.center ).normalize(); + target.multiplyScalar( this.radius ).add( this.center ); - for ( let i = 0; i < 16; i ++ ) { + } - if ( te[ i ] !== me[ i ] ) return false; + return target; - } + } - return true; + getBoundingBox( target ) { - }, + if ( target === undefined ) { - fromArray: function ( array, offset ) { + console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' ); + target = new Box3(); - if ( offset === undefined ) offset = 0; + } - for ( let i = 0; i < 16; i ++ ) { + if ( this.isEmpty() ) { - this.elements[ i ] = array[ i + offset ]; + // Empty sphere produces empty bounding box + target.makeEmpty(); + return target; } - return this; + target.set( this.center, this.center ); + target.expandByScalar( this.radius ); - }, + return target; - toArray: function ( array, offset ) { + } - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + applyMatrix4( matrix ) { - const te = this.elements; + this.center.applyMatrix4( matrix ); + this.radius = this.radius * matrix.getMaxScaleOnAxis(); - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; - array[ offset + 3 ] = te[ 3 ]; + return this; - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; + } - array[ offset + 8 ] = te[ 8 ]; - array[ offset + 9 ] = te[ 9 ]; - array[ offset + 10 ] = te[ 10 ]; - array[ offset + 11 ] = te[ 11 ]; + translate( offset ) { - array[ offset + 12 ] = te[ 12 ]; - array[ offset + 13 ] = te[ 13 ]; - array[ offset + 14 ] = te[ 14 ]; - array[ offset + 15 ] = te[ 15 ]; + this.center.add( offset ); - return array; + return this; } -} ); - -const _matrix = new Matrix4(); -const _quaternion$1 = new Quaternion(); + equals( sphere ) { -function Euler( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) { + return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); - this._x = x; - this._y = y; - this._z = z; - this._order = order; + } } -Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; +const _vector$2 = new Vector3(); +const _segCenter = new Vector3(); +const _segDir = new Vector3(); +const _diff = new Vector3(); -Euler.DefaultOrder = 'XYZ'; +const _edge1 = new Vector3(); +const _edge2 = new Vector3(); +const _normal = new Vector3(); -Object.defineProperties( Euler.prototype, { +class Ray { - x: { + constructor( origin, direction ) { - get: function () { + this.origin = ( origin !== undefined ) ? origin : new Vector3(); + this.direction = ( direction !== undefined ) ? direction : new Vector3( 0, 0, - 1 ); - return this._x; + } - }, + set( origin, direction ) { - set: function ( value ) { + this.origin.copy( origin ); + this.direction.copy( direction ); - this._x = value; - this._onChangeCallback(); + return this; - } + } - }, + clone() { - y: { + return new this.constructor().copy( this ); - get: function () { + } - return this._y; + copy( ray ) { - }, + this.origin.copy( ray.origin ); + this.direction.copy( ray.direction ); - set: function ( value ) { + return this; - this._y = value; - this._onChangeCallback(); + } - } + at( t, target ) { - }, + if ( target === undefined ) { - z: { + console.warn( 'THREE.Ray: .at() target is now required' ); + target = new Vector3(); - get: function () { + } - return this._z; + return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); - }, + } - set: function ( value ) { + lookAt( v ) { - this._z = value; - this._onChangeCallback(); + this.direction.copy( v ).sub( this.origin ).normalize(); - } + return this; - }, + } - order: { + recast( t ) { - get: function () { + this.origin.copy( this.at( t, _vector$2 ) ); + + return this; - return this._order; + } - }, + closestPointToPoint( point, target ) { - set: function ( value ) { + if ( target === undefined ) { - this._order = value; - this._onChangeCallback(); + console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' ); + target = new Vector3(); } - } + target.subVectors( point, this.origin ); -} ); + const directionDistance = target.dot( this.direction ); -Object.assign( Euler.prototype, { + if ( directionDistance < 0 ) { - isEuler: true, + return target.copy( this.origin ); - set: function ( x, y, z, order ) { + } - this._x = x; - this._y = y; - this._z = z; - this._order = order || this._order; + return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - this._onChangeCallback(); + } - return this; + distanceToPoint( point ) { - }, + return Math.sqrt( this.distanceSqToPoint( point ) ); - clone: function () { + } - return new this.constructor( this._x, this._y, this._z, this._order ); + distanceSqToPoint( point ) { - }, + const directionDistance = _vector$2.subVectors( point, this.origin ).dot( this.direction ); - copy: function ( euler ) { + // point behind the ray - this._x = euler._x; - this._y = euler._y; - this._z = euler._z; - this._order = euler._order; + if ( directionDistance < 0 ) { - this._onChangeCallback(); + return this.origin.distanceToSquared( point ); - return this; + } - }, + _vector$2.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - setFromRotationMatrix: function ( m, order, update ) { + return _vector$2.distanceToSquared( point ); - const clamp = MathUtils.clamp; + } - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { - const te = m.elements; - const m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; - const m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; - const m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h + // It returns the min distance between the ray and the segment + // defined by v0 and v1 + // It can also set two optional targets : + // - The closest point on the ray + // - The closest point on the segment - order = order || this._order; + _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); + _segDir.copy( v1 ).sub( v0 ).normalize(); + _diff.copy( this.origin ).sub( _segCenter ); - switch ( order ) { + const segExtent = v0.distanceTo( v1 ) * 0.5; + const a01 = - this.direction.dot( _segDir ); + const b0 = _diff.dot( this.direction ); + const b1 = - _diff.dot( _segDir ); + const c = _diff.lengthSq(); + const det = Math.abs( 1 - a01 * a01 ); + let s0, s1, sqrDist, extDet; - case 'XYZ': + if ( det > 0 ) { - this._y = Math.asin( clamp( m13, - 1, 1 ) ); + // The ray and segment are not parallel. - if ( Math.abs( m13 ) < 0.9999999 ) { + s0 = a01 * b1 - b0; + s1 = a01 * b0 - b1; + extDet = segExtent * det; - this._x = Math.atan2( - m23, m33 ); - this._z = Math.atan2( - m12, m11 ); + if ( s0 >= 0 ) { - } else { + if ( s1 >= - extDet ) { - this._x = Math.atan2( m32, m22 ); - this._z = 0; + if ( s1 <= extDet ) { - } + // region 0 + // Minimum at interior points of ray and segment. - break; + const invDet = 1 / det; + s0 *= invDet; + s1 *= invDet; + sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; - case 'YXZ': + } else { - this._x = Math.asin( - clamp( m23, - 1, 1 ) ); + // region 1 - if ( Math.abs( m23 ) < 0.9999999 ) { + s1 = segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - this._y = Math.atan2( m13, m33 ); - this._z = Math.atan2( m21, m22 ); + } } else { - this._y = Math.atan2( - m31, m11 ); - this._z = 0; + // region 5 + + s1 = - segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; } - break; + } else { - case 'ZXY': + if ( s1 <= - extDet ) { - this._x = Math.asin( clamp( m32, - 1, 1 ) ); + // region 4 - if ( Math.abs( m32 ) < 0.9999999 ) { + s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - this._y = Math.atan2( - m31, m33 ); - this._z = Math.atan2( - m12, m22 ); + } else if ( s1 <= extDet ) { + + // region 3 + + s0 = 0; + s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = s1 * ( s1 + 2 * b1 ) + c; } else { - this._y = 0; - this._z = Math.atan2( m21, m11 ); + // region 2 + + s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); + s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; } - break; + } - case 'ZYX': + } else { - this._y = Math.asin( - clamp( m31, - 1, 1 ) ); + // Ray and segment are parallel. - if ( Math.abs( m31 ) < 0.9999999 ) { + s1 = ( a01 > 0 ) ? - segExtent : segExtent; + s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); + sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - this._x = Math.atan2( m32, m33 ); - this._z = Math.atan2( m21, m11 ); + } - } else { + if ( optionalPointOnRay ) { - this._x = 0; - this._z = Math.atan2( - m12, m22 ); + optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); - } + } - break; + if ( optionalPointOnSegment ) { - case 'YZX': + optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); - this._z = Math.asin( clamp( m21, - 1, 1 ) ); + } - if ( Math.abs( m21 ) < 0.9999999 ) { + return sqrDist; - this._x = Math.atan2( - m23, m22 ); - this._y = Math.atan2( - m31, m11 ); + } - } else { + intersectSphere( sphere, target ) { - this._x = 0; - this._y = Math.atan2( m13, m33 ); + _vector$2.subVectors( sphere.center, this.origin ); + const tca = _vector$2.dot( this.direction ); + const d2 = _vector$2.dot( _vector$2 ) - tca * tca; + const radius2 = sphere.radius * sphere.radius; - } + if ( d2 > radius2 ) return null; - break; + const thc = Math.sqrt( radius2 - d2 ); - case 'XZY': + // t0 = first intersect point - entrance on front of sphere + const t0 = tca - thc; - this._z = Math.asin( - clamp( m12, - 1, 1 ) ); + // t1 = second intersect point - exit point on back of sphere + const t1 = tca + thc; - if ( Math.abs( m12 ) < 0.9999999 ) { + // test to see if both t0 and t1 are behind the ray - if so, return null + if ( t0 < 0 && t1 < 0 ) return null; - this._x = Math.atan2( m32, m22 ); - this._y = Math.atan2( m13, m11 ); + // test to see if t0 is behind the ray: + // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, + // in order to always return an intersect point that is in front of the ray. + if ( t0 < 0 ) return this.at( t1, target ); - } else { + // else t0 is in front of the ray, so return the first collision point scaled by t0 + return this.at( t0, target ); - this._x = Math.atan2( - m23, m33 ); - this._y = 0; + } - } + intersectsSphere( sphere ) { - break; + return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); - default: + } - console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); + distanceToPlane( plane ) { - } + const denominator = plane.normal.dot( this.direction ); - this._order = order; + if ( denominator === 0 ) { - if ( update !== false ) this._onChangeCallback(); + // line is coplanar, return origin + if ( plane.distanceToPoint( this.origin ) === 0 ) { - return this; + return 0; - }, + } - setFromQuaternion: function ( q, order, update ) { + // Null is preferable to undefined since undefined means.... it is undefined - _matrix.makeRotationFromQuaternion( q ); + return null; - return this.setFromRotationMatrix( _matrix, order, update ); + } - }, + const t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; - setFromVector3: function ( v, order ) { + // Return if the ray never intersects the plane - return this.set( v.x, v.y, v.z, order || this._order ); + return t >= 0 ? t : null; - }, + } - reorder: function ( newOrder ) { + intersectPlane( plane, target ) { - // WARNING: this discards revolution information -bhouston + const t = this.distanceToPlane( plane ); - _quaternion$1.setFromEuler( this ); + if ( t === null ) { - return this.setFromQuaternion( _quaternion$1, newOrder ); + return null; - }, + } - equals: function ( euler ) { + return this.at( t, target ); - return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); + } - }, + intersectsPlane( plane ) { - fromArray: function ( array ) { + // check if the ray lies on the plane first - this._x = array[ 0 ]; - this._y = array[ 1 ]; - this._z = array[ 2 ]; - if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; + const distToPoint = plane.distanceToPoint( this.origin ); - this._onChangeCallback(); + if ( distToPoint === 0 ) { - return this; + return true; - }, + } - toArray: function ( array, offset ) { + const denominator = plane.normal.dot( this.direction ); - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; + if ( denominator * distToPoint < 0 ) { - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._order; + return true; - return array; + } - }, + // ray origin is behind the plane (and is pointing behind it) - toVector3: function ( optionalResult ) { + return false; - if ( optionalResult ) { + } - return optionalResult.set( this._x, this._y, this._z ); + intersectBox( box, target ) { - } else { + let tmin, tmax, tymin, tymax, tzmin, tzmax; - return new Vector3( this._x, this._y, this._z ); + const invdirx = 1 / this.direction.x, + invdiry = 1 / this.direction.y, + invdirz = 1 / this.direction.z; - } + const origin = this.origin; - }, + if ( invdirx >= 0 ) { - _onChange: function ( callback ) { + tmin = ( box.min.x - origin.x ) * invdirx; + tmax = ( box.max.x - origin.x ) * invdirx; - this._onChangeCallback = callback; + } else { - return this; + tmin = ( box.max.x - origin.x ) * invdirx; + tmax = ( box.min.x - origin.x ) * invdirx; - }, + } - _onChangeCallback: function () {} + if ( invdiry >= 0 ) { -} ); + tymin = ( box.min.y - origin.y ) * invdiry; + tymax = ( box.max.y - origin.y ) * invdiry; -class Layers { + } else { - constructor() { + tymin = ( box.max.y - origin.y ) * invdiry; + tymax = ( box.min.y - origin.y ) * invdiry; - this.mask = 1 | 0; + } - } + if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; - set( channel ) { + // These lines also handle the case where tmin or tmax is NaN + // (result of 0 * Infinity). x !== x returns true if x is NaN - this.mask = 1 << channel | 0; + if ( tymin > tmin || tmin !== tmin ) tmin = tymin; - } + if ( tymax < tmax || tmax !== tmax ) tmax = tymax; - enable( channel ) { + if ( invdirz >= 0 ) { - this.mask |= 1 << channel | 0; + tzmin = ( box.min.z - origin.z ) * invdirz; + tzmax = ( box.max.z - origin.z ) * invdirz; - } + } else { - enableAll() { + tzmin = ( box.max.z - origin.z ) * invdirz; + tzmax = ( box.min.z - origin.z ) * invdirz; - this.mask = 0xffffffff | 0; + } - } + if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; - toggle( channel ) { + if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; - this.mask ^= 1 << channel | 0; + if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; - } + //return point closest to the ray (positive side) - disable( channel ) { + if ( tmax < 0 ) return null; - this.mask &= ~ ( 1 << channel | 0 ); + return this.at( tmin >= 0 ? tmin : tmax, target ); } - disableAll() { + intersectsBox( box ) { - this.mask = 0; + return this.intersectBox( box, _vector$2 ) !== null; } - test( layers ) { - - return ( this.mask & layers.mask ) !== 0; + intersectTriangle( a, b, c, backfaceCulling, target ) { - } + // Compute the offset origin, edges, and normal. -} + // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h -let _object3DId = 0; + _edge1.subVectors( b, a ); + _edge2.subVectors( c, a ); + _normal.crossVectors( _edge1, _edge2 ); -const _v1$1 = new Vector3(); -const _q1 = new Quaternion(); -const _m1$1 = new Matrix4(); -const _target = new Vector3(); + // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, + // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by + // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) + // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) + // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) + let DdN = this.direction.dot( _normal ); + let sign; -const _position = new Vector3(); -const _scale = new Vector3(); -const _quaternion$2 = new Quaternion(); + if ( DdN > 0 ) { -const _xAxis = new Vector3( 1, 0, 0 ); -const _yAxis = new Vector3( 0, 1, 0 ); -const _zAxis = new Vector3( 0, 0, 1 ); + if ( backfaceCulling ) return null; + sign = 1; -const _addedEvent = { type: 'added' }; -const _removedEvent = { type: 'removed' }; + } else if ( DdN < 0 ) { -function Object3D() { + sign = - 1; + DdN = - DdN; - Object.defineProperty( this, 'id', { value: _object3DId ++ } ); + } else { - this.uuid = MathUtils.generateUUID(); + return null; - this.name = ''; - this.type = 'Object3D'; + } - this.parent = null; - this.children = []; + _diff.subVectors( this.origin, a ); + const DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); - this.up = Object3D.DefaultUp.clone(); + // b1 < 0, no intersection + if ( DdQxE2 < 0 ) { - const position = new Vector3(); - const rotation = new Euler(); - const quaternion = new Quaternion(); - const scale = new Vector3( 1, 1, 1 ); + return null; - function onRotationChange() { + } - quaternion.setFromEuler( rotation, false ); + const DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); - } + // b2 < 0, no intersection + if ( DdE1xQ < 0 ) { - function onQuaternionChange() { + return null; - rotation.setFromQuaternion( quaternion, undefined, false ); + } - } + // b1+b2 > 1, no intersection + if ( DdQxE2 + DdE1xQ > DdN ) { - rotation._onChange( onRotationChange ); - quaternion._onChange( onQuaternionChange ); + return null; - Object.defineProperties( this, { - position: { - configurable: true, - enumerable: true, - value: position - }, - rotation: { - configurable: true, - enumerable: true, - value: rotation - }, - quaternion: { - configurable: true, - enumerable: true, - value: quaternion - }, - scale: { - configurable: true, - enumerable: true, - value: scale - }, - modelViewMatrix: { - value: new Matrix4() - }, - normalMatrix: { - value: new Matrix3() } - } ); - this.matrix = new Matrix4(); - this.matrixWorld = new Matrix4(); + // Line intersects triangle, check if ray does. + const QdN = - sign * _diff.dot( _normal ); - this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; - this.matrixWorldNeedsUpdate = false; + // t < 0, no intersection + if ( QdN < 0 ) { - this.layers = new Layers(); - this.visible = true; + return null; - this.castShadow = false; - this.receiveShadow = false; + } - this.frustumCulled = true; - this.renderOrder = 0; + // Ray intersects triangle. + return this.at( QdN / DdN, target ); - this.userData = {}; + } -} + applyMatrix4( matrix4 ) { -Object3D.DefaultUp = new Vector3( 0, 1, 0 ); -Object3D.DefaultMatrixAutoUpdate = true; + this.origin.applyMatrix4( matrix4 ); + this.direction.transformDirection( matrix4 ); -Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { + return this; - constructor: Object3D, + } - isObject3D: true, + equals( ray ) { - onBeforeRender: function () {}, - onAfterRender: function () {}, + return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); - applyMatrix4: function ( matrix ) { + } - if ( this.matrixAutoUpdate ) this.updateMatrix(); +} - this.matrix.premultiply( matrix ); +class Matrix4 { - this.matrix.decompose( this.position, this.quaternion, this.scale ); + constructor() { - }, + this.elements = [ - applyQuaternion: function ( q ) { + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - this.quaternion.premultiply( q ); + ]; - return this; + if ( arguments.length > 0 ) { - }, + console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); - setRotationFromAxisAngle: function ( axis, angle ) { + } - // assumes axis is normalized + } - this.quaternion.setFromAxisAngle( axis, angle ); + set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - }, + const te = this.elements; - setRotationFromEuler: function ( euler ) { + te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; + te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; + te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; + te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; - this.quaternion.setFromEuler( euler, true ); + return this; - }, + } - setRotationFromMatrix: function ( m ) { + identity() { - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) + this.set( - this.quaternion.setFromRotationMatrix( m ); + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - }, + ); - setRotationFromQuaternion: function ( q ) { + return this; - // assumes q is normalized + } - this.quaternion.copy( q ); + clone() { - }, + return new Matrix4().fromArray( this.elements ); - rotateOnAxis: function ( axis, angle ) { + } - // rotate object on axis in object space - // axis is assumed to be normalized + copy( m ) { - _q1.setFromAxisAngle( axis, angle ); + const te = this.elements; + const me = m.elements; - this.quaternion.multiply( _q1 ); + te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; + te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; + te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; + te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; return this; - }, - - rotateOnWorldAxis: function ( axis, angle ) { + } - // rotate object on axis in world space - // axis is assumed to be normalized - // method assumes no rotated parent + copyPosition( m ) { - _q1.setFromAxisAngle( axis, angle ); + const te = this.elements, me = m.elements; - this.quaternion.premultiply( _q1 ); + te[ 12 ] = me[ 12 ]; + te[ 13 ] = me[ 13 ]; + te[ 14 ] = me[ 14 ]; return this; - }, + } - rotateX: function ( angle ) { + extractBasis( xAxis, yAxis, zAxis ) { - return this.rotateOnAxis( _xAxis, angle ); + xAxis.setFromMatrixColumn( this, 0 ); + yAxis.setFromMatrixColumn( this, 1 ); + zAxis.setFromMatrixColumn( this, 2 ); - }, + return this; - rotateY: function ( angle ) { + } - return this.rotateOnAxis( _yAxis, angle ); + makeBasis( xAxis, yAxis, zAxis ) { - }, + this.set( + xAxis.x, yAxis.x, zAxis.x, 0, + xAxis.y, yAxis.y, zAxis.y, 0, + xAxis.z, yAxis.z, zAxis.z, 0, + 0, 0, 0, 1 + ); - rotateZ: function ( angle ) { + return this; - return this.rotateOnAxis( _zAxis, angle ); + } - }, + extractRotation( m ) { - translateOnAxis: function ( axis, distance ) { + // this method does not support reflection matrices - // translate object by distance along axis in object space - // axis is assumed to be normalized + const te = this.elements; + const me = m.elements; - _v1$1.copy( axis ).applyQuaternion( this.quaternion ); + const scaleX = 1 / _v1$1.setFromMatrixColumn( m, 0 ).length(); + const scaleY = 1 / _v1$1.setFromMatrixColumn( m, 1 ).length(); + const scaleZ = 1 / _v1$1.setFromMatrixColumn( m, 2 ).length(); - this.position.add( _v1$1.multiplyScalar( distance ) ); + te[ 0 ] = me[ 0 ] * scaleX; + te[ 1 ] = me[ 1 ] * scaleX; + te[ 2 ] = me[ 2 ] * scaleX; + te[ 3 ] = 0; - return this; + te[ 4 ] = me[ 4 ] * scaleY; + te[ 5 ] = me[ 5 ] * scaleY; + te[ 6 ] = me[ 6 ] * scaleY; + te[ 7 ] = 0; - }, + te[ 8 ] = me[ 8 ] * scaleZ; + te[ 9 ] = me[ 9 ] * scaleZ; + te[ 10 ] = me[ 10 ] * scaleZ; + te[ 11 ] = 0; - translateX: function ( distance ) { + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - return this.translateOnAxis( _xAxis, distance ); + return this; - }, + } - translateY: function ( distance ) { + makeRotationFromEuler( euler ) { - return this.translateOnAxis( _yAxis, distance ); + if ( ! ( euler && euler.isEuler ) ) { - }, + console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); - translateZ: function ( distance ) { + } - return this.translateOnAxis( _zAxis, distance ); + const te = this.elements; - }, + const x = euler.x, y = euler.y, z = euler.z; + const a = Math.cos( x ), b = Math.sin( x ); + const c = Math.cos( y ), d = Math.sin( y ); + const e = Math.cos( z ), f = Math.sin( z ); - localToWorld: function ( vector ) { + if ( euler.order === 'XYZ' ) { - return vector.applyMatrix4( this.matrixWorld ); + const ae = a * e, af = a * f, be = b * e, bf = b * f; - }, + te[ 0 ] = c * e; + te[ 4 ] = - c * f; + te[ 8 ] = d; - worldToLocal: function ( vector ) { + te[ 1 ] = af + be * d; + te[ 5 ] = ae - bf * d; + te[ 9 ] = - b * c; - return vector.applyMatrix4( _m1$1.getInverse( this.matrixWorld ) ); + te[ 2 ] = bf - ae * d; + te[ 6 ] = be + af * d; + te[ 10 ] = a * c; - }, + } else if ( euler.order === 'YXZ' ) { - lookAt: function ( x, y, z ) { + const ce = c * e, cf = c * f, de = d * e, df = d * f; - // This method does not support objects having non-uniformly-scaled parent(s) + te[ 0 ] = ce + df * b; + te[ 4 ] = de * b - cf; + te[ 8 ] = a * d; - if ( x.isVector3 ) { + te[ 1 ] = a * f; + te[ 5 ] = a * e; + te[ 9 ] = - b; - _target.copy( x ); + te[ 2 ] = cf * b - de; + te[ 6 ] = df + ce * b; + te[ 10 ] = a * c; - } else { + } else if ( euler.order === 'ZXY' ) { - _target.set( x, y, z ); + const ce = c * e, cf = c * f, de = d * e, df = d * f; - } + te[ 0 ] = ce - df * b; + te[ 4 ] = - a * f; + te[ 8 ] = de + cf * b; - const parent = this.parent; + te[ 1 ] = cf + de * b; + te[ 5 ] = a * e; + te[ 9 ] = df - ce * b; - this.updateWorldMatrix( true, false ); + te[ 2 ] = - a * d; + te[ 6 ] = b; + te[ 10 ] = a * c; - _position.setFromMatrixPosition( this.matrixWorld ); + } else if ( euler.order === 'ZYX' ) { - if ( this.isCamera || this.isLight ) { + const ae = a * e, af = a * f, be = b * e, bf = b * f; - _m1$1.lookAt( _position, _target, this.up ); + te[ 0 ] = c * e; + te[ 4 ] = be * d - af; + te[ 8 ] = ae * d + bf; - } else { + te[ 1 ] = c * f; + te[ 5 ] = bf * d + ae; + te[ 9 ] = af * d - be; - _m1$1.lookAt( _target, _position, this.up ); + te[ 2 ] = - d; + te[ 6 ] = b * c; + te[ 10 ] = a * c; - } + } else if ( euler.order === 'YZX' ) { - this.quaternion.setFromRotationMatrix( _m1$1 ); + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - if ( parent ) { + te[ 0 ] = c * e; + te[ 4 ] = bd - ac * f; + te[ 8 ] = bc * f + ad; - _m1$1.extractRotation( parent.matrixWorld ); - _q1.setFromRotationMatrix( _m1$1 ); - this.quaternion.premultiply( _q1.inverse() ); + te[ 1 ] = f; + te[ 5 ] = a * e; + te[ 9 ] = - b * e; - } + te[ 2 ] = - d * e; + te[ 6 ] = ad * f + bc; + te[ 10 ] = ac - bd * f; - }, + } else if ( euler.order === 'XZY' ) { - add: function ( object ) { + const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - if ( arguments.length > 1 ) { + te[ 0 ] = c * e; + te[ 4 ] = - f; + te[ 8 ] = d * e; - for ( let i = 0; i < arguments.length; i ++ ) { + te[ 1 ] = ac * f + bd; + te[ 5 ] = a * e; + te[ 9 ] = ad * f - bc; - this.add( arguments[ i ] ); + te[ 2 ] = bc * f - ad; + te[ 6 ] = b * e; + te[ 10 ] = bd * f + ac; - } + } - return this; + // bottom row + te[ 3 ] = 0; + te[ 7 ] = 0; + te[ 11 ] = 0; - } + // last column + te[ 12 ] = 0; + te[ 13 ] = 0; + te[ 14 ] = 0; + te[ 15 ] = 1; - if ( object === this ) { + return this; - console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); - return this; + } - } + makeRotationFromQuaternion( q ) { - if ( ( object && object.isObject3D ) ) { + return this.compose( _zero, q, _one ); - if ( object.parent !== null ) { + } - object.parent.remove( object ); + lookAt( eye, target, up ) { - } + const te = this.elements; - object.parent = this; - this.children.push( object ); + _z.subVectors( eye, target ); - object.dispatchEvent( _addedEvent ); + if ( _z.lengthSq() === 0 ) { - } else { + // eye and target are in the same position - console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); + _z.z = 1; } - return this; + _z.normalize(); + _x.crossVectors( up, _z ); - }, + if ( _x.lengthSq() === 0 ) { - remove: function ( object ) { + // up and z are parallel - if ( arguments.length > 1 ) { + if ( Math.abs( up.z ) === 1 ) { - for ( let i = 0; i < arguments.length; i ++ ) { - - this.remove( arguments[ i ] ); - - } - - return this; - - } - - const index = this.children.indexOf( object ); - - if ( index !== - 1 ) { - - object.parent = null; - this.children.splice( index, 1 ); - - object.dispatchEvent( _removedEvent ); - - } - - return this; - - }, - - attach: function ( object ) { - - // adds object as a child of this, while maintaining the object's world transform - - this.updateWorldMatrix( true, false ); + _z.x += 0.0001; - _m1$1.getInverse( this.matrixWorld ); + } else { - if ( object.parent !== null ) { + _z.z += 0.0001; - object.parent.updateWorldMatrix( true, false ); + } - _m1$1.multiply( object.parent.matrixWorld ); + _z.normalize(); + _x.crossVectors( up, _z ); } - object.applyMatrix4( _m1$1 ); - - object.updateWorldMatrix( false, false ); + _x.normalize(); + _y.crossVectors( _z, _x ); - this.add( object ); + te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; + te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; + te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; return this; - }, - - getObjectById: function ( id ) { - - return this.getObjectByProperty( 'id', id ); - - }, - - getObjectByName: function ( name ) { - - return this.getObjectByProperty( 'name', name ); - - }, - - getObjectByProperty: function ( name, value ) { - - if ( this[ name ] === value ) return this; - - for ( let i = 0, l = this.children.length; i < l; i ++ ) { - - const child = this.children[ i ]; - const object = child.getObjectByProperty( name, value ); + } - if ( object !== undefined ) { + multiply( m, n ) { - return object; + if ( n !== undefined ) { - } + console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); + return this.multiplyMatrices( m, n ); } - return undefined; + return this.multiplyMatrices( this, m ); - }, + } - getWorldPosition: function ( target ) { + premultiply( m ) { - if ( target === undefined ) { + return this.multiplyMatrices( m, this ); - console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' ); - target = new Vector3(); + } - } + multiplyMatrices( a, b ) { - this.updateMatrixWorld( true ); + const ae = a.elements; + const be = b.elements; + const te = this.elements; - return target.setFromMatrixPosition( this.matrixWorld ); + const a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; + const a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; + const a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; + const a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; - }, + const b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; + const b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; + const b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; + const b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; - getWorldQuaternion: function ( target ) { + te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; + te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; + te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; + te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - if ( target === undefined ) { + te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; + te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; + te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; + te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); - target = new Quaternion(); + te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; + te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; + te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; + te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - } + te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; + te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; + te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; + te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - this.updateMatrixWorld( true ); + return this; - this.matrixWorld.decompose( _position, target, _scale ); + } - return target; + multiplyScalar( s ) { - }, + const te = this.elements; - getWorldScale: function ( target ) { + te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; + te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; + te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; + te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; - if ( target === undefined ) { + return this; - console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); - target = new Vector3(); + } - } + determinant() { - this.updateMatrixWorld( true ); + const te = this.elements; - this.matrixWorld.decompose( _position, _quaternion$2, target ); + const n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; + const n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; + const n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; + const n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; - return target; + //TODO: make this more efficient + //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) - }, + return ( + n41 * ( + + n14 * n23 * n32 + - n13 * n24 * n32 + - n14 * n22 * n33 + + n12 * n24 * n33 + + n13 * n22 * n34 + - n12 * n23 * n34 + ) + + n42 * ( + + n11 * n23 * n34 + - n11 * n24 * n33 + + n14 * n21 * n33 + - n13 * n21 * n34 + + n13 * n24 * n31 + - n14 * n23 * n31 + ) + + n43 * ( + + n11 * n24 * n32 + - n11 * n22 * n34 + - n14 * n21 * n32 + + n12 * n21 * n34 + + n14 * n22 * n31 + - n12 * n24 * n31 + ) + + n44 * ( + - n13 * n22 * n31 + - n11 * n23 * n32 + + n11 * n22 * n33 + + n13 * n21 * n32 + - n12 * n21 * n33 + + n12 * n23 * n31 + ) - getWorldDirection: function ( target ) { + ); - if ( target === undefined ) { + } - console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' ); - target = new Vector3(); + transpose() { - } + const te = this.elements; + let tmp; - this.updateMatrixWorld( true ); + tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; + tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; + tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; - const e = this.matrixWorld.elements; + tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; + tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; + tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; - return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); + return this; - }, + } - raycast: function () {}, + setPosition( x, y, z ) { - traverse: function ( callback ) { + const te = this.elements; - callback( this ); + if ( x.isVector3 ) { - const children = this.children; + te[ 12 ] = x.x; + te[ 13 ] = x.y; + te[ 14 ] = x.z; - for ( let i = 0, l = children.length; i < l; i ++ ) { + } else { - children[ i ].traverse( callback ); + te[ 12 ] = x; + te[ 13 ] = y; + te[ 14 ] = z; } - }, - - traverseVisible: function ( callback ) { - - if ( this.visible === false ) return; + return this; - callback( this ); + } - const children = this.children; + getInverse( m, throwOnDegenerate ) { - for ( let i = 0, l = children.length; i < l; i ++ ) { + if ( throwOnDegenerate !== undefined ) { - children[ i ].traverseVisible( callback ); + console.warn( "THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate." ); } - }, - - traverseAncestors: function ( callback ) { + // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm + const te = this.elements, + me = m.elements, - const parent = this.parent; + n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], + n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], + n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], + n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], - if ( parent !== null ) { + t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, + t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, + t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, + t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - callback( parent ); + const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; - parent.traverseAncestors( callback ); + if ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); - } + const detInv = 1 / det; - }, + te[ 0 ] = t11 * detInv; + te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; + te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; + te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; - updateMatrix: function () { + te[ 4 ] = t12 * detInv; + te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; + te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; + te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; - this.matrix.compose( this.position, this.quaternion, this.scale ); + te[ 8 ] = t13 * detInv; + te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; + te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; + te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; - this.matrixWorldNeedsUpdate = true; + te[ 12 ] = t14 * detInv; + te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; + te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; + te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; - }, + return this; - updateMatrixWorld: function ( force ) { + } - if ( this.matrixAutoUpdate ) this.updateMatrix(); + scale( v ) { - if ( this.matrixWorldNeedsUpdate || force ) { + const te = this.elements; + const x = v.x, y = v.y, z = v.z; - if ( this.parent === null ) { + te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; + te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; + te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; + te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; - this.matrixWorld.copy( this.matrix ); + return this; - } else { + } - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + getMaxScaleOnAxis() { - } + const te = this.elements; - this.matrixWorldNeedsUpdate = false; + const scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; + const scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; + const scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; - force = true; + return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); - } + } - // update children + makeTranslation( x, y, z ) { - const children = this.children; + this.set( - for ( let i = 0, l = children.length; i < l; i ++ ) { + 1, 0, 0, x, + 0, 1, 0, y, + 0, 0, 1, z, + 0, 0, 0, 1 - children[ i ].updateMatrixWorld( force ); + ); - } + return this; - }, + } - updateWorldMatrix: function ( updateParents, updateChildren ) { + makeRotationX( theta ) { - const parent = this.parent; + const c = Math.cos( theta ), s = Math.sin( theta ); - if ( updateParents === true && parent !== null ) { + this.set( - parent.updateWorldMatrix( true, false ); + 1, 0, 0, 0, + 0, c, - s, 0, + 0, s, c, 0, + 0, 0, 0, 1 - } + ); - if ( this.matrixAutoUpdate ) this.updateMatrix(); + return this; - if ( this.parent === null ) { + } - this.matrixWorld.copy( this.matrix ); + makeRotationY( theta ) { - } else { + const c = Math.cos( theta ), s = Math.sin( theta ); - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); + this.set( - } + c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1 - // update children + ); - if ( updateChildren === true ) { + return this; - const children = this.children; + } - for ( let i = 0, l = children.length; i < l; i ++ ) { + makeRotationZ( theta ) { - children[ i ].updateWorldMatrix( false, true ); + const c = Math.cos( theta ), s = Math.sin( theta ); - } + this.set( - } + c, - s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 - }, + ); - toJSON: function ( meta ) { + return this; - // meta is a string when called from JSON.stringify - const isRootObject = ( meta === undefined || typeof meta === 'string' ); + } - const output = {}; + makeRotationAxis( axis, angle ) { - // meta is a hash used to collect geometries, materials. - // not providing it implies that this is the root object - // being serialized. - if ( isRootObject ) { + // Based on http://www.gamedev.net/reference/articles/article1199.asp - // initialize meta obj - meta = { - geometries: {}, - materials: {}, - textures: {}, - images: {}, - shapes: {} - }; + const c = Math.cos( angle ); + const s = Math.sin( angle ); + const t = 1 - c; + const x = axis.x, y = axis.y, z = axis.z; + const tx = t * x, ty = t * y; - output.metadata = { - version: 4.5, - type: 'Object', - generator: 'Object3D.toJSON' - }; + this.set( - } + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 - // standard Object3D serialization + ); - const object = {}; + return this; - object.uuid = this.uuid; - object.type = this.type; + } - if ( this.name !== '' ) object.name = this.name; - if ( this.castShadow === true ) object.castShadow = true; - if ( this.receiveShadow === true ) object.receiveShadow = true; - if ( this.visible === false ) object.visible = false; - if ( this.frustumCulled === false ) object.frustumCulled = false; - if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder; - if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; + makeScale( x, y, z ) { - object.layers = this.layers.mask; - object.matrix = this.matrix.toArray(); + this.set( - if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false; + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, z, 0, + 0, 0, 0, 1 - // object specific properties + ); - if ( this.isInstancedMesh ) { + return this; - object.type = 'InstancedMesh'; - object.count = this.count; - object.instanceMatrix = this.instanceMatrix.toJSON(); + } - } + makeShear( x, y, z ) { - // + this.set( - function serialize( library, element ) { + 1, y, z, 0, + x, 1, z, 0, + x, y, 1, 0, + 0, 0, 0, 1 - if ( library[ element.uuid ] === undefined ) { + ); - library[ element.uuid ] = element.toJSON( meta ); + return this; - } + } - return element.uuid; + compose( position, quaternion, scale ) { - } + const te = this.elements; - if ( this.isMesh || this.isLine || this.isPoints ) { + const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; + const x2 = x + x, y2 = y + y, z2 = z + z; + const xx = x * x2, xy = x * y2, xz = x * z2; + const yy = y * y2, yz = y * z2, zz = z * z2; + const wx = w * x2, wy = w * y2, wz = w * z2; - object.geometry = serialize( meta.geometries, this.geometry ); + const sx = scale.x, sy = scale.y, sz = scale.z; - const parameters = this.geometry.parameters; + te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; + te[ 1 ] = ( xy + wz ) * sx; + te[ 2 ] = ( xz - wy ) * sx; + te[ 3 ] = 0; - if ( parameters !== undefined && parameters.shapes !== undefined ) { + te[ 4 ] = ( xy - wz ) * sy; + te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; + te[ 6 ] = ( yz + wx ) * sy; + te[ 7 ] = 0; - const shapes = parameters.shapes; + te[ 8 ] = ( xz + wy ) * sz; + te[ 9 ] = ( yz - wx ) * sz; + te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; + te[ 11 ] = 0; - if ( Array.isArray( shapes ) ) { + te[ 12 ] = position.x; + te[ 13 ] = position.y; + te[ 14 ] = position.z; + te[ 15 ] = 1; - for ( let i = 0, l = shapes.length; i < l; i ++ ) { + return this; - const shape = shapes[ i ]; + } - serialize( meta.shapes, shape ); + decompose( position, quaternion, scale ) { - } + const te = this.elements; - } else { + let sx = _v1$1.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); + const sy = _v1$1.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); + const sz = _v1$1.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); - serialize( meta.shapes, shapes ); + // if determine is negative, we need to invert one scale + const det = this.determinant(); + if ( det < 0 ) sx = - sx; - } + position.x = te[ 12 ]; + position.y = te[ 13 ]; + position.z = te[ 14 ]; - } + // scale the rotation part + _m1.copy( this ); - } + const invSX = 1 / sx; + const invSY = 1 / sy; + const invSZ = 1 / sz; - if ( this.material !== undefined ) { + _m1.elements[ 0 ] *= invSX; + _m1.elements[ 1 ] *= invSX; + _m1.elements[ 2 ] *= invSX; - if ( Array.isArray( this.material ) ) { + _m1.elements[ 4 ] *= invSY; + _m1.elements[ 5 ] *= invSY; + _m1.elements[ 6 ] *= invSY; - const uuids = []; + _m1.elements[ 8 ] *= invSZ; + _m1.elements[ 9 ] *= invSZ; + _m1.elements[ 10 ] *= invSZ; - for ( let i = 0, l = this.material.length; i < l; i ++ ) { + quaternion.setFromRotationMatrix( _m1 ); - uuids.push( serialize( meta.materials, this.material[ i ] ) ); + scale.x = sx; + scale.y = sy; + scale.z = sz; - } + return this; - object.material = uuids; + } - } else { + makePerspective( left, right, top, bottom, near, far ) { - object.material = serialize( meta.materials, this.material ); + if ( far === undefined ) { - } + console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); } - // - - if ( this.children.length > 0 ) { - - object.children = []; + const te = this.elements; + const x = 2 * near / ( right - left ); + const y = 2 * near / ( top - bottom ); - for ( let i = 0; i < this.children.length; i ++ ) { + const a = ( right + left ) / ( right - left ); + const b = ( top + bottom ) / ( top - bottom ); + const c = - ( far + near ) / ( far - near ); + const d = - 2 * far * near / ( far - near ); - object.children.push( this.children[ i ].toJSON( meta ).object ); + te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; + te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; - } + return this; - } + } - if ( isRootObject ) { + makeOrthographic( left, right, top, bottom, near, far ) { - const geometries = extractFromCache( meta.geometries ); - const materials = extractFromCache( meta.materials ); - const textures = extractFromCache( meta.textures ); - const images = extractFromCache( meta.images ); - const shapes = extractFromCache( meta.shapes ); - - if ( geometries.length > 0 ) output.geometries = geometries; - if ( materials.length > 0 ) output.materials = materials; - if ( textures.length > 0 ) output.textures = textures; - if ( images.length > 0 ) output.images = images; - if ( shapes.length > 0 ) output.shapes = shapes; + const te = this.elements; + const w = 1.0 / ( right - left ); + const h = 1.0 / ( top - bottom ); + const p = 1.0 / ( far - near ); - } + const x = ( right + left ) * w; + const y = ( top + bottom ) * h; + const z = ( far + near ) * p; - output.object = object; + te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; + te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; + te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; + te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; - return output; + return this; - // extract data from the cache hash - // remove metadata on each item - // and return as array - function extractFromCache( cache ) { + } - const values = []; - for ( const key in cache ) { + equals( matrix ) { - const data = cache[ key ]; - delete data.metadata; - values.push( data ); + const te = this.elements; + const me = matrix.elements; - } + for ( let i = 0; i < 16; i ++ ) { - return values; + if ( te[ i ] !== me[ i ] ) return false; } - }, - - clone: function ( recursive ) { - - return new this.constructor().copy( this, recursive ); - - }, - - copy: function ( source, recursive ) { - - if ( recursive === undefined ) recursive = true; - - this.name = source.name; - - this.up.copy( source.up ); - - this.position.copy( source.position ); - this.rotation.order = source.rotation.order; - this.quaternion.copy( source.quaternion ); - this.scale.copy( source.scale ); - - this.matrix.copy( source.matrix ); - this.matrixWorld.copy( source.matrixWorld ); - - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - - this.layers.mask = source.layers.mask; - this.visible = source.visible; - - this.castShadow = source.castShadow; - this.receiveShadow = source.receiveShadow; - - this.frustumCulled = source.frustumCulled; - this.renderOrder = source.renderOrder; + return true; - this.userData = JSON.parse( JSON.stringify( source.userData ) ); + } - if ( recursive === true ) { + fromArray( array, offset ) { - for ( let i = 0; i < source.children.length; i ++ ) { + if ( offset === undefined ) offset = 0; - const child = source.children[ i ]; - this.add( child.clone() ); + for ( let i = 0; i < 16; i ++ ) { - } + this.elements[ i ] = array[ i + offset ]; } @@ -6079,1353 +5991,1312 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), } -} ); - -function Scene() { + toArray( array, offset ) { - Object3D.call( this ); + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; - this.type = 'Scene'; + const te = this.elements; - this.background = null; - this.environment = null; - this.fog = null; + array[ offset ] = te[ 0 ]; + array[ offset + 1 ] = te[ 1 ]; + array[ offset + 2 ] = te[ 2 ]; + array[ offset + 3 ] = te[ 3 ]; - this.overrideMaterial = null; + array[ offset + 4 ] = te[ 4 ]; + array[ offset + 5 ] = te[ 5 ]; + array[ offset + 6 ] = te[ 6 ]; + array[ offset + 7 ] = te[ 7 ]; - this.autoUpdate = true; // checked by the renderer + array[ offset + 8 ] = te[ 8 ]; + array[ offset + 9 ] = te[ 9 ]; + array[ offset + 10 ] = te[ 10 ]; + array[ offset + 11 ] = te[ 11 ]; - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + array[ offset + 12 ] = te[ 12 ]; + array[ offset + 13 ] = te[ 13 ]; + array[ offset + 14 ] = te[ 14 ]; + array[ offset + 15 ] = te[ 15 ]; - __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef + return array; } } -Scene.prototype = Object.assign( Object.create( Object3D.prototype ), { +Matrix4.prototype.isMatrix4 = true; - constructor: Scene, +const _v1$1 = new Vector3(); +const _m1 = new Matrix4(); +const _zero = new Vector3( 0, 0, 0 ); +const _one = new Vector3( 1, 1, 1 ); +const _x = new Vector3(); +const _y = new Vector3(); +const _z = new Vector3(); - isScene: true, +class Euler { - copy: function ( source, recursive ) { + constructor( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) { - Object3D.prototype.copy.call( this, source, recursive ); + this._x = x; + this._y = y; + this._z = z; + this._order = order; - if ( source.background !== null ) this.background = source.background.clone(); - if ( source.environment !== null ) this.environment = source.environment.clone(); - if ( source.fog !== null ) this.fog = source.fog.clone(); + } - if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); + get x() { - this.autoUpdate = source.autoUpdate; - this.matrixAutoUpdate = source.matrixAutoUpdate; + return this._x; - return this; + } - }, + set x( value ) { - toJSON: function ( meta ) { + this._x = value; + this._onChangeCallback(); - const data = Object3D.prototype.toJSON.call( this, meta ); + } - if ( this.background !== null ) data.object.background = this.background.toJSON( meta ); - if ( this.environment !== null ) data.object.environment = this.environment.toJSON( meta ); - if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + get y() { - return data; + return this._y; } -} ); + set y( value ) { -const _points = [ - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3() -]; + this._y = value; + this._onChangeCallback(); -const _vector$1 = new Vector3(); + } -const _box = new Box3(); + get z() { -// triangle centered vertices + return this._z; -const _v0 = new Vector3(); -const _v1$2 = new Vector3(); -const _v2 = new Vector3(); + } -// triangle edge vectors + set z( value ) { -const _f0 = new Vector3(); -const _f1 = new Vector3(); -const _f2 = new Vector3(); + this._z = value; + this._onChangeCallback(); -const _center = new Vector3(); -const _extents = new Vector3(); -const _triangleNormal = new Vector3(); -const _testAxis = new Vector3(); + } -function Box3( min, max ) { + get order() { - this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); + return this._order; -} + } + set order( value ) { -Object.assign( Box3.prototype, { + this._order = value; + this._onChangeCallback(); + + } - isBox3: true, + set( x, y, z, order ) { - set: function ( min, max ) { + this._x = x; + this._y = y; + this._z = z; + this._order = order || this._order; - this.min.copy( min ); - this.max.copy( max ); + this._onChangeCallback(); return this; - }, + } - setFromArray: function ( array ) { + clone() { - let minX = + Infinity; - let minY = + Infinity; - let minZ = + Infinity; + return new this.constructor( this._x, this._y, this._z, this._order ); - let maxX = - Infinity; - let maxY = - Infinity; - let maxZ = - Infinity; + } - for ( let i = 0, l = array.length; i < l; i += 3 ) { + copy( euler ) { - const x = array[ i ]; - const y = array[ i + 1 ]; - const z = array[ i + 2 ]; + this._x = euler._x; + this._y = euler._y; + this._z = euler._z; + this._order = euler._order; - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; + this._onChangeCallback(); - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; + return this; - } + } - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + setFromRotationMatrix( m, order, update ) { - return this; + const clamp = MathUtils.clamp; - }, + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - setFromBufferAttribute: function ( attribute ) { + const te = m.elements; + const m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; + const m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; + const m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - let minX = + Infinity; - let minY = + Infinity; - let minZ = + Infinity; + order = order || this._order; - let maxX = - Infinity; - let maxY = - Infinity; - let maxZ = - Infinity; + switch ( order ) { - for ( let i = 0, l = attribute.count; i < l; i ++ ) { + case 'XYZ': - const x = attribute.getX( i ); - const y = attribute.getY( i ); - const z = attribute.getZ( i ); + this._y = Math.asin( clamp( m13, - 1, 1 ) ); - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; + if ( Math.abs( m13 ) < 0.9999999 ) { - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; + this._x = Math.atan2( - m23, m33 ); + this._z = Math.atan2( - m12, m11 ); - } + } else { - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); + this._x = Math.atan2( m32, m22 ); + this._z = 0; - return this; + } - }, + break; - setFromPoints: function ( points ) { + case 'YXZ': - this.makeEmpty(); + this._x = Math.asin( - clamp( m23, - 1, 1 ) ); - for ( let i = 0, il = points.length; i < il; i ++ ) { + if ( Math.abs( m23 ) < 0.9999999 ) { - this.expandByPoint( points[ i ] ); + this._y = Math.atan2( m13, m33 ); + this._z = Math.atan2( m21, m22 ); - } + } else { - return this; + this._y = Math.atan2( - m31, m11 ); + this._z = 0; - }, + } - setFromCenterAndSize: function ( center, size ) { + break; - const halfSize = _vector$1.copy( size ).multiplyScalar( 0.5 ); + case 'ZXY': - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); + this._x = Math.asin( clamp( m32, - 1, 1 ) ); - return this; + if ( Math.abs( m32 ) < 0.9999999 ) { - }, + this._y = Math.atan2( - m31, m33 ); + this._z = Math.atan2( - m12, m22 ); - setFromObject: function ( object ) { + } else { - this.makeEmpty(); + this._y = 0; + this._z = Math.atan2( m21, m11 ); - return this.expandByObject( object ); + } - }, + break; - clone: function () { + case 'ZYX': - return new this.constructor().copy( this ); + this._y = Math.asin( - clamp( m31, - 1, 1 ) ); - }, + if ( Math.abs( m31 ) < 0.9999999 ) { - copy: function ( box ) { + this._x = Math.atan2( m32, m33 ); + this._z = Math.atan2( m21, m11 ); - this.min.copy( box.min ); - this.max.copy( box.max ); + } else { - return this; + this._x = 0; + this._z = Math.atan2( - m12, m22 ); - }, + } - makeEmpty: function () { + break; - this.min.x = this.min.y = this.min.z = + Infinity; - this.max.x = this.max.y = this.max.z = - Infinity; + case 'YZX': - return this; + this._z = Math.asin( clamp( m21, - 1, 1 ) ); - }, + if ( Math.abs( m21 ) < 0.9999999 ) { - isEmpty: function () { + this._x = Math.atan2( - m23, m22 ); + this._y = Math.atan2( - m31, m11 ); - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes + } else { - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); + this._x = 0; + this._y = Math.atan2( m13, m33 ); - }, + } - getCenter: function ( target ) { + break; - if ( target === undefined ) { + case 'XZY': - console.warn( 'THREE.Box3: .getCenter() target is now required' ); - target = new Vector3(); + this._z = Math.asin( - clamp( m12, - 1, 1 ) ); - } + if ( Math.abs( m12 ) < 0.9999999 ) { - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); + this._x = Math.atan2( m32, m22 ); + this._y = Math.atan2( m13, m11 ); - }, + } else { - getSize: function ( target ) { + this._x = Math.atan2( - m23, m33 ); + this._y = 0; - if ( target === undefined ) { + } - console.warn( 'THREE.Box3: .getSize() target is now required' ); - target = new Vector3(); + break; - } + default: - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); + console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order ); - }, + } - expandByPoint: function ( point ) { + this._order = order; - this.min.min( point ); - this.max.max( point ); + if ( update !== false ) this._onChangeCallback(); return this; - }, + } - expandByVector: function ( vector ) { + setFromQuaternion( q, order, update ) { - this.min.sub( vector ); - this.max.add( vector ); + _matrix.makeRotationFromQuaternion( q ); - return this; + return this.setFromRotationMatrix( _matrix, order, update ); - }, + } - expandByScalar: function ( scalar ) { + setFromVector3( v, order ) { - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); + return this.set( v.x, v.y, v.z, order || this._order ); - return this; + } - }, + reorder( newOrder ) { - expandByObject: function ( object ) { + // WARNING: this discards revolution information -bhouston - // Computes the world-axis-aligned bounding box of an object (including its children), - // accounting for both the object's, and children's, world transforms + _quaternion$1.setFromEuler( this ); - object.updateWorldMatrix( false, false ); + return this.setFromQuaternion( _quaternion$1, newOrder ); - const geometry = object.geometry; + } - if ( geometry !== undefined ) { + equals( euler ) { - if ( geometry.boundingBox === null ) { + return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); - geometry.computeBoundingBox(); + } - } + fromArray( array ) { - _box.copy( geometry.boundingBox ); - _box.applyMatrix4( object.matrixWorld ); + this._x = array[ 0 ]; + this._y = array[ 1 ]; + this._z = array[ 2 ]; + if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; - this.union( _box ); + this._onChangeCallback(); - } + return this; - const children = object.children; + } - for ( let i = 0, l = children.length; i < l; i ++ ) { + toArray( array, offset ) { - this.expandByObject( children[ i ] ); + if ( array === undefined ) array = []; + if ( offset === undefined ) offset = 0; - } + array[ offset ] = this._x; + array[ offset + 1 ] = this._y; + array[ offset + 2 ] = this._z; + array[ offset + 3 ] = this._order; - return this; + return array; - }, + } - containsPoint: function ( point ) { + toVector3( optionalResult ) { - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y || - point.z < this.min.z || point.z > this.max.z ? false : true; + if ( optionalResult ) { - }, + return optionalResult.set( this._x, this._y, this._z ); - containsBox: function ( box ) { + } else { - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y && - this.min.z <= box.min.z && box.max.z <= this.max.z; + return new Vector3( this._x, this._y, this._z ); - }, + } - getParameter: function ( point, target ) { + } - // This can potentially have a divide by zero if the box - // has a size dimension of 0. + _onChange( callback ) { - if ( target === undefined ) { + this._onChangeCallback = callback; - console.warn( 'THREE.Box3: .getParameter() target is now required' ); - target = new Vector3(); + return this; - } + } - return target.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ), - ( point.z - this.min.z ) / ( this.max.z - this.min.z ) - ); + _onChangeCallback() {} - }, +} - intersectsBox: function ( box ) { +Euler.DefaultOrder = 'XYZ'; +Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; +Euler.prototype.isEuler = true; - // using 6 splitting planes to rule out intersections. - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y || - box.max.z < this.min.z || box.min.z > this.max.z ? false : true; +const _matrix = new Matrix4(); +const _quaternion$1 = new Quaternion(); - }, +class Layers { - intersectsSphere: function ( sphere ) { + constructor() { - // Find the point on the AABB closest to the sphere center. - this.clampPoint( sphere.center, _vector$1 ); + this.mask = 1 | 0; - // If that point is inside the sphere, the AABB and sphere intersect. - return _vector$1.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); + } - }, + set( channel ) { - intersectsPlane: function ( plane ) { + this.mask = 1 << channel | 0; - // We compute the minimum and maximum dot product values. If those values - // are on the same side (back or front) of the plane, then there is no intersection. + } - let min, max; + enable( channel ) { - if ( plane.normal.x > 0 ) { + this.mask |= 1 << channel | 0; - min = plane.normal.x * this.min.x; - max = plane.normal.x * this.max.x; + } - } else { + enableAll() { - min = plane.normal.x * this.max.x; - max = plane.normal.x * this.min.x; + this.mask = 0xffffffff | 0; - } + } - if ( plane.normal.y > 0 ) { + toggle( channel ) { - min += plane.normal.y * this.min.y; - max += plane.normal.y * this.max.y; + this.mask ^= 1 << channel | 0; - } else { + } - min += plane.normal.y * this.max.y; - max += plane.normal.y * this.min.y; + disable( channel ) { - } + this.mask &= ~ ( 1 << channel | 0 ); - if ( plane.normal.z > 0 ) { + } - min += plane.normal.z * this.min.z; - max += plane.normal.z * this.max.z; + disableAll() { - } else { + this.mask = 0; - min += plane.normal.z * this.max.z; - max += plane.normal.z * this.min.z; + } - } + test( layers ) { - return ( min <= - plane.constant && max >= - plane.constant ); + return ( this.mask & layers.mask ) !== 0; - }, + } - intersectsTriangle: function ( triangle ) { +} - if ( this.isEmpty() ) { +let _object3DId = 0; - return false; +const _v1$2 = new Vector3(); +const _q1 = new Quaternion(); +const _m1$1 = new Matrix4(); +const _target = new Vector3(); - } +const _position = new Vector3(); +const _scale = new Vector3(); +const _quaternion$2 = new Quaternion(); - // compute box center and extents - this.getCenter( _center ); - _extents.subVectors( this.max, _center ); +const _xAxis = new Vector3( 1, 0, 0 ); +const _yAxis = new Vector3( 0, 1, 0 ); +const _zAxis = new Vector3( 0, 0, 1 ); - // translate triangle to aabb origin - _v0.subVectors( triangle.a, _center ); - _v1$2.subVectors( triangle.b, _center ); - _v2.subVectors( triangle.c, _center ); +const _addedEvent = { type: 'added' }; +const _removedEvent = { type: 'removed' }; - // compute edge vectors for triangle - _f0.subVectors( _v1$2, _v0 ); - _f1.subVectors( _v2, _v1$2 ); - _f2.subVectors( _v0, _v2 ); +function Object3D() { - // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb - // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation - // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) - let axes = [ - 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, - _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, - - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 - ]; - if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { + Object.defineProperty( this, 'id', { value: _object3DId ++ } ); - return false; + this.uuid = MathUtils.generateUUID(); - } + this.name = ''; + this.type = 'Object3D'; - // test 3 face normals from the aabb - axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; - if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { + this.parent = null; + this.children = []; - return false; + this.up = Object3D.DefaultUp.clone(); - } + const position = new Vector3(); + const rotation = new Euler(); + const quaternion = new Quaternion(); + const scale = new Vector3( 1, 1, 1 ); - // finally testing the face normal of the triangle - // use already existing triangle edge vectors here - _triangleNormal.crossVectors( _f0, _f1 ); - axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; + function onRotationChange() { - return satForAxes( axes, _v0, _v1$2, _v2, _extents ); + quaternion.setFromEuler( rotation, false ); - }, + } - clampPoint: function ( point, target ) { + function onQuaternionChange() { - if ( target === undefined ) { + rotation.setFromQuaternion( quaternion, undefined, false ); - console.warn( 'THREE.Box3: .clampPoint() target is now required' ); - target = new Vector3(); + } + + rotation._onChange( onRotationChange ); + quaternion._onChange( onQuaternionChange ); + Object.defineProperties( this, { + position: { + configurable: true, + enumerable: true, + value: position + }, + rotation: { + configurable: true, + enumerable: true, + value: rotation + }, + quaternion: { + configurable: true, + enumerable: true, + value: quaternion + }, + scale: { + configurable: true, + enumerable: true, + value: scale + }, + modelViewMatrix: { + value: new Matrix4() + }, + normalMatrix: { + value: new Matrix3() } + } ); - return target.copy( point ).clamp( this.min, this.max ); - - }, - - distanceToPoint: function ( point ) { + this.matrix = new Matrix4(); + this.matrixWorld = new Matrix4(); - const clampedPoint = _vector$1.copy( point ).clamp( this.min, this.max ); + this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; + this.matrixWorldNeedsUpdate = false; - return clampedPoint.sub( point ).length(); + this.layers = new Layers(); + this.visible = true; - }, + this.castShadow = false; + this.receiveShadow = false; - getBoundingSphere: function ( target ) { + this.frustumCulled = true; + this.renderOrder = 0; - if ( target === undefined ) { + this.userData = {}; - console.error( 'THREE.Box3: .getBoundingSphere() target is now required' ); - //target = new Sphere(); // removed to avoid cyclic dependency +} - } +Object3D.DefaultUp = new Vector3( 0, 1, 0 ); +Object3D.DefaultMatrixAutoUpdate = true; - this.getCenter( target.center ); +Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - target.radius = this.getSize( _vector$1 ).length() * 0.5; + constructor: Object3D, - return target; + isObject3D: true, - }, + onBeforeRender: function () {}, + onAfterRender: function () {}, - intersect: function ( box ) { + applyMatrix4: function ( matrix ) { - this.min.max( box.min ); - this.max.min( box.max ); + if ( this.matrixAutoUpdate ) this.updateMatrix(); - // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. - if ( this.isEmpty() ) this.makeEmpty(); + this.matrix.premultiply( matrix ); - return this; + this.matrix.decompose( this.position, this.quaternion, this.scale ); }, - union: function ( box ) { + applyQuaternion: function ( q ) { - this.min.min( box.min ); - this.max.max( box.max ); + this.quaternion.premultiply( q ); return this; }, - applyMatrix4: function ( matrix ) { - - // transform of empty box is an empty box. - if ( this.isEmpty() ) return this; - - // NOTE: I am using a binary pattern to specify all 2^3 combinations below - _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 - _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 - _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 - _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 - _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 - _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 - _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 - _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 + setRotationFromAxisAngle: function ( axis, angle ) { - this.setFromPoints( _points ); + // assumes axis is normalized - return this; + this.quaternion.setFromAxisAngle( axis, angle ); }, - translate: function ( offset ) { - - this.min.add( offset ); - this.max.add( offset ); + setRotationFromEuler: function ( euler ) { - return this; + this.quaternion.setFromEuler( euler, true ); }, - equals: function ( box ) { - - return box.min.equals( this.min ) && box.max.equals( this.max ); + setRotationFromMatrix: function ( m ) { - } + // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) -} ); + this.quaternion.setFromRotationMatrix( m ); -function satForAxes( axes, v0, v1, v2, extents ) { + }, - for ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) { + setRotationFromQuaternion: function ( q ) { - _testAxis.fromArray( axes, i ); - // project the aabb onto the seperating axis - const r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); - // project all 3 vertices of the triangle onto the seperating axis - const p0 = v0.dot( _testAxis ); - const p1 = v1.dot( _testAxis ); - const p2 = v2.dot( _testAxis ); - // actual test, basically see if either of the most extreme of the triangle points intersects r - if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { + // assumes q is normalized - // points of the projected triangle are outside the projected half-length of the aabb - // the axis is seperating and we can exit - return false; + this.quaternion.copy( q ); - } + }, - } + rotateOnAxis: function ( axis, angle ) { - return true; + // rotate object on axis in object space + // axis is assumed to be normalized -} + _q1.setFromAxisAngle( axis, angle ); -const _box$1 = new Box3(); + this.quaternion.multiply( _q1 ); -function Sphere( center, radius ) { + return this; - this.center = ( center !== undefined ) ? center : new Vector3(); - this.radius = ( radius !== undefined ) ? radius : - 1; + }, -} + rotateOnWorldAxis: function ( axis, angle ) { -Object.assign( Sphere.prototype, { + // rotate object on axis in world space + // axis is assumed to be normalized + // method assumes no rotated parent - set: function ( center, radius ) { + _q1.setFromAxisAngle( axis, angle ); - this.center.copy( center ); - this.radius = radius; + this.quaternion.premultiply( _q1 ); return this; }, - setFromPoints: function ( points, optionalCenter ) { - - const center = this.center; - - if ( optionalCenter !== undefined ) { + rotateX: function ( angle ) { - center.copy( optionalCenter ); + return this.rotateOnAxis( _xAxis, angle ); - } else { + }, - _box$1.setFromPoints( points ).getCenter( center ); + rotateY: function ( angle ) { - } + return this.rotateOnAxis( _yAxis, angle ); - let maxRadiusSq = 0; + }, - for ( let i = 0, il = points.length; i < il; i ++ ) { + rotateZ: function ( angle ) { - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + return this.rotateOnAxis( _zAxis, angle ); - } + }, - this.radius = Math.sqrt( maxRadiusSq ); + translateOnAxis: function ( axis, distance ) { - return this; + // translate object by distance along axis in object space + // axis is assumed to be normalized - }, + _v1$2.copy( axis ).applyQuaternion( this.quaternion ); - clone: function () { + this.position.add( _v1$2.multiplyScalar( distance ) ); - return new this.constructor().copy( this ); + return this; }, - copy: function ( sphere ) { - - this.center.copy( sphere.center ); - this.radius = sphere.radius; + translateX: function ( distance ) { - return this; + return this.translateOnAxis( _xAxis, distance ); }, - isEmpty: function () { + translateY: function ( distance ) { - return ( this.radius < 0 ); + return this.translateOnAxis( _yAxis, distance ); }, - makeEmpty: function () { - - this.center.set( 0, 0, 0 ); - this.radius = - 1; + translateZ: function ( distance ) { - return this; + return this.translateOnAxis( _zAxis, distance ); }, - containsPoint: function ( point ) { + localToWorld: function ( vector ) { - return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); + return vector.applyMatrix4( this.matrixWorld ); }, - distanceToPoint: function ( point ) { + worldToLocal: function ( vector ) { - return ( point.distanceTo( this.center ) - this.radius ); + return vector.applyMatrix4( _m1$1.getInverse( this.matrixWorld ) ); }, - intersectsSphere: function ( sphere ) { + lookAt: function ( x, y, z ) { - const radiusSum = this.radius + sphere.radius; + // This method does not support objects having non-uniformly-scaled parent(s) - return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); + if ( x.isVector3 ) { - }, + _target.copy( x ); - intersectsBox: function ( box ) { + } else { - return box.intersectsSphere( this ); + _target.set( x, y, z ); - }, + } - intersectsPlane: function ( plane ) { + const parent = this.parent; - return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; + this.updateWorldMatrix( true, false ); - }, + _position.setFromMatrixPosition( this.matrixWorld ); - clampPoint: function ( point, target ) { + if ( this.isCamera || this.isLight ) { - const deltaLengthSq = this.center.distanceToSquared( point ); + _m1$1.lookAt( _position, _target, this.up ); - if ( target === undefined ) { + } else { - console.warn( 'THREE.Sphere: .clampPoint() target is now required' ); - target = new Vector3(); + _m1$1.lookAt( _target, _position, this.up ); } - target.copy( point ); + this.quaternion.setFromRotationMatrix( _m1$1 ); - if ( deltaLengthSq > ( this.radius * this.radius ) ) { + if ( parent ) { - target.sub( this.center ).normalize(); - target.multiplyScalar( this.radius ).add( this.center ); + _m1$1.extractRotation( parent.matrixWorld ); + _q1.setFromRotationMatrix( _m1$1 ); + this.quaternion.premultiply( _q1.inverse() ); } - return target; - }, - getBoundingBox: function ( target ) { + add: function ( object ) { - if ( target === undefined ) { + if ( arguments.length > 1 ) { - console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' ); - target = new Box3(); + for ( let i = 0; i < arguments.length; i ++ ) { + + this.add( arguments[ i ] ); + + } + + return this; } - if ( this.isEmpty() ) { + if ( object === this ) { - // Empty sphere produces empty bounding box - target.makeEmpty(); - return target; + console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); + return this; } - target.set( this.center, this.center ); - target.expandByScalar( this.radius ); + if ( ( object && object.isObject3D ) ) { - return target; + if ( object.parent !== null ) { - }, + object.parent.remove( object ); - applyMatrix4: function ( matrix ) { + } - this.center.applyMatrix4( matrix ); - this.radius = this.radius * matrix.getMaxScaleOnAxis(); + object.parent = this; + this.children.push( object ); - return this; + object.dispatchEvent( _addedEvent ); - }, + } else { - translate: function ( offset ) { + console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); - this.center.add( offset ); + } return this; }, - equals: function ( sphere ) { + remove: function ( object ) { - return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); + if ( arguments.length > 1 ) { - } + for ( let i = 0; i < arguments.length; i ++ ) { -} ); + this.remove( arguments[ i ] ); -const _vector$2 = new Vector3(); -const _segCenter = new Vector3(); -const _segDir = new Vector3(); -const _diff = new Vector3(); + } -const _edge1 = new Vector3(); -const _edge2 = new Vector3(); -const _normal = new Vector3(); + return this; -class Ray { + } - constructor( origin, direction ) { + const index = this.children.indexOf( object ); - this.origin = ( origin !== undefined ) ? origin : new Vector3(); - this.direction = ( direction !== undefined ) ? direction : new Vector3( 0, 0, - 1 ); + if ( index !== - 1 ) { - } + object.parent = null; + this.children.splice( index, 1 ); - set( origin, direction ) { + object.dispatchEvent( _removedEvent ); - this.origin.copy( origin ); - this.direction.copy( direction ); + } return this; - } + }, - clone() { + attach: function ( object ) { - return new this.constructor().copy( this ); + // adds object as a child of this, while maintaining the object's world transform - } + this.updateWorldMatrix( true, false ); - copy( ray ) { + _m1$1.getInverse( this.matrixWorld ); - this.origin.copy( ray.origin ); - this.direction.copy( ray.direction ); + if ( object.parent !== null ) { - return this; + object.parent.updateWorldMatrix( true, false ); - } + _m1$1.multiply( object.parent.matrixWorld ); - at( t, target ) { + } - if ( target === undefined ) { + object.applyMatrix4( _m1$1 ); - console.warn( 'THREE.Ray: .at() target is now required' ); - target = new Vector3(); + object.updateWorldMatrix( false, false ); - } + this.add( object ); - return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); + return this; - } + }, - lookAt( v ) { + getObjectById: function ( id ) { - this.direction.copy( v ).sub( this.origin ).normalize(); + return this.getObjectByProperty( 'id', id ); - return this; + }, - } + getObjectByName: function ( name ) { - recast( t ) { + return this.getObjectByProperty( 'name', name ); - this.origin.copy( this.at( t, _vector$2 ) ); + }, - return this; + getObjectByProperty: function ( name, value ) { - } + if ( this[ name ] === value ) return this; - closestPointToPoint( point, target ) { + for ( let i = 0, l = this.children.length; i < l; i ++ ) { - if ( target === undefined ) { + const child = this.children[ i ]; + const object = child.getObjectByProperty( name, value ); - console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' ); - target = new Vector3(); + if ( object !== undefined ) { + + return object; + + } } - target.subVectors( point, this.origin ); + return undefined; - const directionDistance = target.dot( this.direction ); + }, - if ( directionDistance < 0 ) { + getWorldPosition: function ( target ) { - return target.copy( this.origin ); + if ( target === undefined ) { - } + console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' ); + target = new Vector3(); - return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + } - } + this.updateMatrixWorld( true ); - distanceToPoint( point ) { + return target.setFromMatrixPosition( this.matrixWorld ); - return Math.sqrt( this.distanceSqToPoint( point ) ); + }, - } + getWorldQuaternion: function ( target ) { - distanceSqToPoint( point ) { + if ( target === undefined ) { - const directionDistance = _vector$2.subVectors( point, this.origin ).dot( this.direction ); + console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); + target = new Quaternion(); - // point behind the ray + } - if ( directionDistance < 0 ) { + this.updateMatrixWorld( true ); - return this.origin.distanceToSquared( point ); + this.matrixWorld.decompose( _position, target, _scale ); - } + return target; - _vector$2.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); + }, - return _vector$2.distanceToSquared( point ); + getWorldScale: function ( target ) { - } + if ( target === undefined ) { - distanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { + console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); + target = new Vector3(); - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h - // It returns the min distance between the ray and the segment - // defined by v0 and v1 - // It can also set two optional targets : - // - The closest point on the ray - // - The closest point on the segment + } - _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); - _segDir.copy( v1 ).sub( v0 ).normalize(); - _diff.copy( this.origin ).sub( _segCenter ); + this.updateMatrixWorld( true ); - const segExtent = v0.distanceTo( v1 ) * 0.5; - const a01 = - this.direction.dot( _segDir ); - const b0 = _diff.dot( this.direction ); - const b1 = - _diff.dot( _segDir ); - const c = _diff.lengthSq(); - const det = Math.abs( 1 - a01 * a01 ); - let s0, s1, sqrDist, extDet; + this.matrixWorld.decompose( _position, _quaternion$2, target ); - if ( det > 0 ) { + return target; - // The ray and segment are not parallel. + }, - s0 = a01 * b1 - b0; - s1 = a01 * b0 - b1; - extDet = segExtent * det; + getWorldDirection: function ( target ) { - if ( s0 >= 0 ) { + if ( target === undefined ) { - if ( s1 >= - extDet ) { + console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' ); + target = new Vector3(); - if ( s1 <= extDet ) { + } - // region 0 - // Minimum at interior points of ray and segment. + this.updateMatrixWorld( true ); - const invDet = 1 / det; - s0 *= invDet; - s1 *= invDet; - sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; + const e = this.matrixWorld.elements; - } else { + return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); - // region 1 + }, - s1 = segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + raycast: function () {}, - } + traverse: function ( callback ) { - } else { + callback( this ); - // region 5 + const children = this.children; - s1 = - segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + for ( let i = 0, l = children.length; i < l; i ++ ) { - } + children[ i ].traverse( callback ); - } else { + } - if ( s1 <= - extDet ) { + }, - // region 4 + traverseVisible: function ( callback ) { - s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + if ( this.visible === false ) return; - } else if ( s1 <= extDet ) { + callback( this ); - // region 3 + const children = this.children; - s0 = 0; - s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = s1 * ( s1 + 2 * b1 ) + c; + for ( let i = 0, l = children.length; i < l; i ++ ) { - } else { + children[ i ].traverseVisible( callback ); - // region 2 + } - s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + }, - } + traverseAncestors: function ( callback ) { - } + const parent = this.parent; - } else { + if ( parent !== null ) { - // Ray and segment are parallel. + callback( parent ); - s1 = ( a01 > 0 ) ? - segExtent : segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; + parent.traverseAncestors( callback ); } - if ( optionalPointOnRay ) { + }, - optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); + updateMatrix: function () { - } + this.matrix.compose( this.position, this.quaternion, this.scale ); - if ( optionalPointOnSegment ) { + this.matrixWorldNeedsUpdate = true; - optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); + }, - } + updateMatrixWorld: function ( force ) { - return sqrDist; + if ( this.matrixAutoUpdate ) this.updateMatrix(); - } + if ( this.matrixWorldNeedsUpdate || force ) { - intersectSphere( sphere, target ) { + if ( this.parent === null ) { - _vector$2.subVectors( sphere.center, this.origin ); - const tca = _vector$2.dot( this.direction ); - const d2 = _vector$2.dot( _vector$2 ) - tca * tca; - const radius2 = sphere.radius * sphere.radius; + this.matrixWorld.copy( this.matrix ); - if ( d2 > radius2 ) return null; + } else { + + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - const thc = Math.sqrt( radius2 - d2 ); + } - // t0 = first intersect point - entrance on front of sphere - const t0 = tca - thc; + this.matrixWorldNeedsUpdate = false; - // t1 = second intersect point - exit point on back of sphere - const t1 = tca + thc; + force = true; - // test to see if both t0 and t1 are behind the ray - if so, return null - if ( t0 < 0 && t1 < 0 ) return null; + } - // test to see if t0 is behind the ray: - // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, - // in order to always return an intersect point that is in front of the ray. - if ( t0 < 0 ) return this.at( t1, target ); + // update children - // else t0 is in front of the ray, so return the first collision point scaled by t0 - return this.at( t0, target ); + const children = this.children; - } + for ( let i = 0, l = children.length; i < l; i ++ ) { - intersectsSphere( sphere ) { + children[ i ].updateMatrixWorld( force ); - return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); + } - } + }, - distanceToPlane( plane ) { + updateWorldMatrix: function ( updateParents, updateChildren ) { - const denominator = plane.normal.dot( this.direction ); + const parent = this.parent; - if ( denominator === 0 ) { + if ( updateParents === true && parent !== null ) { - // line is coplanar, return origin - if ( plane.distanceToPoint( this.origin ) === 0 ) { + parent.updateWorldMatrix( true, false ); - return 0; + } - } + if ( this.matrixAutoUpdate ) this.updateMatrix(); - // Null is preferable to undefined since undefined means.... it is undefined + if ( this.parent === null ) { - return null; + this.matrixWorld.copy( this.matrix ); - } + } else { - const t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; + this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - // Return if the ray never intersects the plane + } - return t >= 0 ? t : null; + // update children - } + if ( updateChildren === true ) { - intersectPlane( plane, target ) { + const children = this.children; - const t = this.distanceToPlane( plane ); + for ( let i = 0, l = children.length; i < l; i ++ ) { - if ( t === null ) { + children[ i ].updateWorldMatrix( false, true ); - return null; + } } - return this.at( t, target ); + }, - } + toJSON: function ( meta ) { - intersectsPlane( plane ) { + // meta is a string when called from JSON.stringify + const isRootObject = ( meta === undefined || typeof meta === 'string' ); - // check if the ray lies on the plane first + const output = {}; - const distToPoint = plane.distanceToPoint( this.origin ); + // meta is a hash used to collect geometries, materials. + // not providing it implies that this is the root object + // being serialized. + if ( isRootObject ) { - if ( distToPoint === 0 ) { + // initialize meta obj + meta = { + geometries: {}, + materials: {}, + textures: {}, + images: {}, + shapes: {} + }; - return true; + output.metadata = { + version: 4.5, + type: 'Object', + generator: 'Object3D.toJSON' + }; } - const denominator = plane.normal.dot( this.direction ); + // standard Object3D serialization - if ( denominator * distToPoint < 0 ) { + const object = {}; - return true; + object.uuid = this.uuid; + object.type = this.type; - } + if ( this.name !== '' ) object.name = this.name; + if ( this.castShadow === true ) object.castShadow = true; + if ( this.receiveShadow === true ) object.receiveShadow = true; + if ( this.visible === false ) object.visible = false; + if ( this.frustumCulled === false ) object.frustumCulled = false; + if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder; + if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; - // ray origin is behind the plane (and is pointing behind it) + object.layers = this.layers.mask; + object.matrix = this.matrix.toArray(); - return false; + if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false; - } + // object specific properties - intersectBox( box, target ) { + if ( this.isInstancedMesh ) { - let tmin, tmax, tymin, tymax, tzmin, tzmax; + object.type = 'InstancedMesh'; + object.count = this.count; + object.instanceMatrix = this.instanceMatrix.toJSON(); - const invdirx = 1 / this.direction.x, - invdiry = 1 / this.direction.y, - invdirz = 1 / this.direction.z; + } - const origin = this.origin; + // - if ( invdirx >= 0 ) { + function serialize( library, element ) { - tmin = ( box.min.x - origin.x ) * invdirx; - tmax = ( box.max.x - origin.x ) * invdirx; + if ( library[ element.uuid ] === undefined ) { - } else { + library[ element.uuid ] = element.toJSON( meta ); - tmin = ( box.max.x - origin.x ) * invdirx; - tmax = ( box.min.x - origin.x ) * invdirx; + } + + return element.uuid; } - if ( invdiry >= 0 ) { + if ( this.isMesh || this.isLine || this.isPoints ) { - tymin = ( box.min.y - origin.y ) * invdiry; - tymax = ( box.max.y - origin.y ) * invdiry; + object.geometry = serialize( meta.geometries, this.geometry ); - } else { + const parameters = this.geometry.parameters; - tymin = ( box.max.y - origin.y ) * invdiry; - tymax = ( box.min.y - origin.y ) * invdiry; + if ( parameters !== undefined && parameters.shapes !== undefined ) { - } + const shapes = parameters.shapes; - if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; + if ( Array.isArray( shapes ) ) { - // These lines also handle the case where tmin or tmax is NaN - // (result of 0 * Infinity). x !== x returns true if x is NaN + for ( let i = 0, l = shapes.length; i < l; i ++ ) { - if ( tymin > tmin || tmin !== tmin ) tmin = tymin; + const shape = shapes[ i ]; - if ( tymax < tmax || tmax !== tmax ) tmax = tymax; + serialize( meta.shapes, shape ); - if ( invdirz >= 0 ) { + } - tzmin = ( box.min.z - origin.z ) * invdirz; - tzmax = ( box.max.z - origin.z ) * invdirz; + } else { - } else { + serialize( meta.shapes, shapes ); - tzmin = ( box.max.z - origin.z ) * invdirz; - tzmax = ( box.min.z - origin.z ) * invdirz; + } + + } } - if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; + if ( this.material !== undefined ) { - if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; + if ( Array.isArray( this.material ) ) { - if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; + const uuids = []; - //return point closest to the ray (positive side) + for ( let i = 0, l = this.material.length; i < l; i ++ ) { - if ( tmax < 0 ) return null; + uuids.push( serialize( meta.materials, this.material[ i ] ) ); - return this.at( tmin >= 0 ? tmin : tmax, target ); + } - } + object.material = uuids; - intersectsBox( box ) { + } else { - return this.intersectBox( box, _vector$2 ) !== null; + object.material = serialize( meta.materials, this.material ); - } + } - intersectTriangle( a, b, c, backfaceCulling, target ) { + } - // Compute the offset origin, edges, and normal. + // - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h + if ( this.children.length > 0 ) { - _edge1.subVectors( b, a ); - _edge2.subVectors( c, a ); - _normal.crossVectors( _edge1, _edge2 ); + object.children = []; - // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, - // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by - // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) - // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) - // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) - let DdN = this.direction.dot( _normal ); - let sign; + for ( let i = 0; i < this.children.length; i ++ ) { - if ( DdN > 0 ) { + object.children.push( this.children[ i ].toJSON( meta ).object ); - if ( backfaceCulling ) return null; - sign = 1; + } - } else if ( DdN < 0 ) { + } - sign = - 1; - DdN = - DdN; + if ( isRootObject ) { - } else { + const geometries = extractFromCache( meta.geometries ); + const materials = extractFromCache( meta.materials ); + const textures = extractFromCache( meta.textures ); + const images = extractFromCache( meta.images ); + const shapes = extractFromCache( meta.shapes ); - return null; + if ( geometries.length > 0 ) output.geometries = geometries; + if ( materials.length > 0 ) output.materials = materials; + if ( textures.length > 0 ) output.textures = textures; + if ( images.length > 0 ) output.images = images; + if ( shapes.length > 0 ) output.shapes = shapes; } - _diff.subVectors( this.origin, a ); - const DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); + output.object = object; - // b1 < 0, no intersection - if ( DdQxE2 < 0 ) { + return output; - return null; + // extract data from the cache hash + // remove metadata on each item + // and return as array + function extractFromCache( cache ) { - } + const values = []; + for ( const key in cache ) { - const DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); + const data = cache[ key ]; + delete data.metadata; + values.push( data ); - // b2 < 0, no intersection - if ( DdE1xQ < 0 ) { + } - return null; + return values; } - // b1+b2 > 1, no intersection - if ( DdQxE2 + DdE1xQ > DdN ) { + }, - return null; + clone: function ( recursive ) { - } + return new this.constructor().copy( this, recursive ); - // Line intersects triangle, check if ray does. - const QdN = - sign * _diff.dot( _normal ); + }, - // t < 0, no intersection - if ( QdN < 0 ) { + copy: function ( source, recursive ) { - return null; + if ( recursive === undefined ) recursive = true; - } + this.name = source.name; - // Ray intersects triangle. - return this.at( QdN / DdN, target ); + this.up.copy( source.up ); - } + this.position.copy( source.position ); + this.rotation.order = source.rotation.order; + this.quaternion.copy( source.quaternion ); + this.scale.copy( source.scale ); - applyMatrix4( matrix4 ) { + this.matrix.copy( source.matrix ); + this.matrixWorld.copy( source.matrixWorld ); - this.origin.applyMatrix4( matrix4 ); - this.direction.transformDirection( matrix4 ); + this.matrixAutoUpdate = source.matrixAutoUpdate; + this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - return this; + this.layers.mask = source.layers.mask; + this.visible = source.visible; - } + this.castShadow = source.castShadow; + this.receiveShadow = source.receiveShadow; - equals( ray ) { + this.frustumCulled = source.frustumCulled; + this.renderOrder = source.renderOrder; - return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); + this.userData = JSON.parse( JSON.stringify( source.userData ) ); + + if ( recursive === true ) { + + for ( let i = 0; i < source.children.length; i ++ ) { + + const child = source.children[ i ]; + this.add( child.clone() ); + + } + + } + + return this; } -} +} ); const _vector1 = new Vector3(); const _vector2 = new Vector3(); const _normalMatrix = new Matrix3(); -function Plane( normal, constant ) { - - // normal is assumed to be normalized +class Plane { - this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); - this.constant = ( constant !== undefined ) ? constant : 0; + constructor( normal, constant ) { -} + // normal is assumed to be normalized -Object.assign( Plane.prototype, { + this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); + this.constant = ( constant !== undefined ) ? constant : 0; - isPlane: true, + } - set: function ( normal, constant ) { + set( normal, constant ) { this.normal.copy( normal ); this.constant = constant; return this; - }, + } - setComponents: function ( x, y, z, w ) { + setComponents( x, y, z, w ) { this.normal.set( x, y, z ); this.constant = w; return this; - }, + } - setFromNormalAndCoplanarPoint: function ( normal, point ) { + setFromNormalAndCoplanarPoint( normal, point ) { this.normal.copy( normal ); this.constant = - point.dot( this.normal ); return this; - }, + } - setFromCoplanarPoints: function ( a, b, c ) { + setFromCoplanarPoints( a, b, c ) { const normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); @@ -7435,24 +7306,24 @@ Object.assign( Plane.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( plane ) { + copy( plane ) { this.normal.copy( plane.normal ); this.constant = plane.constant; return this; - }, + } - normalize: function () { + normalize() { // Note: will lead to a divide by zero if the plane is invalid. @@ -7462,30 +7333,30 @@ Object.assign( Plane.prototype, { return this; - }, + } - negate: function () { + negate() { this.constant *= - 1; this.normal.negate(); return this; - }, + } - distanceToPoint: function ( point ) { + distanceToPoint( point ) { return this.normal.dot( point ) + this.constant; - }, + } - distanceToSphere: function ( sphere ) { + distanceToSphere( sphere ) { return this.distanceToPoint( sphere.center ) - sphere.radius; - }, + } - projectPoint: function ( point, target ) { + projectPoint( point, target ) { if ( target === undefined ) { @@ -7496,9 +7367,9 @@ Object.assign( Plane.prototype, { return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point ); - }, + } - intersectLine: function ( line, target ) { + intersectLine( line, target ) { if ( target === undefined ) { @@ -7535,9 +7406,9 @@ Object.assign( Plane.prototype, { return target.copy( direction ).multiplyScalar( t ).add( line.start ); - }, + } - intersectsLine: function ( line ) { + intersectsLine( line ) { // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. @@ -7546,21 +7417,21 @@ Object.assign( Plane.prototype, { return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); - }, + } - intersectsBox: function ( box ) { + intersectsBox( box ) { return box.intersectsPlane( this ); - }, + } - intersectsSphere: function ( sphere ) { + intersectsSphere( sphere ) { return sphere.intersectsPlane( this ); - }, + } - coplanarPoint: function ( target ) { + coplanarPoint( target ) { if ( target === undefined ) { @@ -7571,9 +7442,9 @@ Object.assign( Plane.prototype, { return target.copy( this.normal ).multiplyScalar( - this.constant ); - }, + } - applyMatrix4: function ( matrix, optionalNormalMatrix ) { + applyMatrix4( matrix, optionalNormalMatrix ) { const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); @@ -7585,23 +7456,25 @@ Object.assign( Plane.prototype, { return this; - }, + } - translate: function ( offset ) { + translate( offset ) { this.constant -= offset.dot( this.normal ); return this; - }, + } - equals: function ( plane ) { + equals( plane ) { return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); } -} ); +} + +Plane.prototype.isPlane = true; const _v0$1 = new Vector3(); const _v1$3 = new Vector3(); @@ -7615,17 +7488,17 @@ const _vap = new Vector3(); const _vbp = new Vector3(); const _vcp = new Vector3(); -function Triangle( a, b, c ) { +class Triangle { - this.a = ( a !== undefined ) ? a : new Vector3(); - this.b = ( b !== undefined ) ? b : new Vector3(); - this.c = ( c !== undefined ) ? c : new Vector3(); + constructor( a, b, c ) { -} + this.a = ( a !== undefined ) ? a : new Vector3(); + this.b = ( b !== undefined ) ? b : new Vector3(); + this.c = ( c !== undefined ) ? c : new Vector3(); -Object.assign( Triangle, { + } - getNormal: function ( a, b, c, target ) { + static getNormal( a, b, c, target ) { if ( target === undefined ) { @@ -7647,11 +7520,11 @@ Object.assign( Triangle, { return target.set( 0, 0, 0 ); - }, + } // static/instance method to calculate barycentric coordinates // based on: http://www.blackpawn.com/texts/pointinpoly/default.html - getBarycoord: function ( point, a, b, c, target ) { + static getBarycoord( point, a, b, c, target ) { _v0$1.subVectors( c, a ); _v1$3.subVectors( b, a ); @@ -7688,17 +7561,17 @@ Object.assign( Triangle, { // barycentric coordinates must always sum to 1 return target.set( 1 - u - v, v, u ); - }, + } - containsPoint: function ( point, a, b, c ) { + static containsPoint( point, a, b, c ) { - Triangle.getBarycoord( point, a, b, c, _v3 ); + this.getBarycoord( point, a, b, c, _v3 ); return ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 ); - }, + } - getUV: function ( point, p1, p2, p3, uv1, uv2, uv3, target ) { + static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) { this.getBarycoord( point, p1, p2, p3, _v3 ); @@ -7709,9 +7582,9 @@ Object.assign( Triangle, { return target; - }, + } - isFrontFacing: function ( a, b, c, direction ) { + static isFrontFacing( a, b, c, direction ) { _v0$1.subVectors( c, b ); _v1$3.subVectors( a, b ); @@ -7721,11 +7594,7 @@ Object.assign( Triangle, { } -} ); - -Object.assign( Triangle.prototype, { - - set: function ( a, b, c ) { + set( a, b, c ) { this.a.copy( a ); this.b.copy( b ); @@ -7733,9 +7602,9 @@ Object.assign( Triangle.prototype, { return this; - }, + } - setFromPointsAndIndices: function ( points, i0, i1, i2 ) { + setFromPointsAndIndices( points, i0, i1, i2 ) { this.a.copy( points[ i0 ] ); this.b.copy( points[ i1 ] ); @@ -7743,15 +7612,15 @@ Object.assign( Triangle.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( triangle ) { + copy( triangle ) { this.a.copy( triangle.a ); this.b.copy( triangle.b ); @@ -7759,18 +7628,18 @@ Object.assign( Triangle.prototype, { return this; - }, + } - getArea: function () { + getArea() { _v0$1.subVectors( this.c, this.b ); _v1$3.subVectors( this.a, this.b ); return _v0$1.cross( _v1$3 ).length() * 0.5; - }, + } - getMidpoint: function ( target ) { + getMidpoint( target ) { if ( target === undefined ) { @@ -7781,15 +7650,15 @@ Object.assign( Triangle.prototype, { return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); - }, + } - getNormal: function ( target ) { + getNormal( target ) { return Triangle.getNormal( this.a, this.b, this.c, target ); - }, + } - getPlane: function ( target ) { + getPlane( target ) { if ( target === undefined ) { @@ -7800,39 +7669,39 @@ Object.assign( Triangle.prototype, { return target.setFromCoplanarPoints( this.a, this.b, this.c ); - }, + } - getBarycoord: function ( point, target ) { + getBarycoord( point, target ) { return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); - }, + } - getUV: function ( point, uv1, uv2, uv3, target ) { + getUV( point, uv1, uv2, uv3, target ) { return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); - }, + } - containsPoint: function ( point ) { + containsPoint( point ) { return Triangle.containsPoint( point, this.a, this.b, this.c ); - }, + } - isFrontFacing: function ( direction ) { + isFrontFacing( direction ) { return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); - }, + } - intersectsBox: function ( box ) { + intersectsBox( box ) { return box.intersectsTriangle( this ); - }, + } - closestPointToPoint: function ( p, target ) { + closestPointToPoint( p, target ) { if ( target === undefined ) { @@ -7918,15 +7787,15 @@ Object.assign( Triangle.prototype, { return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); - }, + } - equals: function ( triangle ) { + equals( triangle ) { return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); } -} ); +} const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, @@ -7956,19 +7825,6 @@ const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua' const _hslA = { h: 0, s: 0, l: 0 }; const _hslB = { h: 0, s: 0, l: 0 }; -function Color( r, g, b ) { - - if ( g === undefined && b === undefined ) { - - // r is THREE.Color, hex or string - return this.set( r ); - - } - - return this.setRGB( r, g, b ); - -} - function hue2rgb( p, q, t ) { if ( t < 0 ) t += 1; @@ -7992,13 +7848,22 @@ function LinearToSRGB( c ) { } -Object.assign( Color.prototype, { +class Color { - isColor: true, + constructor( r, g, b ) { - r: 1, g: 1, b: 1, + if ( g === undefined && b === undefined ) { - set: function ( value ) { + // r is THREE.Color, hex or string + return this.set( r ); + + } + + return this.setRGB( r, g, b ); + + } + + set( value ) { if ( value && value.isColor ) { @@ -8016,9 +7881,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setScalar: function ( scalar ) { + setScalar( scalar ) { this.r = scalar; this.g = scalar; @@ -8026,9 +7891,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setHex: function ( hex ) { + setHex( hex ) { hex = Math.floor( hex ); @@ -8038,9 +7903,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setRGB: function ( r, g, b ) { + setRGB( r, g, b ) { this.r = r; this.g = g; @@ -8048,9 +7913,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setHSL: function ( h, s, l ) { + setHSL( h, s, l ) { // h,s,l ranges are in 0.0 - 1.0 h = MathUtils.euclideanModulo( h, 1 ); @@ -8074,9 +7939,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setStyle: function ( style ) { + setStyle( style ) { function handleAlpha( string ) { @@ -8191,9 +8056,9 @@ Object.assign( Color.prototype, { return this; - }, + } - setColorName: function ( style ) { + setColorName( style ) { // color keywords const hex = _colorKeywords[ style ]; @@ -8212,15 +8077,15 @@ Object.assign( Color.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor( this.r, this.g, this.b ); - }, + } - copy: function ( color ) { + copy( color ) { this.r = color.r; this.g = color.g; @@ -8228,9 +8093,9 @@ Object.assign( Color.prototype, { return this; - }, + } - copyGammaToLinear: function ( color, gammaFactor ) { + copyGammaToLinear( color, gammaFactor ) { if ( gammaFactor === undefined ) gammaFactor = 2.0; @@ -8240,9 +8105,9 @@ Object.assign( Color.prototype, { return this; - }, + } - copyLinearToGamma: function ( color, gammaFactor ) { + copyLinearToGamma( color, gammaFactor ) { if ( gammaFactor === undefined ) gammaFactor = 2.0; @@ -8254,25 +8119,25 @@ Object.assign( Color.prototype, { return this; - }, + } - convertGammaToLinear: function ( gammaFactor ) { + convertGammaToLinear( gammaFactor ) { this.copyGammaToLinear( this, gammaFactor ); return this; - }, + } - convertLinearToGamma: function ( gammaFactor ) { + convertLinearToGamma( gammaFactor ) { this.copyLinearToGamma( this, gammaFactor ); return this; - }, + } - copySRGBToLinear: function ( color ) { + copySRGBToLinear( color ) { this.r = SRGBToLinear( color.r ); this.g = SRGBToLinear( color.g ); @@ -8280,9 +8145,9 @@ Object.assign( Color.prototype, { return this; - }, + } - copyLinearToSRGB: function ( color ) { + copyLinearToSRGB( color ) { this.r = LinearToSRGB( color.r ); this.g = LinearToSRGB( color.g ); @@ -8290,37 +8155,37 @@ Object.assign( Color.prototype, { return this; - }, + } - convertSRGBToLinear: function () { + convertSRGBToLinear() { this.copySRGBToLinear( this ); return this; - }, + } - convertLinearToSRGB: function () { + convertLinearToSRGB() { this.copyLinearToSRGB( this ); return this; - }, + } - getHex: function () { + getHex() { return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; - }, + } - getHexString: function () { + getHexString() { return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); - }, + } - getHSL: function ( target ) { + getHSL( target ) { // h,s,l ranges are in 0.0 - 1.0 @@ -8368,15 +8233,15 @@ Object.assign( Color.prototype, { return target; - }, + } - getStyle: function () { + getStyle() { return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; - }, + } - offsetHSL: function ( h, s, l ) { + offsetHSL( h, s, l ) { this.getHSL( _hslA ); @@ -8386,9 +8251,9 @@ Object.assign( Color.prototype, { return this; - }, + } - add: function ( color ) { + add( color ) { this.r += color.r; this.g += color.g; @@ -8396,9 +8261,9 @@ Object.assign( Color.prototype, { return this; - }, + } - addColors: function ( color1, color2 ) { + addColors( color1, color2 ) { this.r = color1.r + color2.r; this.g = color1.g + color2.g; @@ -8406,9 +8271,9 @@ Object.assign( Color.prototype, { return this; - }, + } - addScalar: function ( s ) { + addScalar( s ) { this.r += s; this.g += s; @@ -8416,9 +8281,9 @@ Object.assign( Color.prototype, { return this; - }, + } - sub: function ( color ) { + sub( color ) { this.r = Math.max( 0, this.r - color.r ); this.g = Math.max( 0, this.g - color.g ); @@ -8426,9 +8291,9 @@ Object.assign( Color.prototype, { return this; - }, + } - multiply: function ( color ) { + multiply( color ) { this.r *= color.r; this.g *= color.g; @@ -8436,9 +8301,9 @@ Object.assign( Color.prototype, { return this; - }, + } - multiplyScalar: function ( s ) { + multiplyScalar( s ) { this.r *= s; this.g *= s; @@ -8446,9 +8311,9 @@ Object.assign( Color.prototype, { return this; - }, + } - lerp: function ( color, alpha ) { + lerp( color, alpha ) { this.r += ( color.r - this.r ) * alpha; this.g += ( color.g - this.g ) * alpha; @@ -8456,9 +8321,9 @@ Object.assign( Color.prototype, { return this; - }, + } - lerpHSL: function ( color, alpha ) { + lerpHSL( color, alpha ) { this.getHSL( _hslA ); color.getHSL( _hslB ); @@ -8471,15 +8336,15 @@ Object.assign( Color.prototype, { return this; - }, + } - equals: function ( c ) { + equals( c ) { return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -8489,9 +8354,9 @@ Object.assign( Color.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -8502,9 +8367,9 @@ Object.assign( Color.prototype, { return array; - }, + } - fromBufferAttribute: function ( attribute, index ) { + fromBufferAttribute( attribute, index ) { this.r = attribute.getX( index ); this.g = attribute.getY( index ); @@ -8522,17 +8387,21 @@ Object.assign( Color.prototype, { return this; - }, + } - toJSON: function () { + toJSON() { return this.getHex(); } -} ); +} Color.NAMES = _colorKeywords; +Color.prototype.isColor = true; +Color.prototype.r = 1; +Color.prototype.g = 1; +Color.prototype.b = 1; class Face3 { @@ -10473,6 +10342,19 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy const position = this.attributes.position; const morphAttributesPosition = this.morphAttributes.position; + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingBox.set( + new Vector3( - Infinity, - Infinity, - Infinity ), + new Vector3( + Infinity, + Infinity, + Infinity ) + ); + + return; + + } + if ( position !== undefined ) { this.boundingBox.setFromBufferAttribute( position ); @@ -10513,7 +10395,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); + console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); } @@ -10530,6 +10412,16 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy const position = this.attributes.position; const morphAttributesPosition = this.morphAttributes.position; + if ( position && position.isGLBufferAttribute ) { + + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this ); + + this.boundingSphere.set( new Vector3(), Infinity ); + + return; + + } + if ( position ) { // first, find the center of the bounding sphere @@ -13267,6 +13159,8 @@ function ShaderMaterial( parameters ) { this.index0AttributeName = undefined; this.uniformsNeedUpdate = false; + this.glslVersion = null; + if ( parameters !== undefined ) { if ( parameters.attributes !== undefined ) { @@ -13310,6 +13204,8 @@ ShaderMaterial.prototype.copy = function ( source ) { this.extensions = Object.assign( {}, source.extensions ); + this.glslVersion = source.glslVersion; + return this; }; @@ -13318,6 +13214,7 @@ ShaderMaterial.prototype.toJSON = function ( meta ) { const data = Material.prototype.toJSON.call( this, meta ); + data.glslVersion = this.glslVersion; data.uniforms = {}; for ( const name in this.uniforms ) { @@ -13834,6 +13731,8 @@ function WebGLCubeRenderTarget( size, options, dummy ) { WebGLRenderTarget.call( this, size, size, options ); + this.texture.isWebGLCubeRenderTargetTexture = true; // HACK Why is texture not a CubeTexture? + } WebGLCubeRenderTarget.prototype = Object.create( WebGLRenderTarget.prototype ); @@ -13851,8 +13750,6 @@ WebGLCubeRenderTarget.prototype.fromEquirectangularTexture = function ( renderer this.texture.minFilter = texture.minFilter; this.texture.magFilter = texture.magFilter; - const scene = new Scene(); - const shader = { uniforms: { @@ -13899,6 +13796,8 @@ WebGLCubeRenderTarget.prototype.fromEquirectangularTexture = function ( renderer ` }; + const geometry = new BoxBufferGeometry( 5, 5, 5 ); + const material = new ShaderMaterial( { name: 'CubemapFromEquirect', @@ -13913,12 +13812,24 @@ WebGLCubeRenderTarget.prototype.fromEquirectangularTexture = function ( renderer material.uniforms.tEquirect.value = texture; - const mesh = new Mesh( new BoxBufferGeometry( 5, 5, 5 ), material ); + const mesh = new Mesh( geometry, material ); - scene.add( mesh ); + const currentMinFilter = texture.minFilter; + const currentRenderList = renderer.getRenderList(); + const currentRenderTarget = renderer.getRenderTarget(); + const currentRenderState = renderer.getRenderState(); + + // Avoid blurred poles + if ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter; const camera = new CubeCamera( 1, 10, this ); - camera.update( renderer, scene ); + camera.update( renderer, mesh ); + + texture.minFilter = currentMinFilter; + + renderer.setRenderTarget( currentRenderTarget ); + renderer.setRenderList( currentRenderList ); + renderer.setRenderState( currentRenderState ); mesh.geometry.dispose(); mesh.material.dispose(); @@ -13952,24 +13863,24 @@ DataTexture.prototype.isDataTexture = true; const _sphere$1 = new Sphere(); const _vector$5 = new Vector3(); -function Frustum( p0, p1, p2, p3, p4, p5 ) { +class Frustum { - this.planes = [ + constructor( p0, p1, p2, p3, p4, p5 ) { - ( p0 !== undefined ) ? p0 : new Plane(), - ( p1 !== undefined ) ? p1 : new Plane(), - ( p2 !== undefined ) ? p2 : new Plane(), - ( p3 !== undefined ) ? p3 : new Plane(), - ( p4 !== undefined ) ? p4 : new Plane(), - ( p5 !== undefined ) ? p5 : new Plane() + this.planes = [ - ]; + ( p0 !== undefined ) ? p0 : new Plane(), + ( p1 !== undefined ) ? p1 : new Plane(), + ( p2 !== undefined ) ? p2 : new Plane(), + ( p3 !== undefined ) ? p3 : new Plane(), + ( p4 !== undefined ) ? p4 : new Plane(), + ( p5 !== undefined ) ? p5 : new Plane() -} + ]; -Object.assign( Frustum.prototype, { + } - set: function ( p0, p1, p2, p3, p4, p5 ) { + set( p0, p1, p2, p3, p4, p5 ) { const planes = this.planes; @@ -13982,15 +13893,15 @@ Object.assign( Frustum.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( frustum ) { + copy( frustum ) { const planes = this.planes; @@ -14002,9 +13913,9 @@ Object.assign( Frustum.prototype, { return this; - }, + } - setFromProjectionMatrix: function ( m ) { + setFromProjectionMatrix( m ) { const planes = this.planes; const me = m.elements; @@ -14022,9 +13933,9 @@ Object.assign( Frustum.prototype, { return this; - }, + } - intersectsObject: function ( object ) { + intersectsObject( object ) { const geometry = object.geometry; @@ -14034,9 +13945,9 @@ Object.assign( Frustum.prototype, { return this.intersectsSphere( _sphere$1 ); - }, + } - intersectsSprite: function ( sprite ) { + intersectsSprite( sprite ) { _sphere$1.center.set( 0, 0, 0 ); _sphere$1.radius = 0.7071067811865476; @@ -14044,9 +13955,9 @@ Object.assign( Frustum.prototype, { return this.intersectsSphere( _sphere$1 ); - }, + } - intersectsSphere: function ( sphere ) { + intersectsSphere( sphere ) { const planes = this.planes; const center = sphere.center; @@ -14066,9 +13977,9 @@ Object.assign( Frustum.prototype, { return true; - }, + } - intersectsBox: function ( box ) { + intersectsBox( box ) { const planes = this.planes; @@ -14092,9 +14003,9 @@ Object.assign( Frustum.prototype, { return true; - }, + } - containsPoint: function ( point ) { + containsPoint( point ) { const planes = this.planes; @@ -14112,213 +14023,7 @@ Object.assign( Frustum.prototype, { } -} ); - -/** - * Uniforms library for shared webgl shaders - */ - -const UniformsLib = { - - common: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - - map: { value: null }, - uvTransform: { value: new Matrix3() }, - uv2Transform: { value: new Matrix3() }, - - alphaMap: { value: null }, - - }, - - specularmap: { - - specularMap: { value: null }, - - }, - - envmap: { - - envMap: { value: null }, - flipEnvMap: { value: - 1 }, - reflectivity: { value: 1.0 }, - refractionRatio: { value: 0.98 }, - maxMipLevel: { value: 0 } - - }, - - aomap: { - - aoMap: { value: null }, - aoMapIntensity: { value: 1 } - - }, - - lightmap: { - - lightMap: { value: null }, - lightMapIntensity: { value: 1 } - - }, - - emissivemap: { - - emissiveMap: { value: null } - - }, - - bumpmap: { - - bumpMap: { value: null }, - bumpScale: { value: 1 } - - }, - - normalmap: { - - normalMap: { value: null }, - normalScale: { value: new Vector2( 1, 1 ) } - - }, - - displacementmap: { - - displacementMap: { value: null }, - displacementScale: { value: 1 }, - displacementBias: { value: 0 } - - }, - - roughnessmap: { - - roughnessMap: { value: null } - - }, - - metalnessmap: { - - metalnessMap: { value: null } - - }, - - gradientmap: { - - gradientMap: { value: null } - - }, - - fog: { - - fogDensity: { value: 0.00025 }, - fogNear: { value: 1 }, - fogFar: { value: 2000 }, - fogColor: { value: new Color( 0xffffff ) } - - }, - - lights: { - - ambientLightColor: { value: [] }, - - lightProbe: { value: [] }, - - directionalLights: { value: [], properties: { - direction: {}, - color: {} - } }, - - directionalLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - directionalShadowMap: { value: [] }, - directionalShadowMatrix: { value: [] }, - - spotLights: { value: [], properties: { - color: {}, - position: {}, - direction: {}, - distance: {}, - coneCos: {}, - penumbraCos: {}, - decay: {} - } }, - - spotLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - spotShadowMap: { value: [] }, - spotShadowMatrix: { value: [] }, - - pointLights: { value: [], properties: { - color: {}, - position: {}, - decay: {}, - distance: {} - } }, - - pointLightShadows: { value: [], properties: { - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {}, - shadowCameraNear: {}, - shadowCameraFar: {} - } }, - - pointShadowMap: { value: [] }, - pointShadowMatrix: { value: [] }, - - hemisphereLights: { value: [], properties: { - direction: {}, - skyColor: {}, - groundColor: {} - } }, - - // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src - rectAreaLights: { value: [], properties: { - color: {}, - position: {}, - width: {}, - height: {} - } } - - }, - - points: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - size: { value: 1.0 }, - scale: { value: 1.0 }, - map: { value: null }, - alphaMap: { value: null }, - uvTransform: { value: new Matrix3() } - - }, - - sprite: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - center: { value: new Vector2( 0.5, 0.5 ) }, - rotation: { value: 0.0 }, - map: { value: null }, - alphaMap: { value: null }, - uvTransform: { value: new Matrix3() } - - } - -}; +} function WebGLAnimation() { @@ -14496,6 +14201,25 @@ function WebGLAttributes( gl, capabilities ) { function update( attribute, bufferType ) { + if ( attribute.isGLBufferAttribute ) { + + var cached = buffers.get( attribute ); + + if ( ! cached || cached.version < attribute.version ) { + + buffers.set( attribute, { + buffer: attribute.buffer, + type: attribute.type, + bytesPerElement: attribute.elementSize, + version: attribute.version + } ); + + } + + return; + + } + if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; const data = buffers.get( attribute ); @@ -14526,117 +14250,118 @@ function WebGLAttributes( gl, capabilities ) { // PlaneGeometry -function PlaneGeometry( width, height, widthSegments, heightSegments ) { +class PlaneGeometry extends Geometry { - Geometry.call( this ); + constructor( width, height, widthSegments, heightSegments ) { + + super(); - this.type = 'PlaneGeometry'; + this.type = 'PlaneGeometry'; - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; - this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); - this.mergeVertices(); + this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); + this.mergeVertices(); -} + } -PlaneGeometry.prototype = Object.create( Geometry.prototype ); -PlaneGeometry.prototype.constructor = PlaneGeometry; +} // PlaneBufferGeometry -function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { +class PlaneBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( width, height, widthSegments, heightSegments ) { - this.type = 'PlaneBufferGeometry'; + super(); + this.type = 'PlaneBufferGeometry'; - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; + this.parameters = { + width: width, + height: height, + widthSegments: widthSegments, + heightSegments: heightSegments + }; - width = width || 1; - height = height || 1; + width = width || 1; + height = height || 1; - const width_half = width / 2; - const height_half = height / 2; + const width_half = width / 2; + const height_half = height / 2; - const gridX = Math.floor( widthSegments ) || 1; - const gridY = Math.floor( heightSegments ) || 1; + const gridX = Math.floor( widthSegments ) || 1; + const gridY = Math.floor( heightSegments ) || 1; - const gridX1 = gridX + 1; - const gridY1 = gridY + 1; + const gridX1 = gridX + 1; + const gridY1 = gridY + 1; - const segment_width = width / gridX; - const segment_height = height / gridY; + const segment_width = width / gridX; + const segment_height = height / gridY; - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( let iy = 0; iy < gridY1; iy ++ ) { + for ( let iy = 0; iy < gridY1; iy ++ ) { - const y = iy * segment_height - height_half; + const y = iy * segment_height - height_half; - for ( let ix = 0; ix < gridX1; ix ++ ) { + for ( let ix = 0; ix < gridX1; ix ++ ) { - const x = ix * segment_width - width_half; + const x = ix * segment_width - width_half; - vertices.push( x, - y, 0 ); + vertices.push( x, - y, 0 ); - normals.push( 0, 0, 1 ); + normals.push( 0, 0, 1 ); + + uvs.push( ix / gridX ); + uvs.push( 1 - ( iy / gridY ) ); - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); + } } - } + // indices - // indices + for ( let iy = 0; iy < gridY; iy ++ ) { - for ( let iy = 0; iy < gridY; iy ++ ) { + for ( let ix = 0; ix < gridX; ix ++ ) { - for ( let ix = 0; ix < gridX; ix ++ ) { + const a = ix + gridX1 * iy; + const b = ix + gridX1 * ( iy + 1 ); + const c = ( ix + 1 ) + gridX1 * ( iy + 1 ); + const d = ( ix + 1 ) + gridX1 * iy; - const a = ix + gridX1 * iy; - const b = ix + gridX1 * ( iy + 1 ); - const c = ( ix + 1 ) + gridX1 * ( iy + 1 ); - const d = ( ix + 1 ) + gridX1 * iy; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } } -PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; - var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif"; var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif"; @@ -14689,7 +14414,7 @@ var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; var encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}"; -var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; +var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif"; var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif"; @@ -14717,7 +14442,7 @@ var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geome var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif"; -var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif"; +var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif"; var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; @@ -15028,6 +14753,215 @@ const ShaderChunk = { sprite_vert: sprite_vert }; +/** + * Uniforms library for shared webgl shaders + */ + +const UniformsLib = { + + common: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + + map: { value: null }, + uvTransform: { value: new Matrix3() }, + uv2Transform: { value: new Matrix3() }, + + alphaMap: { value: null }, + + }, + + specularmap: { + + specularMap: { value: null }, + + }, + + envmap: { + + envMap: { value: null }, + flipEnvMap: { value: - 1 }, + reflectivity: { value: 1.0 }, + refractionRatio: { value: 0.98 }, + maxMipLevel: { value: 0 } + + }, + + aomap: { + + aoMap: { value: null }, + aoMapIntensity: { value: 1 } + + }, + + lightmap: { + + lightMap: { value: null }, + lightMapIntensity: { value: 1 } + + }, + + emissivemap: { + + emissiveMap: { value: null } + + }, + + bumpmap: { + + bumpMap: { value: null }, + bumpScale: { value: 1 } + + }, + + normalmap: { + + normalMap: { value: null }, + normalScale: { value: new Vector2( 1, 1 ) } + + }, + + displacementmap: { + + displacementMap: { value: null }, + displacementScale: { value: 1 }, + displacementBias: { value: 0 } + + }, + + roughnessmap: { + + roughnessMap: { value: null } + + }, + + metalnessmap: { + + metalnessMap: { value: null } + + }, + + gradientmap: { + + gradientMap: { value: null } + + }, + + fog: { + + fogDensity: { value: 0.00025 }, + fogNear: { value: 1 }, + fogFar: { value: 2000 }, + fogColor: { value: new Color( 0xffffff ) } + + }, + + lights: { + + ambientLightColor: { value: [] }, + + lightProbe: { value: [] }, + + directionalLights: { value: [], properties: { + direction: {}, + color: {} + } }, + + directionalLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + directionalShadowMap: { value: [] }, + directionalShadowMatrix: { value: [] }, + + spotLights: { value: [], properties: { + color: {}, + position: {}, + direction: {}, + distance: {}, + coneCos: {}, + penumbraCos: {}, + decay: {} + } }, + + spotLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {} + } }, + + spotShadowMap: { value: [] }, + spotShadowMatrix: { value: [] }, + + pointLights: { value: [], properties: { + color: {}, + position: {}, + decay: {}, + distance: {} + } }, + + pointLightShadows: { value: [], properties: { + shadowBias: {}, + shadowNormalBias: {}, + shadowRadius: {}, + shadowMapSize: {}, + shadowCameraNear: {}, + shadowCameraFar: {} + } }, + + pointShadowMap: { value: [] }, + pointShadowMatrix: { value: [] }, + + hemisphereLights: { value: [], properties: { + direction: {}, + skyColor: {}, + groundColor: {} + } }, + + // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src + rectAreaLights: { value: [], properties: { + color: {}, + position: {}, + width: {}, + height: {} + } }, + + ltc_1: { value: null }, + ltc_2: { value: null } + + }, + + points: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + size: { value: 1.0 }, + scale: { value: 1.0 }, + map: { value: null }, + alphaMap: { value: null }, + uvTransform: { value: new Matrix3() } + + }, + + sprite: { + + diffuse: { value: new Color( 0xeeeeee ) }, + opacity: { value: 1.0 }, + center: { value: new Vector2( 0.5, 0.5 ) }, + rotation: { value: 0.0 }, + map: { value: null }, + alphaMap: { value: null }, + uvTransform: { value: new Matrix3() } + + } + +}; + const ShaderLib = { basic: { @@ -15329,7 +15263,7 @@ ShaderLib.physical = { }; -function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { +function WebGLBackground( renderer, cubemaps, state, objects, premultipliedAlpha ) { const clearColor = new Color( 0x000000 ); let clearAlpha = 0; @@ -15345,6 +15279,12 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { let background = scene.isScene === true ? scene.background : null; + if ( background && background.isTexture ) { + + background = cubemaps.get( background ); + + } + // Ignore background in AR // TODO: Reconsider this. @@ -15374,7 +15314,7 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { } - if ( background && ( background.isCubeTexture || background.isWebGLCubeRenderTarget || background.mapping === CubeUVReflectionMapping ) ) { + if ( background && ( background.isCubeTexture || background.isWebGLCubeRenderTarget || background.isWebGLCubeRenderTargetTexture || background.mapping === CubeUVReflectionMapping ) ) { if ( boxMesh === undefined ) { @@ -15416,19 +15356,25 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { } - const texture = background.isWebGLCubeRenderTarget ? background.texture : background; + if ( background.isWebGLCubeRenderTarget ) { - boxMesh.material.uniforms.envMap.value = texture; - boxMesh.material.uniforms.flipEnvMap.value = texture.isCubeTexture ? - 1 : 1; + // TODO Deprecate + + background = background.texture; + + } + + boxMesh.material.uniforms.envMap.value = background; + boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture ? - 1 : 1; if ( currentBackground !== background || - currentBackgroundVersion !== texture.version || + currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping ) { boxMesh.material.needsUpdate = true; currentBackground = background; - currentBackgroundVersion = texture.version; + currentBackgroundVersion = background.version; currentTonemapping = renderer.toneMapping; } @@ -15565,9 +15511,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) { } - updateBuffers = needsUpdate( geometry ); + updateBuffers = needsUpdate( geometry, index ); - if ( updateBuffers ) saveCache( geometry ); + if ( updateBuffers ) saveCache( geometry, index ); } else { @@ -15697,13 +15643,14 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) { enabledAttributes: enabledAttributes, attributeDivisors: attributeDivisors, object: vao, - attributes: {} + attributes: {}, + index: null }; } - function needsUpdate( geometry ) { + function needsUpdate( geometry, index ) { const cachedAttributes = currentState.attributes; const geometryAttributes = geometry.attributes; @@ -15715,17 +15662,23 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) { const cachedAttribute = cachedAttributes[ key ]; const geometryAttribute = geometryAttributes[ key ]; + if ( geometryAttribute.isGLBufferAttribute ) return true; + + if ( cachedAttribute === undefined ) return true; + if ( cachedAttribute.attribute !== geometryAttribute ) return true; if ( cachedAttribute.data !== geometryAttribute.data ) return true; } + if ( currentState.index !== index ) return true; + return false; } - function saveCache( geometry ) { + function saveCache( geometry, index ) { const cache = {}; const attributes = geometry.attributes; @@ -15749,6 +15702,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) { currentState.attributes = cache; + currentState.index = index; + } function initAttributes() { @@ -16285,7 +16240,7 @@ function WebGLCapabilities( gl, extensions, parameters ) { } -function WebGLClipping() { +function WebGLClipping( properties ) { const scope = this; @@ -16336,7 +16291,13 @@ function WebGLClipping() { }; - this.setState = function ( planes, clipIntersection, clipShadows, camera, cache, fromCache ) { + this.setState = function ( material, camera, useCache ) { + + const planes = material.clippingPlanes, + clipIntersection = material.clipIntersection, + clipShadows = material.clipShadows; + + const materialProperties = properties.get( material ); if ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) { @@ -16359,11 +16320,11 @@ function WebGLClipping() { const nGlobal = renderingShadows ? 0 : numGlobalPlanes, lGlobal = nGlobal * 4; - let dstArray = cache.clippingState || null; + let dstArray = materialProperties.clippingState || null; uniform.value = dstArray; // ensure unique state - dstArray = projectPlanes( planes, camera, lGlobal, fromCache ); + dstArray = projectPlanes( planes, camera, lGlobal, useCache ); for ( let i = 0; i !== lGlobal; ++ i ) { @@ -16371,7 +16332,7 @@ function WebGLClipping() { } - cache.clippingState = dstArray; + materialProperties.clippingState = dstArray; this.numIntersection = clipIntersection ? this.numPlanes : 0; this.numPlanes += nGlobal; @@ -16441,6 +16402,82 @@ function WebGLClipping() { } +function WebGLCubeMaps( renderer ) { + + let cubemaps = new WeakMap(); + + function mapTextureMapping( texture, mapping ) { + + if ( mapping === EquirectangularReflectionMapping ) { + + texture.mapping = CubeReflectionMapping; + + } else if ( mapping === EquirectangularRefractionMapping ) { + + texture.mapping = CubeRefractionMapping; + + } + + return texture; + + } + + function get( texture ) { + + if ( texture && texture.isTexture ) { + + const mapping = texture.mapping; + + if ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) { + + if ( cubemaps.has( texture ) ) { + + const cubemap = cubemaps.get( texture ).texture; + return mapTextureMapping( cubemap, texture.mapping ); + + } else { + + const image = texture.image; + + if ( image && image.height > 0 ) { + + const renderTarget = new WebGLCubeRenderTarget( image.height / 2 ); + renderTarget.fromEquirectangularTexture( renderer, texture ); + cubemaps.set( texture, renderTarget ); + + return mapTextureMapping( renderTarget.texture, texture.mapping ); + + } else { + + // image not yet ready. try the conversion next frame + + return null; + + } + + } + + } + + } + + return texture; + + } + + function dispose() { + + cubemaps = new WeakMap(); + + } + + return { + get: get, + dispose: dispose + }; + +} + function WebGLExtensions( gl ) { const extensions = {}; @@ -18258,7 +18295,7 @@ function includeReplacer( match, include ) { // Unroll Loops const deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; -const unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g; +const unrollLoopPattern = /#pragma unroll_loop_start[\s]+?for\s*\(\s*int i \= (\d+)\; i < (\d+)\; i\s*\+\+\s*\)\s*{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g; function unrollLoops( string ) { @@ -18355,11 +18392,6 @@ function generateEnvMapTypeDefine( parameters ) { envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; break; - case EquirectangularReflectionMapping: - case EquirectangularRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_EQUIREC'; - break; - } } @@ -18377,7 +18409,6 @@ function generateEnvMapModeDefine( parameters ) { switch ( parameters.envMapMode ) { case CubeRefractionMapping: - case EquirectangularRefractionMapping: case CubeUVRefractionMapping: envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; @@ -18443,6 +18474,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { const program = gl.createProgram(); let prefixVertex, prefixFragment; + let versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + "\n" : ''; if ( parameters.isRawShaderMaterial ) { @@ -18712,20 +18744,20 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { if ( parameters.isWebGL2 && ! parameters.isRawShaderMaterial ) { - // GLSL 3.0 conversion + // GLSL 3.0 conversion for built-in materials and ShaderMaterial + + versionString = '#version 300 es\n'; prefixVertex = [ - '#version 300 es\n', '#define attribute in', '#define varying out', '#define texture2D texture' ].join( '\n' ) + '\n' + prefixVertex; prefixFragment = [ - '#version 300 es\n', '#define varying in', - 'out highp vec4 pc_fragColor;', - '#define gl_FragColor pc_fragColor', + ( parameters.glslVersion === GLSL3 ) ? '' : 'out highp vec4 pc_fragColor;', + ( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor', '#define gl_FragDepthEXT gl_FragDepth', '#define texture2D texture', '#define textureCube texture', @@ -18740,8 +18772,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { } - const vertexGlsl = prefixVertex + vertexShader; - const fragmentGlsl = prefixFragment + fragmentShader; + const vertexGlsl = versionString + prefixVertex + vertexShader; + const fragmentGlsl = versionString + prefixFragment + fragmentShader; // console.log( '*VERTEX*', vertexGlsl ); // console.log( '*FRAGMENT*', fragmentGlsl ); @@ -18890,7 +18922,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) { } -function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { +function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingStates, clipping ) { const programs = []; @@ -18936,7 +18968,7 @@ function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { "sheen", "transmissionMap" ]; - function allocateBones( object ) { + function getMaxBones( object ) { const skeleton = object.skeleton; const bones = skeleton.bones; @@ -18995,19 +19027,19 @@ function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { } - function getParameters( material, lights, shadows, scene, nClipPlanes, nClipIntersection, object ) { + function getParameters( material, lights, shadows, scene, object ) { const fog = scene.fog; const environment = material.isMeshStandardMaterial ? scene.environment : null; - const envMap = material.envMap || environment; + const envMap = cubemaps.get( material.envMap || environment ); const shaderID = shaderIDs[ material.type ]; // heuristics to create shader parameters according to lights in the scene // (not to blow over maxLights budget) - const maxBones = object.isSkinnedMesh ? allocateBones( object ) : 0; + const maxBones = object.isSkinnedMesh ? getMaxBones( object ) : 0; if ( material.precision !== null ) { @@ -19127,8 +19159,8 @@ function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { numPointLightShadows: lights.pointShadowMap.length, numSpotLightShadows: lights.spotShadowMap.length, - numClippingPlanes: nClipPlanes, - numClipIntersection: nClipIntersection, + numClippingPlanes: clipping.numPlanes, + numClipIntersection: clipping.numIntersection, dithering: material.dithering, @@ -19157,7 +19189,9 @@ function WebGLPrograms( renderer, extensions, capabilities, bindingStates ) { rendererExtensionDrawBuffers: isWebGL2 || extensions.get( 'WEBGL_draw_buffers' ) !== null, rendererExtensionShaderTextureLod: isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) !== null, - customProgramCacheKey: material.customProgramCacheKey() + customProgramCacheKey: material.customProgramCacheKey(), + + glslVersion: material.glslVersion }; @@ -19730,6 +19764,8 @@ function WebGLLights() { spotShadowMap: [], spotShadowMatrix: [], rectArea: [], + rectAreaLTC1: null, + rectAreaLTC2: null, point: [], pointShadow: [], pointShadowMap: [], @@ -19950,6 +19986,13 @@ function WebGLLights() { } + if ( rectAreaLength > 0 ) { + + state.rectAreaLTC1 = UniformsLib.LTC_1; + state.rectAreaLTC2 = UniformsLib.LTC_2; + + } + state.ambient[ 0 ] = r; state.ambient[ 1 ] = g; state.ambient[ 2 ] = b; @@ -23877,7 +23920,7 @@ function WebGLMaterials( properties ) { } - function refreshMaterialUniforms( uniforms, material, environment, pixelRatio, height ) { + function refreshMaterialUniforms( uniforms, material, pixelRatio, height ) { if ( material.isMeshBasicMaterial ) { @@ -23900,15 +23943,15 @@ function WebGLMaterials( properties ) { } else if ( material.isMeshStandardMaterial ) { - refreshUniformsCommon( uniforms, material, environment ); + refreshUniformsCommon( uniforms, material ); if ( material.isMeshPhysicalMaterial ) { - refreshUniformsPhysical( uniforms, material, environment ); + refreshUniformsPhysical( uniforms, material ); } else { - refreshUniformsStandard( uniforms, material, environment ); + refreshUniformsStandard( uniforms, material ); } @@ -23963,7 +24006,7 @@ function WebGLMaterials( properties ) { } - function refreshUniformsCommon( uniforms, material, environment ) { + function refreshUniformsCommon( uniforms, material ) { uniforms.opacity.value = material.opacity; @@ -23997,7 +24040,7 @@ function WebGLMaterials( properties ) { } - const envMap = material.envMap || environment; + const envMap = properties.get( material ).envMap; if ( envMap ) { @@ -24008,7 +24051,7 @@ function WebGLMaterials( properties ) { uniforms.reflectivity.value = material.reflectivity; uniforms.refractionRatio.value = material.refractionRatio; - var maxMipLevel = properties.get( envMap ).__maxMipLevel; + const maxMipLevel = properties.get( envMap ).__maxMipLevel; if ( maxMipLevel !== undefined ) { @@ -24335,7 +24378,7 @@ function WebGLMaterials( properties ) { } - function refreshUniformsStandard( uniforms, material, environment ) { + function refreshUniformsStandard( uniforms, material ) { uniforms.roughness.value = material.roughness; uniforms.metalness.value = material.metalness; @@ -24382,7 +24425,9 @@ function WebGLMaterials( properties ) { } - if ( material.envMap || environment ) { + const envMap = properties.get( material ).envMap; + + if ( envMap ) { //uniforms.envMap.value = material.envMap; // part of uniforms common uniforms.envMapIntensity.value = material.envMapIntensity; @@ -24391,9 +24436,9 @@ function WebGLMaterials( properties ) { } - function refreshUniformsPhysical( uniforms, material, environment ) { + function refreshUniformsPhysical( uniforms, material ) { - refreshUniformsStandard( uniforms, material, environment ); + refreshUniformsStandard( uniforms, material ); uniforms.reflectivity.value = material.reflectivity; // also part of uniforms common @@ -24643,7 +24688,6 @@ function WebGLRenderer( parameters ) { // clipping - const _clipping = new WebGLClipping(); let _clippingEnabled = false; let _localClippingEnabled = false; @@ -24745,8 +24789,8 @@ function WebGLRenderer( parameters ) { } let extensions, capabilities, state, info; - let properties, textures, attributes, geometries, objects; - let programCache, materials, renderLists, renderStates; + let properties, textures, cubemaps, attributes, geometries, objects; + let programCache, materials, renderLists, renderStates, clipping; let background, morphtargets, bufferRenderer, indexedBufferRenderer; @@ -24782,17 +24826,18 @@ function WebGLRenderer( parameters ) { info = new WebGLInfo( _gl ); properties = new WebGLProperties(); textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ); + cubemaps = new WebGLCubeMaps( _this ); attributes = new WebGLAttributes( _gl, capabilities ); bindingStates = new WebGLBindingStates( _gl, extensions, attributes, capabilities ); geometries = new WebGLGeometries( _gl, attributes, info, bindingStates ); objects = new WebGLObjects( _gl, geometries, attributes, info ); morphtargets = new WebGLMorphtargets( _gl ); - programCache = new WebGLPrograms( _this, extensions, capabilities, bindingStates ); + clipping = new WebGLClipping( properties ); + programCache = new WebGLPrograms( _this, cubemaps, extensions, capabilities, bindingStates, clipping ); materials = new WebGLMaterials( properties ); renderLists = new WebGLRenderLists( properties ); renderStates = new WebGLRenderStates(); - - background = new WebGLBackground( _this, state, objects, _premultipliedAlpha ); + background = new WebGLBackground( _this, cubemaps, state, objects, _premultipliedAlpha ); bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities ); indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities ); @@ -25082,6 +25127,7 @@ function WebGLRenderer( parameters ) { renderLists.dispose(); renderStates.dispose(); properties.dispose(); + cubemaps.dispose(); objects.dispose(); bindingStates.dispose(); @@ -25504,7 +25550,7 @@ function WebGLRenderer( parameters ) { _frustum.setFromProjectionMatrix( _projScreenMatrix ); _localClippingEnabled = this.localClippingEnabled; - _clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); + _clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); currentRenderList = renderLists.get( scene, camera ); currentRenderList.init(); @@ -25521,7 +25567,7 @@ function WebGLRenderer( parameters ) { // - if ( _clippingEnabled === true ) _clipping.beginShadows(); + if ( _clippingEnabled === true ) clipping.beginShadows(); const shadowsArray = currentRenderState.state.shadowsArray; @@ -25529,7 +25575,7 @@ function WebGLRenderer( parameters ) { currentRenderState.setupLights( camera ); - if ( _clippingEnabled === true ) _clipping.endShadows(); + if ( _clippingEnabled === true ) clipping.endShadows(); // @@ -25798,7 +25844,7 @@ function WebGLRenderer( parameters ) { const lightsStateVersion = lights.state.version; - const parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, _clipping.numPlanes, _clipping.numIntersection, object ); + const parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object ); const programCacheKey = programCache.getProgramCacheKey( parameters ); let program = materialProperties.program; @@ -25822,7 +25868,11 @@ function WebGLRenderer( parameters ) { } else if ( parameters.shaderID !== undefined ) { - // same glsl and uniform list + // same glsl and uniform list, envMap still needs the update here to avoid a frame-late effect + + const environment = material.isMeshStandardMaterial ? scene.environment : null; + materialProperties.envMap = cubemaps.get( material.envMap || environment ); + return; } else { @@ -25886,14 +25936,15 @@ function WebGLRenderer( parameters ) { ! material.isRawShaderMaterial || material.clipping === true ) { - materialProperties.numClippingPlanes = _clipping.numPlanes; - materialProperties.numIntersection = _clipping.numIntersection; - uniforms.clippingPlanes = _clipping.uniform; + materialProperties.numClippingPlanes = clipping.numPlanes; + materialProperties.numIntersection = clipping.numIntersection; + uniforms.clippingPlanes = clipping.uniform; } materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; materialProperties.fog = scene.fog; + materialProperties.envMap = cubemaps.get( material.envMap || materialProperties.environment ); // store the light setup it was created for @@ -25911,6 +25962,8 @@ function WebGLRenderer( parameters ) { uniforms.spotLights.value = lights.state.spot; uniforms.spotLightShadows.value = lights.state.spotShadow; uniforms.rectAreaLights.value = lights.state.rectArea; + uniforms.ltc_1.value = lights.state.rectAreaLTC1; + uniforms.ltc_2.value = lights.state.rectAreaLTC2; uniforms.pointLights.value = lights.state.point; uniforms.pointLightShadows.value = lights.state.pointShadow; uniforms.hemisphereLights.value = lights.state.hemi; @@ -25925,9 +25978,8 @@ function WebGLRenderer( parameters ) { } - const progUniforms = materialProperties.program.getUniforms(), - uniformsList = - WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); + const progUniforms = materialProperties.program.getUniforms(); + const uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); materialProperties.uniformsList = uniformsList; @@ -25942,6 +25994,7 @@ function WebGLRenderer( parameters ) { const fog = scene.fog; const environment = material.isMeshStandardMaterial ? scene.environment : null; const encoding = ( _currentRenderTarget === null ) ? _this.outputEncoding : _currentRenderTarget.texture.encoding; + const envMap = cubemaps.get( material.envMap || environment ); const materialProperties = properties.get( material ); const lights = currentRenderState.state.lights; @@ -25957,9 +26010,7 @@ function WebGLRenderer( parameters ) { // we might want to call this function with some ClippingGroup // object instead of the material, once it becomes feasible // (#8465, #8379) - _clipping.setState( - material.clippingPlanes, material.clipIntersection, material.clipShadows, - camera, materialProperties, useCache ); + clipping.setState( material, camera, useCache ); } @@ -25967,11 +26018,7 @@ function WebGLRenderer( parameters ) { if ( material.version === materialProperties.__version ) { - if ( materialProperties.program === undefined ) { - - initMaterial( material, scene, object ); - - } else if ( material.fog && materialProperties.fog !== fog ) { + if ( material.fog && materialProperties.fog !== fog ) { initMaterial( material, scene, object ); @@ -25984,8 +26031,8 @@ function WebGLRenderer( parameters ) { initMaterial( material, scene, object ); } else if ( materialProperties.numClippingPlanes !== undefined && - ( materialProperties.numClippingPlanes !== _clipping.numPlanes || - materialProperties.numIntersection !== _clipping.numIntersection ) ) { + ( materialProperties.numClippingPlanes !== clipping.numPlanes || + materialProperties.numIntersection !== clipping.numIntersection ) ) { initMaterial( material, scene, object ); @@ -25993,6 +26040,10 @@ function WebGLRenderer( parameters ) { initMaterial( material, scene, object ); + } else if ( materialProperties.envMap !== envMap ) { + + initMaterial( material, scene, object ); + } } else { @@ -26185,13 +26236,7 @@ function WebGLRenderer( parameters ) { } - materials.refreshMaterialUniforms( m_uniforms, material, environment, _pixelRatio, _height ); - - // RectAreaLight Texture - // TODO (mrdoob): Find a nicer implementation - - if ( m_uniforms.ltc_1 !== undefined ) m_uniforms.ltc_1.value = UniformsLib.LTC_1; - if ( m_uniforms.ltc_2 !== undefined ) m_uniforms.ltc_2.value = UniformsLib.LTC_2; + materials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height ); WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); @@ -26267,6 +26312,30 @@ function WebGLRenderer( parameters ) { }; + this.getRenderList = function () { + + return currentRenderList; + + }; + + this.setRenderList = function ( renderList ) { + + currentRenderList = renderList; + + }; + + this.getRenderState = function () { + + return currentRenderState; + + }; + + this.setRenderState = function ( renderState ) { + + currentRenderState = renderState; + + }; + this.getRenderTarget = function () { return _currentRenderTarget; @@ -26509,26 +26578,24 @@ WebGL1Renderer.prototype = Object.assign( Object.create( WebGLRenderer.prototype } ); -function FogExp2( color, density ) { +class FogExp2 { - this.name = ''; + constructor( color, density ) { - this.color = new Color( color ); - this.density = ( density !== undefined ) ? density : 0.00025; + this.name = ''; -} - -Object.assign( FogExp2.prototype, { + this.color = new Color( color ); + this.density = ( density !== undefined ) ? density : 0.00025; - isFogExp2: true, + } - clone: function () { + clone() { return new FogExp2( this.color, this.density ); - }, + } - toJSON: function ( /* meta */ ) { + toJSON( /* meta */ ) { return { type: 'FogExp2', @@ -26538,30 +26605,30 @@ Object.assign( FogExp2.prototype, { } -} ); +} -function Fog( color, near, far ) { +FogExp2.prototype.isFogExp2 = true; - this.name = ''; +class Fog { - this.color = new Color( color ); + constructor( color, near, far ) { - this.near = ( near !== undefined ) ? near : 1; - this.far = ( far !== undefined ) ? far : 1000; + this.name = ''; -} + this.color = new Color( color ); -Object.assign( Fog.prototype, { + this.near = ( near !== undefined ) ? near : 1; + this.far = ( far !== undefined ) ? far : 1000; - isFog: true, + } - clone: function () { + clone() { return new Fog( this.color, this.near, this.far ); - }, + } - toJSON: function ( /* meta */ ) { + toJSON( /* meta */ ) { return { type: 'Fog', @@ -26572,7 +26639,65 @@ Object.assign( Fog.prototype, { } -} ); +} + +Fog.prototype.isFog = true; + +class Scene extends Object3D { + + constructor() { + + super(); + this.type = 'Scene'; + + this.background = null; + this.environment = null; + this.fog = null; + + this.overrideMaterial = null; + + this.autoUpdate = true; // checked by the renderer + + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef + + } + + } + + copy( source, recursive ) { + + super.copy( source, recursive ); + + if ( source.background !== null ) this.background = source.background.clone(); + if ( source.environment !== null ) this.environment = source.environment.clone(); + if ( source.fog !== null ) this.fog = source.fog.clone(); + + if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); + + this.autoUpdate = source.autoUpdate; + this.matrixAutoUpdate = source.matrixAutoUpdate; + + return this; + + } + + toJSON( meta ) { + + const data = super.toJSON( meta ); + + if ( this.background !== null ) data.object.background = this.background.toJSON( meta ); + if ( this.environment !== null ) data.object.environment = this.environment.toJSON( meta ); + if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); + + return data; + + } + +} + +Scene.prototype.isScene = true; function InterleavedBuffer( array, stride ) { @@ -28637,107 +28762,110 @@ DepthTexture.prototype = Object.create( Texture.prototype ); DepthTexture.prototype.constructor = DepthTexture; DepthTexture.prototype.isDepthTexture = true; -function WireframeGeometry( geometry ) { +class WireframeGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( geometry ) { - this.type = 'WireframeGeometry'; + super(); + this.type = 'WireframeGeometry'; - // buffer + // buffer - const vertices = []; + const vertices = []; - // helper variables + // helper variables - const edge = [ 0, 0 ], edges = {}; - const keys = [ 'a', 'b', 'c' ]; + const edge = [ 0, 0 ], edges = {}; + const keys = [ 'a', 'b', 'c' ]; - // different logic for Geometry and BufferGeometry + // different logic for Geometry and BufferGeometry - if ( geometry && geometry.isGeometry ) { + if ( geometry && geometry.isGeometry ) { - // create a data structure that contains all edges without duplicates + // create a data structure that contains all edges without duplicates - const faces = geometry.faces; + const faces = geometry.faces; - for ( let i = 0, l = faces.length; i < l; i ++ ) { + for ( let i = 0, l = faces.length; i < l; i ++ ) { - const face = faces[ i ]; + const face = faces[ i ]; - for ( let j = 0; j < 3; j ++ ) { + for ( let j = 0; j < 3; j ++ ) { - const edge1 = face[ keys[ j ] ]; - const edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); + const edge1 = face[ keys[ j ] ]; + const edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; + edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates + edge[ 1 ] = Math.max( edge1, edge2 ); - const key = edge[ 0 ] + ',' + edge[ 1 ]; + const key = edge[ 0 ] + ',' + edge[ 1 ]; - if ( edges[ key ] === undefined ) { + if ( edges[ key ] === undefined ) { + + edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + } } } - } + // generate vertices - // generate vertices + for ( const key in edges ) { - for ( const key in edges ) { + const e = edges[ key ]; - const e = edges[ key ]; + let vertex = geometry.vertices[ e.index1 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - let vertex = geometry.vertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex = geometry.vertices[ e.index2 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex = geometry.vertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + } - } + } else if ( geometry && geometry.isBufferGeometry ) { - } else if ( geometry && geometry.isBufferGeometry ) { + const vertex = new Vector3(); - const vertex = new Vector3(); + if ( geometry.index !== null ) { - if ( geometry.index !== null ) { + // indexed BufferGeometry - // indexed BufferGeometry + const position = geometry.attributes.position; + const indices = geometry.index; + let groups = geometry.groups; - const position = geometry.attributes.position; - const indices = geometry.index; - let groups = geometry.groups; + if ( groups.length === 0 ) { - if ( groups.length === 0 ) { + groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; - groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; + } - } + // create a data structure that contains all eges without duplicates - // create a data structure that contains all eges without duplicates + for ( let o = 0, ol = groups.length; o < ol; ++ o ) { - for ( let o = 0, ol = groups.length; o < ol; ++ o ) { + const group = groups[ o ]; - const group = groups[ o ]; + const start = group.start; + const count = group.count; - const start = group.start; - const count = group.count; + for ( let i = start, l = ( start + count ); i < l; i += 3 ) { - for ( let i = start, l = ( start + count ); i < l; i += 3 ) { + for ( let j = 0; j < 3; j ++ ) { - for ( let j = 0; j < 3; j ++ ) { + const edge1 = indices.getX( i + j ); + const edge2 = indices.getX( i + ( j + 1 ) % 3 ); + edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates + edge[ 1 ] = Math.max( edge1, edge2 ); - const edge1 = indices.getX( i + j ); - const edge2 = indices.getX( i + ( j + 1 ) % 3 ); - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); + const key = edge[ 0 ] + ',' + edge[ 1 ]; - const key = edge[ 0 ] + ',' + edge[ 1 ]; + if ( edges[ key ] === undefined ) { - if ( edges[ key ] === undefined ) { + edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; + } } @@ -28745,42 +28873,42 @@ function WireframeGeometry( geometry ) { } - } + // generate vertices - // generate vertices + for ( const key in edges ) { - for ( const key in edges ) { + const e = edges[ key ]; - const e = edges[ key ]; + vertex.fromBufferAttribute( position, e.index1 ); + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex.fromBufferAttribute( position, e.index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex.fromBufferAttribute( position, e.index2 ); + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex.fromBufferAttribute( position, e.index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + } - } + } else { - } else { + // non-indexed BufferGeometry - // non-indexed BufferGeometry + const position = geometry.attributes.position; - const position = geometry.attributes.position; + for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) { - for ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) { + for ( let j = 0; j < 3; j ++ ) { - for ( let j = 0; j < 3; j ++ ) { + // three edges per triangle, an edge is represented as (index1, index2) + // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) - // three edges per triangle, an edge is represented as (index1, index2) - // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) + const index1 = 3 * i + j; + vertex.fromBufferAttribute( position, index1 ); + vertices.push( vertex.x, vertex.y, vertex.z ); - const index1 = 3 * i + j; - vertex.fromBufferAttribute( position, index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + const index2 = 3 * i + ( ( j + 1 ) % 3 ); + vertex.fromBufferAttribute( position, index2 ); + vertices.push( vertex.x, vertex.y, vertex.z ); - const index2 = 3 * i + ( ( j + 1 ) % 3 ); - vertex.fromBufferAttribute( position, index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); + } } @@ -28788,17 +28916,14 @@ function WireframeGeometry( geometry ) { } - } + // build geometry - // build geometry + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + } } -WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); -WireframeGeometry.prototype.constructor = WireframeGeometry; - /** * Parametric Surfaces Geometry * based on the brilliant article by @prideout https://prideout.net/blog/old/blog/index.html@p=44.html @@ -28952,158 +29077,163 @@ ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry; // PolyhedronGeometry -function PolyhedronGeometry( vertices, indices, radius, detail ) { +class PolyhedronGeometry extends Geometry { - Geometry.call( this ); + constructor( vertices, indices, radius, detail ) { - this.type = 'PolyhedronGeometry'; + super(); - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + this.type = 'PolyhedronGeometry'; - this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); - this.mergeVertices(); + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; -} + this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); + this.mergeVertices(); -PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); -PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; + } + +} // PolyhedronBufferGeometry -function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { +class PolyhedronBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( vertices, indices, radius, detail ) { - this.type = 'PolyhedronBufferGeometry'; + super(); - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; + this.type = 'PolyhedronBufferGeometry'; + + this.parameters = { + vertices: vertices, + indices: indices, + radius: radius, + detail: detail + }; - radius = radius || 1; - detail = detail || 0; + radius = radius || 1; + detail = detail || 0; - // default buffer data + // default buffer data - const vertexBuffer = []; - const uvBuffer = []; + const vertexBuffer = []; + const uvBuffer = []; - // the subdivision creates the vertex buffer data + // the subdivision creates the vertex buffer data - subdivide( detail ); + subdivide( detail ); - // all vertices should lie on a conceptual sphere with a given radius + // all vertices should lie on a conceptual sphere with a given radius - applyRadius( radius ); + applyRadius( radius ); - // finally, create the uv data + // finally, create the uv data - generateUVs(); + generateUVs(); - // build non-indexed geometry + // build non-indexed geometry - this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); + this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); - if ( detail === 0 ) { + if ( detail === 0 ) { - this.computeVertexNormals(); // flat normals + this.computeVertexNormals(); // flat normals - } else { + } else { - this.normalizeNormals(); // smooth normals + this.normalizeNormals(); // smooth normals - } + } - // helper functions + // helper functions - function subdivide( detail ) { + function subdivide( detail ) { - const a = new Vector3(); - const b = new Vector3(); - const c = new Vector3(); + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); - // iterate over all faces and apply a subdivison with the given detail value + // iterate over all faces and apply a subdivison with the given detail value - for ( let i = 0; i < indices.length; i += 3 ) { + for ( let i = 0; i < indices.length; i += 3 ) { - // get the vertices of the face + // get the vertices of the face - getVertexByIndex( indices[ i + 0 ], a ); - getVertexByIndex( indices[ i + 1 ], b ); - getVertexByIndex( indices[ i + 2 ], c ); + getVertexByIndex( indices[ i + 0 ], a ); + getVertexByIndex( indices[ i + 1 ], b ); + getVertexByIndex( indices[ i + 2 ], c ); - // perform subdivision + // perform subdivision - subdivideFace( a, b, c, detail ); + subdivideFace( a, b, c, detail ); + + } } - } + function subdivideFace( a, b, c, detail ) { - function subdivideFace( a, b, c, detail ) { + const cols = Math.pow( 2, detail ); - const cols = Math.pow( 2, detail ); + // we use this multidimensional array as a data structure for creating the subdivision - // we use this multidimensional array as a data structure for creating the subdivision + const v = []; - const v = []; + // construct all of the vertices for this subdivision - // construct all of the vertices for this subdivision + for ( let i = 0; i <= cols; i ++ ) { - for ( let i = 0; i <= cols; i ++ ) { + v[ i ] = []; - v[ i ] = []; + const aj = a.clone().lerp( c, i / cols ); + const bj = b.clone().lerp( c, i / cols ); - const aj = a.clone().lerp( c, i / cols ); - const bj = b.clone().lerp( c, i / cols ); + const rows = cols - i; - const rows = cols - i; + for ( let j = 0; j <= rows; j ++ ) { - for ( let j = 0; j <= rows; j ++ ) { + if ( j === 0 && i === cols ) { - if ( j === 0 && i === cols ) { + v[ i ][ j ] = aj; - v[ i ][ j ] = aj; + } else { - } else { + v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); - v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); + } } } - } + // construct all of the faces - // construct all of the faces + for ( let i = 0; i < cols; i ++ ) { - for ( let i = 0; i < cols; i ++ ) { + for ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { - for ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { + const k = Math.floor( j / 2 ); - const k = Math.floor( j / 2 ); + if ( j % 2 === 0 ) { - if ( j % 2 === 0 ) { + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); + pushVertex( v[ i ][ k ] ); - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); - pushVertex( v[ i ][ k ] ); + } else { - } else { + pushVertex( v[ i ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k + 1 ] ); + pushVertex( v[ i + 1 ][ k ] ); - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); + } } @@ -29111,916 +29241,922 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { } - } + function applyRadius( radius ) { - function applyRadius( radius ) { + const vertex = new Vector3(); - const vertex = new Vector3(); + // iterate over the entire buffer and apply the radius to each vertex - // iterate over the entire buffer and apply the radius to each vertex + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { - for ( let i = 0; i < vertexBuffer.length; i += 3 ) { + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; + vertex.normalize().multiplyScalar( radius ); - vertex.normalize().multiplyScalar( radius ); + vertexBuffer[ i + 0 ] = vertex.x; + vertexBuffer[ i + 1 ] = vertex.y; + vertexBuffer[ i + 2 ] = vertex.z; - vertexBuffer[ i + 0 ] = vertex.x; - vertexBuffer[ i + 1 ] = vertex.y; - vertexBuffer[ i + 2 ] = vertex.z; + } } - } + function generateUVs() { - function generateUVs() { + const vertex = new Vector3(); - const vertex = new Vector3(); + for ( let i = 0; i < vertexBuffer.length; i += 3 ) { - for ( let i = 0; i < vertexBuffer.length; i += 3 ) { + vertex.x = vertexBuffer[ i + 0 ]; + vertex.y = vertexBuffer[ i + 1 ]; + vertex.z = vertexBuffer[ i + 2 ]; - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; + const u = azimuth( vertex ) / 2 / Math.PI + 0.5; + const v = inclination( vertex ) / Math.PI + 0.5; + uvBuffer.push( u, 1 - v ); - const u = azimuth( vertex ) / 2 / Math.PI + 0.5; - const v = inclination( vertex ) / Math.PI + 0.5; - uvBuffer.push( u, 1 - v ); + } - } + correctUVs(); - correctUVs(); + correctSeam(); - correctSeam(); + } - } + function correctSeam() { - function correctSeam() { + // handle case when face straddles the seam, see #3269 - // handle case when face straddles the seam, see #3269 + for ( let i = 0; i < uvBuffer.length; i += 6 ) { - for ( let i = 0; i < uvBuffer.length; i += 6 ) { + // uv data of a single face - // uv data of a single face + const x0 = uvBuffer[ i + 0 ]; + const x1 = uvBuffer[ i + 2 ]; + const x2 = uvBuffer[ i + 4 ]; - const x0 = uvBuffer[ i + 0 ]; - const x1 = uvBuffer[ i + 2 ]; - const x2 = uvBuffer[ i + 4 ]; + const max = Math.max( x0, x1, x2 ); + const min = Math.min( x0, x1, x2 ); - const max = Math.max( x0, x1, x2 ); - const min = Math.min( x0, x1, x2 ); + // 0.9 is somewhat arbitrary - // 0.9 is somewhat arbitrary + if ( max > 0.9 && min < 0.1 ) { - if ( max > 0.9 && min < 0.1 ) { + if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; + if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; + if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; - if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; - if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; - if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; + } } } - } + function pushVertex( vertex ) { - function pushVertex( vertex ) { + vertexBuffer.push( vertex.x, vertex.y, vertex.z ); - vertexBuffer.push( vertex.x, vertex.y, vertex.z ); + } - } + function getVertexByIndex( index, vertex ) { - function getVertexByIndex( index, vertex ) { + const stride = index * 3; - const stride = index * 3; + vertex.x = vertices[ stride + 0 ]; + vertex.y = vertices[ stride + 1 ]; + vertex.z = vertices[ stride + 2 ]; - vertex.x = vertices[ stride + 0 ]; - vertex.y = vertices[ stride + 1 ]; - vertex.z = vertices[ stride + 2 ]; + } - } + function correctUVs() { - function correctUVs() { + const a = new Vector3(); + const b = new Vector3(); + const c = new Vector3(); - const a = new Vector3(); - const b = new Vector3(); - const c = new Vector3(); + const centroid = new Vector3(); - const centroid = new Vector3(); + const uvA = new Vector2(); + const uvB = new Vector2(); + const uvC = new Vector2(); - const uvA = new Vector2(); - const uvB = new Vector2(); - const uvC = new Vector2(); + for ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { - for ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { + a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); + b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); + c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); - a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); - b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); - c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); + uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); + uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); + uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); - uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); - uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); - uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); + centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); - centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); + const azi = azimuth( centroid ); - const azi = azimuth( centroid ); + correctUV( uvA, j + 0, a, azi ); + correctUV( uvB, j + 2, b, azi ); + correctUV( uvC, j + 4, c, azi ); - correctUV( uvA, j + 0, a, azi ); - correctUV( uvB, j + 2, b, azi ); - correctUV( uvC, j + 4, c, azi ); + } } - } + function correctUV( uv, stride, vector, azimuth ) { - function correctUV( uv, stride, vector, azimuth ) { + if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { - if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { + uvBuffer[ stride ] = uv.x - 1; - uvBuffer[ stride ] = uv.x - 1; + } - } + if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { - if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { + uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; - uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; + } } - } + // Angle around the Y axis, counter-clockwise when looking from above. - // Angle around the Y axis, counter-clockwise when looking from above. + function azimuth( vector ) { - function azimuth( vector ) { + return Math.atan2( vector.z, - vector.x ); - return Math.atan2( vector.z, - vector.x ); + } - } + // Angle above the XZ plane. - // Angle above the XZ plane. + function inclination( vector ) { - function inclination( vector ) { + return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); - return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); + } } } -PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; - // TetrahedronGeometry -function TetrahedronGeometry( radius, detail ) { +class TetrahedronGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, detail ) { - this.type = 'TetrahedronGeometry'; + super(); + this.type = 'TetrahedronGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } } -TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); -TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; // TetrahedronBufferGeometry -function TetrahedronBufferGeometry( radius, detail ) { +class TetrahedronBufferGeometry extends PolyhedronBufferGeometry { - const vertices = [ - 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 - ]; + constructor( radius, detail ) { - const indices = [ - 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 - ]; + const vertices = [ + 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + const indices = [ + 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 + ]; - this.type = 'TetrahedronBufferGeometry'; + super( vertices, indices, radius, detail ); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'TetrahedronBufferGeometry'; -} + this.parameters = { + radius: radius, + detail: detail + }; + + } -TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; +} // OctahedronGeometry -function OctahedronGeometry( radius, detail ) { +class OctahedronGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, detail ) { - this.type = 'OctahedronGeometry'; + super(); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'OctahedronGeometry'; - this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.parameters = { + radius: radius, + detail: detail + }; -} + this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); -OctahedronGeometry.prototype = Object.create( Geometry.prototype ); -OctahedronGeometry.prototype.constructor = OctahedronGeometry; + } + +} // OctahedronBufferGeometry -function OctahedronBufferGeometry( radius, detail ) { +class OctahedronBufferGeometry extends PolyhedronBufferGeometry { - const vertices = [ - 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, - 1, 0, 0, 0, 1, 0, 0, - 1 - ]; + constructor( radius, detail ) { - const indices = [ - 0, 2, 4, 0, 4, 3, 0, 3, 5, - 0, 5, 2, 1, 2, 5, 1, 5, 3, - 1, 3, 4, 1, 4, 2 - ]; + const vertices = [ + 1, 0, 0, - 1, 0, 0, 0, 1, 0, + 0, - 1, 0, 0, 0, 1, 0, 0, - 1 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + const indices = [ + 0, 2, 4, 0, 4, 3, 0, 3, 5, + 0, 5, 2, 1, 2, 5, 1, 5, 3, + 1, 3, 4, 1, 4, 2 + ]; - this.type = 'OctahedronBufferGeometry'; + super( vertices, indices, radius, detail ); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'OctahedronBufferGeometry'; -} + this.parameters = { + radius: radius, + detail: detail + }; + + } -OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; +} // IcosahedronGeometry -function IcosahedronGeometry( radius, detail ) { +class IcosahedronGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, detail ) { - this.type = 'IcosahedronGeometry'; + super(); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'IcosahedronGeometry'; - this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.parameters = { + radius: radius, + detail: detail + }; -} + this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); + + } -IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); -IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; +} // IcosahedronBufferGeometry -function IcosahedronBufferGeometry( radius, detail ) { +class IcosahedronBufferGeometry extends PolyhedronBufferGeometry { - const t = ( 1 + Math.sqrt( 5 ) ) / 2; + constructor( radius, detail ) { - const vertices = [ - - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, - 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, - t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 - ]; + const t = ( 1 + Math.sqrt( 5 ) ) / 2; - const indices = [ - 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, - 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, - 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, - 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 - ]; + const vertices = [ + - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, + 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, + t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + const indices = [ + 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, + 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, + 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, + 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 + ]; - this.type = 'IcosahedronBufferGeometry'; + super( vertices, indices, radius, detail ); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'IcosahedronBufferGeometry'; -} + this.parameters = { + radius: radius, + detail: detail + }; + + } -IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; +} // DodecahedronGeometry -function DodecahedronGeometry( radius, detail ) { +class DodecahedronGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, detail ) { - this.type = 'DodecahedronGeometry'; + super(); + this.type = 'DodecahedronGeometry'; - this.parameters = { - radius: radius, - detail: detail - }; + this.parameters = { + radius: radius, + detail: detail + }; - this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); + this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); + this.mergeVertices(); -} + } -DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); -DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; +} // DodecahedronBufferGeometry -function DodecahedronBufferGeometry( radius, detail ) { +class DodecahedronBufferGeometry extends PolyhedronBufferGeometry { - const t = ( 1 + Math.sqrt( 5 ) ) / 2; - const r = 1 / t; + constructor( radius, detail ) { - const vertices = [ + const t = ( 1 + Math.sqrt( 5 ) ) / 2; + const r = 1 / t; - // (±1, ±1, ±1) - - 1, - 1, - 1, - 1, - 1, 1, - - 1, 1, - 1, - 1, 1, 1, - 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, 1, 1, 1, + const vertices = [ - // (0, ±1/φ, ±φ) - 0, - r, - t, 0, - r, t, - 0, r, - t, 0, r, t, + // (±1, ±1, ±1) + - 1, - 1, - 1, - 1, - 1, 1, + - 1, 1, - 1, - 1, 1, 1, + 1, - 1, - 1, 1, - 1, 1, + 1, 1, - 1, 1, 1, 1, - // (±1/φ, ±φ, 0) - - r, - t, 0, - r, t, 0, - r, - t, 0, r, t, 0, + // (0, ±1/φ, ±φ) + 0, - r, - t, 0, - r, t, + 0, r, - t, 0, r, t, - // (±φ, 0, ±1/φ) - - t, 0, - r, t, 0, - r, - - t, 0, r, t, 0, r - ]; + // (±1/φ, ±φ, 0) + - r, - t, 0, - r, t, 0, + r, - t, 0, r, t, 0, - const indices = [ - 3, 11, 7, 3, 7, 15, 3, 15, 13, - 7, 19, 17, 7, 17, 6, 7, 6, 15, - 17, 4, 8, 17, 8, 10, 17, 10, 6, - 8, 0, 16, 8, 16, 2, 8, 2, 10, - 0, 12, 1, 0, 1, 18, 0, 18, 16, - 6, 10, 2, 6, 2, 13, 6, 13, 15, - 2, 16, 18, 2, 18, 3, 2, 3, 13, - 18, 1, 9, 18, 9, 11, 18, 11, 3, - 4, 14, 12, 4, 12, 0, 4, 0, 8, - 11, 9, 5, 11, 5, 19, 11, 19, 7, - 19, 5, 14, 19, 14, 4, 19, 4, 17, - 1, 12, 14, 1, 14, 5, 1, 5, 9 - ]; + // (±φ, 0, ±1/φ) + - t, 0, - r, t, 0, - r, + - t, 0, r, t, 0, r + ]; - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); + const indices = [ + 3, 11, 7, 3, 7, 15, 3, 15, 13, + 7, 19, 17, 7, 17, 6, 7, 6, 15, + 17, 4, 8, 17, 8, 10, 17, 10, 6, + 8, 0, 16, 8, 16, 2, 8, 2, 10, + 0, 12, 1, 0, 1, 18, 0, 18, 16, + 6, 10, 2, 6, 2, 13, 6, 13, 15, + 2, 16, 18, 2, 18, 3, 2, 3, 13, + 18, 1, 9, 18, 9, 11, 18, 11, 3, + 4, 14, 12, 4, 12, 0, 4, 0, 8, + 11, 9, 5, 11, 5, 19, 11, 19, 7, + 19, 5, 14, 19, 14, 4, 19, 4, 17, + 1, 12, 14, 1, 14, 5, 1, 5, 9 + ]; - this.type = 'DodecahedronBufferGeometry'; + super( vertices, indices, radius, detail ); - this.parameters = { - radius: radius, - detail: detail - }; + this.type = 'DodecahedronBufferGeometry'; -} + this.parameters = { + radius: radius, + detail: detail + }; + + } -DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; +} // TubeGeometry -function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { +class TubeGeometry extends Geometry { - Geometry.call( this ); + constructor( path, tubularSegments, radius, radialSegments, closed, taper ) { - this.type = 'TubeGeometry'; + super(); + this.type = 'TubeGeometry'; - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; - if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' ); + if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' ); - const bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); + const bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); - // expose internals + // expose internals - this.tangents = bufferGeometry.tangents; - this.normals = bufferGeometry.normals; - this.binormals = bufferGeometry.binormals; + this.tangents = bufferGeometry.tangents; + this.normals = bufferGeometry.normals; + this.binormals = bufferGeometry.binormals; - // create geometry + // create geometry - this.fromBufferGeometry( bufferGeometry ); - this.mergeVertices(); + this.fromBufferGeometry( bufferGeometry ); + this.mergeVertices(); + + } } -TubeGeometry.prototype = Object.create( Geometry.prototype ); -TubeGeometry.prototype.constructor = TubeGeometry; // TubeBufferGeometry -function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { +class TubeBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( path, tubularSegments, radius, radialSegments, closed ) { - this.type = 'TubeBufferGeometry'; + super(); + this.type = 'TubeBufferGeometry'; - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; + this.parameters = { + path: path, + tubularSegments: tubularSegments, + radius: radius, + radialSegments: radialSegments, + closed: closed + }; - tubularSegments = tubularSegments || 64; - radius = radius || 1; - radialSegments = radialSegments || 8; - closed = closed || false; + tubularSegments = tubularSegments || 64; + radius = radius || 1; + radialSegments = radialSegments || 8; + closed = closed || false; - const frames = path.computeFrenetFrames( tubularSegments, closed ); + const frames = path.computeFrenetFrames( tubularSegments, closed ); - // expose internals + // expose internals - this.tangents = frames.tangents; - this.normals = frames.normals; - this.binormals = frames.binormals; + this.tangents = frames.tangents; + this.normals = frames.normals; + this.binormals = frames.binormals; - // helper variables + // helper variables - const vertex = new Vector3(); - const normal = new Vector3(); - const uv = new Vector2(); - let P = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); + const uv = new Vector2(); + let P = new Vector3(); - // buffer + // buffer - const vertices = []; - const normals = []; - const uvs = []; - const indices = []; + const vertices = []; + const normals = []; + const uvs = []; + const indices = []; - // create buffer data + // create buffer data - generateBufferData(); + generateBufferData(); - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - // functions + // functions - function generateBufferData() { + function generateBufferData() { - for ( let i = 0; i < tubularSegments; i ++ ) { + for ( let i = 0; i < tubularSegments; i ++ ) { - generateSegment( i ); + generateSegment( i ); - } + } - // if the geometry is not closed, generate the last row of vertices and normals - // at the regular position on the given path - // - // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) + // if the geometry is not closed, generate the last row of vertices and normals + // at the regular position on the given path + // + // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) - generateSegment( ( closed === false ) ? tubularSegments : 0 ); + generateSegment( ( closed === false ) ? tubularSegments : 0 ); - // uvs are generated in a separate function. - // this makes it easy compute correct values for closed geometries + // uvs are generated in a separate function. + // this makes it easy compute correct values for closed geometries - generateUVs(); + generateUVs(); - // finally create faces + // finally create faces - generateIndices(); + generateIndices(); - } + } - function generateSegment( i ) { + function generateSegment( i ) { - // we use getPointAt to sample evenly distributed points from the given path + // we use getPointAt to sample evenly distributed points from the given path - P = path.getPointAt( i / tubularSegments, P ); + P = path.getPointAt( i / tubularSegments, P ); - // retrieve corresponding normal and binormal + // retrieve corresponding normal and binormal - const N = frames.normals[ i ]; - const B = frames.binormals[ i ]; + const N = frames.normals[ i ]; + const B = frames.binormals[ i ]; - // generate normals and vertices for the current segment + // generate normals and vertices for the current segment - for ( let j = 0; j <= radialSegments; j ++ ) { + for ( let j = 0; j <= radialSegments; j ++ ) { - const v = j / radialSegments * Math.PI * 2; + const v = j / radialSegments * Math.PI * 2; - const sin = Math.sin( v ); - const cos = - Math.cos( v ); + const sin = Math.sin( v ); + const cos = - Math.cos( v ); - // normal + // normal - normal.x = ( cos * N.x + sin * B.x ); - normal.y = ( cos * N.y + sin * B.y ); - normal.z = ( cos * N.z + sin * B.z ); - normal.normalize(); + normal.x = ( cos * N.x + sin * B.x ); + normal.y = ( cos * N.y + sin * B.y ); + normal.z = ( cos * N.z + sin * B.z ); + normal.normalize(); - normals.push( normal.x, normal.y, normal.z ); + normals.push( normal.x, normal.y, normal.z ); - // vertex + // vertex - vertex.x = P.x + radius * normal.x; - vertex.y = P.y + radius * normal.y; - vertex.z = P.z + radius * normal.z; + vertex.x = P.x + radius * normal.x; + vertex.y = P.y + radius * normal.y; + vertex.z = P.z + radius * normal.z; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); + + } } - } + function generateIndices() { - function generateIndices() { + for ( let j = 1; j <= tubularSegments; j ++ ) { - for ( let j = 1; j <= tubularSegments; j ++ ) { + for ( let i = 1; i <= radialSegments; i ++ ) { - for ( let i = 1; i <= radialSegments; i ++ ) { + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; - const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - const b = ( radialSegments + 1 ) * j + ( i - 1 ); - const c = ( radialSegments + 1 ) * j + i; - const d = ( radialSegments + 1 ) * ( j - 1 ) + i; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } } - } + function generateUVs() { - function generateUVs() { + for ( let i = 0; i <= tubularSegments; i ++ ) { - for ( let i = 0; i <= tubularSegments; i ++ ) { + for ( let j = 0; j <= radialSegments; j ++ ) { - for ( let j = 0; j <= radialSegments; j ++ ) { + uv.x = i / tubularSegments; + uv.y = j / radialSegments; - uv.x = i / tubularSegments; - uv.y = j / radialSegments; + uvs.push( uv.x, uv.y ); - uvs.push( uv.x, uv.y ); + } } } } + toJSON() { -} - -TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; - -TubeBufferGeometry.prototype.toJSON = function () { + const data = BufferGeometry.prototype.toJSON.call( this ); - const data = BufferGeometry.prototype.toJSON.call( this ); + data.path = this.parameters.path.toJSON(); - data.path = this.parameters.path.toJSON(); + return data; - return data; + } -}; +} // TorusKnotGeometry -function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { +class TorusKnotGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { - this.type = 'TorusKnotGeometry'; + super(); + this.type = 'TorusKnotGeometry'; - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; - if ( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); + if ( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); - this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); - this.mergeVertices(); + this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); + this.mergeVertices(); + + } } -TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); -TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; // TorusKnotBufferGeometry -function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { +class TorusKnotBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( radius, tube, tubularSegments, radialSegments, p, q ) { - this.type = 'TorusKnotBufferGeometry'; + super(); + this.type = 'TorusKnotBufferGeometry'; - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; + this.parameters = { + radius: radius, + tube: tube, + tubularSegments: tubularSegments, + radialSegments: radialSegments, + p: p, + q: q + }; - radius = radius || 1; - tube = tube || 0.4; - tubularSegments = Math.floor( tubularSegments ) || 64; - radialSegments = Math.floor( radialSegments ) || 8; - p = p || 2; - q = q || 3; + radius = radius || 1; + tube = tube || 0.4; + tubularSegments = Math.floor( tubularSegments ) || 64; + radialSegments = Math.floor( radialSegments ) || 8; + p = p || 2; + q = q || 3; - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // helper variables + // helper variables - const vertex = new Vector3(); - const normal = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); - const P1 = new Vector3(); - const P2 = new Vector3(); + const P1 = new Vector3(); + const P2 = new Vector3(); - const B = new Vector3(); - const T = new Vector3(); - const N = new Vector3(); + const B = new Vector3(); + const T = new Vector3(); + const N = new Vector3(); - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( let i = 0; i <= tubularSegments; ++ i ) { + for ( let i = 0; i <= tubularSegments; ++ i ) { - // the radian "u" is used to calculate the position on the torus curve of the current tubular segement + // the radian "u" is used to calculate the position on the torus curve of the current tubular segement - const u = i / tubularSegments * p * Math.PI * 2; + const u = i / tubularSegments * p * Math.PI * 2; - // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. - // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions + // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. + // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions - calculatePositionOnCurve( u, p, q, radius, P1 ); - calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); + calculatePositionOnCurve( u, p, q, radius, P1 ); + calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); - // calculate orthonormal basis + // calculate orthonormal basis - T.subVectors( P2, P1 ); - N.addVectors( P2, P1 ); - B.crossVectors( T, N ); - N.crossVectors( B, T ); + T.subVectors( P2, P1 ); + N.addVectors( P2, P1 ); + B.crossVectors( T, N ); + N.crossVectors( B, T ); - // normalize B, N. T can be ignored, we don't use it + // normalize B, N. T can be ignored, we don't use it - B.normalize(); - N.normalize(); + B.normalize(); + N.normalize(); - for ( let j = 0; j <= radialSegments; ++ j ) { + for ( let j = 0; j <= radialSegments; ++ j ) { - // now calculate the vertices. they are nothing more than an extrusion of the torus curve. - // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. + // now calculate the vertices. they are nothing more than an extrusion of the torus curve. + // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. - const v = j / radialSegments * Math.PI * 2; - const cx = - tube * Math.cos( v ); - const cy = tube * Math.sin( v ); + const v = j / radialSegments * Math.PI * 2; + const cx = - tube * Math.cos( v ); + const cy = tube * Math.sin( v ); - // now calculate the final vertex position. - // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve + // now calculate the final vertex position. + // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve - vertex.x = P1.x + ( cx * N.x + cy * B.x ); - vertex.y = P1.y + ( cx * N.y + cy * B.y ); - vertex.z = P1.z + ( cx * N.z + cy * B.z ); + vertex.x = P1.x + ( cx * N.x + cy * B.x ); + vertex.y = P1.y + ( cx * N.y + cy * B.y ); + vertex.z = P1.z + ( cx * N.z + cy * B.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) + // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) - normal.subVectors( vertex, P1 ).normalize(); + normal.subVectors( vertex, P1 ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + normals.push( normal.x, normal.y, normal.z ); - // uv + // uv - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); + + } } - } + // generate indices - // generate indices + for ( let j = 1; j <= tubularSegments; j ++ ) { - for ( let j = 1; j <= tubularSegments; j ++ ) { + for ( let i = 1; i <= radialSegments; i ++ ) { - for ( let i = 1; i <= radialSegments; i ++ ) { + // indices - // indices + const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); + const b = ( radialSegments + 1 ) * j + ( i - 1 ); + const c = ( radialSegments + 1 ) * j + i; + const d = ( radialSegments + 1 ) * ( j - 1 ) + i; - const a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - const b = ( radialSegments + 1 ) * j + ( i - 1 ); - const c = ( radialSegments + 1 ) * j + i; - const d = ( radialSegments + 1 ) * ( j - 1 ) + i; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // this function calculates the current position on the torus curve - // this function calculates the current position on the torus curve + function calculatePositionOnCurve( u, p, q, radius, position ) { - function calculatePositionOnCurve( u, p, q, radius, position ) { + const cu = Math.cos( u ); + const su = Math.sin( u ); + const quOverP = q / p * u; + const cs = Math.cos( quOverP ); - const cu = Math.cos( u ); - const su = Math.sin( u ); - const quOverP = q / p * u; - const cs = Math.cos( quOverP ); + position.x = radius * ( 2 + cs ) * 0.5 * cu; + position.y = radius * ( 2 + cs ) * su * 0.5; + position.z = radius * Math.sin( quOverP ) * 0.5; - position.x = radius * ( 2 + cs ) * 0.5 * cu; - position.y = radius * ( 2 + cs ) * su * 0.5; - position.z = radius * Math.sin( quOverP ) * 0.5; + } } } -TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; - // TorusGeometry -function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { +class TorusGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, tube, radialSegments, tubularSegments, arc ) { - this.type = 'TorusGeometry'; + super(); + this.type = 'TorusGeometry'; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; - this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); - this.mergeVertices(); + this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); + this.mergeVertices(); + + } } -TorusGeometry.prototype = Object.create( Geometry.prototype ); -TorusGeometry.prototype.constructor = TorusGeometry; // TorusBufferGeometry -function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { +class TorusBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( radius, tube, radialSegments, tubularSegments, arc ) { - this.type = 'TorusBufferGeometry'; + super(); + this.type = 'TorusBufferGeometry'; - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; + this.parameters = { + radius: radius, + tube: tube, + radialSegments: radialSegments, + tubularSegments: tubularSegments, + arc: arc + }; - radius = radius || 1; - tube = tube || 0.4; - radialSegments = Math.floor( radialSegments ) || 8; - tubularSegments = Math.floor( tubularSegments ) || 6; - arc = arc || Math.PI * 2; + radius = radius || 1; + tube = tube || 0.4; + radialSegments = Math.floor( radialSegments ) || 8; + tubularSegments = Math.floor( tubularSegments ) || 6; + arc = arc || Math.PI * 2; - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // helper variables + // helper variables - const center = new Vector3(); - const vertex = new Vector3(); - const normal = new Vector3(); + const center = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( let j = 0; j <= radialSegments; j ++ ) { + for ( let j = 0; j <= radialSegments; j ++ ) { - for ( let i = 0; i <= tubularSegments; i ++ ) { + for ( let i = 0; i <= tubularSegments; i ++ ) { - const u = i / tubularSegments * arc; - const v = j / radialSegments * Math.PI * 2; + const u = i / tubularSegments * arc; + const v = j / radialSegments * Math.PI * 2; - // vertex + // vertex - vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); - vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); - vertex.z = tube * Math.sin( v ); + vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + vertex.z = tube * Math.sin( v ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal + // normal - center.x = radius * Math.cos( u ); - center.y = radius * Math.sin( u ); - normal.subVectors( vertex, center ).normalize(); + center.x = radius * Math.cos( u ); + center.y = radius * Math.sin( u ); + normal.subVectors( vertex, center ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + normals.push( normal.x, normal.y, normal.z ); - // uv + // uv - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); + uvs.push( i / tubularSegments ); + uvs.push( j / radialSegments ); + + } } - } + // generate indices - // generate indices + for ( let j = 1; j <= radialSegments; j ++ ) { - for ( let j = 1; j <= radialSegments; j ++ ) { + for ( let i = 1; i <= tubularSegments; i ++ ) { - for ( let i = 1; i <= tubularSegments; i ++ ) { + // indices - // indices + const a = ( tubularSegments + 1 ) * j + i - 1; + const b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; + const c = ( tubularSegments + 1 ) * ( j - 1 ) + i; + const d = ( tubularSegments + 1 ) * j + i; - const a = ( tubularSegments + 1 ) * j + i - 1; - const b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; - const c = ( tubularSegments + 1 ) * ( j - 1 ) + i; - const d = ( tubularSegments + 1 ) * j + i; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } } -TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; - /** * Port from https://github.com/mapbox/earcut (v2.2.2) */ @@ -30924,493 +31060,499 @@ function addContour( vertices, contour ) { // ExtrudeGeometry -function ExtrudeGeometry( shapes, options ) { +class ExtrudeGeometry extends Geometry { - Geometry.call( this ); + constructor( shapes, options ) { - this.type = 'ExtrudeGeometry'; + super(); - this.parameters = { - shapes: shapes, - options: options - }; + this.type = 'ExtrudeGeometry'; - this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); - this.mergeVertices(); + this.parameters = { + shapes: shapes, + options: options + }; -} + this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); + this.mergeVertices(); -ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); -ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; + } -ExtrudeGeometry.prototype.toJSON = function () { + toJSON() { - const data = Geometry.prototype.toJSON.call( this ); + const data = super.toJSON(); - const shapes = this.parameters.shapes; - const options = this.parameters.options; + const shapes = this.parameters.shapes; + const options = this.parameters.options; - return toJSON( shapes, options, data ); + return toJSON( shapes, options, data ); + + } + +} -}; // ExtrudeBufferGeometry -function ExtrudeBufferGeometry( shapes, options ) { +class ExtrudeBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( shapes, options ) { - this.type = 'ExtrudeBufferGeometry'; + super(); - this.parameters = { - shapes: shapes, - options: options - }; + this.type = 'ExtrudeBufferGeometry'; - shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; + this.parameters = { + shapes: shapes, + options: options + }; - const scope = this; + shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; - const verticesArray = []; - const uvArray = []; + const scope = this; - for ( let i = 0, l = shapes.length; i < l; i ++ ) { + const verticesArray = []; + const uvArray = []; - const shape = shapes[ i ]; - addShape( shape ); + for ( let i = 0, l = shapes.length; i < l; i ++ ) { - } + const shape = shapes[ i ]; + addShape( shape ); - // build geometry + } - this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); + // build geometry - this.computeVertexNormals(); + this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); - // functions + this.computeVertexNormals(); - function addShape( shape ) { + // functions - const placeholder = []; + function addShape( shape ) { - // options + const placeholder = []; - const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; - const steps = options.steps !== undefined ? options.steps : 1; - let depth = options.depth !== undefined ? options.depth : 100; + // options - let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; - let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; - let bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; - let bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; - let bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; + const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; + const steps = options.steps !== undefined ? options.steps : 1; + let depth = options.depth !== undefined ? options.depth : 100; - const extrudePath = options.extrudePath; + let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; + let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; + let bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; + let bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; + let bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; - const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; + const extrudePath = options.extrudePath; - // deprecated options + const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; - if ( options.amount !== undefined ) { + // deprecated options - console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); - depth = options.amount; + if ( options.amount !== undefined ) { - } + console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); + depth = options.amount; - // + } - let extrudePts, extrudeByPath = false; - let splineTube, binormal, normal, position2; + // - if ( extrudePath ) { + let extrudePts, extrudeByPath = false; + let splineTube, binormal, normal, position2; - extrudePts = extrudePath.getSpacedPoints( steps ); + if ( extrudePath ) { - extrudeByPath = true; - bevelEnabled = false; // bevels not supported for path extrusion + extrudePts = extrudePath.getSpacedPoints( steps ); - // SETUP TNB variables + extrudeByPath = true; + bevelEnabled = false; // bevels not supported for path extrusion - // TODO1 - have a .isClosed in spline? + // SETUP TNB variables - splineTube = extrudePath.computeFrenetFrames( steps, false ); + // TODO1 - have a .isClosed in spline? - // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); + splineTube = extrudePath.computeFrenetFrames( steps, false ); - binormal = new Vector3(); - normal = new Vector3(); - position2 = new Vector3(); + // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); - } + binormal = new Vector3(); + normal = new Vector3(); + position2 = new Vector3(); + + } - // Safeguards if bevels are not enabled + // Safeguards if bevels are not enabled - if ( ! bevelEnabled ) { + if ( ! bevelEnabled ) { - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; - bevelOffset = 0; + bevelSegments = 0; + bevelThickness = 0; + bevelSize = 0; + bevelOffset = 0; - } + } - // Variables initialization + // Variables initialization - const shapePoints = shape.extractPoints( curveSegments ); + const shapePoints = shape.extractPoints( curveSegments ); - let vertices = shapePoints.shape; - const holes = shapePoints.holes; + let vertices = shapePoints.shape; + const holes = shapePoints.holes; - const reverse = ! ShapeUtils.isClockWise( vertices ); + const reverse = ! ShapeUtils.isClockWise( vertices ); - if ( reverse ) { + if ( reverse ) { - vertices = vertices.reverse(); + vertices = vertices.reverse(); - // Maybe we should also check if holes are in the opposite direction, just to be safe ... + // Maybe we should also check if holes are in the opposite direction, just to be safe ... - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - const ahole = holes[ h ]; + const ahole = holes[ h ]; + + if ( ShapeUtils.isClockWise( ahole ) ) { - if ( ShapeUtils.isClockWise( ahole ) ) { + holes[ h ] = ahole.reverse(); - holes[ h ] = ahole.reverse(); + } } } - } + const faces = ShapeUtils.triangulateShape( vertices, holes ); - const faces = ShapeUtils.triangulateShape( vertices, holes ); + /* Vertices */ - /* Vertices */ + const contour = vertices; // vertices has all points but contour has only points of circumference - const contour = vertices; // vertices has all points but contour has only points of circumference + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + const ahole = holes[ h ]; - const ahole = holes[ h ]; + vertices = vertices.concat( ahole ); - vertices = vertices.concat( ahole ); + } - } + function scalePt2( pt, vec, size ) { - function scalePt2( pt, vec, size ) { + if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" ); - if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" ); + return vec.clone().multiplyScalar( size ).add( pt ); - return vec.clone().multiplyScalar( size ).add( pt ); + } - } + const vlen = vertices.length, flen = faces.length; - const vlen = vertices.length, flen = faces.length; + // Find directions for point movement - // Find directions for point movement + function getBevelVec( inPt, inPrev, inNext ) { - function getBevelVec( inPt, inPrev, inNext ) { + // computes for inPt the corresponding point inPt' on a new contour + // shifted by 1 unit (length of normalized vector) to the left + // if we walk along contour clockwise, this new contour is outside the old one + // + // inPt' is the intersection of the two lines parallel to the two + // adjacent edges of inPt at a distance of 1 unit on the left side. - // computes for inPt the corresponding point inPt' on a new contour - // shifted by 1 unit (length of normalized vector) to the left - // if we walk along contour clockwise, this new contour is outside the old one - // - // inPt' is the intersection of the two lines parallel to the two - // adjacent edges of inPt at a distance of 1 unit on the left side. + let v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt - let v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt + // good reading for geometry algorithms (here: line-line intersection) + // http://geomalgorithms.com/a05-_intersect-1.html - // good reading for geometry algorithms (here: line-line intersection) - // http://geomalgorithms.com/a05-_intersect-1.html + const v_prev_x = inPt.x - inPrev.x, + v_prev_y = inPt.y - inPrev.y; + const v_next_x = inNext.x - inPt.x, + v_next_y = inNext.y - inPt.y; - const v_prev_x = inPt.x - inPrev.x, - v_prev_y = inPt.y - inPrev.y; - const v_next_x = inNext.x - inPt.x, - v_next_y = inNext.y - inPt.y; + const v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); - const v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); + // check for collinear edges + const collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - // check for collinear edges - const collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + if ( Math.abs( collinear0 ) > Number.EPSILON ) { - if ( Math.abs( collinear0 ) > Number.EPSILON ) { + // not collinear - // not collinear + // length of vectors for normalizing - // length of vectors for normalizing + const v_prev_len = Math.sqrt( v_prev_lensq ); + const v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); - const v_prev_len = Math.sqrt( v_prev_lensq ); - const v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); + // shift adjacent points by unit vectors to the left - // shift adjacent points by unit vectors to the left + const ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); + const ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); - const ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); - const ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); + const ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); + const ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); - const ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); - const ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); + // scaling factor for v_prev to intersection point - // scaling factor for v_prev to intersection point + const sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - + ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / + ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - const sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - - ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / - ( v_prev_x * v_next_y - v_prev_y * v_next_x ); + // vector from inPt to intersection point - // vector from inPt to intersection point + v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); + v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); - v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); - v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); + // Don't normalize!, otherwise sharp corners become ugly + // but prevent crazy spikes + const v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); + if ( v_trans_lensq <= 2 ) { - // Don't normalize!, otherwise sharp corners become ugly - // but prevent crazy spikes - const v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); - if ( v_trans_lensq <= 2 ) { + return new Vector2( v_trans_x, v_trans_y ); - return new Vector2( v_trans_x, v_trans_y ); + } else { - } else { + shrink_by = Math.sqrt( v_trans_lensq / 2 ); - shrink_by = Math.sqrt( v_trans_lensq / 2 ); + } - } + } else { - } else { + // handle special case of collinear edges - // handle special case of collinear edges + let direction_eq = false; // assumes: opposite - let direction_eq = false; // assumes: opposite + if ( v_prev_x > Number.EPSILON ) { - if ( v_prev_x > Number.EPSILON ) { + if ( v_next_x > Number.EPSILON ) { - if ( v_next_x > Number.EPSILON ) { + direction_eq = true; - direction_eq = true; + } - } + } else { - } else { + if ( v_prev_x < - Number.EPSILON ) { - if ( v_prev_x < - Number.EPSILON ) { + if ( v_next_x < - Number.EPSILON ) { - if ( v_next_x < - Number.EPSILON ) { + direction_eq = true; - direction_eq = true; + } - } + } else { - } else { + if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { - if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { + direction_eq = true; - direction_eq = true; + } } } - } + if ( direction_eq ) { - if ( direction_eq ) { + // console.log("Warning: lines are a straight sequence"); + v_trans_x = - v_prev_y; + v_trans_y = v_prev_x; + shrink_by = Math.sqrt( v_prev_lensq ); - // console.log("Warning: lines are a straight sequence"); - v_trans_x = - v_prev_y; - v_trans_y = v_prev_x; - shrink_by = Math.sqrt( v_prev_lensq ); + } else { - } else { + // console.log("Warning: lines are a straight spike"); + v_trans_x = v_prev_x; + v_trans_y = v_prev_y; + shrink_by = Math.sqrt( v_prev_lensq / 2 ); - // console.log("Warning: lines are a straight spike"); - v_trans_x = v_prev_x; - v_trans_y = v_prev_y; - shrink_by = Math.sqrt( v_prev_lensq / 2 ); + } } + return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); + } - return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); - } + const contourMovements = []; + for ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - const contourMovements = []; + if ( j === il ) j = 0; + if ( k === il ) k = 0; - for ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + // (j)---(i)---(k) + // console.log('i,j,k', i, j , k) - if ( j === il ) j = 0; - if ( k === il ) k = 0; + contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); - // (j)---(i)---(k) - // console.log('i,j,k', i, j , k) + } - contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); + const holesMovements = []; + let oneHoleMovements, verticesMovements = contourMovements.concat(); - } + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - const holesMovements = []; - let oneHoleMovements, verticesMovements = contourMovements.concat(); + const ahole = holes[ h ]; - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + oneHoleMovements = []; - const ahole = holes[ h ]; + for ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - oneHoleMovements = []; + if ( j === il ) j = 0; + if ( k === il ) k = 0; - for ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { + // (j)---(i)---(k) + oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); - if ( j === il ) j = 0; - if ( k === il ) k = 0; + } - // (j)---(i)---(k) - oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); + holesMovements.push( oneHoleMovements ); + verticesMovements = verticesMovements.concat( oneHoleMovements ); } - holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); - - } + // Loop bevelSegments, 1 for the front, 1 for the back - // Loop bevelSegments, 1 for the front, 1 for the back + for ( let b = 0; b < bevelSegments; b ++ ) { - for ( let b = 0; b < bevelSegments; b ++ ) { + //for ( b = bevelSegments; b > 0; b -- ) { - //for ( b = bevelSegments; b > 0; b -- ) { + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - const t = b / bevelSegments; - const z = bevelThickness * Math.cos( t * Math.PI / 2 ); - const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; + // contract shape - // contract shape + for ( let i = 0, il = contour.length; i < il; i ++ ) { - for ( let i = 0, il = contour.length; i < il; i ++ ) { + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + v( vert.x, vert.y, - z ); - v( vert.x, vert.y, - z ); + } - } + // expand holes - // expand holes + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; - const ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; + for ( let i = 0, il = ahole.length; i < il; i ++ ) { - for ( let i = 0, il = ahole.length; i < il; i ++ ) { + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + v( vert.x, vert.y, - z ); - v( vert.x, vert.y, - z ); + } } } - } + const bs = bevelSize + bevelOffset; - const bs = bevelSize + bevelOffset; + // Back facing vertices - // Back facing vertices + for ( let i = 0; i < vlen; i ++ ) { - for ( let i = 0; i < vlen; i ++ ) { + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert.x, vert.y, 0 ); - v( vert.x, vert.y, 0 ); + } else { - } else { + // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); - // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); + normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); - normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); + position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); - position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); + v( position2.x, position2.y, position2.z ); - v( position2.x, position2.y, position2.z ); + } } - } + // Add stepped vertices... + // Including front facing vertices - // Add stepped vertices... - // Including front facing vertices + for ( let s = 1; s <= steps; s ++ ) { - for ( let s = 1; s <= steps; s ++ ) { + for ( let i = 0; i < vlen; i ++ ) { - for ( let i = 0; i < vlen; i ++ ) { + const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - const vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert.x, vert.y, depth / steps * s ); - v( vert.x, vert.y, depth / steps * s ); + } else { - } else { + // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); - // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); + normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); + binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); - normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); + position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); - position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); + v( position2.x, position2.y, position2.z ); - v( position2.x, position2.y, position2.z ); + } } } - } + // Add bevel segments planes - // Add bevel segments planes + //for ( b = 1; b <= bevelSegments; b ++ ) { + for ( let b = bevelSegments - 1; b >= 0; b -- ) { - //for ( b = 1; b <= bevelSegments; b ++ ) { - for ( let b = bevelSegments - 1; b >= 0; b -- ) { + const t = b / bevelSegments; + const z = bevelThickness * Math.cos( t * Math.PI / 2 ); + const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - const t = b / bevelSegments; - const z = bevelThickness * Math.cos( t * Math.PI / 2 ); - const bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; + // contract shape - // contract shape + for ( let i = 0, il = contour.length; i < il; i ++ ) { - for ( let i = 0, il = contour.length; i < il; i ++ ) { + const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); + v( vert.x, vert.y, depth + z ); - const vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - v( vert.x, vert.y, depth + z ); + } - } + // expand holes - // expand holes + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + const ahole = holes[ h ]; + oneHoleMovements = holesMovements[ h ]; - const ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; + for ( let i = 0, il = ahole.length; i < il; i ++ ) { - for ( let i = 0, il = ahole.length; i < il; i ++ ) { + const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - const vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); + if ( ! extrudeByPath ) { - if ( ! extrudeByPath ) { + v( vert.x, vert.y, depth + z ); - v( vert.x, vert.y, depth + z ); + } else { - } else { + v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); - v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); + } } @@ -31418,215 +31560,210 @@ function ExtrudeBufferGeometry( shapes, options ) { } - } + /* Faces */ - /* Faces */ + // Top and bottom faces - // Top and bottom faces + buildLidFaces(); - buildLidFaces(); + // Sides faces - // Sides faces + buildSideFaces(); - buildSideFaces(); + ///// Internal functions - ///// Internal functions + function buildLidFaces() { - function buildLidFaces() { + const start = verticesArray.length / 3; - const start = verticesArray.length / 3; + if ( bevelEnabled ) { - if ( bevelEnabled ) { + let layer = 0; // steps + 1 + let offset = vlen * layer; - let layer = 0; // steps + 1 - let offset = vlen * layer; + // Bottom faces - // Bottom faces + for ( let i = 0; i < flen; i ++ ) { - for ( let i = 0; i < flen; i ++ ) { + const face = faces[ i ]; + f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); - const face = faces[ i ]; - f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); + } - } + layer = steps + bevelSegments * 2; + offset = vlen * layer; - layer = steps + bevelSegments * 2; - offset = vlen * layer; + // Top faces - // Top faces + for ( let i = 0; i < flen; i ++ ) { - for ( let i = 0; i < flen; i ++ ) { + const face = faces[ i ]; + f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); - const face = faces[ i ]; - f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); + } - } + } else { - } else { + // Bottom faces - // Bottom faces + for ( let i = 0; i < flen; i ++ ) { - for ( let i = 0; i < flen; i ++ ) { + const face = faces[ i ]; + f3( face[ 2 ], face[ 1 ], face[ 0 ] ); - const face = faces[ i ]; - f3( face[ 2 ], face[ 1 ], face[ 0 ] ); + } - } + // Top faces - // Top faces + for ( let i = 0; i < flen; i ++ ) { - for ( let i = 0; i < flen; i ++ ) { + const face = faces[ i ]; + f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); - const face = faces[ i ]; - f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); + } } - } + scope.addGroup( start, verticesArray.length / 3 - start, 0 ); - scope.addGroup( start, verticesArray.length / 3 - start, 0 ); + } - } + // Create faces for the z-sides of the shape - // Create faces for the z-sides of the shape + function buildSideFaces() { - function buildSideFaces() { + const start = verticesArray.length / 3; + let layeroffset = 0; + sidewalls( contour, layeroffset ); + layeroffset += contour.length; - const start = verticesArray.length / 3; - let layeroffset = 0; - sidewalls( contour, layeroffset ); - layeroffset += contour.length; + for ( let h = 0, hl = holes.length; h < hl; h ++ ) { - for ( let h = 0, hl = holes.length; h < hl; h ++ ) { + const ahole = holes[ h ]; + sidewalls( ahole, layeroffset ); - const ahole = holes[ h ]; - sidewalls( ahole, layeroffset ); + //, true + layeroffset += ahole.length; - //, true - layeroffset += ahole.length; + } - } + scope.addGroup( start, verticesArray.length / 3 - start, 1 ); - scope.addGroup( start, verticesArray.length / 3 - start, 1 ); + } - } + function sidewalls( contour, layeroffset ) { - function sidewalls( contour, layeroffset ) { + let i = contour.length; - let i = contour.length; + while ( -- i >= 0 ) { - while ( -- i >= 0 ) { + const j = i; + let k = i - 1; + if ( k < 0 ) k = contour.length - 1; - const j = i; - let k = i - 1; - if ( k < 0 ) k = contour.length - 1; + //console.log('b', i,j, i-1, k,vertices.length); - //console.log('b', i,j, i-1, k,vertices.length); + for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { - for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) { + const slen1 = vlen * s; + const slen2 = vlen * ( s + 1 ); - const slen1 = vlen * s; - const slen2 = vlen * ( s + 1 ); + const a = layeroffset + j + slen1, + b = layeroffset + k + slen1, + c = layeroffset + k + slen2, + d = layeroffset + j + slen2; - const a = layeroffset + j + slen1, - b = layeroffset + k + slen1, - c = layeroffset + k + slen2, - d = layeroffset + j + slen2; + f4( a, b, c, d ); - f4( a, b, c, d ); + } } } - } + function v( x, y, z ) { - function v( x, y, z ) { + placeholder.push( x ); + placeholder.push( y ); + placeholder.push( z ); - placeholder.push( x ); - placeholder.push( y ); - placeholder.push( z ); + } - } + function f3( a, b, c ) { - function f3( a, b, c ) { + addVertex( a ); + addVertex( b ); + addVertex( c ); - addVertex( a ); - addVertex( b ); - addVertex( c ); + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - const nextIndex = verticesArray.length / 3; - const uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); + } - } + function f4( a, b, c, d ) { - function f4( a, b, c, d ) { + addVertex( a ); + addVertex( b ); + addVertex( d ); - addVertex( a ); - addVertex( b ); - addVertex( d ); + addVertex( b ); + addVertex( c ); + addVertex( d ); - addVertex( b ); - addVertex( c ); - addVertex( d ); + const nextIndex = verticesArray.length / 3; + const uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - const nextIndex = verticesArray.length / 3; - const uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); + addUV( uvs[ 0 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 3 ] ); - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 3 ] ); + addUV( uvs[ 1 ] ); + addUV( uvs[ 2 ] ); + addUV( uvs[ 3 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); - addUV( uvs[ 3 ] ); + } - } + function addVertex( index ) { - function addVertex( index ) { + verticesArray.push( placeholder[ index * 3 + 0 ] ); + verticesArray.push( placeholder[ index * 3 + 1 ] ); + verticesArray.push( placeholder[ index * 3 + 2 ] ); - verticesArray.push( placeholder[ index * 3 + 0 ] ); - verticesArray.push( placeholder[ index * 3 + 1 ] ); - verticesArray.push( placeholder[ index * 3 + 2 ] ); + } - } + function addUV( vector2 ) { - function addUV( vector2 ) { + uvArray.push( vector2.x ); + uvArray.push( vector2.y ); - uvArray.push( vector2.x ); - uvArray.push( vector2.y ); + } } } -} - -ExtrudeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -ExtrudeBufferGeometry.prototype.constructor = ExtrudeBufferGeometry; + toJSON() { -ExtrudeBufferGeometry.prototype.toJSON = function () { - - const data = BufferGeometry.prototype.toJSON.call( this ); + const data = BufferGeometry.prototype.toJSON.call( this ); - const shapes = this.parameters.shapes; - const options = this.parameters.options; + const shapes = this.parameters.shapes; + const options = this.parameters.options; - return toJSON( shapes, options, data ); + return toJSON( shapes, options, data ); -}; + } -// +} const WorldUVGenerator = { @@ -31687,8 +31824,6 @@ const WorldUVGenerator = { function toJSON( shapes, options, data ) { - // - data.shapes = []; if ( Array.isArray( shapes ) ) { @@ -31707,8 +31842,6 @@ function toJSON( shapes, options, data ) { } - // - if ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON(); return data; @@ -31734,508 +31867,517 @@ function toJSON( shapes, options, data ) { // TextGeometry -function TextGeometry( text, parameters ) { +class TextGeometry extends Geometry { - Geometry.call( this ); + constructor( text, parameters ) { - this.type = 'TextGeometry'; + super(); + this.type = 'TextGeometry'; - this.parameters = { - text: text, - parameters: parameters - }; + this.parameters = { + text: text, + parameters: parameters + }; - this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); - this.mergeVertices(); + this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); + this.mergeVertices(); + + } } -TextGeometry.prototype = Object.create( Geometry.prototype ); -TextGeometry.prototype.constructor = TextGeometry; // TextBufferGeometry -function TextBufferGeometry( text, parameters ) { +class TextBufferGeometry extends ExtrudeBufferGeometry { - parameters = parameters || {}; + constructor( text, parameters ) { - const font = parameters.font; + parameters = parameters || {}; - if ( ! ( font && font.isFont ) ) { + const font = parameters.font; - console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); - return new Geometry(); + if ( ! ( font && font.isFont ) ) { - } + console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); + return new Geometry(); - const shapes = font.generateShapes( text, parameters.size ); + } - // translate parameters to ExtrudeGeometry API + const shapes = font.generateShapes( text, parameters.size ); - parameters.depth = parameters.height !== undefined ? parameters.height : 50; + // translate parameters to ExtrudeGeometry API - // defaults + parameters.depth = parameters.height !== undefined ? parameters.height : 50; - if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; - if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; - if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; + // defaults - ExtrudeBufferGeometry.call( this, shapes, parameters ); + if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; + if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; + if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; - this.type = 'TextBufferGeometry'; + super( shapes, parameters ); -} + this.type = 'TextBufferGeometry'; -TextBufferGeometry.prototype = Object.create( ExtrudeBufferGeometry.prototype ); -TextBufferGeometry.prototype.constructor = TextBufferGeometry; + } + +} // SphereGeometry -function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { +class SphereGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - this.type = 'SphereGeometry'; + super(); + this.type = 'SphereGeometry'; - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); + this.mergeVertices(); -} + } -SphereGeometry.prototype = Object.create( Geometry.prototype ); -SphereGeometry.prototype.constructor = SphereGeometry; +} // SphereBufferGeometry -function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { +class SphereBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - this.type = 'SphereBufferGeometry'; + super(); + this.type = 'SphereBufferGeometry'; - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + widthSegments: widthSegments, + heightSegments: heightSegments, + phiStart: phiStart, + phiLength: phiLength, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - radius = radius || 1; + radius = radius || 1; - widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); - heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); + widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); + heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); - phiStart = phiStart !== undefined ? phiStart : 0; - phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; + phiStart = phiStart !== undefined ? phiStart : 0; + phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; - const thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); + const thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); - let index = 0; - const grid = []; + let index = 0; + const grid = []; - const vertex = new Vector3(); - const normal = new Vector3(); + const vertex = new Vector3(); + const normal = new Vector3(); - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( let iy = 0; iy <= heightSegments; iy ++ ) { + for ( let iy = 0; iy <= heightSegments; iy ++ ) { - const verticesRow = []; + const verticesRow = []; - const v = iy / heightSegments; + const v = iy / heightSegments; - // special case for the poles + // special case for the poles - let uOffset = 0; + let uOffset = 0; - if ( iy == 0 && thetaStart == 0 ) { + if ( iy == 0 && thetaStart == 0 ) { - uOffset = 0.5 / widthSegments; + uOffset = 0.5 / widthSegments; - } else if ( iy == heightSegments && thetaEnd == Math.PI ) { + } else if ( iy == heightSegments && thetaEnd == Math.PI ) { - uOffset = - 0.5 / widthSegments; + uOffset = - 0.5 / widthSegments; - } + } - for ( let ix = 0; ix <= widthSegments; ix ++ ) { + for ( let ix = 0; ix <= widthSegments; ix ++ ) { - const u = ix / widthSegments; + const u = ix / widthSegments; - // vertex + // vertex - vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); - vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); + vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertices.push( vertex.x, vertex.y, vertex.z ); + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal + // normal - normal.copy( vertex ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + normal.copy( vertex ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - // uv + // uv - uvs.push( u + uOffset, 1 - v ); + uvs.push( u + uOffset, 1 - v ); - verticesRow.push( index ++ ); + verticesRow.push( index ++ ); - } + } - grid.push( verticesRow ); + grid.push( verticesRow ); - } + } - // indices + // indices - for ( let iy = 0; iy < heightSegments; iy ++ ) { + for ( let iy = 0; iy < heightSegments; iy ++ ) { - for ( let ix = 0; ix < widthSegments; ix ++ ) { + for ( let ix = 0; ix < widthSegments; ix ++ ) { - const a = grid[ iy ][ ix + 1 ]; - const b = grid[ iy ][ ix ]; - const c = grid[ iy + 1 ][ ix ]; - const d = grid[ iy + 1 ][ ix + 1 ]; + const a = grid[ iy ][ ix + 1 ]; + const b = grid[ iy ][ ix ]; + const c = grid[ iy + 1 ][ ix ]; + const d = grid[ iy + 1 ][ ix + 1 ]; - if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); - if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); + if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); + if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); + + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } } -SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; - // RingGeometry -function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { +class RingGeometry extends Geometry { - Geometry.call( this ); + constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - this.type = 'RingGeometry'; + super(); - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.type = 'RingGeometry'; - this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; -} + this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); + this.mergeVertices(); + + } -RingGeometry.prototype = Object.create( Geometry.prototype ); -RingGeometry.prototype.constructor = RingGeometry; +} // RingBufferGeometry -function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { +class RingBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - this.type = 'RingBufferGeometry'; + super(); - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.type = 'RingBufferGeometry'; - innerRadius = innerRadius || 0.5; - outerRadius = outerRadius || 1; + this.parameters = { + innerRadius: innerRadius, + outerRadius: outerRadius, + thetaSegments: thetaSegments, + phiSegments: phiSegments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + innerRadius = innerRadius || 0.5; + outerRadius = outerRadius || 1; - thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; - phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - // buffers + thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; + phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + // buffers - // some helper variables + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - let radius = innerRadius; - const radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); - const vertex = new Vector3(); - const uv = new Vector2(); + // some helper variables - // generate vertices, normals and uvs + let radius = innerRadius; + const radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); + const vertex = new Vector3(); + const uv = new Vector2(); - for ( let j = 0; j <= phiSegments; j ++ ) { + // generate vertices, normals and uvs - for ( let i = 0; i <= thetaSegments; i ++ ) { + for ( let j = 0; j <= phiSegments; j ++ ) { - // values are generate from the inside of the ring to the outside + for ( let i = 0; i <= thetaSegments; i ++ ) { - const segment = thetaStart + i / thetaSegments * thetaLength; + // values are generate from the inside of the ring to the outside - // vertex + const segment = thetaStart + i / thetaSegments * thetaLength; - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + // vertex - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - // normal + vertices.push( vertex.x, vertex.y, vertex.z ); - normals.push( 0, 0, 1 ); + // normal - // uv + normals.push( 0, 0, 1 ); - uv.x = ( vertex.x / outerRadius + 1 ) / 2; - uv.y = ( vertex.y / outerRadius + 1 ) / 2; + // uv - uvs.push( uv.x, uv.y ); + uv.x = ( vertex.x / outerRadius + 1 ) / 2; + uv.y = ( vertex.y / outerRadius + 1 ) / 2; - } + uvs.push( uv.x, uv.y ); - // increase the radius for next row of vertices + } - radius += radiusStep; + // increase the radius for next row of vertices - } + radius += radiusStep; - // indices + } - for ( let j = 0; j < phiSegments; j ++ ) { + // indices - const thetaSegmentLevel = j * ( thetaSegments + 1 ); + for ( let j = 0; j < phiSegments; j ++ ) { - for ( let i = 0; i < thetaSegments; i ++ ) { + const thetaSegmentLevel = j * ( thetaSegments + 1 ); - const segment = i + thetaSegmentLevel; + for ( let i = 0; i < thetaSegments; i ++ ) { - const a = segment; - const b = segment + thetaSegments + 1; - const c = segment + thetaSegments + 2; - const d = segment + 1; + const segment = i + thetaSegmentLevel; - // faces + const a = segment; + const b = segment + thetaSegments + 1; + const c = segment + thetaSegments + 2; + const d = segment + 1; - indices.push( a, b, d ); - indices.push( b, c, d ); + // faces + + indices.push( a, b, d ); + indices.push( b, c, d ); + + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + } } -RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -RingBufferGeometry.prototype.constructor = RingBufferGeometry; - // LatheGeometry -function LatheGeometry( points, segments, phiStart, phiLength ) { +class LatheGeometry extends Geometry { - Geometry.call( this ); + constructor( points, segments, phiStart, phiLength ) { - this.type = 'LatheGeometry'; + super(); - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + this.type = 'LatheGeometry'; - this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); - this.mergeVertices(); + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; -} + this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); + this.mergeVertices(); -LatheGeometry.prototype = Object.create( Geometry.prototype ); -LatheGeometry.prototype.constructor = LatheGeometry; + } + +} // LatheBufferGeometry -function LatheBufferGeometry( points, segments, phiStart, phiLength ) { +class LatheBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( points, segments, phiStart, phiLength ) { - this.type = 'LatheBufferGeometry'; + super(); - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; + this.type = 'LatheBufferGeometry'; - segments = Math.floor( segments ) || 12; - phiStart = phiStart || 0; - phiLength = phiLength || Math.PI * 2; + this.parameters = { + points: points, + segments: segments, + phiStart: phiStart, + phiLength: phiLength + }; - // clamp phiLength so it's in range of [ 0, 2PI ] + segments = Math.floor( segments ) || 12; + phiStart = phiStart || 0; + phiLength = phiLength || Math.PI * 2; - phiLength = MathUtils.clamp( phiLength, 0, Math.PI * 2 ); + // clamp phiLength so it's in range of [ 0, 2PI ] + phiLength = MathUtils.clamp( phiLength, 0, Math.PI * 2 ); - // buffers - const indices = []; - const vertices = []; - const uvs = []; + // buffers - // helper variables + const indices = []; + const vertices = []; + const uvs = []; + + // helper variables + + const inverseSegments = 1.0 / segments; + const vertex = new Vector3(); + const uv = new Vector2(); - const inverseSegments = 1.0 / segments; - const vertex = new Vector3(); - const uv = new Vector2(); + // generate vertices and uvs - // generate vertices and uvs + for ( let i = 0; i <= segments; i ++ ) { - for ( let i = 0; i <= segments; i ++ ) { + const phi = phiStart + i * inverseSegments * phiLength; - const phi = phiStart + i * inverseSegments * phiLength; + const sin = Math.sin( phi ); + const cos = Math.cos( phi ); - const sin = Math.sin( phi ); - const cos = Math.cos( phi ); + for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { - for ( let j = 0; j <= ( points.length - 1 ); j ++ ) { + // vertex - // vertex + vertex.x = points[ j ].x * sin; + vertex.y = points[ j ].y; + vertex.z = points[ j ].x * cos; - vertex.x = points[ j ].x * sin; - vertex.y = points[ j ].y; - vertex.z = points[ j ].x * cos; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertices.push( vertex.x, vertex.y, vertex.z ); + // uv - // uv + uv.x = i / segments; + uv.y = j / ( points.length - 1 ); - uv.x = i / segments; - uv.y = j / ( points.length - 1 ); + uvs.push( uv.x, uv.y ); - uvs.push( uv.x, uv.y ); + } } - } + // indices - // indices + for ( let i = 0; i < segments; i ++ ) { - for ( let i = 0; i < segments; i ++ ) { + for ( let j = 0; j < ( points.length - 1 ); j ++ ) { - for ( let j = 0; j < ( points.length - 1 ); j ++ ) { + const base = j + i * points.length; - const base = j + i * points.length; + const a = base; + const b = base + points.length; + const c = base + points.length + 1; + const d = base + 1; - const a = base; - const b = base + points.length; - const c = base + points.length + 1; - const d = base + 1; + // faces - // faces + indices.push( a, b, d ); + indices.push( b, c, d ); - indices.push( a, b, d ); - indices.push( b, c, d ); + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // generate normals - // generate normals + this.computeVertexNormals(); - this.computeVertexNormals(); + // if the geometry is closed, we need to average the normals along the seam. + // because the corresponding vertices are identical (but still have different UVs). - // if the geometry is closed, we need to average the normals along the seam. - // because the corresponding vertices are identical (but still have different UVs). + if ( phiLength === Math.PI * 2 ) { - if ( phiLength === Math.PI * 2 ) { + const normals = this.attributes.normal.array; + const n1 = new Vector3(); + const n2 = new Vector3(); + const n = new Vector3(); - const normals = this.attributes.normal.array; - const n1 = new Vector3(); - const n2 = new Vector3(); - const n = new Vector3(); + // this is the buffer offset for the last line of vertices - // this is the buffer offset for the last line of vertices + const base = segments * points.length * 3; - const base = segments * points.length * 3; + for ( let i = 0, j = 0; i < points.length; i ++, j += 3 ) { - for ( let i = 0, j = 0; i < points.length; i ++, j += 3 ) { + // select the normal of the vertex in the first line - // select the normal of the vertex in the first line + n1.x = normals[ j + 0 ]; + n1.y = normals[ j + 1 ]; + n1.z = normals[ j + 2 ]; - n1.x = normals[ j + 0 ]; - n1.y = normals[ j + 1 ]; - n1.z = normals[ j + 2 ]; + // select the normal of the vertex in the last line - // select the normal of the vertex in the last line + n2.x = normals[ base + j + 0 ]; + n2.y = normals[ base + j + 1 ]; + n2.z = normals[ base + j + 2 ]; - n2.x = normals[ base + j + 0 ]; - n2.y = normals[ base + j + 1 ]; - n2.z = normals[ base + j + 2 ]; + // average normals - // average normals + n.addVectors( n1, n2 ).normalize(); - n.addVectors( n1, n2 ).normalize(); + // assign the new values to both normals - // assign the new values to both normals + normals[ j + 0 ] = normals[ base + j + 0 ] = n.x; + normals[ j + 1 ] = normals[ base + j + 1 ] = n.y; + normals[ j + 2 ] = normals[ base + j + 2 ] = n.z; - normals[ j + 0 ] = normals[ base + j + 0 ] = n.x; - normals[ j + 1 ] = normals[ base + j + 1 ] = n.y; - normals[ j + 2 ] = normals[ base + j + 2 ] = n.z; + } } @@ -32243,188 +32385,185 @@ function LatheBufferGeometry( points, segments, phiStart, phiLength ) { } -LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; - // ShapeGeometry -function ShapeGeometry( shapes, curveSegments ) { +class ShapeGeometry extends Geometry { - Geometry.call( this ); + constructor( shapes, curveSegments ) { - this.type = 'ShapeGeometry'; + super(); + this.type = 'ShapeGeometry'; - if ( typeof curveSegments === 'object' ) { + if ( typeof curveSegments === 'object' ) { - console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); + console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); - curveSegments = curveSegments.curveSegments; + curveSegments = curveSegments.curveSegments; - } + } - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; - this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); - this.mergeVertices(); + this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); + this.mergeVertices(); -} + } -ShapeGeometry.prototype = Object.create( Geometry.prototype ); -ShapeGeometry.prototype.constructor = ShapeGeometry; + toJSON() { -ShapeGeometry.prototype.toJSON = function () { + const data = Geometry.prototype.toJSON.call( this ); - const data = Geometry.prototype.toJSON.call( this ); + const shapes = this.parameters.shapes; - const shapes = this.parameters.shapes; + return toJSON$1( shapes, data ); - return toJSON$1( shapes, data ); + } -}; +} // ShapeBufferGeometry -function ShapeBufferGeometry( shapes, curveSegments ) { +class ShapeBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( shapes, curveSegments ) { - this.type = 'ShapeBufferGeometry'; + super(); + this.type = 'ShapeBufferGeometry'; - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; + this.parameters = { + shapes: shapes, + curveSegments: curveSegments + }; - curveSegments = curveSegments || 12; + curveSegments = curveSegments || 12; - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // helper variables + // helper variables + + let groupStart = 0; + let groupCount = 0; - let groupStart = 0; - let groupCount = 0; + // allow single and array values for "shapes" parameter - // allow single and array values for "shapes" parameter + if ( Array.isArray( shapes ) === false ) { - if ( Array.isArray( shapes ) === false ) { + addShape( shapes ); - addShape( shapes ); + } else { - } else { + for ( let i = 0; i < shapes.length; i ++ ) { - for ( let i = 0; i < shapes.length; i ++ ) { + addShape( shapes[ i ] ); - addShape( shapes[ i ] ); + this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support - this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support + groupStart += groupCount; + groupCount = 0; - groupStart += groupCount; - groupCount = 0; + } } - } + // build geometry - // build geometry + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // helper functions - // helper functions + function addShape( shape ) { - function addShape( shape ) { + const indexOffset = vertices.length / 3; + const points = shape.extractPoints( curveSegments ); - const indexOffset = vertices.length / 3; - const points = shape.extractPoints( curveSegments ); + let shapeVertices = points.shape; + const shapeHoles = points.holes; - let shapeVertices = points.shape; - const shapeHoles = points.holes; + // check direction of vertices - // check direction of vertices + if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { - if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { + shapeVertices = shapeVertices.reverse(); - shapeVertices = shapeVertices.reverse(); + } - } + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { - for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { + const shapeHole = shapeHoles[ i ]; - const shapeHole = shapeHoles[ i ]; + if ( ShapeUtils.isClockWise( shapeHole ) === true ) { - if ( ShapeUtils.isClockWise( shapeHole ) === true ) { + shapeHoles[ i ] = shapeHole.reverse(); - shapeHoles[ i ] = shapeHole.reverse(); + } } - } + const faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); - const faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); + // join vertices of inner and outer paths to a single array - // join vertices of inner and outer paths to a single array + for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { - for ( let i = 0, l = shapeHoles.length; i < l; i ++ ) { + const shapeHole = shapeHoles[ i ]; + shapeVertices = shapeVertices.concat( shapeHole ); - const shapeHole = shapeHoles[ i ]; - shapeVertices = shapeVertices.concat( shapeHole ); + } - } + // vertices, normals, uvs - // vertices, normals, uvs + for ( let i = 0, l = shapeVertices.length; i < l; i ++ ) { - for ( let i = 0, l = shapeVertices.length; i < l; i ++ ) { + const vertex = shapeVertices[ i ]; - const vertex = shapeVertices[ i ]; + vertices.push( vertex.x, vertex.y, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( vertex.x, vertex.y ); // world uvs - vertices.push( vertex.x, vertex.y, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( vertex.x, vertex.y ); // world uvs + } - } + // incides - // incides + for ( let i = 0, l = faces.length; i < l; i ++ ) { - for ( let i = 0, l = faces.length; i < l; i ++ ) { + const face = faces[ i ]; - const face = faces[ i ]; + const a = face[ 0 ] + indexOffset; + const b = face[ 1 ] + indexOffset; + const c = face[ 2 ] + indexOffset; - const a = face[ 0 ] + indexOffset; - const b = face[ 1 ] + indexOffset; - const c = face[ 2 ] + indexOffset; + indices.push( a, b, c ); + groupCount += 3; - indices.push( a, b, c ); - groupCount += 3; + } } } -} - -ShapeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -ShapeBufferGeometry.prototype.constructor = ShapeBufferGeometry; + toJSON() { -ShapeBufferGeometry.prototype.toJSON = function () { + const data = BufferGeometry.prototype.toJSON.call( this ); - const data = BufferGeometry.prototype.toJSON.call( this ); + const shapes = this.parameters.shapes; - const shapes = this.parameters.shapes; + return toJSON$1( shapes, data ); - return toJSON$1( shapes, data ); + } -}; +} // @@ -32452,558 +32591,560 @@ function toJSON$1( shapes, data ) { } -function EdgesGeometry( geometry, thresholdAngle ) { +class EdgesGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( geometry, thresholdAngle ) { - this.type = 'EdgesGeometry'; + super(); - this.parameters = { - thresholdAngle: thresholdAngle - }; + this.type = 'EdgesGeometry'; - thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; + this.parameters = { + thresholdAngle: thresholdAngle + }; - // buffer + thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; - const vertices = []; + // buffer - // helper variables + const vertices = []; - const thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle ); - const edge = [ 0, 0 ], edges = {}; - let edge1, edge2, key; - const keys = [ 'a', 'b', 'c' ]; + // helper variables - // prepare source geometry + const thresholdDot = Math.cos( MathUtils.DEG2RAD * thresholdAngle ); + const edge = [ 0, 0 ], edges = {}; + let edge1, edge2, key; + const keys = [ 'a', 'b', 'c' ]; - let geometry2; + // prepare source geometry - if ( geometry.isBufferGeometry ) { + let geometry2; - geometry2 = new Geometry(); - geometry2.fromBufferGeometry( geometry ); + if ( geometry.isBufferGeometry ) { - } else { + geometry2 = new Geometry(); + geometry2.fromBufferGeometry( geometry ); - geometry2 = geometry.clone(); + } else { - } + geometry2 = geometry.clone(); - geometry2.mergeVertices(); - geometry2.computeFaceNormals(); + } - const sourceVertices = geometry2.vertices; - const faces = geometry2.faces; + geometry2.mergeVertices(); + geometry2.computeFaceNormals(); - // now create a data structure where each entry represents an edge with its adjoining faces + const sourceVertices = geometry2.vertices; + const faces = geometry2.faces; - for ( let i = 0, l = faces.length; i < l; i ++ ) { + // now create a data structure where each entry represents an edge with its adjoining faces - const face = faces[ i ]; + for ( let i = 0, l = faces.length; i < l; i ++ ) { - for ( let j = 0; j < 3; j ++ ) { + const face = faces[ i ]; - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); - edge[ 1 ] = Math.max( edge1, edge2 ); + for ( let j = 0; j < 3; j ++ ) { - key = edge[ 0 ] + ',' + edge[ 1 ]; + edge1 = face[ keys[ j ] ]; + edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; + edge[ 0 ] = Math.min( edge1, edge2 ); + edge[ 1 ] = Math.max( edge1, edge2 ); - if ( edges[ key ] === undefined ) { + key = edge[ 0 ] + ',' + edge[ 1 ]; - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; + if ( edges[ key ] === undefined ) { - } else { + edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; + + } else { - edges[ key ].face2 = i; + edges[ key ].face2 = i; + + } } } - } + // generate vertices - // generate vertices + for ( key in edges ) { - for ( key in edges ) { + const e = edges[ key ]; - const e = edges[ key ]; + // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. - // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. + if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { - if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { + let vertex = sourceVertices[ e.index1 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - let vertex = sourceVertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex = sourceVertices[ e.index2 ]; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex = sourceVertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); + } } - } + // build geometry - // build geometry + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + } } -EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); -EdgesGeometry.prototype.constructor = EdgesGeometry; - // CylinderGeometry -function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { +class CylinderGeometry extends Geometry { - Geometry.call( this ); + constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'CylinderGeometry'; + super(); + this.type = 'CylinderGeometry'; - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); + this.mergeVertices(); -} + } -CylinderGeometry.prototype = Object.create( Geometry.prototype ); -CylinderGeometry.prototype.constructor = CylinderGeometry; +} // CylinderBufferGeometry -function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { +class CylinderBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'CylinderBufferGeometry'; + super(); + this.type = 'CylinderBufferGeometry'; - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radiusTop: radiusTop, + radiusBottom: radiusBottom, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - const scope = this; + const scope = this; - radiusTop = radiusTop !== undefined ? radiusTop : 1; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; - height = height || 1; + radiusTop = radiusTop !== undefined ? radiusTop : 1; + radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; + height = height || 1; - radialSegments = Math.floor( radialSegments ) || 8; - heightSegments = Math.floor( heightSegments ) || 1; + radialSegments = Math.floor( radialSegments ) || 8; + heightSegments = Math.floor( heightSegments ) || 1; - openEnded = openEnded !== undefined ? openEnded : false; - thetaStart = thetaStart !== undefined ? thetaStart : 0.0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + openEnded = openEnded !== undefined ? openEnded : false; + thetaStart = thetaStart !== undefined ? thetaStart : 0.0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - // buffers + // buffers - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - // helper variables + // helper variables - let index = 0; - const indexArray = []; - const halfHeight = height / 2; - let groupStart = 0; + let index = 0; + const indexArray = []; + const halfHeight = height / 2; + let groupStart = 0; - // generate geometry + // generate geometry - generateTorso(); + generateTorso(); - if ( openEnded === false ) { + if ( openEnded === false ) { - if ( radiusTop > 0 ) generateCap( true ); - if ( radiusBottom > 0 ) generateCap( false ); + if ( radiusTop > 0 ) generateCap( true ); + if ( radiusBottom > 0 ) generateCap( false ); - } + } - // build geometry + // build geometry - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - function generateTorso() { + function generateTorso() { - const normal = new Vector3(); - const vertex = new Vector3(); + const normal = new Vector3(); + const vertex = new Vector3(); - let groupCount = 0; + let groupCount = 0; - // this will be used to calculate the normal - const slope = ( radiusBottom - radiusTop ) / height; + // this will be used to calculate the normal + const slope = ( radiusBottom - radiusTop ) / height; - // generate vertices, normals and uvs + // generate vertices, normals and uvs - for ( let y = 0; y <= heightSegments; y ++ ) { + for ( let y = 0; y <= heightSegments; y ++ ) { - const indexRow = []; + const indexRow = []; - const v = y / heightSegments; + const v = y / heightSegments; - // calculate the radius of the current row + // calculate the radius of the current row - const radius = v * ( radiusBottom - radiusTop ) + radiusTop; + const radius = v * ( radiusBottom - radiusTop ) + radiusTop; - for ( let x = 0; x <= radialSegments; x ++ ) { + for ( let x = 0; x <= radialSegments; x ++ ) { - const u = x / radialSegments; + const u = x / radialSegments; - const theta = u * thetaLength + thetaStart; + const theta = u * thetaLength + thetaStart; - const sinTheta = Math.sin( theta ); - const cosTheta = Math.cos( theta ); + const sinTheta = Math.sin( theta ); + const cosTheta = Math.cos( theta ); - // vertex + // vertex - vertex.x = radius * sinTheta; - vertex.y = - v * height + halfHeight; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex.x = radius * sinTheta; + vertex.y = - v * height + halfHeight; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - // normal + // normal - normal.set( sinTheta, slope, cosTheta ).normalize(); - normals.push( normal.x, normal.y, normal.z ); + normal.set( sinTheta, slope, cosTheta ).normalize(); + normals.push( normal.x, normal.y, normal.z ); - // uv + // uv - uvs.push( u, 1 - v ); + uvs.push( u, 1 - v ); - // save index of vertex in respective row + // save index of vertex in respective row - indexRow.push( index ++ ); + indexRow.push( index ++ ); - } + } - // now save vertices of the row in our index array + // now save vertices of the row in our index array - indexArray.push( indexRow ); + indexArray.push( indexRow ); - } + } - // generate indices + // generate indices - for ( let x = 0; x < radialSegments; x ++ ) { + for ( let x = 0; x < radialSegments; x ++ ) { - for ( let y = 0; y < heightSegments; y ++ ) { + for ( let y = 0; y < heightSegments; y ++ ) { - // we use the index array to access the correct indices + // we use the index array to access the correct indices - const a = indexArray[ y ][ x ]; - const b = indexArray[ y + 1 ][ x ]; - const c = indexArray[ y + 1 ][ x + 1 ]; - const d = indexArray[ y ][ x + 1 ]; + const a = indexArray[ y ][ x ]; + const b = indexArray[ y + 1 ][ x ]; + const c = indexArray[ y + 1 ][ x + 1 ]; + const d = indexArray[ y ][ x + 1 ]; - // faces + // faces - indices.push( a, b, d ); - indices.push( b, c, d ); + indices.push( a, b, d ); + indices.push( b, c, d ); - // update group counter + // update group counter - groupCount += 6; + groupCount += 6; + + } } - } + // add a group to the geometry. this will ensure multi material support - // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, 0 ); - scope.addGroup( groupStart, groupCount, 0 ); + // calculate new start value for groups - // calculate new start value for groups + groupStart += groupCount; - groupStart += groupCount; + } - } + function generateCap( top ) { - function generateCap( top ) { + // save the index of the first center vertex + const centerIndexStart = index; - // save the index of the first center vertex - const centerIndexStart = index; + const uv = new Vector2(); + const vertex = new Vector3(); - const uv = new Vector2(); - const vertex = new Vector3(); + let groupCount = 0; - let groupCount = 0; + const radius = ( top === true ) ? radiusTop : radiusBottom; + const sign = ( top === true ) ? 1 : - 1; - const radius = ( top === true ) ? radiusTop : radiusBottom; - const sign = ( top === true ) ? 1 : - 1; + // first we generate the center vertex data of the cap. + // because the geometry needs one set of uvs per face, + // we must generate a center vertex per face/segment - // first we generate the center vertex data of the cap. - // because the geometry needs one set of uvs per face, - // we must generate a center vertex per face/segment + for ( let x = 1; x <= radialSegments; x ++ ) { - for ( let x = 1; x <= radialSegments; x ++ ) { + // vertex - // vertex + vertices.push( 0, halfHeight * sign, 0 ); - vertices.push( 0, halfHeight * sign, 0 ); + // normal - // normal + normals.push( 0, sign, 0 ); - normals.push( 0, sign, 0 ); + // uv - // uv + uvs.push( 0.5, 0.5 ); - uvs.push( 0.5, 0.5 ); + // increase index - // increase index + index ++; - index ++; + } - } + // save the index of the last center vertex + const centerIndexEnd = index; - // save the index of the last center vertex - const centerIndexEnd = index; + // now we generate the surrounding vertices, normals and uvs - // now we generate the surrounding vertices, normals and uvs + for ( let x = 0; x <= radialSegments; x ++ ) { - for ( let x = 0; x <= radialSegments; x ++ ) { + const u = x / radialSegments; + const theta = u * thetaLength + thetaStart; - const u = x / radialSegments; - const theta = u * thetaLength + thetaStart; + const cosTheta = Math.cos( theta ); + const sinTheta = Math.sin( theta ); - const cosTheta = Math.cos( theta ); - const sinTheta = Math.sin( theta ); + // vertex - // vertex + vertex.x = radius * sinTheta; + vertex.y = halfHeight * sign; + vertex.z = radius * cosTheta; + vertices.push( vertex.x, vertex.y, vertex.z ); - vertex.x = radius * sinTheta; - vertex.y = halfHeight * sign; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); + // normal - // normal + normals.push( 0, sign, 0 ); - normals.push( 0, sign, 0 ); + // uv - // uv + uv.x = ( cosTheta * 0.5 ) + 0.5; + uv.y = ( sinTheta * 0.5 * sign ) + 0.5; + uvs.push( uv.x, uv.y ); - uv.x = ( cosTheta * 0.5 ) + 0.5; - uv.y = ( sinTheta * 0.5 * sign ) + 0.5; - uvs.push( uv.x, uv.y ); + // increase index - // increase index + index ++; - index ++; + } - } + // generate indices - // generate indices + for ( let x = 0; x < radialSegments; x ++ ) { - for ( let x = 0; x < radialSegments; x ++ ) { + const c = centerIndexStart + x; + const i = centerIndexEnd + x; - const c = centerIndexStart + x; - const i = centerIndexEnd + x; + if ( top === true ) { - if ( top === true ) { + // face top - // face top + indices.push( i, i + 1, c ); - indices.push( i, i + 1, c ); + } else { - } else { + // face bottom - // face bottom + indices.push( i + 1, i, c ); - indices.push( i + 1, i, c ); + } - } + groupCount += 3; - groupCount += 3; + } - } + // add a group to the geometry. this will ensure multi material support - // add a group to the geometry. this will ensure multi material support + scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); - scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); + // calculate new start value for groups - // calculate new start value for groups + groupStart += groupCount; - groupStart += groupCount; + } } } -CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; - // ConeGeometry -function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { +class ConeGeometry extends CylinderGeometry { - CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'ConeGeometry'; + super( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + this.type = 'ConeGeometry'; - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; -} + } -ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); -ConeGeometry.prototype.constructor = ConeGeometry; +} // ConeBufferGeometry -function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { +class ConeBufferGeometry extends CylinderBufferGeometry { - CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - this.type = 'ConeBufferGeometry'; + super( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); + this.type = 'ConeBufferGeometry'; - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + height: height, + radialSegments: radialSegments, + heightSegments: heightSegments, + openEnded: openEnded, + thetaStart: thetaStart, + thetaLength: thetaLength + }; -} + } -ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); -ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; +} // CircleGeometry -function CircleGeometry( radius, segments, thetaStart, thetaLength ) { +class CircleGeometry extends Geometry { - Geometry.call( this ); + constructor( radius, segments, thetaStart, thetaLength ) { - this.type = 'CircleGeometry'; + super(); + this.type = 'CircleGeometry'; - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); - this.mergeVertices(); + this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); + this.mergeVertices(); -} + } -CircleGeometry.prototype = Object.create( Geometry.prototype ); -CircleGeometry.prototype.constructor = CircleGeometry; +} // CircleBufferGeometry -function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { +class CircleBufferGeometry extends BufferGeometry { - BufferGeometry.call( this ); + constructor( radius, segments, thetaStart, thetaLength ) { - this.type = 'CircleBufferGeometry'; + super(); - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; + this.type = 'CircleBufferGeometry'; - radius = radius || 1; - segments = segments !== undefined ? Math.max( 3, segments ) : 8; + this.parameters = { + radius: radius, + segments: segments, + thetaStart: thetaStart, + thetaLength: thetaLength + }; - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; + radius = radius || 1; + segments = segments !== undefined ? Math.max( 3, segments ) : 8; - // buffers + thetaStart = thetaStart !== undefined ? thetaStart : 0; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; + // buffers - // helper variables + const indices = []; + const vertices = []; + const normals = []; + const uvs = []; - const vertex = new Vector3(); - const uv = new Vector2(); + // helper variables - // center point + const vertex = new Vector3(); + const uv = new Vector2(); - vertices.push( 0, 0, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( 0.5, 0.5 ); + // center point - for ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) { + vertices.push( 0, 0, 0 ); + normals.push( 0, 0, 1 ); + uvs.push( 0.5, 0.5 ); - const segment = thetaStart + s / segments * thetaLength; + for ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) { - // vertex + const segment = thetaStart + s / segments * thetaLength; - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); + // vertex - vertices.push( vertex.x, vertex.y, vertex.z ); + vertex.x = radius * Math.cos( segment ); + vertex.y = radius * Math.sin( segment ); - // normal + vertices.push( vertex.x, vertex.y, vertex.z ); - normals.push( 0, 0, 1 ); + // normal - // uvs + normals.push( 0, 0, 1 ); - uv.x = ( vertices[ i ] / radius + 1 ) / 2; - uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; + // uvs - uvs.push( uv.x, uv.y ); + uv.x = ( vertices[ i ] / radius + 1 ) / 2; + uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; - } + uvs.push( uv.x, uv.y ); - // indices + } - for ( let i = 1; i <= segments; i ++ ) { + // indices - indices.push( i, i + 1, 0 ); + for ( let i = 1; i <= segments; i ++ ) { - } + indices.push( i, i + 1, 0 ); - // build geometry + } - this.setIndex( indices ); - this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); + // build geometry -} + this.setIndex( indices ); + this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); + this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); -CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; + } + +} var Geometries = /*#__PURE__*/Object.freeze({ __proto__: null, @@ -34288,13 +34429,30 @@ const AnimationUtils = { const targetTrack = targetClip.tracks.find( function ( track ) { return track.name === referenceTrack.name - && track.ValueTypeName === referenceTrackType; + && track.ValueTypeName === referenceTrackType; } ); if ( targetTrack === undefined ) continue; - const valueSize = referenceTrack.getValueSize(); + let referenceOffset = 0; + const referenceValueSize = referenceTrack.getValueSize(); + + if ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + referenceOffset = referenceValueSize / 3; + + } + + let targetOffset = 0; + const targetValueSize = targetTrack.getValueSize(); + + if ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) { + + targetOffset = targetValueSize / 3; + + } + const lastIndex = referenceTrack.times.length - 1; let referenceValue; @@ -34302,32 +34460,32 @@ const AnimationUtils = { if ( referenceTime <= referenceTrack.times[ 0 ] ) { // Reference frame is earlier than the first keyframe, so just use the first keyframe - referenceValue = AnimationUtils.arraySlice( referenceTrack.values, 0, referenceTrack.valueSize ); + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex ); } else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) { // Reference frame is after the last keyframe, so just use the last keyframe - const startIndex = lastIndex * valueSize; - referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex ); + const startIndex = lastIndex * referenceValueSize + referenceOffset; + const endIndex = startIndex + referenceValueSize - referenceOffset; + referenceValue = AnimationUtils.arraySlice( referenceTrack.values, startIndex, endIndex ); } else { // Interpolate to the reference value const interpolant = referenceTrack.createInterpolant(); + const startIndex = referenceOffset; + const endIndex = referenceValueSize - referenceOffset; interpolant.evaluate( referenceTime ); - referenceValue = interpolant.resultBuffer; + referenceValue = AnimationUtils.arraySlice( interpolant.resultBuffer, startIndex, endIndex ); } // Conjugate the quaternion if ( referenceTrackType === 'quaternion' ) { - const referenceQuat = new Quaternion( - referenceValue[ 0 ], - referenceValue[ 1 ], - referenceValue[ 2 ], - referenceValue[ 3 ] - ).normalize().conjugate(); + const referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate(); referenceQuat.toArray( referenceValue ); } @@ -34337,7 +34495,7 @@ const AnimationUtils = { const numTimes = targetTrack.times.length; for ( let j = 0; j < numTimes; ++ j ) { - const valueStart = j * valueSize; + const valueStart = j * targetValueSize + targetOffset; if ( referenceTrackType === 'quaternion' ) { @@ -34353,8 +34511,10 @@ const AnimationUtils = { } else { + const valueEnd = targetValueSize - targetOffset * 2; + // Subtract each value for all other numeric track types - for ( let k = 0; k < valueSize; ++ k ) { + for ( let k = 0; k < valueEnd; ++ k ) { targetTrack.values[ valueStart + k ] -= referenceValue[ k ]; @@ -36666,96 +36826,6 @@ CompressedTextureLoader.prototype = Object.assign( Object.create( Loader.prototy } ); -/** - * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) - * - * Sub classes have to implement the parse() method which will be used in load(). - */ - -function DataTextureLoader( manager ) { - - Loader.call( this, manager ); - -} - -DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: DataTextureLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - const scope = this; - - const texture = new DataTexture(); - - const loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); - loader.setRequestHeader( this.requestHeader ); - loader.setPath( this.path ); - loader.load( url, function ( buffer ) { - - const texData = scope.parse( buffer ); - - if ( ! texData ) return; - - if ( texData.image !== undefined ) { - - texture.image = texData.image; - - } else if ( texData.data !== undefined ) { - - texture.image.width = texData.width; - texture.image.height = texData.height; - texture.image.data = texData.data; - - } - - texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; - texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; - - texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; - texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; - - texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; - - if ( texData.format !== undefined ) { - - texture.format = texData.format; - - } - - if ( texData.type !== undefined ) { - - texture.type = texData.type; - - } - - if ( texData.mipmaps !== undefined ) { - - texture.mipmaps = texData.mipmaps; - texture.minFilter = LinearMipmapLinearFilter; // presumably... - - } - - if ( texData.mipmapCount === 1 ) { - - texture.minFilter = LinearFilter; - - } - - texture.needsUpdate = true; - - if ( onLoad ) onLoad( texture, texData ); - - }, onProgress, onError ); - - - return texture; - - } - -} ); - function ImageLoader( manager ) { Loader.call( this, manager ); @@ -36890,6 +36960,96 @@ CubeTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), } ); +/** + * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) + * + * Sub classes have to implement the parse() method which will be used in load(). + */ + +function DataTextureLoader( manager ) { + + Loader.call( this, manager ); + +} + +DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { + + constructor: DataTextureLoader, + + load: function ( url, onLoad, onProgress, onError ) { + + const scope = this; + + const texture = new DataTexture(); + + const loader = new FileLoader( this.manager ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setPath( this.path ); + loader.load( url, function ( buffer ) { + + const texData = scope.parse( buffer ); + + if ( ! texData ) return; + + if ( texData.image !== undefined ) { + + texture.image = texData.image; + + } else if ( texData.data !== undefined ) { + + texture.image.width = texData.width; + texture.image.height = texData.height; + texture.image.data = texData.data; + + } + + texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; + texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; + + texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; + texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter; + + texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; + + if ( texData.format !== undefined ) { + + texture.format = texData.format; + + } + + if ( texData.type !== undefined ) { + + texture.type = texData.type; + + } + + if ( texData.mipmaps !== undefined ) { + + texture.mipmaps = texData.mipmaps; + texture.minFilter = LinearMipmapLinearFilter; // presumably... + + } + + if ( texData.mipmapCount === 1 ) { + + texture.minFilter = LinearFilter; + + } + + texture.needsUpdate = true; + + if ( onLoad ) onLoad( texture, texData ); + + }, onProgress, onError ); + + + return texture; + + } + +} ); + function TextureLoader( manager ) { Loader.call( this, manager ); @@ -39631,23 +39791,21 @@ RectAreaLight.prototype = Object.assign( Object.create( Light.prototype ), { // 3-band SH defined by 9 coefficients -function SphericalHarmonics3() { - - this.coefficients = []; +class SphericalHarmonics3 { - for ( let i = 0; i < 9; i ++ ) { + constructor() { - this.coefficients.push( new Vector3() ); + this.coefficients = []; - } + for ( let i = 0; i < 9; i ++ ) { -} + this.coefficients.push( new Vector3() ); -Object.assign( SphericalHarmonics3.prototype, { + } - isSphericalHarmonics3: true, + } - set: function ( coefficients ) { + set( coefficients ) { for ( let i = 0; i < 9; i ++ ) { @@ -39657,9 +39815,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - zero: function () { + zero() { for ( let i = 0; i < 9; i ++ ) { @@ -39669,11 +39827,11 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } // get the radiance in the direction of the normal // target is a Vector3 - getAt: function ( normal, target ) { + getAt( normal, target ) { // normal is assumed to be unit length @@ -39698,12 +39856,12 @@ Object.assign( SphericalHarmonics3.prototype, { return target; - }, + } // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal // target is a Vector3 // https://graphics.stanford.edu/papers/envmap/envmap.pdf - getIrradianceAt: function ( normal, target ) { + getIrradianceAt( normal, target ) { // normal is assumed to be unit length @@ -39728,9 +39886,9 @@ Object.assign( SphericalHarmonics3.prototype, { return target; - }, + } - add: function ( sh ) { + add( sh ) { for ( let i = 0; i < 9; i ++ ) { @@ -39740,9 +39898,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - addScaledSH: function ( sh, s ) { + addScaledSH( sh, s ) { for ( let i = 0; i < 9; i ++ ) { @@ -39752,9 +39910,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - scale: function ( s ) { + scale( s ) { for ( let i = 0; i < 9; i ++ ) { @@ -39764,9 +39922,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - lerp: function ( sh, alpha ) { + lerp( sh, alpha ) { for ( let i = 0; i < 9; i ++ ) { @@ -39776,9 +39934,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - equals: function ( sh ) { + equals( sh ) { for ( let i = 0; i < 9; i ++ ) { @@ -39792,21 +39950,21 @@ Object.assign( SphericalHarmonics3.prototype, { return true; - }, + } - copy: function ( sh ) { + copy( sh ) { return this.set( sh.coefficients ); - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - fromArray: function ( array, offset ) { + fromArray( array, offset ) { if ( offset === undefined ) offset = 0; @@ -39820,9 +39978,9 @@ Object.assign( SphericalHarmonics3.prototype, { return this; - }, + } - toArray: function ( array, offset ) { + toArray( array, offset ) { if ( array === undefined ) array = []; if ( offset === undefined ) offset = 0; @@ -39839,13 +39997,9 @@ Object.assign( SphericalHarmonics3.prototype, { } -} ); - -Object.assign( SphericalHarmonics3, { - // evaluate the basis functions // shBasis is an Array[ 9 ] - getBasisAt: function ( normal, shBasis ) { + static getBasisAt( normal, shBasis ) { // normal is assumed to be unit length @@ -39868,7 +40022,9 @@ Object.assign( SphericalHarmonics3, { } -} ); +} + +SphericalHarmonics3.prototype.isSphericalHarmonics3 = true; function LightProbe( sh, intensity ) { @@ -40089,6 +40245,7 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), { case 'm3': material.uniforms[ name ].value = new Matrix3().fromArray( uniform.value ); + break; case 'm4': material.uniforms[ name ].value = new Matrix4().fromArray( uniform.value ); @@ -42402,38 +42559,36 @@ const _quaternion$3 = new Quaternion(); const _scale$1 = new Vector3(); const _orientation = new Vector3(); -function AudioListener() { - - Object3D.call( this ); +class AudioListener extends Object3D { - this.type = 'AudioListener'; + constructor() { - this.context = AudioContext.getContext(); + super(); - this.gain = this.context.createGain(); - this.gain.connect( this.context.destination ); + this.type = 'AudioListener'; - this.filter = null; + this.context = AudioContext.getContext(); - this.timeDelta = 0; + this.gain = this.context.createGain(); + this.gain.connect( this.context.destination ); - // private + this.filter = null; - this._clock = new Clock(); + this.timeDelta = 0; -} + // private -AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { + this._clock = new Clock(); - constructor: AudioListener, + } - getInput: function () { + getInput() { return this.gain; - }, + } - removeFilter: function ( ) { + removeFilter() { if ( this.filter !== null ) { @@ -42446,15 +42601,15 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - getFilter: function () { + getFilter() { return this.filter; - }, + } - setFilter: function ( value ) { + setFilter( value ) { if ( this.filter !== null ) { @@ -42473,25 +42628,25 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - getMasterVolume: function () { + getMasterVolume() { return this.gain.gain.value; - }, + } - setMasterVolume: function ( value ) { + setMasterVolume( value ) { this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); return this; - }, + } - updateMatrixWorld: function ( force ) { + updateMatrixWorld( force ) { - Object3D.prototype.updateMatrixWorld.call( this, force ); + super.updateMatrixWorld( force ); const listener = this.context.listener; const up = this.up; @@ -42527,52 +42682,52 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { } -} ); +} -function Audio( listener ) { +class Audio extends Object3D { - Object3D.call( this ); + constructor( listener ) { - this.type = 'Audio'; - - this.listener = listener; - this.context = listener.context; + super(); - this.gain = this.context.createGain(); - this.gain.connect( listener.getInput() ); + this.type = 'Audio'; - this.autoplay = false; + this.listener = listener; + this.context = listener.context; - this.buffer = null; - this.detune = 0; - this.loop = false; - this.loopStart = 0; - this.loopEnd = 0; - this.offset = 0; - this.duration = undefined; - this.playbackRate = 1; - this.isPlaying = false; - this.hasPlaybackControl = true; - this.sourceType = 'empty'; + this.gain = this.context.createGain(); + this.gain.connect( listener.getInput() ); - this._startedAt = 0; - this._progress = 0; + this.autoplay = false; - this.filters = []; + this.buffer = null; + this.detune = 0; + this.loop = false; + this.loopStart = 0; + this.loopEnd = 0; + this.offset = 0; + this.duration = undefined; + this.playbackRate = 1; + this.isPlaying = false; + this.hasPlaybackControl = true; + this.source = null; + this.sourceType = 'empty'; -} + this._startedAt = 0; + this._progress = 0; + this._connected = false; -Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { + this.filters = []; - constructor: Audio, + } - getOutput: function () { + getOutput() { return this.gain; - }, + } - setNodeSource: function ( audioNode ) { + setNodeSource( audioNode ) { this.hasPlaybackControl = false; this.sourceType = 'audioNode'; @@ -42581,9 +42736,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - setMediaElementSource: function ( mediaElement ) { + setMediaElementSource( mediaElement ) { this.hasPlaybackControl = false; this.sourceType = 'mediaNode'; @@ -42592,9 +42747,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - setMediaStreamSource: function ( mediaStream ) { + setMediaStreamSource( mediaStream ) { this.hasPlaybackControl = false; this.sourceType = 'mediaStreamNode'; @@ -42603,9 +42758,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - setBuffer: function ( audioBuffer ) { + setBuffer( audioBuffer ) { this.buffer = audioBuffer; this.sourceType = 'buffer'; @@ -42614,9 +42769,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - play: function ( delay ) { + play( delay ) { if ( delay === undefined ) delay = 0; @@ -42653,9 +42808,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this.connect(); - }, + } - pause: function () { + pause() { if ( this.hasPlaybackControl === false ) { @@ -42687,9 +42842,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - stop: function () { + stop() { if ( this.hasPlaybackControl === false ) { @@ -42706,9 +42861,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - connect: function () { + connect() { if ( this.filters.length > 0 ) { @@ -42728,11 +42883,13 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { } + this._connected = true; + return this; - }, + } - disconnect: function () { + disconnect() { if ( this.filters.length > 0 ) { @@ -42752,21 +42909,23 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { } + this._connected = false; + return this; - }, + } - getFilters: function () { + getFilters() { return this.filters; - }, + } - setFilters: function ( value ) { + setFilters( value ) { if ( ! value ) value = []; - if ( this.isPlaying === true ) { + if ( this._connected === true ) { this.disconnect(); this.filters = value; @@ -42780,9 +42939,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - setDetune: function ( value ) { + setDetune( value ) { this.detune = value; @@ -42796,27 +42955,27 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - getDetune: function () { + getDetune() { return this.detune; - }, + } - getFilter: function () { + getFilter() { return this.getFilters()[ 0 ]; - }, + } - setFilter: function ( filter ) { + setFilter( filter ) { return this.setFilters( filter ? [ filter ] : [] ); - }, + } - setPlaybackRate: function ( value ) { + setPlaybackRate( value ) { if ( this.hasPlaybackControl === false ) { @@ -42835,21 +42994,21 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - getPlaybackRate: function () { + getPlaybackRate() { return this.playbackRate; - }, + } - onEnded: function () { + onEnded() { this.isPlaying = false; - }, + } - getLoop: function () { + getLoop() { if ( this.hasPlaybackControl === false ) { @@ -42860,9 +43019,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this.loop; - }, + } - setLoop: function ( value ) { + setLoop( value ) { if ( this.hasPlaybackControl === false ) { @@ -42881,31 +43040,31 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { return this; - }, + } - setLoopStart: function ( value ) { + setLoopStart( value ) { this.loopStart = value; return this; - }, + } - setLoopEnd: function ( value ) { + setLoopEnd( value ) { this.loopEnd = value; return this; - }, + } - getVolume: function () { + getVolume() { return this.gain.gain.value; - }, + } - setVolume: function ( value ) { + setVolume( value ) { this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); @@ -42913,90 +43072,88 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { } -} ); +} const _position$3 = new Vector3(); const _quaternion$4 = new Quaternion(); const _scale$2 = new Vector3(); const _orientation$1 = new Vector3(); -function PositionalAudio( listener ) { +class PositionalAudio extends Audio { - Audio.call( this, listener ); + constructor( listener ) { - this.panner = this.context.createPanner(); - this.panner.panningModel = 'HRTF'; - this.panner.connect( this.gain ); + super( listener ); -} + this.panner = this.context.createPanner(); + this.panner.panningModel = 'HRTF'; + this.panner.connect( this.gain ); -PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { - - constructor: PositionalAudio, + } - getOutput: function () { + getOutput() { return this.panner; - }, + } - getRefDistance: function () { + getRefDistance() { return this.panner.refDistance; - }, + } - setRefDistance: function ( value ) { + setRefDistance( value ) { this.panner.refDistance = value; return this; - }, + } - getRolloffFactor: function () { + getRolloffFactor() { return this.panner.rolloffFactor; - }, + } - setRolloffFactor: function ( value ) { + setRolloffFactor( value ) { this.panner.rolloffFactor = value; return this; - }, + } - getDistanceModel: function () { + getDistanceModel() { return this.panner.distanceModel; - }, + } - setDistanceModel: function ( value ) { + setDistanceModel( value ) { this.panner.distanceModel = value; return this; - }, + } - getMaxDistance: function () { + getMaxDistance() { return this.panner.maxDistance; - }, + } - setMaxDistance: function ( value ) { + setMaxDistance( value ) { this.panner.maxDistance = value; return this; - }, + } - setDirectionalCone: function ( coneInnerAngle, coneOuterAngle, coneOuterGain ) { + setDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) { this.panner.coneInnerAngle = coneInnerAngle; this.panner.coneOuterAngle = coneOuterAngle; @@ -43004,11 +43161,11 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { return this; - }, + } - updateMatrixWorld: function ( force ) { + updateMatrixWorld( force ) { - Object3D.prototype.updateMatrixWorld.call( this, force ); + super.updateMatrixWorld( force ); if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; @@ -43040,7 +43197,7 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { } -} ); +} class AudioAnalyser { @@ -43315,7 +43472,7 @@ Object.assign( PropertyMixer.prototype, { _setAdditiveIdentityQuaternion: function () { this._setAdditiveIdentityNumeric(); - this.buffer[ this._addIndex * 4 + 3 ] = 1; + this.buffer[ this._addIndex * this.valueSize + 3 ] = 1; }, @@ -45980,6 +46137,81 @@ InstancedInterleavedBuffer.prototype = Object.assign( Object.create( Interleaved } ); +/** + * @author raub / https://github.com/raub + */ + +/** + * Element size is one of: + * 5126: 4 + * 5123: 2 + * 5122: 2 + * 5125: 4 + * 5124: 4 + * 5120: 1 + * 5121: 1 + */ +function GLBufferAttribute( buffer, type, itemSize, elementSize, count ) { + + this.buffer = buffer; + this.type = type; + this.itemSize = itemSize; + this.elementSize = elementSize; + this.count = count; + + this.version = 0; + +} + +Object.defineProperty( GLBufferAttribute.prototype, 'needsUpdate', { + + set: function ( value ) { + + if ( value === true ) this.version ++; + + } + +} ); + +Object.assign( GLBufferAttribute.prototype, { + + isGLBufferAttribute: true, + + setBuffer: function ( buffer ) { + + this.buffer = buffer; + + return this; + + }, + + setType: function ( type, elementSize ) { + + this.type = type; + this.elementSize = elementSize; + + return this; + + }, + + setItemSize: function ( itemSize ) { + + this.itemSize = itemSize; + + return this; + + }, + + setCount: function ( count ) { + + this.count = count; + + return this; + + }, + +} ); + function Raycaster( origin, direction, near, far ) { this.ray = new Ray( origin, direction ); @@ -46195,19 +46427,19 @@ class Spherical { * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system */ -function Cylindrical( radius, theta, y ) { +class Cylindrical { - this.radius = ( radius !== undefined ) ? radius : 1.0; // distance from the origin to a point in the x-z plane - this.theta = ( theta !== undefined ) ? theta : 0; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis - this.y = ( y !== undefined ) ? y : 0; // height above the x-z plane + constructor( radius, theta, y ) { - return this; + this.radius = ( radius !== undefined ) ? radius : 1.0; // distance from the origin to a point in the x-z plane + this.theta = ( theta !== undefined ) ? theta : 0; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis + this.y = ( y !== undefined ) ? y : 0; // height above the x-z plane -} + return this; -Object.assign( Cylindrical.prototype, { + } - set: function ( radius, theta, y ) { + set( radius, theta, y ) { this.radius = radius; this.theta = theta; @@ -46215,15 +46447,15 @@ Object.assign( Cylindrical.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( other ) { + copy( other ) { this.radius = other.radius; this.theta = other.theta; @@ -46231,15 +46463,15 @@ Object.assign( Cylindrical.prototype, { return this; - }, + } - setFromVector3: function ( v ) { + setFromVector3( v ) { return this.setFromCartesianCoords( v.x, v.y, v.z ); - }, + } - setFromCartesianCoords: function ( x, y, z ) { + setFromCartesianCoords( x, y, z ) { this.radius = Math.sqrt( x * x + z * z ); this.theta = Math.atan2( x, z ); @@ -46249,29 +46481,29 @@ Object.assign( Cylindrical.prototype, { } -} ); +} const _vector$7 = new Vector2(); -function Box2( min, max ) { +class Box2 { - this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); + constructor( min, max ) { -} + this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); + this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); -Object.assign( Box2.prototype, { + } - set: function ( min, max ) { + set( min, max ) { this.min.copy( min ); this.max.copy( max ); return this; - }, + } - setFromPoints: function ( points ) { + setFromPoints( points ) { this.makeEmpty(); @@ -46283,9 +46515,9 @@ Object.assign( Box2.prototype, { return this; - }, + } - setFromCenterAndSize: function ( center, size ) { + setFromCenterAndSize( center, size ) { const halfSize = _vector$7.copy( size ).multiplyScalar( 0.5 ); this.min.copy( center ).sub( halfSize ); @@ -46293,41 +46525,41 @@ Object.assign( Box2.prototype, { return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( box ) { + copy( box ) { this.min.copy( box.min ); this.max.copy( box.max ); return this; - }, + } - makeEmpty: function () { + makeEmpty() { this.min.x = this.min.y = + Infinity; this.max.x = this.max.y = - Infinity; return this; - }, + } - isEmpty: function () { + isEmpty() { // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); - }, + } - getCenter: function ( target ) { + getCenter( target ) { if ( target === undefined ) { @@ -46338,9 +46570,9 @@ Object.assign( Box2.prototype, { return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - }, + } - getSize: function ( target ) { + getSize( target ) { if ( target === undefined ) { @@ -46351,50 +46583,50 @@ Object.assign( Box2.prototype, { return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); - }, + } - expandByPoint: function ( point ) { + expandByPoint( point ) { this.min.min( point ); this.max.max( point ); return this; - }, + } - expandByVector: function ( vector ) { + expandByVector( vector ) { this.min.sub( vector ); this.max.add( vector ); return this; - }, + } - expandByScalar: function ( scalar ) { + expandByScalar( scalar ) { this.min.addScalar( - scalar ); this.max.addScalar( scalar ); return this; - }, + } - containsPoint: function ( point ) { + containsPoint( point ) { return point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true; - }, + } - containsBox: function ( box ) { + containsBox( box ) { return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y; - }, + } - getParameter: function ( point, target ) { + getParameter( point, target ) { // This can potentially have a divide by zero if the box // has a size dimension of 0. @@ -46411,18 +46643,18 @@ Object.assign( Box2.prototype, { ( point.y - this.min.y ) / ( this.max.y - this.min.y ) ); - }, + } - intersectsBox: function ( box ) { + intersectsBox( box ) { // using 4 splitting planes to rule out intersections return box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true; - }, + } - clampPoint: function ( point, target ) { + clampPoint( point, target ) { if ( target === undefined ) { @@ -46433,87 +46665,87 @@ Object.assign( Box2.prototype, { return target.copy( point ).clamp( this.min, this.max ); - }, + } - distanceToPoint: function ( point ) { + distanceToPoint( point ) { const clampedPoint = _vector$7.copy( point ).clamp( this.min, this.max ); return clampedPoint.sub( point ).length(); - }, + } - intersect: function ( box ) { + intersect( box ) { this.min.max( box.min ); this.max.min( box.max ); return this; - }, + } - union: function ( box ) { + union( box ) { this.min.min( box.min ); this.max.max( box.max ); return this; - }, + } - translate: function ( offset ) { + translate( offset ) { this.min.add( offset ); this.max.add( offset ); return this; - }, + } - equals: function ( box ) { + equals( box ) { return box.min.equals( this.min ) && box.max.equals( this.max ); } -} ); +} const _startP = new Vector3(); const _startEnd = new Vector3(); -function Line3( start, end ) { +class Line3 { - this.start = ( start !== undefined ) ? start : new Vector3(); - this.end = ( end !== undefined ) ? end : new Vector3(); + constructor( start, end ) { -} + this.start = ( start !== undefined ) ? start : new Vector3(); + this.end = ( end !== undefined ) ? end : new Vector3(); -Object.assign( Line3.prototype, { + } - set: function ( start, end ) { + set( start, end ) { this.start.copy( start ); this.end.copy( end ); return this; - }, + } - clone: function () { + clone() { return new this.constructor().copy( this ); - }, + } - copy: function ( line ) { + copy( line ) { this.start.copy( line.start ); this.end.copy( line.end ); return this; - }, + } - getCenter: function ( target ) { + getCenter( target ) { if ( target === undefined ) { @@ -46524,9 +46756,9 @@ Object.assign( Line3.prototype, { return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); - }, + } - delta: function ( target ) { + delta( target ) { if ( target === undefined ) { @@ -46537,21 +46769,21 @@ Object.assign( Line3.prototype, { return target.subVectors( this.end, this.start ); - }, + } - distanceSq: function () { + distanceSq() { return this.start.distanceToSquared( this.end ); - }, + } - distance: function () { + distance() { return this.start.distanceTo( this.end ); - }, + } - at: function ( t, target ) { + at( t, target ) { if ( target === undefined ) { @@ -46562,9 +46794,9 @@ Object.assign( Line3.prototype, { return this.delta( target ).multiplyScalar( t ).add( this.start ); - }, + } - closestPointToPointParameter: function ( point, clampToLine ) { + closestPointToPointParameter( point, clampToLine ) { _startP.subVectors( point, this.start ); _startEnd.subVectors( this.end, this.start ); @@ -46582,9 +46814,9 @@ Object.assign( Line3.prototype, { return t; - }, + } - closestPointToPoint: function ( point, clampToLine, target ) { + closestPointToPoint( point, clampToLine, target ) { const t = this.closestPointToPointParameter( point, clampToLine ); @@ -46597,24 +46829,24 @@ Object.assign( Line3.prototype, { return this.delta( target ).multiplyScalar( t ).add( this.start ); - }, + } - applyMatrix4: function ( matrix ) { + applyMatrix4( matrix ) { this.start.applyMatrix4( matrix ); this.end.applyMatrix4( matrix ); return this; - }, + } - equals: function ( line ) { + equals( line ) { return line.start.equals( this.start ) && line.end.equals( this.end ); } -} ); +} function ImmediateRenderObject( material ) { @@ -46644,215 +46876,220 @@ ImmediateRenderObject.prototype.isImmediateRenderObject = true; const _vector$8 = new Vector3(); -function SpotLightHelper( light, color ) { +class SpotLightHelper extends Object3D { - Object3D.call( this ); + constructor( light, color ) { - this.light = light; - this.light.updateMatrixWorld(); + super(); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - const geometry = new BufferGeometry(); + const geometry = new BufferGeometry(); - const positions = [ - 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 1, - 0, 0, 0, - 1, 0, 1, - 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, - 1, 1 - ]; + const positions = [ + 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, - 1, 0, 1, + 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, - 1, 1 + ]; - for ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { + for ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { - const p1 = ( i / l ) * Math.PI * 2; - const p2 = ( j / l ) * Math.PI * 2; + const p1 = ( i / l ) * Math.PI * 2; + const p2 = ( j / l ) * Math.PI * 2; - positions.push( - Math.cos( p1 ), Math.sin( p1 ), 1, - Math.cos( p2 ), Math.sin( p2 ), 1 - ); + positions.push( + Math.cos( p1 ), Math.sin( p1 ), 1, + Math.cos( p2 ), Math.sin( p2 ), 1 + ); - } + } - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); - this.cone = new LineSegments( geometry, material ); - this.add( this.cone ); + this.cone = new LineSegments( geometry, material ); + this.add( this.cone ); - this.update(); + this.update(); -} + } -SpotLightHelper.prototype = Object.create( Object3D.prototype ); -SpotLightHelper.prototype.constructor = SpotLightHelper; + dispose() { -SpotLightHelper.prototype.dispose = function () { + this.cone.geometry.dispose(); + this.cone.material.dispose(); - this.cone.geometry.dispose(); - this.cone.material.dispose(); + } -}; + update() { -SpotLightHelper.prototype.update = function () { + this.light.updateMatrixWorld(); - this.light.updateMatrixWorld(); + const coneLength = this.light.distance ? this.light.distance : 1000; + const coneWidth = coneLength * Math.tan( this.light.angle ); - const coneLength = this.light.distance ? this.light.distance : 1000; - const coneWidth = coneLength * Math.tan( this.light.angle ); + this.cone.scale.set( coneWidth, coneWidth, coneLength ); - this.cone.scale.set( coneWidth, coneWidth, coneLength ); + _vector$8.setFromMatrixPosition( this.light.target.matrixWorld ); - _vector$8.setFromMatrixPosition( this.light.target.matrixWorld ); + this.cone.lookAt( _vector$8 ); - this.cone.lookAt( _vector$8 ); + if ( this.color !== undefined ) { - if ( this.color !== undefined ) { + this.cone.material.color.set( this.color ); - this.cone.material.color.set( this.color ); + } else { - } else { + this.cone.material.color.copy( this.light.color ); - this.cone.material.color.copy( this.light.color ); + } } -}; +} const _vector$9 = new Vector3(); const _boneMatrix = new Matrix4(); const _matrixWorldInv = new Matrix4(); -function getBoneList( object ) { - - const boneList = []; - if ( object && object.isBone ) { +class SkeletonHelper extends LineSegments { - boneList.push( object ); + constructor( object ) { - } + const bones = getBoneList( object ); - for ( let i = 0; i < object.children.length; i ++ ) { + const geometry = new BufferGeometry(); - boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); + const vertices = []; + const colors = []; - } + const color1 = new Color( 0, 0, 1 ); + const color2 = new Color( 0, 1, 0 ); - return boneList; + for ( let i = 0; i < bones.length; i ++ ) { -} + const bone = bones[ i ]; -function SkeletonHelper( object ) { + if ( bone.parent && bone.parent.isBone ) { - const bones = getBoneList( object ); + vertices.push( 0, 0, 0 ); + vertices.push( 0, 0, 0 ); + colors.push( color1.r, color1.g, color1.b ); + colors.push( color2.r, color2.g, color2.b ); - const geometry = new BufferGeometry(); + } - const vertices = []; - const colors = []; + } - const color1 = new Color( 0, 0, 1 ); - const color2 = new Color( 0, 1, 0 ); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - for ( let i = 0; i < bones.length; i ++ ) { + const material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); - const bone = bones[ i ]; + super( geometry, material ); - if ( bone.parent && bone.parent.isBone ) { + this.type = 'SkeletonHelper'; + this.isSkeletonHelper = true; - vertices.push( 0, 0, 0 ); - vertices.push( 0, 0, 0 ); - colors.push( color1.r, color1.g, color1.b ); - colors.push( color2.r, color2.g, color2.b ); + this.root = object; + this.bones = bones; - } + this.matrix = object.matrixWorld; + this.matrixAutoUpdate = false; } - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + updateMatrixWorld( force ) { + + const bones = this.bones; - const material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } ); + const geometry = this.geometry; + const position = geometry.getAttribute( 'position' ); - LineSegments.call( this, geometry, material ); + _matrixWorldInv.getInverse( this.root.matrixWorld ); - this.type = 'SkeletonHelper'; + for ( let i = 0, j = 0; i < bones.length; i ++ ) { - this.root = object; - this.bones = bones; + const bone = bones[ i ]; - this.matrix = object.matrixWorld; - this.matrixAutoUpdate = false; + if ( bone.parent && bone.parent.isBone ) { -} + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); + _vector$9.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$9.x, _vector$9.y, _vector$9.z ); -SkeletonHelper.prototype = Object.create( LineSegments.prototype ); -SkeletonHelper.prototype.constructor = SkeletonHelper; + _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); + _vector$9.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$9.x, _vector$9.y, _vector$9.z ); -SkeletonHelper.prototype.isSkeletonHelper = true; + j += 2; -SkeletonHelper.prototype.updateMatrixWorld = function ( force ) { + } - const bones = this.bones; + } - const geometry = this.geometry; - const position = geometry.getAttribute( 'position' ); + geometry.getAttribute( 'position' ).needsUpdate = true; - _matrixWorldInv.getInverse( this.root.matrixWorld ); + super.updateMatrixWorld( force ); - for ( let i = 0, j = 0; i < bones.length; i ++ ) { + } - const bone = bones[ i ]; +} - if ( bone.parent && bone.parent.isBone ) { - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); - _vector$9.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j, _vector$9.x, _vector$9.y, _vector$9.z ); +function getBoneList( object ) { - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); - _vector$9.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j + 1, _vector$9.x, _vector$9.y, _vector$9.z ); + const boneList = []; - j += 2; + if ( object && object.isBone ) { - } + boneList.push( object ); } - geometry.getAttribute( 'position' ).needsUpdate = true; + for ( let i = 0; i < object.children.length; i ++ ) { - Object3D.prototype.updateMatrixWorld.call( this, force ); + boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); -}; + } -function PointLightHelper( light, sphereSize, color ) { + return boneList; - this.light = light; - this.light.updateMatrixWorld(); +} - this.color = color; +class PointLightHelper extends Mesh { - const geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); - const material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + constructor( light, sphereSize, color ) { - Mesh.call( this, geometry, material ); + const geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); + const material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); - this.type = 'PointLightHelper'; + super( geometry, material ); - this.matrix = this.light.matrixWorld; - this.matrixAutoUpdate = false; + this.light = light; + this.light.updateMatrixWorld(); - this.update(); + this.color = color; + this.type = 'PointLightHelper'; - /* + this.matrix = this.light.matrixWorld; + this.matrixAutoUpdate = false; + + this.update(); + + + /* + // TODO: delete this comment? const distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 ); const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); @@ -46874,321 +47111,322 @@ function PointLightHelper( light, sphereSize, color ) { this.add( this.lightDistance ); */ -} + } -PointLightHelper.prototype = Object.create( Mesh.prototype ); -PointLightHelper.prototype.constructor = PointLightHelper; + dispose() { -PointLightHelper.prototype.dispose = function () { + this.geometry.dispose(); + this.material.dispose(); - this.geometry.dispose(); - this.material.dispose(); + } -}; + update() { -PointLightHelper.prototype.update = function () { + if ( this.color !== undefined ) { - if ( this.color !== undefined ) { + this.material.color.set( this.color ); - this.material.color.set( this.color ); + } else { - } else { + this.material.color.copy( this.light.color ); - this.material.color.copy( this.light.color ); + } - } + /* + const d = this.light.distance; - /* - const d = this.light.distance; + if ( d === 0.0 ) { - if ( d === 0.0 ) { + this.lightDistance.visible = false; - this.lightDistance.visible = false; + } else { - } else { + this.lightDistance.visible = true; + this.lightDistance.scale.set( d, d, d ); - this.lightDistance.visible = true; - this.lightDistance.scale.set( d, d, d ); + } + */ } - */ -}; +} const _vector$a = new Vector3(); const _color1 = new Color(); const _color2 = new Color(); -function HemisphereLightHelper( light, size, color ) { +class HemisphereLightHelper extends Object3D { - Object3D.call( this ); + constructor( light, size, color ) { - this.light = light; - this.light.updateMatrixWorld(); + super(); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - const geometry = new OctahedronBufferGeometry( size ); - geometry.rotateY( Math.PI * 0.5 ); + const geometry = new OctahedronBufferGeometry( size ); + geometry.rotateY( Math.PI * 0.5 ); - this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); - if ( this.color === undefined ) this.material.vertexColors = true; + this.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } ); + if ( this.color === undefined ) this.material.vertexColors = true; - const position = geometry.getAttribute( 'position' ); - const colors = new Float32Array( position.count * 3 ); + const position = geometry.getAttribute( 'position' ); + const colors = new Float32Array( position.count * 3 ); - geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); + geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) ); - this.add( new Mesh( geometry, this.material ) ); + this.add( new Mesh( geometry, this.material ) ); - this.update(); + this.update(); -} + } + + dispose() { -HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); -HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; + this.children[ 0 ].geometry.dispose(); + this.children[ 0 ].material.dispose(); -HemisphereLightHelper.prototype.dispose = function () { + } - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); + update() { -}; + const mesh = this.children[ 0 ]; -HemisphereLightHelper.prototype.update = function () { + if ( this.color !== undefined ) { - const mesh = this.children[ 0 ]; + this.material.color.set( this.color ); - if ( this.color !== undefined ) { + } else { - this.material.color.set( this.color ); + const colors = mesh.geometry.getAttribute( 'color' ); - } else { + _color1.copy( this.light.color ); + _color2.copy( this.light.groundColor ); - const colors = mesh.geometry.getAttribute( 'color' ); + for ( let i = 0, l = colors.count; i < l; i ++ ) { - _color1.copy( this.light.color ); - _color2.copy( this.light.groundColor ); + const color = ( i < ( l / 2 ) ) ? _color1 : _color2; - for ( let i = 0, l = colors.count; i < l; i ++ ) { + colors.setXYZ( i, color.r, color.g, color.b ); - const color = ( i < ( l / 2 ) ) ? _color1 : _color2; + } - colors.setXYZ( i, color.r, color.g, color.b ); + colors.needsUpdate = true; } - colors.needsUpdate = true; + mesh.lookAt( _vector$a.setFromMatrixPosition( this.light.matrixWorld ).negate() ); } - mesh.lookAt( _vector$a.setFromMatrixPosition( this.light.matrixWorld ).negate() ); +} -}; +class GridHelper extends LineSegments { -function GridHelper( size, divisions, color1, color2 ) { + constructor( size, divisions, color1, color2 ) { - size = size || 10; - divisions = divisions || 10; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + size = size || 10; + divisions = divisions || 10; + color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); + color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - const center = divisions / 2; - const step = size / divisions; - const halfSize = size / 2; + const center = divisions / 2; + const step = size / divisions; + const halfSize = size / 2; - const vertices = [], colors = []; + const vertices = [], colors = []; - for ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { + for ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { - vertices.push( - halfSize, 0, k, halfSize, 0, k ); - vertices.push( k, 0, - halfSize, k, 0, halfSize ); + vertices.push( - halfSize, 0, k, halfSize, 0, k ); + vertices.push( k, 0, - halfSize, k, 0, halfSize ); - const color = i === center ? color1 : color2; + const color = i === center ? color1 : color2; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; + color.toArray( colors, j ); j += 3; - } + } - const geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - LineSegments.call( this, geometry, material ); + super( geometry, material ); - this.type = 'GridHelper'; + this.type = 'GridHelper'; + + } } -GridHelper.prototype = Object.create( LineSegments.prototype ); -GridHelper.prototype.constructor = GridHelper; +class PolarGridHelper extends LineSegments { -function PolarGridHelper( radius, radials, circles, divisions, color1, color2 ) { + constructor( radius, radials, circles, divisions, color1, color2 ) { - radius = radius || 10; - radials = radials || 16; - circles = circles || 8; - divisions = divisions || 64; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); + radius = radius || 10; + radials = radials || 16; + circles = circles || 8; + divisions = divisions || 64; + color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); + color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - const vertices = []; - const colors = []; + const vertices = []; + const colors = []; - // create the radials + // create the radials - for ( let i = 0; i <= radials; i ++ ) { + for ( let i = 0; i <= radials; i ++ ) { - const v = ( i / radials ) * ( Math.PI * 2 ); + const v = ( i / radials ) * ( Math.PI * 2 ); - const x = Math.sin( v ) * radius; - const z = Math.cos( v ) * radius; + const x = Math.sin( v ) * radius; + const z = Math.cos( v ) * radius; - vertices.push( 0, 0, 0 ); - vertices.push( x, 0, z ); + vertices.push( 0, 0, 0 ); + vertices.push( x, 0, z ); - const color = ( i & 1 ) ? color1 : color2; + const color = ( i & 1 ) ? color1 : color2; + + colors.push( color.r, color.g, color.b ); + colors.push( color.r, color.g, color.b ); - colors.push( color.r, color.g, color.b ); - colors.push( color.r, color.g, color.b ); + } - } + // create the circles - // create the circles + for ( let i = 0; i <= circles; i ++ ) { - for ( let i = 0; i <= circles; i ++ ) { + const color = ( i & 1 ) ? color1 : color2; - const color = ( i & 1 ) ? color1 : color2; + const r = radius - ( radius / circles * i ); - const r = radius - ( radius / circles * i ); + for ( let j = 0; j < divisions; j ++ ) { - for ( let j = 0; j < divisions; j ++ ) { + // first vertex - // first vertex + let v = ( j / divisions ) * ( Math.PI * 2 ); - let v = ( j / divisions ) * ( Math.PI * 2 ); + let x = Math.sin( v ) * r; + let z = Math.cos( v ) * r; - let x = Math.sin( v ) * r; - let z = Math.cos( v ) * r; + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); + // second vertex - // second vertex + v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); - v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); + x = Math.sin( v ) * r; + z = Math.cos( v ) * r; - x = Math.sin( v ) * r; - z = Math.cos( v ) * r; + vertices.push( x, 0, z ); + colors.push( color.r, color.g, color.b ); - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); + } } - } + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - const geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + super( geometry, material ); - LineSegments.call( this, geometry, material ); + this.type = 'PolarGridHelper'; - this.type = 'PolarGridHelper'; + } } -PolarGridHelper.prototype = Object.create( LineSegments.prototype ); -PolarGridHelper.prototype.constructor = PolarGridHelper; - const _v1$5 = new Vector3(); const _v2$3 = new Vector3(); const _v3$1 = new Vector3(); -function DirectionalLightHelper( light, size, color ) { +class DirectionalLightHelper extends Object3D { - Object3D.call( this ); + constructor( light, size, color ) { - this.light = light; - this.light.updateMatrixWorld(); + super(); + this.light = light; + this.light.updateMatrixWorld(); - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; + this.matrix = light.matrixWorld; + this.matrixAutoUpdate = false; - this.color = color; + this.color = color; - if ( size === undefined ) size = 1; + if ( size === undefined ) size = 1; - let geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( [ - - size, size, 0, - size, size, 0, - size, - size, 0, - - size, - size, 0, - - size, size, 0 - ], 3 ) ); + let geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ + - size, size, 0, + size, size, 0, + size, - size, 0, + - size, - size, 0, + - size, size, 0 + ], 3 ) ); - const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); + const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); - this.lightPlane = new Line( geometry, material ); - this.add( this.lightPlane ); + this.lightPlane = new Line( geometry, material ); + this.add( this.lightPlane ); - geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); + geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); - this.targetLine = new Line( geometry, material ); - this.add( this.targetLine ); + this.targetLine = new Line( geometry, material ); + this.add( this.targetLine ); - this.update(); + this.update(); -} + } -DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); -DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; + dispose() { -DirectionalLightHelper.prototype.dispose = function () { + this.lightPlane.geometry.dispose(); + this.lightPlane.material.dispose(); + this.targetLine.geometry.dispose(); + this.targetLine.material.dispose(); - this.lightPlane.geometry.dispose(); - this.lightPlane.material.dispose(); - this.targetLine.geometry.dispose(); - this.targetLine.material.dispose(); + } -}; + update() { -DirectionalLightHelper.prototype.update = function () { + _v1$5.setFromMatrixPosition( this.light.matrixWorld ); + _v2$3.setFromMatrixPosition( this.light.target.matrixWorld ); + _v3$1.subVectors( _v2$3, _v1$5 ); - _v1$5.setFromMatrixPosition( this.light.matrixWorld ); - _v2$3.setFromMatrixPosition( this.light.target.matrixWorld ); - _v3$1.subVectors( _v2$3, _v1$5 ); + this.lightPlane.lookAt( _v2$3 ); - this.lightPlane.lookAt( _v2$3 ); + if ( this.color !== undefined ) { - if ( this.color !== undefined ) { + this.lightPlane.material.color.set( this.color ); + this.targetLine.material.color.set( this.color ); - this.lightPlane.material.color.set( this.color ); - this.targetLine.material.color.set( this.color ); + } else { - } else { + this.lightPlane.material.color.copy( this.light.color ); + this.targetLine.material.color.copy( this.light.color ); - this.lightPlane.material.color.copy( this.light.color ); - this.targetLine.material.color.copy( this.light.color ); + } - } + this.targetLine.lookAt( _v2$3 ); + this.targetLine.scale.z = _v3$1.length(); - this.targetLine.lookAt( _v2$3 ); - this.targetLine.scale.z = _v3$1.length(); + } -}; +} const _vector$b = new Vector3(); const _camera = new Camera(); @@ -47200,167 +47438,169 @@ const _camera = new Camera(); * http://evanw.github.com/lightgl.js/tests/shadowmap.html */ -function CameraHelper( camera ) { +class CameraHelper extends LineSegments { - const geometry = new BufferGeometry(); - const material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); + constructor( camera ) { - const vertices = []; - const colors = []; + const geometry = new BufferGeometry(); + const material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } ); - const pointMap = {}; + const vertices = []; + const colors = []; - // colors + const pointMap = {}; - const colorFrustum = new Color( 0xffaa00 ); - const colorCone = new Color( 0xff0000 ); - const colorUp = new Color( 0x00aaff ); - const colorTarget = new Color( 0xffffff ); - const colorCross = new Color( 0x333333 ); + // colors - // near + const colorFrustum = new Color( 0xffaa00 ); + const colorCone = new Color( 0xff0000 ); + const colorUp = new Color( 0x00aaff ); + const colorTarget = new Color( 0xffffff ); + const colorCross = new Color( 0x333333 ); - addLine( 'n1', 'n2', colorFrustum ); - addLine( 'n2', 'n4', colorFrustum ); - addLine( 'n4', 'n3', colorFrustum ); - addLine( 'n3', 'n1', colorFrustum ); + // near - // far + addLine( 'n1', 'n2', colorFrustum ); + addLine( 'n2', 'n4', colorFrustum ); + addLine( 'n4', 'n3', colorFrustum ); + addLine( 'n3', 'n1', colorFrustum ); - addLine( 'f1', 'f2', colorFrustum ); - addLine( 'f2', 'f4', colorFrustum ); - addLine( 'f4', 'f3', colorFrustum ); - addLine( 'f3', 'f1', colorFrustum ); + // far - // sides + addLine( 'f1', 'f2', colorFrustum ); + addLine( 'f2', 'f4', colorFrustum ); + addLine( 'f4', 'f3', colorFrustum ); + addLine( 'f3', 'f1', colorFrustum ); - addLine( 'n1', 'f1', colorFrustum ); - addLine( 'n2', 'f2', colorFrustum ); - addLine( 'n3', 'f3', colorFrustum ); - addLine( 'n4', 'f4', colorFrustum ); + // sides - // cone + addLine( 'n1', 'f1', colorFrustum ); + addLine( 'n2', 'f2', colorFrustum ); + addLine( 'n3', 'f3', colorFrustum ); + addLine( 'n4', 'f4', colorFrustum ); - addLine( 'p', 'n1', colorCone ); - addLine( 'p', 'n2', colorCone ); - addLine( 'p', 'n3', colorCone ); - addLine( 'p', 'n4', colorCone ); + // cone - // up + addLine( 'p', 'n1', colorCone ); + addLine( 'p', 'n2', colorCone ); + addLine( 'p', 'n3', colorCone ); + addLine( 'p', 'n4', colorCone ); - addLine( 'u1', 'u2', colorUp ); - addLine( 'u2', 'u3', colorUp ); - addLine( 'u3', 'u1', colorUp ); + // up - // target + addLine( 'u1', 'u2', colorUp ); + addLine( 'u2', 'u3', colorUp ); + addLine( 'u3', 'u1', colorUp ); - addLine( 'c', 't', colorTarget ); - addLine( 'p', 'c', colorCross ); + // target - // cross + addLine( 'c', 't', colorTarget ); + addLine( 'p', 'c', colorCross ); - addLine( 'cn1', 'cn2', colorCross ); - addLine( 'cn3', 'cn4', colorCross ); + // cross - addLine( 'cf1', 'cf2', colorCross ); - addLine( 'cf3', 'cf4', colorCross ); + addLine( 'cn1', 'cn2', colorCross ); + addLine( 'cn3', 'cn4', colorCross ); - function addLine( a, b, color ) { + addLine( 'cf1', 'cf2', colorCross ); + addLine( 'cf3', 'cf4', colorCross ); - addPoint( a, color ); - addPoint( b, color ); + function addLine( a, b, color ) { - } + addPoint( a, color ); + addPoint( b, color ); - function addPoint( id, color ) { + } - vertices.push( 0, 0, 0 ); - colors.push( color.r, color.g, color.b ); + function addPoint( id, color ) { - if ( pointMap[ id ] === undefined ) { + vertices.push( 0, 0, 0 ); + colors.push( color.r, color.g, color.b ); - pointMap[ id ] = []; + if ( pointMap[ id ] === undefined ) { - } + pointMap[ id ] = []; - pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); + } - } + pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + } - LineSegments.call( this, geometry, material ); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - this.type = 'CameraHelper'; + super( geometry, material ); - this.camera = camera; - if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); + this.type = 'CameraHelper'; - this.matrix = camera.matrixWorld; - this.matrixAutoUpdate = false; + this.camera = camera; + if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); - this.pointMap = pointMap; + this.matrix = camera.matrixWorld; + this.matrixAutoUpdate = false; - this.update(); + this.pointMap = pointMap; -} + this.update(); -CameraHelper.prototype = Object.create( LineSegments.prototype ); -CameraHelper.prototype.constructor = CameraHelper; + } -CameraHelper.prototype.update = function () { + update() { - const geometry = this.geometry; - const pointMap = this.pointMap; + const geometry = this.geometry; + const pointMap = this.pointMap; - const w = 1, h = 1; + const w = 1, h = 1; - // we need just camera projection matrix inverse - // world matrix must be identity + // we need just camera projection matrix inverse + // world matrix must be identity - _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); + _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); - // center / target + // center / target - setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); - setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); + setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); + setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); - // near + // near - setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); - setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); - setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); - setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); + setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); + setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); + setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); + setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); - // far + // far - setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); - setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); - setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); - setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); + setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); + setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); + setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); + setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); - // up + // up - setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); - setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); - setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); + setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); + setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); + setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); - // cross + // cross - setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); - setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); - setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); - setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); + setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); + setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); + setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); + setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); - setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); - setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); - setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); - setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); + setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); + setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); + setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); + setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); - geometry.getAttribute( 'position' ).needsUpdate = true; + geometry.getAttribute( 'position' ).needsUpdate = true; + + } + +} -}; function setPoint( point, pointMap, geometry, camera, x, y, z ) { @@ -47384,331 +47624,331 @@ function setPoint( point, pointMap, geometry, camera, x, y, z ) { const _box$3 = new Box3(); -function BoxHelper( object, color ) { +class BoxHelper extends LineSegments { - this.object = object; + constructor( object, color ) { - if ( color === undefined ) color = 0xffff00; + if ( color === undefined ) color = 0xffff00; - const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - const positions = new Float32Array( 8 * 3 ); + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + const positions = new Float32Array( 8 * 3 ); - const geometry = new BufferGeometry(); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); + const geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) ); - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - this.type = 'BoxHelper'; + this.object = object; + this.type = 'BoxHelper'; - this.matrixAutoUpdate = false; + this.matrixAutoUpdate = false; - this.update(); + this.update(); -} + } + + update( object ) { -BoxHelper.prototype = Object.create( LineSegments.prototype ); -BoxHelper.prototype.constructor = BoxHelper; + if ( object !== undefined ) { -BoxHelper.prototype.update = function ( object ) { + console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); - if ( object !== undefined ) { + } - console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); + if ( this.object !== undefined ) { - } + _box$3.setFromObject( this.object ); - if ( this.object !== undefined ) { + } - _box$3.setFromObject( this.object ); + if ( _box$3.isEmpty() ) return; - } + const min = _box$3.min; + const max = _box$3.max; - if ( _box$3.isEmpty() ) return; + /* + 5____4 + 1/___0/| + | 6__|_7 + 2/___3/ - const min = _box$3.min; - const max = _box$3.max; + 0: max.x, max.y, max.z + 1: min.x, max.y, max.z + 2: min.x, min.y, max.z + 3: max.x, min.y, max.z + 4: max.x, max.y, min.z + 5: min.x, max.y, min.z + 6: min.x, min.y, min.z + 7: max.x, min.y, min.z + */ - /* - 5____4 - 1/___0/| - | 6__|_7 - 2/___3/ - - 0: max.x, max.y, max.z - 1: min.x, max.y, max.z - 2: min.x, min.y, max.z - 3: max.x, min.y, max.z - 4: max.x, max.y, min.z - 5: min.x, max.y, min.z - 6: min.x, min.y, min.z - 7: max.x, min.y, min.z - */ + const position = this.geometry.attributes.position; + const array = position.array; - const position = this.geometry.attributes.position; - const array = position.array; + array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; + array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; + array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; + array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; + array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; + array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; + array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; + array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; - array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; - array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; - array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; - array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; - array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; - array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; - array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; - array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; + position.needsUpdate = true; - position.needsUpdate = true; + this.geometry.computeBoundingSphere(); - this.geometry.computeBoundingSphere(); + } -}; + setFromObject( object ) { -BoxHelper.prototype.setFromObject = function ( object ) { + this.object = object; + this.update(); - this.object = object; - this.update(); + return this; - return this; + } -}; + copy( source ) { -BoxHelper.prototype.copy = function ( source ) { + LineSegments.prototype.copy.call( this, source ); - LineSegments.prototype.copy.call( this, source ); + this.object = source.object; - this.object = source.object; + return this; - return this; + } -}; +} -function Box3Helper( box, color ) { +class Box3Helper extends LineSegments { - this.type = 'Box3Helper'; + constructor( box, color ) { - this.box = box; + if ( color === undefined ) color = 0xffff00; - if ( color === undefined ) color = 0xffff00; + const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); + const positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; - const positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; + const geometry = new BufferGeometry(); - const geometry = new BufferGeometry(); + geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.box = box; - this.type = 'Box3Helper'; + this.type = 'Box3Helper'; - this.geometry.computeBoundingSphere(); + this.geometry.computeBoundingSphere(); -} + } -Box3Helper.prototype = Object.create( LineSegments.prototype ); -Box3Helper.prototype.constructor = Box3Helper; + updateMatrixWorld( force ) { -Box3Helper.prototype.updateMatrixWorld = function ( force ) { + const box = this.box; - const box = this.box; + if ( box.isEmpty() ) return; - if ( box.isEmpty() ) return; + box.getCenter( this.position ); - box.getCenter( this.position ); + box.getSize( this.scale ); - box.getSize( this.scale ); + this.scale.multiplyScalar( 0.5 ); - this.scale.multiplyScalar( 0.5 ); + super.updateMatrixWorld( force ); - Object3D.prototype.updateMatrixWorld.call( this, force ); + } -}; +} -function PlaneHelper( plane, size, hex ) { +class PlaneHelper extends Line { - this.plane = plane; + constructor( plane, size, hex ) { - this.size = ( size === undefined ) ? 1 : size; - const color = ( hex !== undefined ) ? hex : 0xffff00; + const color = ( hex !== undefined ) ? hex : 0xffff00; - const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; + const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; - const geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.computeBoundingSphere(); + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); + geometry.computeBoundingSphere(); - Line.call( this, geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + super( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - this.type = 'PlaneHelper'; + this.type = 'PlaneHelper'; - // + this.plane = plane; - const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; + this.size = ( size === undefined ) ? 1 : size; - const geometry2 = new BufferGeometry(); - geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); - geometry2.computeBoundingSphere(); + const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; - this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); + const geometry2 = new BufferGeometry(); + geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); + geometry2.computeBoundingSphere(); -} + this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) ); -PlaneHelper.prototype = Object.create( Line.prototype ); -PlaneHelper.prototype.constructor = PlaneHelper; + } -PlaneHelper.prototype.updateMatrixWorld = function ( force ) { + updateMatrixWorld( force ) { - let scale = - this.plane.constant; + let scale = - this.plane.constant; - if ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter + if ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter - this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); + this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); - this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here + this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here - this.lookAt( this.plane.normal ); + this.lookAt( this.plane.normal ); - Object3D.prototype.updateMatrixWorld.call( this, force ); + super.updateMatrixWorld( force ); -}; + } + +} const _axis = new Vector3(); let _lineGeometry, _coneGeometry; -function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { +class ArrowHelper extends Object3D { - // dir is assumed to be normalized + constructor( dir, origin, length, color, headLength, headWidth ) { - Object3D.call( this ); + super(); + // dir is assumed to be normalized - this.type = 'ArrowHelper'; + this.type = 'ArrowHelper'; - if ( dir === undefined ) dir = new Vector3( 0, 0, 1 ); - if ( origin === undefined ) origin = new Vector3( 0, 0, 0 ); - if ( length === undefined ) length = 1; - if ( color === undefined ) color = 0xffff00; - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; + if ( dir === undefined ) dir = new Vector3( 0, 0, 1 ); + if ( origin === undefined ) origin = new Vector3( 0, 0, 0 ); + if ( length === undefined ) length = 1; + if ( color === undefined ) color = 0xffff00; + if ( headLength === undefined ) headLength = 0.2 * length; + if ( headWidth === undefined ) headWidth = 0.2 * headLength; - if ( _lineGeometry === undefined ) { + if ( _lineGeometry === undefined ) { - _lineGeometry = new BufferGeometry(); - _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); + _lineGeometry = new BufferGeometry(); + _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); - _coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); - _coneGeometry.translate( 0, - 0.5, 0 ); + _coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); + _coneGeometry.translate( 0, - 0.5, 0 ); - } + } - this.position.copy( origin ); + this.position.copy( origin ); - this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); - this.line.matrixAutoUpdate = false; - this.add( this.line ); + this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) ); + this.line.matrixAutoUpdate = false; + this.add( this.line ); - this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); - this.cone.matrixAutoUpdate = false; - this.add( this.cone ); + this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) ); + this.cone.matrixAutoUpdate = false; + this.add( this.cone ); - this.setDirection( dir ); - this.setLength( length, headLength, headWidth ); + this.setDirection( dir ); + this.setLength( length, headLength, headWidth ); -} + } -ArrowHelper.prototype = Object.create( Object3D.prototype ); -ArrowHelper.prototype.constructor = ArrowHelper; + setDirection( dir ) { -ArrowHelper.prototype.setDirection = function ( dir ) { + // dir is assumed to be normalized - // dir is assumed to be normalized + if ( dir.y > 0.99999 ) { - if ( dir.y > 0.99999 ) { + this.quaternion.set( 0, 0, 0, 1 ); - this.quaternion.set( 0, 0, 0, 1 ); + } else if ( dir.y < - 0.99999 ) { - } else if ( dir.y < - 0.99999 ) { + this.quaternion.set( 1, 0, 0, 0 ); - this.quaternion.set( 1, 0, 0, 0 ); + } else { - } else { + _axis.set( dir.z, 0, - dir.x ).normalize(); - _axis.set( dir.z, 0, - dir.x ).normalize(); + const radians = Math.acos( dir.y ); - const radians = Math.acos( dir.y ); + this.quaternion.setFromAxisAngle( _axis, radians ); - this.quaternion.setFromAxisAngle( _axis, radians ); + } } -}; + setLength( length, headLength, headWidth ) { -ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { + if ( headLength === undefined ) headLength = 0.2 * length; + if ( headWidth === undefined ) headWidth = 0.2 * headLength; - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 + this.line.updateMatrix(); - this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 - this.line.updateMatrix(); + this.cone.scale.set( headWidth, headLength, headWidth ); + this.cone.position.y = length; + this.cone.updateMatrix(); - this.cone.scale.set( headWidth, headLength, headWidth ); - this.cone.position.y = length; - this.cone.updateMatrix(); + } -}; + setColor( color ) { -ArrowHelper.prototype.setColor = function ( color ) { + this.line.material.color.set( color ); + this.cone.material.color.set( color ); - this.line.material.color.set( color ); - this.cone.material.color.set( color ); + } -}; + copy( source ) { -ArrowHelper.prototype.copy = function ( source ) { + super.copy( source, false ); - Object3D.prototype.copy.call( this, source, false ); + this.line.copy( source.line ); + this.cone.copy( source.cone ); - this.line.copy( source.line ); - this.cone.copy( source.cone ); + return this; - return this; + } -}; +} -function AxesHelper( size ) { +class AxesHelper extends LineSegments { - size = size || 1; + constructor( size ) { - const vertices = [ - 0, 0, 0, size, 0, 0, - 0, 0, 0, 0, size, 0, - 0, 0, 0, 0, 0, size - ]; + size = size || 1; - const colors = [ - 1, 0, 0, 1, 0.6, 0, - 0, 1, 0, 0.6, 1, 0, - 0, 0, 1, 0, 0.6, 1 - ]; + const vertices = [ + 0, 0, 0, size, 0, 0, + 0, 0, 0, 0, size, 0, + 0, 0, 0, 0, 0, size + ]; - const geometry = new BufferGeometry(); - geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); + const colors = [ + 1, 0, 0, 1, 0.6, 0, + 0, 1, 0, 0.6, 1, 0, + 0, 0, 1, 0, 0.6, 1 + ]; - const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); + const geometry = new BufferGeometry(); + geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - LineSegments.call( this, geometry, material ); + const material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } ); - this.type = 'AxesHelper'; + super( geometry, material ); -} + this.type = 'AxesHelper'; -AxesHelper.prototype = Object.create( LineSegments.prototype ); -AxesHelper.prototype.constructor = AxesHelper; + } + +} const LOD_MIN = 4; const LOD_MAX = 8; @@ -50799,4 +51039,4 @@ if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { } -export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, AxisHelper, BackSide, BasicDepthPacking, BasicShadowMap, BinaryTextureLoader, Bone, BooleanKeyframeTrack, BoundingBoxHelper, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasRenderer, CanvasTexture, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, ClosedSplineCurve3, Color, ColorKeyframeTrack, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, BoxGeometry as CubeGeometry, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubeUVRefractionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DirectionalLightShadow, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicBufferAttribute, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EdgesHelper, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, Face3, Face4, FaceColors, FileLoader, FlatShading, Float32Attribute, Float32BufferAttribute, Float64Attribute, Float64BufferAttribute, FloatType, Fog, FogExp2, Font, FontLoader, FrontSide, Frustum, GammaEncoding, Geometry, GeometryUtils, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16Attribute, Int16BufferAttribute, Int32Attribute, Int32BufferAttribute, Int8Attribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, JSONLoader, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LensFlare, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LinePieces, LineSegments, LineStrip, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LogLuvEncoding, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils as Math, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshFaceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiMaterial, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverDepth, NeverStencilFunc, NoBlending, NoColors, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, ParametricBufferGeometry, ParametricGeometry, Particle, ParticleBasicMaterial, ParticleSystem, ParticleSystemMaterial, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointCloud, PointCloudMaterial, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDEncoding, RGBEEncoding, RGBEFormat, RGBFormat, RGBIntegerFormat, RGBM16Encoding, RGBM7Encoding, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, SRGB8_ALPHA8_ASTC_10x10_Format, SRGB8_ALPHA8_ASTC_10x5_Format, SRGB8_ALPHA8_ASTC_10x6_Format, SRGB8_ALPHA8_ASTC_10x8_Format, SRGB8_ALPHA8_ASTC_12x10_Format, SRGB8_ALPHA8_ASTC_12x12_Format, SRGB8_ALPHA8_ASTC_4x4_Format, SRGB8_ALPHA8_ASTC_5x4_Format, SRGB8_ALPHA8_ASTC_5x5_Format, SRGB8_ALPHA8_ASTC_6x5_Format, SRGB8_ALPHA8_ASTC_6x6_Format, SRGB8_ALPHA8_ASTC_8x5_Format, SRGB8_ALPHA8_ASTC_8x6_Format, SRGB8_ALPHA8_ASTC_8x8_Format, Scene, SceneUtils, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SmoothShading, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, Spline, SplineCurve, SplineCurve3, SpotLight, SpotLightHelper, SpotLightShadow, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, TextBufferGeometry, TextGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, TubeGeometry, UVMapping, Uint16Attribute, Uint16BufferAttribute, Uint32Attribute, Uint32BufferAttribute, Uint8Attribute, Uint8BufferAttribute, Uint8ClampedAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShort565Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, Vertex, VertexColors, VideoTexture, WebGL1Renderer, WebGLCubeRenderTarget, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderTargetCube, WebGLRenderer, WebGLUtils, WireframeGeometry, WireframeHelper, WrapAroundEnding, XHRLoader, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, sRGBEncoding }; +export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, AxisHelper, BackSide, BasicDepthPacking, BasicShadowMap, BinaryTextureLoader, Bone, BooleanKeyframeTrack, BoundingBoxHelper, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasRenderer, CanvasTexture, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, ClosedSplineCurve3, Color, ColorKeyframeTrack, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, BoxGeometry as CubeGeometry, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubeUVRefractionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DirectionalLightShadow, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicBufferAttribute, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EdgesHelper, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, Face3, Face4, FaceColors, FileLoader, FlatShading, Float32Attribute, Float32BufferAttribute, Float64Attribute, Float64BufferAttribute, FloatType, Fog, FogExp2, Font, FontLoader, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GammaEncoding, Geometry, GeometryUtils, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16Attribute, Int16BufferAttribute, Int32Attribute, Int32BufferAttribute, Int8Attribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, JSONLoader, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LensFlare, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LinePieces, LineSegments, LineStrip, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LogLuvEncoding, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils as Math, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshFaceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiMaterial, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverDepth, NeverStencilFunc, NoBlending, NoColors, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, ParametricBufferGeometry, ParametricGeometry, Particle, ParticleBasicMaterial, ParticleSystem, ParticleSystemMaterial, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointCloud, PointCloudMaterial, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDEncoding, RGBEEncoding, RGBEFormat, RGBFormat, RGBIntegerFormat, RGBM16Encoding, RGBM7Encoding, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, SRGB8_ALPHA8_ASTC_10x10_Format, SRGB8_ALPHA8_ASTC_10x5_Format, SRGB8_ALPHA8_ASTC_10x6_Format, SRGB8_ALPHA8_ASTC_10x8_Format, SRGB8_ALPHA8_ASTC_12x10_Format, SRGB8_ALPHA8_ASTC_12x12_Format, SRGB8_ALPHA8_ASTC_4x4_Format, SRGB8_ALPHA8_ASTC_5x4_Format, SRGB8_ALPHA8_ASTC_5x5_Format, SRGB8_ALPHA8_ASTC_6x5_Format, SRGB8_ALPHA8_ASTC_6x6_Format, SRGB8_ALPHA8_ASTC_8x5_Format, SRGB8_ALPHA8_ASTC_8x6_Format, SRGB8_ALPHA8_ASTC_8x8_Format, Scene, SceneUtils, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SmoothShading, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, Spline, SplineCurve, SplineCurve3, SpotLight, SpotLightHelper, SpotLightShadow, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, TextBufferGeometry, TextGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, TubeGeometry, UVMapping, Uint16Attribute, Uint16BufferAttribute, Uint32Attribute, Uint32BufferAttribute, Uint8Attribute, Uint8BufferAttribute, Uint8ClampedAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShort565Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, Vertex, VertexColors, VideoTexture, WebGL1Renderer, WebGLCubeRenderTarget, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderTargetCube, WebGLRenderer, WebGLUtils, WireframeGeometry, WireframeHelper, WrapAroundEnding, XHRLoader, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, sRGBEncoding }; diff --git a/docs/api/en/core/GLBufferAttribute.html b/docs/api/en/core/GLBufferAttribute.html new file mode 100644 index 00000000000000..6626118fc420b6 --- /dev/null +++ b/docs/api/en/core/GLBufferAttribute.html @@ -0,0 +1,117 @@ + + + + + + + + + + +

[name]

+ +

+ This buffer attribute class does not construct a VBO. Instead, it uses + whatever VBO is passed in constructor and can later be altered via the + *buffer* property.

+ It is required to pass additional params alongside the VBO. Those are: + the GL context, the GL data type, the number of components per vertex, + the number of bytes per component, and the number of vertices.

+ The most common use case for this class is when some kind of GPGPU + calculation interferes or even produces the VBOs in question. +

+ +

Constructor

+

[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count] )

+

+ *buffer* — Must be a WebGLBuffer. +
+ *type* — One of WebGL Data Types. +
+ *itemSize* — The number of values of the array that should be associated with + a particular vertex. For instance, if this + attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3. +
+ *elementSize* — 1, 2 or 4. The corresponding size (in bytes) for the given "type" param. +

    +
  • gl.FLOAT: 4
  • +
  • gl.UNSIGNED_SHORT: 2
  • +
  • gl.SHORT: 2
  • +
  • gl.UNSIGNED_INT: 4
  • +
  • gl.INT: 4
  • +
  • gl.BYTE: 1
  • +
  • gl.UNSIGNED_BYTE: 1
  • +
+ *count* — The expected number of vertices in VBO. +

+ +

Properties

+ +

[property:WebGLBuffer buffer]

+

+ The current WebGLBuffer instance. +

+ +

[property:Integer count]

+

+ The expected number of vertices in VBO. +

+ +

[property:Integer itemSize]

+

+ How many values make up each item (vertex). +

+ +

[property:Integer elementSize]

+

+ Stores the corresponding size in bytes for the current *type* property value. +

+

+ See above (constructor) for a list of known type sizes. +

+ +

[property:GLenum type]

+

+ A WebGL Data Type + describing the underlying VBO contents. +

+

+ Set this property together with *elementSize*. The recommended way is + using the *setType* method. +

+ +

[property:Boolean isGLBufferAttribute]

+

+ Read-only. Always *true*. +

+ +

Methods

+ +

[method:null setBuffer]( buffer )

+

Sets the *buffer* property.

+ +

[method:null setType]( type, elementSize )

+

Sets the both *type* and *elementSize* properties.

+ +

[method:null setItemSize]( itemSize )

+

Sets the *itemSize* property.

+ +

[method:null setCount]( count )

+

Sets the *count* property.

+ +

[property:Integer version]

+

+ A version number, incremented every time the needsUpdate property is set to true. +

+ +

[property:Boolean needsUpdate]

+

+ Default is *false*. Setting this to true increments [page:GLBufferAttribute.version version]. +

+ +

Source

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/en/helpers/ArrowHelper.html b/docs/api/en/helpers/ArrowHelper.html index 434624c5509467..70efe7280280dc 100644 --- a/docs/api/en/helpers/ArrowHelper.html +++ b/docs/api/en/helpers/ArrowHelper.html @@ -33,8 +33,6 @@

Code Example

Examples

- [example:webgl_geometries WebGL / geometries]
- [example:webgl_geometry_normals WebGL / geometry / normals]
[example:webgl_shadowmesh WebGL / shadowmesh]

diff --git a/docs/api/en/materials/Material.html b/docs/api/en/materials/Material.html index f0f58109b93498..c7de9fcaa50f76 100644 --- a/docs/api/en/materials/Material.html +++ b/docs/api/en/materials/Material.html @@ -211,7 +211,7 @@

[property:String precision]

[property:Boolean premultipliedAlpha]

Whether to premultiply the alpha (transparency) value. - See [Example:webgl_materials_physical_transparency WebGL / Materials / Physical / Transparency] for an example of the difference. + See [Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission] for an example of the difference. Default is *false*.

diff --git a/docs/api/en/materials/ShaderMaterial.html b/docs/api/en/materials/ShaderMaterial.html index ece5ed7c7ce235..29c547a6dc5aa9 100644 --- a/docs/api/en/materials/ShaderMaterial.html +++ b/docs/api/en/materials/ShaderMaterial.html @@ -346,6 +346,12 @@

[property:String fragmentShader]

as a string directly or loaded via AJAX instead.

+

[property:String glslVersion]

+

+ Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify + GLSL 3.0 or not. Valid values are *THREE.GLSL1* or *THREE.GLSL3*. Default is *null*. +

+

[property:String index0AttributeName]

If set, this calls [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation gl.bindAttribLocation] @@ -378,19 +384,11 @@

[property:boolean morphNormals]

When set to true, morph normal attributes are available in the vertex shader. Default is *false*.

- -

[property:WebGLProgram program]

-

- The compiled shader program associated with this material, generated by [page:WebGLRenderer]. - You should not need to access this property. -

-

[property:Boolean flatShading]

Define whether the material is rendered with flat shading. Default is false.

-

[property:Boolean skinning]

Define whether the material uses skinning; true to pass skinning attributes to the shader. Default is false. diff --git a/docs/api/en/renderers/WebGLCubeRenderTarget.html b/docs/api/en/renderers/WebGLCubeRenderTarget.html index e8d5c33b8837ef..e7d8ea85d1ae63 100644 --- a/docs/api/en/renderers/WebGLCubeRenderTarget.html +++ b/docs/api/en/renderers/WebGLCubeRenderTarget.html @@ -42,7 +42,7 @@

[name]([param:Number size], [param:Object options])

[page:Number anisotropy] - default is *1*. See [page:Texture.anistropy]
[page:Constant encoding] - default is [page:Textures LinearEncoding].
[page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it.
- [page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.

+ [page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.

Creates a new [name]

diff --git a/docs/api/en/renderers/WebGLRenderTarget.html b/docs/api/en/renderers/WebGLRenderTarget.html index 4372319dcabc89..dcd03401117174 100644 --- a/docs/api/en/renderers/WebGLRenderTarget.html +++ b/docs/api/en/renderers/WebGLRenderTarget.html @@ -41,7 +41,7 @@

[name]([param:Number width], [param:Number height], [param:Object options])< [page:Number anisotropy] - default is *1*. See [page:Texture.anisotropy]
[page:Constant encoding] - default is [page:Textures LinearEncoding].
[page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it.
- [page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.

+ [page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.

Creates a new [name]

@@ -85,7 +85,7 @@

[property:boolean depthBuffer]

[property:boolean stencilBuffer]

- Renders to the stencil buffer. Default is true. + Renders to the stencil buffer. Default is false.

[property:DepthTexture depthTexture]

diff --git a/docs/api/en/scenes/Scene.html b/docs/api/en/scenes/Scene.html index 780cfdc0fee88a..530ffbb44455a4 100644 --- a/docs/api/en/scenes/Scene.html +++ b/docs/api/en/scenes/Scene.html @@ -33,7 +33,8 @@

[property:boolean autoUpdate]

[property:Object background]

- If not null, sets the background used when rendering the scene, and is always rendered first. Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, or a cubemap as a [page:CubeTexture] or [page:WebGLCubeRenderTarget]. Default is null. + If not null, sets the background used when rendering the scene, and is always rendered first. + Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, a cubemap as a [page:CubeTexture] or [page:WebGLCubeRenderTarget] or an equirectangular as a [page:Texture] . Default is null.

[property:Texture environment]

diff --git a/docs/api/zh/core/GLBufferAttribute.html b/docs/api/zh/core/GLBufferAttribute.html new file mode 100644 index 00000000000000..6626118fc420b6 --- /dev/null +++ b/docs/api/zh/core/GLBufferAttribute.html @@ -0,0 +1,117 @@ + + + + + + + + + + +

[name]

+ +

+ This buffer attribute class does not construct a VBO. Instead, it uses + whatever VBO is passed in constructor and can later be altered via the + *buffer* property.

+ It is required to pass additional params alongside the VBO. Those are: + the GL context, the GL data type, the number of components per vertex, + the number of bytes per component, and the number of vertices.

+ The most common use case for this class is when some kind of GPGPU + calculation interferes or even produces the VBOs in question. +

+ +

Constructor

+

[name]( [param:WebGLBuffer buffer], [param:GLenum type], [param:Integer itemSize], [param:Integer elementSize], [param:Integer count] )

+

+ *buffer* — Must be a WebGLBuffer. +
+ *type* — One of WebGL Data Types. +
+ *itemSize* — The number of values of the array that should be associated with + a particular vertex. For instance, if this + attribute is storing a 3-component vector (such as a position, normal, or color), then itemSize should be 3. +
+ *elementSize* — 1, 2 or 4. The corresponding size (in bytes) for the given "type" param. +

    +
  • gl.FLOAT: 4
  • +
  • gl.UNSIGNED_SHORT: 2
  • +
  • gl.SHORT: 2
  • +
  • gl.UNSIGNED_INT: 4
  • +
  • gl.INT: 4
  • +
  • gl.BYTE: 1
  • +
  • gl.UNSIGNED_BYTE: 1
  • +
+ *count* — The expected number of vertices in VBO. +

+ +

Properties

+ +

[property:WebGLBuffer buffer]

+

+ The current WebGLBuffer instance. +

+ +

[property:Integer count]

+

+ The expected number of vertices in VBO. +

+ +

[property:Integer itemSize]

+

+ How many values make up each item (vertex). +

+ +

[property:Integer elementSize]

+

+ Stores the corresponding size in bytes for the current *type* property value. +

+

+ See above (constructor) for a list of known type sizes. +

+ +

[property:GLenum type]

+

+ A WebGL Data Type + describing the underlying VBO contents. +

+

+ Set this property together with *elementSize*. The recommended way is + using the *setType* method. +

+ +

[property:Boolean isGLBufferAttribute]

+

+ Read-only. Always *true*. +

+ +

Methods

+ +

[method:null setBuffer]( buffer )

+

Sets the *buffer* property.

+ +

[method:null setType]( type, elementSize )

+

Sets the both *type* and *elementSize* properties.

+ +

[method:null setItemSize]( itemSize )

+

Sets the *itemSize* property.

+ +

[method:null setCount]( count )

+

Sets the *count* property.

+ +

[property:Integer version]

+

+ A version number, incremented every time the needsUpdate property is set to true. +

+ +

[property:Boolean needsUpdate]

+

+ Default is *false*. Setting this to true increments [page:GLBufferAttribute.version version]. +

+ +

Source

+

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/zh/helpers/ArrowHelper.html b/docs/api/zh/helpers/ArrowHelper.html index da6982d7e9cdfc..ea87086cda1434 100644 --- a/docs/api/zh/helpers/ArrowHelper.html +++ b/docs/api/zh/helpers/ArrowHelper.html @@ -33,8 +33,6 @@

代码示例

例子

- [example:webgl_geometries WebGL / geometries]
- [example:webgl_geometry_normals WebGL / geometry / normals]
[example:webgl_shadowmesh WebGL / shadowmesh]

diff --git a/docs/api/zh/materials/Material.html b/docs/api/zh/materials/Material.html index c088c5dda3ac97..81efdf92634642 100644 --- a/docs/api/zh/materials/Material.html +++ b/docs/api/zh/materials/Material.html @@ -181,7 +181,7 @@

[property:String precision]

[property:Boolean premultipliedAlpha]

-

是否预乘alpha(透明度)值。有关差异的示例,请参阅[Example:webgl_materials_physical_transparency WebGL / Materials / Physical / Transparency]。 +

是否预乘alpha(透明度)值。有关差异的示例,请参阅[Example:webgl_materials_physical_transmission WebGL / Materials / Physical / Transmission]。 默认值为*false*。

diff --git a/docs/api/zh/materials/MeshBasicMaterial.html b/docs/api/zh/materials/MeshBasicMaterial.html index 1f84d6e59f0e9b..7c3b6620972737 100644 --- a/docs/api/zh/materials/MeshBasicMaterial.html +++ b/docs/api/zh/materials/MeshBasicMaterial.html @@ -94,6 +94,8 @@

[property:Float reflectivity]

[property:Float refractionRatio]

空气的折射率(IOR)(约为1)除以材质的折射率。它与环境映射模式[page:Textures THREE.CubeRefractionMapping] 和[page:Textures THREE.EquirectangularRefractionMapping]一起使用。 + The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. + It is used with environment mapping mode [page:Textures THREE.CubeRefractionMapping]. 折射率不应超过1。默认值为*0.98*。

diff --git a/docs/api/zh/materials/MeshLambertMaterial.html b/docs/api/zh/materials/MeshLambertMaterial.html index 666e4a8ae78c32..288a253e1ba1c7 100644 --- a/docs/api/zh/materials/MeshLambertMaterial.html +++ b/docs/api/zh/materials/MeshLambertMaterial.html @@ -115,6 +115,8 @@

[property:Float reflectivity]

[property:Float refractionRatio]

空气的折射率(IOR)(约为1)除以材质的折射率。它与环境映射模式[page:Textures THREE.CubeRefractionMapping] 和[page:Textures THREE.EquirectangularRefractionMapping]一起使用。 + The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. + It is used with environment mapping mode [page:Textures THREE.CubeRefractionMapping]. 折射率不应超过1。默认值为*0.98*。

diff --git a/docs/api/zh/materials/MeshPhongMaterial.html b/docs/api/zh/materials/MeshPhongMaterial.html index 465d3b5420fef5..feca36ce03dfd4 100644 --- a/docs/api/zh/materials/MeshPhongMaterial.html +++ b/docs/api/zh/materials/MeshPhongMaterial.html @@ -151,6 +151,8 @@

[property:Float reflectivity]

[property:Float refractionRatio]

空气的折射率(IOR)(约为1)除以材质的折射率。它与环境映射模式[page:Textures THREE.CubeRefractionMapping] 和[page:Textures THREE.EquirectangularRefractionMapping]一起使用。 + The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. + It is used with environment mapping mode [page:Textures THREE.CubeRefractionMapping]. 折射率不应超过1。默认值为*0.98*。

diff --git a/docs/api/zh/materials/MeshStandardMaterial.html b/docs/api/zh/materials/MeshStandardMaterial.html index a559ac95c1c5ce..3e3e8715b0a78f 100644 --- a/docs/api/zh/materials/MeshStandardMaterial.html +++ b/docs/api/zh/materials/MeshStandardMaterial.html @@ -188,6 +188,8 @@

[property:Vector2 normalScale]

[property:Float refractionRatio]

空气的折射率(IOR)(约为1)除以材质的折射率。它与环境映射模式[page:Textures THREE.CubeRefractionMapping] 和[page:Textures THREE.EquirectangularRefractionMapping]一起使用。 + The index of refraction (IOR) of air (approximately 1) divided by the index of refraction of the material. + It is used with environment mapping mode [page:Textures THREE.CubeRefractionMapping]. 折射率不应超过1。默认值为*0.98*。

diff --git a/docs/api/zh/materials/ShaderMaterial.html b/docs/api/zh/materials/ShaderMaterial.html index 9eb463efba5a5a..6d8e796eb41d60 100644 --- a/docs/api/zh/materials/ShaderMaterial.html +++ b/docs/api/zh/materials/ShaderMaterial.html @@ -310,6 +310,12 @@

[property:String fragmentShader]

它也可以作为一个字符串直接传递或者通过AJAX加载。

+

[property:String glslVersion]

+

+ Defines the GLSL version of custom shader code. Only relevant for WebGL 2 in order to define whether to specify + GLSL 3.0 or not. Valid values are *THREE.GLSL1* or *THREE.GLSL3*. Default is *null*. +

+

[property:String index0AttributeName]

如果设置,则调用[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation gl.bindAttribLocation] 将通用顶点索引绑定到属性变量。默认值未定义。 @@ -333,10 +339,6 @@

[property:boolean morphNormals]

When set to true, morph normal attributes are available in the vertex shader. Default is *false*.

-

[property:WebGLProgram program]

-

与此材质相关联的编译后的shader程序,由[page:WebGLRenderer]生成。您应该不需要访问此属性。 -

-

[property:Boolean flatShading]

定义材质是否使用平面着色进行渲染。默认值为false。

diff --git a/docs/api/zh/renderers/WebGLCubeRenderTarget.html b/docs/api/zh/renderers/WebGLCubeRenderTarget.html index 9e27eeb02171a8..e7978c762ae0e8 100644 --- a/docs/api/zh/renderers/WebGLCubeRenderTarget.html +++ b/docs/api/zh/renderers/WebGLCubeRenderTarget.html @@ -39,7 +39,7 @@

[name]([param:Number size], [param:Object options])

[page:Number anisotropy] - 默认是 *1*. 参见[page:Texture.anistropy]
[page:Constant encoding] - 默认是[page:Textures LinearEncoding].
[page:Boolean depthBuffer] - 默认是*true*.如果不需要就设为false
- [page:Boolean stencilBuffer] - 默认是*true*.如果不需要就设为false

+ [page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.

创建一个新[name]

diff --git a/docs/api/zh/renderers/WebGLRenderTarget.html b/docs/api/zh/renderers/WebGLRenderTarget.html index b89ed6adb975c2..05695996e0b6e2 100644 --- a/docs/api/zh/renderers/WebGLRenderTarget.html +++ b/docs/api/zh/renderers/WebGLRenderTarget.html @@ -37,7 +37,7 @@

[name]([param:Number width], [param:Number height], [param:Object options])< [page:Number anisotropy] - 默认是*1*. 参见[page:Texture.anistropy]
[page:Constant encoding] - 默认是[page:Textures LinearEncoding].
[page:Boolean depthBuffer] - 默认是*true*. 如果不需要就设为false
- [page:Boolean stencilBuffer] - 默认是*true*. 如果不需要就设为false

+ [page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.

创建一个新[name]

@@ -81,7 +81,7 @@

[property:boolean depthBuffer]

[property:boolean stencilBuffer]

- 渲染到模板缓冲区。默认true. + Renders to the stencil buffer. Default is false.

[property:DepthTexture depthTexture]

diff --git a/docs/api/zh/scenes/Scene.html b/docs/api/zh/scenes/Scene.html index e9894f4eb9df0f..550e4aced36b0b 100644 --- a/docs/api/zh/scenes/Scene.html +++ b/docs/api/zh/scenes/Scene.html @@ -34,8 +34,8 @@

[property:boolean autoUpdate]

[property:Object background]

- 若不为空,在渲染场景的时候将设置背景,且背景总是首先被渲染的。 - 可以设置一个用于的“clear”的[page:Color](颜色)、一个覆盖canvas的[page:Texture](纹理),或是一个[page:CubeTexture]。默认值为null。 + If not null, sets the background used when rendering the scene, and is always rendered first. + Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, a cubemap as a [page:CubeTexture] or [page:WebGLCubeRenderTarget] or an equirectangular as a [page:Texture] . Default is null.

[property:Texture environment]

diff --git a/docs/index.html b/docs/index.html index 9140b9372b8ab5..02910766599929 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,6 +31,7 @@

three.js

@@ -53,7 +54,7 @@

three.js

if ( /^(api|manual|examples)/.test( hash ) ) { - var hashLanguage = /^(api|manual|examples)\/(en|zh)\//.exec( hash ); + var hashLanguage = /^(api|manual|examples)\/(en|ar|zh)\//.exec( hash ); if ( hashLanguage === null ) { @@ -203,6 +204,12 @@

three.js

navigation = document.createElement( 'div' ); content.appendChild( navigation ); + if ( language === 'ar' ) { + + navigation.style.direction = 'rtl'; + + } + var localList = list[ language ]; for ( var section in localList ) { diff --git a/docs/list.js b/docs/list.js index e962ff2b404085..a8a1a7754db25f 100644 --- a/docs/list.js +++ b/docs/list.js @@ -89,6 +89,7 @@ var list = { "EventDispatcher": "api/en/core/EventDispatcher", "Face3": "api/en/core/Face3", "Geometry": "api/en/core/Geometry", + "GLBufferAttribute": "api/en/core/GLBufferAttribute", "InstancedBufferAttribute": "api/en/core/InstancedBufferAttribute", "InstancedBufferGeometry": "api/en/core/InstancedBufferGeometry", "InstancedInterleavedBuffer": "api/en/core/InstancedInterleavedBuffer", @@ -461,6 +462,28 @@ var list = { }, + "ar": { + + "الكتيب": { + + "البدء": { + "إنشاء مشهد": "manual/ar/introduction/Creating-a-scene", + "التثبيت": "manual/ar/introduction/Installation", + "دعم المتصفح": "manual/ar/introduction/Browser-support", + "فحص توافق WebGL": "manual/ar/introduction/WebGL-compatibility-check", + "كيف تدير الأشياء محليًا": "manual/ar/introduction/How-to-run-things-locally", + "إعدادات Typescript": "manual/ar/introduction/Typescript-setup", + "رسم خطوط": "manual/ar/introduction/Drawing-lines", + "إنشاء نص": "manual/ar/introduction/Creating-text", + "تحميل نماذج ثلاثية الأبعاد": "manual/ar/introduction/Loading-3D-models", + "الأسئلة الشائعة": "manual/ar/introduction/FAQ", + "روابط مفيدة": "manual/ar/introduction/Useful-links" + }, + + }, + + }, + "zh": { "手册": { @@ -550,6 +573,7 @@ var list = { "EventDispatcher": "api/zh/core/EventDispatcher", "Face3": "api/zh/core/Face3", "Geometry": "api/zh/core/Geometry", + "GLBufferAttribute": "api/zh/core/GLBufferAttribute", "InstancedBufferAttribute": "api/zh/core/InstancedBufferAttribute", "InstancedBufferGeometry": "api/zh/core/InstancedBufferGeometry", "InstancedInterleavedBuffer": "api/zh/core/InstancedInterleavedBuffer", diff --git a/docs/manual/ar/introduction/Browser-support.html b/docs/manual/ar/introduction/Browser-support.html new file mode 100644 index 00000000000000..a1233d5b346530 --- /dev/null +++ b/docs/manual/ar/introduction/Browser-support.html @@ -0,0 +1,124 @@ + + + + + + + + + + +

([name]) دعم المتصفح

+ +

نظرة عامة

+
+

+ يمكن لـ Three.js استخدام WebGL لعرض المشاهد الخاصة بك على جميع المتصفحات الحديثة. بالنسبة إلى المتصفحات الأقدم ، وخاصة Internet Explorer 10 والإصدارات الأقدم ، قد تضطر إلى الرجوع إلى أحد المستعرضات الأخرى [link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers] (CSS2DRenderer و CSS3DRenderer و SVGRenderer). بالإضافة إلى ذلك ، قد تضطر إلى تضمين بعض polyfills ، بالأخص إذا كنت تستخدم ملفات من المجلد [link:https://github.com/mrdoob/three.js/tree/master/examples /examples]. +

+

+ ملاحظة: إذا لم تكن بحاجة إلى دعم هذه المتصفحات القديمة ، فلا يوصى باستخدام برامج العارض الأخرى لأنها أبطأ وتدعم ميزات أقل من WebGLRenderer. +

+
+ +

المتصفحات التي تدعم WebGL

+
+

+ Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 و Microsoft Edge.
+ يمكنك العثور على المتصفحات التي تدعم WebGL في [link:https://caniuse.com/#feat=webgl Can I use WebGL]. +

+
+ +

ميزات لغة JavaScript أو واجهات الويب البرمجية المستخدمة في three.js

+
+

+ فيما يلي بعض الميزات المستخدمة في three.js. قد يتطلب بعض منهم polyfills إضافية. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
الخاصيةنطاق الاستخدمالوحدات
Typed ArraysSourceBufferAttribute, BufferGeometry, etc.
Web Audio APISourceAudio, AudioContext, AudioListener, etc.
WebXR Device APISourceWebXRManager
BlobSourceFileLoader, etc.
PromiseExamplesGLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.
FetchExamplesImageBitmapLoader, etc.
File APIExamplesGLTFExporter, etc.
URL APIExamplesGLTFLoader, etc.
Pointer Lock APIExamplesPointerLockControls
+
+ +

Polyfills

+
+

فقط قم باستيراد polyfills بناءً على متطلباتك. إذا أخذنا IE9 كمثال ، فأنت بحاجة إلى ملء هذه الميزات على الأقل:

+
    +
  • Typed Arrays
  • +
  • Blob
  • +
+
+ +

مقترح polyfills

+
+
    +
  • + [link:https://github.com/zloirock/core-js core-js] +
  • +
  • + [link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js] +
  • +
  • + [link:https://github.com/stefanpenner/es6-promise/ ES6-Promise] +
  • +
  • + [link:https://github.com/eligrey/Blob.js Blob.js] +
  • +
  • + [link:https://github.com/github/fetch fetch] +
  • +
+
+ + diff --git a/docs/manual/ar/introduction/Creating-a-scene.html b/docs/manual/ar/introduction/Creating-a-scene.html new file mode 100644 index 00000000000000..ecb59f35066a4b --- /dev/null +++ b/docs/manual/ar/introduction/Creating-a-scene.html @@ -0,0 +1,269 @@ + + + + + + + + + + +

إنشاء مشهد([name])

+ +

الهدف من هذا القسم هو تقديم لمحة وجيزة عن كيفية عمل المكتبة. سنبدأ بتحضير مشهد يتمثل في مكعب ثلاثي الأبعاد .الصفحة مرفوقة بمثال أسفلها في حالة واجهتك بعض المشاكل وإحتجت إلى المساعدة.

+ +

قبل أن نبدأ

+ +

+ قبل أن يمكنك إستعمال المكتبة, يجب أن توفر مكان لإظهار المشهد. قم بإنشاء ملف HTML يحتوي الشفرة البرمجية التالية + بصحبة نسخة من المكتبة [link:https://threejs.org/build/three.js three.js] في مجلد سمه js و من ثم فم بفتح الصفحة في المتصفح. +

+ + + <!DOCTYPE html> + <html> + <head> + <meta charset="utf-8"> + <title>My first three.js app</title> + <style> + body { margin: 0; } + canvas { display: block; } + </style> + </head> + <body> + <script src="js/three.js"></script> + <script> + // Our Javascript will go here. + </script> + </body> + </html> + + +

+ هذا كل شيء. بقية الأوامر البرمجية ستكون محتوات في وسم <script> الفارغ حاليا. +

+ +

إنشاء مشهد

+ +

+ لنتمكن من إظهار أي شيء بإستهمال three.js، نحتاج ثلاثة عناصر أساسية: المسرح (Scene)، الكاميرا (Camera)، و العارض + (Renderer). +

+ + + var scene = new THREE.Scene(); + var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); + + var renderer = new THREE.WebGLRenderer(); + renderer.setSize( window.innerWidth, window.innerHeight ); + document.body.appendChild( renderer.domElement ); + + +

+ لنتمهل لحظة من أجل توضيح ما يحصل هنا. لقد قمنا بتحضير كل من المسرح، الكاميرا، و العارض. +

+ +

+ توفر مكتبة three.js العديد من الخيارات بخصوص نوع الكاميرا. للوقت الراهن، سنستعمل + PerspectiveCamera. +

+ +

+ أول ميزة هي مجال الرؤية - Field of view. يمكن التعبير عنها بإستعمال إختصارها كالأتي FOV. هذه + القيمة تمثل مجال + المشاهدة المتاح في أي وقت + من العرض. وحده قيسها هي الدرجة (degrees) +

+ +

+ القيمة الثانية هي نسبة العرض إلى الارتفاع - aspect ratio. من المستحسن إستعمال نتيجة قسمة عرض و + طول العنصر الحاوي، و إلا ستحصل على تجربة مماثلة + لمشاهدة فيلم قديم على تلفاز عريض حيث ستكون الصورة متغيرة. +

+ +

+ القيمتين المتبقيتين هما أقرب و أبعد سطح فاصل. نقصد بدلك أن أي عنصر في المشهد + أبعد من السطح الفاصل البعيد بالنسبة + للكاميرا أو أقرب من السطح الفاصل القريب لن يتم عرضه. + أنت لست مطالب بالقلق حيال هذا، و لكن من الممكن أن تريد إستعمال قيم أخرى من أجل الحصول على أداء أفضل. +

+ +

+ نصل الأن إلى العارض. هنا أين يكمن السحر. بالإضافة لإستعمال WebGLRenderer، المكتبة تتكفل بتمكين بعض المتصفحات + القديمة التي لا + تدعم WebGL لسبب ما من الخصائص المفقودة. +

+ +

+ إلي جانب إنشاء نموذج من مكون عارض، نحن مطالبون بتوفير قياس المشهد المراد عرضه. إنها لا فكرة جيدة أن نستعمل عرض و + طول المنطقة التي نريد ملأها في الصفحة. في هذه الحالة إستعملنا عرض و طول نافدة المتصفح. بالنسبة لتطبيقات عالية + الأداء، يمكنك توفير قيم أقل مثل window.innerWidth/2 و window.innerHeight/2، + التي + ستجعل المشهد يعرض أسرع بنصف المدة السابقة. +

+ +

+ على سبيل المثال إلغاء قيمة updateStyle كالأتي: +
+ setSize(window.innerWidth/2, window.innerHeight/2, false) +
+ ستجعل المشهد يعرض بدقة أقل بنصف + الدرجة القديمة، مع العلم أن < canvas> + الخاصة بك تم إمدادها ب100% في كلا الطول و العرض. +

+ +

+ أخيرا و ليس أخرا، سنقوم بإضافة العارض إلى ملف الـHTML. +
+ < canvas> هو وسم يستعمله العارض لإظهار المشهد من خلاله. +

+ +

+ "كل شيء جيد، و لكن أي المكعب الذي وعدتنا به؟" لنقم بإضافته الأن. +

+ + + var geometry = new THREE.BoxGeometry(); + var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); + var cube = new THREE.Mesh( geometry, material ); + scene.add( cube ); + + camera.position.z = 5; + + +

+ لكي نقوم بإنشاء مكعب، نحتاج مكون BoxGeometry. هذا الأخير مسؤول عن حفض أماكن كل النقاط + (vertices) و تعبئة كل الأوجه + (faces) المكونة للمكعب. سنقوم بالتعمق في هذا الموضوع مستقبلا. +

+ +

+ بالإضافة إلى الهندسة الخاصة بالمكعب، نحتاج المادة المكونة له لتعطيه لون. Three.js تأتي مع العديد من المواد، + و + لكن سنكتفي بإستعمال MeshBasicMaterial للوقت الراهن. كل المواد تأخذ مجموعة من القيم ستطبق + عليها + من أجل الوصول إلى النتيجة المرادة. لإبقاء الأشياء بسيطة، قمنا بإرفاق قيمة اللون التي تحمل + 0x00ff00، و الذي يمثل اللون الأخضر. كيفية إحتساب القيمة هي نفسها كإستعمال CSS أو Photoshop + (hex colors). +

+ +

+ الخطوة التالية هي إنشاء جسم Mesh. نقصد به الشيء الذي سيتكفل بالتعامل مع هندسة الشكل و + تطبيقها + على المادة المرفوقة، و من ثم يمكننا إدخال الشكل الجسم النهائي إلى المشهد، و التحرك بحرية حوله. +

+ +

+ عند إستعمال أمر ()scene.add، الشيء المراد إضافته للمشهد سيضاف في الإحداثيات التالية + (0,0,0). هذا يمكن له أن يشكل بعض المشاكل كون الكاميرا في هذه الحالة وسط المكعب. لتجنب هذا + نقوم + ببساطة بإبعاد الكاميرا قليلا. +

+ +

عرض المشهد

+ +

+ إن قمت بنسخ الأوامر البرمجية الموجودة أعله وسط ملف HTML الذي قمنا بإنشائه مسبقا، لم تتمكن من رؤية أي شيء حتى + الأن. هذا بسبب أننا لم نقم بعرض أي شيء حتى اللحظة. لذلك، ما نحتاجه يدعى العرض (render) أو + حلقة + الحركات (animation loop). +

+ + + function animate() { + requestAnimationFrame( animate ); + renderer.render( scene, camera ); + } + animate(); + + +

+ هذه الشفرة البرمجية تقوم بإنشاء حلقة تجعل العارض يعيد تحديث المشهد كل مرة يحدث فيها تغيير في الصفحة (أو نظريا + هذا يعني 60 + مرة + خلال كل ثانية). إن كنت لا تملك تجربة مسبقة في صناعة ألعاب المتصفح، ستتسائل "لماذا لا نستعمل + setInterval؟" الحقيقة أننا بإمكاننا ذلك و لكن requestAnimationFrame تقدم لنا + العديد من + المزايا. من أهما أنها تقوم بإيقاف العمل عندما يقوم المستعمل بتغيير الصفحة، بالإضافة لعدم إستهلاك قدرة + الحاسب الخاص بالجهاز و عمر البطارية. +

+ +

تحريك المكعب

+ +

+ إن قمت بإضافة الأوامر البرمجية السابقة للملف الخاص بك، من الأرجح أنك ترى الأن مكعبا أخضر اللون. لنقم بجعله + أكثر + جذابية من خلال تدويره. +

+ +

+ قم بإضافة الشفرة التالية فوق السطر الذي يحتوي أمر renderer.render في الوظيفة + (animate): +

+ + + cube.rotation.x += 0.01; + cube.rotation.y += 0.01; + + +

+ هذه الأوامر سيتم تشغيلها في كل إطار (frame). ما يعني 60 مرة في الثانية تقريبا، و بذلك ستمكن المكعب من الدوران. + في + الأساس، أي شيء تريد تحريكه أو تغيره خلال فترة عمل التطبيق يستوجب أن تكون الأوامر الخاصة بذلك قد تم تشغيلها + داخل + حلقة الحركات. يمكنك بالتأكيد مناداة وظائف أخرى، لكي لا ينتهي بك المطاف بوظيفة واحدة تحتوي على مئات السطور. +

+ +

النتيجة

+

+ تهانينا! لقد قمت بإكمال أول تطبيق three.js لك. الأمر ليس معقدا، يجب عليك فقد البدأ بشيء ما. +

+ +

+ الشفرة البرمجية الكاملة في الأسفل إلى جانب محرر مباشر [link:https://jsfiddle.net/mkba0ecu/ live example]. + أنت + مدعو للعب بالأوامر البرمجية لكي تصبح صورة كيفية عملها أوضح من قبل. +

+ + + <html> + <head> + <title>My first three.js app</title> + <style> + body { margin: 0; } + canvas { display: block; } + </style> + </head> + <body> + <script src="js/three.js"></script> + <script> + var scene = new THREE.Scene(); + var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); + + var renderer = new THREE.WebGLRenderer(); + renderer.setSize( window.innerWidth, window.innerHeight ); + document.body.appendChild( renderer.domElement ); + + var geometry = new THREE.BoxGeometry(); + var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); + var cube = new THREE.Mesh( geometry, material ); + scene.add( cube ); + + camera.position.z = 5; + + var animate = function () { + requestAnimationFrame( animate ); + + cube.rotation.x += 0.01; + cube.rotation.y += 0.01; + + renderer.render( scene, camera ); + }; + + animate(); + </script> + </body> + </html> + + + diff --git a/docs/manual/ar/introduction/Creating-text.html b/docs/manual/ar/introduction/Creating-text.html new file mode 100644 index 00000000000000..e0c33eba5ff720 --- /dev/null +++ b/docs/manual/ar/introduction/Creating-text.html @@ -0,0 +1,111 @@ + + + + + + + + + + +

إنشاء نص ([name])

+
+

+ غالبًا ما تحتاج إلى استخدام نص في تطبيق three.js الخاص بك - إليك طريقتان يمكنك القيام بذلك. +

+
+ +

1. DOM + CSS

+
+

+ يعد استخدام HTML بشكل عام أسهل وأسرع طريقة لإضافة نص. هذه هي الطريقة المستخدمة للتراكبات الوصفية في معظم الأمثلة الثلاثة. +

+

يمكنك إضافة محتوى إلى ملف

+ <div id="info">Description</div> + +

+ وإستخدم ترميز CSS لوضع موضع مطلق (position absolutely) في موضع فوق كل المواقع الأخرى باستخدام z-index بالأخاص إذا كنت تقوم بتشغيل على كامل الشاشة three.js. +

+ + +#info { + position: absolute; + top: 10px; + width: 100%; + text-align: center; + z-index: 100; + display:block; +} + + +
+ + + +

2. ارسم نصًا على (canvas) واستخدمه كـ [page:Texture]

+
+

استخدم هذه الطريقة إذا كنت ترغب في رسم نص بسهولة على سطح في مشهد three.js.

+
+ + +

3. قم بإنشاء نموذج في التطبيق ثلاثي الأبعاد المفضل لديك وقم بتصديره إلى three.js

+
+

إستخدم هذه الطريقة إذا كنت تفضل العمل مع تطبيقاتك ثلاثية الأبعاد وإستيراد النماذج إلى three.js

+
+ + + +

4. هندسة النص الإجرائي (Procedural Text Geometry)

+
+

+ إذا كنت تفضل العمل فقط في THREE.js أو إنشاء أشكال هندسية إجرائية وديناميكية للنص ثلاثي الأبعاد ، فيمكنك إنشاء شبكة تعتبر هندستها مثيلًا لـ THREE.TextGeometry: +

+

+ new THREE.TextGeometry( text, parameters ); +

+

+ لكي يعمل هذا، ستحتاج Text Geometry إلى نموذج من THREE.Font لتعيينه لجعله إعداد "الخط" الخاصة به. + + راجع صفحة [page:TextGeometry] للحصول على مزيد من المعلومات حول كيفية القيام بذلك ، و وصف كل الخيارات المتاحة ، وقائمة بخطوط JSON التي تأتي مع توزيع THREE.js نفسه. +

+ +

أمثلة

+ +

+ [example:webgl_geometry_text WebGL / geometry / text]
+ [example:webgl_shadowmap WebGL / shadowmap] +

+ +

+ إذا كان Typeface معطلاً ، أو كنت تريد استخدام خط غير موجود ، فهناك برنامج تعليمي مع برنامج نصي بايثون لـ bender يسمح لك بتصدير النص إلى Three.js بتنسيق JSON: +
+ [link:http://www.jaanga.com/2012/03/blender-to-threejs-create-3d-text-with.html] +

+ +
+ + + +

5. خطوط نقطية (Bitmap Fonts)

+
+

+ تسمح BMFonts (الخطوط النقطية) بدمج الصور الرمزية في BufferGeometry واحد. يدعم عرض BMFont التفاف الكلمات ، وتباعد الأحرف ، وتقنين الأحرف ، وحقول المسافة الموقعة مع المشتقات القياسية ، وحقول المسافة الموقعة متعددة القنوات ، والخطوط متعددة الأنسجة ، والمزيد. + انظر [link:https://github.com/Jam3/three-bmfont-text three-bmfont-text]. +

+

+ تتوفر الخطوط في مشاريع مثل [link:https://github.com/etiennepinchon/aframe-fonts A-Frame Fonts] ، أو يمكنك إنشاء خطوطك الخاصة من أي خط .TTF ، مع التحسين لتضمين الأحرف المطلوبة للمشروع. +

+

+ بعض الأدوات المفيدة +

+
    +
  • [link:http://msdf-bmfont.donmccurdy.com/ msdf-bmfont-web] (على شبكة الإنترنت)
  • +
  • [link:https://github.com/soimy/msdf-bmfont-xml msdf-bmfont-xml] (سطر الأوامر)
  • +
  • [link:https://github.com/libgdx/libgdx/wiki/Hiero hiero] (تطبيق سطح مكتب)
  • +
+
+ + + + + diff --git a/docs/manual/ar/introduction/Drawing-lines.html b/docs/manual/ar/introduction/Drawing-lines.html new file mode 100644 index 00000000000000..52d246805ddd2b --- /dev/null +++ b/docs/manual/ar/introduction/Drawing-lines.html @@ -0,0 +1,64 @@ + + + + + + + + + + +

رسم خطوط ([name])

+
+

+ لنفترض أنك تريد رسم خط أو دائرة ، وليس إطارًا سلكيًا [page:Mesh]. نحتاج أولاً إلى إعداد العارض [page:WebGLRenderer renderer] ، المسرح [page:Scene scene] والكاميرا (انظر صفحة إنشاء مشهد). +

+ +

هذا هو الكود الذي سنستخدمه:

+ +var renderer = new THREE.WebGLRenderer(); +renderer.setSize( window.innerWidth, window.innerHeight ); +document.body.appendChild( renderer.domElement ); + +var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 500 ); +camera.position.set( 0, 0, 100 ); +camera.lookAt( 0, 0, 0 ); + +var scene = new THREE.Scene(); + +

الشيء التالي الذي سنفعله هو تحديد المادة. بالنسبة للخطوط ، يتعين علينا استخدام [page:LineBasicMaterial] أو [page:LineDashedMaterial].

+ +//create a blue LineBasicMaterial +var material = new THREE.LineBasicMaterial( { color: 0x0000ff } ); + + +

+ بعد إختيار المادة سنحتاج إلى الهندسة الخاصة بها التي تحتوي بعض القمم(vertices): +

+ + +var points = []; +points.push( new THREE.Vector3( - 10, 0, 0 ) ); +points.push( new THREE.Vector3( 0, 10, 0 ) ); +points.push( new THREE.Vector3( 10, 0, 0 ) ); + +var geometry = new THREE.BufferGeometry().setFromPoints( points ); + + +

لاحظ أنه تم رسم الخطوط بين كل زوج متتالي من الرؤوس ، ولكن ليس بين الأول والأخير (الخط غير مغلق).

+ +

الآن بعد أن أصبح لدينا نقاط لخطين ومادة ، يمكننا تجميعها معًا لتشكيل خط.

+ +var line = new THREE.Line( geometry, material ); + +

كل ما تبقى هو إضافته إلى المشهد و إستعمال أمر العرض [page:WebGLRenderer.render render].

+ + +scene.add( line ); +renderer.render( scene, camera ); + + +

يجب أن ترى الآن سهمًا يشير إلى الأعلى ، مكون من خطين أزرقين.

+
+ + diff --git a/docs/manual/ar/introduction/FAQ.html b/docs/manual/ar/introduction/FAQ.html new file mode 100644 index 00000000000000..f1769f70a63a36 --- /dev/null +++ b/docs/manual/ar/introduction/FAQ.html @@ -0,0 +1,57 @@ + + + + + + + + + + +

الأسئلة الشائعة ([name])

+ +

ما هو أفضل تنسيق النموذج ثلاثي الأبعاد الذي تدعمه المكتبة؟

+
+

+ التنسيق الموصى به لاستيراد المجسمات وتصديرها هو glTF (GL Transmission Format). نظرًا لأن glTF يركز على تسليم أصول وقت التشغيل ، فهو مضغوط للإرسال وسريع التحميل. +

+

+ توفر three.js أدوات تحميل للعديد من التنسيقات الشائعة الأخرى مثل FBX أو Collada أو OBJ أيضًا. ومع ذلك ، يجب أن تحاول دائمًا إنشاء سير عمل قائم على glTF في مشاريعك. لمزيد من المعلومات ، انظر [link:#manual/introduction/Loading-3D-models loading 3D models]. +

+
+ +

لماذا توجد علامات meta viewport في الأمثلة؟

+
+ <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + +

تتحكم هذه العلامات في حجم منفذ العرض ومقياسه لمتصفحات الجوال (حيث يمكن عرض محتوى الصفحة بحجم مختلف عن إطار العرض المرئي).

+ +

[link:https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html Safari: Using the Viewport]

+ +

[link:https://developer.mozilla.org/en/Mobile/Viewport_meta_tag MDN: Using the viewport meta tag]

+
+ +

كيف يمكن الحفاظ على مقياس المشهد عند تغيير الحجم؟

+

+ نريد أن تظهر جميع النماذج ، بغض النظر عن بعدها عن الكاميرا ، بالحجم نفسه ، حتى عندما يتم تغيير حجم النافذة. + + المعادلة الأساسية لحل هذه المعادلة هي معادلة الارتفاع المرئي على مسافة معينة: + + +visible_height = 2 * Math.tan( ( Math.PI / 180 ) * camera.fov / 2 ) * distance_from_camera; + + إذا قمنا بزيادة ارتفاع النافذة بنسبة معينة ، فإن ما نريده هو زيادة الارتفاع المرئي في جميع المسافات بنفس النسبة المئوية. + + لا يمكن القيام بذلك عن طريق تغيير موضع الكاميرا. بل ما يجب أن تفعله هو تغيير مجال رؤية الكاميرا. + [link:http://jsfiddle.net/Q4Jpu/ Example]. +

+ +

لماذا جزء من نموذجي غير مرئي؟

+

+ يمكن أن يكون هدا بسبب إعدام الوجه, فالأوجه التي تبني النموذج لها إتجاه معين من خلاله يتم تقرير ما يتم إضهار. و هده الظاهرة تقوم بإلغاء الوجه الخلفي في الحالات العادية. + لمعرفة ما إذا كانت هذه هي مشكلتك ، قم بتغيير جانب المادة إلى THREE.DoubleSide. + + material.side = THREE.DoubleSide +

+ + diff --git a/docs/manual/ar/introduction/How-to-run-things-locally.html b/docs/manual/ar/introduction/How-to-run-things-locally.html new file mode 100644 index 00000000000000..948be496de2865 --- /dev/null +++ b/docs/manual/ar/introduction/How-to-run-things-locally.html @@ -0,0 +1,141 @@ + + + + + + + + + + +

كيف تدير الأشياء محليًا

+

+ إذا كنت تستخدم الأشكال الهندسية الإجرائية فقط ولا تقوم بتحميل أي مواد ، فيجب أن تعمل صفحات الويب مباشرة من نظام الملفات ، فقط انقر نقرًا مزدوجًا فوق ملف HTML في مدير الملفات + يجب أن يعرض محتوى الصفحة في المتصفح (سترى file:///yourFile.html في شريط العناوين). +

+ +

المحتوى الذي تم تحميله من ملفات خارجية

+
+

+ إذا قمت بتحميل نماذج وأنسجة من ملفات خارجية ، نظرًا لقيود أمان المتصفحات [link:http://en.wikipedia.org/wiki/Same_origin_policy same origin policy] ، فسيفشل التحميل من نظام الملفات مع استثناء أمان. +

+ +

هناك طريقتان لحل هذا:

+ +
    +
  1. + قم بتغيير أمان الملفات المحلية في المستعرض. يتيح لك ذلك الوصول إلى صفحتك على النحو التالي: file:///yourFile.html +
  2. +
  3. + قم بتشغيل الملفات من خادم ويب محلي. يتيح لك هذا الوصول إلى صفحتك على النحو التالي: http://localhost/yourFile.html +
  4. +
+ +

+ إذا كنت تستخدم الخيار 1 ، فاعلم أنك قد تفتح نفسك لبعض نقاط الضعف إذا كنت تستخدم نفس المتصفح لتصفح الويب. قد ترغب في إنشاء ملف تعريف / اختصار متصفح منفصل يستخدم فقط للتطور لتكون في مأمن. دعنا نمر إلى كل خيار على حدة. +

+
+ + +

قم بتشغيل خادم محلي

+
+

+ تحتوي العديد من لغات البرمجة على خوادم HTTP بسيطة مضمنة فيها. فهي ليست كاملة الميزات مثل خوادم الإنتاج مثل [link:https://www.apache.org/ Apache] أو [link:https://nginx.org NGINX] ، ولكن يجب أن تكون كافية لاختبار تطبيق three.js الخاص بك. +

+ +

إضافات لمحررات الأكواد الأكثر إستعمالا

+
+

تحتوي بعض برامج تحرير الأكواد على مكونات إضافية والتي ستنتج خادمًا بسيطًا عند الطلب.

+
    +
  • [link:https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer Live Server] لـ Visual Studio Code.
  • +
  • [link:https://atom.io/packages/atom-live-server Live Server] لـ Atom.
  • +
+
+ +

Servez

+
+

+ [link:https://greggman.github.io/servez Servez] هو خادم بسيط مع واجهة المستخدم. +

+
+ +

Node.js http-server

+
+

يحتوي Node.js على حزمة خادم HTTP بسيطة. لتثبيت:

+ npm install http-server -g + +

للتشغيل (من دليلك المحلي):

+ http-server . -p 8000 +
+ +

خادم Python

+
+

+ إذا كان لديك [link:http://python.org/ Python] مثبتًا ، فيجب أن يكون كافيًا لتشغيل هذا من سطر أوامر (من دليل العمل الخاص بك): +

+ +//Python 2.x +python -m SimpleHTTPServer + +//Python 3.x +python -m http.server + + +

سيخدم هذا الملفات من الدليل الحالي في المضيف المحلي تحت المنفذ 8000 ، كمثال في شريط العنوان اكتب:

+ + http://localhost:8000/ +
+ +

خادم Ruby

+
+

إذا قمت بتثبيت Ruby ، فيمكنك الحصول على نفس النتيجة بتشغيل هذا بدلاً من ذلك:

+ +ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start" + +
+ +

خادم PHP

+
+

تحتوي PHP أيضًا على خادم ويب مدمج ، بدءًا من php 5.4.0:

+ php -S localhost:8000 +
+ +

Lighttpd

+
+

+ Lighttpd هو خادم ويب خفيف الوزن للغاية للأغراض العامة. سنغطي تثبيته على OSX مع HomeBrew هنا. على عكس الخوادم الأخرى التي تمت مناقشتها هنا ، فإن lighttpd هو خادم جاهز للإنتاج الكامل. +

+ +
    +
  1. + تثبيته بواسطة homebrew + brew install lighttpd +
  2. +
  3. + قم بإنشاء ملف ترتيب (configuration) يسمى lighttpd.conf في المجلد حيث تريد تشغيل خادم الويب الخاص بك. يوجد نموذج [link:http://redmine.lighttpd.net/projects/lighttpd/wiki/TutorialConfiguration here]. +
  4. +
  5. + في ملف conf ، قم بتغيير server.document-root إلى الدليل الذي تريد خدمة الملفات منه. +
  6. +
  7. + شغله من خلال الأمر التالي: + lighttpd -f lighttpd.conf +
  8. +
  9. + انتقل إلى http://localhost:3000 وسيخدم الملفات الثابتة من الدليل الذي تختاره. +
  10. +
+
+

IIS

+
+

إذا كنت تستخدم Microsoft IIS كخادم ويب. الرجاء إضافة إعدادات نوع MIME فيما يتعلق بامتداد .fbx قبل التحميل.

+ File name extension: fbx MIME Type: text/plain +

بشكل تلقائي ، يقوم IIS بحظر تنزيل ملفات .fbx و .obj. يجب عليك تعديل IIS لتمكين تنزيل هذا النوع من الملفات.

+
+

+ تمت مناقشة البدائل البسيطة الأخرى هنا [link:http://stackoverflow.com/q/12905426/24874 here] على Stack Overflow. +

+
+ + + diff --git a/docs/manual/ar/introduction/Installation.html b/docs/manual/ar/introduction/Installation.html new file mode 100644 index 00000000000000..151727aae6c3e8 --- /dev/null +++ b/docs/manual/ar/introduction/Installation.html @@ -0,0 +1,182 @@ + + + + + + + + + + +

التثبيت ([name])

+ +

+ يمكنك تنصيب three.js بإستعمال [link:https://www.npmjs.com/ npm] و وسائل البناء الحديثة، أو قم بالبدأ فقط + بإستعمال إصدار ثابت متوفر عبر خدمة CDN. + بالنسبة لأغلب المستخدمين تنصيب المكتبة بإستعمال npm هو الخيار الأفضل. +

+ +

+ بغض النظر عن إختيارك، كن حريصا على أن تقوم بإستدعاء جميع الملفات التي تنتمي لنفس الإصدار. خلط ملفات من إصدارات + مختلفة قد ينتج منه بعض السلوكات الغير متوقعة. +

+ +

+ جميع طرق تنصيب three.js بناءا على ES modules (شاهد + [link:https://eloquentjavascript.net/10_modules.html#h_hF2FmOVxw7 Eloquent JavaScript: ECMAScript Modules])، + التي تمكنك من إستدعاء أجزاء معينة من المكتبة دون الحاجة لإستدعاء المصدر كله. +

+ +

التثبيت بإستعمال npm

+ +

+ لتنصيب وحدة (npm module) [link:https://www.npmjs.com/package/three three]، قم بفتح نافذة الأوامر في المجلد الخاص + بمشروعك و شغل الأمر التالي: +

+ + + npm install --save three + + +

+ سيتم تحميل الرزمة و تثبيتها. و من ثم تصبح مستعد لإستدعائها كالأتي: +

+ + + /////////////////////////////////////////////////////// + // Option 1: Import the entire three.js core library. + import * as THREE from 'three'; + + const scene = new THREE.Scene(); + + + /////////////////////////////////////////////////////// + // Option 2: Import just the parts you need. + import { Scene } from 'three'; + + const scene = new Scene(); + + +

+ خلال التنصيب بإستعمال npm، لقد قمت بشكل غير مباشر بإستعمال + [link:https://eloquentjavascript.net/10_modules.html#h_zWTXAU93DC bundling tool] لجمع كل الرزم التي يحتاجها + مشروعك في ملف JavaScript واحد. + بينما يمكن لأي جامع رزم حديث العمل مع three.js، يبقى الخيار الأكثر شيوعا هو + [link:https://webpack.js.org/ webpack]. +

+ +

+ لا يمكن الوصول لكل المزايا مباشرة من خلال رزمة three (بإستعمال bare import). بقية الأجزاء المستعملة + كثيرا من المكتبة مثل + الضوابط (controls)، + المحمل (loaders)، و آثار ما بعد المعالجة (post-processing effects)، يجب إستدعائهم من مجلد + [link:https://github.com/mrdoob/three.js/tree/dev/examples/jsm examples/jsm]. لمعرفة المزيد، قم + بزيارة قسم + الأمثلة + بالأسفل. +

+ +

+ لمعرفة المزيد عن وحدات npm. + قم بزيارة [link:https://eloquentjavascript.net/20_node.html#h_J6hW/SmL/a Eloquent JavaScript: Installing with npm]. +

+ +

التثبيت من CDN أو استضافة ثابتة

+ +

+ يمكن إستعمال مكتبة three.js دون الحاجة إلى نظام بناء، سواءا عبر تحميل الملفات إلى خادم الويب الخاص بك أو باستخدام CDN موجود. بسبب أن المكتبة تعتمد على وحدات ES (modules) يجب على أي شفرة برمجية تشير إليها أن تستخدام type="module" كما هو موضح أسفله: +

+ + + <script type="module"> + + // Find the latest version by visiting https://unpkg.com/three. The URL will + // redirect to the newest stable release. + import * as THREE from 'https://unpkg.com/three@<VERSION>/build/three.module.js'; + + const scene = new THREE.Scene(); + + </script> + + +

+ ليست كل المزايا يمكن الوصول لها عبر وحدة build/three.module.js. بعض المكونات الأخرى من المكتبة - مثل الضوابط (controls) وعناصر التحميل (loaders) وتأثيرات ما بعد المعالجة (post-processing effects) - يجب إستدعائهم من الملفات الثانوية [link:https://github.com/mrdoob/three.js/tree/dev/examples/jsm examples/jsm]. +

+ + +

أمثلة

+ +

+ يركز جوهر three.js على أهم المكونات المكونة لمحرك ثلاثي الأبعاد. العديد من المكونات المفيدة الأخرى - مثل الضوابط ، عناصر التحميل ، وتأثيرات ما بعد المعالجة - هي جزء من المجلد [link:https://github.com/mrdoob/three.js/tree/dev/examples/jsm examples/jsm]. .يشار إليها باسم "أمثلة" ، لأنه بينما يمكنك استخدامها ببساطة، من المفترض أيضًا إعادة دمجها وتخصيصها. هذه المكونات تضل متزامنة مع المكتبة الأساسية + بينما يتم الاحتفاظ بحزم الجهات الخارجية المماثلة على npm بواسطة أشخاص مختلفين وقد لا تكون محدثة. +

+ +

+ لا يلزم تثبيت الأمثلة بشكل منفصل ، ولكن يجب استيرادها بشكل منفصل. إذا تم تثبيت three.js بواسطة npm ، يمكنك إستدعاء مكون OrbitControls كالأتي: +

+ + + import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; + + const controls = new OrbitControls(); + + +

+ إذا تم تثبيت three.js من CDN ، فمن المستحسن إستخدم نفس CDN لتثبيت المكونات الأخرى: +

+ + + <script type="module"> + + // Find the latest version by visiting https://unpkg.com/three. The URL will + // redirect to the newest stable release. + import { OrbitControls } from 'https://unpkg.com/three@<VERSION>/examples/jsm/controls/OrbitControls.js'; + + const controls = new OrbitControls(); + + </script> + + +

+ من المهم أن تستخدم جميع الملفات نفس الإصدار. لا تستورد أمثلة مختلفة من إصدارات مختلفة، أو تستخدم أمثلة من إصدارات مختلفة عن مكتبة three.js نفسها. +

+ +

التوافق

+ +

واردات CommonJS

+ +

+ في حين أن معظم حِزم JavaScript الحديثة تدعم الآن وحدات ES افتراضيًا ، فقد لا تدعم بعض أدوات البناء القديمة. + في مثل هذه الحالات بإستطاعتك تعديل المجمع لفهم وحدات ES:
+ [link:http://browserify.org/ Browserify] يحتاج فقط إلى إضافة [link:https://github.com/babel/babelify babelify] على سبيل المثال. +

+ +

خرائط الإستيراد

+ +

+ تختلف المسارات المستوردة عند التثبيت من npm ، مقارنة بالتثبيت من استضافة ثابتة أو CDN. نحن ندرك أن هذه مشكلة مريحة لكلا مجموعتي المستخدمين. + يفضل المطورون الذين لديهم أدوات إنشاء وحزم محددات الحزم المجردة (على سبيل المثال "three") بدلاً من المسارات النسبية ، وتستخدم الملفات في المجلد examples/ مراجع نسبية إلى three.module.js التي لا تتبع هذا التوقع. + أولئك الذين لا يستخدمون أدوات الإنشاء - للنماذج الأولية السريعة أو التعلم أو التفضيل الشخصي - قد يكرهون بالمثل تلك الواردات النسبية ، والتي تتطلب هياكل مجلدات معينة وتكون أقل تسامحًا من مساحة الاسم THREE. * العام. +

+ +

+ نأمل في إزالة هذه المسارات النسبية عندما يصبح [link:https://github.com/WICG/import-maps import maps] متاحًا على نطاق واسع ، واستبدالها بمحددات الحزمة المجردة إلى اسم الحزمة npm ، 'three'. يتطابق هذا مع توقعات أداة الإنشاء لحزم npm بشكل وثيق ، ويسمح لمجموعتي المستخدمين بكتابة نفس الرمز تمامًا عند استيراد ملف. بالنسبة للمستخدمين الذين يفضلون تجنب أدوات الإنشاء ، يمكن أن يوجه تعيين JSON البسيط جميع الواردات إلى CDN أو مجلد ملف ثابت. من الناحية التجريبية ، يمكنك محاولة استخدام عمليات استيراد أبسط اليوم مع تعبئة خريطة الاستيراد ، كما هو موضح في [link:https://glitch.com/edit/#!/three-import-map?path=index.html import map example]. +

+ +

Node.js

+ +

+ قد يكون استخدام three.js في Node.js أمرًا صعبًا ، وذلك لسببين: +

+ +

+ أولاً ، نظرًا لأن three.js مصممة للويب ، فإنها تعتمد على المتصفح وواجهات برمجة تطبيقات DOM التي لا تتواجد دائمًا في Node.js. يمكن حل بعض هذه المشكلات باستخدام (shims) مثل [link:https://github.com/stackgl/headless-gl headless-gl]، أو عن طريق استبدال مكونات مثل [page: TextureLoader] ببدائل مخصصة. قد تتشابك واجهات برمجة تطبيقات DOM الأخرى بعمق مع الكود الذي يستخدمها ، وسيكون من الصعب حلها. نرحب بطلبات السحب البسيطة والقابلة للصيانة لتحسين دعم Node.js ، لكننا نوصي بفتح مشكلة لمناقشة التحسينات التي أجريتها أولاً. +

+ +

+ ثانيًا ، دعم Node.js لوحدات ES ... معقد. بدءًا من الإصدار 12 من Node.js ، يمكن استيراد المكتبة الأساسية كوحدة نمطية CommonJS ، مع require('three'). ومع ذلك ، فإن معظم أمثلة المكونات في examples/jsm لا يمكنها ذلك. + قد تحل الإصدارات المستقبلية من Node.js هذه المشكلة ، ولكن في هذه الأثناء قد تحتاج إلى استخدام حلول بديلة مثل [link:https://github.com/standard-things/esm esm] لتمكين تطبيق Node.js الخاص بك من التعرف على وحدات ES. +

+ + + diff --git a/docs/manual/ar/introduction/Loading-3D-models.html b/docs/manual/ar/introduction/Loading-3D-models.html new file mode 100644 index 00000000000000..b313d6c6f50f9f --- /dev/null +++ b/docs/manual/ar/introduction/Loading-3D-models.html @@ -0,0 +1,135 @@ + + + + + + + + + + + + +

تحميل نماذج ثلاثية الأبعاد

+ +

+ تتوفر النماذج ثلاثية الأبعاد في مئات من تنسيقات الملفات ، ولكل منها أغراض مختلفة وميزات متنوعة وتعقيد متفاوت. برغم من أن + + مكتبة three.js توفر العديد من عناصر التحميل، فإن اختيار التنسيق المناسب وسير العمل سيوفر الوقت والإحباط لاحقًا. يصعب العمل مع بعض التنسيقات ، أو أنها غير فعالة في تجارب الوقت الفعلي ، أو ببساطة غير مدعومة بالكامل في هذا الوقت. +

+ +

+ يوفر هذا الدليل سير عمل موصى به لمعظم المستخدمين ، واقتراحات لما يجب تجربته إذا لم تسير الأمور كما هو متوقع. +

+ +

قبل أن نبدأ

+ +

+ إذا كنت جديدًا في تشغيل خادم محلي ، فابدأ بكيفية إدارة الأشياء محليًا [link:#manual/introduction/How-to-run-things-locally how to run things locally] أولاً. يمكن تجنب العديد من الأخطاء الشائعة أثناء عرض النماذج ثلاثية الأبعاد عن طريق استضافة الملفات بشكل صحيح. +

+ +

سير العمل الموصى به

+ +

+ حيثما أمكن ، نوصي باستخدام glTF (تنسيق نقل GL). كلا النسختين .GLB و .GLTF من التنسيق مدعومة بشكل جيد. نظرًا لأن glTF يركز على تسليم أصول وقت التشغيل ، فهو مضغوط للإرسال وسريع التحميل. تتضمن الميزات الشبكات والمواد والأنسجة والجلود والهياكل العظمية والأهداف المتحولة والرسوم المتحركة والأضواء والكاميرات. +

+ +

+ تتوفر ملفات glTF عامة على مواقع مثل + + Sketchfab، أو أدوات متنوعة تتضمن تصدير glTF: +

+ + + +

+ إذا كانت أدواتك المفضلة لا تدعم glTF ، ففكر في طلب تصدير glTF من المؤلفين ، أو النشر على + the glTF roadmap thread. +

+ +

+ عندما لا يكون glTF خيارًا ، تتوفر أيضًا التنسيقات الشائعة مثل FBX أو OBJ أو COLLADA ويتم صيانتها بانتظام. +

+ +

التحميل

+ +

+ يتم تضمين عدد قليل فقط من عناصر التحميل (على سبيل المثال [page:ObjectLoader]) بشكل ألي مع + three.js - يجب عليك إضافة الآخرين إلى تطبيقك بشكل فردي. +

+ + + import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; + + +

+ بمجرد قيامك باستيراد عنصر التحميل ، فأنت جاهز لإضافة نموذج إلى المشهد الخاص بك. يختلف بناء الجملة باختلاف عناصر التحميل - عند استخدام تنسيق آخر ، تحقق من الأمثلة والوثائق الخاصة بهذا المُحمل. بالنسبة إلى glTF ، سيكون الاستخدام مع البرامج النصية العامة: +

+ + + var loader = new GLTFLoader(); + + loader.load( 'path/to/model.glb', function ( gltf ) { + + scene.add( gltf.scene ); + + }, undefined, function ( error ) { + + console.error( error ); + + } ); + + +

+ انظر [page:GLTFLoader GLTFLoader documentation] لمزيد من التفاصيل. +

+ +

إستكشاف الأخطاء وإصلاحها

+ +

+ إن كنت قد أمضيت ساعات في تصميم تحفة فنية ، وقمت بتحميلها في صفحة الويب ، و- لا! 😭 إنه مشوه أو مفقود تمامًا. ابدأ بالخطوات التالية لاستكشاف الأخطاء وإصلاحها: +

+ +
    +
  1. + تحقق من وحدة تحكم جافا سكريبت بحثًا عن أخطاء ، وتأكد من استخدام رد اتصال onError عند استدعاء .load () لتسجيل النتيجة. +
  2. +
  3. + اعرض النموذج في تطبيق آخر. بالنسبة إلى glTF ، تتوفر عارضات السحب والإفلات لـ + three.js و + babylon.js. إذا ظهر النموذج بشكل صحيح في تطبيق واحد أو أكثر ، + إرفع إعلان وجود خطأ ضد المكتبة. + إذا تعذر عرض النموذج في أي تطبيق ، فإننا نشجع بشدة على تسجيل خطأ في التطبيق المستخدم لإنشاء النموذج. +
  4. +
  5. + حاول تكبير النموذج لأعلى أو لأسفل بعامل 1000. يتم قياس العديد من الأمثلة بشكل مختلف ، وقد لا تظهر الأمثلة الكبيرة إذا كانت الكاميرا داخل النموذج. +
  6. +
  7. + حاول إضافة مصدر ضوء وتحديد موضعه. قد يكون النموذج مخفيًا في الظلام. +
  8. +
  9. + ابحث عن طلبات النسيج الفاشلة في علامة تبويب الشبكة ، مثل C:\\Path\To\Model\texture.jpg. استخدم المسارات المتعلقة بنموذجك بدلاً من ذلك ، مثل images/texture.jpg - قد يتطلب ذلك تعديل ملف النموذج في محرر نصي. +
  10. +
+ +

طلب المساعدة

+ +

+ إذا مررت بعملية استكشاف الأخطاء وإصلاحها أعلاه ولا يزال نموذجك لا يعمل ، فإن الطريقة الصحيحة لطلب المساعدة ستوصلك إلى حل بشكل أسرع. انشر سؤالاً على منتدى المكتبة + three.js forum وحيثما أمكن ، قم بتضمين النموذج الخاص بك (أو نموذج أبسط بنفس المشكلة) بأي تنسيقات متوفرة لديك. قم بتضمين معلومات كافية لشخص آخر لإعادة إنتاج المشكلة بسرعة - من الناحية المثالية ، عرض توضيحي مباشر. +

+ + + + diff --git a/docs/manual/ar/introduction/Typescript-setup.html b/docs/manual/ar/introduction/Typescript-setup.html new file mode 100644 index 00000000000000..426eed4190cd4d --- /dev/null +++ b/docs/manual/ar/introduction/Typescript-setup.html @@ -0,0 +1,43 @@ + + + + + + + + + + +

Typescript إعدادات

+ +

+ three.js هي مكتبة قائمة على JavaScript. ومع ذلك ، من الممكن استخدامه في مشروع TypeScript ، حيث تعرض المكتبة [link:https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html Declaration Files] ملفات التصريح (ملفات * d.ts *). +

+ +

+ الحد الأدنى من التكوين المطلوب لكي يتمكن برنامج التحويل البرمجي TypeScript من + اكتشف أنواع three.js. +
+ ستحتاج إلى ضبط الخيار [link:https://www.typescriptlang.org/docs/handbook/module-resolution.html moduleResolution] على *node* ، وخيار [link:https://www.typescriptlang.org/docs/handbook/compiler-options.html target] على *es6* أو ما هو أحدث. +

+ + + // Example of minimal `tsconfig.json` file + { + "compilerOptions": { + "target": "es6", + "moduleResolution": "node", + }, + "include": [ "./src/**/*.ts" ], + } + + +

+ ملاحظة: اعتبارًا من اليوم ، ليس من الممكن استخدام كتابة three.js بدون استخدام هذين الخيارين. +

+ +

+ ملاحظة: يحدث أن بعض التصريحات غير صحيحة و / أو مفقودة. تُعد المساهمة في ملفات التصريح مفيدة حقًا للمجتمع ، مما يجعل كتابات three.js أفضل وأكثر دقة. +

+ + diff --git a/docs/manual/ar/introduction/Useful-links.html b/docs/manual/ar/introduction/Useful-links.html new file mode 100644 index 00000000000000..dfd58841df1572 --- /dev/null +++ b/docs/manual/ar/introduction/Useful-links.html @@ -0,0 +1,175 @@ + + + + + + + + + + +

روابط مفيدة

+ +

+ فيما يلي مجموعة من الروابط التي قد تجدها مفيدة عند تعلم three.js.
+ إذا وجدت شيئًا ما ترغب في إضافته هنا ، أو تعتقد أن أحد الروابط أدناه لم يعد مناسبًا أو يعمل ، فلا تتردد في النقر فوق الزر "تحرير" في الجزء السفلي الأيسر وإجراء بعض التغييرات!

+ + لاحظ أيضًا أنه نظرًا لأن موقع three.js قيد التطوير السريع ، فإن الكثير من هذه الروابط سيحتوي على معلومات قديمة - إذا كان هناك شيء لا يعمل كما تتوقع أو كما يقول أحد هذه الروابط ، تحقق من وحدة تحكم المتصفح للتحذيرات أو الأخطاء. تحقق أيضًا من صفحات المستندات ذات الصلة. +

+ +

منتديات المساعدة

+

+ يستخدم Three.js رسميًا [link:https://discourse.threejs.org/ forum] و [link:http://stackoverflow.com/tags/three.js/info Stack Overflow] لطلبات المساعدة. إذا كنت بحاجة إلى مساعدة في شيء ما ، فهذا هو المكان المناسب لك. لا تفتح مشكلة على Github لطلبات المساعدة. +

+ +

الدروس والدورات

+ +

الشروع في العمل مع three.js

+
    +
  • + [link:https://threejsfundamentals.org/threejs/lessons/threejs-fundamentals.html Three.js Fundamentals starting lesson] +
  • +
  • + [link:https://codepen.io/rachsmith/post/beginning-with-3d-webgl-pt-1-the-scene Beginning with 3D WebGL] بواسطة [link:https://codepen.io/rachsmith/ Rachel Smith]. +
  • +
  • + [link:https://www.august.com.au/blog/animating-scenes-with-webgl-three-js/ Animating scenes with WebGL and three.js] +
  • +
+ +

مقالات ودورات أكثر شمولاً / متقدمة

+
    +
  • + [link:https://discoverthreejs.com/ Discover three.js] +
  • +
  • + [link:https://threejsfundamentals.org/ Three.js Fundamentals] +
  • +
  • + [link:http://blog.cjgammon.com/ Collection of tutorials] by [link:http://www.cjgammon.com/ CJ Gammon]. +
  • +
  • + [link:https://medium.com/soffritti.pierfrancesco/glossy-spheres-in-three-js-bfd2785d4857 Glossy spheres in three.js]. +
  • +
  • + [link:https://www.udacity.com/course/cs291 Interactive 3D Graphics] - دورة مجانية على Udacity تُعلِّم أساسيات الرسومات ثلاثية الأبعاد ، وتستخدم three.js كأداة تشفير لها. +
  • +
  • + [Link:https://aerotwist.com/tutorials/ Aerotwist] tutorials by [link:https://github.com/paullewis/ Paul Lewis]. +
  • +
  • + [link:http://learningthreejs.com/ Learning Three.js] – مدونة تحتوي على مقالات مخصصة لتدريس three.js +
  • +
  • + [link:https://discourse.threejs.org/t/three-js-bookshelf/2468 Three.js Bookshelf] - هل تبحث عن مزيد من الموارد حول three.js أو رسومات الكمبيوتر بشكل عام؟ تحقق من اختيار الأدبيات التي أوصى بها مجتمع المكتبة. +
  • +
+ +

الأخبار والتحديثات

+
    +
  • + [link:https://twitter.com/hashtag/threejs Three.js on Twitter] +
  • +
  • + [link:http://www.reddit.com/r/threejs/ Three.js on reddit] +
  • +
  • + [link:http://www.reddit.com/r/webgl/ WebGL on reddit] +
  • +
  • + [link:http://learningwebgl.com/blog/ Learning WebGL Blog] – مصدر الأخبار الموثوق لـ WebGL. +
  • +
+ +

أمثلة

+
    +
  • + [link:https://github.com/edwinwebb/three-seed/ three-seed] - three.js starter مع ES6 و Webpack +
  • +
  • + [link:http://stemkoski.github.io/Three.js/index.html Professor Stemkoskis Examples] - مجموعة من الأمثلة الصديقة للمبتدئين التي تم إنشاؤها باستخدام three.js r60. +
  • +
  • + [link:https://threejs.org/examples/ Official three.js examples] - يتم الاحتفاظ بهذه الأمثلة كجزء من مستودع three.js ، ودائمًا ما تستخدم أحدث إصدار من three.js. +
  • +
  • + [link:https://raw.githack.com/mrdoob/three.js/dev/examples/ Official three.js dev branch examples] - + كما هو مذكور أعلاه ، باستثناء هذه تستخدم فرع dev من three.js ، وتُستخدم للتحقق من أن كل شيء يعمل كما تم تطوير three.js. +
  • +
+ +

أدوات

+
    +
  • + [link:http://www.physgl.org/ physgl.org] - واجهة JavaScript الأمامية مع أغلفة لـ three.js ، لجلب رسومات WebGL للطلاب الذين يتعلمون الفيزياء والرياضيات. +
  • +
  • + [link:https://whs.io/ Whitestorm.js] – إطار عمل modular three.js مع البرنامج المساعد AmmoNext للفيزياء. +
  • + +
  • + [link:http://zz85.github.io/zz85-bookmarklets/threelabs.html Three.js Inspector] +
  • +
  • + [link:http://idflood.github.io/ThreeNodes.js/ ThreeNodes.js]. +
  • +
  • + [link:https://marketplace.visualstudio.com/items?itemName=bierner.comment-tagged-templates comment-tagged-templates] - VSCode extension syntax highlighting for tagged template strings, like: glsl.js. +
  • +
  • + [link:https://github.com/MozillaReality/WebXR-emulator-extension WebXR-emulator-extension] +
  • +
+ +

مراجع WebGL

+
    +
  • + [link:https://www.khronos.org/files/webgl/webgl-reference-card-1_0.pdf webgl-reference-card.pdf] - مراجع لجميع الكلمات الرئيسية والمصطلحات والنحو والتعريفات في WebGL و GLSL. +
  • +
+ +

الروابط القديمة

+

+ يتم الاحتفاظ بهذه الروابط لأغراض تاريخية - قد لا تزال تجدها مفيدة ، ولكن حذر من أنها قد تحتوي على معلومات تتعلق بالإصدارات القديمة جدًا من three.js. +

+ +
    +
  • + AlterQualia at WebGL Camp 3 +
  • +
  • + [link:http://yomotsu.github.io/threejs-examples/ Yomotsus Examples] - مجموعة من الأمثلة باستخدام three.js r45. +
  • +
  • + [link:http://fhtr.org/BasicsOfThreeJS/#1 Introduction to Three.js] بواسطة [link:http://github.com/kig/ Ilmari Heikkinen] (slideshow). +
  • +
  • + [link:http://www.slideshare.net/yomotsu/webgl-and-threejs WebGL and Three.js] بواسطة [link:http://github.com/yomotsu Akihiro Oyamada] (slideshow). +
  • +
  • + [link:http://bkcore.com/blog/general/adobe-user-group-nl-talk-video-hexgl.html Fast HTML5 game development using three.js] بواسطة [link:https://github.com/BKcore BKcore] (video). +
  • +
  • + Trigger Rally بواسطة [link:https://github.com/jareiko jareiko] (video). +
  • +
  • + [link:http://blackjk3.github.io/threefab/ ThreeFab] - محرر مشاهد ، تم دعم إصداراته حتى حوالي three.js r50. +
  • +
  • + [link:http://bkcore.com/blog/3d/webgl-three-js-workflow-tips.html Max to Three.js workflow tips and tricks] بواسطة [link:https://github.com/BKcore BKcore] +
  • +
  • + [link:http://12devsofxmas.co.uk/2012/01/webgl-and-three-js/ A whirlwind look at Three.js] + بواسطة [link:http://github.com/nrocy Paul King] +
  • +
  • + [link:http://bkcore.com/blog/3d/webgl-three-js-animated-selective-glow.html Animated selective glow in Three.js] + بواسطة [link:https://github.com/BKcore BKcore] +
  • +
  • + [link:http://www.natural-science.or.jp/article/20120220155529.php Building A Physics Simulation Environment] - أمثلة تعليمية باللغة اليابانية +
  • +
+ + + diff --git a/docs/manual/ar/introduction/WebGL-compatibility-check.html b/docs/manual/ar/introduction/WebGL-compatibility-check.html new file mode 100644 index 00000000000000..976b46ce595aaf --- /dev/null +++ b/docs/manual/ar/introduction/WebGL-compatibility-check.html @@ -0,0 +1,35 @@ + + + + + + + + + + +

فحص توافق WebGL

+

+ على الرغم من أن هذه المشكلة أصبحت أقل وأقل ، إلا أن بعض الأجهزة أو المتصفحات قد لا تدعم WebGL. + تتيح لك الطريقة التالية التحقق مما إذا كانت مدعومة وعرض رسالة للمستخدم إذا لم تكن مدعومة. +

+ +

+ أضف [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js] إلى جافا سكريبت الخاص بك وقم بتشغيل ما يلي قبل محاولة تقديم أي شيء. +

+ + + if ( WEBGL.isWebGLAvailable() ) { + + // Initiate function or other initializations here + animate(); + + } else { + + var warning = WEBGL.getWebGLErrorMessage(); + document.getElementById( 'container' ).appendChild( warning ); + + } + + + diff --git a/docs/page.css b/docs/page.css index f87dadce0475ba..069da5696ba563 100644 --- a/docs/page.css +++ b/docs/page.css @@ -64,6 +64,20 @@ body { word-break: break-word; } +body.rtl h1, +body.rtl h2, +body.rtl h3, +body.rtl h4, +body.rtl p, +body.rtl ul, +body.rtl ol, +body.rtl table { + direction: rtl !important; +} +body.rtl code { + direction: ltr !important; +} + a { color: var(--color-blue); cursor: pointer; diff --git a/editor/index.html b/editor/index.html index 94a2bff8a400a2..7a57a53233ff74 100644 --- a/editor/index.html +++ b/editor/index.html @@ -21,7 +21,6 @@ - diff --git a/editor/js/Menubar.Edit.js b/editor/js/Menubar.Edit.js index ff96671ac56cc2..c7363a3f3d1db3 100644 --- a/editor/js/Menubar.Edit.js +++ b/editor/js/Menubar.Edit.js @@ -2,8 +2,6 @@ import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js'; import { AddObjectCommand } from './commands/AddObjectCommand.js'; import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js'; -import { MultiCmdsCommand } from './commands/MultiCmdsCommand.js'; -import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js'; function MenubarEdit( editor ) { @@ -123,85 +121,7 @@ function MenubarEdit( editor ) { } ); options.add( option ); - // Minify shaders - - var option = new UIRow(); - option.setClass( 'option' ); - option.setTextContent( strings.getKey( 'menubar/edit/minify_shaders' ) ); - option.onClick( function () { - - var root = editor.selected || editor.scene; - - var errors = []; - var nMaterialsChanged = 0; - - var path = []; - - function getPath( object ) { - - path.length = 0; - - var parent = object.parent; - if ( parent !== undefined ) getPath( parent ); - - path.push( object.name || object.uuid ); - - return path; - - } - - var cmds = []; - root.traverse( function ( object ) { - - var material = object.material; - - if ( material !== undefined && material.isShaderMaterial ) { - - try { - - var shader = glslprep.minifyGlsl( [ - material.vertexShader, material.fragmentShader ] ); - - cmds.push( new SetMaterialValueCommand( editor, object, 'vertexShader', shader[ 0 ] ) ); - cmds.push( new SetMaterialValueCommand( editor, object, 'fragmentShader', shader[ 1 ] ) ); - - ++ nMaterialsChanged; - - } catch ( e ) { - - var path = getPath( object ).join( "/" ); - - if ( e instanceof glslprep.SyntaxError ) - - errors.push( path + ":" + - e.line + ":" + e.column + ": " + e.message ); - - else { - - errors.push( path + - ": Unexpected error (see console for details)." ); - - console.error( e.stack || e ); - - } - - } - - } - - } ); - - if ( nMaterialsChanged > 0 ) { - - editor.execute( new MultiCmdsCommand( editor, cmds ), 'Minify Shaders' ); - - } - - window.alert( nMaterialsChanged + - " material(s) were changed.\n" + errors.join( "\n" ) ); - - } ); - options.add( option ); + // options.add( new UIHorizontalRule() ); diff --git a/editor/js/Strings.js b/editor/js/Strings.js index 81b8d9a7662e02..a38f5931afe88d 100644 --- a/editor/js/Strings.js +++ b/editor/js/Strings.js @@ -29,7 +29,6 @@ function Strings( config ) { 'menubar/edit/clear_history': 'Clear History', 'menubar/edit/clone': 'Clone', 'menubar/edit/delete': 'Delete (Del)', - 'menubar/edit/minify_shaders': 'Minify Shaders', 'menubar/edit/fixcolormaps': 'Fix Color Maps', 'menubar/add': 'Add', @@ -348,7 +347,6 @@ function Strings( config ) { 'menubar/edit/clear_history': 'Supprimer Historique', 'menubar/edit/clone': 'Cloner', 'menubar/edit/delete': 'Supprimer (Supp)', - 'menubar/edit/minify_shaders': 'Minimiser les Shaders', 'menubar/edit/fixcolormaps': 'Correction des couleurs', 'menubar/add': 'Ajouter', @@ -667,7 +665,6 @@ function Strings( config ) { 'menubar/edit/clear_history': '清空历史记录', 'menubar/edit/clone': '拷贝', 'menubar/edit/delete': '删除 (Del)', - 'menubar/edit/minify_shaders': '压缩着色器', 'menubar/edit/fixcolormaps': '修复颜色贴图', 'menubar/add': '添加', diff --git a/editor/js/libs/glslprep.min.js b/editor/js/libs/glslprep.min.js deleted file mode 100644 index 79c22a637d17a1..00000000000000 --- a/editor/js/libs/glslprep.min.js +++ /dev/null @@ -1,202 +0,0 @@ -/* Copyright 2011-2015 Roy Williams, Tobias Schwinger and the Closure team. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -(function(){var aa=this;function da(c){return void 0!==c} -function ea(c){var f=typeof c;if("object"==f)if(c){if(c instanceof Array)return"array";if(c instanceof Object)return f;var k=Object.prototype.toString.call(c);if("[object Window]"==k)return"object";if("[object Array]"==k||"number"==typeof c.length&&"undefined"!=typeof c.splice&&"undefined"!=typeof c.propertyIsEnumerable&&!c.propertyIsEnumerable("splice"))return"array";if("[object Function]"==k||"undefined"!=typeof c.call&&"undefined"!=typeof c.propertyIsEnumerable&&!c.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==f&&"undefined"==typeof c.call)return"object";return f}function fa(c,f,k){return c.call.apply(c.bind,arguments)}function ga(c,f,k){if(!c)throw Error();if(2=a?(b="x",e=2):(b="u",e=4);var d=a.toString(16).toUpperCase(),a=d;e-=d.length;for(d=0;dta&&(ta=b,ob=[]),ob.push(c))}function u(){var w="newLine@"+b,a=p[w];if(a)return b= -a.b,a.result;var e;e=b;/^[\n]/.test(c.charAt(b))?(a=c.charAt(b),b++):(a=null,0===l&&g("[\\n]"));null!==a&&(a="\n");null===a&&(b=e);p[w]={b:b,result:a};return a}function B(){var w="EOF@"+b,a=p[w];if(a)return b=a.b,a.result;var e;e=b;l++;c.length>b?(a=c.charAt(b),b++):(a=null,0===l&&g("any character"));l--;null===a?a="":(a=null,b=e);p[w]={b:b,result:a};return a}function q(){var w="_@"+b,a=p[w];if(a)return b=a.b,a.result;var e;l++;e=u();null===e&&(/^[\\\n]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null, -0===l&&g("[\\\\\\n]")),null===e&&(/^[\r\t\f\x0B ]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null,0===l&&g("[\\r\\t\\f\\x0B ]")),null===e&&(e=C())));if(null!==e)for(a=[];null!==e;)a.push(e),e=u(),null===e&&(/^[\\\n]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null,0===l&&g("[\\\\\\n]")),null===e&&(/^[\r\t\f\x0B ]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null,0===l&&g("[\\r\\t\\f\\x0B ]")),null===e&&(e=C())));else a=null;l--;0===l&&null===a&&g("whitespace");p[w]={b:b,result:a};return a}function x(){var w= -"noNewlineComment@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h,m,t;m=b;"/*"===c.substr(b,2)?(a="/*",b+=2):(a=null,0===l&&g('"/*"'));if(null!==a){e=[];h=t=b;l++;"*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"'));l--;null===d?d="":(d=null,b=h);null!==d?(c.length>b?(h=c.charAt(b),b++):(h=null,0===l&&g("any character")),null!==h?d=[d,h]:(d=null,b=t)):(d=null,b=t);for(;null!==d;)e.push(d),h=t=b,l++,"*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"')),l--,null===d?d="":(d=null,b=h), -null!==d?(c.length>b?(h=c.charAt(b),b++):(h=null,0===l&&g("any character")),null!==h?d=[d,h]:(d=null,b=t)):(d=null,b=t);null!==e?("*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"')),null!==d?a=[a,e,d]:(a=null,b=m)):(a=null,b=m)}else a=null,b=m;if(null===a)if(m=b,"//"===c.substr(b,2)?(a="//",b+=2):(a=null,0===l&&g('"//"')),null!==a){e=[];/^[^\n]/.test(c.charAt(b))?(d=c.charAt(b),b++):(d=null,0===l&&g("[^\\n]"));for(;null!==d;)e.push(d),/^[^\n]/.test(c.charAt(b))?(d=c.charAt(b),b++):(d=null, -0===l&&g("[^\\n]"));null!==e?a=[a,e]:(a=null,b=m)}else a=null,b=m;p[w]={b:b,result:a};return a}function ha(){var w="noNewlineWhitespace@"+b,a=p[w];if(a)return b=a.b,a.result;var e;/^[\r\t\f\x0B ]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null,0===l&&g("[\\r\\t\\f\\x0B ]"));null===e&&(e=x());if(null!==e)for(a=[];null!==e;)a.push(e),/^[\r\t\f\x0B ]/.test(c.charAt(b))?(e=c.charAt(b),b++):(e=null,0===l&&g("[\\r\\t\\f\\x0B ]")),null===e&&(e=x());else a=null;p[w]={b:b,result:a};return a}function C(){var w= -"comment@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h,m,t;l++;m=b;"/*"===c.substr(b,2)?(a="/*",b+=2):(a=null,0===l&&g('"/*"'));if(null!==a){e=[];h=t=b;l++;"*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"'));l--;null===d?d="":(d=null,b=h);null!==d?(c.length>b?(h=c.charAt(b),b++):(h=null,0===l&&g("any character")),null!==h?d=[d,h]:(d=null,b=t)):(d=null,b=t);for(;null!==d;)e.push(d),h=t=b,l++,"*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"')),l--,null===d?d="":(d=null,b=h),null!== -d?(c.length>b?(h=c.charAt(b),b++):(h=null,0===l&&g("any character")),null!==h?d=[d,h]:(d=null,b=t)):(d=null,b=t);null!==e?("*/"===c.substr(b,2)?(d="*/",b+=2):(d=null,0===l&&g('"*/"')),null!==d?a=[a,e,d]:(a=null,b=m)):(a=null,b=m)}else a=null,b=m;if(null===a)if(m=b,"//"===c.substr(b,2)?(a="//",b+=2):(a=null,0===l&&g('"//"')),null!==a){e=[];/^[^\n]/.test(c.charAt(b))?(d=c.charAt(b),b++):(d=null,0===l&&g("[^\\n]"));for(;null!==d;)e.push(d),/^[^\n]/.test(c.charAt(b))?(d=c.charAt(b),b++):(d=null,0===l&& -g("[^\\n]"));null!==e?(d=u(),null===d&&(d=B()),null!==d?a=[a,e,d]:(a=null,b=m)):(a=null,b=m)}else a=null,b=m;l--;0===l&&null===a&&g("comment");p[w]={b:b,result:a};return a}function A(){var w="semicolon@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(59===c.charCodeAt(b)?(e=";",b+=1):(e=null,0===l&&g('";"')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function H(){var w="comma@"+b,a=p[w]; -if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(44===c.charCodeAt(b)?(e=",",b+=1):(e=null,0===l&&g('","')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function ua(){var w="left_bracket@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(91===c.charCodeAt(b)?(e="[",b+=1):(e=null,0===l&&g('"["')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null, -b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function va(){var w="right_bracket@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(93===c.charCodeAt(b)?(e="]",b+=1):(e=null,0===l&&g('"]"')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function cc(){var w="equals@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(61===c.charCodeAt(b)?(e="=",b+=1):(e=null, -0===l&&g('"="')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function ba(){var w="left_paren@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(40===c.charCodeAt(b)?(e="(",b+=1):(e=null,0===l&&g('"("')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function ca(){var w="right_paren@"+b,a=p[w];if(a)return b=a.b,a.result; -var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(41===c.charCodeAt(b)?(e=")",b+=1):(e=null,0===l&&g('")"')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function pb(){var w="left_brace@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(123===c.charCodeAt(b)?(e="{",b+=1):(e=null,0===l&&g('"{"')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b, -result:a};return a}function qb(){var w="right_brace@"+b,a=p[w];if(a)return b=a.b,a.result;var e,d,h;h=b;a=q();a=null!==a?a:"";null!==a?(125===c.charCodeAt(b)?(e="}",b+=1):(e=null,0===l&&g('"}"')),null!==e?(d=q(),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=h)):(a=null,b=h)):(a=null,b=h);p[w]={b:b,result:a};return a}function ja(){var c="external_statement_list@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,a=b;e=[];for(d=rb();null!==d;)e.push(d),d=rb();if(null!==e){d=new y({type:"root",C:[]});for(var h= -0;h>"===c.substr(b,2)?(a=">>",b+=2):(a=null,0===l&&g('">>"')));null!== -a?(m=b,l++,61===c.charCodeAt(b)?(e="=",b+=1):(e=null,0===l&&g('"="')),l--,null===e?e="":(e=null,b=m),null!==e?a=[a,e]:(a=null,b=h)):(a=null,b=h);null!==a&&(a=new y({type:"operator",j:a[0]}));null===a&&(b=d);p[f]={b:b,result:a};return a}function ab(){var c="shift_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,h,f,g,k,l,n;l=k=b;a=$a();if(null!==a){e=[];n=b;d=q();d=null!==d?d:"";null!==d?(h=Ob(),null!==h?(f=q(),f=null!==f?f:"",null!==f?(g=$a(),null!==g?d=[d,h,f,g]:(d=null,b=n)):(d=null,b=n)): -(d=null,b=n)):(d=null,b=n);for(;null!==d;)e.push(d),n=b,d=q(),d=null!==d?d:"",null!==d?(h=Ob(),null!==h?(f=q(),f=null!==f?f:"",null!==f?(g=$a(),null!==g?d=[d,h,f,g]:(d=null,b=n)):(d=null,b=n)):(d=null,b=n)):(d=null,b=n);null!==e?a=[a,e]:(a=null,b=l)}else a=null,b=l;null!==a&&(a=X(a[0],a[1]));null===a&&(b=k);p[c]={b:b,result:a};return a}function Pb(){var f="relational_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,m;m=h=b;60===c.charCodeAt(b)?(a="<",b+=1):(a=null,0===l&&g('"<"'));null!== -a?(d=b,l++,60===c.charCodeAt(b)?(e="<",b+=1):(e=null,0===l&&g('"<"')),l--,null===e?e="":(e=null,b=d),null!==e?(61===c.charCodeAt(b)?(d="=",b+=1):(d=null,0===l&&g('"="')),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=m)):(a=null,b=m)):(a=null,b=m);null!==a&&(a=new y({type:"operator",j:"<"+a[2]}));null===a&&(b=h);null===a&&(m=h=b,62===c.charCodeAt(b)?(a=">",b+=1):(a=null,0===l&&g('">"')),null!==a?(d=b,l++,62===c.charCodeAt(b)?(e=">",b+=1):(e=null,0===l&&g('">"')),l--,null===e?e="":(e=null,b=d),null!== -e?(61===c.charCodeAt(b)?(d="=",b+=1):(d=null,0===l&&g('"="')),d=null!==d?d:"",null!==d?a=[a,e,d]:(a=null,b=m)):(a=null,b=m)):(a=null,b=m),null!==a&&(a=new y({type:"operator",j:">"+a[2]})),null===a&&(b=h));p[f]={b:b,result:a};return a}function bb(){var c="relational_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,h,f,g,k,l,n;l=k=b;a=ab();if(null!==a){e=[];n=b;d=q();d=null!==d?d:"";null!==d?(h=Pb(),null!==h?(f=q(),f=null!==f?f:"",null!==f?(g=ab(),null!==g?d=[d,h,f,g]:(d=null,b=n)):(d=null, -b=n)):(d=null,b=n)):(d=null,b=n);for(;null!==d;)e.push(d),n=b,d=q(),d=null!==d?d:"",null!==d?(h=Pb(),null!==h?(f=q(),f=null!==f?f:"",null!==f?(g=ab(),null!==g?d=[d,h,f,g]:(d=null,b=n)):(d=null,b=n)):(d=null,b=n)):(d=null,b=n);null!==e?a=[a,e]:(a=null,b=l)}else a=null,b=l;null!==a&&(a=X(a[0],a[1]));null===a&&(b=k);p[c]={b:b,result:a};return a}function Qb(){var f="equality_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e;e=b;"=="===c.substr(b,2)?(a="==",b+=2):(a=null,0===l&&g('"=="'));null===a&& -("!="===c.substr(b,2)?(a="!=",b+=2):(a=null,0===l&&g('"!="')));null!==a&&(a=new y({type:"operator",j:a}));null===a&&(b=e);p[f]={b:b,result:a};return a}function cb(){var c="equality_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=bb();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Qb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=bb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!== -d?(f=Qb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=bb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Rb(){var f="bitwise_and_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,m;h=d=b;38===c.charCodeAt(b)?(a="&",b+=1):(a=null,0===l&&g('"&"'));null!==a?(m=b,l++,61===c.charCodeAt(b)?(e="=",b+=1):(e=null,0===l&&g('"="')),null===e&&(38=== -c.charCodeAt(b)?(e="&",b+=1):(e=null,0===l&&g('"&"'))),l--,null===e?e="":(e=null,b=m),null!==e?a=[a,e]:(a=null,b=h)):(a=null,b=h);null!==a&&(a=new y({type:"operator",j:"&"}));null===a&&(b=d);p[f]={b:b,result:a};return a}function db(){var c="bitwise_and_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=cb();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Rb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=cb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null, -b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Rb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=cb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Sb(){var f="bitwise_xor_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,k;h=d=b;94===c.charCodeAt(b)?(a="^",b+=1):(a=null,0===l&&g('"^"'));null!==a?(k=b, -l++,61===c.charCodeAt(b)?(e="=",b+=1):(e=null,0===l&&g('"="')),null===e&&(94===c.charCodeAt(b)?(e="^",b+=1):(e=null,0===l&&g('"^"'))),l--,null===e?e="":(e=null,b=k),null!==e?a=[a,e]:(a=null,b=h)):(a=null,b=h);null!==a&&(a=new y({type:"operator",j:"^"}));null===a&&(b=d);p[f]={b:b,result:a};return a}function eb(){var c="bitwise_xor_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=db();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Sb(),null!==f?(g=q(),g=null!==g? -g:"",null!==g?(k=db(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Sb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=db(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Tb(){var f="bitwise_or_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,k;h= -d=b;124===c.charCodeAt(b)?(a="|",b+=1):(a=null,0===l&&g('"|"'));null!==a?(k=b,l++,61===c.charCodeAt(b)?(e="=",b+=1):(e=null,0===l&&g('"="')),null===e&&(124===c.charCodeAt(b)?(e="|",b+=1):(e=null,0===l&&g('"|"'))),l--,null===e?e="":(e=null,b=k),null!==e?a=[a,e]:(a=null,b=h)):(a=null,b=h);null!==a&&(a=new y({type:"operator",j:"|"}));null===a&&(b=d);p[f]={b:b,result:a};return a}function fb(){var c="bitwise_or_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=eb();if(null!== -a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Tb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=eb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Tb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=eb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Ub(){var f= -"logical_and_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e;e=b;"&&"===c.substr(b,2)?(a="&&",b+=2):(a=null,0===l&&g('"&&"'));null!==a&&(a=new y({type:"operator",j:"&&"}));null===a&&(b=e);p[f]={b:b,result:a};return a}function gb(){var c="logical_and_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=fb();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Ub(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=fb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null, -b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Ub(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=fb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Vb(){var f="logical_xor_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e;e=b;"^^"===c.substr(b,2)?(a="^^",b+=2):(a=null,0===l&&g('"^^"'));null!==a&&(a=new y({type:"operator", -j:"^^"}));null===a&&(b=e);p[f]={b:b,result:a};return a}function hb(){var c="logical_xor_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k,l,n,r;n=l=b;a=gb();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Vb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=gb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Vb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=gb(),null!==k?d=[d,f,g,k]:(d=null, -b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a};return a}function Wb(){var f="logical_or_operator@"+b,a=p[f];if(a)return b=a.b,a.result;var e;e=b;"||"===c.substr(b,2)?(a="||",b+=2):(a=null,0===l&&g('"||"'));null!==a&&(a=new y({type:"operator",j:"||"}));null===a&&(b=e);p[f]={b:b,result:a};return a}function Kc(){var c="logical_or_expression@"+b,a=p[c];if(a)return b=a.b,a.result;var e,d,f,g,k, -l,n,r;n=l=b;a=hb();if(null!==a){e=[];r=b;d=q();d=null!==d?d:"";null!==d?(f=Wb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=hb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);for(;null!==d;)e.push(d),r=b,d=q(),d=null!==d?d:"",null!==d?(f=Wb(),null!==f?(g=q(),g=null!==g?g:"",null!==g?(k=hb(),null!==k?d=[d,f,g,k]:(d=null,b=r)):(d=null,b=r)):(d=null,b=r)):(d=null,b=r);null!==e?a=[a,e]:(a=null,b=n)}else a=null,b=n;null!==a&&(a=X(a[0],a[1]));null===a&&(b=l);p[c]={b:b,result:a}; -return a}function pa(){var f="conditional_expression@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,k,n,u,x,r,B,A,C;A=a=b;e=Kc();null!==e?(C=b,d=q(),d=null!==d?d:"",null!==d?(63===c.charCodeAt(b)?(h="?",b+=1):(h=null,0===l&&g('"?"')),null!==h?(k=q(),k=null!==k?k:"",null!==k?(n=S(),null!==n?(u=q(),u=null!==u?u:"",null!==u?(58===c.charCodeAt(b)?(x=":",b+=1):(x=null,0===l&&g('":"')),null!==x?(r=q(),r=null!==r?r:"",null!==r?(B=S(),null!==B?d=[d,h,k,n,u,x,r,B]:(d=null,b=C)):(d=null,b=C)):(d=null,b=C)): -(d=null,b=C)):(d=null,b=C)):(d=null,b=C)):(d=null,b=C)):(d=null,b=C),d=null!==d?d:"",null!==d?e=[e,d]:(e=null,b=A)):(e=null,b=A);null!==e&&(d=e[0],e=e[1],L=d,e&&(L=new y({type:"ternary",F:d,Ha:e[3],Ga:e[7]})),e=L);null===e&&(b=a);p[f]={b:b,result:e};return e}function S(){var f="assignment_expression@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,k,n,u;u=n=b;a=pa();null!==a?(e=q(),e=null!==e?e:"",null!==e?(61===c.charCodeAt(b)?(d="=",b+=1):(d=null,0===l&&g('"="')),null===d&&("*="===c.substr(b,2)? -(d="*=",b+=2):(d=null,0===l&&g('"*="')),null===d&&("/="===c.substr(b,2)?(d="/=",b+=2):(d=null,0===l&&g('"/="')),null===d&&("%="===c.substr(b,2)?(d="%=",b+=2):(d=null,0===l&&g('"%="')),null===d&&("+="===c.substr(b,2)?(d="+=",b+=2):(d=null,0===l&&g('"+="')),null===d&&("-="===c.substr(b,2)?(d="-=",b+=2):(d=null,0===l&&g('"-="')),null===d&&("<<="===c.substr(b,3)?(d="<<=",b+=3):(d=null,0===l&&g('"<<="')),null===d&&(">>="===c.substr(b,3)?(d=">>=",b+=3):(d=null,0===l&&g('">>="')),null===d&&("&="===c.substr(b, -2)?(d="&=",b+=2):(d=null,0===l&&g('"&="')),null===d&&("^="===c.substr(b,2)?(d="^=",b+=2):(d=null,0===l&&g('"^="')),null===d&&("|="===c.substr(b,2)?(d="|=",b+=2):(d=null,0===l&&g('"|="')))))))))))),null!==d?(h=q(),h=null!==h?h:"",null!==h?(k=S(),null!==k?a=[a,e,d,h,k]:(a=null,b=u)):(a=null,b=u)):(a=null,b=u)):(a=null,b=u)):(a=null,b=u);null!==a&&(e=a[0],d=a[4],a=new y({type:"binary",j:new y({type:"operator",j:a[2]}),left:e,right:d}));null===a&&(b=n);null===a&&(a=pa());p[f]={b:b,result:a};return a} -function Db(){var f="condition@"+b,a=p[f];if(a)return b=a.b,a.result;var e,d,h,k,n,u,x;x=b;a=za();null!==a?(e=q(),null!==e?(d=Q(),null!==d?(h=q(),h=null!==h?h:"",null!==h?(61===c.charCodeAt(b)?(k="=",b+=1):(k=null,0===l&&g('"="')),null!==k?(n=q(),n=null!==n?n:"",null!==n?(u=S(),null!==u?a=[a,e,d,h,k,n,u]:(a=null,b=x)):(a=null,b=x)):(a=null,b=x)):(a=null,b=x)):(a=null,b=x)):(a=null,b=x)):(a=null,b=x);null===a&&(a=S());p[f]={b:b,result:a};return a}function nd(){var f;a:{f=ob;f.sort();for(var a=null, -e=[],d=0;d>":new G(5),"<":new G(6),">":new G(6),"<=":new G(6),">=":new G(6),"==":new G(7),"!=":new G(7),"&":new G(8,0),"^":new G(9,0),"|":new G(10,0),"&&":new G(11,0),"^^":new G(12,0),"||":new G(13,0),ternary:new G(14,1,3),"=":new G(15),"-=":new G(15),"+=":new G(15),"*=":new G(15), -"/=":new G(15),"%=":new G(15),"<<=":new G(15),">>=":new G(15),"&=":new G(15),"^=":new G(15),"|=":new G(15)};function I(c,f,k){f=new F(f,k);E(f,c);return f.a}function Ma(c,f,k){return f?c+f+k:""}function Na(c,f,k){for(var n=0;nf?"-":"")+"0x"+Math.abs(f).toString(16).toLowerCase();this.a+=c.length<=f.length?c:f};F.prototype.visitInt=F.prototype.ga;F.prototype.P=F.prototype.o;F.prototype.visitBool=F.prototype.P;F.prototype.O=function(c){mb(this,c.left,c,0);E(this,c.j);mb(this,c.right,c,1)};F.prototype.visitBinary=F.prototype.O;F.prototype.Aa=function(c){mb(this,c.F,c,0);this.a+="?";mb(this,c.Ha,c,1);this.a+=":";mb(this,c.Ga,c,2)};F.prototype.visitTernary=F.prototype.Aa; -function mb(c,f,k,n){var g=La["binary"==f.type?f.j.j:f.type];k=La["binary"==k.type?k.j.j:k.type];var u=!1;if(u=g.a>k.a?!0:g.a==k.a?0==k.c&&0==n||1==k.c&&n==k.f-1?!1:!0:!1)c.a+="(";E(c,f);u&&(c.a+=")")};function J(c,f){this.U=c||null;this.o=!!f;this.D={};this.h=[];this.a=[];this.v={};this.c=[]}v(J,Ia);ka("glslunit.VariableScopeVisitor",J);function Xb(c){var f={};ra(c.h.concat([c.a]),function(c){D(c,function(c){"declarator"==c.type?D(c.A,function(g){da(f[g.name.name])||(f[g.name.name]=c)},this):"parameter"==c.type&&(f[c.name]=c)},this)},c);return f}J.prototype.g=function(){this.h.push(this.a);this.a=[];[].push.apply(this.a,this.c);this.c=[]};J.prototype.beforeVisitScope=J.prototype.g; -J.prototype.f=function(c){this.v[c.id]=this.a;c==this.U&&(this.D=Xb(this));this.a=this.h.pop()};J.prototype.afterVisitScope=J.prototype.f;J.prototype.K=J.prototype.g;J.prototype.beforeVisitRoot=J.prototype.K;J.prototype.O=function(c){this.o||this.f(c)};J.prototype.afterVisitPreprocessor=J.prototype.O;J.prototype.J=function(){this.o||this.g()};J.prototype.beforeVisitPreprocessor=J.prototype.J;J.prototype.P=J.prototype.f;J.prototype.afterVisitRoot=J.prototype.P;J.prototype.W=function(c){this.a.push(c)}; -J.prototype.beforeVisitDeclarator=J.prototype.W;J.prototype.T=function(c){this.c=c.l};J.prototype.beforeVisitFunctionDeclaration=J.prototype.T;J.prototype.S=function(){this.c=[]};J.prototype.afterVisitFunctionDeclaration=J.prototype.S;function Yb(c){var f=new J;E(f,c);return f.v}J.getScopeToDeclarationMap=Yb;function Zb(c,f){var k=new J(f,!0);E(k,c);return k.D};function $b(c){this.c=[];this.a=[];this.f=c}v($b,Ia);$b.prototype.g=function(c){this.f(c,this.a.slice(0,-1))&&this.c.push(c);Ja(this,c)};$b.prototype.i=function(){return ia(Array.prototype.push,this.a)};$b.prototype.u=function(){return ia(Array.prototype.pop,this.a)};$b.prototype.m=function(){return this.g};function ac(c,f){var k=new $b(f);E(k,c);return k.c};function K(){this.a={};this.a[bc]=[];this.c=bc}v(K,Ia);var bc="#";K.prototype.g=function(c){c.name in this.a||(this.a[c.name]=[]);this.c=c.name};K.prototype.beforeVisitFunctionDeclaration=K.prototype.g;K.prototype.f=function(){this.c=bc};K.prototype.afterVisitFunctionDeclaration=K.prototype.f;K.prototype.h=function(c){this.a[this.c].push(c.I);Ja(this,c)};K.prototype.visitFunctionCall=K.prototype.h;function Oc(c){c=ac(c,function(c,f){return"declarator"==c.type&&"struct_definition"==f.slice(-1)[0].type});var f=[];D(c,function(c){f[c.id]=!0});return f};function M(c){var f={},k;for(k in c)f[k]=c[k];return f};function N(){this.c=[]}var Pc=-1;function O(c){c=M(c);c.id=Pc--;return c}N.prototype.W=function(c){return this["transform"+ma(c.type)]};function Qc(c,f,k,n){var g=c[k+ma(f.type)];return ia(function(c){D(this.c,function(f){var g=n(f).apply(f,[c]);g&&g.apply(f,[c])});g&&g.apply(this,[c])},c)}N.prototype.P=function(c){return Qc(this,c,"beforeTransform",function(c){return c.i})};N.prototype.O=function(c){return Qc(this,c,"afterTransform",function(c){return c.u})}; -function P(c,f){var k=!1,n=c.P(f);n&&n.apply(c,[f]);var n=O(f),g;for(g in f){var u=f[g];if("array"==ea(u)){n[g]=[];for(var B=0;BMath.abs(c.value)&&c.value==Math.round(c.value)){var f=O(c);f.type="int";f.value=Number(c.value);return f}return c};T.prototype.o=T.prototype.i;T.prototype.transformFloat=T.prototype.o;T.prototype.m=T.prototype.i;T.prototype.transformBool=T.prototype.m; -T.prototype.h=function(c){var f=Xc[c.I];if(f){if(Yc(this)&&c.l.length==f)return c.l;if(c.l&&1");n in c.f||(D(f.g(),function(c){c in this.c&&fd(this,this.c[c],g)},c),c.f[n]=f.u(c.f,c.i))};function gd(){this.c={};this.g={};this.f=this.a=0}function hd(c){var f="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[c%52];for(c=Math.floor(c/52);0\/\*]|[ \t\n]+)/g,ud=/[A-Za-z_][A-Za-z_0-9]*/g;function vd(c,f){this.name=c.identifier;this.arguments=c.l?c.l.map(function(c){return c.name}):null;this.c=c.pa.split(td).filter(function(c){return 0f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}}"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le"); -var buffer,va,wa,xa,ya;function za(){na("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+Aa+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}var Aa=d.TOTAL_MEMORY||67108864; -5242880>Aa&&qa("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+Aa+"! (TOTAL_STACK=5242880)");d.buffer?buffer=d.buffer:(buffer=new ArrayBuffer(Aa),d.buffer=buffer);d.HEAP8=va=new Int8Array(buffer);d.HEAP16=new Int16Array(buffer);d.HEAP32=xa=new Int32Array(buffer);d.HEAPU8=wa=new Uint8Array(buffer);d.HEAPU16=new Uint16Array(buffer);d.HEAPU32=new Uint32Array(buffer);d.HEAPF32=ya=new Float32Array(buffer);d.HEAPF64=new Float64Array(buffer);xa[7336]=5272480; -function Ba(a){for(;0>>16)*f+e*(b>>>16)<<16)|0}); -Math.clz32||(Math.clz32=function(a){var b=32,e=a>>16;e&&(b-=16,a=e);if(e=a>>8)b-=8,a=e;if(e=a>>4)b-=4,a=e;if(e=a>>2)b-=2,a=e;return a>>1?b-2:b-a});Math.trunc||(Math.trunc=function(a){return 0>a?Math.ceil(a):Math.floor(a)});var Ia=0,Ja=null,Ka=null;d.preloadedImages={};d.preloadedAudios={}; -var La=null,Ma="data:application/octet-stream;base64,",Na=[function(a,b,e,f){a=d.getCache(d.DebugDrawer)[a];if(!a.hasOwnProperty("drawLine"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::drawLine.";a.drawLine(b,e,f)},function(a,b,e,f,g,n){a=d.getCache(d.DebugDrawer)[a];if(!a.hasOwnProperty("drawContactPoint"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::drawContactPoint.";a.drawContactPoint(b,e,f,g,n)},function(a,b){a=d.getCache(d.DebugDrawer)[a]; -if(!a.hasOwnProperty("reportErrorWarning"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::reportErrorWarning.";a.reportErrorWarning(b)},function(a,b,e){a=d.getCache(d.DebugDrawer)[a];if(!a.hasOwnProperty("draw3dText"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::draw3dText.";a.draw3dText(b,e)},function(a,b){a=d.getCache(d.DebugDrawer)[a];if(!a.hasOwnProperty("setDebugMode"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::setDebugMode."; -a.setDebugMode(b)},function(a){a=d.getCache(d.DebugDrawer)[a];if(!a.hasOwnProperty("getDebugMode"))throw"a JSImplementation must implement all functions, you forgot DebugDrawer::getDebugMode.";return a.getDebugMode()},function(a,b,e,f,g,n,A,Q){a=d.getCache(d.ConcreteContactResultCallback)[a];if(!a.hasOwnProperty("addSingleResult"))throw"a JSImplementation must implement all functions, you forgot ConcreteContactResultCallback::addSingleResult.";return a.addSingleResult(b,e,f,g,n,A,Q)}];Da.push({Da:function(){Oa()}}); -La="data:application/octet-stream;base64,AAAAAAAAAAARAAoAERERAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABEADwoREREDCgcAARMJCwsAAAkGCwAACwAGEQAAABEREQAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA0AAAAEDQAAAAAJDgAAAAAADgAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAPAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAABISEgAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAoAAAAACgAAAAAJCwAAAAAACwAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAwAAAAACQwAAAAAAAwAAAwAADAxMjM0NTY3ODlBQkNERUZUISIZDQECAxFLHAwQBAsdEh4naG5vcHFiIAUGDxMUFRoIFgcoJBcYCQoOGx8lI4OCfSYqKzw9Pj9DR0pNWFlaW1xdXl9gYWNkZWZnaWprbHJzdHl6e3wAAAAAAAAAAABJbGxlZ2FsIGJ5dGUgc2VxdWVuY2UARG9tYWluIGVycm9yAFJlc3VsdCBub3QgcmVwcmVzZW50YWJsZQBOb3QgYSB0dHkAUGVybWlzc2lvbiBkZW5pZWQAT3BlcmF0aW9uIG5vdCBwZXJtaXR0ZWQATm8gc3VjaCBmaWxlIG9yIGRpcmVjdG9yeQBObyBzdWNoIHByb2Nlc3MARmlsZSBleGlzdHMAVmFsdWUgdG9vIGxhcmdlIGZvciBkYXRhIHR5cGUATm8gc3BhY2UgbGVmdCBvbiBkZXZpY2UAT3V0IG9mIG1lbW9yeQBSZXNvdXJjZSBidXN5AEludGVycnVwdGVkIHN5c3RlbSBjYWxsAFJlc291cmNlIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlAEludmFsaWQgc2VlawBDcm9zcy1kZXZpY2UgbGluawBSZWFkLW9ubHkgZmlsZSBzeXN0ZW0ARGlyZWN0b3J5IG5vdCBlbXB0eQBDb25uZWN0aW9uIHJlc2V0IGJ5IHBlZXIAT3BlcmF0aW9uIHRpbWVkIG91dABDb25uZWN0aW9uIHJlZnVzZWQASG9zdCBpcyBkb3duAEhvc3QgaXMgdW5yZWFjaGFibGUAQWRkcmVzcyBpbiB1c2UAQnJva2VuIHBpcGUASS9PIGVycm9yAE5vIHN1Y2ggZGV2aWNlIG9yIGFkZHJlc3MAQmxvY2sgZGV2aWNlIHJlcXVpcmVkAE5vIHN1Y2ggZGV2aWNlAE5vdCBhIGRpcmVjdG9yeQBJcyBhIGRpcmVjdG9yeQBUZXh0IGZpbGUgYnVzeQBFeGVjIGZvcm1hdCBlcnJvcgBJbnZhbGlkIGFyZ3VtZW50AEFyZ3VtZW50IGxpc3QgdG9vIGxvbmcAU3ltYm9saWMgbGluayBsb29wAEZpbGVuYW1lIHRvbyBsb25nAFRvbyBtYW55IG9wZW4gZmlsZXMgaW4gc3lzdGVtAE5vIGZpbGUgZGVzY3JpcHRvcnMgYXZhaWxhYmxlAEJhZCBmaWxlIGRlc2NyaXB0b3IATm8gY2hpbGQgcHJvY2VzcwBCYWQgYWRkcmVzcwBGaWxlIHRvbyBsYXJnZQBUb28gbWFueSBsaW5rcwBObyBsb2NrcyBhdmFpbGFibGUAUmVzb3VyY2UgZGVhZGxvY2sgd291bGQgb2NjdXIAU3RhdGUgbm90IHJlY292ZXJhYmxlAFByZXZpb3VzIG93bmVyIGRpZWQAT3BlcmF0aW9uIGNhbmNlbGVkAEZ1bmN0aW9uIG5vdCBpbXBsZW1lbnRlZABObyBtZXNzYWdlIG9mIGRlc2lyZWQgdHlwZQBJZGVudGlmaWVyIHJlbW92ZWQARGV2aWNlIG5vdCBhIHN0cmVhbQBObyBkYXRhIGF2YWlsYWJsZQBEZXZpY2UgdGltZW91dABPdXQgb2Ygc3RyZWFtcyByZXNvdXJjZXMATGluayBoYXMgYmVlbiBzZXZlcmVkAFByb3RvY29sIGVycm9yAEJhZCBtZXNzYWdlAEZpbGUgZGVzY3JpcHRvciBpbiBiYWQgc3RhdGUATm90IGEgc29ja2V0AERlc3RpbmF0aW9uIGFkZHJlc3MgcmVxdWlyZWQATWVzc2FnZSB0b28gbGFyZ2UAUHJvdG9jb2wgd3JvbmcgdHlwZSBmb3Igc29ja2V0AFByb3RvY29sIG5vdCBhdmFpbGFibGUAUHJvdG9jb2wgbm90IHN1cHBvcnRlZABTb2NrZXQgdHlwZSBub3Qgc3VwcG9ydGVkAE5vdCBzdXBwb3J0ZWQAUHJvdG9jb2wgZmFtaWx5IG5vdCBzdXBwb3J0ZWQAQWRkcmVzcyBmYW1pbHkgbm90IHN1cHBvcnRlZCBieSBwcm90b2NvbABBZGRyZXNzIG5vdCBhdmFpbGFibGUATmV0d29yayBpcyBkb3duAE5ldHdvcmsgdW5yZWFjaGFibGUAQ29ubmVjdGlvbiByZXNldCBieSBuZXR3b3JrAENvbm5lY3Rpb24gYWJvcnRlZABObyBidWZmZXIgc3BhY2UgYXZhaWxhYmxlAFNvY2tldCBpcyBjb25uZWN0ZWQAU29ja2V0IG5vdCBjb25uZWN0ZWQAQ2Fubm90IHNlbmQgYWZ0ZXIgc29ja2V0IHNodXRkb3duAE9wZXJhdGlvbiBhbHJlYWR5IGluIHByb2dyZXNzAE9wZXJhdGlvbiBpbiBwcm9ncmVzcwBTdGFsZSBmaWxlIGhhbmRsZQBSZW1vdGUgSS9PIGVycm9yAFF1b3RhIGV4Y2VlZGVkAE5vIG1lZGl1bSBmb3VuZABXcm9uZyBtZWRpdW0gdHlwZQBObyBlcnJvciBpbmZvcm1hdGlvbgAAAAAAAOgwAACiNgAAcAkAAAAAAADAMAAAsDYAAOgwAADnNwAAiAkAAAAAAADAMAAABzgAAOgwAAAzOAAAoAkAAAAAAADAMAAAYjgAAOgwAACKOAAAuAkAAAAAAADAMAAAoDgAAOgwAAC8OAAA0AkAAAAAAADAMAAA0zgAAMAwAADjOAAA6DAAAPg4AADwCQAAAAAAAMAwAAAqOQAA6DAAAFU5AAAICgAAAAAAAMAwAABvOQAA6DAAAII5AACADQAAAAAAAOgwAACuOQAAMAoAAAAAAADAMAAA6TkAAOgwAAAKOgAAMAoAAAAAAADoMAAAPjoAADAKAAAAAAAA6DAAAGw6AAAwCgAAAAAAAOgwAABeOwAAMA0AAAAAAADoMAAAazsAAIgKAAAAAAAAwDAAAIs7AADAMAAAnjsAAOgwAACzOwAAkAoAAAAAAADoMAAA0jsAALARAAAAAAAA6DAAAGM8AADYCgAAAAAAAOgwAABFPAAAMBEAAAAAAADoMAAAhTwAAIgKAAAAAAAA6DAAAKY8AACICgAAAAAAAOgwAADJPAAAiAoAAAAAAADoMAAA6zwAANgKAAAAAAAA6DAAAA09AAAoCwAAAAAAAMAwAAAtPQAA6DAAADk+AAAoCwAAAAAAAOgwAAB8PQAAUBEAAAAAAADoMAAATT0AAPgQAAAAAAAAwDAAAF89AADoMAAAHD4AAFARAAAAAAAA6DAAAO0+AADQCwAAAAAAAOgwAACePgAAmAsAAAAAAADoMAAAuD4AAKgLAAAAAAAAwDAAANI+AADoMAAACD8AACgLAAAAAAAA6DAAADw/AAAwDQAAAAAAAOgwAADsQAAA8AsAAAAAAADoMAAAzj8AAOAJAAAAAAAA6DAAAAZBAACoDgAAAAAAAOgwAAAYQQAAEAwAAAAAAADAMAAANkEAAOgwAABkQQAAWAwAAAAAAADoMAAAlEEAAFgMAAAAAAAA6DAAANBBAAAoDAAAAAAAAOgwAAARQgAAWAwAAAAAAAAQMQAARkIAAAAAAAABAAAAcAwAAAIEAADAMAAAWkIAAOgwAACBQgAAWAwAAAAAAADoMAAAsEIAAFgMAAAAAAAA6DAAAONCAABYDAAAAAAAAOgwAABBQwAAuAwAAAAAAADAMAAAZ0MAAOgwAAB8QwAA0AwAAAAAAADAMAAAj0MAAOgwAACjQwAA2AkAAAAAAADoMAAA7UMAAAgNAAAAAAAA6DAAAL9DAADgCQAAAAAAAOgwAAAORAAA0AwAAAAAAADoMAAAL0QAACgNAAAAAAAAwDAAAEhEAADAMAAAckQAAOgwAACGRAAAMA0AAAAAAADoMAAAlkQAADgNAAAAAAAA6DAAAN9EAAAIEwAAAAAAAOgwAACxRAAAeA0AAAAAAADAMAAAy0QAAOgwAAD3RAAAkA0AAAAAAADAMAAAGUUAAOgwAAA0RQAAMAoAAAAAAADoMAAAZEUAADAKAAAAAAAA6DAAAI9FAAAwCgAAAAAAAOgwAADCRQAAMAoAAAAAAADoMAAA80UAADAKAAAAAAAA6DAAABRGAAAwCgAAAAAAAOgwAABIRgAAMAoAAAAAAADoMAAAfUYAADAKAAAAAAAA6DAAAKpGAAAwCgAAAAAAAOgwAADjRgAAMAoAAAAAAADAMAAAFUcAAOgwAABcRwAAKAsAAAAAAADoMAAAN0gAALgTAAAAAAAA6DAAAH5HAABQEQAAAAAAAOgwAAAcSAAAUBEAAAAAAADoMAAAW0gAALgTAAAAAAAA6DAAAHhIAACgDgAAAAAAAMAwAACLSAAAwDAAADJMAADoMAAAIksAAJgLAAAAAAAA6DAAAPdIAACgCQAAAAAAAOgwAAB8SQAAiAoAAAAAAADoMAAA+kkAABgTAAAAAAAA6DAAAI9KAAAYEwAAAAAAABAxAAA4SwAAAAAAAAIAAABQEQAAAgAAAFgRAAACBAAA6DAAAFlMAADwCQAAAAAAAOgwAAD2TAAAKBMAAAAAAADoMAAAp00AACgTAAAAAAAA6DAAAGZOAACYCwAAAAAAAOgwAACYTgAAqAsAAAAAAADoMAAAfk4AAJAOAAAAAAAA6DAAALJOAAC4EwAAAAAAAOgwAAAeUAAAMAoAAAAAAADoMAAABFAAALgTAAAAAAAA6DAAANdOAACQDgAAAAAAAOgwAADyTgAAoA4AAAAAAADoMAAAf08AAKAOAAAAAAAA6DAAAF9QAAC4EwAAAAAAAOgwAABGUAAAiAoAAAAAAADoMAAAn1AAALgTAAAAAAAA6DAAAH5QAACICgAAAAAAAOgwAAD8UAAAGBEAAAAAAADoMAAAI1EAADARAAAAAAAA6DAAADdRAAAwEAAAAAAAAOgwAABMUQAAMBAAAAAAAADoMAAAYlEAADARAAAAAAAA6DAAACBSAAC4EAAAAAAAAOgwAAByUQAAkBAAAAAAAADAMAAA4FEAAOgwAAA5UgAAkBAAAAAAAADoMAAAoVIAAJAQAAAAAAAA6DAAAJ1TAACwEQAAAAAAAOgwAAASUwAAUBEAAAAAAADoMAAAKlMAAFgRAAAAAAAA6DAAANZTAACwEQAAAAAAAOgwAADrUwAAMBEAAAAAAADoMAAABVQAAPgQAAAAAAAAwDAAAD9UAADoMAAAUlQAABgRAAAAAAAA6DAAAGJUAAAgEQAAAAAAAOgwAACXVAAACBEAAAAAAADAMAAAq1QAAMAwAADAVAAA6DAAAAJVAAAwEQAAAAAAAOgwAAAcVQAAYBEAAAAAAADoMAAAN1UAAGARAAAAAAAA6DAAAHRVAAAIEQAAAAAAAOgwAABJVQAAWBEAAAAAAADoMAAAkFUAABgRAAAAAAAA6DAAAKVVAAD4EAAAAAAAAOgwAACyVQAAEBMAAAAAAADoMAAAw1UAAFgRAAAAAAAA6DAAAB5WAABYEQAAAAAAAOgwAACOVgAAsBEAAAAAAADoMAAAyFYAADARAAAAAAAA6DAAAORWAAAQEgAAAAAAAOgwAAABVwAAEBIAAAAAAADoMAAAFFcAABgUAAAAAAAA6DAAAFdXAABgEgAAAAAAAOgwAAAlVwAAcBIAAAAAAADAMAAAP1cAAOgwAABmVwAAiBIAAAAAAADoMAAAeFcAALgJAAAAAAAA6DAAAIBYAACIEgAAAAAAAOgwAACRVwAAeA0AAAAAAADoMAAA/1cAAHgNAAAAAAAA6DAAAOFYAABwEgAAAAAAAOgwAACfWAAAiAoAAAAAAADoMAAAtFgAAIgKAAAAAAAA6DAAAMtYAACICgAAAAAAAMAwAAD0WAAAwDAAAF5ZAADoMAAAb1kAAFARAAAAAAAA6DAAAItZAABQEQAAAAAAAOgwAABVWgAAWBMAAAAAAADoMAAAqlkAAKAOAAAAAAAAwDAAAHlaAADoMAAAmloAAFgTAAAAAAAA6DAAAM5aAAAoDQAAAAAAAOgwAAC7WgAAoA4AAAAAAADoMAAA4FoAACgNAAAAAAAA6DAAAP5aAACwEwAAAAAAAMAwAAASWwAA6DAAADlbAAAoCwAAAAAAAOgwAABaWwAAKAsAAAAAAADoMAAAbVsAALgTAAAAAAAA6DAAAJBbAACwEwAAAAAAAOgwAACjWwAAsBMAAAAAAADAMAAAvFsAAMAwAADWWwAA6DAAAOtbAAAoFAAAAAAAAMAwAACbXAAAwDAAAIFdAADoMAAA4V0AAEgUAAAAAAAA6DAAAI5dAABYFAAAAAAAAMAwAACvXQAA6DAAALxdAAA4FAAAAAAAAOgwAADnXgAASBQAAAAAAADoMAAAw14AAHAUAAAAAAAA6DAAAAlfAAA4FAAAAAAAAAAAAABgCQAAAQAAAAIAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAIAAAABAAAAAQAAAAEAAAADAAAAAgAAAAEAAAACAAAAAwAAAAEAAAAAAAAAcAkAAAMAAAAEAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAEAAAABAAAAAwAAAAIAAAABAAAAAgAAAAMAAAABAAAAAAAAAHgJAAAFAAAABgAAAAEAAAABAAAAAAAAAIgJAAAHAAAACAAAAAEAAAABAAAAAAAAAJAJAAAJAAAACgAAAAIAAAABAAAAAAAAAKAJAAALAAAADAAAAAIAAAABAAAAAAAAAKgJAAANAAAADgAAAAEAAAABAAAAAgAAAAAAAAC4CQAADwAAABAAAAABAAAAAQAAAAEAAAAAAAAAwAkAABEAAAASAAAAAwAAAAQAAAAAAAAA0AkAABMAAAAUAAAAAQAAAAEAAAAAAAAA2AkAABUAAAAWAAAAAQAAAAAAAADgCQAAFwAAABgAAAADAAAAAgAAAAAAAADwCQAAGQAAABoAAAADAAAAAQAAAAAAAAD4CQAAGwAAABwAAAACAAAAAwAAAAMAAAAFAAAAAQAAAAIAAAAdAAAABAAAAAUAAAAGAAAABAAAAAcAAAAFAAAABgAAAAAAAAAQCgAAHgAAAB8AAAAGAAAABwAAAAIAAAAIAAAAAAAAAFgKAAAgAAAAIQAAAAIAAAAAAAAASAoAACAAAAAiAAAAAwAAAAAAAAA4CgAAIAAAACMAAAAEAAAAAAAAACAKAAAgAAAAJAAAAAUAAAAAAAAAaAoAAAQAAAAlAAAAJgAAAAgAAAAJAAAAAwAAAAkAAAAHAAAAAAAAAHgKAAAnAAAAKAAAAAgAAAAKAAAAAgAAAAUAAAAGAAAAAAAAAJgKAAApAAAAKgAAAAEAAAABAAAAAwAAAAoAAAAAAAAAqAoAACsAAAAsAAAABAAAAAkAAAABAAAAAQAAAAsAAAALAAAAAgAAAAwAAAAMAAAABAAAAAIAAAANAAAABAAAAA0AAAAFAAAAAAAAAOgKAAAnAAAALQAAAAgAAAAOAAAAAgAAAAUAAAAGAAAAAAAAALgKAAAnAAAALgAAAAgAAAAPAAAAAgAAAAUAAAAGAAAAAAAAAMgKAAAvAAAAMAAAAAYAAAAJAAAAAQAAAAEAAAAQAAAADgAAAAMAAAAPAAAADAAAAAUAAAADAAAAEAAAAAUAAAANAAAACgAAAAsAAAADAAAABwAAAAgAAAARAAAADAAAABIAAAAAAAAACAsAACcAAAAxAAAADQAAABEAAAACAAAABQAAAAYAAAAAAAAA+AoAACcAAAAyAAAADgAAABEAAAACAAAABQAAAAYAAAAAAAAAGAsAADMAAAA0AAAABAAAAAEAAAASAAAAAAAAADALAAA1AAAANgAAAAUAAAACAAAAEwAAAAAAAABACwAANwAAADgAAAAJAAAAAAAAAGALAAAGAAAAFAAAAA8AAAA5AAAAOgAAAAAAAABQCwAAOwAAADwAAAAKAAAACQAAAAEAAAABAAAAEAAAAA4AAAAEAAAAEwAAAAwAAAAHAAAABAAAABAAAAAFAAAADQAAABAAAAARAAAAAwAAAAsAAAAIAAAAFAAAABIAAAAHAAAAFQAAABYAAAAMAAAAEwAAABcAAAANAAAAAQAAAA4AAAAAAAAAaAsAAD0AAAA+AAAADwAAAAAAAAB4CwAAPwAAAEAAAABBAAAAQgAAABUAAAAYAAAAQwAAABAAAAARAAAAEgAAABYAAABEAAAAFwAAAAEAAAAUAAAAGAAAABkAAAAaAAAAGwAAABwAAABFAAAAHQAAABMAAAAeAAAAHwAAABkAAAAaAAAACAAAAAkAAAAbAAAARgAAACAAAAAhAAAAIgAAACMAAAAIAAAACQAAAEcAAAAkAAAACgAAAAsAAAAMAAAASAAAACUAAAANAAAAAAAAAIgLAABJAAAASgAAAAoAAAAAAAAAsAsAAEsAAABMAAAABgAAAAMAAAAmAAAAAAAAAMALAAALAAAATQAAAE4AAAAnAAAAHAAAAAYAAAAoAAAAAAAAANALAABPAAAAUAAAAEEAAABCAAAAFQAAABgAAABRAAAAEAAAABQAAAASAAAAKQAAAEQAAAAqAAAAAQAAABQAAAAYAAAAGQAAABoAAAAbAAAAHAAAAEUAAAAdAAAAEwAAAB4AAAAfAAAAGQAAABoAAAAIAAAACQAAAB0AAABGAAAAIAAAACEAAAAiAAAAIwAAAA4AAAAJAAAARwAAACQAAAAKAAAADwAAAAwAAABIAAAAJQAAAA0AAAAAAAAA4AsAABkAAABSAAAADAAAAAMAAAAAAAAAAAwAAFMAAABUAAAAAQAAAAAAAAAYDAAAVQAAAFYAAABXAAAAAQAAACsAAAAsAAAAAQAAAAIAAAAEAAAAHgAAAAcAAAAAAAAAKAwAAFgAAABZAAAAWgAAAAEAAAAtAAAALgAAAAEAAAADAAAABQAAAB8AAAAIAAAAWwAAAAAAAAA4DAAAWAAAAFwAAABaAAAAAQAAAC0AAAAvAAAAAQAAAAMAAAAFAAAAIAAAAAkAAABbAAAAFQAAAAAAAABIDAAAWAAAAF0AAABeAAAAAQAAADAAAAAxAAAAAQAAAAQAAAAGAAAAIQAAAAoAAAAAAAAAWAwAAFgAAABfAAAAVwAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAB4AAAAHAAAAAAAAAHgMAABYAAAAYAAAAFcAAAABAAAAMgAAADMAAAABAAAABQAAAAcAAAAiAAAACwAAAAAAAACIDAAAWAAAAGEAAABiAAAAAQAAADQAAAA1AAAAAgAAAAYAAAAIAAAAIwAAAAwAAAAWAAAAAAAAAJgMAABYAAAAYwAAAGQAAAABAAAANgAAADcAAAABAAAABwAAAAkAAAAkAAAADQAAAAAAAACoDAAAZQAAAGYAAAAXAAAAAQAAABgAAABnAAAAJQAAABUAAAABAAAAAQAAAAIAAAABAAAAAgAAAAAAAADADAAAaAAAAGkAAAADAAAAOAAAABAAAAARAAAAFgAAAAAAAADYDAAAFQAAAGoAAAAGAAAAAAAAAOgMAABrAAAAbAAAAAQAAAA5AAAAOgAAAAUAAAA7AAAAPAAAAD0AAAAGAAAAJgAAAG0AAAAnAAAAPgAAAAAAAAD4DAAAGQAAAG4AAAADAAAACgAAAAAAAAAYDQAAbwAAAHAAAAABAAAAAQAAAAIAAAAAAAAAAgAAAAAAAAABAAAAAAAAADANAAAEAAAAcQAAAHIAAAAnAAAAKAAAAA4AAAAJAAAAAAAAADgNAAAEAAAAcwAAAHQAAAAnAAAAKAAAAA4AAAAJAAAAGQAAABcAAAAAAAAASA0AAAQAAAB1AAAAdgAAACcAAAAoAAAADgAAAAkAAAAaAAAAGAAAAAAAAABYDQAAdwAAAHgAAAAHAAAADwAAAD8AAABAAAAAEAAAABEAAAAZAAAAKQAAAA0AAAAqAAAAKwAAACwAAAAOAAAAQQAAAAAAAABoDQAAeQAAAHoAAAAPAAAAAAAAAIANAAB7AAAAfAAAAAYAAAAHAAAAEgAAAAgAAAAAAAAAKA4AACAAAAB9AAAACAAAAAAAAAAYDgAAIAAAAH4AAAAJAAAAAAAAAAgOAAAgAAAAfwAAAAoAAAAAAAAA+A0AACAAAACAAAAACwAAAAAAAADoDQAAIAAAAIEAAAAMAAAAAAAAANgNAAAgAAAAggAAAA0AAAAAAAAAyA0AACAAAACDAAAADgAAAAAAAAC4DQAAIAAAAIQAAAAPAAAAAAAAAKgNAAAgAAAAhQAAABAAAAAAAAAAmA0AACAAAACGAAAAEQAAAAAAAAA4DgAAhwAAAIgAAAAbAAAAQgAAAAAAAABADgAAiQAAAIoAAAAHAAAABAAAAEMAAAAAAAAAUA4AAIsAAACMAAAACAAAAAUAAABEAAAAAAAAAGAOAAA3AAAAjQAAABoAAAAAAAAAcA4AAI4AAACPAAAAGwAAAAAAAACADgAAkAAAAJEAAAAJAAAABgAAAEUAAAAAAAAAkA4AAJIAAACTAAAAHAAAAB0AAAADAAAAAAAAAKgOAACUAAAAlQAAAEEAAABCAAAAFQAAABgAAACWAAAAEAAAABQAAAAcAAAARgAAAEQAAABHAAAAAAAAALAOAABJAAAAlwAAABAAAAAAAAAA8A4AADcAAACYAAAAHQAAAAEAAAAAAAAA4A4AADcAAACZAAAAHQAAAAIAAAAAAAAA0A4AACcAAACaAAAACAAAAEgAAAACAAAABQAAAAYAAAAAAAAAwA4AAAsAAACbAAAAEQAAAAsAAAAAAAAAAA8AAJwAAACdAAAAHgAAAB8AAAD8////AA8AAJ4AAACfAAAAIAAAAAAAAABADwAANwAAAKAAAAAhAAAAAQAAAAAAAAAwDwAANwAAAKEAAAAhAAAAAgAAAAAAAAAgDwAAGQAAAKIAAAASAAAADAAAAAAAAABQDwAASQAAAKMAAAATAAAAAAAAAGAPAABJAAAApAAAABQAAAAAAAAAcA8AAJIAAAClAAAAHAAAAB0AAAAEAAAAAAAAAIAPAACmAAAApwAAAAoAAAAHAAAASQAAAAAAAACQDwAAqAAAAKkAAAASAAAAAAAAAKAPAACqAAAAqwAAAAsAAAAIAAAASgAAAAAAAADQDwAAkgAAAKwAAAAeAAAAHwAAAAUAAAAAAAAAwA8AAJIAAACtAAAAIAAAACEAAAAGAAAAAAAAALAPAACSAAAArgAAABwAAAAdAAAABwAAAAAAAADgDwAArwAAALAAAAAMAAAACQAAAEsAAAAAAAAA8A8AACcAAACxAAAACAAAAEwAAAACAAAABQAAAAYAAAAAAAAAABAAALIAAACzAAAADQAAAAoAAABNAAAAAAAAABAQAAAnAAAAtAAAACIAAAARAAAAAgAAAAUAAAAGAAAAAAAAACAQAAC1AAAAtgAAACIAAAAJAAAAAQAAAAEAAABOAAAALQAAAAUAAAAuAAAADAAAABIAAAAFAAAALwAAABMAAAANAAAATwAAALcAAAAAAAAAMBAAAC8AAAC4AAAAIwAAAAkAAAABAAAAAQAAAFAAAAAOAAAABgAAADAAAABRAAAABwAAAAQAAAAxAAAAFAAAAA0AAAAjAAAAJAAAAAMAAAAkAAAACAAAABEAAAAMAAAAAAAAAEAQAAAvAAAAuQAAACMAAAAJAAAAAQAAAAEAAABQAAAADgAAAAYAAAAyAAAAUgAAAAcAAAAEAAAAMQAAABQAAAANAAAAIwAAACQAAAADAAAAJAAAAAgAAAARAAAADAAAAAAAAABQEAAALwAAALoAAAAjAAAACQAAAAEAAAABAAAAUAAAAA4AAAAGAAAAMwAAAFMAAAAHAAAABAAAADEAAAAUAAAADQAAACMAAAAkAAAAAwAAACQAAAAIAAAAEQAAAAwAAAAAAAAAYBAAAC8AAAC7AAAAJQAAAAkAAAABAAAAAQAAABAAAAAOAAAABwAAADQAAAAMAAAAEwAAAAYAAAAQAAAABQAAAA0AAAAlAAAAJgAAAAMAAAAmAAAACAAAABEAAAAMAAAAAAAAAHAQAAC8AAAAvQAAACcAAAAJAAAAAQAAAAEAAABUAAAANQAAAAgAAAA2AAAADAAAAAQAAAACAAAANwAAABUAAAANAAAAKAAAACcAAAAoAAAAVQAAAFYAAAAAAAAAgBAAAL4AAAC/AAAAKQAAAAAAAACYEAAAvgAAAMAAAAAqAAAAAAAAAKgQAAC+AAAAwQAAACsAAAAAAAAAuBAAAMIAAADDAAAAJwAAAAkAAAABAAAAAQAAAFcAAAA1AAAACAAAADgAAAAMAAAABAAAAAIAAAANAAAABAAAAA0AAAApAAAAJwAAACgAAAAAAAAAyBAAADcAAADEAAAAKgAAAAAAAADYEAAAxQAAAMYAAAArAAAAAAAAAOgQAADHAAAAyAAAACwAAAAJAAAAAQAAAAEAAABYAAAAOQAAAAkAAAA6AAAADAAAAAQAAAACAAAAOwAAABYAAAANAAAALQAAAAAAAAD4EAAAOwAAAMkAAAAjAAAACQAAAAEAAAABAAAAEAAAAA4AAAAKAAAAAQAAAAwAAAAHAAAABAAAABAAAAAFAAAADQAAABAAAAAsAAAAAwAAAC4AAAAIAAAAEQAAAAwAAAAHAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAAwEQAALwAAAMoAAAAjAAAACQAAAAEAAAABAAAAEAAAAA4AAAABAAAAAQAAAAwAAAAHAAAABAAAABAAAAAFAAAADQAAABAAAAABAAAAAwAAAAEAAAAIAAAAEQAAAAwAAAAAAAAAQBEAAMsAAADMAAAALwAAAAkAAAABAAAAAQAAAFkAAAAOAAAACgAAADwAAAAMAAAABwAAAAQAAAA9AAAAFwAAAA0AAAAtAAAALgAAAAMAAAAwAAAACAAAABEAAAAMAAAABwAAAD4AAAA/AAAAMQAAAC8AAABAAAAAMgAAAAIAAAABAAAAAAAAAGARAAAvAAAAzQAAADMAAAAJAAAAAQAAAAEAAABaAAAADgAAAAsAAABBAAAAWwAAABQAAAAEAAAAQgAAABgAAAANAAAAEAAAADAAAAADAAAANAAAAAgAAAARAAAADAAAAAAAAABwEQAALwAAAM4AAAAzAAAACQAAAAEAAAABAAAAWgAAAA4AAAALAAAAQwAAAFsAAAAUAAAABAAAAEIAAAAYAAAADQAAABAAAAAwAAAAAwAAADQAAAAIAAAAEQAAAAwAAAAAAAAAgBEAAC8AAADPAAAAMwAAAAkAAAABAAAAAQAAAFoAAAAOAAAACwAAAEQAAABbAAAAFAAAAAQAAABCAAAAGAAAAA0AAAAQAAAAMAAAAAMAAAA0AAAACAAAABEAAAAMAAAAAAAAAJARAAA7AAAA0AAAAC8AAAAJAAAAAQAAAAEAAABcAAAARQAAAAoAAABGAAAADAAAAAcAAAAEAAAAEAAAAAUAAAANAAAAMQAAADIAAAADAAAANQAAAAgAAAARAAAADAAAAAcAAABHAAAASAAAADYAAAAzAAAASQAAADcAAAADAAAAAAAAAKARAADFAAAA0QAAADgAAAAAAAAAwBEAADsAAADSAAAAOQAAAAkAAAABAAAAAQAAAF0AAAAOAAAADAAAAEoAAAAMAAAAFQAAAAQAAAAQAAAABQAAAA0AAAA0AAAANQAAAAMAAAA6AAAACAAAAEsAAAA2AAAABwAAAEwAAABNAAAAOwAAADcAAABOAAAAPAAAAAQAAAA4AAAAAAAAANARAADTAAAA1AAAABMAAABPAAAAGQAAAF4AAABfAAAAFAAAAAAAAADwEQAAxQAAANUAAAA9AAAAAAAAAOARAADFAAAA1gAAAD4AAAAAAAAAABIAANcAAADYAAAAPwAAAAkAAAABAAAAAQAAAGAAAABQAAAADQAAAFEAAAAMAAAABAAAAAIAAAANAAAABAAAAA0AAABAAAAADQAAAAAAAAAQEgAALwAAANkAAABBAAAACQAAAAEAAAABAAAAYQAAAA4AAAAOAAAAUgAAAGIAAAAWAAAABAAAAFMAAAAaAAAADQAAADkAAAA6AAAAAwAAAEIAAAAIAAAAEQAAAAwAAAAHAAAAAAAAACASAAAvAAAA2gAAAEEAAAAJAAAAAQAAAAEAAABhAAAADgAAAA4AAABUAAAAYgAAABYAAAAEAAAAUwAAABoAAAANAAAAOQAAADsAAAADAAAAQwAAAAgAAAARAAAADAAAAAgAAAAAAAAAMBIAAC8AAADbAAAAQQAAAAkAAAABAAAAAQAAAGEAAAAOAAAADgAAAFUAAABiAAAAFgAAAAQAAABTAAAAGgAAAA0AAAA5AAAAPAAAAAMAAABEAAAACAAAABEAAAAMAAAACQAAAAAAAABAEgAA3AAAAN0AAABFAAAAAQAAAAIAAABjAAAAZAAAAFYAAABlAAAAZgAAAFcAAAA9AAAAPgAAAFgAAAAbAAAAAAAAAFASAADeAAAA3wAAAAEAAAA/AAAADgAAAEYAAAACAAAARwAAAGcAAABZAAAAWgAAAEAAAABoAAAA4AAAAAAAAABgEgAA3gAAAOEAAAABAAAAPwAAAA4AAABGAAAAAgAAAEcAAABnAAAAWQAAAFoAAABAAAAAaAAAAOAAAAAAAAAAeBIAAOIAAADjAAAAHAAAABUAAABBAAAAWwAAAFwAAABdAAAAQgAAAF4AAABDAAAAaQAAAEQAAAAdAAAAXwAAAGoAAABrAAAAAAAAAJgSAADkAAAA5QAAAB4AAAAWAAAARQAAAGAAAABhAAAAYgAAAEYAAABjAAAARwAAAGwAAABIAAAAHwAAAGQAAABtAAAAbgAAAAAAAACoEgAAeQAAAOYAAAAVAAAAAAAAALgSAAB5AAAA5wAAABYAAAAAAAAAyBIAAOgAAADpAAAAAgAAAEkAAAAPAAAASAAAAAMAAABJAAAAbwAAAGUAAABmAAAASgAAAHAAAADqAAAAAAAAANgSAAAnAAAA6wAAAEsAAABxAAAAAgAAAAUAAAAGAAAAAAAAAOgSAAAnAAAA7AAAAAgAAAByAAAAAgAAAAUAAAAGAAAAAAAAAPgSAAAnAAAA7QAAAAgAAABzAAAAAgAAAAUAAAAGAAAAAAAAABATAADuAAAA7wAAABMAAABPAAAAGQAAAF4AAABfAAAAAAAAACgTAAA3AAAA8AAAACEAAAABAAAAAAAAADgTAADxAAAA8gAAAAEAAAAAAAAASBMAAJIAAADzAAAATAAAAE0AAAAIAAAAAAAAAGATAADxAAAA9AAAAAIAAAAAAAAAcBMAAG8AAAD1AAAAAgAAAAAAAACAEwAAkgAAAPYAAABOAAAATwAAAAkAAAAAAAAAkBMAAG8AAAD3AAAAAwAAAAAAAACgEwAA+AAAAPkAAAAQAAAAAAAAAMgTAAD6AAAA+wAAABEAAAALAAAAdAAAAAAAAADYEwAA/AAAAP0AAAASAAAADAAAAHUAAAAAAAAA6BMAAPgAAAD+AAAAEwAAAAAAAAD4EwAA+AAAAP8AAAAUAAAAAAAAAAgUAAAAAQAAAQEAACAAAAAhAAAAZwAAAAAAAAAQFAAAAgEAAAMBAAAAAAAAGBQAAAQBAAAFAQAARQAAAAEAAAACAAAAYwAAAGQAAABWAAAAdgAAAHcAAABXAAAAPQAAAD4AAABYAAAAGwAAAAxwAAD/////BQAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAAACMAAACJcgAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAA//////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAOBQAAAYBAAAHAQAACAEAAAkBAAAkAAAABAAAABUAAABKAAAAAAAAAGAUAAAGAQAACgEAAAgBAAAJAQAAJAAAAAUAAAAWAAAASwAAAAAAAACQFAAABgEAAAsBAAAIAQAACQEAACQAAAAGAAAAFwAAAEwAAAB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2dldERlYnVnTW9kZScpKSB0aHJvdyAnYSBKU0ltcGxlbWVudGF0aW9uIG11c3QgaW1wbGVtZW50IGFsbCBmdW5jdGlvbnMsIHlvdSBmb3Jnb3QgRGVidWdEcmF3ZXI6OmdldERlYnVnTW9kZS4nOyByZXR1cm4gc2VsZlsnZ2V0RGVidWdNb2RlJ10oKTsgfQB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ3NldERlYnVnTW9kZScpKSB0aHJvdyAnYSBKU0ltcGxlbWVudGF0aW9uIG11c3QgaW1wbGVtZW50IGFsbCBmdW5jdGlvbnMsIHlvdSBmb3Jnb3QgRGVidWdEcmF3ZXI6OnNldERlYnVnTW9kZS4nOyBzZWxmWydzZXREZWJ1Z01vZGUnXSgkMSk7IH0AeyB2YXIgc2VsZiA9IE1vZHVsZVsnZ2V0Q2FjaGUnXShNb2R1bGVbJ0RlYnVnRHJhd2VyJ10pWyQwXTsgaWYgKCFzZWxmLmhhc093blByb3BlcnR5KCdkcmF3M2RUZXh0JykpIHRocm93ICdhIEpTSW1wbGVtZW50YXRpb24gbXVzdCBpbXBsZW1lbnQgYWxsIGZ1bmN0aW9ucywgeW91IGZvcmdvdCBEZWJ1Z0RyYXdlcjo6ZHJhdzNkVGV4dC4nOyBzZWxmWydkcmF3M2RUZXh0J10oJDEsJDIpOyB9AHsgdmFyIHNlbGYgPSBNb2R1bGVbJ2dldENhY2hlJ10oTW9kdWxlWydEZWJ1Z0RyYXdlciddKVskMF07IGlmICghc2VsZi5oYXNPd25Qcm9wZXJ0eSgncmVwb3J0RXJyb3JXYXJuaW5nJykpIHRocm93ICdhIEpTSW1wbGVtZW50YXRpb24gbXVzdCBpbXBsZW1lbnQgYWxsIGZ1bmN0aW9ucywgeW91IGZvcmdvdCBEZWJ1Z0RyYXdlcjo6cmVwb3J0RXJyb3JXYXJuaW5nLic7IHNlbGZbJ3JlcG9ydEVycm9yV2FybmluZyddKCQxKTsgfQB7IHZhciBzZWxmID0gTW9kdWxlWydnZXRDYWNoZSddKE1vZHVsZVsnRGVidWdEcmF3ZXInXSlbJDBdOyBpZiAoIXNlbGYuaGFzT3duUHJvcGVydHkoJ2RyYXdDb250YWN0UG9pbnQnKSkgdGhyb3cgJ2EgSlNJbXBsZW1lbnRhdGlvbiBtdXN0IGltcGxlbWVudCBhbGwgZnVuY3Rpb25zLCB5b3UgZm9yZ290IERlYnVnRHJhd2VyOjpkcmF3Q29udGFjdFBvaW50Lic7IHNlbGZbJ2RyYXdDb250YWN0UG9pbnQnXSgkMSwkMiwkMywkNCwkNSk7IH0AeyB2YXIgc2VsZiA9IE1vZHVsZVsnZ2V0Q2FjaGUnXShNb2R1bGVbJ0RlYnVnRHJhd2VyJ10pWyQwXTsgaWYgKCFzZWxmLmhhc093blByb3BlcnR5KCdkcmF3TGluZScpKSB0aHJvdyAnYSBKU0ltcGxlbWVudGF0aW9uIG11c3QgaW1wbGVtZW50IGFsbCBmdW5jdGlvbnMsIHlvdSBmb3Jnb3QgRGVidWdEcmF3ZXI6OmRyYXdMaW5lLic7IHNlbGZbJ2RyYXdMaW5lJ10oJDEsJDIsJDMpOyB9ADExRGVidWdEcmF3ZXIAMTJidElEZWJ1Z0RyYXcAeyB2YXIgc2VsZiA9IE1vZHVsZVsnZ2V0Q2FjaGUnXShNb2R1bGVbJ0NvbmNyZXRlQ29udGFjdFJlc3VsdENhbGxiYWNrJ10pWyQwXTsgaWYgKCFzZWxmLmhhc093blByb3BlcnR5KCdhZGRTaW5nbGVSZXN1bHQnKSkgdGhyb3cgJ2EgSlNJbXBsZW1lbnRhdGlvbiBtdXN0IGltcGxlbWVudCBhbGwgZnVuY3Rpb25zLCB5b3UgZm9yZ290IENvbmNyZXRlQ29udGFjdFJlc3VsdENhbGxiYWNrOjphZGRTaW5nbGVSZXN1bHQuJzsgcmV0dXJuIHNlbGZbJ2FkZFNpbmdsZVJlc3VsdCddKCQxLCQyLCQzLCQ0LCQ1LCQ2LCQ3KTsgfQAyOUNvbmNyZXRlQ29udGFjdFJlc3VsdENhbGxiYWNrAE4xNmJ0Q29sbGlzaW9uV29ybGQyMUNvbnRhY3RSZXN1bHRDYWxsYmFja0UATjE2YnRDb2xsaXNpb25Xb3JsZDI0Q2xvc2VzdFJheVJlc3VsdENhbGxiYWNrRQBOMTZidENvbGxpc2lvbldvcmxkMTdSYXlSZXN1bHRDYWxsYmFja0UAMTlidEdob3N0UGFpckNhbGxiYWNrADI1YnRPdmVybGFwcGluZ1BhaXJDYWxsYmFjawAyMGJ0RGVmYXVsdE1vdGlvblN0YXRlADEzYnRNb3Rpb25TdGF0ZQAxOGJ0VmVoaWNsZVJheWNhc3RlcgBOMTZidENvbGxpc2lvbldvcmxkMjdDbG9zZXN0Q29udmV4UmVzdWx0Q2FsbGJhY2tFAE4xNmJ0Q29sbGlzaW9uV29ybGQyMENvbnZleFJlc3VsdENhbGxiYWNrRQAyM2J0RGVmYXVsdFNvZnRCb2R5U29sdmVyADE2YnRTb2Z0Qm9keVNvbHZlcgA0MWJ0U29mdEJvZHlSaWdpZEJvZHlDb2xsaXNpb25Db25maWd1cmF0aW9uAE4zNWJ0U29mdEJvZHlDb25jYXZlQ29sbGlzaW9uQWxnb3JpdGhtMTdTd2FwcGVkQ3JlYXRlRnVuY0UAMzBidENvbGxpc2lvbkFsZ29yaXRobUNyZWF0ZUZ1bmMATjM1YnRTb2Z0Qm9keUNvbmNhdmVDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAE4yOWJ0U29mdFJpZ2lkQ29sbGlzaW9uQWxnb3JpdGhtMTBDcmVhdGVGdW5jRQBOMjhidFNvZnRTb2Z0Q29sbGlzaW9uQWxnb3JpdGhtMTBDcmVhdGVGdW5jRQBTb2Z0Qm9keU1hdGVyaWFsRGF0YQBTb2Z0Qm9keU5vZGVEYXRhAFNvZnRCb2R5TGlua0RhdGEAU29mdEJvZHlGYWNlRGF0YQBTb2Z0Qm9keVRldHJhRGF0YQBTb2Z0UmlnaWRBbmNob3JEYXRhAGZsb2F0AFNvZnRCb2R5UG9zZURhdGEAU29mdEJvZHlDbHVzdGVyRGF0YQBpbnQAYnRTb2Z0Qm9keUpvaW50RGF0YQBidFNvZnRCb2R5RmxvYXREYXRhADEwYnRTb2Z0Qm9keQBOMTBidFNvZnRCb2R5MTVSYXlGcm9tVG9DYXN0ZXJFAE42YnREYnZ0OElDb2xsaWRlRQBOMTBidFNvZnRCb2R5NUpvaW50RQBOMTBidFNvZnRCb2R5NkNKb2ludEUAU29mdEJvZHkAMjRidFNvZnRCb2R5Q29sbGlzaW9uU2hhcGUAVXBkYXRlQ2x1c3RlcnMAU29mdEJvZHkgYXBwbHlGb3JjZXMAQXBwbHlDbHVzdGVycwBidENvbnZleEludGVybmFsU2hhcGVEYXRhAFNPRlRDTFVTVEVSADI3YnRTb2Z0Q2x1c3RlckNvbGxpc2lvblNoYXBlAE4xNWJ0U29mdENvbGxpZGVyczEyQ29sbGlkZUNMX1JTRQBOMTVidFNvZnRDb2xsaWRlcnMxMUNsdXN0ZXJCYXNlRQBOMTVidFNvZnRDb2xsaWRlcnMxM0NvbGxpZGVTREZfUlNFAE4xNWJ0U29mdENvbGxpZGVyczEyQ29sbGlkZVZGX1NTRQBOMTVidFNvZnRDb2xsaWRlcnMxMkNvbGxpZGVDTF9TU0UAMjlidFNvZnRSaWdpZENvbGxpc2lvbkFsZ29yaXRobQAyMGJ0Q29sbGlzaW9uQWxnb3JpdGhtAFRyaWFuZ2xlADE1YnRUcmlhbmdsZVNoYXBlAE4xMmJ0Q29udmV4Q2FzdDEwQ2FzdFJlc3VsdEUAWk4zNWJ0U29mdEJvZHlDb25jYXZlQ29sbGlzaW9uQWxnb3JpdGhtMjFjYWxjdWxhdGVUaW1lT2ZJbXBhY3RFUDE3YnRDb2xsaXNpb25PYmplY3RTMV9SSzE2YnREaXNwYXRjaGVySW5mb1AxNmJ0TWFuaWZvbGRSZXN1bHRFMzFMb2NhbFRyaWFuZ2xlU3BoZXJlQ2FzdENhbGxiYWNrADI2YnRTb2Z0Qm9keVRyaWFuZ2xlQ2FsbGJhY2sAMzVidFNvZnRCb2R5Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobQBzb2x2ZVNvZnRDb25zdHJhaW50cwBwcmVkaWN0VW5jb25zdHJhaW50TW90aW9uU29mdEJvZHkAcmF5VGVzdAAyM2J0U29mdFNpbmdsZVJheUNhbGxiYWNrADIzYnRCcm9hZHBoYXNlUmF5Q2FsbGJhY2sAMjRidEJyb2FkcGhhc2VBYWJiQ2FsbGJhY2sAMjRidFNvZnRSaWdpZER5bmFtaWNzV29ybGQAMjhidFNvZnRTb2Z0Q29sbGlzaW9uQWxnb3JpdGhtAGJ0UmlnaWRCb2R5RmxvYXREYXRhADExYnRSaWdpZEJvZHkAaW50ZXJuYWxTaW5nbGVTdGVwU2ltdWxhdGlvbgB1cGRhdGVBY3Rpb25zAGNyZWF0ZVByZWRpY3RpdmVDb250YWN0cwByZWxlYXNlIHByZWRpY3RpdmUgY29udGFjdCBtYW5pZm9sZHMAcHJlZGljdGl2ZSBjb252ZXhTd2VlcFRlc3QAMzRidENsb3Nlc3ROb3RNZUNvbnZleFJlc3VsdENhbGxiYWNrAHVwZGF0ZUFjdGl2YXRpb25TdGF0ZQBzb2x2ZUNvbnN0cmFpbnRzAGNhbGN1bGF0ZVNpbXVsYXRpb25Jc2xhbmRzAGludGVncmF0ZVRyYW5zZm9ybXMAQ0NEIG1vdGlvbiBjbGFtcGluZwBhcHBseSBzcGVjdWxhdGl2ZSBjb250YWN0IHJlc3RpdHV0aW9uAHByZWRpY3RVbmNvbnN0cmFpbnRNb3Rpb24Ac3luY2hyb25pemVNb3Rpb25TdGF0ZXMAc3RlcFNpbXVsYXRpb24AYnREeW5hbWljc1dvcmxkRmxvYXREYXRhAGRlYnVnRHJhd1dvcmxkADIzYnREaXNjcmV0ZUR5bmFtaWNzV29ybGQAMTVidER5bmFtaWNzV29ybGQAMjdJbnBsYWNlU29sdmVySXNsYW5kQ2FsbGJhY2sATjI1YnRTaW11bGF0aW9uSXNsYW5kTWFuYWdlcjE0SXNsYW5kQ2FsbGJhY2tFADE3YnRGaXhlZENvbnN0cmFpbnQAYnRHZW5lcmljNkRvZkNvbnN0cmFpbnREYXRhADIzYnRHZW5lcmljNkRvZkNvbnN0cmFpbnQAYnRHZW5lcmljNkRvZlNwcmluZ0NvbnN0cmFpbnREYXRhADI5YnRHZW5lcmljNkRvZlNwcmluZ0NvbnN0cmFpbnQAYnRQb2ludDJQb2ludENvbnN0cmFpbnRGbG9hdERhdGEAMjNidFBvaW50MlBvaW50Q29uc3RyYWludABidFR5cGVkQ29uc3RyYWludEZsb2F0RGF0YQAxN2J0VHlwZWRDb25zdHJhaW50ADEzYnRUeXBlZE9iamVjdABidFNsaWRlckNvbnN0cmFpbnREYXRhADE4YnRTbGlkZXJDb25zdHJhaW50AGJ0Q29uZVR3aXN0Q29uc3RyYWludERhdGEAMjFidENvbmVUd2lzdENvbnN0cmFpbnQAYnRIaW5nZUNvbnN0cmFpbnRGbG9hdERhdGEAMTdidEhpbmdlQ29uc3RyYWludABzb2x2ZUdyb3VwQ2FjaGVGcmllbmRseUl0ZXJhdGlvbnMAc29sdmVHcm91cENhY2hlRnJpZW5kbHlTZXR1cABzb2x2ZUdyb3VwADM1YnRTZXF1ZW50aWFsSW1wdWxzZUNvbnN0cmFpbnRTb2x2ZXIAMThidENvbnN0cmFpbnRTb2x2ZXIAMTZidFJheWNhc3RWZWhpY2xlADE3YnRBY3Rpb25JbnRlcmZhY2UAMjVidERlZmF1bHRWZWhpY2xlUmF5Y2FzdGVyADQzYnRLaW5lbWF0aWNDbG9zZXN0Tm90TWVDb252ZXhSZXN1bHRDYWxsYmFjawAzMGJ0S2luZW1hdGljQ2hhcmFjdGVyQ29udHJvbGxlcgAzMGJ0Q2hhcmFjdGVyQ29udHJvbGxlckludGVyZmFjZQAyMmJ0U3Vic2ltcGxleENvbnZleENhc3QAMTJidENvbnZleENhc3QAYnRDb2xsaXNpb25PYmplY3RGbG9hdERhdGEAMTdidENvbGxpc2lvbk9iamVjdAAxM2J0R2hvc3RPYmplY3QAMjRidFBhaXJDYWNoaW5nR2hvc3RPYmplY3QAMjNidENvbGxpc2lvblBhaXJDYWxsYmFjawAxN2J0T3ZlcmxhcENhbGxiYWNrADIxYnRDb2xsaXNpb25EaXNwYXRjaGVyADMxYnREZWZhdWx0Q29sbGlzaW9uQ29uZmlndXJhdGlvbgAyNGJ0Q29sbGlzaW9uQ29uZmlndXJhdGlvbgBOMzFidENvbnZleFBsYW5lQ29sbGlzaW9uQWxnb3JpdGhtMTBDcmVhdGVGdW5jRQBOMjZidEJveEJveENvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UATjM0YnRTcGhlcmVUcmlhbmdsZUNvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UATjMyYnRTcGhlcmVTcGhlcmVDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAE4xNmJ0RW1wdHlBbGdvcml0aG0xMENyZWF0ZUZ1bmNFAE4yOGJ0Q29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0xN1N3YXBwZWRDcmVhdGVGdW5jRQBOMzZidENvbXBvdW5kQ29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAE4yOGJ0Q29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0xMENyZWF0ZUZ1bmNFAE4zM2J0Q29udmV4Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTE3U3dhcHBlZENyZWF0ZUZ1bmNFAE4zM2J0Q29udmV4Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTEwQ3JlYXRlRnVuY0UAMjVidFNpbXVsYXRpb25Jc2xhbmRNYW5hZ2VyAGlzbGFuZFVuaW9uRmluZEFuZFF1aWNrU29ydABwcm9jZXNzSXNsYW5kcwAzMWJ0Q29udmV4UGxhbmVDb2xsaXNpb25BbGdvcml0aG0AWk4zM2J0Q29udmV4Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobTIxY2FsY3VsYXRlVGltZU9mSW1wYWN0RVAxN2J0Q29sbGlzaW9uT2JqZWN0UzFfUksxNmJ0RGlzcGF0Y2hlckluZm9QMTZidE1hbmlmb2xkUmVzdWx0RTMxTG9jYWxUcmlhbmdsZVNwaGVyZUNhc3RDYWxsYmFjawAyNGJ0Q29udmV4VHJpYW5nbGVDYWxsYmFjawAzM2J0Q29udmV4Q29uY2F2ZUNvbGxpc2lvbkFsZ29yaXRobQAyNmJ0Qm94Qm94Q29sbGlzaW9uQWxnb3JpdGhtADE2YnRNYW5pZm9sZFJlc3VsdABOMzZidERpc2NyZXRlQ29sbGlzaW9uRGV0ZWN0b3JJbnRlcmZhY2U2UmVzdWx0RQBwZXJmb3JtRGlzY3JldGVDb2xsaXNpb25EZXRlY3Rpb24AZGlzcGF0Y2hBbGxDb2xsaXNpb25QYWlycwBaTjE2YnRDb2xsaXNpb25Xb3JsZDIxcmF5VGVzdFNpbmdsZUludGVybmFsRVJLMTFidFRyYW5zZm9ybVMyX1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMTdSYXlSZXN1bHRDYWxsYmFja0VFMTVMb2NhbEluZm9BZGRlcjIAWk4xNmJ0Q29sbGlzaW9uV29ybGQyMXJheVRlc3RTaW5nbGVJbnRlcm5hbEVSSzExYnRUcmFuc2Zvcm1TMl9QSzI0YnRDb2xsaXNpb25PYmplY3RXcmFwcGVyUk5TXzE3UmF5UmVzdWx0Q2FsbGJhY2tFRTlSYXlUZXN0ZXIAWk4xNmJ0Q29sbGlzaW9uV29ybGQyMXJheVRlc3RTaW5nbGVJbnRlcm5hbEVSSzExYnRUcmFuc2Zvcm1TMl9QSzI0YnRDb2xsaXNpb25PYmplY3RXcmFwcGVyUk5TXzE3UmF5UmVzdWx0Q2FsbGJhY2tFRTI5QnJpZGdlVHJpYW5nbGVSYXljYXN0Q2FsbGJhY2tfMABaTjE2YnRDb2xsaXNpb25Xb3JsZDIxcmF5VGVzdFNpbmdsZUludGVybmFsRVJLMTFidFRyYW5zZm9ybVMyX1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMTdSYXlSZXN1bHRDYWxsYmFja0VFMjlCcmlkZ2VUcmlhbmdsZVJheWNhc3RDYWxsYmFjawAxOWJ0U2luZ2xlUmF5Q2FsbGJhY2sAMTdEZWJ1Z0RyYXdjYWxsYmFjawBjYWxjdWxhdGVPdmVybGFwcGluZ1BhaXJzAHVwZGF0ZUFhYmJzAAFPdmVyZmxvdyBpbiBBQUJCLCBvYmplY3QgcmVtb3ZlZCBmcm9tIHNpbXVsYXRpb24ASWYgeW91IGNhbiByZXByb2R1Y2UgdGhpcywgcGxlYXNlIGVtYWlsIGJ1Z3NAY29udGludW91c3BoeXNpY3MuY29tCgBQbGVhc2UgaW5jbHVkZSBhYm92ZSBpbmZvcm1hdGlvbiwgeW91ciBQbGF0Zm9ybSwgdmVyc2lvbiBvZiBPUy4KAFRoYW5rcy4KADE2YnRDb2xsaXNpb25Xb3JsZABjb252ZXhTd2VlcENvbXBvdW5kAFpOMTZidENvbGxpc2lvbldvcmxkMjVvYmplY3RRdWVyeVNpbmdsZUludGVybmFsRVBLMTNidENvbnZleFNoYXBlUksxMWJ0VHJhbnNmb3JtUzVfUEsyNGJ0Q29sbGlzaW9uT2JqZWN0V3JhcHBlclJOU18yMENvbnZleFJlc3VsdENhbGxiYWNrRWZFMTRMb2NhbEluZm9BZGRlcgBaTjE2YnRDb2xsaXNpb25Xb3JsZDI1b2JqZWN0UXVlcnlTaW5nbGVJbnRlcm5hbEVQSzEzYnRDb252ZXhTaGFwZVJLMTFidFRyYW5zZm9ybVM1X1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMjBDb252ZXhSZXN1bHRDYWxsYmFja0VmRTMyQnJpZGdlVHJpYW5nbGVDb252ZXhjYXN0Q2FsbGJhY2tfMABaTjE2YnRDb2xsaXNpb25Xb3JsZDI1b2JqZWN0UXVlcnlTaW5nbGVJbnRlcm5hbEVQSzEzYnRDb252ZXhTaGFwZVJLMTFidFRyYW5zZm9ybVM1X1BLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJSTlNfMjBDb252ZXhSZXN1bHRDYWxsYmFja0VmRTMyQnJpZGdlVHJpYW5nbGVDb252ZXhjYXN0Q2FsbGJhY2sAY29udmV4U3dlZXBUZXN0ADIxYnRTaW5nbGVTd2VlcENhbGxiYWNrADIzYnRCcmlkZ2VkTWFuaWZvbGRSZXN1bHQAMjNidFNpbmdsZUNvbnRhY3RDYWxsYmFjawAzNGJ0U3BoZXJlVHJpYW5nbGVDb2xsaXNpb25BbGdvcml0aG0AMjRidFBlcnR1cmJlZENvbnRhY3RSZXN1bHQAWk4yM2J0Q29udmV4Q29udmV4QWxnb3JpdGhtMTZwcm9jZXNzQ29sbGlzaW9uRVBLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJTMl9SSzE2YnREaXNwYXRjaGVySW5mb1AxNmJ0TWFuaWZvbGRSZXN1bHRFMjFidFdpdGhvdXRNYXJnaW5SZXN1bHQAWk4yM2J0Q29udmV4Q29udmV4QWxnb3JpdGhtMTZwcm9jZXNzQ29sbGlzaW9uRVBLMjRidENvbGxpc2lvbk9iamVjdFdyYXBwZXJTMl9SSzE2YnREaXNwYXRjaGVySW5mb1AxNmJ0TWFuaWZvbGRSZXN1bHRFMTNidER1bW15UmVzdWx0ADIzYnRDb252ZXhDb252ZXhBbGdvcml0aG0ATjIzYnRDb252ZXhDb252ZXhBbGdvcml0aG0xMENyZWF0ZUZ1bmNFADIyYnRDb21wb3VuZExlYWZDYWxsYmFjawAyOGJ0Q29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0AMzBidENvbXBvdW5kQ29tcG91bmRMZWFmQ2FsbGJhY2sAMzZidENvbXBvdW5kQ29tcG91bmRDb2xsaXNpb25BbGdvcml0aG0AYnRDb21wb3VuZFNoYXBlQ2hpbGREYXRhAGJ0Q29tcG91bmRTaGFwZURhdGEAQ29tcG91bmQAMTVidENvbXBvdW5kU2hhcGUAYnRDb25lU2hhcGVEYXRhAENvbmUAMTFidENvbmVTaGFwZQBDb25lWgAxMmJ0Q29uZVNoYXBlWgBDb25lWAAxMmJ0Q29uZVNoYXBlWABTUEhFUkUAMTNidFNwaGVyZVNoYXBlAFpOSzIyYnRCdmhUcmlhbmdsZU1lc2hTaGFwZTE5cHJvY2Vzc0FsbFRyaWFuZ2xlc0VQMThidFRyaWFuZ2xlQ2FsbGJhY2tSSzlidFZlY3RvcjNTNF9FMjFNeU5vZGVPdmVybGFwQ2FsbGJhY2sAMjFidE5vZGVPdmVybGFwQ2FsbGJhY2sAYnRUcmlhbmdsZU1lc2hTaGFwZURhdGEAQlZIVFJJQU5HTEVNRVNIADIyYnRCdmhUcmlhbmdsZU1lc2hTaGFwZQBaTjIyYnRCdmhUcmlhbmdsZU1lc2hTaGFwZTE0cGVyZm9ybVJheWNhc3RFUDE4YnRUcmlhbmdsZUNhbGxiYWNrUks5YnRWZWN0b3IzUzRfRTIxTXlOb2RlT3ZlcmxhcENhbGxiYWNrAFpOMjJidEJ2aFRyaWFuZ2xlTWVzaFNoYXBlMTdwZXJmb3JtQ29udmV4Y2FzdEVQMThidFRyaWFuZ2xlQ2FsbGJhY2tSSzlidFZlY3RvcjNTNF9TNF9TNF9FMjFNeU5vZGVPdmVybGFwQ2FsbGJhY2sAMjFTdXBwb3J0VmVydGV4Q2FsbGJhY2sAWk5LMTlidFRyaWFuZ2xlTWVzaFNoYXBlMTlwcm9jZXNzQWxsVHJpYW5nbGVzRVAxOGJ0VHJpYW5nbGVDYWxsYmFja1JLOWJ0VmVjdG9yM1M0X0UxNkZpbHRlcmVkQ2FsbGJhY2sAVFJJQU5HTEVNRVNIADE5YnRUcmlhbmdsZU1lc2hTaGFwZQBidFN0YXRpY1BsYW5lU2hhcGVEYXRhAFNUQVRJQ1BMQU5FADE4YnRTdGF0aWNQbGFuZVNoYXBlADIzYnRQb2x5aGVkcmFsQ29udmV4U2hhcGUAMzRidFBvbHloZWRyYWxDb252ZXhBYWJiQ2FjaGluZ1NoYXBlAGJ0Q29sbGlzaW9uU2hhcGVEYXRhADE2YnRDb2xsaXNpb25TaGFwZQAxM2J0Q29udmV4U2hhcGUAMjFidENvbnZleEludGVybmFsU2hhcGUAYnRDb252ZXhIdWxsU2hhcGVEYXRhAENvbnZleAAxN2J0Q29udmV4SHVsbFNoYXBlADE4YnRUcmlhbmdsZUNhbGxiYWNrADMxYnRJbnRlcm5hbFRyaWFuZ2xlSW5kZXhDYWxsYmFjawBidENhcHN1bGVTaGFwZURhdGEAQ2Fwc3VsZVNoYXBlADE0YnRDYXBzdWxlU2hhcGUAQ2Fwc3VsZVgAMTVidENhcHN1bGVTaGFwZVgAQ2Fwc3VsZVoAMTVidENhcHN1bGVTaGFwZVoAMjZMb2NhbFN1cHBvcnRWZXJ0ZXhDYWxsYmFjawBDb252ZXhUcmltZXNoADI1YnRDb252ZXhUcmlhbmdsZU1lc2hTaGFwZQAxNGJ0Q29uY2F2ZVNoYXBlAEJveAAxMGJ0Qm94U2hhcGUAMTRidE9wdGltaXplZEJ2aABaTjE0YnRPcHRpbWl6ZWRCdmg1YnVpbGRFUDIzYnRTdHJpZGluZ01lc2hJbnRlcmZhY2ViUks5YnRWZWN0b3IzUzRfRTIwTm9kZVRyaWFuZ2xlQ2FsbGJhY2sAWk4xNGJ0T3B0aW1pemVkQnZoNWJ1aWxkRVAyM2J0U3RyaWRpbmdNZXNoSW50ZXJmYWNlYlJLOWJ0VmVjdG9yM1M0X0UyOVF1YW50aXplZE5vZGVUcmlhbmdsZUNhbGxiYWNrAEhFSUdIVEZJRUxEADI1YnRIZWlnaHRmaWVsZFRlcnJhaW5TaGFwZQBidEN5bGluZGVyU2hhcGVEYXRhAEN5bGluZGVyWQAxNWJ0Q3lsaW5kZXJTaGFwZQBDeWxpbmRlclgAMTZidEN5bGluZGVyU2hhcGVYAEN5bGluZGVyWgAxNmJ0Q3lsaW5kZXJTaGFwZVoAMTRidFRyaWFuZ2xlTWVzaAAyMGJ0QXhpc1N3ZWVwM0ludGVybmFsSXRFADIxYnRCcm9hZHBoYXNlSW50ZXJmYWNlADEyYnRBeGlzU3dlZXAzADE1YnROdWxsUGFpckNhY2hlADIyYnRPdmVybGFwcGluZ1BhaXJDYWNoZQBaTjI4YnRIYXNoZWRPdmVybGFwcGluZ1BhaXJDYWNoZTE5Y2xlYW5Qcm94eUZyb21QYWlyc0VQMTdidEJyb2FkcGhhc2VQcm94eVAxMmJ0RGlzcGF0Y2hlckUxN0NsZWFuUGFpckNhbGxiYWNrAFpOMjhidEhhc2hlZE92ZXJsYXBwaW5nUGFpckNhY2hlMzdyZW1vdmVPdmVybGFwcGluZ1BhaXJzQ29udGFpbmluZ1Byb3h5RVAxN2J0QnJvYWRwaGFzZVByb3h5UDEyYnREaXNwYXRjaGVyRTE4UmVtb3ZlUGFpckNhbGxiYWNrADI4YnRIYXNoZWRPdmVybGFwcGluZ1BhaXJDYWNoZQAxOGJ0RGJ2dFRyZWVDb2xsaWRlcgAyMEJyb2FkcGhhc2VBYWJiVGVzdGVyADE5QnJvYWRwaGFzZVJheVRlc3RlcgAxNmJ0RGJ2dEJyb2FkcGhhc2UAMTJidERpc3BhdGNoZXIAYnRPcHRpbWl6ZWRCdmhOb2RlRGF0YQBidFF1YW50aXplZEJ2aE5vZGVEYXRhAGJ0QnZoU3VidHJlZUluZm9EYXRhAGJ0UXVhbnRpemVkQnZoRmxvYXREYXRhADE0YnRRdWFudGl6ZWRCdmgAMjVidFRyaWFuZ2xlUmF5Y2FzdENhbGxiYWNrADI4YnRUcmlhbmdsZUNvbnZleGNhc3RDYWxsYmFjawBaTjMzYnRNaW5rb3dza2lQZW5ldHJhdGlvbkRlcHRoU29sdmVyMTJjYWxjUGVuRGVwdGhFUjIyYnRWb3Jvbm9pU2ltcGxleFNvbHZlclBLMTNidENvbnZleFNoYXBlUzRfUksxMWJ0VHJhbnNmb3JtUzdfUjlidFZlY3RvcjNTOV9TOV9QMTJidElEZWJ1Z0RyYXdFMjBidEludGVybWVkaWF0ZVJlc3VsdAAzM2J0TWlua293c2tpUGVuZXRyYXRpb25EZXB0aFNvbHZlcgAzMGJ0Q29udmV4UGVuZXRyYXRpb25EZXB0aFNvbHZlcgAzMGJ0R2prRXBhUGVuZXRyYXRpb25EZXB0aFNvbHZlcgAxNmJ0UG9pbnRDb2xsZWN0b3IAMTVidEdqa0NvbnZleENhc3QAMjdidENvbnRpbnVvdXNDb252ZXhDb2xsaXNpb24AMTdidEdqa1BhaXJEZXRlY3RvcgAzNmJ0RGlzY3JldGVDb2xsaXNpb25EZXRlY3RvckludGVyZmFjZQAzMGJ0QWN0aXZhdGluZ0NvbGxpc2lvbkFsZ29yaXRobQAxNmJ0RW1wdHlBbGdvcml0aG0AMzJidFNwaGVyZVNwaGVyZUNvbGxpc2lvbkFsZ29yaXRobQAxNmJ0Qm94Qm94RGV0ZWN0b3IAMjJTcGhlcmVUcmlhbmdsZURldGVjdG9yADIzYnRIYXNoZWRTaW1wbGVQYWlyQ2FjaGUAMThidENvbnZleFBvbHloZWRyb24AMjZidFRyaWFuZ2xlSW5kZXhWZXJ0ZXhBcnJheQBidEludEluZGV4RGF0YQBidFNob3J0SW50SW5kZXhUcmlwbGV0RGF0YQBidENoYXJJbmRleFRyaXBsZXREYXRhAGJ0VmVjdG9yM0Zsb2F0RGF0YQBidFZlY3RvcjNEb3VibGVEYXRhAGJ0TWVzaFBhcnREYXRhAGJ0U3RyaWRpbmdNZXNoSW50ZXJmYWNlRGF0YQAyM2J0U3RyaWRpbmdNZXNoSW50ZXJmYWNlAFJvb3QALSsgICAwWDB4AChudWxsKQAtMFgrMFggMFgtMHgrMHggMHgAaW5mAElORgBuYW4ATkFOAC4AdGVybWluYXRpbmcgd2l0aCAlcyBleGNlcHRpb24gb2YgdHlwZSAlczogJXMAdGVybWluYXRpbmcgd2l0aCAlcyBleGNlcHRpb24gb2YgdHlwZSAlcwB0ZXJtaW5hdGluZyB3aXRoICVzIGZvcmVpZ24gZXhjZXB0aW9uAHRlcm1pbmF0aW5nAHVuY2F1Z2h0AFN0OWV4Y2VwdGlvbgBOMTBfX2N4eGFiaXYxMTZfX3NoaW1fdHlwZV9pbmZvRQBTdDl0eXBlX2luZm8ATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQBwdGhyZWFkX29uY2UgZmFpbHVyZSBpbiBfX2N4YV9nZXRfZ2xvYmFsc19mYXN0KCkAY2Fubm90IGNyZWF0ZSBwdGhyZWFkIGtleSBmb3IgX19jeGFfZ2V0X2dsb2JhbHMoKQBjYW5ub3QgemVybyBvdXQgdGhyZWFkIHZhbHVlIGZvciBfX2N4YV9nZXRfZ2xvYmFscygpAHRlcm1pbmF0ZV9oYW5kbGVyIHVuZXhwZWN0ZWRseSByZXR1cm5lZABOMTBfX2N4eGFiaXYxMTlfX3BvaW50ZXJfdHlwZV9pbmZvRQBOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0UATjEwX19jeHhhYml2MTIxX192bWlfY2xhc3NfdHlwZV9pbmZvRQ=="; -function Pa(){return!!Pa.Vf}var Qa=0,Ra=[],Sa={};function Ta(){var a=Qa;if(!a)return ra=0;var b=Sa[a],e=b.type;if(!e)return ra=0,a|0;var f=Array.prototype.slice.call(arguments);d.___cxa_is_pointer_type(e);Ta.buffer||(Ta.buffer=Ua(4));xa[Ta.buffer>>2]=a;a=Ta.buffer;for(var g=0;g>2],b.Aa.push(a),ra=f[g],a|0;a=xa[a>>2];ra=e;return a|0}var Va=[null,[],[]]; -function Wa(a,b){var e=Va[a];assert(e);0===b||10===b?((1===a?pa:qa)(ua(e,0)),e.length=0):e.push(b)}var Xa=0;function Ya(){Xa+=4;return xa[Xa-4>>2]}var Za={},$a={},ab=1;function bb(a,b){bb.pa||(bb.pa={});a in bb.pa||(d.dynCall_v(b),bb.pa[a]=1)}var cb=!1;function oa(a){for(var b=[],e=0;e>4; -g=(g&15)<<4|n>>2;var Q=(n&3)<<6|A;b+=String.fromCharCode(f);64!==n&&(b+=String.fromCharCode(g));64!==A&&(b+=String.fromCharCode(Q))}while(e>2]=a);return a},n:function(a,b){Xa=b;try{var e=Za.Ea();Ya();var f=Ya(),g=Ya(),n=Ya();(void 0).Wf(e,f,n);xa[g>>2]=e.position;e.nd&&0===f&&0===n&&(e.nd=null);return 0}catch(A){return na(A),-A.ya}},o:function(a,b){Xa=b;try{var e=Ya(),f=Ya(),g=Ya();for(b=a=0;b>2],A=xa[f+(8*b+4)>>2],Q=0;Q>2]=b/1E3|0;xa[a+4>>2]=b%1E3*1E3|0;return 0},B:function(){na("trap!")}, -C:function(a){return $a[a]||0},D:function(a){if(0==a)return 22;xa[a>>2]=ab;$a[ab]=0;ab++;return 0},E:bb,F:function(a,b){if(!(a in $a))return 22;$a[a]=b;return 0},G:function(){var a=d._fflush;a&&a(0);Va[1].length&&Wa(1,10);Va[2].length&&Wa(2,10)},H:29344,I:29584};// EMSCRIPTEN_START_ASM -var h=(/** @suppress {uselessCode} */ function(global,env,buffer) { -"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.H|0;var j=env.I|0;var k=0;var l=0;var m=0;var n=0;var o=global.NaN,p=global.Infinity;var q=0,r=0,s=0,t=0,u=0.0;var v=global.Math.floor;var w=global.Math.abs;var x=global.Math.sqrt;var y=global.Math.pow;var z=global.Math.cos;var A=global.Math.sin;var B=global.Math.tan;var C=global.Math.acos;var D=global.Math.asin;var E=global.Math.atan;var F=global.Math.atan2;var G=global.Math.exp;var H=global.Math.log;var I=global.Math.ceil;var J=global.Math.imul;var K=global.Math.min;var L=global.Math.max;var M=global.Math.clz32;var N=env.a;var O=env.b;var P=env.c;var Q=env.d;var R=env.e;var S=env.f;var T=env.g;var U=env.h;var V=env.i;var W=env.j;var X=env.k;var Y=env.l;var Z=env.m;var _=env.n;var $=env.o;var aa=env.p;var ba=env.q;var ca=env.r;var da=env.s;var ea=env.t;var fa=env.u;var ga=env.v;var ha=env.w;var ia=env.x;var ja=env.y;var ka=env.z;var la=env.A;var ma=env.B;var na=env.C;var oa=env.D;var pa=env.E;var qa=env.F;var ra=env.G;var sa=29600;var ta=5272480;var ua=0.0; -// EMSCRIPTEN_START_FUNCS -function te(b,d){b=b|0;d=+d;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0.0;r=sa;sa=sa+16|0;Ki(16515);e=c[b+232>>2]|0;if((e|0)>0){q=0;do{p=c[(c[b+240>>2]|0)+(q<<2)>>2]|0;if(!(c[p+204>>2]&3)){n=+g[p+444>>2];h=+y(+(1.0-n),+d);i=+g[p+312>>2]*h;g[p+312>>2]=i;f=h*+g[p+316>>2];g[p+316>>2]=f;h=h*+g[p+320>>2];g[p+320>>2]=h;o=+g[p+448>>2];k=+y(+(1.0-o),+d);j=+g[p+328>>2]*k;g[p+328>>2]=j;l=k*+g[p+332>>2];g[p+332>>2]=l;k=k*+g[p+336>>2];g[p+336>>2]=k;do if(a[p+452>>0]|0){if(j*j+l*l+k*k<+g[p+464>>2]?i*i+f*f+h*h<+g[p+460>>2]:0){s=+g[p+456>>2];g[p+328>>2]=j*s;g[p+332>>2]=l*s;g[p+336>>2]=k*s;g[p+312>>2]=i*s;g[p+316>>2]=f*s;g[p+320>>2]=h*s;f=f*s;m=h*s;j=j*s;l=l*s;k=k*s;i=i*s}else m=h;h=+x(+(i*i+f*f+m*m));do if(h.004999999888241291){g[p+312>>2]=i-i*(1.0/h)*.004999999888241291;g[p+316>>2]=f-f*(1.0/h)*.004999999888241291;g[p+320>>2]=m-m*(1.0/h)*.004999999888241291;break}else{c[p+312>>2]=0;c[p+312+4>>2]=0;c[p+312+8>>2]=0;c[p+312+12>>2]=0;break}while(0);f=+x(+(j*j+l*l+k*k));if(f.004999999888241291){g[p+328>>2]=j-j*(1.0/f)*.004999999888241291;g[p+332>>2]=l-l*(1.0/f)*.004999999888241291;g[p+336>>2]=k-k*(1.0/f)*.004999999888241291;break}else{c[p+328>>2]=0;c[p+328+4>>2]=0;c[p+328+8>>2]=0;c[p+328+12>>2]=0;break}}while(0);jg(p+4|0,+g[p+312>>2],+g[p+316>>2],+g[p+320>>2],p+328|0,d,p+68|0);e=c[b+232>>2]|0}q=q+1|0}while((q|0)<(e|0))}e=c[3084]|0;b=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=b;if(b|0){sa=r;return}do if(c[e+4>>2]|0){la(r|0,0)|0;b=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[r+4>>2]|0)-(c[b+4>>2]|0)+(((c[r>>2]|0)-(c[b>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[e+16>>2]|0)){e=c[3084]|0;break}else{sa=r;return}}while(0);c[3084]=c[e+20>>2];sa=r;return}function ue(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,h=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0.0;if(!(c[a>>2]|0)){c[a>>2]=d;c[d+32>>2]=0;return}f=c[b+40>>2]|0;if(!f)l=b;else{e=+g[d>>2]+ +g[d+16>>2];j=+g[d+4>>2]+ +g[d+20>>2];k=+g[d+8>>2]+ +g[d+24>>2];do{m=c[b+36>>2]|0;n=+w(+(e-(+g[m>>2]+ +g[m+16>>2])))+ +w(+(j-(+g[m+4>>2]+ +g[m+20>>2])))+ +w(+(k-(+g[m+8>>2]+ +g[m+24>>2])));b=c[b+36+((!(n<+w(+(e-(+g[f>>2]+ +g[f+16>>2])))+ +w(+(j-(+g[f+4>>2]+ +g[f+20>>2])))+ +w(+(k-(+g[f+8>>2]+ +g[f+24>>2]))))&1)<<2)>>2]|0;f=c[b+40>>2]|0}while((f|0)!=0);l=b}m=l+32|0;h=c[m>>2]|0;b=c[a+4>>2]|0;if(!b){c[7182]=(c[7182]|0)+1;b=xb(63)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}f=b;i=f+44|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(i|0))}else c[a+4>>2]=0;c[b+32>>2]=h;c[b+36>>2]=0;f=b+40|0;c[f>>2]=0;n=+g[d>>2];k=+g[l>>2];g[b>>2]=n>2];n=+g[l+16>>2];g[b+16>>2]=k>n?k:n;n=+g[d+4>>2];k=+g[l+4>>2];g[b+4>>2]=n>2];n=+g[l+20>>2];g[b+20>>2]=k>n?k:n;n=+g[d+8>>2];k=+g[l+8>>2];g[b+8>>2]=n>2];n=+g[l+24>>2];g[b+24>>2]=k>n?k:n;if(!h){c[b+36>>2]=l;c[m>>2]=b;c[f>>2]=d;c[d+32>>2]=b;c[a>>2]=b;return}c[h+36+(((c[(c[m>>2]|0)+40>>2]|0)==(l|0)&1)<<2)>>2]=b;c[b+36>>2]=l;c[m>>2]=b;c[f>>2]=d;c[d+32>>2]=b;f=b;e=+g[b>>2];while(1){b=h+4|0;if(((((+g[h>>2]<=e?+g[b>>2]<=+g[f+4>>2]:0)?+g[h+8>>2]<=+g[f+8>>2]:0)?+g[h+16>>2]>=+g[f+16>>2]:0)?+g[h+20>>2]>=+g[f+20>>2]:0)?+g[h+24>>2]>=+g[f+24>>2]:0){b=21;break}a=c[h+36>>2]|0;d=c[h+40>>2]|0;k=+g[a>>2];e=+g[d>>2];e=k>2]=e;k=+g[a+16>>2];n=+g[d+16>>2];g[h+16>>2]=k>n?k:n;n=+g[a+4>>2];k=+g[d+4>>2];g[b>>2]=n>2];n=+g[d+20>>2];g[h+20>>2]=k>n?k:n;n=+g[a+8>>2];k=+g[d+8>>2];g[h+8>>2]=n>2];n=+g[d+24>>2];g[h+24>>2]=k>n?k:n;b=c[h+32>>2]|0;if(!b){b=21;break}else{f=h;h=b}}if((b|0)==21)return}function ve(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;c[b+16>>2]=c[a+4>>2];c[b+20>>2]=c[a+8>>2];c[b+24>>2]=c[a+12>>2];c[b+28>>2]=c[a+16>>2];c[b+32>>2]=c[a+20>>2];c[b+36>>2]=c[a+24>>2];c[b+40>>2]=c[a+28>>2];c[b+44>>2]=c[a+32>>2];c[b+48>>2]=c[a+36>>2];c[b+52>>2]=c[a+40>>2];c[b+56>>2]=c[a+44>>2];c[b+60>>2]=c[a+48>>2];c[b+64>>2]=c[a+52>>2];c[b+68>>2]=c[a+56>>2];c[b+72>>2]=c[a+60>>2];c[b+76>>2]=c[a+64>>2];c[b+80>>2]=c[a+68>>2];c[b+84>>2]=c[a+72>>2];c[b+88>>2]=c[a+76>>2];c[b+92>>2]=c[a+80>>2];c[b+96>>2]=c[a+84>>2];c[b+100>>2]=c[a+88>>2];c[b+104>>2]=c[a+92>>2];c[b+108>>2]=c[a+96>>2];c[b+112>>2]=c[a+100>>2];c[b+116>>2]=c[a+104>>2];c[b+120>>2]=c[a+108>>2];c[b+124>>2]=c[a+112>>2];c[b+128>>2]=c[a+116>>2];c[b+132>>2]=c[a+120>>2];c[b+136>>2]=c[a+124>>2];c[b+140>>2]=c[a+128>>2];c[b+144>>2]=c[a+132>>2];c[b+148>>2]=c[a+136>>2];c[b+152>>2]=c[a+140>>2];c[b+156>>2]=c[a+144>>2];c[b+160>>2]=c[a+148>>2];c[b+164>>2]=c[a+152>>2];c[b+168>>2]=c[a+156>>2];c[b+172>>2]=c[a+160>>2];c[b+176>>2]=c[a+164>>2];c[b+180>>2]=c[a+168>>2];c[b+184>>2]=c[a+172>>2];c[b+188>>2]=c[a+176>>2];c[b+224>>2]=c[a+180>>2];c[b+192>>2]=c[a+184>>2];c[b>>2]=0;c[b+4>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,c[a+192>>2]|0)|0;c[b+8>>2]=0;c[b+228>>2]=c[a+204>>2];c[b+232>>2]=c[a+208>>2];c[b+236>>2]=c[a+212>>2];c[b+240>>2]=c[a+216>>2];c[b+196>>2]=c[a+220>>2];c[b+200>>2]=c[a+224>>2];c[b+204>>2]=c[a+232>>2];c[b+208>>2]=c[a+228>>2];c[b+244>>2]=c[a+236>>2];e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b+12>>2]=f;if(!f){f=a+244|0;f=c[f>>2]|0;d=b+212|0;c[d>>2]=f;d=a+248|0;d=c[d>>2]|0;f=b+216|0;c[f>>2]=d;f=a+252|0;f=c[f>>2]|0;d=b+220|0;c[d>>2]=f;d=a+256|0;d=c[d>>2]|0;f=b+248|0;c[f>>2]=d;return 17495}Va[c[(c[d>>2]|0)+48>>2]&127](d,e);f=a+244|0;f=c[f>>2]|0;d=b+212|0;c[d>>2]=f;d=a+248|0;d=c[d>>2]|0;f=b+216|0;c[f>>2]=d;f=a+252|0;f=c[f>>2]|0;d=b+220|0;c[d>>2]=f;d=a+256|0;d=c[d>>2]|0;f=b+248|0;c[f>>2]=d;return 17495}function we(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a:do if(!(RC(b,c[d+8>>2]|0)|0)){if(!(RC(b,c[d>>2]|0)|0)){i=c[b+12>>2]|0;wn(b+16|0,d,e,f,g);if((i|0)<=1)break;h=c[b+8>>2]|0;if((h&2|0)==0?(c[d+36>>2]|0)!=1:0){if(!(h&1)){h=b+24|0;while(1){if(a[d+54>>0]|0)break a;if((c[d+36>>2]|0)==1)break a;wn(h,d,e,f,g);h=h+8|0;if(h>>>0>=(b+16+(i<<3)|0)>>>0)break a}}h=b+24|0;while(1){if(a[d+54>>0]|0)break a;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==1:0)break a;wn(h,d,e,f,g);h=h+8|0;if(h>>>0>=(b+16+(i<<3)|0)>>>0)break a}}h=b+24|0;while(1){if(a[d+54>>0]|0)break a;wn(h,d,e,f,g);h=h+8|0;if(h>>>0>=(b+16+(i<<3)|0)>>>0)break a}}if((c[d+16>>2]|0)!=(e|0)?(c[d+20>>2]|0)!=(e|0):0){c[d+32>>2]=f;if((c[d+44>>2]|0)==4)break;j=b+16+(c[b+12>>2]<<3)|0;h=0;i=b+16|0;k=0;b:while(1){if(i>>>0>=j>>>0){f=18;break}a[d+52>>0]=0;a[d+53>>0]=0;dn(i,d,e,e,1,g);if(a[d+54>>0]|0){f=18;break}do if(a[d+53>>0]|0){if(!(a[d+52>>0]|0))if(!(c[b+8>>2]&1)){h=1;f=18;break b}else{h=1;f=k;break}if((c[d+24>>2]|0)==1){f=23;break b}if(!(c[b+8>>2]&2)){f=23;break b}else{h=1;f=1}}else f=k;while(0);i=i+8|0;k=f}do if((f|0)==18){if((!k?(c[d+20>>2]=e,c[d+40>>2]=(c[d+40>>2]|0)+1,(c[d+36>>2]|0)==1):0)?(c[d+24>>2]|0)==2:0){a[d+54>>0]=1;if(h){f=23;break}else{h=4;break}}if(h)f=23;else h=4}while(0);if((f|0)==23)h=3;c[d+44>>2]=h;break}if((f|0)==1)c[d+32>>2]=1}else Er(d,e,f);while(0);return}function xe(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,k=0,l=0.0,m=0.0;if(a[b+48>>0]|0){c[d>>2]=0;c[d+4>>2]=0;return}c[d>>2]=4;c[d+4>>2]=2;kc(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);g[b+1088>>2]=0.0;a[b+297>>0]=0;l=+g[b+192>>2];m=+g[b+196>>2];do if(l<=m){h=+g[b+892>>2];i=+g[b+908>>2];f=+g[b+924>>2];f=+F(+(+g[b+832>>2]*h+ +g[b+848>>2]*i+ +g[b+864>>2]*f),+(+g[b+828>>2]*h+ +g[b+844>>2]*i+ +g[b+860>>2]*f));do if(!(l>=m)){if(f3.1415927410125732)h=(l-f)%6.2831854820251465+-6.2831854820251465;else h=(l-f)%6.2831854820251465;else h=(l-f)%6.2831854820251465+6.2831854820251465;i=+w(+h);if(!((m-f)%6.2831854820251465<-3.1415927410125732))if((m-f)%6.2831854820251465>3.1415927410125732)h=(m-f)%6.2831854820251465+-6.2831854820251465;else h=(m-f)%6.2831854820251465;else h=(m-f)%6.2831854820251465+6.2831854820251465;k=i<+w(+h);f=k?f:f+6.2831854820251465;break}if(f>m){if(!((f-m)%6.2831854820251465<-3.1415927410125732))if((f-m)%6.2831854820251465>3.1415927410125732)h=(f-m)%6.2831854820251465+-6.2831854820251465;else h=(f-m)%6.2831854820251465;else h=(f-m)%6.2831854820251465+6.2831854820251465;i=+w(+h);if(!((f-l)%6.2831854820251465<-3.1415927410125732))if((f-l)%6.2831854820251465>3.1415927410125732)h=(f-l)%6.2831854820251465+-6.2831854820251465;else h=(f-l)%6.2831854820251465;else h=(f-l)%6.2831854820251465+6.2831854820251465;k=+w(+h)>2]=f;if(f>2]=f-l;a[b+297>>0]=1;k=1;break}if(f>m){g[b+1088>>2]=f-m;a[b+297>>0]=1;k=1}else k=0}else k=0;while(0);a[b+296>>0]=0;e=c[b+1032>>2]|0;c[b+1080>>2]=e;f=+g[b+184>>2];h=+g[b+188>>2];i=(c[j>>2]=e,+g[j>>2]);do if(!(f<=h))e=32;else{if(!(hi)){e=32;break}}else f=h;g[b+1032>>2]=i-f;a[b+296>>0]=1;e=34}while(0);if((e|0)==32?(g[b+1032>>2]=0.0,a[b+1096>>0]|0):0)e=34;if((e|0)==34){c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1}if(k<<24>>24==0?(a[b+1112>>0]|0)==0:0)return;c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1;return}function ye(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0;k=sa;sa=sa+128|0;a=c[a+16>>2]|0;n=+g[a+892>>2];x=+g[a+896>>2];y=+g[a+900>>2];w=+g[a+908>>2];l=+g[a+912>>2];h=+g[a+916>>2];v=+g[b>>2];u=+g[b+4>>2];t=+g[b+8>>2];r=+g[b+16>>2];q=+g[b+20>>2];p=+g[b+24>>2];m=+g[b+32>>2];f=+g[b+36>>2];i=+g[b+40>>2];s=+g[b+48>>2];o=+g[b+52>>2];j=+g[b+56>>2];g[k>>2]=n*v+x*u+y*t+s;g[k+4>>2]=n*r+x*q+y*p+o;g[k+8>>2]=n*m+x*f+y*i+j;g[k+12>>2]=0.0;g[k+16>>2]=w*v+x*u+y*t+s;g[k+20>>2]=w*r+x*q+y*p+o;g[k+24>>2]=w*m+x*f+y*i+j;g[k+28>>2]=0.0;g[k+32>>2]=w*v+l*u+y*t+s;g[k+36>>2]=w*r+l*q+y*p+o;g[k+40>>2]=w*m+l*f+y*i+j;g[k+44>>2]=0.0;g[k+48>>2]=n*v+l*u+y*t+s;g[k+52>>2]=n*r+l*q+y*p+o;g[k+56>>2]=n*m+l*f+y*i+j;g[k+60>>2]=0.0;g[k+64>>2]=n*v+x*u+h*t+s;g[k+68>>2]=n*r+x*q+h*p+o;g[k+72>>2]=n*m+x*f+h*i+j;g[k+76>>2]=0.0;g[k+80>>2]=w*v+x*u+h*t+s;g[k+84>>2]=w*r+x*q+h*p+o;g[k+88>>2]=w*m+x*f+h*i+j;g[k+92>>2]=0.0;g[k+96>>2]=w*v+l*u+h*t+s;g[k+100>>2]=w*r+l*q+h*p+o;g[k+104>>2]=w*m+l*f+h*i+j;g[k+108>>2]=0.0;g[k+112>>2]=n*v+l*u+h*t+s;g[k+116>>2]=n*r+l*q+h*p+o;g[k+120>>2]=n*m+l*f+h*i+j;g[k+124>>2]=0.0;c[e>>2]=c[k>>2];c[e+4>>2]=c[k+4>>2];c[e+8>>2]=c[k+8>>2];c[e+12>>2]=c[k+12>>2];c[d>>2]=c[k>>2];c[d+4>>2]=c[k+4>>2];c[d+8>>2]=c[k+8>>2];c[d+12>>2]=c[k+12>>2];a=1;do{f=+g[k+(a<<4)>>2];if(f<+g[d>>2])g[d>>2]=f;h=+g[k+(a<<4)+4>>2];if(h<+g[d+4>>2])g[d+4>>2]=h;i=+g[k+(a<<4)+8>>2];if(i<+g[d+8>>2])g[d+8>>2]=i;j=+g[k+(a<<4)+12>>2];if(j<+g[d+12>>2])g[d+12>>2]=j;if(+g[e>>2]>2]=f;if(+g[e+4>>2]>2]=h;if(+g[e+8>>2]>2]=i;if(+g[e+12>>2]>2]=j;a=a+1|0}while((a|0)!=8);sa=k;return}function ze(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0;q=sa;sa=sa+64|0;dg(c[b+116>>2]|0,d,0);e=+g[d+204>>2]+ +g[d+212>>2];o=e*+g[d+56>>2]+ +g[d+40>>2];p=e*+g[d+60>>2]+ +g[d+44>>2];g[d+16>>2]=+g[d+52>>2]*e+ +g[d+36>>2];g[d+20>>2]=o;g[d+24>>2]=p;g[d+28>>2]=0.0;g[q+32>>2]=-1.0;r=c[b+100>>2]|0;r=Ka[c[(c[r>>2]|0)+8>>2]&31](r,d+36|0,d+16|0,q)|0;c[d+88>>2]=0;if(!r){c[d+32>>2]=c[d+204>>2];g[d+272>>2]=0.0;o=-+g[d+56>>2];p=-+g[d+60>>2];g[d>>2]=-+g[d+52>>2];g[d+4>>2]=o;g[d+8>>2]=p;g[d+12>>2]=0.0;p=-1.0;o=1.0;r=d+268|0;g[r>>2]=o;sa=q;return +p}p=e*+g[q+32>>2];c[d>>2]=c[q+16>>2];c[d+4>>2]=c[q+16+4>>2];c[d+8>>2]=c[q+16+8>>2];c[d+12>>2]=c[q+16+12>>2];a[d+84>>0]=1;if((a[26712]|0)==0?mz(26712)|0:0){c[q+40>>2]=0;c[q+40+4>>2]=0;c[q+40+8>>2]=0;c[q+40+12>>2]=0;Cf(28012,0.0,0,0,q+40|0)}c[7054]=c[7054]|1;g[7089]=0.0;o=+g[7099]*0.0;e=+g[7100]*0.0;g[7094]=+g[7098]*0.0;g[7095]=o;g[7096]=e;g[7097]=0.0;c[7102]=0;c[7103]=0;c[7104]=0;c[7105]=0;e=+g[7091]*0.0;o=+g[7092]*0.0;g[7143]=+g[7090]*0.0;g[7144]=e;g[7145]=o;g[7146]=0.0;c[d+88>>2]=28012;o=p-+g[d+212>>2];g[d+32>>2]=o;e=+g[d+204>>2];f=+g[d+208>>2]*.009999999776482582;h=oe+f)g[d+32>>2]=h>e+f?e+f:h;c[d+16>>2]=c[q>>2];c[d+16+4>>2]=c[q+4>>2];c[d+16+8>>2]=c[q+8>>2];c[d+16+12>>2]=c[q+12>>2];l=+g[d>>2];m=+g[d+4>>2];n=+g[d+8>>2];o=l*+g[d+52>>2]+m*+g[d+56>>2]+n*+g[d+60>>2];b=c[b+116>>2]|0;h=+g[d+16>>2]-+g[b+52>>2];i=+g[d+20>>2]-+g[b+56>>2];j=+g[d+24>>2]-+g[b+60>>2];k=+g[b+332>>2];e=+g[b+336>>2];f=+g[b+328>>2];if(!(o>=-.10000000149011612)){g[d+272>>2]=-1.0/o*(l*(k*j-i*e+ +g[b+312>>2])+m*(h*e-j*f+ +g[b+316>>2])+n*(i*f-h*k+ +g[b+320>>2]));o=-1.0/o;r=d+268|0;g[r>>2]=o;sa=q;return +p}else{g[d+272>>2]=0.0;o=10.0;r=d+268|0;g[r>>2]=o;sa=q;return +p}return 0.0}function Ae(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0;u=+g[b>>2];t=+g[b+4>>2];s=+g[b+8>>2];r=1.0/+x(+(u*u+t*t+s*s));z=+g[d>>2];y=+g[d+4>>2];w=+g[d+8>>2];v=1.0/+x(+(z*z+y*y+w*w));C=s*r*y*v-t*r*w*v;B=u*r*w*v-s*r*z*v;A=t*r*z*v-u*r*y*v;d=c[a+28>>2]|0;e=+g[d+4>>2];h=+g[d+20>>2];j=+g[d+36>>2];f=+g[d+8>>2];i=+g[d+24>>2];k=+g[d+40>>2];l=+g[d+12>>2];n=+g[d+28>>2];p=+g[d+44>>2];m=-+g[d+52>>2];o=-+g[d+56>>2];q=-+g[d+60>>2];g[a+48>>2]=j*A+(e*C+h*B);g[a+52>>2]=j*w*v+(e*z*v+h*y*v);g[a+56>>2]=e*u*r+t*r*h+s*r*j;g[a+60>>2]=0.0;g[a+64>>2]=A*k+(f*C+i*B);g[a+68>>2]=z*v*f+y*v*i+w*v*k;g[a+72>>2]=u*r*f+t*r*i+s*r*k;g[a+76>>2]=0.0;g[a+80>>2]=C*l+B*n+A*p;g[a+84>>2]=z*v*l+y*v*n+w*v*p;g[a+88>>2]=u*r*l+t*r*n+s*r*p;g[a+92>>2]=0.0;g[a+96>>2]=e*0.0+h*0.0+j*0.0+(e*m+h*o+j*q);g[a+100>>2]=f*0.0+i*0.0+k*0.0+(f*m+i*o+k*q);g[a+104>>2]=l*0.0+n*0.0+p*0.0+(l*m+n*o+p*q);g[a+108>>2]=0.0;d=c[a+32>>2]|0;q=+g[d+4>>2];p=+g[d+20>>2];o=+g[d+36>>2];n=+g[d+8>>2];m=+g[d+24>>2];l=+g[d+40>>2];k=+g[d+12>>2];i=+g[d+28>>2];f=+g[d+44>>2];j=-+g[d+52>>2];h=-+g[d+56>>2];e=-+g[d+60>>2];g[a+112>>2]=C*q+B*p+A*o;g[a+116>>2]=z*v*q+y*v*p+w*v*o;g[a+120>>2]=u*r*q+t*r*p+s*r*o;g[a+124>>2]=0.0;g[a+128>>2]=C*n+B*m+A*l;g[a+132>>2]=z*v*n+y*v*m+w*v*l;g[a+136>>2]=u*r*n+t*r*m+s*r*l;g[a+140>>2]=0.0;g[a+144>>2]=C*k+B*i+A*f;g[a+148>>2]=z*v*k+y*v*i+w*v*f;g[a+152>>2]=u*r*k+t*r*i+s*r*f;g[a+156>>2]=0.0;g[a+160>>2]=q*0.0+p*0.0+o*0.0+(q*j+p*h+o*e);g[a+164>>2]=n*0.0+m*0.0+l*0.0+(n*j+m*h+l*e);g[a+168>>2]=k*0.0+i*0.0+f*0.0+(k*j+i*h+f*e);g[a+172>>2]=0.0;tc(a,(c[a+28>>2]|0)+4|0,(c[a+32>>2]|0)+4|0);return}function Be(b){b=b|0;var d=0.0,e=0.0,f=0.0,h=0,i=0,j=0,k=0;h=sa;sa=sa+16|0;if(!(a[b+1308>>0]|0)){sa=h;return}g[b+928>>2]=0.0;g[b+992>>2]=0.0;g[b+1056>>2]=0.0;c[b+712>>2]=0;c[b+712+4>>2]=0;c[b+712+8>>2]=0;c[b+712+12>>2]=0;tc(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);Pa[c[(c[b>>2]|0)+44>>2]&511](b);d=+g[b+1284>>2];e=+g[b+1288>>2];f=+g[b+1292>>2];if(+g[b+696>>2]>=+g[b+680>>2]){k=(a[b+1300>>0]|0)==0;i=c[(k?b+1160|0:b+1096|0)>>2]|0;j=c[(k?b+1144|0:b+1080|0)>>2]|0;c[h>>2]=c[(k?b+1128|0:b+1064|0)>>2];c[h+4>>2]=j;c[h+8>>2]=i;g[h+12>>2]=0.0;Vg(c[b+28>>2]|0,c[b+32>>2]|0,b+176|0,h,d,e,f,d,e,f)}if(+g[b+700>>2]>=+g[b+684>>2]){i=(a[b+1300>>0]|0)==0;k=c[(i?b+1164|0:b+1100|0)>>2]|0;j=c[(i?b+1148|0:b+1084|0)>>2]|0;c[h>>2]=c[(i?b+1132|0:b+1068|0)>>2];c[h+4>>2]=j;c[h+8>>2]=k;g[h+12>>2]=0.0;Vg(c[b+28>>2]|0,c[b+32>>2]|0,b+260|0,h,d,e,f,d,e,f)}if(+g[b+704>>2]>=+g[b+688>>2]){i=(a[b+1300>>0]|0)==0;k=c[(i?b+1168|0:b+1104|0)>>2]|0;j=c[(i?b+1152|0:b+1088|0)>>2]|0;c[h>>2]=c[(i?b+1136|0:b+1072|0)>>2];c[h+4>>2]=j;c[h+8>>2]=k;g[h+12>>2]=0.0;Vg(c[b+28>>2]|0,c[b+32>>2]|0,b+344|0,h,d,e,f,d,e,f)}if(of(b,0)|0){c[h>>2]=c[b+1208>>2];c[h+4>>2]=c[b+1208+4>>2];c[h+8>>2]=c[b+1208+8>>2];c[h+12>>2]=c[b+1208+12>>2];_f(c[b+28>>2]|0,c[b+32>>2]|0,b+428|0,h)}if(of(b,1)|0){c[h>>2]=c[b+1224>>2];c[h+4>>2]=c[b+1224+4>>2];c[h+8>>2]=c[b+1224+8>>2];c[h+12>>2]=c[b+1224+12>>2];_f(c[b+28>>2]|0,c[b+32>>2]|0,b+512|0,h)}if(of(b,2)|0){c[h>>2]=c[b+1240>>2];c[h+4>>2]=c[b+1240+4>>2];c[h+8>>2]=c[b+1240+8>>2];c[h+12>>2]=c[b+1240+12>>2];_f(c[b+28>>2]|0,c[b+32>>2]|0,b+596|0,h)}sa=h;return}function Ce(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,y=0,z=0;d=c[a+748>>2]|0;if((d|0)!=4){c[a+748>>2]=d+1;z=d;y=(z|0)>0;z=y?z:0;a=a+4+(z*184|0)|0;Bh(a|0,b|0,184)|0;return z|0}k=+g[b+80>>2];x=+g[a+84>>2];v=x>2];t=u>2];z=+g[a+636>>2]<(s>31;k=+g[b>>2];if(d){n=+g[a+188>>2];h=+g[b+4>>2];q=+g[a+192>>2];j=+g[b+8>>2];p=+g[a+196>>2];m=+g[a+556>>2];s=+g[a+372>>2];f=+g[a+560>>2];o=+g[a+376>>2];e=+g[a+564>>2];l=+g[a+380>>2];i=((k-n)*(f-o)-(h-q)*(m-s))*((k-n)*(f-o)-(h-q)*(m-s))+(((h-q)*(e-l)-(j-p)*(f-o))*((h-q)*(e-l)-(j-p)*(f-o))+((j-p)*(m-s)-(k-n)*(e-l))*((j-p)*(m-s)-(k-n)*(e-l)));if((d|0)==1){k=k-+g[a+4>>2];u=h-+g[a+8>>2];t=j-+g[a+12>>2];h=0.0;j=p;y=7}else{t=m-s;u=f-o;r=e-l;y=6}}else{m=+g[a+556>>2];s=+g[a+372>>2];f=+g[a+560>>2];o=+g[a+376>>2];e=+g[a+564>>2];l=+g[a+380>>2];t=m-s;u=f-o;r=e-l;n=+g[a+188>>2];q=+g[a+192>>2];p=+g[a+196>>2];i=0.0;h=+g[b+4>>2];j=+g[b+8>>2];y=6}if((y|0)==6){k=k-+g[a+4>>2];h=h-+g[a+8>>2];j=j-+g[a+12>>2];x=h*r-j*u;v=j*t-k*r;r=k*u-h*t;if((d|0)==2){u=h;t=j;m=o;j=p;f=l;e=0.0;h=r*r+(x*x+v*v);y=8}else{u=h;t=j;h=r*r+(x*x+v*v);j=p;y=7}}if((y|0)==7){p=m-n;x=f-q;e=e-j;r=u*e-t*x;e=t*p-k*e;p=k*x-u*p;if(z){e=p*p+(r*r+e*e);f=0.0}else{m=o;f=l;e=p*p+(r*r+e*e);y=8}}if((y|0)==8){v=s-n;s=m-q;f=f-j;x=u*f-t*s;f=t*v-k*f;v=k*s-u*v;f=v*v+(x*x+f*f)}x=+w(+i);u=+w(+h);s=+w(+e);r=+w(+f);v=x>-999999984306749440.0?x:-999999984306749440.0;t=u>v?u:v;z=r>(s>t?s:t)?3:s>t?2:u>v?1:(x>-999999984306749440.0^1)<<31>>31;y=(z|0)>0;z=y?z:0;a=a+4+(z*184|0)|0;Bh(a|0,b|0,184)|0;return z|0}function De(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[7160]=(c[7160]|0)+1;g=c[d+24>>2]|0;if(!g){if(!((b[f+6>>1]&b[e+4>>1])<<16>>16)){d=0;return d|0}if(!((b[e+6>>1]&b[f+4>>1])<<16>>16)){d=0;return d|0}}else if(!(Ja[c[(c[g>>2]|0)+8>>2]&63](g,e,f)|0)){d=0;return d|0}l=(c[e+12>>2]|0)>(c[f+12>>2]|0);m=l?f:e;i=c[m+12>>2]|0;l=l?e:f;f=c[l+12>>2]|0;j=(f<<16|i)+~((f<<16|i)<<15)|0;j=((10?j>>10:j)^j)*9|0;j=(6?j>>6:j)^j;j=(16?j+~(j<<11)>>16:j+~(j<<11)|0)^j+~(j<<11);k=c[d+12>>2]|0;g=c[(c[d+44>>2]|0)+((j&k+-1)<<2)>>2]|0;a:do if((g|0)!=-1){h=c[d+16>>2]|0;e=g;while(1){g=h+(e<<4)|0;if((c[(c[g>>2]|0)+12>>2]|0)==(i|0)?(c[(c[h+(e<<4)+4>>2]|0)+12>>2]|0)==(f|0):0)break;e=c[(c[d+64>>2]|0)+(e<<2)>>2]|0;if((e|0)==-1)break a}return g|0}while(0);i=c[d+8>>2]|0;if((i|0)==(k|0)){h=(k|0)==0?1:k<<1;if((k|0)<(h|0)){if(!h){g=0;f=k}else{c[7182]=(c[7182]|0)+1;g=xb((h<<4|3)+16|0)|0;if(!g)g=0;else{c[(g+4+15&-16)+-4>>2]=g;g=g+4+15&-16}f=c[d+8>>2]|0}if((f|0)>0){e=0;do{n=c[d+16>>2]|0;c[g+(e<<4)>>2]=c[n+(e<<4)>>2];c[g+(e<<4)+4>>2]=c[n+(e<<4)+4>>2];c[g+(e<<4)+8>>2]=c[n+(e<<4)+8>>2];c[g+(e<<4)+12>>2]=c[n+(e<<4)+12>>2];e=e+1|0}while((e|0)!=(f|0))}e=c[d+16>>2]|0;if(e|0){if(a[d+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[d+16>>2]=0}a[d+20>>0]=1;c[d+16>>2]=g;c[d+12>>2]=h;e=c[d+8>>2]|0;g=h}else{e=k;g=k}}else{e=i;g=k}c[d+8>>2]=e+1;f=c[d+16>>2]|0;e=c[d+72>>2]|0;if(e){Ja[c[(c[e>>2]|0)+8>>2]&63](e,m,l)|0;g=c[d+12>>2]|0}if((k|0)<(g|0)){Re(d);g=(c[d+12>>2]|0)+-1&j}else g=j&k+-1;n=(c[m+12>>2]|0)<(c[l+12>>2]|0);c[f+(i<<4)>>2]=n?m:l;c[f+(i<<4)+4>>2]=n?l:m;c[f+(i<<4)+8>>2]=0;c[f+(i<<4)+8+4>>2]=0;n=(c[d+44>>2]|0)+(g<<2)|0;c[(c[d+64>>2]|0)+(i<<2)>>2]=c[n>>2];c[n>>2]=i;n=f+(i<<4)|0;return n|0}function Ee(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=sa;sa=sa+32|0;a[p+16>>0]=1;c[p+12>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;if((c[b+8>>2]|0)>0){l=0;g=0;h=0;e=0;f=0;while(1){m=c[b+16>>2]|0;n=m+(l<<4)|0;if((g|0)==(f|0)){k=(f|0)==0?1:f<<1;if((f|0)<(k|0)){if(k){c[7182]=(c[7182]|0)+1;e=xb((k<<4|3)+16|0)|0;if(!e){h=0;f=g}else{c[(e+4+15&-16)+-4>>2]=e;h=e+4+15&-16;f=g}}else h=0;if((f|0)>0){e=0;do{j=c[p+12>>2]|0;c[h+(e<<4)>>2]=c[j+(e<<4)>>2];c[h+(e<<4)+4>>2]=c[j+(e<<4)+4>>2];c[h+(e<<4)+8>>2]=c[j+(e<<4)+8>>2];c[h+(e<<4)+12>>2]=c[j+(e<<4)+12>>2];e=e+1|0}while((e|0)!=(f|0))}e=c[p+12>>2]|0;if(!e)g=f;else{if(!(a[p+16>>0]|0))g=f;else{c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[p+12>>2]=0}a[p+16>>0]=1;c[p+12>>2]=h;j=k;i=g;e=k}else{j=f;i=f}}else{j=f;i=g}c[h+(i<<4)>>2]=c[n>>2];c[h+(i<<4)+4>>2]=c[m+(l<<4)+4>>2];c[h+(i<<4)+8>>2]=c[m+(l<<4)+8>>2];c[h+(i<<4)+12>>2]=c[m+(l<<4)+12>>2];g=i+1|0;l=l+1|0;if((l|0)>=(c[b+8>>2]|0))break;else f=j}c[p+4>>2]=g;c[p+8>>2]=e;if((i|0)>-1){f=c[p+12>>2]|0;e=0;while(1){Ka[c[(c[b>>2]|0)+12>>2]&31](b,c[f+(e<<4)>>2]|0,c[f+(e<<4)+4>>2]|0,d)|0;if((e|0)<(i|0))e=e+1|0;else break}}}else g=0;if((c[b+56>>2]|0)>0){f=c[b+64>>2]|0;e=0;do{c[f+(e<<2)>>2]=-1;e=e+1|0}while((e|0)<(c[b+56>>2]|0))}if((g|0)<=1)if((g|0)<=0){e=c[p+12>>2]|0;if(!e){sa=p;return}}else o=26;else{Ed(p,0,g+-1|0);o=26}if((o|0)==26){e=c[p+12>>2]|0;f=0;do{Ja[c[(c[b>>2]|0)+8>>2]&63](b,c[e+(f<<4)>>2]|0,c[e+(f<<4)+4>>2]|0)|0;f=f+1|0}while((f|0)<(g|0))}c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);c[p+12>>2]=0;sa=p;return}function Fe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0,u=0.0,v=0.0,w=0.0,x=0;x=sa;sa=sa+32|0;r=c[a+12>>2]|0;s=+g[r+(((e+d|0)/2|0)*24|0)>>2];u=+g[r+(((e+d|0)/2|0)*24|0)+4>>2];v=+g[r+(((e+d|0)/2|0)*24|0)+8>>2];w=+g[r+(((e+d|0)/2|0)*24|0)+16>>2];t=c[r+(((e+d|0)/2|0)*24|0)+20>>2]|0;f=e;h=d;while(1){n=+g[b>>2];o=+g[b+4>>2];p=+g[b+8>>2];q=(s-n)*(s-n)+(u-o)*(u-o)+(v-p)*(v-p);a:while(1){m=r+(h*24|0)|0;i=+g[r+(h*24|0)+16>>2];do if(i!=w){if(!(i>2]-n;j=+g[r+(h*24|0)+4>>2]-o;k=+g[r+(h*24|0)+8>>2]-p;if(i*i+j*j+k*k!=q)if(i*i+j*j+k*k>2]|0)<(t|0))break;else break a}while(0);h=h+1|0}b:while(1){l=r+(f*24|0)|0;i=+g[r+(f*24|0)+16>>2];do if(w!=i){if(!(w>2]-n;j=+g[r+(f*24|0)+4>>2]-o;k=+g[r+(f*24|0)+8>>2]-p;if(q!=i*i+j*j+k*k)if(q>2]|0))break;else break b}while(0);f=f+-1|0}if((h|0)<=(f|0)){c[x>>2]=c[m>>2];c[x+4>>2]=c[m+4>>2];c[x+8>>2]=c[m+8>>2];c[x+12>>2]=c[m+12>>2];c[x+16>>2]=c[m+16>>2];c[x+20>>2]=c[m+20>>2];c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];c[m+16>>2]=c[l+16>>2];c[m+20>>2]=c[l+20>>2];r=(c[a+12>>2]|0)+(f*24|0)|0;c[r>>2]=c[x>>2];c[r+4>>2]=c[x+4>>2];c[r+8>>2]=c[x+8>>2];c[r+12>>2]=c[x+12>>2];c[r+16>>2]=c[x+16>>2];c[r+20>>2]=c[x+20>>2];f=f+-1|0;h=h+1|0}if((h|0)>(f|0))break;r=c[a+12>>2]|0}if((f|0)>(d|0))Fe(a,b,d,f);if((h|0)>=(e|0)){sa=x;return}Fe(a,b,h,e);sa=x;return}function Ge(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;j=c[a+28>>2]|0;k=c[a+32>>2]|0;h=c[b+8>>2]|0;g[h>>2]=1.0;f=c[b+24>>2]|0;g[h+(f+1<<2)>>2]=1.0;g[h+((f<<1)+2<<2)>>2]=1.0;l=+g[a+300>>2];q=+g[a+304>>2];e=+g[a+308>>2];o=+g[j+4>>2]*l+ +g[j+8>>2]*q+ +g[j+12>>2]*e;m=l*+g[j+20>>2]+q*+g[j+24>>2]+e*+g[j+28>>2];e=l*+g[j+36>>2]+q*+g[j+40>>2]+e*+g[j+44>>2];h=c[b+12>>2]|0;c[h>>2]=0;g[h+4>>2]=e;g[h+8>>2]=-m;g[h+12>>2]=0.0;g[h+(f<<2)>>2]=-e;c[h+(f<<2)+4>>2]=0;g[h+(f<<2)+8>>2]=o;g[h+(f<<2)+12>>2]=0.0;g[h+(f<<1<<2)>>2]=m;g[h+(f<<1<<2)+4>>2]=-o;c[h+(f<<1<<2)+8>>2]=0;g[h+(f<<1<<2)+12>>2]=0.0;h=c[b+16>>2]|0;g[h>>2]=-1.0;g[h+(f+1<<2)>>2]=-1.0;g[h+((f<<1)+2<<2)>>2]=-1.0;q=+g[a+316>>2];l=+g[a+320>>2];d=+g[a+324>>2];p=+g[k+4>>2]*q+ +g[k+8>>2]*l+ +g[k+12>>2]*d;n=q*+g[k+20>>2]+l*+g[k+24>>2]+d*+g[k+28>>2];d=q*+g[k+36>>2]+l*+g[k+40>>2]+d*+g[k+44>>2];h=c[b+20>>2]|0;c[h>>2]=0;g[h+4>>2]=-d;g[h+8>>2]=n;g[h+12>>2]=0.0;g[h+(f<<2)>>2]=d;c[h+(f<<2)+4>>2]=0;g[h+(f<<2)+8>>2]=-p;g[h+(f<<2)+12>>2]=0.0;g[h+(f<<1<<2)>>2]=-n;g[h+(f<<1<<2)+4>>2]=p;c[h+(f<<1<<2)+8>>2]=0;g[h+(f<<1<<2)+12>>2]=0.0;h=c[a+332>>2]|0;l=+g[((h&1|0)==0?b+4|0:a+336|0)>>2]*+g[b>>2];i=c[b+28>>2]|0;g[i>>2]=l*(p+ +g[k+52>>2]-o-+g[j+52>>2]);g[i+(f<<2)>>2]=l*(n+ +g[k+56>>2]-m-+g[j+56>>2]);g[i+(f<<1<<2)>>2]=l*(d+ +g[k+60>>2]-e-+g[j+60>>2]);if(h&2|0){k=c[b+32>>2]|0;c[k>>2]=c[a+340>>2];c[k+(f<<2)>>2]=c[a+340>>2];c[k+(f<<1<<2)>>2]=c[a+340>>2]}e=+g[a+356>>2];if(e>0.0){g[c[b+36>>2]>>2]=-e;g[c[b+40>>2]>>2]=e;d=+g[a+356>>2]}else d=e;if(d>0.0){g[(c[b+36>>2]|0)+(f<<2)>>2]=-e;g[(c[b+40>>2]|0)+(f<<2)>>2]=e;d=+g[a+356>>2]}if(!(d>0.0)){j=a+352|0;j=c[j>>2]|0;k=b+52|0;c[k>>2]=j;return}g[(c[b+36>>2]|0)+(f<<1<<2)>>2]=-e;g[(c[b+40>>2]|0)+(f<<1<<2)>>2]=e;j=a+352|0;j=c[j>>2]|0;k=b+52|0;c[k>>2]=j;return}function He(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c[7159]=(c[7159]|0)+1;j=(c[b+12>>2]|0)>(c[d+12>>2]|0);l=j?d:b;h=c[l+12>>2]|0;j=j?b:d;f=c[j+12>>2]|0;i=(f<<16|h)+~((f<<16|h)<<15)|0;i=((10?i>>10:i)^i)*9|0;i=(6?i>>6:i)^i;i=((16?i+~(i<<11)>>16:i+~(i<<11)|0)^i+~(i<<11))&(c[a+12>>2]|0)+-1;b=c[(c[a+44>>2]|0)+(i<<2)>>2]|0;if((b|0)==-1){o=0;return o|0}g=c[a+16>>2]|0;while(1){d=g+(b<<4)|0;if((c[(c[d>>2]|0)+12>>2]|0)==(h|0)?(c[(c[g+(b<<4)+4>>2]|0)+12>>2]|0)==(f|0):0)break;b=c[(c[a+64>>2]|0)+(b<<2)>>2]|0;if((b|0)==-1){b=0;o=25;break}}if((o|0)==25)return b|0;Za[c[(c[a>>2]|0)+32>>2]&127](a,d,e);n=c[g+(b<<4)+12>>2]|0;m=d-(c[a+16>>2]|0)|0;m=4?m>>4:m;h=(c[a+44>>2]|0)+(i<<2)|0;b=c[h>>2]|0;f=c[a+64>>2]|0;if((b|0)!=(m|0)){d=b;while(1){g=f+(d<<2)|0;b=c[g>>2]|0;if((b|0)==(m|0))break;else d=b}b=c[f+(m<<2)>>2]|0;if((d|0)==-1)o=12;else c[g>>2]=b}else{b=c[f+(m<<2)>>2]|0;o=12}if((o|0)==12)c[h>>2]=b;k=(c[a+8>>2]|0)+-1|0;b=c[a+72>>2]|0;if(b|0)Ka[c[(c[b>>2]|0)+12>>2]&31](b,l,j,e)|0;if((k|0)==(m|0)){c[a+8>>2]=(c[a+8>>2]|0)+-1;o=n;return o|0}j=c[a+16>>2]|0;h=c[(c[j+(k<<4)+4>>2]|0)+12>>2]<<16|c[(c[j+(k<<4)>>2]|0)+12>>2];h=((10?h+~(h<<15)>>10:h+~(h<<15)|0)^h+~(h<<15))*9|0;h=(6?h>>6:h)^h;h=((16?h+~(h<<11)>>16:h+~(h<<11)|0)^h+~(h<<11))&(c[a+12>>2]|0)+-1;i=(c[a+44>>2]|0)+(h<<2)|0;b=c[i>>2]|0;f=c[a+64>>2]|0;if((b|0)!=(k|0)){d=b;while(1){g=f+(d<<2)|0;b=c[g>>2]|0;if((b|0)==(k|0))break;else d=b}b=c[f+(k<<2)>>2]|0;if((d|0)==-1)o=23;else c[g>>2]=b}else{b=c[f+(k<<2)>>2]|0;o=23}if((o|0)==23)c[i>>2]=b;c[j+(m<<4)>>2]=c[j+(k<<4)>>2];c[j+(m<<4)+4>>2]=c[j+(k<<4)+4>>2];c[j+(m<<4)+8>>2]=c[j+(k<<4)+8>>2];c[j+(m<<4)+12>>2]=c[j+(k<<4)+12>>2];o=(c[a+44>>2]|0)+(h<<2)|0;c[(c[a+64>>2]|0)+(m<<2)>>2]=c[o>>2];c[o>>2]=m;c[a+8>>2]=(c[a+8>>2]|0)+-1;o=n;return o|0}function Ie(a,b,e){a=a|0;b=b|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0;ih(a,b,e)|0;c[b+52>>2]=c[a+552>>2];c[b+56>>2]=c[a+556>>2];c[b+60>>2]=c[a+560>>2];c[b+64>>2]=c[a+564>>2];c[b+68>>2]=c[a+568>>2];c[b+72>>2]=c[a+572>>2];c[b+76>>2]=c[a+576>>2];c[b+80>>2]=c[a+580>>2];c[b+84>>2]=c[a+584>>2];c[b+88>>2]=c[a+588>>2];c[b+92>>2]=c[a+592>>2];c[b+96>>2]=c[a+596>>2];c[b+100>>2]=c[a+600>>2];c[b+104>>2]=c[a+604>>2];c[b+108>>2]=c[a+608>>2];c[b+112>>2]=c[a+612>>2];c[b+116>>2]=c[a+616>>2];c[b+120>>2]=c[a+620>>2];c[b+124>>2]=c[a+624>>2];c[b+128>>2]=c[a+628>>2];c[b+132>>2]=c[a+632>>2];c[b+136>>2]=c[a+636>>2];c[b+140>>2]=c[a+640>>2];c[b+144>>2]=c[a+644>>2];c[b+148>>2]=c[a+648>>2];c[b+152>>2]=c[a+652>>2];c[b+156>>2]=c[a+656>>2];c[b+160>>2]=c[a+660>>2];c[b+164>>2]=c[a+664>>2];c[b+168>>2]=c[a+668>>2];c[b+172>>2]=c[a+672>>2];c[b+176>>2]=c[a+676>>2];c[b+184>>2]=d[a+736>>0];c[b+188>>2]=d[a+737>>0];c[b+196>>2]=c[a+684>>2];c[b+192>>2]=c[a+680>>2];c[b+180>>2]=d[a+740>>0];h=+g[a+688>>2];i=+g[a+692>>2];if(!((h-i)%6.2831854820251465<-3.1415927410125732))if((h-i)%6.2831854820251465>3.1415927410125732)f=(h-i)%6.2831854820251465+-6.2831854820251465;else f=(h-i)%6.2831854820251465;else f=(h-i)%6.2831854820251465+6.2831854820251465;g[b+200>>2]=f;if((h+i)%6.2831854820251465<-3.1415927410125732){i=(h+i)%6.2831854820251465+6.2831854820251465;e=b+204|0;g[e>>2]=i;e=a+696|0;e=c[e>>2]|0;j=b+208|0;c[j>>2]=e;j=a+700|0;j=c[j>>2]|0;e=b+212|0;c[e>>2]=j;a=a+704|0;a=c[a>>2]|0;b=b+216|0;c[b>>2]=a;return 17096}if(!((h+i)%6.2831854820251465>3.1415927410125732)){i=(h+i)%6.2831854820251465;j=b+204|0;g[j>>2]=i;j=a+696|0;j=c[j>>2]|0;e=b+208|0;c[e>>2]=j;e=a+700|0;e=c[e>>2]|0;j=b+212|0;c[j>>2]=e;a=a+704|0;a=c[a>>2]|0;j=b+216|0;c[j>>2]=a;return 17096}i=(h+i)%6.2831854820251465+-6.2831854820251465;j=b+204|0;g[j>>2]=i;j=a+696|0;j=c[j>>2]|0;e=b+208|0;c[e>>2]=j;e=a+700|0;e=c[e>>2]|0;j=b+212|0;c[j>>2]=e;a=a+704|0;a=c[a>>2]|0;j=b+216|0;c[j>>2]=a;return 17096}function Je(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0;B=(a[b+28>>0]|0)!=0;C=B?e:d;B=B?d:e;z=c[b+12>>2]|0;if((z|0)<=0){x=1.0;return +x}A=(c[C+192>>2]|0)+24|0;j=+g[C+4>>2];u=+g[C+8>>2];v=+g[C+12>>2];w=c[C+16>>2]|0;x=+g[C+20>>2];k=+g[C+24>>2];l=+g[C+28>>2];e=c[C+32>>2]|0;m=+g[C+36>>2];n=+g[C+40>>2];o=+g[C+44>>2];p=c[C+48>>2]|0;q=+g[C+52>>2];r=+g[C+56>>2];s=+g[C+60>>2];t=c[C+64>>2]|0;i=1.0;d=0;y=c[C+260>>2]|0;do{E=c[A>>2]|0;P=+g[E+(d*80|0)>>2];O=+g[E+(d*80|0)+16>>2];N=+g[E+(d*80|0)+32>>2];M=+g[E+(d*80|0)+4>>2];L=+g[E+(d*80|0)+20>>2];K=+g[E+(d*80|0)+36>>2];J=+g[E+(d*80|0)+8>>2];I=+g[E+(d*80|0)+24>>2];H=+g[E+(d*80|0)+40>>2];G=+g[E+(d*80|0)+48>>2];F=+g[E+(d*80|0)+52>>2];D=+g[E+(d*80|0)+56>>2];c[C+260>>2]=y+1;g[C+4>>2]=j*P+u*O+v*N;g[C+8>>2]=j*M+u*L+v*K;g[C+12>>2]=j*J+u*I+v*H;g[C+16>>2]=0.0;g[C+20>>2]=x*P+k*O+l*N;g[C+24>>2]=x*M+k*L+l*K;g[C+28>>2]=x*J+k*I+l*H;g[C+32>>2]=0.0;g[C+36>>2]=m*P+n*O+o*N;g[C+40>>2]=m*M+n*L+o*K;g[C+44>>2]=m*J+n*I+o*H;g[C+48>>2]=0.0;g[C+52>>2]=q+(j*G+u*F+v*D);g[C+56>>2]=r+(x*G+k*F+l*D);g[C+60>>2]=s+(m*G+n*F+o*D);g[C+64>>2]=0.0;E=c[(c[b+20>>2]|0)+(d<<2)>>2]|0;D=+Ba[c[(c[E>>2]|0)+12>>2]&15](E,C,B,f,h);i=D>2]|0)+1|0;c[C+260>>2]=y;g[C+4>>2]=j;g[C+8>>2]=u;g[C+12>>2]=v;c[C+16>>2]=w;g[C+20>>2]=x;g[C+24>>2]=k;g[C+28>>2]=l;c[C+32>>2]=e;g[C+36>>2]=m;g[C+40>>2]=n;g[C+44>>2]=o;c[C+48>>2]=p;g[C+52>>2]=q;g[C+56>>2]=r;g[C+60>>2]=s;c[C+64>>2]=t;d=d+1|0}while((d|0)!=(z|0));return +i}function Ke(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0;i=xs()|0;c[i+4>>2]=7;c[i+8>>2]=-1;c[i+12>>2]=-1;g[i+16>>2]=3402823466385288598117041.0e14;a[i+20>>0]=1;a[i+21>>0]=0;c[i+24>>2]=-1;c[i+28>>2]=b;c[i+32>>2]=d;g[i+36>>2]=0.0;g[i+40>>2]=.30000001192092896;c[i+44>>2]=0;c[i>>2]=7408;a[i+48>>0]=0;c[i+52>>2]=c[e>>2];c[i+52+4>>2]=c[e+4>>2];c[i+52+8>>2]=c[e+8>>2];c[i+52+12>>2]=c[e+12>>2];c[i+68>>2]=c[e+16>>2];c[i+68+4>>2]=c[e+16+4>>2];c[i+68+8>>2]=c[e+16+8>>2];c[i+68+12>>2]=c[e+16+12>>2];c[i+84>>2]=c[e+32>>2];c[i+84+4>>2]=c[e+32+4>>2];c[i+84+8>>2]=c[e+32+8>>2];c[i+84+12>>2]=c[e+32+12>>2];c[i+100>>2]=c[e+48>>2];c[i+100+4>>2]=c[e+48+4>>2];c[i+100+8>>2]=c[e+48+8>>2];c[i+100+12>>2]=c[e+48+12>>2];c[i+116>>2]=c[f>>2];c[i+116+4>>2]=c[f+4>>2];c[i+116+8>>2]=c[f+8>>2];c[i+116+12>>2]=c[f+12>>2];c[i+132>>2]=c[f+16>>2];c[i+132+4>>2]=c[f+16+4>>2];c[i+132+8>>2]=c[f+16+8>>2];c[i+132+12>>2]=c[f+16+12>>2];c[i+148>>2]=c[f+32>>2];c[i+148+4>>2]=c[f+32+4>>2];c[i+148+8>>2]=c[f+32+8>>2];c[i+148+12>>2]=c[f+32+12>>2];c[i+164>>2]=c[f+48>>2];c[i+164+4>>2]=c[f+48+4>>2];c[i+164+8>>2]=c[f+48+8>>2];c[i+164+12>>2]=c[f+48+12>>2];a[i+180>>0]=h&1;g[i+184>>2]=1.0;g[i+188>>2]=-1.0;g[i+192>>2]=0.0;g[i+196>>2]=0.0;g[i+200>>2]=1.0;g[i+204>>2]=.699999988079071;g[i+208>>2]=0.0;g[i+212>>2]=0.0;g[i+216>>2]=1.0;g[i+220>>2]=.699999988079071;g[i+224>>2]=0.0;g[i+228>>2]=0.0;g[i+264>>2]=1.0;g[i+268>>2]=.699999988079071;g[i+272>>2]=1.0;g[i+276>>2]=0.0;g[i+280>>2]=1.0;g[i+284>>2]=.699999988079071;g[i+288>>2]=1.0;g[i+292>>2]=0.0;g[i+232>>2]=1.0;g[i+236>>2]=.699999988079071;g[i+240>>2]=1.0;g[i+244>>2]=0.0;g[i+248>>2]=1.0;g[i+252>>2]=.699999988079071;g[i+256>>2]=1.0;g[i+260>>2]=0.0;a[i+1096>>0]=0;g[i+1116>>2]=0.0;g[i+1120>>2]=0.0;g[i+1124>>2]=0.0;c[i+300>>2]=0;c[i+1100>>2]=0;c[i+1100+4>>2]=0;c[i+1100+8>>2]=0;a[i+1100+12>>0]=0;a[i+49>>0]=1;kc(i,(c[i+28>>2]|0)+4|0,(c[i+32>>2]|0)+4|0);return i|0}function Le(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0,l=0,m=0.0,n=0;c[7157]=(c[7157]|0)+1;if(!(c[b+4>>2]&2))j=.019999999552965164;else{k=c[d+192>>2]|0;i=+wa[c[(c[k>>2]|0)+20>>2]&1](k,.019999999552965164);k=c[e+192>>2]|0;j=+wa[c[(c[k>>2]|0)+20>>2]&1](k,.019999999552965164);j=i>2];i=+g[e+184>>2];i=m>2]|0;h=c[f+8>>2]|0;if(!h){if(c[b+4>>2]&4|0){b=0;return b|0}c[7182]=(c[7182]|0)+1;f=xb(791)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}k=f}else{n=c[f+12>>2]|0;c[f+12>>2]=c[n>>2];c[f+8>>2]=h+-1;k=n;f=n}c[f>>2]=1025;c[k+116>>2]=0;a[k+120>>0]=0;f=k+124|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;c[k+300>>2]=0;a[k+304>>0]=0;f=k+308|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;c[k+484>>2]=0;a[k+488>>0]=0;f=k+492|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;c[k+668>>2]=0;a[k+672>>0]=0;f=k+676|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;c[k+740>>2]=d;c[k+744>>2]=e;c[k+748>>2]=0;g[k+752>>2]=j;g[k+756>>2]=i;e=k;f=c[b+12>>2]|0;c[k+768>>2]=f;if((f|0)==(c[b+16>>2]|0)?(l=(f|0)==0?1:f<<1,(f|0)<(l|0)):0){if(!l)d=0;else{c[7182]=(c[7182]|0)+1;f=xb((l<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}d=f;f=c[b+12>>2]|0}if((f|0)>0){h=0;do{c[d+(h<<2)>>2]=c[(c[b+20>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0))}h=c[b+20>>2]|0;if(h){if(a[b+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);f=c[b+12>>2]|0}c[b+20>>2]=0}a[b+24>>0]=1;c[b+20>>2]=d;c[b+16>>2]=l}c[(c[b+20>>2]|0)+(f<<2)>>2]=e;c[b+12>>2]=f+1;n=k;return n|0}function Me(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0;n=sa;sa=sa+64|0;e=c[d+192>>2]|0;ab[c[(c[e>>2]|0)+8>>2]&127](e,d+4|0,n+48|0,n+32|0);f=+g[n+48>>2]+-.019999999552965164;g[n+48>>2]=f;i=+g[n+48+4>>2]+-.019999999552965164;g[n+48+4>>2]=i;j=+g[n+48+8>>2]+-.019999999552965164;g[n+48+8>>2]=j;h=+g[n+32>>2]+.019999999552965164;g[n+32>>2]=h;k=+g[n+32+4>>2]+.019999999552965164;g[n+32+4>>2]=k;l=+g[n+32+8>>2]+.019999999552965164;g[n+32+8>>2]=l;if(((a[b+44>>0]|0)!=0?(c[d+236>>2]|0)==2:0)?(c[d+204>>2]&3|0)==0:0){e=c[d+192>>2]|0;ab[c[(c[e>>2]|0)+8>>2]&127](e,d+68|0,n+16|0,n);f=+g[n+16>>2]+-.019999999552965164;g[n+16>>2]=f;j=+g[n+16+4>>2]+-.019999999552965164;g[n+16+4>>2]=j;k=+g[n+16+8>>2]+-.019999999552965164;g[n+16+8>>2]=k;h=+g[n>>2]+.019999999552965164;g[n>>2]=h;l=+g[n+4>>2]+.019999999552965164;g[n+4>>2]=l;m=+g[n+8>>2]+.019999999552965164;g[n+8>>2]=m;i=+g[n+48>>2];if(f>2]=f;else f=i;i=+g[n+48+4>>2];if(j>2]=j;i=j}j=+g[n+48+8>>2];if(k>2]=k;j=k}k=+g[n+16+12>>2];if(k<+g[n+48+12>>2])g[n+48+12>>2]=k;k=+g[n+32>>2];if(k>2]=h;else h=k;k=+g[n+32+4>>2];if(k>2]=l;k=l}l=+g[n+32+8>>2];if(l>2]=m;l=m}m=+g[n+12>>2];if(+g[n+32+12>>2]>2]=m}e=c[b+68>>2]|0;if((c[d+204>>2]&1|0)==0?(h=h-f,k=k-i,m=l-j,!(h*h+k*k+m*m<999999995904.0)):0){if((c[d+216>>2]&-2|0)!=4)c[d+216>>2]=5;if(!(a[19314]|0)){sa=n;return}e=c[b+72>>2]|0;if(!e){sa=n;return}a[19314]=0;Va[c[(c[e>>2]|0)+36>>2]&127](e,19315);d=c[b+72>>2]|0;Va[c[(c[d>>2]|0)+36>>2]&127](d,19364);d=c[b+72>>2]|0;Va[c[(c[d>>2]|0)+36>>2]&127](d,19432);b=c[b+72>>2]|0;Va[c[(c[b>>2]|0)+36>>2]&127](b,19497);sa=n;return}eb[c[(c[e>>2]|0)+16>>2]&31](e,c[d+188>>2]|0,n+48|0,n+32|0,c[b+24>>2]|0);sa=n;return}function Ne(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0;i=fs(460)|0;jd(i,b,d,e);c[i>>2]=6632;a[i+340>>0]=1;c[i+336>>2]=0;c[i+328>>2]=0;c[i+332>>2]=0;g[i+352>>2]=1.2000000476837158;g[i+356>>2]=0.0;g[i+360>>2]=0.0;g[i+364>>2]=1.0e3;c[i+368>>2]=0;c[i+368+4>>2]=0;c[i+368+8>>2]=0;c[i+368+12>>2]=0;c[i+368+16>>2]=0;c[i+368+20>>2]=0;c[i+368+24>>2]=0;c[i+396>>2]=-1054867456;c[i+400>>2]=0;g[i+404>>2]=0.0;a[i+424>>0]=1;c[i+420>>2]=0;c[i+412>>2]=0;c[i+416>>2]=0;c[i+452>>2]=h;a[i+456>>0]=0;if(!h){c[7182]=(c[7182]|0)+1;f=xb(59)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}g[f+12>>2]=1.0;c[f+8>>2]=0;c[f+4>>2]=5;c[f>>2]=5756;a[f+36>>0]=1;c[f+32>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;a[f+16>>0]=1;c[i+452>>2]=f;a[i+456>>0]=1}c[i+344>>2]=4302;a[i+348>>0]=1;a[i+349>>0]=0;a[i+350>>0]=0;c[i+384>>2]=d;c[i+388>>2]=b;Oh(i+408|0);h=c[i+412>>2]|0;if((h|0)<=0){d=i+428|0;g[d>>2]=.25;d=i+432|0;c[d>>2]=0;d=i+436|0;c[d>>2]=0;d=i+444|0;c[d>>2]=1;d=i+448|0;c[d>>2]=1;g[i+352>>2]=1.2000000476837158;g[i+356>>2]=0.0;g[i+360>>2]=0.0;d=i+392|0;c[d>>2]=0;c[i+368>>2]=0;c[i+368+4>>2]=0;c[i+368+8>>2]=0;c[i+368+12>>2]=0;c[i+396>>2]=-1054867456;c[i+400>>2]=0;g[i+404>>2]=0.0;Oh(i+408|0);return i|0}e=0;do{d=(c[i+420>>2]|0)+(e<<2)|0;f=c[d>>2]|0;c[d>>2]=0;if(f|0)do{d=f;f=c[f+280>>2]|0;GI(d)}while((f|0)!=0);e=e+1|0}while((e|0)!=(h|0));d=i+428|0;g[d>>2]=.25;d=i+432|0;c[d>>2]=0;d=i+436|0;c[d>>2]=0;d=i+444|0;c[d>>2]=1;d=i+448|0;c[d>>2]=1;g[i+352>>2]=1.2000000476837158;g[i+356>>2]=0.0;g[i+360>>2]=0.0;d=i+392|0;c[d>>2]=0;c[i+368>>2]=0;c[i+368+4>>2]=0;c[i+368+8>>2]=0;c[i+368+12>>2]=0;c[i+396>>2]=-1054867456;c[i+400>>2]=0;g[i+404>>2]=0.0;Oh(i+408|0);return i|0}function Oe(a,b,e){a=a|0;b=b|0;e=e|0;ih(a,b,e)|0;c[b+52>>2]=c[a+48>>2];c[b+56>>2]=c[a+52>>2];c[b+60>>2]=c[a+56>>2];c[b+64>>2]=c[a+60>>2];c[b+68>>2]=c[a+64>>2];c[b+72>>2]=c[a+68>>2];c[b+76>>2]=c[a+72>>2];c[b+80>>2]=c[a+76>>2];c[b+84>>2]=c[a+80>>2];c[b+88>>2]=c[a+84>>2];c[b+92>>2]=c[a+88>>2];c[b+96>>2]=c[a+92>>2];c[b+100>>2]=c[a+96>>2];c[b+104>>2]=c[a+100>>2];c[b+108>>2]=c[a+104>>2];c[b+112>>2]=c[a+108>>2];c[b+116>>2]=c[a+112>>2];c[b+120>>2]=c[a+116>>2];c[b+124>>2]=c[a+120>>2];c[b+128>>2]=c[a+124>>2];c[b+132>>2]=c[a+128>>2];c[b+136>>2]=c[a+132>>2];c[b+140>>2]=c[a+136>>2];c[b+144>>2]=c[a+140>>2];c[b+148>>2]=c[a+144>>2];c[b+152>>2]=c[a+148>>2];c[b+156>>2]=c[a+152>>2];c[b+160>>2]=c[a+156>>2];c[b+164>>2]=c[a+160>>2];c[b+168>>2]=c[a+164>>2];c[b+172>>2]=c[a+168>>2];c[b+176>>2]=c[a+172>>2];c[b+228>>2]=c[a+868>>2];c[b+212>>2]=c[a+872>>2];c[b+196>>2]=c[a+680>>2];c[b+180>>2]=c[a+696>>2];c[b+232>>2]=c[a+932>>2];c[b+216>>2]=c[a+936>>2];c[b+200>>2]=c[a+684>>2];c[b+184>>2]=c[a+700>>2];c[b+236>>2]=c[a+996>>2];c[b+220>>2]=c[a+1e3>>2];c[b+204>>2]=c[a+688>>2];c[b+188>>2]=c[a+704>>2];c[b+244>>2]=d[a+1300>>0];c[b+248>>2]=d[a+1301>>0];c[b+276>>2]=c[a+1316>>2];c[b+324>>2]=c[a+1364>>2];c[b+252>>2]=d[a+1309>>0];c[b+300>>2]=c[a+1340>>2];c[b+280>>2]=c[a+1320>>2];c[b+328>>2]=c[a+1368>>2];c[b+256>>2]=d[a+1310>>0];c[b+304>>2]=c[a+1344>>2];c[b+284>>2]=c[a+1324>>2];c[b+332>>2]=c[a+1372>>2];c[b+260>>2]=d[a+1311>>0];c[b+308>>2]=c[a+1348>>2];c[b+288>>2]=c[a+1328>>2];c[b+336>>2]=c[a+1376>>2];c[b+264>>2]=d[a+1312>>0];c[b+312>>2]=c[a+1352>>2];c[b+292>>2]=c[a+1332>>2];c[b+340>>2]=c[a+1380>>2];c[b+268>>2]=d[a+1313>>0];c[b+316>>2]=c[a+1356>>2];c[b+296>>2]=c[a+1336>>2];c[b+344>>2]=c[a+1384>>2];c[b+272>>2]=d[a+1314>>0];c[b+320>>2]=c[a+1360>>2];return 16814}function Pe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;i=c[b+4>>2]|0;if((i|0)==(c[b+8>>2]|0)?(h=(i|0)==0?1:i<<1,(i|0)<(h|0)):0){if(!h){e=0;g=i}else{c[7182]=(c[7182]|0)+1;e=xb((h*244|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}g=c[b+4>>2]|0}if((g|0)>0){f=0;do{k=e+(f*244|0)|0;j=c[b+12>>2]|0;l=j+(f*244|0)|0;c[k>>2]=c[l>>2];c[k+4>>2]=c[l+4>>2];c[k+8>>2]=c[l+8>>2];c[k+12>>2]=c[l+12>>2];k=j+(f*244|0)+16|0;l=e+(f*244|0)+16|0;c[l>>2]=c[k>>2];c[l+4>>2]=c[k+4>>2];c[l+8>>2]=c[k+8>>2];c[l+12>>2]=c[k+12>>2];l=j+(f*244|0)+32|0;k=e+(f*244|0)+32|0;c[k>>2]=c[l>>2];c[k+4>>2]=c[l+4>>2];c[k+8>>2]=c[l+8>>2];c[k+12>>2]=c[l+12>>2];k=e+(f*244|0)+48|0;l=j+(f*244|0)+48|0;c[k>>2]=c[l>>2];c[k+4>>2]=c[l+4>>2];c[k+8>>2]=c[l+8>>2];c[k+12>>2]=c[l+12>>2];Bh(e+(f*244|0)+64|0,j+(f*244|0)+64|0,180)|0;f=f+1|0}while((f|0)!=(g|0))}f=c[b+12>>2]|0;if(f|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=h;e=c[b+4>>2]|0}else e=i;c[b+4>>2]=e+1;l=c[b+12>>2]|0;c[l+(i*244|0)>>2]=c[d>>2];c[l+(i*244|0)+4>>2]=c[d+4>>2];c[l+(i*244|0)+8>>2]=c[d+8>>2];c[l+(i*244|0)+12>>2]=c[d+12>>2];c[l+(i*244|0)+16>>2]=c[d+16>>2];c[l+(i*244|0)+16+4>>2]=c[d+16+4>>2];c[l+(i*244|0)+16+8>>2]=c[d+16+8>>2];c[l+(i*244|0)+16+12>>2]=c[d+16+12>>2];c[l+(i*244|0)+32>>2]=c[d+32>>2];c[l+(i*244|0)+32+4>>2]=c[d+32+4>>2];c[l+(i*244|0)+32+8>>2]=c[d+32+8>>2];c[l+(i*244|0)+32+12>>2]=c[d+32+12>>2];c[l+(i*244|0)+48>>2]=c[d+48>>2];c[l+(i*244|0)+48+4>>2]=c[d+48+4>>2];c[l+(i*244|0)+48+8>>2]=c[d+48+8>>2];c[l+(i*244|0)+48+12>>2]=c[d+48+12>>2];Bh(l+(i*244|0)+64|0,d+64|0,180)|0;return (c[b+12>>2]|0)+(i*244|0)|0}function Qe(a,b,d){a=a|0;b=b|0;d=+d;var e=0.0,f=0.0,h=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;i=sa;sa=sa+32|0;k=+g[a+56>>2];p=+g[a+72>>2]-k;j=+g[a+60>>2];n=+g[a+76>>2]-j;l=+g[a+64>>2];q=+g[a+80>>2]-l;m=+g[a+88>>2]-k;o=+g[a+92>>2]-j;f=+g[a+96>>2]-l;h=1.0/+x(+((p*o-n*m)*(p*o-n*m)+((n*f-q*o)*(n*f-q*o)+(q*m-p*f)*(q*m-p*f))));e=(n*f-q*o)*h;f=(q*m-p*f)*h;h=(p*o-n*m)*h;j=+g[b+8>>2]*h+(+g[b>>2]*e+ +g[b+4>>2]*f)-(l*h+(k*e+j*f));if(!(j>=-d)|!(j<=d)){b=0;sa=i;return b|0}ab[c[(c[a>>2]|0)+104>>2]&127](a,0,i+16|0,i);l=+g[i+16>>2];p=+g[i>>2]-l;n=+g[i+16+4>>2];m=+g[i+4>>2]-n;k=+g[i+16+8>>2];o=+g[i+8>>2]-k;q=1.0/+x(+((f*p-e*m)*(f*p-e*m)+((h*m-f*o)*(h*m-f*o)+(e*o-h*p)*(e*o-h*p))));if(+g[b+8>>2]*(f*p-e*m)*q+(+g[b>>2]*(h*m-f*o)*q+ +g[b+4>>2]*(e*o-h*p)*q)-(k*(f*p-e*m)*q+(l*(h*m-f*o)*q+n*(e*o-h*p)*q))<-d){b=0;sa=i;return b|0}ab[c[(c[a>>2]|0)+104>>2]&127](a,1,i+16|0,i);l=+g[i+16>>2];p=+g[i>>2]-l;n=+g[i+16+4>>2];m=+g[i+4>>2]-n;k=+g[i+16+8>>2];o=+g[i+8>>2]-k;q=1.0/+x(+((f*p-e*m)*(f*p-e*m)+((h*m-f*o)*(h*m-f*o)+(e*o-h*p)*(e*o-h*p))));if(+g[b+8>>2]*(f*p-e*m)*q+(+g[b>>2]*(h*m-f*o)*q+ +g[b+4>>2]*(e*o-h*p)*q)-(k*(f*p-e*m)*q+(l*(h*m-f*o)*q+n*(e*o-h*p)*q))<-d){b=0;sa=i;return b|0}ab[c[(c[a>>2]|0)+104>>2]&127](a,2,i+16|0,i);l=+g[i+16>>2];p=+g[i>>2]-l;n=+g[i+16+4>>2];m=+g[i+4>>2]-n;k=+g[i+16+8>>2];o=+g[i+8>>2]-k;q=1.0/+x(+((f*p-e*m)*(f*p-e*m)+((h*m-f*o)*(h*m-f*o)+(e*o-h*p)*(e*o-h*p))));if(+g[b+8>>2]*(f*p-e*m)*q+(+g[b>>2]*(h*m-f*o)*q+ +g[b+4>>2]*(e*o-h*p)*q)-(k*(f*p-e*m)*q+(l*(h*m-f*o)*q+n*(e*o-h*p)*q))<-d){b=0;sa=i;return b|0}b=1;sa=i;return b|0}function Re(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=c[b+12>>2]|0;k=c[b+36>>2]|0;if((k|0)>=(j|0))return;do if((c[b+40>>2]|0)<(j|0)){if(!j){d=0;f=k}else{c[7182]=(c[7182]|0)+1;d=xb((j<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=c[b+36>>2]|0}g=c[b+44>>2]|0;if((f|0)<=0){if(!g){a[b+48>>0]=1;c[b+44>>2]=d;c[b+40>>2]=j;i=b+44|0;break}}else{e=0;do{c[d+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}if(a[b+48>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}a[b+48>>0]=1;c[b+44>>2]=d;c[b+40>>2]=j;i=b+44|0}else{i=b+44|0;d=c[b+44>>2]|0}while(0);mk(d+(k<<2)|0,0,(j<<2)-(k<<2)|0)|0;c[b+36>>2]=j;h=c[b+56>>2]|0;if((h|0)<(j|0)){do if((c[b+60>>2]|0)<(j|0)){if(!j){d=0;f=h}else{c[7182]=(c[7182]|0)+1;d=xb((j<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=c[b+56>>2]|0}g=c[b+64>>2]|0;if((f|0)<=0){if(!g){a[b+68>>0]=1;c[b+64>>2]=d;c[b+60>>2]=j;break}}else{e=0;do{c[d+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}if(a[b+68>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}a[b+68>>0]=1;c[b+64>>2]=d;c[b+60>>2]=j}else d=c[b+64>>2]|0;while(0);mk(d+(h<<2)|0,0,(j<<2)-(h<<2)|0)|0}c[b+56>>2]=j;if((j|0)>0){mk(c[i>>2]|0,-1,j<<2|0)|0;mk(c[b+64>>2]|0,-1,j<<2|0)|0}if((k|0)<=0)return;g=c[b+16>>2]|0;e=c[i>>2]|0;f=c[b+64>>2]|0;d=0;do{j=c[(c[g+(d<<4)+4>>2]|0)+12>>2]<<16|c[(c[g+(d<<4)>>2]|0)+12>>2];j=((10?j+~(j<<15)>>10:j+~(j<<15)|0)^j+~(j<<15))*9|0;j=(6?j>>6:j)^j;j=e+((((16?j+~(j<<11)>>16:j+~(j<<11)|0)^j+~(j<<11))&(c[b+12>>2]|0)+-1)<<2)|0;c[f+(d<<2)>>2]=c[j>>2];c[j>>2]=d;d=d+1|0}while((d|0)!=(k|0));return}function Se(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0;k=sa;sa=sa+64|0;m=+g[a+20>>2];t=+g[a+40>>2];o=+g[a+24>>2];r=+g[a+36>>2];s=+g[a+32>>2];l=+g[a+16>>2];j=+g[a>>2];i=+g[a+4>>2];p=+g[a+8>>2];h=1.0/((m*t-o*r)*j+i*(o*s-t*l)+(r*l-m*s)*p);z=+g[b>>2];y=+g[b+4>>2];A=+g[b+8>>2];w=+g[b+16>>2];v=+g[b+20>>2];u=+g[b+24>>2];q=+g[b+32>>2];n=+g[b+36>>2];f=+g[b+40>>2];g[k+16>>2]=A*(r*l-m*s)*h+(z*(m*t-o*r)*h+y*(o*s-t*l)*h);g[k+16+4>>2]=A*(s*i-r*j)*h+(z*(r*p-t*i)*h+y*(t*j-s*p)*h);g[k+16+8>>2]=A*(m*j-l*i)*h+(z*(o*i-m*p)*h+y*(l*p-o*j)*h);g[k+16+12>>2]=0.0;g[k+16+16>>2]=(m*t-o*r)*h*w+(o*s-t*l)*h*v+(r*l-m*s)*h*u;g[k+16+20>>2]=(r*p-t*i)*h*w+(t*j-s*p)*h*v+(s*i-r*j)*h*u;g[k+16+24>>2]=(o*i-m*p)*h*w+(l*p-o*j)*h*v+(m*j-l*i)*h*u;g[k+16+28>>2]=0.0;g[k+16+32>>2]=(m*t-o*r)*h*q+(o*s-t*l)*h*n+(r*l-m*s)*h*f;g[k+16+36>>2]=(r*p-t*i)*h*q+(t*j-s*p)*h*n+(s*i-r*j)*h*f;g[k+16+40>>2]=(o*i-m*p)*h*q+(l*p-o*j)*h*n+(m*j-l*i)*h*f;g[k+16+44>>2]=0.0;Og(k+16|0,k);f=+g[k>>2];h=+g[k+4>>2];i=+g[k+8>>2];l=+g[k+12>>2];j=1.0/+x(+(f*f+h*h+i*i+l*l));g[k>>2]=f*j;g[k+4>>2]=h*j;g[k+8>>2]=i*j;g[k+12>>2]=l*j;l=l*j<-1.0?-1.0:l*j;g[e>>2]=+C(+(l>1.0?1.0:l))*2.0;g[d>>2]=f*j;g[d+4>>2]=h*j;g[d+8>>2]=i*j;g[d+12>>2]=0.0;if(f*j*f*j+h*j*h*j+i*j*i*j<1.4210854715202004e-14){c[d>>2]=1065353216;c[d+4>>2]=0;c[d+8>>2]=0;g[d+12>>2]=0.0;sa=k;return}else{A=1.0/+x(+(f*j*f*j+h*j*h*j+i*j*i*j));g[d>>2]=f*j*A;g[d+4>>2]=h*j*A;g[d+8>>2]=i*j*A;sa=k;return}}function Te(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;j=c[b+12>>2]|0;k=c[b+32>>2]|0;if((k|0)>=(j|0))return;do if((c[b+36>>2]|0)<(j|0)){if(!j){d=0;f=k}else{c[7182]=(c[7182]|0)+1;d=xb((j<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=c[b+32>>2]|0}g=c[b+40>>2]|0;if((f|0)<=0){if(!g){a[b+44>>0]=1;c[b+40>>2]=d;c[b+36>>2]=j;i=b+40|0;break}}else{e=0;do{c[d+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}a[b+44>>0]=1;c[b+40>>2]=d;c[b+36>>2]=j;i=b+40|0}else{i=b+40|0;d=c[b+40>>2]|0}while(0);mk(d+(k<<2)|0,0,(j<<2)-(k<<2)|0)|0;c[b+32>>2]=j;h=c[b+52>>2]|0;if((h|0)<(j|0)){do if((c[b+56>>2]|0)<(j|0)){if(!j){d=0;f=h}else{c[7182]=(c[7182]|0)+1;d=xb((j<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=c[b+52>>2]|0}g=c[b+60>>2]|0;if((f|0)<=0){if(!g){a[b+64>>0]=1;c[b+60>>2]=d;c[b+56>>2]=j;break}}else{e=0;do{c[d+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}a[b+64>>0]=1;c[b+60>>2]=d;c[b+56>>2]=j}else d=c[b+60>>2]|0;while(0);mk(d+(h<<2)|0,0,(j<<2)-(h<<2)|0)|0}c[b+52>>2]=j;if((j|0)>0){mk(c[i>>2]|0,-1,j<<2|0)|0;mk(c[b+60>>2]|0,-1,j<<2|0)|0}if((k|0)<=0)return;g=c[b+16>>2]|0;e=c[i>>2]|0;f=c[b+60>>2]|0;d=0;do{j=c[g+(d*12|0)+4>>2]<<16|c[g+(d*12|0)>>2];j=((10?j+~(j<<15)>>10:j+~(j<<15)|0)^j+~(j<<15))*9|0;j=(6?j>>6:j)^j;j=e+((((16?j+~(j<<11)>>16:j+~(j<<11)|0)^j+~(j<<11))&(c[b+12>>2]|0)+-1)<<2)|0;c[f+(d<<2)>>2]=c[j>>2];c[j>>2]=d;d=d+1|0}while((d|0)!=(k|0));return}function Ue(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=sa;sa=sa+384|0;h=c[(c[a>>2]|0)+8>>2]|0;g=JI(b)|0;ns(f+368|0,g,g+4|0,g+8|0);b=JI(d)|0;ns(f+352|0,b,g+4|0,g+8|0);ab[h&127](a,f+368|0,f+352|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+336|0,b,g+4|0,g+8|0);ns(f+320|0,b,b+4|0,g+8|0);ab[d&127](a,f+336|0,f+320|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+304|0,b,b+4|0,g+8|0);ns(f+288|0,g,b+4|0,g+8|0);ab[d&127](a,f+304|0,f+288|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+272|0,g,b+4|0,g+8|0);ns(f+256|0,g,g+4|0,g+8|0);ab[d&127](a,f+272|0,f+256|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+240|0,g,g+4|0,g+8|0);ns(f+224|0,g,g+4|0,b+8|0);ab[d&127](a,f+240|0,f+224|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+208|0,b,g+4|0,g+8|0);ns(f+192|0,b,g+4|0,b+8|0);ab[d&127](a,f+208|0,f+192|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+176|0,b,b+4|0,g+8|0);ns(f+160|0,b,b+4|0,b+8|0);ab[d&127](a,f+176|0,f+160|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+144|0,g,b+4|0,g+8|0);ns(f+128|0,g,b+4|0,b+8|0);ab[d&127](a,f+144|0,f+128|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+112|0,g,g+4|0,b+8|0);ns(f+96|0,b,g+4|0,b+8|0);ab[d&127](a,f+112|0,f+96|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+80|0,b,g+4|0,b+8|0);ns(f+64|0,b,b+4|0,b+8|0);ab[d&127](a,f+80|0,f+64|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+48|0,b,b+4|0,b+8|0);ns(f+32|0,g,b+4|0,b+8|0);ab[d&127](a,f+48|0,f+32|0,e);d=c[(c[a>>2]|0)+8>>2]|0;ns(f+16|0,g,b+4|0,b+8|0);ns(f,g,g+4|0,b+8|0);ab[d&127](a,f+16|0,f,e);sa=f;return}function Ve(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;g=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=g;if(g|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+20>>2]=c[a+72>>2];e=c[a+16>>2]|0;c[b+16>>2]=e;c[b+12>>2]=0;if(!e)return 20703;g=Ja[c[(c[d>>2]|0)+16>>2]&63](d,76,e)|0;e=c[g+8>>2]|0;c[b+12>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;if((c[b+16>>2]|0)>0){f=0;while(1){h=c[a+24>>2]|0;c[e+72>>2]=c[h+(f*80|0)+72>>2];c[e+64>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,c[h+(f*80|0)+64>>2]|0)|0;if(!(Ha[c[(c[d>>2]|0)+24>>2]&31](d,c[(c[a+24>>2]|0)+(f*80|0)+64>>2]|0)|0)){h=c[(c[d>>2]|0)+16>>2]|0;i=c[(c[a+24>>2]|0)+(f*80|0)+64>>2]|0;i=Fa[c[(c[i>>2]|0)+52>>2]&127](i)|0;i=Ja[h&63](d,i,1)|0;h=c[(c[a+24>>2]|0)+(f*80|0)+64>>2]|0;h=Ja[c[(c[h>>2]|0)+56>>2]&63](h,c[i+8>>2]|0,d)|0;eb[c[(c[d>>2]|0)+20>>2]&31](d,i,h,1346455635,c[(c[a+24>>2]|0)+(f*80|0)+64>>2]|0)}i=c[a+24>>2]|0;c[e+68>>2]=c[i+(f*80|0)+68>>2];c[e>>2]=c[i+(f*80|0)>>2];c[e+4>>2]=c[i+(f*80|0)+4>>2];c[e+8>>2]=c[i+(f*80|0)+8>>2];c[e+12>>2]=c[i+(f*80|0)+12>>2];c[e+16>>2]=c[i+(f*80|0)+16>>2];c[e+20>>2]=c[i+(f*80|0)+20>>2];c[e+24>>2]=c[i+(f*80|0)+24>>2];c[e+28>>2]=c[i+(f*80|0)+28>>2];c[e+32>>2]=c[i+(f*80|0)+32>>2];c[e+36>>2]=c[i+(f*80|0)+36>>2];c[e+40>>2]=c[i+(f*80|0)+40>>2];c[e+44>>2]=c[i+(f*80|0)+44>>2];c[e+48>>2]=c[i+(f*80|0)+48>>2];c[e+52>>2]=c[i+(f*80|0)+52>>2];c[e+56>>2]=c[i+(f*80|0)+56>>2];c[e+60>>2]=c[i+(f*80|0)+60>>2];f=f+1|0;if((f|0)>=(c[b+16>>2]|0)){e=d;break}else e=e+76|0}}else e=d;eb[c[(c[e>>2]|0)+20>>2]&31](d,g,20678,1497453121,c[g+8>>2]|0);return 20703}function We(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0;f=sa;sa=sa+256|0;c[f+32>>2]=8500;k=f+32+36|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];l=f+32+52|0;c[l>>2]=c[d>>2];c[l+4>>2]=c[d+4>>2];c[l+8>>2]=c[d+8>>2];c[l+12>>2]=c[d+12>>2];c[f+32+212>>2]=a;c[f+32+216>>2]=e;c[f+32+68>>2]=1065353216;c[f+32+72>>2]=0;c[f+32+72+4>>2]=0;c[f+32+72+8>>2]=0;c[f+32+72+12>>2]=0;c[f+32+88>>2]=1065353216;c[f+32+92>>2]=0;c[f+32+92+4>>2]=0;c[f+32+92+8>>2]=0;c[f+32+92+12>>2]=0;c[f+32+108>>2]=1065353216;c[f+32+112>>2]=0;c[f+32+116>>2]=c[k>>2];c[f+32+116+4>>2]=c[k+4>>2];c[f+32+116+8>>2]=c[k+8>>2];c[f+32+116+12>>2]=c[k+12>>2];c[f+32+132>>2]=1065353216;c[f+32+136>>2]=0;c[f+32+136+4>>2]=0;c[f+32+136+8>>2]=0;c[f+32+136+12>>2]=0;c[f+32+152>>2]=1065353216;c[f+32+156>>2]=0;c[f+32+156+4>>2]=0;c[f+32+156+8>>2]=0;c[f+32+156+12>>2]=0;c[f+32+172>>2]=1065353216;c[f+32+176>>2]=0;c[f+32+180>>2]=c[d>>2];c[f+32+180+4>>2]=c[d+4>>2];c[f+32+180+8>>2]=c[d+8>>2];c[f+32+180+12>>2]=c[d+12>>2];m=+g[d>>2]-+g[b>>2];j=+g[d+4>>2]-+g[b+4>>2];i=+g[d+8>>2]-+g[b+8>>2];h=1.0/+x(+(m*m+j*j+i*i));p=m*h==0.0?999999984306749440.0:1.0/(m*h);g[f+32+4>>2]=p;o=j*h==0.0?999999984306749440.0:1.0/(j*h);g[f+32+8>>2]=o;n=i*h==0.0?999999984306749440.0:1.0/(i*h);g[f+32+12>>2]=n;c[f+32+20>>2]=p<0.0&1;c[f+32+24>>2]=o<0.0&1;c[f+32+28>>2]=n<0.0&1;g[f+32+32>>2]=m*h*(+g[l>>2]-+g[k>>2])+j*h*(+g[f+32+56>>2]-+g[f+32+40>>2])+i*h*(+g[f+32+60>>2]-+g[f+32+44>>2]);e=c[a+68>>2]|0;a=c[(c[e>>2]|0)+24>>2]|0;c[f+16>>2]=0;c[f+16+4>>2]=0;c[f+16+8>>2]=0;c[f+16+12>>2]=0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;gb[a&7](e,b,d,f+32|0,f+16|0,f);sa=f;return}function Xe(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;h=sa;sa=sa+128|0;if(!b){sa=h;return}if(c[b+40>>2]|0){Xe(a,c[b+36>>2]|0,d+1|0,e,f);Xe(a,c[b+40>>2]|0,d+1|0,e,f)}if((d|0)<0){sa=h;return}l=+g[b>>2];q=+g[b+16>>2];j=+g[b+4>>2];p=+g[b+20>>2];i=+g[b+8>>2];o=+g[b+24>>2];k=(l+q)*.5-(q-l)*.5;m=(j+p)*.5-(p-j)*.5;n=(i+o)*.5-(o-i)*.5;l=(l+q)*.5+(q-l)*.5;j=(j+p)*.5+(p-j)*.5;i=(i+o)*.5+(o-i)*.5;f=(c[b+40>>2]|0)==0?f:e;g[h>>2]=k;g[h+4>>2]=m;g[h+8>>2]=n;g[h+12>>2]=0.0;g[h+16>>2]=l;g[h+20>>2]=m;g[h+24>>2]=n;g[h+28>>2]=0.0;g[h+32>>2]=l;g[h+36>>2]=j;g[h+40>>2]=n;g[h+44>>2]=0.0;g[h+48>>2]=k;g[h+52>>2]=j;g[h+56>>2]=n;g[h+60>>2]=0.0;g[h+64>>2]=k;g[h+68>>2]=m;g[h+72>>2]=i;g[h+76>>2]=0.0;g[h+80>>2]=l;g[h+84>>2]=m;g[h+88>>2]=i;g[h+92>>2]=0.0;g[h+96>>2]=l;g[h+100>>2]=j;g[h+104>>2]=i;g[h+108>>2]=0.0;g[h+112>>2]=k;g[h+116>>2]=j;g[h+120>>2]=i;g[h+124>>2]=0.0;ab[c[(c[a>>2]|0)+8>>2]&127](a,h,h+16|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+16|0,h+32|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+32|0,h+48|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+48|0,h,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+64|0,h+80|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+80|0,h+96|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+96|0,h+112|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+112|0,h+64|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h,h+64|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+16|0,h+80|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+32|0,h+96|0,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,h+48|0,h+112|0,f);sa=h;return}function Ye(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0;q=sa;sa=sa+96|0;l=q;m=l+96|0;do{c[l>>2]=0;l=l+4|0}while((l|0)<(m|0));if(!i)o=c[c[b+880>>2]>>2]|0;else o=i;i=c[b+772>>2]|0;if((i|0)==(c[b+776>>2]|0)?(p=(i|0)==0?1:i<<1,(i|0)<(p|0)):0){if(!p)n=0;else{c[7182]=(c[7182]|0)+1;i=xb((p*104|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}n=i;i=c[b+772>>2]|0}if((i|0)>0){j=0;do{l=n+(j*104|0)|0;k=(c[b+780>>2]|0)+(j*104|0)|0;m=l+104|0;do{c[l>>2]=c[k>>2];l=l+4|0;k=k+4|0}while((l|0)<(m|0));j=j+1|0}while((j|0)!=(i|0))}i=c[b+780>>2]|0;if(i|0){if(a[b+784>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+780>>2]=0}a[b+784>>0]=1;c[b+780>>2]=n;c[b+776>>2]=p;i=c[b+772>>2]|0}l=c[b+780>>2]|0;c[l+(i*104|0)>>2]=0;c[l+(i*104|0)+4>>2]=o;l=l+(i*104|0)+8|0;k=q;m=l+96|0;do{c[l>>2]=c[k>>2];l=l+4|0;k=k+4|0}while((l|0)<(m|0));p=c[b+772>>2]|0;c[b+772>>2]=p+1;o=c[b+780>>2]|0;k=c[b+720>>2]|0;c[o+(p*104|0)+8>>2]=k+(d*104|0);n=c[b+720>>2]|0;c[o+(p*104|0)+12>>2]=n+(e*104|0);l=c[b+720>>2]|0;c[o+(p*104|0)+16>>2]=l+(f*104|0);m=c[b+720>>2]|0;c[o+(p*104|0)+20>>2]=m+(h*104|0);y=+g[k+(d*104|0)+8>>2];v=+g[k+(d*104|0)+12>>2];z=+g[k+(d*104|0)+16>>2];s=+g[l+(f*104|0)+8>>2]-y;x=+g[l+(f*104|0)+12>>2]-v;u=+g[l+(f*104|0)+16>>2]-z;t=+g[m+(h*104|0)+8>>2]-y;w=+g[m+(h*104|0)+12>>2]-v;r=+g[m+(h*104|0)+16>>2]-z;g[o+(p*104|0)+24>>2]=(+g[n+(e*104|0)+16>>2]-z)*(s*w-x*t)+((+g[n+(e*104|0)+8>>2]-y)*(x*r-u*w)+(+g[n+(e*104|0)+12>>2]-v)*(u*t-s*r));a[b+924>>0]=1;sa=q;return}function Ze(a,b,d){a=a|0;b=+b;d=+d;var e=0.0,f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0,x=0,y=0.0;x=c[a+832>>2]|0;if((x|0)<=0)return;s=c[a+840>>2]|0;a=0;do{w=c[s+(a*56|0)>>2]|0;l=c[s+(a*56|0)+4>>2]|0;j=c[l+8>>2]|0;k=c[l+12>>2]|0;l=c[l+16>>2]|0;f=s+(a*56|0)+8|0;u=+g[f>>2];h=s+(a*56|0)+12|0;t=+g[h>>2];i=s+(a*56|0)+16|0;r=+g[i>>2];b=+g[j+8>>2]*u+ +g[k+8>>2]*t+ +g[l+8>>2]*r;d=+g[j+12>>2]*u+ +g[k+12>>2]*t+ +g[l+12>>2]*r;e=+g[j+16>>2]*u+ +g[k+16>>2]*t+ +g[l+16>>2]*r;m=+g[w+8>>2];n=+g[w+12>>2];o=+g[w+16>>2];p=m-+g[w+24>>2]-(b-(u*+g[j+24>>2]+t*+g[k+24>>2]+r*+g[l+24>>2]));q=n-+g[w+28>>2]-(d-(u*+g[j+28>>2]+t*+g[k+28>>2]+r*+g[l+28>>2]));r=o-+g[w+32>>2]-(e-(u*+g[j+32>>2]+t*+g[k+32>>2]+r*+g[l+32>>2]));t=+g[s+(a*56|0)+24>>2];u=+g[s+(a*56|0)+28>>2];v=+g[s+(a*56|0)+32>>2];if(p*t+q*u+r*v<0.0){e=+g[s+(a*56|0)+40>>2]-(m*t+n*u+o*v-(b*t+d*u+e*v));b=t*e+0.0;d=u*e+0.0;e=v*e+0.0}else{b=0.0;d=0.0;e=0.0}y=+g[s+(a*56|0)+44>>2];b=b-y*(p-t*(p*t+q*u+r*v));d=d-y*(q-u*(p*t+q*u+r*v));u=e-y*(r-v*(p*t+q*u+r*v));v=+g[s+(a*56|0)+48>>2];g[w+8>>2]=m+v*b;g[w+12>>2]=n+v*d;g[w+16>>2]=o+v*u;w=s+(a*56|0)+52|0;v=+g[w>>2]*+g[f>>2];g[j+8>>2]=+g[j+8>>2]-b*v;g[j+12>>2]=+g[j+12>>2]-d*v;g[j+16>>2]=+g[j+16>>2]-u*v;v=+g[w>>2]*+g[h>>2];g[k+8>>2]=+g[k+8>>2]-b*v;g[k+12>>2]=+g[k+12>>2]-d*v;g[k+16>>2]=+g[k+16>>2]-u*v;v=+g[w>>2]*+g[i>>2];g[l+8>>2]=+g[l+8>>2]-b*v;g[l+12>>2]=+g[l+12>>2]-d*v;g[l+16>>2]=+g[l+16>>2]-u*v;a=a+1|0}while((a|0)!=(x|0));return}function _e(a,b,c,d,e,f,h,i){a=a|0;b=+b;c=+c;d=+d;e=e|0;f=+f;h=+h;i=+i;var j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0;y=+g[e>>2];x=+g[e+16>>2];w=+g[e+32>>2];v=+g[e+4>>2];u=+g[e+20>>2];t=+g[e+36>>2];s=+g[e+8>>2];r=+g[e+24>>2];q=+g[e+40>>2];j=d-((y*0.0+x*-i+w*h)*0.0+(v*0.0+u*-i+t*h)*i+(s*0.0+r*-i+q*h)*-h)+c;o=0.0-((y*0.0+x*-i+w*h)*-i+(v*0.0+u*-i+t*h)*0.0+(s*0.0+r*-i+q*h)*f)+0.0;l=0.0-((y*0.0+x*-i+w*h)*h+(v*0.0+u*-i+t*h)*-f+(s*0.0+r*-i+q*h)*0.0)+0.0;m=0.0-((y*i+x*0.0+w*-f)*0.0+(v*i+u*0.0+t*-f)*i+(s*i+r*0.0+q*-f)*-h)+0.0;n=d-((y*i+x*0.0+w*-f)*-i+(v*i+u*0.0+t*-f)*0.0+(s*i+r*0.0+q*-f)*f)+c;k=0.0-((y*i+x*0.0+w*-f)*h+(v*i+u*0.0+t*-f)*-f+(s*i+r*0.0+q*-f)*0.0)+0.0;p=0.0-((y*-h+x*f+w*0.0)*0.0+(v*-h+u*f+t*0.0)*i+(s*-h+r*f+q*0.0)*-h)+0.0;i=0.0-((y*-h+x*f+w*0.0)*-i+(v*-h+u*f+t*0.0)*0.0+(s*-h+r*f+q*0.0)*f)+0.0;c=d-((y*-h+x*f+w*0.0)*h+(v*-h+u*f+t*0.0)*-f+(s*-h+r*f+q*0.0)*0.0)+c;d=1.0/(l*(i*m-n*p)+(j*(n*c-k*i)+o*(k*p-c*m)));g[a>>2]=(i*m-n*p)*d*0.0+(1.0/b*(n*c-k*i)*d+(k*p-c*m)*d*0.0);g[a+4>>2]=(p*o-i*j)*d*0.0+(1.0/b*(i*l-c*o)*d+(c*j-p*l)*d*0.0);g[a+8>>2]=(n*j-m*o)*d*0.0+(1.0/b*(k*o-n*l)*d+(m*l-k*j)*d*0.0);g[a+12>>2]=0.0;g[a+16>>2]=(i*m-n*p)*d*0.0+((n*c-k*i)*d*0.0+1.0/b*(k*p-c*m)*d);g[a+20>>2]=(p*o-i*j)*d*0.0+((i*l-c*o)*d*0.0+1.0/b*(c*j-p*l)*d);g[a+24>>2]=(n*j-m*o)*d*0.0+((k*o-n*l)*d*0.0+1.0/b*(m*l-k*j)*d);g[a+28>>2]=0.0;g[a+32>>2]=1.0/b*(i*m-n*p)*d+((n*c-k*i)*d*0.0+(k*p-c*m)*d*0.0);g[a+36>>2]=1.0/b*(p*o-i*j)*d+((i*l-c*o)*d*0.0+(c*j-p*l)*d*0.0);g[a+40>>2]=1.0/b*(n*j-m*o)*d+((k*o-n*l)*d*0.0+(m*l-k*j)*d*0.0);g[a+44>>2]=0.0;return}function $e(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0;f=sa;sa=sa+784|0;c[f+712>>2]=1065353216;c[f+712+4>>2]=0;c[f+712+4+4>>2]=0;c[f+712+4+8>>2]=0;c[f+712+4+12>>2]=0;c[f+712+20>>2]=1065353216;c[f+712+24>>2]=0;c[f+712+24+4>>2]=0;c[f+712+24+8>>2]=0;c[f+712+24+12>>2]=0;c[f+712+40>>2]=1065353216;e=f+712+44|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[f+536>>2]=6448;c[f+536+168>>2]=0;g[f+536+172>>2]=0.0;c[f+536+164>>2]=c[b+200>>2];e=c[b+196>>2]|0;c[f+480+8>>2]=0;c[f+480+12>>2]=1065353216;c[f+480+16>>2]=1065353216;c[f+480+20>>2]=1065353216;g[f+480+24>>2]=0.0;c[f+480>>2]=9480;c[f+480+4>>2]=8;c[f+480+28>>2]=e;c[f+480+44>>2]=e;c[f+376+8>>2]=0;c[f+376+12>>2]=1065353216;c[f+376+16>>2]=1065353216;c[f+376+20>>2]=1065353216;g[f+376+24>>2]=0.0;g[f+376+44>>2]=.03999999910593033;c[f+376+52>>2]=0;c[f+376>>2]=6476;c[f+376+4>>2]=1;c[f+376+56>>2]=c[d>>2];c[f+376+56+4>>2]=c[d+4>>2];c[f+376+56+8>>2]=c[d+8>>2];c[f+376+56+12>>2]=c[d+12>>2];c[f+376+72>>2]=c[d+16>>2];c[f+376+72+4>>2]=c[d+16+4>>2];c[f+376+72+8>>2]=c[d+16+8>>2];c[f+376+72+12>>2]=c[d+16+12>>2];c[f+376+88>>2]=c[d+32>>2];c[f+376+88+4>>2]=c[d+32+4>>2];c[f+376+88+8>>2]=c[d+32+8>>2];c[f+376+88+12>>2]=c[d+32+12>>2];g[f+16+308>>2]=9.999999747378752e-05;a[f+16+332>>0]=0;c[f>>2]=7772;c[f+4>>2]=f+16;c[f+8>>2]=f+480;c[f+12>>2]=f+376;if(rc(f,b+4|0,b+68|0,f+712|0,f+712|0,f+536|0)|0?(h=+g[f+536+164>>2],+g[b+200>>2]>h):0)g[b+200>>2]=h;c[f+376>>2]=9932;e=c[f+376+52>>2]|0;if(!e){sa=f;return}Pa[c[c[e>>2]>>2]&511](e);e=c[f+376+52>>2]|0;if(!e){sa=f;return}c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);sa=f;return}function af(d,e,f,g,h,i,j,k,l){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0;n=sa;sa=sa+48|0;c[7182]=(c[7182]|0)+1;g=xb(83)|0;if(!g)m=0;else{c[(g+4+15&-16)+-4>>2]=g;m=g+4+15&-16}c[m>>2]=h;b[m+4>>1]=i;b[m+6>>1]=j;h=m+16|0;c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];h=m+32|0;c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];c[m+8>>2]=0;h=m+56|0;c[h>>2]=0;i=m+52|0;c[i>>2]=0;c[n+16>>2]=c[e>>2];c[n+16+4>>2]=c[e+4>>2];c[n+16+8>>2]=c[e+8>>2];c[n+16+12>>2]=c[e+12>>2];c[n+16+16>>2]=c[f>>2];c[n+16+16+4>>2]=c[f+4>>2];c[n+16+16+8>>2]=c[f+8>>2];c[n+16+16+12>>2]=c[f+12>>2];c[m+60>>2]=c[d+144>>2];g=(c[d+188>>2]|0)+1|0;c[d+188>>2]=g;c[m+12>>2]=g;g=c[d+8>>2]|0;if(!g){c[7182]=(c[7182]|0)+1;g=xb(63)|0;if(!g)g=0;else{c[(g+4+15&-16)+-4>>2]=g;g=g+4+15&-16}k=g;l=k+44|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(l|0))}else c[d+8>>2]=0;c[g+32>>2]=0;c[g+36>>2]=m;c[g+40>>2]=0;c[g>>2]=c[n+16>>2];c[g+4>>2]=c[n+16+4>>2];c[g+8>>2]=c[n+16+8>>2];c[g+12>>2]=c[n+16+12>>2];c[g+16>>2]=c[n+16+16>>2];c[g+20>>2]=c[n+16+20>>2];c[g+24>>2]=c[n+16+24>>2];c[g+28>>2]=c[n+16+28>>2];ue(d+4|0,c[d+4>>2]|0,g);c[d+16>>2]=(c[d+16>>2]|0)+1;c[m+48>>2]=g;k=d+124+(c[d+144>>2]<<2)|0;c[i>>2]=0;c[h>>2]=c[k>>2];g=c[k>>2]|0;if(g|0)c[g+52>>2]=m;c[k>>2]=m;if(a[d+193>>0]|0){sa=n;return m|0}c[n>>2]=11812;c[n+4>>2]=d;c[n+8>>2]=m;le(c[d+4>>2]|0,n+16|0,n);le(c[d+64>>2]|0,n+16|0,n);sa=n;return m|0}function bf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;k=sa;sa=sa+160|0;i=c[b+12>>2]|0;if(!i){sa=k;return}l=(a[b+16>>0]|0)!=0;m=l?e:d;e=l?d:e;n=c[m+4>>2]|0;d=c[e+4>>2]|0;c[h+4>>2]=i;i=c[i+752>>2]|0;c[k+136>>2]=12212;c[k+136+4>>2]=n;c[k+136+8>>2]=d;c[k+136+12>>2]=i;g[k+128>>2]=999999984306749440.0;i=c[m+12>>2]|0;c[k>>2]=c[i>>2];c[k+4>>2]=c[i+4>>2];c[k+8>>2]=c[i+8>>2];c[k+12>>2]=c[i+12>>2];c[k+16>>2]=c[i+16>>2];c[k+16+4>>2]=c[i+16+4>>2];c[k+16+8>>2]=c[i+16+8>>2];c[k+16+12>>2]=c[i+16+12>>2];c[k+32>>2]=c[i+32>>2];c[k+32+4>>2]=c[i+32+4>>2];c[k+32+8>>2]=c[i+32+8>>2];c[k+32+12>>2]=c[i+32+12>>2];c[k+48>>2]=c[i+48>>2];c[k+48+4>>2]=c[i+48+4>>2];c[k+48+8>>2]=c[i+48+8>>2];c[k+48+12>>2]=c[i+48+12>>2];i=c[e+12>>2]|0;c[k+64>>2]=c[i>>2];c[k+64+4>>2]=c[i+4>>2];c[k+64+8>>2]=c[i+8>>2];c[k+64+12>>2]=c[i+12>>2];c[k+80>>2]=c[i+16>>2];c[k+80+4>>2]=c[i+16+4>>2];c[k+80+8>>2]=c[i+16+8>>2];c[k+80+12>>2]=c[i+16+12>>2];c[k+96>>2]=c[i+32>>2];c[k+96+4>>2]=c[i+32+4>>2];c[k+96+8>>2]=c[i+32+8>>2];c[k+96+12>>2]=c[i+32+12>>2];c[k+112>>2]=c[i+48>>2];c[k+112+4>>2]=c[i+48+4>>2];c[k+112+8>>2]=c[i+48+8>>2];c[k+112+12>>2]=c[i+48+12>>2];dd(k+136|0,k,h,c[f+20>>2]|0,l);do if(a[b+8>>0]|0?(j=c[h+4>>2]|0,c[j+748>>2]|0):0){b=c[j+740>>2]|0;d=c[(c[h+8>>2]|0)+8>>2]|0;if((b|0)==(d|0)){re(j,b+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(j,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,d+4|0);break}}while(0);sa=k;return}function cf(a){a=a|0;var b=0,d=0,e=0,f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0;d=c[a+752>>2]|0;if((d|0)>0){e=c[a+760>>2]|0;b=0;do{f=c[e+(b*44|0)+8>>2]|0;h=c[e+(b*44|0)+12>>2]|0;i=c[e+(b*44|0)+16>>2]|0;l=+g[f+8>>2];n=+g[f+12>>2];j=+g[f+16>>2];k=+g[h+8>>2]-l;o=+g[h+12>>2]-n;m=+g[h+16>>2]-j;l=+g[i+8>>2]-l;n=+g[i+12>>2]-n;j=+g[i+16>>2]-j;g[e+(b*44|0)+36>>2]=+x(+((k*n-o*l)*(k*n-o*l)+((o*j-m*n)*(o*j-m*n)+(m*l-k*j)*(m*l-k*j))));b=b+1|0}while((b|0)!=(d|0))}d=c[a+712>>2]|0;if((d|0)>0){c[7182]=(c[7182]|0)+1;b=xb((d<<2|3)+16|0)|0;if(!b)e=0;else{c[(b+4+15&-16)+-4>>2]=b;e=b+4+15&-16}mk(e|0,0,d<<2|0)|0;f=c[a+712>>2]|0;if((f|0)>0){d=c[a+720>>2]|0;b=0;do{g[d+(b*104|0)+92>>2]=0.0;b=b+1|0}while((b|0)!=(f|0));i=e;h=e;b=f}else{i=e;h=e;b=f}}else{i=0;h=0;b=d}f=c[a+752>>2]|0;if((f|0)>0){d=c[a+760>>2]|0;e=c[a+720>>2]|0;b=0;do{o=+w(+(+g[d+(b*44|0)+36>>2]));p=c[d+(b*44|0)+8>>2]|0;q=i+(((p-e|0)/104|0)<<2)|0;c[q>>2]=(c[q>>2]|0)+1;g[p+92>>2]=o+ +g[p+92>>2];p=c[d+(b*44|0)+12>>2]|0;q=i+(((p-e|0)/104|0)<<2)|0;c[q>>2]=(c[q>>2]|0)+1;g[p+92>>2]=o+ +g[p+92>>2];p=c[d+(b*44|0)+16>>2]|0;q=i+(((p-e|0)/104|0)<<2)|0;c[q>>2]=(c[q>>2]|0)+1;g[p+92>>2]=o+ +g[p+92>>2];b=b+1|0}while((b|0)!=(f|0));b=c[a+712>>2]|0}if((b|0)>0){d=0;do{e=c[i+(d<<2)>>2]|0;if((e|0)>0){q=(c[a+720>>2]|0)+(d*104|0)+92|0;g[q>>2]=+g[q>>2]/+(e|0)}else g[(c[a+720>>2]|0)+(d*104|0)+92>>2]=0.0;d=d+1|0}while((d|0)!=(b|0));if(!h)return}else if((i|0)==0|(h|0)==0)return;c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);return}function df(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;e=c[a+56>>2]|0;if(!e){e=c[a+52>>2]|0;if(!e){c[7182]=(c[7182]|0)+1;e=xb(31)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[a+60>>2]|0;c[e+4>>2]=f;g=e+8|0;c[g>>2]=0;c[7182]=(c[7182]|0)+1;f=xb((f*24|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}c[e>>2]=f;c[g>>2]=c[a+48>>2];c[a+48>>2]=e}else c[a+52>>2]=c[e+8>>2];h=c[e>>2]|0;g=c[e+4>>2]|0;if((g|0)>0?(c[h>>2]=(g|0)!=1?h+24|0:0,(g|0)!=1):0){e=1;f=h+24|0;do{e=e+1|0;i=(e|0)<(g|0);j=f;f=f+24|0;c[j>>2]=i?f:0}while(i)}}else h=e;c[a+56>>2]=c[h>>2];c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;e=c[a+56>>2]|0;if(!e){e=c[a+52>>2]|0;if(!e){c[7182]=(c[7182]|0)+1;e=xb(31)|0;if(!e)f=0;else{c[(e+4+15&-16)+-4>>2]=e;f=e+4+15&-16}e=c[a+60>>2]|0;c[f+4>>2]=e;g=f+8|0;c[g>>2]=0;c[7182]=(c[7182]|0)+1;e=xb((e*24|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[f>>2]=e;c[g>>2]=c[a+48>>2];c[a+48>>2]=f}else{c[a+52>>2]=c[e+8>>2];f=e}e=c[f>>2]|0;i=c[f+4>>2]|0;if((i|0)>0?(c[e>>2]=(i|0)!=1?e+24|0:0,(i|0)!=1):0){f=1;g=e+24|0;do{f=f+1|0;j=(f|0)<(i|0);k=g;g=g+24|0;c[k>>2]=j?g:0}while(j)}}c[a+56>>2]=c[e>>2];k=e;c[k>>2]=0;c[k+4>>2]=0;c[h+8>>2]=e;c[e+8>>2]=h;k=c[a+100>>2]|0;c[h+20>>2]=k;c[e+20>>2]=k;c[h+12>>2]=d;c[e+12>>2]=b;c[h+16>>2]=0;c[e+16>>2]=0;e=c[a+116>>2]|0;c[a+116>>2]=e+1;if((e|0)<(c[a+120>>2]|0))return h|0;c[a+120>>2]=e+1;return h|0}function ef(a,d){a=a|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0;e=sa;sa=sa+128|0;F=c[(c[a+8>>2]|0)+24>>2]|0;h=c[F+(d*80|0)+64>>2]|0;f=c[a+12>>2]|0;w=+g[F+(d*80|0)>>2];C=+g[f>>2];v=+g[F+(d*80|0)+16>>2];B=+g[f+4>>2];u=+g[F+(d*80|0)+32>>2];A=+g[f+8>>2];t=+g[F+(d*80|0)+4>>2];s=+g[F+(d*80|0)+20>>2];r=+g[F+(d*80|0)+36>>2];q=+g[F+(d*80|0)+8>>2];o=+g[F+(d*80|0)+24>>2];m=+g[F+(d*80|0)+40>>2];z=+g[f+16>>2];y=+g[f+20>>2];x=+g[f+24>>2];p=+g[f+32>>2];n=+g[f+36>>2];l=+g[f+40>>2];E=+g[F+(d*80|0)+48>>2];D=+g[F+(d*80|0)+52>>2];i=+g[F+(d*80|0)+56>>2];k=+g[f+48>>2]+(C*E+B*D+A*i);j=z*E+y*D+x*i+ +g[f+52>>2];i=p*E+n*D+l*i+ +g[f+56>>2];g[e+56>>2]=w*C+v*B+u*A;g[e+56+4>>2]=C*t+B*s+A*r;g[e+56+8>>2]=C*q+B*o+A*m;g[e+56+12>>2]=0.0;g[e+56+16>>2]=w*z+v*y+u*x;g[e+56+20>>2]=t*z+s*y+r*x;g[e+56+24>>2]=q*z+o*y+m*x;g[e+56+28>>2]=0.0;g[e+56+32>>2]=w*p+v*n+u*l;g[e+56+36>>2]=t*p+s*n+r*l;g[e+56+40>>2]=q*p+o*n+m*l;g[e+56+44>>2]=0.0;g[e+56+48>>2]=k;g[e+56+52>>2]=j;g[e+56+56>>2]=i;g[e+56+60>>2]=0.0;f=c[a+4>>2]|0;c[e+32>>2]=0;c[e+32+4>>2]=h;c[e+32+8>>2]=f;c[e+32+12>>2]=e+56;c[e+32+16>>2]=-1;c[e+32+20>>2]=d;f=c[a+24>>2]|0;g[e+4>>2]=1.0;c[e+8>>2]=0;b[e+12>>1]=1;b[e+14>>1]=-1;c[e+16>>2]=0;c[e>>2]=8604;c[e+20>>2]=f;c[e+24>>2]=d;c[e+4>>2]=c[f+4>>2];c[e+16>>2]=c[f+16>>2];_b(c[a+16>>2]|0,c[a+20>>2]|0,e+32|0,e);sa=e;return}function ff(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0;i=sa;sa=sa+80|0;h=+va[c[(c[a>>2]|0)+48>>2]&15](a);f=0;do{p=i+64+(f<<2)|0;c[i+64>>2]=0;c[i+64+4>>2]=0;c[i+64+8>>2]=0;c[i+64+12>>2]=0;g[p>>2]=1.0;j=c[(c[a>>2]|0)+64>>2]|0;k=+g[i+64>>2];l=+g[i+64+4>>2];m=+g[i+64+8>>2];n=k*+g[b+4>>2]+l*+g[b+20>>2]+m*+g[b+36>>2];o=k*+g[b+8>>2]+l*+g[b+24>>2]+m*+g[b+40>>2];g[i+32>>2]=+g[b>>2]*k+ +g[b+16>>2]*l+ +g[b+32>>2]*m;g[i+32+4>>2]=n;g[i+32+8>>2]=o;g[i+32+12>>2]=0.0;Za[j&127](i+48|0,a,i+32|0);o=+g[i+48>>2];n=+g[i+48+4>>2];m=+g[i+48+8>>2];l=o*+g[b+16>>2]+n*+g[b+20>>2]+m*+g[b+24>>2]+ +g[b+52>>2];k=o*+g[b+32>>2]+n*+g[b+36>>2]+m*+g[b+40>>2]+ +g[b+56>>2];g[i+32>>2]=o*+g[b>>2]+n*+g[b+4>>2]+m*+g[b+8>>2]+ +g[b+48>>2];g[i+32+4>>2]=l;g[i+32+8>>2]=k;g[i+32+12>>2]=0.0;j=i+32+(f<<2)|0;g[e+(f<<2)>>2]=h+ +g[j>>2];g[p>>2]=-1.0;p=c[(c[a>>2]|0)+64>>2]|0;k=+g[i+64>>2];l=+g[i+64+4>>2];m=+g[i+64+8>>2];n=k*+g[b+4>>2]+l*+g[b+20>>2]+m*+g[b+36>>2];o=k*+g[b+8>>2]+l*+g[b+24>>2]+m*+g[b+40>>2];g[i>>2]=+g[b>>2]*k+ +g[b+16>>2]*l+ +g[b+32>>2]*m;g[i+4>>2]=n;g[i+8>>2]=o;g[i+12>>2]=0.0;Za[p&127](i+16|0,a,i);o=+g[i+16>>2];n=+g[i+16+4>>2];m=+g[i+16+8>>2];l=o*+g[b+16>>2]+n*+g[b+20>>2]+m*+g[b+24>>2]+ +g[b+52>>2];k=o*+g[b+32>>2]+n*+g[b+36>>2]+m*+g[b+40>>2]+ +g[b+56>>2];g[i+32>>2]=o*+g[b>>2]+n*+g[b+4>>2]+m*+g[b+8>>2]+ +g[b+48>>2];g[i+32+4>>2]=l;g[i+32+8>>2]=k;g[i+32+12>>2]=0.0;g[d+(f<<2)>>2]=+g[j>>2]-h;f=f+1|0}while((f|0)!=3);sa=i;return}function gf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0;k=sa;sa=sa+144|0;i=c[b+12>>2]|0;if(!i){sa=k;return}m=c[d+4>>2]|0;l=c[e+4>>2]|0;c[h+4>>2]=i;g[k+12+128>>2]=999999984306749440.0;i=c[d+12>>2]|0;c[k+12>>2]=c[i>>2];c[k+12+4>>2]=c[i+4>>2];c[k+12+8>>2]=c[i+8>>2];c[k+12+12>>2]=c[i+12>>2];c[k+12+16>>2]=c[i+16>>2];c[k+12+16+4>>2]=c[i+16+4>>2];c[k+12+16+8>>2]=c[i+16+8>>2];c[k+12+16+12>>2]=c[i+16+12>>2];c[k+12+32>>2]=c[i+32>>2];c[k+12+32+4>>2]=c[i+32+4>>2];c[k+12+32+8>>2]=c[i+32+8>>2];c[k+12+32+12>>2]=c[i+32+12>>2];c[k+12+48>>2]=c[i+48>>2];c[k+12+48+4>>2]=c[i+48+4>>2];c[k+12+48+8>>2]=c[i+48+8>>2];c[k+12+48+12>>2]=c[i+48+12>>2];i=c[e+12>>2]|0;c[k+12+64>>2]=c[i>>2];c[k+12+64+4>>2]=c[i+4>>2];c[k+12+64+8>>2]=c[i+8>>2];c[k+12+64+12>>2]=c[i+12>>2];c[k+12+80>>2]=c[i+16>>2];c[k+12+80+4>>2]=c[i+16+4>>2];c[k+12+80+8>>2]=c[i+16+8>>2];c[k+12+80+12>>2]=c[i+16+12>>2];c[k+12+96>>2]=c[i+32>>2];c[k+12+96+4>>2]=c[i+32+4>>2];c[k+12+96+8>>2]=c[i+32+8>>2];c[k+12+96+12>>2]=c[i+32+12>>2];c[k+12+112>>2]=c[i+48>>2];c[k+12+112+4>>2]=c[i+48+4>>2];c[k+12+112+8>>2]=c[i+48+8>>2];c[k+12+112+12>>2]=c[i+48+12>>2];c[k>>2]=12192;c[k+4>>2]=m;c[k+8>>2]=l;vb(k,k+12|0,h,c[f+20>>2]|0,0);do if(a[b+8>>0]|0?(j=c[h+4>>2]|0,c[j+748>>2]|0):0){b=c[j+740>>2]|0;d=c[(c[h+8>>2]|0)+8>>2]|0;if((b|0)==(d|0)){re(j,b+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(j,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,d+4|0);break}}while(0);sa=k;return}function hf(b,d,e,f,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0;q=sa;sa=sa+80|0;g[q+16+60>>2]=0.0;g[q+16+8>>2]=0.0;g[q+16+12>>2]=.10000000149011612;g[q+16+16>>2]=300.0;g[q+16>>2]=1.0;g[q+16+4>>2]=-1.0;g[q+16+28>>2]=0.0;g[q+16+32>>2]=.20000000298023224;g[q+16+36>>2]=0.0;g[q+16+40>>2]=0.0;g[q+16+20>>2]=1.0;g[q+16+24>>2]=.5;c[q+16+56>>2]=0;g[q+16+48>>2]=0.0;a[q+16+44>>0]=0;o=0;do{n=c[b+856+(o<<2)>>2]|0;m=a[b+788+o>>0]|0;if(!n){if(m<<24>>24){m=1;p=5}}else p=5;if((p|0)==5){p=0;g[q+16+40>>2]=0.0;c[q+16+56>>2]=n;c[q+16+52>>2]=c[b+840+(o<<2)>>2];c[q+16+48>>2]=c[b+824+(o<<2)>>2];c[q+16+20>>2]=c[b+732>>2];a[q+16+44>>0]=m;c[q+16+4>>2]=c[b+696+(o<<2)>>2];c[q+16+24>>2]=c[b+728>>2];c[q+16>>2]=c[b+680+(o<<2)>>2];g[q+16+16>>2]=0.0;c[q+16+12>>2]=c[b+808+(o<<2)>>2];c[q+16+8>>2]=c[b+792+(o<<2)>>2];c[q>>2]=c[b+1064+(o<<2)>>2];c[q+4>>2]=c[b+1080+(o<<2)>>2];c[q+8>>2]=c[b+1096+(o<<2)>>2];g[q+12>>2]=0.0;n=c[b+1304>>2]|0;m=o*3|0;n=m?n>>m:n;if(!(n&1))m=c[d+32>>2]|0;else m=b+740+(o<<2)|0;c[q+16+28>>2]=c[m>>2];if(!(n&2))m=c[d+32>>2]|0;else m=b+772+(o<<2)|0;c[q+16+36>>2]=c[m>>2];c[q+16+32>>2]=c[((n&4|0)==0?d+4|0:b+756+(o<<2)|0)>>2];if(a[b+1301>>0]|0){n=o+1|0;if(!(c[b+868+(((n|0)==3?0:n)<<6)+56>>2]|0))m=1;else m=(c[b+868+((((o+2|0)>>>0)%3|0)<<6)+56>>2]|0)==0&1}else m=0;e=(Kc(b,q+16|0,f,h,i,j,k,l,d,e,q,0,m)|0)+e|0}o=o+1|0}while((o|0)!=3);sa=q;return e|0}function jf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0;b=sa;sa=sa+608|0;o=+g[d+116>>2]-+g[d+52>>2];n=+g[d+120>>2]-+g[d+56>>2];m=+g[d+124>>2]-+g[d+60>>2];i=+g[e+116>>2]-+g[e+52>>2];j=+g[e+120>>2]-+g[e+56>>2];k=+g[e+124>>2]-+g[e+60>>2];l=+g[d+252>>2];if(o*o+n*n+m*m>2],i*i+j*j+k*k>2]|0;f=c[e+248>>2]|0;c[b+552+8>>2]=0;c[b+552+12>>2]=1065353216;c[b+552+16>>2]=1065353216;c[b+552+20>>2]=1065353216;g[b+552+24>>2]=0.0;c[b+552>>2]=9480;c[b+552+4>>2]=8;c[b+552+28>>2]=f;c[b+552+44>>2]=f;c[b+376>>2]=6448;g[b+376+164>>2]=999999984306749440.0;c[b+376+168>>2]=0;g[b+376+172>>2]=0.0;g[b+16+308>>2]=9.999999747378752e-05;a[b+16+332>>0]=0;c[b>>2]=12048;c[b+4>>2]=b+16;c[b+8>>2]=h;c[b+12>>2]=b+552;if(Lc(b,d+4|0,d+68|0,e+4|0,e+68|0,b+376|0)|0){i=+g[b+376+164>>2];if(+g[d+244>>2]>i)g[d+244>>2]=i;if(+g[e+244>>2]>i)g[e+244>>2]=i;if(!(i<1.0))i=1.0}else i=1.0;h=c[e+192>>2]|0;f=c[d+248>>2]|0;c[b+552+8>>2]=0;c[b+552+12>>2]=1065353216;c[b+552+16>>2]=1065353216;c[b+552+20>>2]=1065353216;g[b+552+24>>2]=0.0;c[b+552>>2]=9480;c[b+552+4>>2]=8;c[b+552+28>>2]=f;c[b+552+44>>2]=f;c[b+376>>2]=6448;g[b+376+164>>2]=999999984306749440.0;c[b+376+168>>2]=0;g[b+376+172>>2]=0.0;g[b+16+308>>2]=9.999999747378752e-05;a[b+16+332>>0]=0;c[b>>2]=12048;c[b+4>>2]=b+16;c[b+8>>2]=b+552;c[b+12>>2]=h;if(Lc(b,d+4|0,d+68|0,e+4|0,e+68|0,b+376|0)|0){j=+g[b+376+164>>2];if(+g[d+244>>2]>j)g[d+244>>2]=j;if(+g[e+244>>2]>j)g[e+244>>2]=j;if(i>j)i=j}o=i;sa=b;return +o}function kf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0,G=0.0,H=0;H=sa;sa=sa+32|0;j=+g[b+16>>2];f=+g[b>>2];k=+g[b+20>>2];h=+g[b+4>>2];m=+g[b+24>>2];i=+g[b+8>>2];q=+g[b+32>>2];u=+g[b+36>>2];v=+g[b+40>>2];B=(k-h)*(v-i)-(m-i)*(u-h);C=(m-i)*(q-f)-(j-f)*(v-i);D=(j-f)*(u-h)-(k-h)*(q-f);g[H+16>>2]=B;g[H+16+4>>2]=C;g[H+16+8>>2]=D;g[H+16+12>>2]=0.0;n=+g[a+4>>2];r=+g[a+8>>2];w=+g[a+12>>2];E=B*n+C*r+D*w-(i*D+(f*B+h*C));o=+g[a+20>>2];s=+g[a+24>>2];y=+g[a+28>>2];if(E*(B*o+C*s+D*y-(i*D+(f*B+h*C)))>=0.0){sa=H;return}F=c[a+36>>2]|0;if(E<=0.0&(F&1|0)!=0){sa=H;return}G=E/(E-(B*o+C*s+D*y-(i*D+(f*B+h*C))));if(!(G<+g[a+40>>2])){sa=H;return}A=(D*D+(B*B+C*C))*-9.999999747378752e-05;z=f-(o*G+n*(1.0-G));t=h-(s*G+r*(1.0-G));p=i-(y*G+w*(1.0-G));l=j-(o*G+n*(1.0-G));k=k-(s*G+r*(1.0-G));j=m-(y*G+w*(1.0-G));if(!(D*(k*z-t*l)+(B*(t*j-p*k)+C*(p*l-j*z))>=A)){sa=H;return}i=q-(o*G+n*(1.0-G));h=u-(s*G+r*(1.0-G));f=v-(y*G+w*(1.0-G));if(!(D*(h*l-k*i)+(B*(k*f-j*h)+C*(j*i-f*l))>=A)){sa=H;return}if(!(D*(t*i-h*z)+(B*(h*p-f*t)+C*(f*z-p*i))>=A)){sa=H;return}f=1.0/+x(+(D*D+(B*B+C*C)));g[H+16>>2]=B*f;g[H+16+4>>2]=C*f;g[H+16+8>>2]=D*f;b=c[(c[a>>2]|0)+12>>2]|0;if(E<=0.0&(F&2|0)==0){g[H>>2]=-(B*f);g[H+4>>2]=-(C*f);g[H+8>>2]=-(D*f);g[H+12>>2]=0.0;g[a+40>>2]=+xa[b&3](a,H,G,d,e);sa=H;return}else{g[a+40>>2]=+xa[b&3](a,H+16|0,G,d,e);sa=H;return}}function lf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=+h;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0;B=sa;sa=sa+96|0;m=+g[e+4>>2];n=+g[e+20>>2];o=+g[e+36>>2];p=+g[e+8>>2];q=+g[e+24>>2];r=+g[e+40>>2];s=+g[e+12>>2];t=+g[e+28>>2];u=+g[e+44>>2];v=-+g[e+52>>2];w=-+g[e+56>>2];x=-+g[e+60>>2];k=c[b+720>>2]|0;y=+g[k+(d*104|0)+8>>2];z=+g[k+(d*104|0)+12>>2];A=+g[k+(d*104|0)+16>>2];a:do if(f){f=c[b+268>>2]|0;b:do if((f|0)>0){j=c[b+276>>2]|0;i=0;while(1){if((c[j+(i<<2)>>2]|0)==(e|0))break;i=i+1|0;if((i|0)>=(f|0))break b}if((i|0)!=(f|0)){f=k;break a}}while(0);if((f|0)==(c[b+272>>2]|0)?(l=(f|0)==0?1:f<<1,(f|0)<(l|0)):0){if(!l)j=0;else{c[7182]=(c[7182]|0)+1;f=xb((l<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=f;f=c[b+268>>2]|0}if((f|0)>0){i=0;do{c[j+(i<<2)>>2]=c[(c[b+276>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(f|0))}i=c[b+276>>2]|0;if(i){if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);f=c[b+268>>2]|0}c[b+276>>2]=0}a[b+280>>0]=1;c[b+276>>2]=j;c[b+272>>2]=l}c[(c[b+276>>2]|0)+(f<<2)>>2]=e;c[b+268>>2]=f+1;f=c[b+720>>2]|0}else f=k;while(0);c[B>>2]=f+(d*104|0);c[B+20>>2]=e;g[B+4>>2]=m*v+n*w+o*x+(m*y+n*z+o*A);g[B+8>>2]=p*v+q*w+r*x+(p*y+q*z+r*A);g[B+12>>2]=s*v+t*w+u*x+(s*y+t*z+u*A);g[B+16>>2]=0.0;e=f+(d*104|0)+100|0;a[e>>0]=a[e>>0]|1;g[B+24>>2]=h;Km(b+788|0,B);sa=B;return}function mf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0;p=sa;sa=sa+48|0;if((f|0)==(d|0)|((d|0)==(e|0)|(e|0)==(f|0))){sa=p;return}k=p;l=k+36|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(l|0));if(!h)n=c[c[b+880>>2]>>2]|0;else n=h;h=c[b+752>>2]|0;if((h|0)==(c[b+756>>2]|0)?(o=(h|0)==0?1:h<<1,(h|0)<(o|0)):0){if(!o)m=0;else{c[7182]=(c[7182]|0)+1;h=xb((o*44|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}m=h;h=c[b+752>>2]|0}if((h|0)>0){i=0;do{k=m+(i*44|0)|0;j=(c[b+760>>2]|0)+(i*44|0)|0;l=k+44|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(l|0));i=i+1|0}while((i|0)!=(h|0))}h=c[b+760>>2]|0;if(h|0){if(a[b+764>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+760>>2]=0}a[b+764>>0]=1;c[b+760>>2]=m;c[b+756>>2]=o;h=c[b+752>>2]|0}k=c[b+760>>2]|0;c[k+(h*44|0)>>2]=0;c[k+(h*44|0)+4>>2]=n;k=k+(h*44|0)+8|0;j=p;l=k+36|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(l|0));o=c[b+752>>2]|0;c[b+752>>2]=o+1;n=c[b+760>>2]|0;k=c[b+720>>2]|0;c[n+(o*44|0)+8>>2]=k+(d*104|0);l=c[b+720>>2]|0;c[n+(o*44|0)+12>>2]=l+(e*104|0);m=c[b+720>>2]|0;c[n+(o*44|0)+16>>2]=m+(f*104|0);s=+g[k+(d*104|0)+8>>2];u=+g[k+(d*104|0)+12>>2];q=+g[k+(d*104|0)+16>>2];r=+g[l+(e*104|0)+8>>2]-s;v=+g[l+(e*104|0)+12>>2]-u;t=+g[l+(e*104|0)+16>>2]-q;s=+g[m+(f*104|0)+8>>2]-s;u=+g[m+(f*104|0)+12>>2]-u;q=+g[m+(f*104|0)+16>>2]-q;g[n+(o*44|0)+36>>2]=+x(+((r*u-v*s)*(r*u-v*s)+((v*q-t*u)*(v*q-t*u)+(t*s-r*q)*(t*s-r*q))));a[b+924>>0]=1;sa=p;return}function nf(a,b,d,e,f,h,i,j,k,l,m){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;h=+h;i=+i;j=+j;k=k|0;l=l|0;m=+m;var n=0.0,o=0.0,p=0,q=0,r=0.0,s=0.0;q=sa;sa=sa+208|0;Co(q+192|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],+g[e>>2],+g[e+4>>2],+g[e+8>>2]);p=(~~((j-i)/(m*.01745329238474369))|0)==0?1:~~((j-i)/(m*.01745329238474369));yy(q+128|0,f,+g[e>>2],+g[e+4>>2],+g[e+8>>2]);m=+zI(i);Wp(q+144|0,+g[q+128>>2],+g[q+128+4>>2],+g[q+128+8>>2],m);qp(q+160|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[q+144>>2],+g[q+144+4>>2],+g[q+144+8>>2]);m=+g[q+192>>2];n=+g[q+192+4>>2];o=+g[q+192+8>>2];yy(q+96|0,h,m,n,o);r=+yI(i);Wp(q+112|0,+g[q+96>>2],+g[q+96+4>>2],+g[q+96+8>>2],r);qp(q+176|0,+g[q+160>>2],+g[q+160+4>>2],+g[q+160+8>>2],+g[q+112>>2],+g[q+112+4>>2],+g[q+112+8>>2]);if(l)ab[c[(c[a>>2]|0)+8>>2]&127](a,b,q+176|0,k);d=1;while(1){if((d|0)>(p|0))break;r=(j-i)*+(d|0)/+(p|0)+i;yy(q+32|0,f,+g[e>>2],+g[e+4>>2],+g[e+8>>2]);s=+zI(r);Wp(q+48|0,+g[q+32>>2],+g[q+32+4>>2],+g[q+32+8>>2],s);qp(q+64|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[q+48>>2],+g[q+48+4>>2],+g[q+48+8>>2]);yy(q,h,m,n,o);r=+yI(r);Wp(q+16|0,+g[q>>2],+g[q+4>>2],+g[q+8>>2],r);qp(q+80|0,+g[q+64>>2],+g[q+64+4>>2],+g[q+64+8>>2],+g[q+16>>2],+g[q+16+4>>2],+g[q+16+8>>2]);ab[c[(c[a>>2]|0)+8>>2]&127](a,q+176|0,q+80|0,k);c[q+176>>2]=c[q+80>>2];c[q+176+4>>2]=c[q+80+4>>2];c[q+176+8>>2]=c[q+80+8>>2];c[q+176+12>>2]=c[q+80+12>>2];d=d+1|0}if(!l){sa=q;return}ab[c[(c[a>>2]|0)+8>>2]&127](a,b,q+176|0,k);sa=q;return}function of(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0;e=+g[b+1192+(d<<2)>>2];i=+g[b+868+(d<<6)>>2];j=+g[b+868+(d<<6)+4>>2];do if(!(i>=j)){if(e3.1415927410125732)f=(i-e)%6.2831854820251465+-6.2831854820251465;else f=(i-e)%6.2831854820251465;else f=(i-e)%6.2831854820251465+6.2831854820251465;h=+w(+f);if(!((j-e)%6.2831854820251465<-3.1415927410125732))if((j-e)%6.2831854820251465>3.1415927410125732)f=(j-e)%6.2831854820251465+-6.2831854820251465;else f=(j-e)%6.2831854820251465;else f=(j-e)%6.2831854820251465+6.2831854820251465;m=h<+w(+f);e=m?e:e+6.2831854820251465;break}if(e>j){if(!((e-j)%6.2831854820251465<-3.1415927410125732))if((e-j)%6.2831854820251465>3.1415927410125732)f=(e-j)%6.2831854820251465+-6.2831854820251465;else f=(e-j)%6.2831854820251465;else f=(e-j)%6.2831854820251465+6.2831854820251465;h=+w(+f);if(!((e-i)%6.2831854820251465<-3.1415927410125732))if((e-i)%6.2831854820251465>3.1415927410125732)f=(e-i)%6.2831854820251465+-6.2831854820251465;else f=(e-i)%6.2831854820251465;else f=(e-i)%6.2831854820251465+6.2831854820251465;m=+w(+f)>2]=e;do if(!(i>j)){if(i>e){c[b+868+(d<<6)+56>>2]=1;e=e-i;g[b+868+(d<<6)+48>>2]=e;if(e>3.1415927410125732){g[b+868+(d<<6)+48>>2]=e+-6.2831854820251465;break}if(!(e<-3.1415927410125732))break;g[b+868+(d<<6)+48>>2]=e+6.2831854820251465;break}if(j>2]=2;e=e-j;g[b+868+(d<<6)+48>>2]=e;if(e>3.1415927410125732){g[b+868+(d<<6)+48>>2]=e+-6.2831854820251465;break}if(e<-3.1415927410125732)g[b+868+(d<<6)+48>>2]=e+6.2831854820251465}else{k=b+868+(d<<6)+56|0;l=34}}else{k=b+868+(d<<6)+56|0;l=34}while(0);if((l|0)==34?(c[k>>2]=0,(a[b+868+(d<<6)+44>>0]|0)==0):0){m=0;return m|0}m=1;return m|0}function pf(b,d){b=b|0;d=+d;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0;l=sa;sa=sa+16|0;Ki(16371);e=c[b+232>>2]|0;if((e|0)>0){k=(a[29312]|0)==0;j=0;do{i=c[(c[b+240>>2]|0)+(j<<2)>>2]|0;a:do if(i){f=c[i+216>>2]|0;b:do switch(f|0){case 4:case 2:{if((f|0)==4)break a;break}default:{p=+g[i+312>>2];o=+g[i+316>>2];n=+g[i+320>>2];m=+g[i+472>>2];if(p*p+o*o+n*n>2],n=+g[i+332>>2],o=+g[i+336>>2],p=+g[i+476>>2],m*m+n*n+o*o>2]=+g[i+220>>2]+d;break b}g[i+220>>2]=0.0;if((f&-2|0)!=4){c[i+216>>2]=0;f=0}}}while(0);h=f&-2;do if(k){if((h|0)!=2?!(+g[i+220>>2]>2.0):0)break;if(c[i+204>>2]&3|0){if((h|0)==4)break a;c[i+216>>2]=2;break a}if((f|0)==1){c[i+216>>2]=3;break a}if((f|0)!=2)break a;e=(c[i+260>>2]|0)+2|0;c[i+328>>2]=0;c[i+328+4>>2]=0;c[i+328+8>>2]=0;c[i+328+12>>2]=0;c[i+260>>2]=e;c[i+312>>2]=0;c[i+312+4>>2]=0;c[i+312+8>>2]=0;c[i+312+12>>2]=0;e=c[b+232>>2]|0;break a}while(0);if((h|0)!=4)c[i+216>>2]=1}while(0);j=j+1|0}while((j|0)<(e|0))}e=c[3084]|0;k=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=k;if(k|0){sa=l;return}do if(c[e+4>>2]|0){la(l|0,0)|0;k=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[l+4>>2]|0)-(c[k+4>>2]|0)+(((c[l>>2]|0)-(c[k>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[e+16>>2]|0)){e=c[3084]|0;break}else{sa=l;return}}while(0);c[3084]=c[e+20>>2];sa=l;return}function qf(a,b,d){a=a|0;b=+b;d=+d;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0.0,n=0,o=0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0.0,x=0.0,y=0.0;u=sa;sa=sa+16|0;p=+g[a+452>>2];n=c[a+192>>2]|0;m=+va[c[(c[n>>2]|0)+48>>2]&15](n);n=c[a+812>>2]|0;if((n|0)<=0){sa=u;return}l=0;do{o=c[a+820>>2]|0;k=c[o+(l*104|0)>>2]|0;k=(c[k+236>>2]&2|0)==0?0:k;if(k|0){t=+g[k+332>>2];e=+g[o+(l*104|0)+84>>2];j=+g[k+336>>2];r=+g[o+(l*104|0)+80>>2];f=+g[o+(l*104|0)+76>>2];s=+g[k+328>>2];d=p*(t*e-j*r+ +g[k+312>>2]);e=p*(+g[k+316>>2]+(j*f-e*s));f=p*(r*s-t*f+ +g[k+320>>2])}else{d=0.0;e=0.0;f=0.0}q=c[o+(l*104|0)+24>>2]|0;r=+g[q+8>>2];s=+g[q+12>>2];t=+g[q+16>>2];j=r-+g[q+24>>2]-d;i=s-+g[q+28>>2]-e;d=t-+g[q+32>>2]-f;e=+g[o+(l*104|0)+4>>2];f=+g[o+(l*104|0)+8>>2];h=+g[o+(l*104|0)+12>>2];if(j*e+i*f+d*h<=1.1920928955078125e-07?(x=r*e+s*f+t*h+ +g[o+(l*104|0)+20>>2],y=+g[o+(l*104|0)+96>>2],x=(x>2],w=(j-(j-e*(j*e+i*f+d*h))*y+e*x)*b,v=(i-(i-f*(j*e+i*f+d*h))*y+f*x)*b,i=(d-(d-h*(j*e+i*f+d*h))*y+h*x)*b,f=+g[o+(l*104|0)+36>>2]*i+(+g[o+(l*104|0)+28>>2]*w+ +g[o+(l*104|0)+32>>2]*v),h=w*+g[o+(l*104|0)+44>>2]+v*+g[o+(l*104|0)+48>>2]+i*+g[o+(l*104|0)+52>>2],i=w*+g[o+(l*104|0)+60>>2]+v*+g[o+(l*104|0)+64>>2]+i*+g[o+(l*104|0)+68>>2],g[u>>2]=f,g[u+4>>2]=h,g[u+8>>2]=i,g[u+12>>2]=0.0,j=+g[o+(l*104|0)+92>>2],g[q+8>>2]=r-f*j,g[q+12>>2]=s-h*j,g[q+16>>2]=t-i*j,k|0):0)Bk(k,u,o+(l*104|0)+76|0);l=l+1|0}while((l|0)!=(n|0));sa=u;return}function rf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0.0;f=sa;sa=sa+224|0;sp(f+192|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],+g[b>>2],+g[b+4>>2],+g[b+8>>2]);Wp(f+208|0,+g[f+192>>2],+g[f+192+4>>2],+g[f+192+8>>2],.5);qp(f+160|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],+g[b>>2],+g[b+4>>2],+g[b+8>>2]);Wp(f+176|0,+g[f+160>>2],+g[f+160+4>>2],+g[f+160+8>>2],.5);g[f+136>>2]=1.0;g[f+132>>2]=1.0;g[f+128>>2]=1.0;ns(f+144|0,f+136|0,f+132|0,f+128|0);d=0;while(1){if((d|0)==4)break;b=0;while(1){if((b|0)==3)break;i=JI(f+144|0)|0;k=+g[i>>2];h=JI(f+208|0)|0;g[f+72>>2]=k*+g[h>>2];g[f+68>>2]=+g[i+4>>2]*+g[h+4>>2];g[f+64>>2]=+g[i+8>>2]*+g[h+8>>2];ns(f+80|0,f+72|0,f+68|0,f+64|0);c[f+112>>2]=c[f+80>>2];c[f+112+4>>2]=c[f+80+4>>2];c[f+112+8>>2]=c[f+80+8>>2];c[f+112+12>>2]=c[f+80+12>>2];Hr(f+112|0,f+176|0)|0;j=i+(((b>>>0)%3|0)<<2)|0;g[j>>2]=-+g[j>>2];g[f+40>>2]=+g[i>>2]*+g[h>>2];g[f+36>>2]=+g[i+4>>2]*+g[h+4>>2];g[f+32>>2]=+g[i+8>>2]*+g[h+8>>2];ns(f+48|0,f+40|0,f+36|0,f+32|0);c[f+96>>2]=c[f+48>>2];c[f+96+4>>2]=c[f+48+4>>2];c[f+96+8>>2]=c[f+48+8>>2];c[f+96+12>>2]=c[f+48+12>>2];Hr(f+96|0,f+176|0)|0;ab[c[(c[a>>2]|0)+8>>2]&127](a,f+112|0,f+96|0,e);b=b+1|0}g[f+8>>2]=-1.0;g[f+4>>2]=-1.0;g[f>>2]=-1.0;ns(f+16|0,f+8|0,f+4|0,f);c[f+144>>2]=c[f+16>>2];c[f+144+4>>2]=c[f+16+4>>2];c[f+144+8>>2]=c[f+16+8>>2];c[f+144+12>>2]=c[f+16+12>>2];if(d>>>0<3){j=(JI(f+144|0)|0)+(d<<2)|0;g[j>>2]=-+g[j>>2]}d=d+1|0}sa=f;return}function sf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0;c[b+4>>2]=1065353216;c[b+8>>2]=1065353216;c[b+12>>2]=1065353216;g[b+16>>2]=0.0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;c[b+48>>2]=0;c[b>>2]=11360;a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;a[b+140>>0]=1;c[b+136>>2]=0;c[b+128>>2]=0;c[b+132>>2]=0;a[b+160>>0]=1;c[b+156>>2]=0;c[b+148>>2]=0;c[b+152>>2]=0;a[b+164>>0]=d&1;a[b+165>>0]=e&1;g[b+168>>2]=0.0;c[7182]=(c[7182]|0)+1;d=xb(51)|0;if(!d)f=0;else{c[(d+4+15&-16)+-4>>2]=d;f=d+4+15&-16}e=c[b+24>>2]|0;if((e|0)>0){d=0;do{h=f+(d<<5)|0;i=(c[b+32>>2]|0)+(d<<5)|0;c[h>>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];c[h+16>>2]=c[i+16>>2];c[h+20>>2]=c[i+20>>2];c[h+24>>2]=c[i+24>>2];c[h+28>>2]=c[i+28>>2];d=d+1|0}while((d|0)!=(e|0))}d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=f;c[b+28>>2]=1;i=c[b+24>>2]|0;c[f+(i<<5)>>2]=0;c[f+(i<<5)+4>>2]=0;c[f+(i<<5)+8>>2]=12;c[f+(i<<5)+12>>2]=0;c[f+(i<<5)+16>>2]=0;c[f+(i<<5)+20>>2]=16;c[f+(i<<5)+24>>2]=2;c[f+(i<<5)+28>>2]=0;c[b+24>>2]=(c[b+24>>2]|0)+1;i=(a[b+164>>0]|0)==0;d=c[b+32>>2]|0;c[d>>2]=(c[(i?b+148|0:b+128|0)>>2]|0)/3|0;c[d+4>>2]=0;c[d+24>>2]=i?3:2;c[d+8>>2]=i?6:12;if(!(a[b+165>>0]|0)){h=12;b=(c[b+108>>2]|0)/3|0;i=d+12|0;c[i>>2]=b;i=d+16|0;c[i>>2]=0;i=d+20|0;c[i>>2]=h;return}else{h=16;b=c[b+88>>2]|0;i=d+12|0;c[i>>2]=b;i=d+16|0;c[i>>2]=0;i=d+20|0;c[i>>2]=h;return}}function tf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;f=Cs()|0;_i(f,4,b);c[f>>2]=7516;c[f+552>>2]=c[d>>2];c[f+552+4>>2]=c[d+4>>2];c[f+552+8>>2]=c[d+8>>2];c[f+552+12>>2]=c[d+12>>2];c[f+568>>2]=c[d+16>>2];c[f+568+4>>2]=c[d+16+4>>2];c[f+568+8>>2]=c[d+16+8>>2];c[f+568+12>>2]=c[d+16+12>>2];c[f+584>>2]=c[d+32>>2];c[f+584+4>>2]=c[d+32+4>>2];c[f+584+8>>2]=c[d+32+8>>2];c[f+584+12>>2]=c[d+32+12>>2];c[f+600>>2]=c[d+48>>2];c[f+600+4>>2]=c[d+48+4>>2];c[f+600+8>>2]=c[d+48+8>>2];c[f+600+12>>2]=c[d+48+12>>2];c[f+616>>2]=c[d>>2];c[f+616+4>>2]=c[d+4>>2];c[f+616+8>>2]=c[d+8>>2];c[f+616+12>>2]=c[d+12>>2];c[f+632>>2]=c[d+16>>2];c[f+632+4>>2]=c[d+16+4>>2];c[f+632+8>>2]=c[d+16+8>>2];c[f+632+12>>2]=c[d+16+12>>2];c[f+648>>2]=c[d+32>>2];c[f+648+4>>2]=c[d+32+4>>2];c[f+648+8>>2]=c[d+32+8>>2];c[f+648+12>>2]=c[d+32+12>>2];c[f+664>>2]=c[d+48>>2];c[f+664+4>>2]=c[d+48+4>>2];c[f+664+8>>2]=c[d+48+8>>2];c[f+664+12>>2]=c[d+48+12>>2];g[f+688>>2]=0.0;g[f+692>>2]=-1.0;g[f+696>>2]=.8999999761581421;g[f+700>>2]=.30000001192092896;g[f+704>>2]=1.0;g[f+708>>2]=0.0;g[f+712>>2]=0.0;a[f+716>>0]=0;a[f+736>>0]=0;a[f+737>>0]=0;a[f+738>>0]=0;a[f+739>>0]=1;a[f+740>>0]=e&1;c[f+748>>2]=0;d=c[f+28>>2]|0;l=+g[f+600>>2];k=+g[f+604>>2];j=+g[f+608>>2];i=l*+g[d+20>>2]+k*+g[d+24>>2]+j*+g[d+28>>2]+ +g[d+56>>2];h=l*+g[d+36>>2]+k*+g[d+40>>2]+j*+g[d+44>>2]+ +g[d+60>>2];g[f+664>>2]=l*+g[d+4>>2]+k*+g[d+8>>2]+j*+g[d+12>>2]+ +g[d+52>>2];g[f+668>>2]=i;g[f+672>>2]=h;g[f+676>>2]=0.0;g[f+732>>2]=e?-1.0:1.0;return f|0}function uf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;m=sa;sa=sa+32|0;if((b|0)<0)b=c[a+12>>2]|0;d=c[a>>2]|0;if(!((b|0)>0&(d|0)!=0)){sa=m;return}while(1){e=d+40|0;if(c[e>>2]|0){l=0;while(1){g=d+32|0;h=c[g>>2]|0;if(h>>>0>d>>>0){i=(c[h+40>>2]|0)==(d|0);j=c[h+36+(((i^1)&1)<<2)>>2]|0;k=c[h+32>>2]|0;if(!k)f=a;else f=k+36+(((c[k+40>>2]|0)==(h|0)&1)<<2)|0;c[f>>2]=d;c[j+32>>2]=d;c[h+32>>2]=d;c[g>>2]=k;k=d+36|0;c[h+36>>2]=c[k>>2];c[h+40>>2]=c[e>>2];c[(c[k>>2]|0)+32>>2]=h;c[(c[e>>2]|0)+32>>2]=h;c[d+36+((i&1)<<2)>>2]=h;c[d+36+(((i^1)&1)<<2)>>2]=j;c[m>>2]=c[h>>2];c[m+4>>2]=c[h+4>>2];c[m+8>>2]=c[h+8>>2];c[m+12>>2]=c[h+12>>2];c[m+16>>2]=c[h+16>>2];c[m+20>>2]=c[h+20>>2];c[m+24>>2]=c[h+24>>2];c[m+28>>2]=c[h+28>>2];c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];c[h+16>>2]=c[d+16>>2];c[h+20>>2]=c[d+20>>2];c[h+24>>2]=c[d+24>>2];c[h+28>>2]=c[d+28>>2];c[d>>2]=c[m>>2];c[d+4>>2]=c[m+4>>2];c[d+8>>2]=c[m+8>>2];c[d+12>>2]=c[m+12>>2];c[d+16>>2]=c[m+16>>2];c[d+20>>2]=c[m+20>>2];c[d+24>>2]=c[m+24>>2];c[d+28>>2]=c[m+28>>2];d=h}e=c[a+16>>2]|0;d=c[d+36+(((l?e>>>l:e)&1)<<2)>>2]|0;e=d+40|0;if(!(c[e>>2]|0))break;else l=l+1&31}}if(!(sg(a,d)|0))e=0;else e=c[a>>2]|0;ue(a,e,d);c[a+16>>2]=(c[a+16>>2]|0)+1;b=b+-1|0;if(!b)break;d=c[a>>2]|0}sa=m;return}function vf(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;e=Cs()|0;_i(e,4,b);c[e>>2]=7516;c[e+552>>2]=c[d>>2];c[e+552+4>>2]=c[d+4>>2];c[e+552+8>>2]=c[d+8>>2];c[e+552+12>>2]=c[d+12>>2];c[e+568>>2]=c[d+16>>2];c[e+568+4>>2]=c[d+16+4>>2];c[e+568+8>>2]=c[d+16+8>>2];c[e+568+12>>2]=c[d+16+12>>2];c[e+584>>2]=c[d+32>>2];c[e+584+4>>2]=c[d+32+4>>2];c[e+584+8>>2]=c[d+32+8>>2];c[e+584+12>>2]=c[d+32+12>>2];c[e+600>>2]=c[d+48>>2];c[e+600+4>>2]=c[d+48+4>>2];c[e+600+8>>2]=c[d+48+8>>2];c[e+600+12>>2]=c[d+48+12>>2];c[e+616>>2]=c[d>>2];c[e+616+4>>2]=c[d+4>>2];c[e+616+8>>2]=c[d+8>>2];c[e+616+12>>2]=c[d+12>>2];c[e+632>>2]=c[d+16>>2];c[e+632+4>>2]=c[d+16+4>>2];c[e+632+8>>2]=c[d+16+8>>2];c[e+632+12>>2]=c[d+16+12>>2];c[e+648>>2]=c[d+32>>2];c[e+648+4>>2]=c[d+32+4>>2];c[e+648+8>>2]=c[d+32+8>>2];c[e+648+12>>2]=c[d+32+12>>2];c[e+664>>2]=c[d+48>>2];c[e+664+4>>2]=c[d+48+4>>2];c[e+664+8>>2]=c[d+48+8>>2];c[e+664+12>>2]=c[d+48+12>>2];g[e+688>>2]=0.0;g[e+692>>2]=-1.0;g[e+696>>2]=.8999999761581421;g[e+700>>2]=.30000001192092896;g[e+704>>2]=1.0;g[e+708>>2]=0.0;g[e+712>>2]=0.0;a[e+716>>0]=0;a[e+736>>0]=0;a[e+737>>0]=0;a[e+738>>0]=0;a[e+739>>0]=1;a[e+740>>0]=0;c[e+748>>2]=0;d=c[e+28>>2]|0;k=+g[e+600>>2];j=+g[e+604>>2];i=+g[e+608>>2];h=k*+g[d+20>>2]+j*+g[d+24>>2]+i*+g[d+28>>2]+ +g[d+56>>2];f=k*+g[d+36>>2]+j*+g[d+40>>2]+i*+g[d+44>>2]+ +g[d+60>>2];g[e+664>>2]=k*+g[d+4>>2]+j*+g[d+8>>2]+i*+g[d+12>>2]+ +g[d+52>>2];g[e+668>>2]=h;g[e+672>>2]=f;g[e+676>>2]=0.0;g[e+732>>2]=1.0;return e|0}function wf(b){b=b|0;var d=0,e=0.0,f=0,h=0,i=0.0,j=0.0,k=0;k=sa;sa=sa+64|0;Ki(16541);a:do if(!(a[b+274>>0]|0)){d=c[b+232>>2]|0;if((d|0)>0){h=0;while(1){f=c[(c[b+240>>2]|0)+(h<<2)>>2]|0;switch(c[f+216>>2]|0){case 2:case 5:break;default:if((c[f+480>>2]|0)!=0?(c[f+204>>2]&3|0)==0:0){if((a[b+300>>0]|0)!=0?(j=+g[b+268>>2],j!=0.0):0)e=+g[b+264>>2]-j;else e=+g[b+264>>2]*+g[f+244>>2];jg(f+68|0,+g[f+132>>2],+g[f+136>>2],+g[f+140>>2],f+148|0,e,k);d=c[f+480>>2]|0;Va[c[(c[d>>2]|0)+12>>2]&127](d,k);d=c[b+232>>2]|0}}h=h+1|0;if((h|0)>=(d|0))break a}}}else{d=c[b+8>>2]|0;if((d|0)>0){h=0;do{f=c[(c[b+16>>2]|0)+(h<<2)>>2]|0;if((!((f|0)==0?1:(c[f+236>>2]&2|0)==0)?(c[f+480>>2]|0)!=0:0)?(c[f+204>>2]&3|0)==0:0){if((a[b+300>>0]|0)!=0?(i=+g[b+268>>2],i!=0.0):0)e=+g[b+264>>2]-i;else e=+g[b+264>>2]*+g[f+244>>2];jg(f+68|0,+g[f+132>>2],+g[f+136>>2],+g[f+140>>2],f+148|0,e,k);d=c[f+480>>2]|0;Va[c[(c[d>>2]|0)+12>>2]&127](d,k);d=c[b+8>>2]|0}h=h+1|0}while((h|0)<(d|0))}}while(0);d=c[3084]|0;b=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=b;if(b|0){sa=k;return}do if(c[d+4>>2]|0){la(k|0,0)|0;b=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[k+4>>2]|0)-(c[b+4>>2]|0)+(((c[k>>2]|0)-(c[b>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=k;return}}while(0);c[3084]=c[d+20>>2];sa=k;return}function xf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0;i=sa;sa=sa+32|0;d=(a[b+8>>0]|0)==0?e:d;if(((c[(c[d+4>>2]|0)+4>>2]|0)+-21|0)>>>0>=9){sa=i;return}e=c[(c[d+8>>2]|0)+192>>2]|0;v=+va[c[(c[e>>2]|0)+48>>2]&15](e);c[b+64>>2]=f;g[b+68>>2]=v+.05999999865889549;c[b+56>>2]=h;h=c[b+16>>2]|0;Za[c[(c[h>>2]|0)+28>>2]&127](h,i+16|0,i);v=+g[i>>2];u=+g[i+16>>2];q=+g[i+4>>2];p=+g[i+16+4>>2];y=+g[i+8>>2];x=+g[i+16+8>>2];h=c[d+12>>2]|0;C=+g[h>>2];B=+g[h+16>>2];n=+g[h+32>>2];A=+g[h+4>>2];z=+g[h+20>>2];l=+g[h+36>>2];t=+g[h+8>>2];s=+g[h+24>>2];r=+g[h+40>>2];D=-+g[h+48>>2];j=-+g[h+52>>2];k=-+g[h+56>>2];o=(v+u)*.5*C+(q+p)*.5*B+(y+x)*.5*n+(C*D+B*j+n*k);m=(v+u)*.5*A+(q+p)*.5*z+(y+x)*.5*l+(A*D+z*j+l*k);k=(v+u)*.5*t+(q+p)*.5*s+(y+x)*.5*r+(t*D+s*j+r*k);j=+g[b+68>>2];n=+w(+(n+(C*0.0+B*0.0)))*((y-x)*.5+j)+(+w(+(C+B*0.0+n*0.0))*((v-u)*.5+j)+ +w(+(C*0.0+B+n*0.0))*((q-p)*.5+j));l=+w(+(l+(A*0.0+z*0.0)))*((y-x)*.5+j)+(+w(+(A+z*0.0+l*0.0))*((v-u)*.5+j)+ +w(+(A*0.0+z+l*0.0))*((q-p)*.5+j));j=+w(+(r+(t*0.0+s*0.0)))*((y-x)*.5+j)+(+w(+(t+s*0.0+r*0.0))*((v-u)*.5+j)+ +w(+(t*0.0+s+r*0.0))*((q-p)*.5+j));g[b+24>>2]=o-n;g[b+28>>2]=m-l;g[b+32>>2]=k-j;g[b+36>>2]=0.0;g[b+40>>2]=o+n;g[b+44>>2]=m+l;g[b+48>>2]=k+j;g[b+52>>2]=0.0;ab[c[(c[e>>2]|0)+64>>2]&127](e,b+12|0,b+24|0,b+40|0);sa=i;return}function yf(b,d,e,f,g,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0;m=sa;sa=sa+16|0;if(!((c[b+924>>2]|0)==0?(a[b+912>>0]|0)==0:0)){c[m>>2]=c[b+1208>>2];c[m+4>>2]=c[b+1208+4>>2];c[m+8>>2]=c[b+1208+8>>2];c[m+12>>2]=c[b+1208+12>>2];l=c[b+1304>>2]|0;if(!(l&512))c[b+896>>2]=c[c[d+32>>2]>>2];if(!(l&1024))c[b+904>>2]=c[c[d+32>>2]>>2];if(!(l&2048))c[b+900>>2]=c[d+4>>2];e=(Kc(b,b+868|0,f,g,h,i,j,k,d,e,m,1,0)|0)+e|0}if(!((c[b+988>>2]|0)==0?(a[b+976>>0]|0)==0:0)){c[m>>2]=c[b+1224>>2];c[m+4>>2]=c[b+1224+4>>2];c[m+8>>2]=c[b+1224+8>>2];c[m+12>>2]=c[b+1224+12>>2];l=c[b+1304>>2]|0;if(!(l&4096))c[b+960>>2]=c[c[d+32>>2]>>2];if(!(l&8192))c[b+968>>2]=c[c[d+32>>2]>>2];if(!(l&16384))c[b+964>>2]=c[d+4>>2];e=(Kc(b,b+932|0,f,g,h,i,j,k,d,e,m,1,0)|0)+e|0}if((c[b+1052>>2]|0)==0?(a[b+1040>>0]|0)==0:0){k=e;sa=m;return k|0}c[m>>2]=c[b+1240>>2];c[m+4>>2]=c[b+1240+4>>2];c[m+8>>2]=c[b+1240+8>>2];c[m+12>>2]=c[b+1240+12>>2];l=c[b+1304>>2]|0;if(!(l&32768))c[b+1024>>2]=c[c[d+32>>2]>>2];if(!(l&65536))c[b+1032>>2]=c[c[d+32>>2]>>2];if(!(l&131072))c[b+1028>>2]=c[d+4>>2];k=(Kc(b,b+996|0,f,g,h,i,j,k,d,e,m,1,0)|0)+e|0;sa=m;return k|0}function zf(b){b=b|0;var d=0;c[b>>2]=7568;d=c[b+176>>2]|0;if(d|0){if(a[b+180>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+176>>2]=0}a[b+180>>0]=1;c[b+176>>2]=0;c[b+168>>2]=0;c[b+172>>2]=0;d=c[b+156>>2]|0;if(d|0){if(a[b+160>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+156>>2]=0}a[b+160>>0]=1;c[b+156>>2]=0;c[b+148>>2]=0;c[b+152>>2]=0;d=c[b+136>>2]|0;if(d|0){if(a[b+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+136>>2]=0}a[b+140>>0]=1;c[b+136>>2]=0;c[b+128>>2]=0;c[b+132>>2]=0;d=c[b+116>>2]|0;if(d|0){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+116>>2]=0}a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;d=c[b+96>>2]|0;if(d|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;d=c[b+76>>2]|0;if(d|0){if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+76>>2]=0}a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;c[b+72>>2]=0;d=c[b+56>>2]|0;if(d|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function Af(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0;k=sa;sa=sa+16|0;c[b+8>>2]=0;c[b+12>>2]=1065353216;c[b+16>>2]=1065353216;c[b+20>>2]=1065353216;g[b+24>>2]=0.0;g[b+44>>2]=.03999999910593033;c[b+52>>2]=0;c[b+56>>2]=1065353216;c[b+60>>2]=1065353216;c[b+64>>2]=1065353216;g[b+68>>2]=0.0;c[b+72>>2]=-1082130432;c[b+76>>2]=-1082130432;c[b+80>>2]=-1082130432;g[b+84>>2]=0.0;a[b+88>>0]=0;c[b>>2]=10164;a[b+108>>0]=1;c[b+104>>2]=0;c[b+96>>2]=0;c[b+100>>2]=0;c[b+4>>2]=4;if((e|0)<=0){c[b+96>>2]=e;Oi(b);sa=k;return}c[7182]=(c[7182]|0)+1;h=xb((e<<4|3)+16|0)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}i=c[b+96>>2]|0;if((i|0)>0){h=0;do{l=j+(h<<4)|0;m=(c[b+104>>2]|0)+(h<<4)|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[b+104>>2]|0;if(h|0){if(a[b+108>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+104>>2]=0}a[b+108>>0]=1;c[b+104>>2]=j;c[b+100>>2]=e;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];if((e|0)!=1){h=1;do{m=(c[b+104>>2]|0)+(h<<4)|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];h=h+1|0}while((h|0)!=(e|0))}c[b+96>>2]=e;h=0;while(1){j=c[d+4>>2]|0;l=c[d+8>>2]|0;m=c[b+104>>2]|0;c[m+(h<<4)>>2]=c[d>>2];c[m+(h<<4)+4>>2]=j;c[m+(h<<4)+8>>2]=l;g[m+(h<<4)+12>>2]=0.0;h=h+1|0;if((h|0)==(e|0))break;else d=d+f|0}Oi(b);sa=k;return}function Bf(a,b,e){a=a|0;b=b|0;e=e|0;ve(a,b,e)|0;c[b+256>>2]=c[a+264>>2];c[b+260>>2]=c[a+268>>2];c[b+264>>2]=c[a+272>>2];c[b+268>>2]=c[a+276>>2];c[b+272>>2]=c[a+280>>2];c[b+276>>2]=c[a+284>>2];c[b+280>>2]=c[a+288>>2];c[b+284>>2]=c[a+292>>2];c[b+288>>2]=c[a+296>>2];c[b+292>>2]=c[a+300>>2];c[b+296>>2]=c[a+304>>2];c[b+300>>2]=c[a+308>>2];c[b+304>>2]=c[a+312>>2];c[b+308>>2]=c[a+316>>2];c[b+312>>2]=c[a+320>>2];c[b+316>>2]=c[a+324>>2];c[b+320>>2]=c[a+328>>2];c[b+324>>2]=c[a+332>>2];c[b+328>>2]=c[a+336>>2];c[b+332>>2]=c[a+340>>2];c[b+448>>2]=c[a+344>>2];c[b+336>>2]=c[a+544>>2];c[b+340>>2]=c[a+548>>2];c[b+344>>2]=c[a+552>>2];c[b+348>>2]=c[a+556>>2];c[b+352>>2]=c[a+348>>2];c[b+356>>2]=c[a+352>>2];c[b+360>>2]=c[a+356>>2];c[b+364>>2]=c[a+360>>2];c[b+368>>2]=c[a+364>>2];c[b+372>>2]=c[a+368>>2];c[b+376>>2]=c[a+372>>2];c[b+380>>2]=c[a+376>>2];c[b+384>>2]=c[a+380>>2];c[b+388>>2]=c[a+384>>2];c[b+392>>2]=c[a+388>>2];c[b+396>>2]=c[a+392>>2];c[b+400>>2]=c[a+396>>2];c[b+404>>2]=c[a+400>>2];c[b+408>>2]=c[a+404>>2];c[b+412>>2]=c[a+408>>2];c[b+416>>2]=c[a+412>>2];c[b+420>>2]=c[a+416>>2];c[b+424>>2]=c[a+420>>2];c[b+428>>2]=c[a+424>>2];c[b+432>>2]=c[a+428>>2];c[b+436>>2]=c[a+432>>2];c[b+440>>2]=c[a+436>>2];c[b+444>>2]=c[a+440>>2];c[b+452>>2]=c[a+444>>2];c[b+456>>2]=c[a+448>>2];c[b+484>>2]=d[a+452>>0];c[b+460>>2]=c[a+456>>2];c[b+464>>2]=c[a+460>>2];c[b+468>>2]=c[a+464>>2];c[b+472>>2]=c[a+468>>2];c[b+476>>2]=c[a+472>>2];c[b+480>>2]=c[a+476>>2];return 16167}function Cf(b,d,e,f,h){b=b|0;d=+d;e=e|0;f=f|0;h=h|0;var i=0;i=sa;sa=sa+144|0;c[b+164>>2]=1065353216;c[b+168>>2]=1065353216;c[b+172>>2]=1065353216;g[b+176>>2]=0.0;c[b+180>>2]=0;g[b+184>>2]=999999984306749440.0;c[b+188>>2]=0;c[b+188+4>>2]=0;c[b+188+8>>2]=0;c[b+188+12>>2]=0;c[b+204>>2]=1;c[b+208>>2]=-1;c[b+212>>2]=-1;c[b+216>>2]=1;g[b+220>>2]=0.0;g[b+224>>2]=.5;g[b+228>>2]=0.0;g[b+232>>2]=0.0;c[b+236>>2]=1;c[b+240>>2]=0;g[b+244>>2]=1.0;c[b+248>>2]=0;c[b+248+4>>2]=0;c[b+248+8>>2]=0;c[b+248+12>>2]=0;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+48+4>>2]=0;c[b+48+8>>2]=0;c[b+48+12>>2]=0;c[b+48+16>>2]=0;c[b>>2]=6868;a[b+500>>0]=1;c[b+496>>2]=0;c[b+488>>2]=0;c[b+492>>2]=0;g[i>>2]=d;c[i+4>>2]=e;c[i+72>>2]=f;c[i+76>>2]=c[h>>2];c[i+76+4>>2]=c[h+4>>2];c[i+76+8>>2]=c[h+8>>2];c[i+76+12>>2]=c[h+12>>2];g[i+92>>2]=0.0;g[i+96>>2]=0.0;g[i+100>>2]=.5;g[i+104>>2]=0.0;g[i+108>>2]=0.0;g[i+112>>2]=.800000011920929;g[i+116>>2]=1.0;a[i+120>>0]=0;g[i+124>>2]=.004999999888241291;g[i+128>>2]=.009999999776482582;g[i+132>>2]=.009999999776482582;g[i+136>>2]=.009999999776482582;c[i+8>>2]=1065353216;c[i+12>>2]=0;c[i+12+4>>2]=0;c[i+12+8>>2]=0;c[i+12+12>>2]=0;c[i+28>>2]=1065353216;c[i+32>>2]=0;c[i+32+4>>2]=0;c[i+32+8>>2]=0;c[i+32+12>>2]=0;c[i+48>>2]=1065353216;c[i+52>>2]=0;c[i+52+4>>2]=0;c[i+52+8>>2]=0;c[i+52+12>>2]=0;c[i+52+16>>2]=0;Qc(b,i);sa=i;return}function Df(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;ed(b,d);c[b>>2]=5828;c[7182]=(c[7182]|0)+1;e=xb(27)|0;i=e+4+15&-16;c[i+-4>>2]=e;a[i+4>>0]=0;c[(e+4+15&-16)>>2]=5860;c[b+92>>2]=i;c[7182]=(c[7182]|0)+1;i=xb(27)|0;e=i+4+15&-16;c[e+-4>>2]=i;a[e+4>>0]=0;c[(i+4+15&-16)>>2]=5880;c[b+96>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=5880;c[b+100>>2]=e;a[e+4>>0]=1;c[7182]=(c[7182]|0)+1;i=xb(27)|0;e=i+4+15&-16;c[e+-4>>2]=i;a[e+4>>0]=0;c[(i+4+15&-16)>>2]=5900;c[b+104>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=5920;c[b+108>>2]=e;a[e+4>>0]=1;if(!(a[b+20>>0]|0))return;e=c[b+16>>2]|0;if(!e)return;if((c[e>>2]|0)>=156)return;f=c[e+16>>2]|0;if(f){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);e=c[b+16>>2]|0;if(!e)i=b+16|0;else{f=b+16|0;g=11}}else{f=b+16|0;g=11}if((g|0)==11){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);i=f}c[7182]=(c[7182]|0)+1;e=xb(39)|0;if(!e)h=0;else{c[(e+4+15&-16)+-4>>2]=e;h=e+4+15&-16}e=c[d+12>>2]|0;c[h>>2]=156;f=h+4|0;c[f>>2]=e;c[7182]=(c[7182]|0)+1;e=xb((e*156|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[h+16>>2]=e;c[h+12>>2]=e;b=c[f>>2]|0;c[h+8>>2]=b;if(b+-1|0){g=c[h>>2]|0;f=e;d=b+-1|0;do{j=f;f=f+g|0;c[j>>2]=f;d=d+-1|0}while((d|0)!=0);e=e+(J(g,b+-1|0)|0)|0}c[e>>2]=0;c[i>>2]=h;return}function Ef(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=c[d>>2]|0;l=Ha[c[(c[l>>2]|0)+56>>2]&31](l,48)|0;c[l+4>>2]=c[d>>2];c[l>>2]=9036;a[l+28>>0]=1;c[l+24>>2]=0;c[l+16>>2]=0;c[l+20>>2]=0;c[l+32>>2]=c[d+4>>2];a[l+36>>0]=0;c[7182]=(c[7182]|0)+1;b=xb(87)|0;if(!b)h=0;else{c[(b+4+15&-16)+-4>>2]=b;h=b+4+15&-16}c[h>>2]=12232;i=h+20|0;a[i>>0]=1;j=h+16|0;c[j>>2]=0;d=h+8|0;c[d>>2]=0;k=h+12|0;c[k>>2]=0;a[h+24>>0]=0;a[h+44>>0]=1;c[h+40>>2]=0;c[h+32>>2]=0;c[h+36>>2]=0;a[h+64>>0]=1;c[h+60>>2]=0;c[h+52>>2]=0;c[h+56>>2]=0;c[7182]=(c[7182]|0)+1;b=xb(43)|0;if(!b)g=0;else{c[(b+4+15&-16)+-4>>2]=b;g=b+4+15&-16}d=c[d>>2]|0;if((d|0)>0){b=0;do{m=g+(b*12|0)|0;n=(c[j>>2]|0)+(b*12|0)|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];b=b+1|0}while((b|0)!=(d|0))}b=c[j>>2]|0;if(!b){a[i>>0]=1;c[j>>2]=g;c[k>>2]=2;Te(h);n=l+8|0;c[n>>2]=h;n=e+4|0;n=c[n>>2]|0;n=n+68|0;n=c[n>>2]|0;m=l+40|0;c[m>>2]=n;m=f+4|0;m=c[m>>2]|0;m=m+68|0;m=c[m>>2]|0;n=l+44|0;c[n>>2]=m;return l|0}if(a[i>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}c[j>>2]=0;a[i>>0]=1;c[j>>2]=g;c[k>>2]=2;Te(h);n=l+8|0;c[n>>2]=h;n=e+4|0;n=c[n>>2]|0;n=n+68|0;n=c[n>>2]|0;m=l+40|0;c[m>>2]=n;m=f+4|0;m=c[m>>2]|0;m=m+68|0;m=c[m>>2]|0;n=l+44|0;c[n>>2]=m;return l|0}function Ff(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[7168]=(c[7168]|0)+1;g=(d<<16|b)+~((d<<16|b)<<15)|0;g=((10?g>>10:g)^g)*9|0;g=(6?g>>6:g)^g;l=c[a+40>>2]|0;g=l+(((c[a+12>>2]|0)+-1&((16?g+~(g<<11)>>16:g+~(g<<11)|0)^g+~(g<<11)))<<2)|0;f=c[g>>2]|0;if((f|0)==-1){n=0;return n|0}m=c[a+16>>2]|0;e=f;while(1){k=m+(e*12|0)|0;if((c[k>>2]|0)==(b|0)?(c[m+(e*12|0)+4>>2]|0)==(d|0):0)break;e=c[(c[a+60>>2]|0)+(e<<2)>>2]|0;if((e|0)==-1){e=0;n=23;break}}if((n|0)==23)return e|0;if(!k){n=0;return n|0}j=c[m+(e*12|0)+8>>2]|0;i=(e*12|0)/12|0;h=c[a+60>>2]|0;if((f|0)!=(i|0)){b=f;while(1){d=h+(b<<2)|0;e=c[d>>2]|0;if((e|0)==(i|0))break;else b=e}e=c[h+(i<<2)>>2]|0;if((b|0)==-1)n=12;else c[d>>2]=e}else{e=c[h+(f<<2)>>2]|0;n=12}if((n|0)==12)c[g>>2]=e;f=(c[a+8>>2]|0)+-1|0;if((f|0)==(i|0)){c[a+8>>2]=i;n=j;return n|0}g=c[m+(f*12|0)+4>>2]<<16|c[m+(f*12|0)>>2];g=((10?g+~(g<<15)>>10:g+~(g<<15)|0)^g+~(g<<15))*9|0;g=(6?g>>6:g)^g;g=((16?g+~(g<<11)>>16:g+~(g<<11)|0)^g+~(g<<11))&(c[a+12>>2]|0)+-1;e=c[l+(g<<2)>>2]|0;if((e|0)!=(f|0)){b=e;while(1){d=h+(b<<2)|0;e=c[d>>2]|0;if((e|0)==(f|0))break;else b=e}e=c[h+(f<<2)>>2]|0;if((b|0)==-1)n=21;else c[d>>2]=e}else{e=c[h+(f<<2)>>2]|0;n=21}if((n|0)==21)c[l+(g<<2)>>2]=e;c[k>>2]=c[m+(f*12|0)>>2];c[k+4>>2]=c[m+(f*12|0)+4>>2];c[k+8>>2]=c[m+(f*12|0)+8>>2];n=(c[a+40>>2]|0)+(g<<2)|0;c[(c[a+60>>2]|0)+(i<<2)>>2]=c[n>>2];c[n>>2]=i;c[a+8>>2]=(c[a+8>>2]|0)+-1;n=j;return n|0}function Gf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;Pa[c[(c[b>>2]|0)+32>>2]&511](b);e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,104,1)|0;d=c[e+8>>2]|0;f=d;g=f+104|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));c[d+88>>2]=c[a+248>>2];c[d+92>>2]=c[a+252>>2];c[d+96>>2]=c[a+256>>2];c[d+100>>2]=c[a+260>>2];c[d>>2]=c[a+92>>2];c[d+4>>2]=c[a+96>>2];c[d+8>>2]=c[a+100>>2];c[d+12>>2]=c[a+104>>2];c[d+16>>2]=c[a+108>>2];c[d+20>>2]=c[a+116>>2];c[d+24>>2]=c[a+120>>2];c[d+28>>2]=c[a+124>>2];c[d+32>>2]=c[a+128>>2];c[d+36>>2]=c[a+132>>2];c[d+40>>2]=c[a+140>>2];c[d+44>>2]=c[a+144>>2];c[d+48>>2]=c[a+148>>2];c[d+52>>2]=c[a+152>>2];c[d+56>>2]=c[a+168>>2];c[d+60>>2]=c[a+172>>2];c[d+64>>2]=c[a+112>>2];c[d+68>>2]=c[a+156>>2];c[d+72>>2]=c[a+160>>2];c[d+76>>2]=c[a+164>>2];c[d+80>>2]=c[a+136>>2];eb[c[(c[b>>2]|0)+20>>2]&31](b,e,16580,1145853764,d);d=c[a+8>>2]|0;if((d|0)<=0){wi(a,b);Ac(a,b);a=c[b>>2]|0;a=a+36|0;a=c[a>>2]|0;Pa[a&511](b);return}f=0;do{e=c[(c[a+16>>2]|0)+(f<<2)>>2]|0;if(c[e+236>>2]&8){g=Fa[c[(c[e>>2]|0)+16>>2]&127](e)|0;g=Ja[c[(c[b>>2]|0)+16>>2]&63](b,g,1)|0;d=Ja[c[(c[e>>2]|0)+20>>2]&63](e,c[g+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,g,d,1497645651,e);d=c[a+8>>2]|0}f=f+1|0}while((f|0)<(d|0));wi(a,b);Ac(a,b);a=c[b>>2]|0;a=a+36|0;a=c[a>>2]|0;Pa[a&511](b);return}function Hf(a,b){a=a|0;b=+b;var d=0,e=0,f=0,h=0,i=0.0,j=0.0,k=0.0;h=sa;sa=sa+32|0;d=c[a+8>>2]|0;if((d|0)<=0){sa=h;return}f=0;do{e=c[(c[a+16>>2]|0)+(f<<2)>>2]|0;if((!((e|0)==0?1:(c[e+236>>2]&2|0)==0)?(c[e+216>>2]|0)!=2:0)?!(b==0.0?1:(c[e+204>>2]&2|0)==0):0){d=c[e+480>>2]|0;if(!d)d=e+4|0;else{Va[c[(c[d>>2]|0)+8>>2]&127](d,e+4|0);d=e+4|0}j=1.0/b*(+g[e+56>>2]-+g[e+120>>2]);k=1.0/b*(+g[e+60>>2]-+g[e+124>>2]);g[e+312>>2]=1.0/b*(+g[e+52>>2]-+g[e+116>>2]);g[e+316>>2]=j;g[e+320>>2]=k;g[e+324>>2]=0.0;Se(e+68|0,d,h+8|0,h);k=+g[h>>2];j=1.0/b*k*+g[h+8+4>>2];i=1.0/b*k*+g[h+8+8>>2];g[e+328>>2]=1.0/b*+g[h+8>>2]*k;g[e+332>>2]=j;g[e+336>>2]=i;g[e+340>>2]=0.0;c[e+132>>2]=c[e+312>>2];c[e+132+4>>2]=c[e+312+4>>2];c[e+132+8>>2]=c[e+312+8>>2];c[e+132+12>>2]=c[e+312+12>>2];c[e+148>>2]=c[e+328>>2];c[e+148+4>>2]=c[e+328+4>>2];c[e+148+8>>2]=c[e+328+8>>2];c[e+148+12>>2]=c[e+328+12>>2];c[e+68>>2]=c[d>>2];c[e+68+4>>2]=c[d+4>>2];c[e+68+8>>2]=c[d+8>>2];c[e+68+12>>2]=c[d+12>>2];c[e+84>>2]=c[e+20>>2];c[e+84+4>>2]=c[e+20+4>>2];c[e+84+8>>2]=c[e+20+8>>2];c[e+84+12>>2]=c[e+20+12>>2];c[e+100>>2]=c[e+36>>2];c[e+100+4>>2]=c[e+36+4>>2];c[e+100+8>>2]=c[e+36+8>>2];c[e+100+12>>2]=c[e+36+12>>2];c[e+116>>2]=c[e+52>>2];c[e+116+4>>2]=c[e+52+4>>2];c[e+116+8>>2]=c[e+52+8>>2];c[e+116+12>>2]=c[e+52+12>>2];d=c[a+8>>2]|0}f=f+1|0}while((f|0)<(d|0));sa=h;return}function If(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0;s=sa;sa=sa+32|0;r=c[a+12>>2]|0;if(!r){sa=s;return}c[f+4>>2]=r;a=c[b+4>>2]|0;e=c[d+4>>2]|0;b=c[b+12>>2]|0;d=c[d+12>>2]|0;l=+g[d+48>>2];h=+g[b+48>>2]-l;m=+g[d+52>>2];i=+g[b+52>>2]-m;n=+g[d+56>>2];k=+g[b+56>>2]-n;o=+x(+(h*h+i*i+k*k));p=+g[e+28>>2]*+g[e+12>>2];q=+g[a+28>>2]*+g[a+12>>2]+p;if(o>q){if(!(c[r+748>>2]|0)){sa=s;return}e=c[r+740>>2]|0;a=c[(c[f+8>>2]|0)+8>>2]|0;if((e|0)==(a|0)){re(r,e+4|0,(c[(c[f+12>>2]|0)+8>>2]|0)+4|0);sa=s;return}else{re(r,(c[(c[f+12>>2]|0)+8>>2]|0)+4|0,a+4|0);sa=s;return}}c[s+16>>2]=1065353216;c[s+16+4>>2]=0;c[s+16+8>>2]=0;g[s+16+12>>2]=0.0;if(o>1.1920928955078125e-07){g[s+16>>2]=h*(1.0/o);g[s+16+4>>2]=i*(1.0/o);g[s+16+8>>2]=k*(1.0/o);g[s+16+12>>2]=0.0;j=h*(1.0/o);i=i*(1.0/o);h=k*(1.0/o)}else{j=1.0;i=0.0;h=0.0}g[s>>2]=l+p*j;g[s+4>>2]=m+p*i;g[s+8>>2]=n+p*h;g[s+12>>2]=0.0;_a[c[(c[f>>2]|0)+16>>2]&15](f,s+16|0,s,o-q);b=c[f+4>>2]|0;do if(c[b+748>>2]|0){e=c[b+740>>2]|0;a=c[(c[f+8>>2]|0)+8>>2]|0;if((e|0)==(a|0)){re(b,e+4|0,(c[(c[f+12>>2]|0)+8>>2]|0)+4|0);break}else{re(b,(c[(c[f+12>>2]|0)+8>>2]|0)+4|0,a+4|0);break}}while(0);sa=s;return}function Jf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;d=c[b+236>>2]|0;if((b|0)==0|(d|0)!=8){if(!((b|0)==0|(d&2|0)==0)){Va[c[(c[a>>2]|0)+92>>2]&127](a,b);return}d=c[b+188>>2]|0;if(d|0){h=c[a+68>>2]|0;h=Fa[c[(c[h>>2]|0)+36>>2]&127](h)|0;Za[c[(c[h>>2]|0)+40>>2]&127](h,d,c[a+24>>2]|0);h=c[a+68>>2]|0;Za[c[(c[h>>2]|0)+12>>2]&127](h,d,c[a+24>>2]|0);c[b+188>>2]=0}e=c[a+8>>2]|0;if((e|0)<=0)return;f=c[a+16>>2]|0;d=0;while(1){g=f+(d<<2)|0;if((c[g>>2]|0)==(b|0))break;h=d+1|0;if((h|0)<(e|0))d=h;else{i=26;break}}if((i|0)==26)return;if((d|0)>=(e|0))return;c[g>>2]=c[f+(e+-1<<2)>>2];c[(c[a+16>>2]|0)+(e+-1<<2)>>2]=b;c[a+8>>2]=e+-1;return}g=c[a+328>>2]|0;a:do if((g|0)>0){f=c[a+336>>2]|0;d=0;while(1){e=f+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(g|0))break a}if((d|0)<(g|0)){c[e>>2]=c[f+(g+-1<<2)>>2];c[(c[a+336>>2]|0)+(g+-1<<2)>>2]=b;c[a+328>>2]=g+-1}}while(0);d=c[b+188>>2]|0;if(d|0){h=c[a+68>>2]|0;h=Fa[c[(c[h>>2]|0)+36>>2]&127](h)|0;Za[c[(c[h>>2]|0)+40>>2]&127](h,d,c[a+24>>2]|0);h=c[a+68>>2]|0;Za[c[(c[h>>2]|0)+12>>2]&127](h,d,c[a+24>>2]|0);c[b+188>>2]=0}e=c[a+8>>2]|0;if((e|0)<=0)return;f=c[a+16>>2]|0;d=0;while(1){g=f+(d<<2)|0;if((c[g>>2]|0)==(b|0))break;h=d+1|0;if((h|0)<(e|0))d=h;else{i=26;break}}if((i|0)==26)return;if((d|0)>=(e|0))return;c[g>>2]=c[f+(e+-1<<2)>>2];c[(c[a+16>>2]|0)+(e+-1<<2)>>2]=b;c[a+8>>2]=e+-1;return}function Kf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0,z=0.0;y=sa;sa=sa+48|0;t=+g[e>>2];u=+g[d>>2];v=+g[e+4>>2];s=+g[d+4>>2];r=+g[e+8>>2];m=+g[d+8>>2];n=+x(+((t-u)*.5*(t-u)*.5+(v-s)*.5*(v-s)*.5+(r-m)*.5*(r-m)*.5));o=+g[a+56>>2];if(+w(+o)>.7071067690849304){q=+g[a+52>>2];l=1.0/+x(+(o*o+q*q));p=+g[a+48>>2];f=p*-(o*l);h=(o*o+q*q)*l;i=0.0;j=-(p*q*l);k=-(o*l);l=q*l}else{p=+g[a+48>>2];q=+g[a+52>>2];k=1.0/+x(+(p*p+q*q));f=(p*p+q*q)*k;h=-(o*p*k);i=-(q*k);j=o*-(q*k);k=p*k;l=0.0}z=o*(r+m)*.5+((t+u)*.5*p+(v+s)*.5*q)-+g[a+64>>2];s=(v+s)*.5-q*z;p=(t+u)*.5-p*z;i=n*i;t=n*k;v=n*l;l=n*h;q=n*j;u=n*f;g[y>>2]=l+(i+p);g[y+4>>2]=q+(t+s);g[y+8>>2]=u+(v+((r+m)*.5-o*z));g[y+12>>2]=0.0;g[y+16>>2]=i+p-l;g[y+20>>2]=t+s-q;g[y+24>>2]=v+((r+m)*.5-o*z)-u;g[y+28>>2]=0.0;g[y+32>>2]=p-i-l;g[y+36>>2]=s-t-q;g[y+40>>2]=(r+m)*.5-o*z-v-u;g[y+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,y,0,0);g[y>>2]=p-i-l;g[y+4>>2]=s-t-q;g[y+8>>2]=(r+m)*.5-o*z-v-u;g[y+12>>2]=0.0;g[y+16>>2]=l+(p-i);g[y+20>>2]=q+(s-t);g[y+24>>2]=u+((r+m)*.5-o*z-v);g[y+28>>2]=0.0;g[y+32>>2]=l+(i+p);g[y+36>>2]=q+(t+s);g[y+40>>2]=u+(v+((r+m)*.5-o*z));g[y+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,y,0,1);sa=y;return}function Lf(b,d,e,f){b=b|0;d=+d;e=e|0;f=+f;var h=0,i=0.0,j=0,k=0;k=sa;sa=sa+16|0;la(c[7181]|0,0)|0;er(28684);c[7172]=(c[7172]|0)+1;j=c[7175]|0;c[7175]=j+1;if(!j){la(k|0,0)|0;j=c[7181]|0;c[7174]=(c[k+4>>2]|0)-(c[j+4>>2]|0)+(((c[k>>2]|0)-(c[j>>2]|0)|0)*1e6|0)}c[7180]=0;la(k|0,0)|0;Ki(16565);if(e){g[b+268>>2]=f;i=+g[b+264>>2]+d;g[b+264>>2]=i;if(!(i>=f)){d=f;j=0}else{g[b+264>>2]=i-+(~~(i/f)|0)*f;d=f;j=~~(i/f)}}else{g[b+264>>2]=(a[b+300>>0]|0)==0?d:0.0;g[b+268>>2]=0.0;j=!(+w(+d)<1.1920928955078125e-07)&1;e=j}if(Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0){h=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;h=Fa[c[(c[h>>2]|0)+48>>2]&127](h)|0;a[29312]=(4?h>>>4:h)&1}if(j){h=(j|0)>(e|0)?e:j;Qa[c[(c[b>>2]|0)+164>>2]&31](b,d*+(h|0));Pa[c[(c[b>>2]|0)+168>>2]&511](b);if((h|0)>0){e=0;do{Qa[c[(c[b>>2]|0)+160>>2]&31](b,d);Pa[c[(c[b>>2]|0)+80>>2]&511](b);e=e+1|0}while((e|0)<(h|0));e=b}else e=b}else{Pa[c[(c[b>>2]|0)+80>>2]&511](b);e=b}Pa[c[(c[e>>2]|0)+120>>2]&511](b);c[7180]=(c[7180]|0)+1;e=c[3084]|0;b=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=b;if(b|0){sa=k;return j|0}do if(c[e+4>>2]|0){la(k|0,0)|0;b=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[k+4>>2]|0)-(c[b+4>>2]|0)+(((c[k>>2]|0)-(c[b>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[e+16>>2]|0)){e=c[3084]|0;break}else{sa=k;return j|0}}while(0);c[3084]=c[e+20>>2];sa=k;return j|0}function Mf(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,h=0;e=sa;sa=sa+288|0;g[e+280>>2]=d;h=IH(b)|0;c[e+264>>2]=c[h>>2];c[e+264+4>>2]=c[h+4>>2];c[e+264+8>>2]=c[h+8>>2];c[e+264+12>>2]=c[h+12>>2];h=c[(c[a>>2]|0)+8>>2]|0;f=JI(b)|0;g[e+212>>2]=0.0;g[e+208>>2]=0.0;ns(e+216|0,e+280|0,e+212|0,e+208|0);vl(e+232|0,f,+g[e+216>>2],+g[e+216+4>>2],+g[e+216+8>>2]);qp(e+248|0,+g[e+264>>2],+g[e+264+4>>2],+g[e+264+8>>2],+g[e+232>>2],+g[e+232+4>>2],+g[e+232+8>>2]);g[e+184>>2]=.699999988079071;g[e+180>>2]=0.0;g[e+176>>2]=0.0;ns(e+192|0,e+184|0,e+180|0,e+176|0);ab[h&127](a,e+264|0,e+248|0,e+192|0);b=c[(c[a>>2]|0)+8>>2]|0;g[e+124>>2]=0.0;g[e+120>>2]=0.0;ns(e+128|0,e+124|0,e+280|0,e+120|0);vl(e+144|0,f,+g[e+128>>2],+g[e+128+4>>2],+g[e+128+8>>2]);qp(e+160|0,+g[e+264>>2],+g[e+264+4>>2],+g[e+264+8>>2],+g[e+144>>2],+g[e+144+4>>2],+g[e+144+8>>2]);g[e+96>>2]=0.0;g[e+92>>2]=.699999988079071;g[e+88>>2]=0.0;ns(e+104|0,e+96|0,e+92|0,e+88|0);ab[b&127](a,e+264|0,e+160|0,e+104|0);b=c[(c[a>>2]|0)+8>>2]|0;g[e+36>>2]=0.0;g[e+32>>2]=0.0;ns(e+40|0,e+36|0,e+32|0,e+280|0);vl(e+56|0,f,+g[e+40>>2],+g[e+40+4>>2],+g[e+40+8>>2]);qp(e+72|0,+g[e+264>>2],+g[e+264+4>>2],+g[e+264+8>>2],+g[e+56>>2],+g[e+56+4>>2],+g[e+56+8>>2]);g[e+8>>2]=0.0;g[e+4>>2]=0.0;g[e>>2]=.699999988079071;ns(e+16|0,e+8|0,e+4|0,e);ab[b&127](a,e+264|0,e+72|0,e+16|0);sa=e;return}function Nf(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,h=0,i=0.0,j=0,k=0.0,l=0,m=0.0,n=0.0,o=0,p=0.0;d=c[a+712>>2]|0;if((d|0)>0){b=0;do{l=(c[a+720>>2]|0)+(b*104|0)+72|0;b=b+1|0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0}while((b|0)!=(d|0))}d=c[a+752>>2]|0;if((d|0)>0){b=0;do{o=c[a+760>>2]|0;j=c[o+(b*44|0)+12>>2]|0;h=c[o+(b*44|0)+8>>2]|0;k=+g[h+8>>2];e=+g[j+8>>2]-k;f=+g[h+12>>2];i=+g[j+12>>2]-f;m=+g[h+16>>2];n=+g[j+16>>2]-m;l=c[o+(b*44|0)+16>>2]|0;k=+g[l+8>>2]-k;f=+g[l+12>>2]-f;m=+g[l+16>>2]-m;p=1.0/+x(+((e*f-i*k)*(e*f-i*k)+((i*m-n*f)*(i*m-n*f)+(n*k-e*m)*(n*k-e*m))));g[o+(b*44|0)+20>>2]=(i*m-n*f)*p;g[o+(b*44|0)+24>>2]=(n*k-e*m)*p;g[o+(b*44|0)+28>>2]=(e*f-i*k)*p;c[o+(b*44|0)+32>>2]=0;g[h+72>>2]=i*m-n*f+ +g[h+72>>2];g[h+76>>2]=n*k-e*m+ +g[h+76>>2];g[h+80>>2]=e*f-i*k+ +g[h+80>>2];g[j+72>>2]=i*m-n*f+ +g[j+72>>2];g[j+76>>2]=n*k-e*m+ +g[j+76>>2];g[j+80>>2]=e*f-i*k+ +g[j+80>>2];g[l+72>>2]=i*m-n*f+ +g[l+72>>2];g[l+76>>2]=n*k-e*m+ +g[l+76>>2];g[l+80>>2]=e*f-i*k+ +g[l+80>>2];b=b+1|0}while((b|0)!=(d|0))}l=c[a+712>>2]|0;if((l|0)<=0)return;a=c[a+720>>2]|0;b=0;do{h=a+(b*104|0)+72|0;i=+g[h>>2];j=a+(b*104|0)+76|0;k=+g[j>>2];d=a+(b*104|0)+80|0;e=+g[d>>2];f=+x(+(i*i+k*k+e*e));if(f>1.1920928955078125e-07){g[h>>2]=i*(1.0/f);g[j>>2]=k*(1.0/f);g[d>>2]=e*(1.0/f)}b=b+1|0}while((b|0)!=(l|0));return}function Of(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!(a[d+164>>0]|0)){f=c[d+148>>2]|0;if((f|0)==(c[d+152>>2]|0)?(k=(f|0)==0?1:f<<1,(f|0)<(k|0)):0){if(!k)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((k<<1)+19|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=f;f=c[d+148>>2]|0}h=c[d+156>>2]|0;if((f|0)<=0)if(!h)g=d+160|0;else l=29;else{g=0;do{b[i+(g<<1)>>1]=b[h+(g<<1)>>1]|0;g=g+1|0}while((g|0)!=(f|0));l=29}if((l|0)==29){if(a[d+160>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);f=c[d+148>>2]|0}c[d+156>>2]=0;g=d+160|0}a[g>>0]=1;c[d+156>>2]=i;c[d+152>>2]=k}l=c[d+156>>2]|0;b[l+(f<<1)>>1]=e;c[d+148>>2]=f+1;c[(c[d+32>>2]|0)+4>>2]=l;return}else{f=c[d+128>>2]|0;if((f|0)==(c[d+132>>2]|0)?(j=(f|0)==0?1:f<<1,(f|0)<(j|0)):0){if(!j)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((j<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=f;f=c[d+128>>2]|0}h=c[d+136>>2]|0;if((f|0)<=0)if(!h)g=d+140|0;else l=13;else{g=0;do{c[i+(g<<2)>>2]=c[h+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0));l=13}if((l|0)==13){if(a[d+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[d+136>>2]=0;g=d+140|0;f=c[d+128>>2]|0}a[g>>0]=1;c[d+136>>2]=i;c[d+132>>2]=j}l=c[d+136>>2]|0;c[l+(f<<2)>>2]=e;c[d+128>>2]=(c[d+128>>2]|0)+1;c[(c[d+32>>2]|0)+4>>2]=l;return}}function Pf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0;h=ts()|0;c[h+4>>2]=5;c[h+8>>2]=-1;c[h+12>>2]=-1;g[h+16>>2]=3402823466385288598117041.0e14;a[h+20>>0]=1;a[h+21>>0]=0;c[h+24>>2]=-1;c[h+28>>2]=b;c[h+32>>2]=d;g[h+36>>2]=0.0;g[h+40>>2]=.30000001192092896;c[h+44>>2]=0;c[h>>2]=7460;c[h+300>>2]=c[e>>2];c[h+300+4>>2]=c[e+4>>2];c[h+300+8>>2]=c[e+8>>2];c[h+300+12>>2]=c[e+12>>2];c[h+316>>2]=c[e+16>>2];c[h+316+4>>2]=c[e+16+4>>2];c[h+316+8>>2]=c[e+16+8>>2];c[h+316+12>>2]=c[e+16+12>>2];c[h+332>>2]=c[e+32>>2];c[h+332+4>>2]=c[e+32+4>>2];c[h+332+8>>2]=c[e+32+8>>2];c[h+332+12>>2]=c[e+32+12>>2];c[h+348>>2]=c[e+48>>2];c[h+348+4>>2]=c[e+48+4>>2];c[h+348+8>>2]=c[e+48+8>>2];c[h+348+12>>2]=c[e+48+12>>2];c[h+364>>2]=c[f>>2];c[h+364+4>>2]=c[f+4>>2];c[h+364+8>>2]=c[f+8>>2];c[h+364+12>>2]=c[f+12>>2];c[h+380>>2]=c[f+16>>2];c[h+380+4>>2]=c[f+16+4>>2];c[h+380+8>>2]=c[f+16+8>>2];c[h+380+12>>2]=c[f+16+12>>2];c[h+396>>2]=c[f+32>>2];c[h+396+4>>2]=c[f+32+4>>2];c[h+396+8>>2]=c[f+32+8>>2];c[h+396+12>>2]=c[f+32+12>>2];c[h+412>>2]=c[f+48>>2];c[h+412+4>>2]=c[f+48+4>>2];c[h+412+8>>2]=c[f+48+8>>2];c[h+412+12>>2]=c[f+48+12>>2];a[h+552>>0]=0;c[h+524>>2]=0;g[h+572>>2]=-1.0;g[h+444>>2]=999999984306749440.0;g[h+448>>2]=999999984306749440.0;g[h+452>>2]=999999984306749440.0;g[h+428>>2]=1.0;g[h+432>>2]=.30000001192092896;g[h+436>>2]=1.0;g[h+440>>2]=.009999999776482582;g[h+456>>2]=.05000000074505806;c[h+592>>2]=0;g[h+596>>2]=0.0;g[h+600>>2]=.699999988079071;g[h+604>>2]=0.0;return h|0}function Qf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0.0;l=sa;sa=sa+672|0;c[l+568+8>>2]=0;c[l+568+12>>2]=1065353216;c[l+568+16>>2]=1065353216;c[l+568+20>>2]=1065353216;g[l+568+24>>2]=0.0;c[l+568+52>>2]=0;c[l+568>>2]=6476;c[l+568+4>>2]=1;c[l+568+56>>2]=c[d>>2];c[l+568+56+4>>2]=c[d+4>>2];c[l+568+56+8>>2]=c[d+8>>2];c[l+568+56+12>>2]=c[d+12>>2];c[l+568+72>>2]=c[d+16>>2];c[l+568+72+4>>2]=c[d+16+4>>2];c[l+568+72+8>>2]=c[d+16+8>>2];c[l+568+72+12>>2]=c[d+16+12>>2];c[l+568+88>>2]=c[d+32>>2];c[l+568+88+4>>2]=c[d+32+4>>2];c[l+568+88+8>>2]=c[d+32+8>>2];c[l+568+88+12>>2]=c[d+32+12>>2];c[l+568+44>>2]=c[b+204>>2];g[l+208+308>>2]=9.999999747378752e-05;a[l+208+332>>0]=0;c[l+200>>2]=12028;d=c[b+4>>2]|0;c[l+176>>2]=12096;c[l+176+4>>2]=l+208;c[l+176+8>>2]=l+200;c[l+176+12>>2]=d;c[l+176+16>>2]=l+568;c[l+176+20>>2]=0;c[l>>2]=6448;c[l+168>>2]=0;g[l+164>>2]=1.0;c[l+172>>2]=c[b+208>>2];if((bd(l+176|0,b+8|0,b+72|0,b+136|0,b+136|0,l)|0?(h=+g[l+132>>2],i=+g[l+136>>2],j=+g[l+140>>2],h*h+i*i+j*j>9.999999747378752e-05):0)?(k=+g[l+164>>2],k<+g[b+200>>2]):0){m=1.0/+x(+(h*h+i*i+j*j));g[l+132>>2]=h*m;g[l+136>>2]=i*m;g[l+140>>2]=j*m;+za[c[(c[b>>2]|0)+12>>2]&3](b,l+132|0,l+148|0,k,e,f)}c[l+568>>2]=9932;b=c[l+568+52>>2]|0;if(!b){sa=l;return}Pa[c[c[b>>2]>>2]&511](b);b=c[l+568+52>>2]|0;if(!b){sa=l;return}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);sa=l;return}function Rf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;e=+g[d+128>>2];if(!(e!=0.0))return;c[7002]=(c[7002]|0)+1;k=+g[d+96>>2];f=+g[d+16>>2];h=+g[d+20>>2];i=+g[d+24>>2];j=+g[d+108>>2];j=e-k*+g[d+116>>2]-(f*+g[a+144>>2]+h*+g[a+148>>2]+i*+g[a+152>>2]+(+g[d>>2]*+g[a+160>>2]+ +g[d+4>>2]*+g[a+164>>2]+ +g[d+8>>2]*+g[a+168>>2]))*j-j*(+g[d+48>>2]*+g[b+144>>2]+ +g[d+52>>2]*+g[b+148>>2]+ +g[d+56>>2]*+g[b+152>>2]+(+g[d+32>>2]*+g[b+160>>2]+ +g[d+36>>2]*+g[b+164>>2]+ +g[d+40>>2]*+g[b+168>>2]));l=+g[d+120>>2];e=k+j>2]=k+j>2]|0){l=e*h*+g[a+132>>2]*+g[a+116>>2];k=e*i*+g[a+136>>2]*+g[a+120>>2];g[a+144>>2]=+g[a+112>>2]*e*f*+g[a+128>>2]+ +g[a+144>>2];g[a+148>>2]=l+ +g[a+148>>2];g[a+152>>2]=k+ +g[a+152>>2];k=e*+g[a+100>>2]*+g[d+68>>2];l=e*+g[a+104>>2]*+g[d+72>>2];g[a+160>>2]=e*+g[a+96>>2]*+g[d+64>>2]+ +g[a+160>>2];g[a+164>>2]=k+ +g[a+164>>2];g[a+168>>2]=l+ +g[a+168>>2]}if(!(c[b+240>>2]|0))return;l=e*+g[d+52>>2]*+g[b+132>>2]*+g[b+116>>2];k=e*+g[d+56>>2]*+g[b+136>>2]*+g[b+120>>2];g[b+144>>2]=+g[b+112>>2]*e*+g[d+48>>2]*+g[b+128>>2]+ +g[b+144>>2];g[b+148>>2]=l+ +g[b+148>>2];g[b+152>>2]=k+ +g[b+152>>2];k=e*+g[b+100>>2]*+g[d+84>>2];l=e*+g[b+104>>2]*+g[d+88>>2];g[b+160>>2]=e*+g[b+96>>2]*+g[d+80>>2]+ +g[b+160>>2];g[b+164>>2]=k+ +g[b+164>>2];g[b+168>>2]=l+ +g[b+168>>2];return}function Sf(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0;h=sa;sa=sa+16|0;d=+g[a+336>>2]*b;b=+g[a+452>>2];f=c[a+792>>2]|0;if((f|0)<=0){sa=h;return}e=0;do{s=c[a+800>>2]|0;j=c[s+(e*96|0)+20>>2]|0;n=c[s+(e*96|0)>>2]|0;x=+g[s+(e*96|0)+4>>2];w=+g[s+(e*96|0)+8>>2];v=+g[s+(e*96|0)+12>>2];i=s+(e*96|0)+76|0;u=+g[j+332>>2];o=+g[s+(e*96|0)+84>>2];y=+g[j+336>>2];l=+g[s+(e*96|0)+80>>2];k=+g[i>>2];m=+g[j+328>>2];r=+g[n+8>>2];q=+g[n+12>>2];p=+g[n+16>>2];t=d*(x*+g[j+4>>2]+w*+g[j+8>>2]+v*+g[j+12>>2]+ +g[j+52>>2]-r)+(b*(u*o-y*l+ +g[j+312>>2])-(r-+g[n+24>>2]));o=d*(x*+g[j+20>>2]+w*+g[j+24>>2]+v*+g[j+28>>2]+ +g[j+56>>2]-q)+(b*(+g[j+316>>2]+(y*k-o*m))-(q-+g[n+28>>2]));k=d*(x*+g[j+36>>2]+w*+g[j+40>>2]+v*+g[j+44>>2]+ +g[j+60>>2]-p)+(b*(l*m-u*k+ +g[j+320>>2])-(p-+g[n+32>>2]));u=+g[s+(e*96|0)+24>>2];m=(t*+g[s+(e*96|0)+28>>2]+o*+g[s+(e*96|0)+32>>2]+ +g[s+(e*96|0)+36>>2]*k)*u;l=(t*+g[s+(e*96|0)+44>>2]+o*+g[s+(e*96|0)+48>>2]+k*+g[s+(e*96|0)+52>>2])*u;k=u*(t*+g[s+(e*96|0)+60>>2]+o*+g[s+(e*96|0)+64>>2]+k*+g[s+(e*96|0)+68>>2]);o=+g[s+(e*96|0)+92>>2];g[n+8>>2]=r+m*o;g[n+12>>2]=q+o*l;g[n+16>>2]=p+o*k;g[h>>2]=-m;g[h+4>>2]=-l;g[h+8>>2]=-k;g[h+12>>2]=0.0;Bk(j,h,i);e=e+1|0}while((e|0)!=(f|0));sa=h;return}function Tf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;f=+g[d+100>>2];j=+g[d+16>>2];k=+g[d+20>>2];l=+g[d+24>>2];h=+g[d+108>>2];h=+g[d+112>>2]-f*+g[d+116>>2]-(j*+g[a+64>>2]+k*+g[a+68>>2]+l*+g[a+72>>2]+(+g[d>>2]*+g[a+80>>2]+ +g[d+4>>2]*+g[a+84>>2]+ +g[d+8>>2]*+g[a+88>>2]))*h-h*(+g[d+48>>2]*+g[b+64>>2]+ +g[d+52>>2]*+g[b+68>>2]+ +g[d+56>>2]*+g[b+72>>2]+(+g[d+32>>2]*+g[b+80>>2]+ +g[d+36>>2]*+g[b+84>>2]+ +g[d+40>>2]*+g[b+88>>2]));e=+g[d+120>>2];if(!(f+h>2];if(f+h>e)i=e-f;else{i=h;e=f+h}}else i=e-f;g[d+100>>2]=e;if(c[a+240>>2]|0){h=i*k*+g[a+132>>2]*+g[a+116>>2];k=i*l*+g[a+136>>2]*+g[a+120>>2];g[a+64>>2]=+g[a+112>>2]*i*j*+g[a+128>>2]+ +g[a+64>>2];g[a+68>>2]=h+ +g[a+68>>2];g[a+72>>2]=k+ +g[a+72>>2];k=i*+g[a+100>>2]*+g[d+68>>2];l=i*+g[a+104>>2]*+g[d+72>>2];g[a+80>>2]=i*+g[a+96>>2]*+g[d+64>>2]+ +g[a+80>>2];g[a+84>>2]=k+ +g[a+84>>2];g[a+88>>2]=l+ +g[a+88>>2]}if(!(c[b+240>>2]|0))return;l=i*+g[d+52>>2]*+g[b+132>>2]*+g[b+116>>2];k=i*+g[d+56>>2]*+g[b+136>>2]*+g[b+120>>2];g[b+64>>2]=+g[b+112>>2]*i*+g[d+48>>2]*+g[b+128>>2]+ +g[b+64>>2];g[b+68>>2]=l+ +g[b+68>>2];g[b+72>>2]=k+ +g[b+72>>2];k=i*+g[b+100>>2]*+g[d+84>>2];l=i*+g[b+104>>2]*+g[d+88>>2];g[b+80>>2]=i*+g[b+96>>2]*+g[d+80>>2]+ +g[b+80>>2];g[b+84>>2]=k+ +g[b+84>>2];g[b+88>>2]=l+ +g[b+88>>2];return}function Uf(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0;i=Cs()|0;c[i+4>>2]=4;c[i+8>>2]=-1;c[i+12>>2]=-1;g[i+16>>2]=3402823466385288598117041.0e14;a[i+20>>0]=1;a[i+21>>0]=0;c[i+24>>2]=-1;c[i+28>>2]=b;c[i+32>>2]=d;g[i+36>>2]=0.0;g[i+40>>2]=.30000001192092896;c[i+44>>2]=0;c[i>>2]=7516;c[i+552>>2]=c[e>>2];c[i+552+4>>2]=c[e+4>>2];c[i+552+8>>2]=c[e+8>>2];c[i+552+12>>2]=c[e+12>>2];c[i+568>>2]=c[e+16>>2];c[i+568+4>>2]=c[e+16+4>>2];c[i+568+8>>2]=c[e+16+8>>2];c[i+568+12>>2]=c[e+16+12>>2];c[i+584>>2]=c[e+32>>2];c[i+584+4>>2]=c[e+32+4>>2];c[i+584+8>>2]=c[e+32+8>>2];c[i+584+12>>2]=c[e+32+12>>2];c[i+600>>2]=c[e+48>>2];c[i+600+4>>2]=c[e+48+4>>2];c[i+600+8>>2]=c[e+48+8>>2];c[i+600+12>>2]=c[e+48+12>>2];c[i+616>>2]=c[f>>2];c[i+616+4>>2]=c[f+4>>2];c[i+616+8>>2]=c[f+8>>2];c[i+616+12>>2]=c[f+12>>2];c[i+632>>2]=c[f+16>>2];c[i+632+4>>2]=c[f+16+4>>2];c[i+632+8>>2]=c[f+16+8>>2];c[i+632+12>>2]=c[f+16+12>>2];c[i+648>>2]=c[f+32>>2];c[i+648+4>>2]=c[f+32+4>>2];c[i+648+8>>2]=c[f+32+8>>2];c[i+648+12>>2]=c[f+32+12>>2];c[i+664>>2]=c[f+48>>2];c[i+664+4>>2]=c[f+48+4>>2];c[i+664+8>>2]=c[f+48+8>>2];c[i+664+12>>2]=c[f+48+12>>2];g[i+688>>2]=0.0;g[i+692>>2]=-1.0;g[i+696>>2]=.8999999761581421;g[i+700>>2]=.30000001192092896;g[i+704>>2]=1.0;g[i+708>>2]=0.0;g[i+712>>2]=0.0;a[i+716>>0]=0;a[i+736>>0]=0;a[i+737>>0]=0;a[i+738>>0]=0;a[i+739>>0]=1;a[i+740>>0]=h&1;c[i+748>>2]=0;g[i+732>>2]=h?-1.0:1.0;return i|0}function Vf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;g=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=g;if(g|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];g=c[a+48>>2]|0;Ja[c[(c[g>>2]|0)+56>>2]&63](g,b+12|0,d)|0;c[b+52>>2]=c[a+12>>2];do if((c[a+52>>2]|0)!=0?((Fa[c[(c[d>>2]|0)+52>>2]&127](d)|0)&1|0)==0:0){e=Ha[c[(c[d>>2]|0)+24>>2]&31](d,c[a+52>>2]|0)|0;if(!e){c[b+40>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,c[a+52>>2]|0)|0;c[b+44>>2]=0;e=c[a+52>>2]|0;e=Fa[c[(c[e>>2]|0)+12>>2]&127](e)|0;e=Ja[c[(c[d>>2]|0)+16>>2]&63](d,e,1)|0;g=c[a+52>>2]|0;g=Ja[c[(c[g>>2]|0)+16>>2]&63](g,c[e+8>>2]|0,d)|0;eb[c[(c[d>>2]|0)+20>>2]&31](d,e,g,1213612625,c[a+52>>2]|0);break}else{c[b+40>>2]=e;c[b+44>>2]=0;break}}else f=8;while(0);if((f|0)==8){c[b+40>>2]=0;c[b+44>>2]=0}if(c[a+56>>2]|0?((Fa[c[(c[d>>2]|0)+52>>2]&127](d)|0)&2|0)==0:0){e=Ha[c[(c[d>>2]|0)+24>>2]&31](d,c[a+56>>2]|0)|0;if(!e){c[b+48>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,c[a+56>>2]|0)|0;b=c[a+56>>2]|0;b=Fa[c[(c[b>>2]|0)+8>>2]&127](b)|0;b=Ja[c[(c[d>>2]|0)+16>>2]&63](d,b,1)|0;g=c[a+56>>2]|0;g=Ja[c[(c[g>>2]|0)+12>>2]&63](g,c[b+8>>2]|0,d)|0;eb[c[(c[d>>2]|0)+20>>2]&31](d,b,g,1346456916,c[a+56>>2]|0);return 20984}else{c[b+48>>2]=e;return 20984}}c[b+48>>2]=0;return 20984}function Wf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c[7169]=(c[7169]|0)+1;k=(e<<16|d)+~((e<<16|d)<<15)|0;k=((10?k>>10:k)^k)*9|0;k=(6?k>>6:k)^k;k=(16?k+~(k<<11)>>16:k+~(k<<11)|0)^k+~(k<<11);l=c[b+12>>2]|0;f=c[(c[b+40>>2]|0)+((l+-1&k)<<2)>>2]|0;a:do if((f|0)!=-1){h=c[b+16>>2]|0;while(1){g=h+(f*12|0)|0;if((c[g>>2]|0)==(d|0)?(c[h+(f*12|0)+4>>2]|0)==(e|0):0)break;f=c[(c[b+60>>2]|0)+(f<<2)>>2]|0;if((f|0)==-1)break a}if(g|0){e=g;return e|0}}while(0);j=c[b+8>>2]|0;if((j|0)==(l|0)){h=(l|0)==0?1:l<<1;if((l|0)<(h|0)){if(!h){f=0;i=l}else{c[7182]=(c[7182]|0)+1;f=xb((h*12|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=c[b+8>>2]|0}if((i|0)>0){g=0;do{m=f+(g*12|0)|0;n=(c[b+16>>2]|0)+(g*12|0)|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];g=g+1|0}while((g|0)!=(i|0))}g=c[b+16>>2]|0;if(g|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=f;c[b+12>>2]=h;f=c[b+8>>2]|0}else{f=l;h=l}}else{f=j;h=l}c[b+8>>2]=f+1;g=c[b+16>>2]|0;if((l|0)<(h|0)){Te(b);f=(c[b+12>>2]|0)+-1&k}else f=l+-1&k;c[g+(j*12|0)>>2]=d;c[g+(j*12|0)+4>>2]=e;c[g+(j*12|0)+8>>2]=0;n=(c[b+40>>2]|0)+(f<<2)|0;c[(c[b+60>>2]|0)+(j<<2)>>2]=c[n>>2];c[n>>2]=j;n=g+(j*12|0)|0;return n|0}function Xf(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0;h=Cs()|0;c[h+4>>2]=4;c[h+8>>2]=-1;c[h+12>>2]=-1;g[h+16>>2]=3402823466385288598117041.0e14;a[h+20>>0]=1;a[h+21>>0]=0;c[h+24>>2]=-1;c[h+28>>2]=b;c[h+32>>2]=d;g[h+36>>2]=0.0;g[h+40>>2]=.30000001192092896;c[h+44>>2]=0;c[h>>2]=7516;c[h+552>>2]=c[e>>2];c[h+552+4>>2]=c[e+4>>2];c[h+552+8>>2]=c[e+8>>2];c[h+552+12>>2]=c[e+12>>2];c[h+568>>2]=c[e+16>>2];c[h+568+4>>2]=c[e+16+4>>2];c[h+568+8>>2]=c[e+16+8>>2];c[h+568+12>>2]=c[e+16+12>>2];c[h+584>>2]=c[e+32>>2];c[h+584+4>>2]=c[e+32+4>>2];c[h+584+8>>2]=c[e+32+8>>2];c[h+584+12>>2]=c[e+32+12>>2];c[h+600>>2]=c[e+48>>2];c[h+600+4>>2]=c[e+48+4>>2];c[h+600+8>>2]=c[e+48+8>>2];c[h+600+12>>2]=c[e+48+12>>2];c[h+616>>2]=c[f>>2];c[h+616+4>>2]=c[f+4>>2];c[h+616+8>>2]=c[f+8>>2];c[h+616+12>>2]=c[f+12>>2];c[h+632>>2]=c[f+16>>2];c[h+632+4>>2]=c[f+16+4>>2];c[h+632+8>>2]=c[f+16+8>>2];c[h+632+12>>2]=c[f+16+12>>2];c[h+648>>2]=c[f+32>>2];c[h+648+4>>2]=c[f+32+4>>2];c[h+648+8>>2]=c[f+32+8>>2];c[h+648+12>>2]=c[f+32+12>>2];c[h+664>>2]=c[f+48>>2];c[h+664+4>>2]=c[f+48+4>>2];c[h+664+8>>2]=c[f+48+8>>2];c[h+664+12>>2]=c[f+48+12>>2];g[h+688>>2]=0.0;g[h+692>>2]=-1.0;g[h+696>>2]=.8999999761581421;g[h+700>>2]=.30000001192092896;g[h+704>>2]=1.0;g[h+708>>2]=0.0;g[h+712>>2]=0.0;a[h+716>>0]=0;a[h+736>>0]=0;a[h+737>>0]=0;a[h+738>>0]=0;a[h+739>>0]=1;a[h+740>>0]=0;c[h+748>>2]=0;g[h+732>>2]=1.0;return h|0}function Yf(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0;c[7182]=(c[7182]|0)+1;b=xb((h+2|0)>>>0>268435455?18:(h+2<<4|3)+16|0)|0;if(!b)j=0;else{c[(b+4+15&-16)+-4>>2]=b;j=b+4+15&-16}k=CI((h+2|0)>>>0>1073741823?-1:h+2<<2)|0;if((h|0)>-2){b=0;do{p=+(b|0)/+(h+1|0);o=+g[e>>2];n=+g[e+4>>2];n=n+p*(+g[f+4>>2]-n);m=+g[e+8>>2];m=m+p*(+g[f+8>>2]-m);g[j+(b<<4)>>2]=o+p*(+g[f>>2]-o);g[j+(b<<4)+4>>2]=n;g[j+(b<<4)+8>>2]=m;g[j+(b<<4)+12>>2]=0.0;g[k+(b<<2)>>2]=1.0;b=b+1|0}while((b|0)<(h+2|0))}c[7182]=(c[7182]|0)+1;b=xb(1271)|0;if(!b)l=0;else{c[(b+4+15&-16)+-4>>2]=b;l=b+4+15&-16}Hb(l,d,h+2|0,j,k);if(i&1|0){g[(c[l+720>>2]|0)+88>>2]=0.0;a[l+924>>0]=1}if(i&2|0){g[(c[l+720>>2]|0)+((h+1|0)*104|0)+88>>2]=0.0;a[l+924>>0]=1}if(j|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}DI(k);if((h|0)<=-1)return l|0;j=l+720|0;k=l+732|0;e=l+740|0;f=l+924|0;b=1;do{r=b+-1|0;q=c[j>>2]|0;oh(l,0);i=(c[k>>2]|0)+-1|0;d=c[e>>2]|0;c[d+(i*52|0)+8>>2]=q+(r*104|0);c[d+(i*52|0)+12>>2]=q+(b*104|0);n=+g[q+(r*104|0)+8>>2]-+g[q+(b*104|0)+8>>2];o=+g[q+(r*104|0)+12>>2]-+g[q+(b*104|0)+12>>2];p=+g[q+(r*104|0)+16>>2]-+g[q+(b*104|0)+16>>2];g[d+(i*52|0)+16>>2]=+x(+(n*n+o*o+p*p));a[f>>0]=1;b=b+1|0}while((b|0)<(h+2|0));return l|0}function Zf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;k=+g[d+100>>2];f=+g[d+16>>2];h=+g[d+20>>2];i=+g[d+24>>2];j=+g[d+108>>2];j=+g[d+112>>2]-k*+g[d+116>>2]-(f*+g[a+64>>2]+h*+g[a+68>>2]+i*+g[a+72>>2]+(+g[d>>2]*+g[a+80>>2]+ +g[d+4>>2]*+g[a+84>>2]+ +g[d+8>>2]*+g[a+88>>2]))*j-j*(+g[d+48>>2]*+g[b+64>>2]+ +g[d+52>>2]*+g[b+68>>2]+ +g[d+56>>2]*+g[b+72>>2]+(+g[d+32>>2]*+g[b+80>>2]+ +g[d+36>>2]*+g[b+84>>2]+ +g[d+40>>2]*+g[b+88>>2]));l=+g[d+120>>2];e=k+j>2]=k+j>2]|0){l=e*h*+g[a+132>>2]*+g[a+116>>2];k=e*i*+g[a+136>>2]*+g[a+120>>2];g[a+64>>2]=+g[a+112>>2]*e*f*+g[a+128>>2]+ +g[a+64>>2];g[a+68>>2]=l+ +g[a+68>>2];g[a+72>>2]=k+ +g[a+72>>2];k=e*+g[a+100>>2]*+g[d+68>>2];l=e*+g[a+104>>2]*+g[d+72>>2];g[a+80>>2]=e*+g[a+96>>2]*+g[d+64>>2]+ +g[a+80>>2];g[a+84>>2]=k+ +g[a+84>>2];g[a+88>>2]=l+ +g[a+88>>2]}if(!(c[b+240>>2]|0))return;l=e*+g[d+52>>2]*+g[b+132>>2]*+g[b+116>>2];k=e*+g[d+56>>2]*+g[b+136>>2]*+g[b+120>>2];g[b+64>>2]=+g[b+112>>2]*e*+g[d+48>>2]*+g[b+128>>2]+ +g[b+64>>2];g[b+68>>2]=l+ +g[b+68>>2];g[b+72>>2]=k+ +g[b+72>>2];k=e*+g[b+100>>2]*+g[d+84>>2];l=e*+g[b+104>>2]*+g[d+88>>2];g[b+80>>2]=e*+g[b+96>>2]*+g[d+80>>2]+ +g[b+80>>2];g[b+84>>2]=k+ +g[b+84>>2];g[b+88>>2]=l+ +g[b+88>>2];return}function _f(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0;J=+g[a+4>>2];I=+g[a+20>>2];H=+g[a+36>>2];F=+g[a+8>>2];E=+g[a+24>>2];D=+g[a+40>>2];B=+g[a+12>>2];z=+g[a+28>>2];x=+g[a+44>>2];u=+g[b+4>>2];t=+g[b+20>>2];s=+g[b+36>>2];q=+g[b+8>>2];p=+g[b+24>>2];o=+g[b+40>>2];m=+g[b+12>>2];k=+g[b+28>>2];i=+g[b+44>>2];c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;A=+g[e>>2];y=+g[e+4>>2];w=+g[e+8>>2];g[d+16>>2]=J*A+I*y+H*w;g[d+20>>2]=F*A+E*y+D*w;g[d+24>>2]=B*A+z*y+x*w;g[d+28>>2]=0.0;l=-+g[e>>2];j=-+g[e+4>>2];h=-+g[e+8>>2];g[d+32>>2]=u*l+t*j+s*h;g[d+36>>2]=q*l+p*j+o*h;g[d+40>>2]=m*l+k*j+i*h;g[d+44>>2]=0.0;G=(J*A+I*y+H*w)*+g[a+396>>2];C=(F*A+E*y+D*w)*+g[a+400>>2];v=(B*A+z*y+x*w)*+g[a+404>>2];g[d+48>>2]=G;g[d+52>>2]=C;g[d+56>>2]=v;g[d+60>>2]=0.0;r=(u*l+t*j+s*h)*+g[b+396>>2];n=(q*l+p*j+o*h)*+g[b+400>>2];f=(m*l+k*j+i*h)*+g[b+404>>2];g[d+64>>2]=r;g[d+68>>2]=n;g[d+72>>2]=f;g[d+76>>2]=0.0;g[d+80>>2]=(J*A+I*y+H*w)*G+(F*A+E*y+D*w)*C+(B*A+z*y+x*w)*v+((u*l+t*j+s*h)*r+(q*l+p*j+o*h)*n+(m*l+k*j+i*h)*f);return}function $f(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;k=sa;sa=sa+96|0;g=c[b+8>>2]|0;if((g|0)==(c[b+12>>2]|0)?(j=(g|0)==0?1:g<<1,(g|0)<(j|0)):0){if(!j)i=0;else{c[7182]=(c[7182]|0)+1;g=xb((j<<2|3)+16|0)|0;if(!g)g=0;else{c[(g+4+15&-16)+-4>>2]=g;g=g+4+15&-16}i=g;g=c[b+8>>2]|0}if((g|0)>0){h=0;do{c[i+(h<<2)>>2]=c[(c[b+16>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(g|0))}h=c[b+16>>2]|0;if(h){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);g=c[b+8>>2]|0}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=i;c[b+12>>2]=j}c[(c[b+16>>2]|0)+(g<<2)>>2]=d;c[b+8>>2]=g+1;c[k+32>>2]=c[d+4>>2];c[k+32+4>>2]=c[d+4+4>>2];c[k+32+8>>2]=c[d+4+8>>2];c[k+32+12>>2]=c[d+4+12>>2];c[k+32+16>>2]=c[d+20>>2];c[k+32+16+4>>2]=c[d+20+4>>2];c[k+32+16+8>>2]=c[d+20+8>>2];c[k+32+16+12>>2]=c[d+20+12>>2];c[k+32+32>>2]=c[d+36>>2];c[k+32+32+4>>2]=c[d+36+4>>2];c[k+32+32+8>>2]=c[d+36+8>>2];c[k+32+32+12>>2]=c[d+36+12>>2];c[k+32+48>>2]=c[d+52>>2];c[k+32+48+4>>2]=c[d+52+4>>2];c[k+32+48+8>>2]=c[d+52+8>>2];c[k+32+48+12>>2]=c[d+52+12>>2];j=c[d+192>>2]|0;ab[c[(c[j>>2]|0)+8>>2]&127](j,k+32|0,k+16|0,k);j=c[b+68>>2]|0;c[d+188>>2]=Ma[c[(c[j>>2]|0)+8>>2]&3](j,k+16|0,k,c[(c[d+192>>2]|0)+4>>2]|0,d,e,f,c[b+24>>2]|0,0)|0;sa=k;return}function ag(b){b=b|0;var d=0,e=0,f=0;c[b>>2]=6904;if(a[b+272>>0]|0?(d=c[b+204>>2]|0,Pa[c[c[d>>2]>>2]&511](d),d=c[b+204>>2]|0,d|0):0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+196>>2]|0;if(d|0?(Pa[c[c[d>>2]>>2]&511](d),e=c[b+196>>2]|0,e|0):0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}if(a[b+273>>0]|0?(f=c[b+200>>2]|0,Pa[c[c[f>>2]>>2]&511](f),f=c[b+200>>2]|0,f|0):0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}d=c[b+316>>2]|0;if(d|0){if(a[b+320>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+316>>2]=0}a[b+320>>0]=1;c[b+316>>2]=0;c[b+308>>2]=0;c[b+312>>2]=0;d=c[b+288>>2]|0;if(d|0){if(a[b+292>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+288>>2]=0}a[b+292>>0]=1;c[b+288>>2]=0;c[b+280>>2]=0;c[b+284>>2]=0;d=c[b+240>>2]|0;if(d|0){if(a[b+244>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+240>>2]=0}a[b+244>>0]=1;c[b+240>>2]=0;c[b+232>>2]=0;c[b+236>>2]=0;d=c[b+220>>2]|0;if(d|0){if(a[b+224>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+220>>2]=0}a[b+224>>0]=1;c[b+220>>2]=0;c[b+212>>2]=0;c[b+216>>2]=0;d=c[b+188>>2]|0;if(!d){a[b+192>>0]=1;c[b+188>>2]=0;c[b+180>>2]=0;f=b+184|0;c[f>>2]=0;cj(b);return}if(a[b+192>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+188>>2]=0;a[b+192>>0]=1;c[b+188>>2]=0;c[b+180>>2]=0;f=b+184|0;c[f>>2]=0;cj(b);return}function bg(b,d,e,f,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=+f;h=+h;i=+i;j=j|0;k=k|0;l=l|0;var m=0.0,n=0.0,o=0.0,p=0;p=os()|0;c[p+8>>2]=0;g[p+12>>2]=0.0;c[p>>2]=10968;c[p+4>>2]=24;c[p+64>>2]=b;c[p+68>>2]=d;g[p+72>>2]=h;g[p+76>>2]=i;g[p+80>>2]=+(b+-1|0);g[p+84>>2]=+(d+-1|0);g[p+88>>2]=f;c[p+92>>2]=e;c[p+96>>2]=k;a[p+100>>0]=l&1;a[p+101>>0]=0;a[p+102>>0]=0;c[p+104>>2]=j;c[p+108>>2]=1065353216;c[p+112>>2]=1065353216;c[p+116>>2]=1065353216;g[p+120>>2]=0.0;switch(j|0){case 0:{g[p+16>>2]=h;c[p+20>>2]=0;c[p+24>>2]=0;g[p+28>>2]=0.0;g[p+32>>2]=i;g[p+36>>2]=+(b+-1|0);g[p+40>>2]=+(d+-1|0);g[p+44>>2]=0.0;n=i;o=h;f=+(b+-1|0);m=0.0;i=+(d+-1|0);h=0.0;break}case 1:{c[p+16>>2]=0;g[p+20>>2]=h;c[p+24>>2]=0;g[p+28>>2]=0.0;g[p+32>>2]=+(b+-1|0);g[p+36>>2]=i;g[p+40>>2]=+(d+-1|0);g[p+44>>2]=0.0;n=+(b+-1|0);o=0.0;f=i;m=h;i=+(d+-1|0);h=0.0;break}case 2:{c[p+16>>2]=0;c[p+20>>2]=0;g[p+24>>2]=h;g[p+28>>2]=0.0;g[p+32>>2]=+(b+-1|0);g[p+36>>2]=+(d+-1|0);g[p+40>>2]=i;g[p+44>>2]=0.0;n=+(b+-1|0);o=0.0;f=+(d+-1|0);m=0.0;break}default:{n=+g[p+32>>2];o=+g[p+16>>2];f=+g[p+36>>2];m=+g[p+20>>2];i=+g[p+40>>2];h=+g[p+24>>2]}}g[p+48>>2]=(o+n)*.5;g[p+52>>2]=(m+f)*.5;g[p+56>>2]=(h+i)*.5;g[p+60>>2]=0.0;return p|0}function cg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;while(1){m=c[a+12>>2]|0;n=c[m+(((b+d|0)/2|0)<<2)>>2]|0;e=b;f=d;while(1){l=c[(c[n+740>>2]|0)+208>>2]|0;if((l|0)>-1)while(1){i=m+(e<<2)|0;h=c[i>>2]|0;g=c[(c[h+740>>2]|0)+208>>2]|0;if((g|0)<=-1)g=c[(c[h+744>>2]|0)+208>>2]|0;if((g|0)<(l|0))e=e+1|0;else{k=i;break}}else{i=c[(c[n+744>>2]|0)+208>>2]|0;while(1){j=m+(e<<2)|0;h=c[j>>2]|0;g=c[(c[h+740>>2]|0)+208>>2]|0;if((g|0)<=-1)g=c[(c[h+744>>2]|0)+208>>2]|0;if((g|0)<(i|0))e=e+1|0;else{k=j;break}}}if((l|0)>-1)while(1){g=m+(f<<2)|0;i=c[g>>2]|0;h=c[(c[i+740>>2]|0)+208>>2]|0;if((h|0)<=-1)h=c[(c[i+744>>2]|0)+208>>2]|0;if((l|0)<(h|0))f=f+-1|0;else break}else{j=c[(c[n+744>>2]|0)+208>>2]|0;while(1){g=m+(f<<2)|0;i=c[g>>2]|0;h=c[(c[i+740>>2]|0)+208>>2]|0;if((h|0)<=-1)h=c[(c[i+744>>2]|0)+208>>2]|0;if((j|0)<(h|0))f=f+-1|0;else break}}if((e|0)<=(f|0)){m=c[k>>2]|0;c[k>>2]=c[g>>2];c[(c[a+12>>2]|0)+(f<<2)>>2]=m;e=e+1|0;f=f+-1|0}if((e|0)>(f|0))break;m=c[a+12>>2]|0}if((f|0)>(b|0))cg(a,b,f);if((e|0)<(d|0))b=e;else break}return}function dg(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0;h=sa;sa=sa+64|0;a[d+84>>0]=0;c[h>>2]=c[b+4>>2];c[h+4>>2]=c[b+4+4>>2];c[h+8>>2]=c[b+4+8>>2];c[h+12>>2]=c[b+4+12>>2];c[h+16>>2]=c[b+20>>2];c[h+16+4>>2]=c[b+20+4>>2];c[h+16+8>>2]=c[b+20+8>>2];c[h+16+12>>2]=c[b+20+12>>2];c[h+32>>2]=c[b+36>>2];c[h+32+4>>2]=c[b+36+4>>2];c[h+32+8>>2]=c[b+36+8>>2];c[h+32+12>>2]=c[b+36+12>>2];c[h+48>>2]=c[b+52>>2];c[h+48+4>>2]=c[b+52+4>>2];c[h+48+8>>2]=c[b+52+8>>2];c[h+48+12>>2]=c[b+52+12>>2];if(e?(f=c[b+480>>2]|0,f|0):0)Va[c[(c[f>>2]|0)+8>>2]&127](f,h);v=+g[d+156>>2];t=+g[h>>2];u=+g[d+160>>2];s=+g[h+4>>2];m=+g[d+164>>2];r=+g[h+8>>2];q=+g[h+16>>2];p=+g[h+20>>2];o=+g[h+24>>2];n=+g[h+32>>2];l=+g[h+36>>2];j=+g[h+40>>2];k=v*q+u*p+m*o+ +g[h+52>>2];i=v*n+u*l+m*j+ +g[h+56>>2];g[d+36>>2]=v*t+u*s+m*r+ +g[h+48>>2];g[d+40>>2]=k;g[d+44>>2]=i;g[d+48>>2]=0.0;i=+g[d+172>>2];k=+g[d+176>>2];m=+g[d+180>>2];g[d+52>>2]=t*i+s*k+r*m;g[d+56>>2]=i*q+k*p+m*o;g[d+60>>2]=i*n+k*l+m*j;g[d+64>>2]=0.0;m=+g[d+188>>2];k=+g[d+192>>2];i=+g[d+196>>2];g[d+68>>2]=t*m+s*k+r*i;g[d+72>>2]=q*m+p*k+o*i;g[d+76>>2]=n*m+l*k+j*i;g[d+80>>2]=0.0;sa=h;return}function eg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);b=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=b;break a}case 10:{b=(c[d>>2]|0)+(4-1)&~(4-1);e=c[b>>2]|0;c[d>>2]=b+4;c[a>>2]=e;c[a+4>>2]=((e|0)<0)<<31>>31;break a}case 11:{b=(c[d>>2]|0)+(4-1)&~(4-1);e=c[b>>2]|0;c[d>>2]=b+4;c[a>>2]=e;c[a+4>>2]=0;break a}case 12:{f=(c[d>>2]|0)+(8-1)&~(8-1);b=c[f>>2]|0;e=c[f+4>>2]|0;c[d>>2]=f+8;c[a>>2]=b;c[a+4>>2]=e;break a}case 13:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=(f&65535)<<16>>16;c[a+4>>2]=(((f&65535)<<16>>16|0)<0)<<31>>31;break a}case 14:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=f&65535;c[a+4>>2]=0;break a}case 15:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=(f&255)<<24>>24;c[a+4>>2]=(((f&255)<<24>>24|0)<0)<<31>>31;break a}case 16:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=f&255;c[a+4>>2]=0;break a}case 17:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}case 18:{f=(c[d>>2]|0)+(8-1)&~(8-1);g=+h[f>>3];c[d>>2]=f+8;h[a>>3]=g;break a}default:break a}while(0);while(0);return}function fg(a,b,d,e,f,h,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=+j;k=k|0;l=+l;var m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0;c[a>>2]=c[h>>2];c[a+4>>2]=c[h+4>>2];c[a+8>>2]=c[h+8>>2];c[a+12>>2]=c[h+12>>2];t=+g[e+4>>2];q=+g[a+8>>2];o=+g[e+8>>2];u=+g[a+4>>2];n=+g[a>>2];w=+g[e>>2];x=(t*q-o*u)*+g[b>>2]+ +g[b+4>>2]*(o*n-q*w)+(u*w-t*n)*+g[b+8>>2];v=(t*q-o*u)*+g[b+16>>2]+(o*n-q*w)*+g[b+20>>2]+(u*w-t*n)*+g[b+24>>2];t=(t*q-o*u)*+g[b+32>>2]+(o*n-q*w)*+g[b+36>>2]+(u*w-t*n)*+g[b+40>>2];g[a+16>>2]=x;g[a+20>>2]=v;g[a+24>>2]=t;g[a+28>>2]=0.0;w=+g[f+4>>2];o=+g[f+8>>2];s=+g[f>>2];r=+g[d>>2]*(w*-q-o*-u)+ +g[d+4>>2]*(o*-n-s*-q)+(s*-u-w*-n)*+g[d+8>>2];p=(w*-q-o*-u)*+g[d+16>>2]+(o*-n-s*-q)*+g[d+20>>2]+(s*-u-w*-n)*+g[d+24>>2];n=(w*-q-o*-u)*+g[d+32>>2]+(o*-n-s*-q)*+g[d+36>>2]+(s*-u-w*-n)*+g[d+40>>2];g[a+32>>2]=r;g[a+36>>2]=p;g[a+40>>2]=n;g[a+44>>2]=0.0;w=+g[i>>2]*x;u=+g[i+4>>2]*v;s=+g[i+8>>2]*t;g[a+48>>2]=w;g[a+52>>2]=u;g[a+56>>2]=s;g[a+60>>2]=0.0;q=+g[k>>2]*r;o=+g[k+4>>2]*p;m=+g[k+8>>2]*n;g[a+64>>2]=q;g[a+68>>2]=o;g[a+72>>2]=m;g[a+76>>2]=0.0;g[a+80>>2]=x*w+v*u+t*s+j+l+(r*q+p*o+n*m);return}function gg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0;v=sa;sa=sa+2048|0;if((e|0)<=0){sa=v;return}f=0;do{g[d+(f<<4)+12>>2]=-999999984306749440.0;f=f+1|0}while((f|0)!=(e|0));o=0;do{if((Fa[c[(c[a>>2]|0)+96>>2]&127](a)|0)>0){p=b+(o<<4)|0;q=b+(o<<4)+4|0;r=b+(o<<4)+8|0;s=d+(o<<4)+12|0;t=d+(o<<4)|0;n=0;do{if(((Fa[c[(c[a>>2]|0)+96>>2]&127](a)|0)-n|0)<128){f=(Fa[c[(c[a>>2]|0)+96>>2]&127](a)|0)-n|0;if((f|0)>0)u=11;else{i=-3402823466385288598117041.0e14;f=-1}}else{f=128;u=11}if((u|0)==11){u=0;h=0;do{Za[c[(c[a>>2]|0)+108>>2]&127](a,h,v+(h<<4)|0);h=h+1|0}while((h|0)!=(f|0));k=+g[p>>2];l=+g[q>>2];m=+g[r>>2];h=-1;j=0;i=-3402823466385288598117041.0e14;do{w=k*+g[v+(j<<4)>>2]+l*+g[v+(j<<4)+4>>2]+m*+g[v+(j<<4)+8>>2];x=w>i;h=x?j:h;i=x?w:i;j=j+1|0}while((j|0)!=(f|0));f=h}if(i>+g[s>>2]){x=v+(f<<4)|0;c[t>>2]=c[x>>2];c[t+4>>2]=c[x+4>>2];c[t+8>>2]=c[x+8>>2];c[t+12>>2]=c[x+12>>2];g[s>>2]=i}n=n+128|0}while((n|0)<(Fa[c[(c[a>>2]|0)+96>>2]&127](a)|0))}o=o+1|0}while((o|0)!=(e|0));sa=v;return}function hg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;while(1){l=c[a+12>>2]|0;m=c[l+(((b+d|0)/2|0)<<2)>>2]|0;e=b;f=d;while(1){k=c[(c[m+28>>2]|0)+208>>2]|0;if((k|0)>-1)while(1){i=l+(e<<2)|0;h=c[i>>2]|0;g=c[(c[h+28>>2]|0)+208>>2]|0;if((g|0)<=-1)g=c[(c[h+32>>2]|0)+208>>2]|0;if((g|0)<(k|0))e=e+1|0;else{j=i;break}}else{i=c[(c[m+32>>2]|0)+208>>2]|0;while(1){j=l+(e<<2)|0;h=c[j>>2]|0;g=c[(c[h+28>>2]|0)+208>>2]|0;if((g|0)<=-1)g=c[(c[h+32>>2]|0)+208>>2]|0;if((g|0)<(i|0))e=e+1|0;else break}}if((k|0)>-1)while(1){g=l+(f<<2)|0;i=c[g>>2]|0;h=c[(c[i+28>>2]|0)+208>>2]|0;if((h|0)<=-1)h=c[(c[i+32>>2]|0)+208>>2]|0;if((k|0)<(h|0))f=f+-1|0;else break}else{k=c[(c[m+32>>2]|0)+208>>2]|0;while(1){g=l+(f<<2)|0;i=c[g>>2]|0;h=c[(c[i+28>>2]|0)+208>>2]|0;if((h|0)<=-1)h=c[(c[i+32>>2]|0)+208>>2]|0;if((k|0)<(h|0))f=f+-1|0;else break}}if((e|0)<=(f|0)){l=c[j>>2]|0;c[j>>2]=c[g>>2];c[(c[a+12>>2]|0)+(f<<2)>>2]=l;e=e+1|0;f=f+-1|0}if((e|0)>(f|0))break;l=c[a+12>>2]|0}if((f|0)>(b|0))hg(a,b,f);if((e|0)<(d|0))b=e;else break}return}function ig(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0,s=0.0,t=0,u=0;t=sa;sa=sa+16|0;h=c[a+52>>2]|0;s=+g[a+28+(((h+2|0)%3|0)<<2)>>2];if((e|0)<=0){sa=t;return}f=0;while(1){c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+(h<<2)>>2]=c[a+28+(h<<2)>>2];h=b+(f<<4)|0;q=b+(f<<4)+4|0;r=b+(f<<4)+8|0;l=s*+g[h>>2]+ +g[t>>2];m=s*+g[q>>2]+ +g[t+4>>2];n=s*+g[r>>2]+ +g[t+8>>2];o=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=+g[h>>2];j=+g[q>>2];k=+g[r>>2];if(i*(l-o*i)+j*(m-o*j)+k*(n-o*k)>-999999984306749440.0){g[d+(f<<4)>>2]=l-o*i;g[d+(f<<4)+4>>2]=m-o*j;g[d+(f<<4)+8>>2]=n-o*k;g[d+(f<<4)+12>>2]=0.0;p=i*(l-o*i)+j*(m-o*j)+k*(n-o*k);i=+g[h>>2];j=+g[q>>2];k=+g[r>>2]}else p=-999999984306749440.0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;u=c[a+52>>2]|0;g[t+(u<<2)>>2]=-+g[a+28+(u<<2)>>2];o=s*i+ +g[t>>2];n=s*j+ +g[t+4>>2];l=s*k+ +g[t+8>>2];m=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+g[h>>2];j=+g[q>>2];i=+g[r>>2];if(k*(o-m*k)+j*(n-m*j)+i*(l-m*i)>p){g[d+(f<<4)>>2]=o-m*k;g[d+(f<<4)+4>>2]=n-m*j;g[d+(f<<4)+8>>2]=l-m*i;g[d+(f<<4)+12>>2]=0.0}f=f+1|0;if((f|0)==(e|0))break;h=c[a+52>>2]|0}sa=t;return}function jg(a,b,c,d,e,f,h){a=a|0;b=+b;c=+c;d=+d;e=e|0;f=+f;h=h|0;var i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;k=sa;sa=sa+16|0;j=c*f+ +g[a+52>>2];i=d*f+ +g[a+56>>2];g[h+48>>2]=b*f+ +g[a+48>>2];g[h+52>>2]=j;g[h+56>>2]=i;g[h+60>>2]=0.0;i=+g[e>>2];j=+g[e+4>>2];d=+g[e+8>>2];b=+x(+(i*i+j*j+d*d));b=b*f>.7853981852531433?.7853981852531433/f:b;if(b<1.0000000474974513e-03)c=f*.5-b*f*f*f*.02083333395421505*b;else c=+A(+(b*.5*f))/b;m=d*c;n=j*c;o=i*c;q=+z(+(b*f*.5));Og(a,k);b=+g[k>>2];p=+g[k+12>>2];i=+g[k+8>>2];f=+g[k+4>>2];c=1.0/+x(+((q*p-o*b-n*f-m*i)*(q*p-o*b-n*f-m*i)+((m*p+q*i+o*f-n*b)*(m*p+q*i+o*f-n*b)+((q*b+o*p+n*i-m*f)*(q*b+o*p+n*i-m*f)+(m*b+(n*p+q*f)-o*i)*(m*b+(n*p+q*f)-o*i)))));d=(q*b+o*p+n*i-m*f)*c;j=(m*b+(n*p+q*f)-o*i)*c;l=(m*p+q*i+o*f-n*b)*c;c=(q*p-o*b-n*f-m*i)*c;i=d*(2.0/(c*c+(l*l+(d*d+j*j))));f=j*(2.0/(c*c+(l*l+(d*d+j*j))));b=l*(2.0/(c*c+(l*l+(d*d+j*j))));g[h>>2]=1.0-(j*f+l*b);g[h+4>>2]=d*f-c*b;g[h+8>>2]=d*b+c*f;g[h+12>>2]=0.0;g[h+16>>2]=d*f+c*b;g[h+20>>2]=1.0-(d*i+l*b);g[h+24>>2]=j*b-c*i;g[h+28>>2]=0.0;g[h+32>>2]=d*b-c*f;g[h+36>>2]=j*b+c*i;g[h+40>>2]=1.0-(d*i+j*f);g[h+44>>2]=0.0;sa=k;return}function kg(b,d){b=b|0;d=d|0;var e=0;e=ts()|0;_i(e,5,b);c[e>>2]=7460;c[e+300>>2]=c[d>>2];c[e+300+4>>2]=c[d+4>>2];c[e+300+8>>2]=c[d+8>>2];c[e+300+12>>2]=c[d+12>>2];c[e+316>>2]=c[d+16>>2];c[e+316+4>>2]=c[d+16+4>>2];c[e+316+8>>2]=c[d+16+8>>2];c[e+316+12>>2]=c[d+16+12>>2];c[e+332>>2]=c[d+32>>2];c[e+332+4>>2]=c[d+32+4>>2];c[e+332+8>>2]=c[d+32+8>>2];c[e+332+12>>2]=c[d+32+12>>2];c[e+348>>2]=c[d+48>>2];c[e+348+4>>2]=c[d+48+4>>2];c[e+348+8>>2]=c[d+48+8>>2];c[e+348+12>>2]=c[d+48+12>>2];a[e+527>>0]=0;c[e+364>>2]=c[e+300>>2];c[e+364+4>>2]=c[e+300+4>>2];c[e+364+8>>2]=c[e+300+8>>2];c[e+364+12>>2]=c[e+300+12>>2];c[e+380>>2]=c[e+316>>2];c[e+380+4>>2]=c[e+316+4>>2];c[e+380+8>>2]=c[e+316+8>>2];c[e+380+12>>2]=c[e+316+12>>2];c[e+396>>2]=c[e+332>>2];c[e+396+4>>2]=c[e+332+4>>2];c[e+396+8>>2]=c[e+332+8>>2];c[e+396+12>>2]=c[e+332+12>>2];a[e+524>>0]=0;a[e+525>>0]=0;a[e+526>>0]=0;a[e+552>>0]=0;c[e+412>>2]=0;c[e+412+4>>2]=0;c[e+412+8>>2]=0;c[e+412+12>>2]=0;g[e+572>>2]=-1.0;g[e+444>>2]=999999984306749440.0;g[e+448>>2]=999999984306749440.0;g[e+452>>2]=999999984306749440.0;g[e+428>>2]=1.0;g[e+432>>2]=.30000001192092896;g[e+436>>2]=1.0;g[e+440>>2]=.009999999776482582;g[e+456>>2]=.05000000074505806;c[e+592>>2]=0;g[e+596>>2]=0.0;g[e+600>>2]=.699999988079071;g[e+604>>2]=0.0;return e|0}function lg(a,b,d,e,f,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var k=0.0,l=0.0,m=0,n=0.0,o=0,p=0.0,q=0,r=0.0,s=0;q=sa;sa=sa+16|0;g[e>>2]=3402823466385288598117041.0e14;g[f>>2]=-3402823466385288598117041.0e14;o=c[a+96>>2]|0;if((o|0)>0){m=0;do{s=c[a+104>>2]|0;r=+g[s+(m<<4)>>2]*+g[a+12>>2];p=+g[s+(m<<4)+4>>2]*+g[a+16>>2];n=+g[s+(m<<4)+8>>2]*+g[a+20>>2];k=r*+g[b>>2]+p*+g[b+4>>2]+n*+g[b+8>>2]+ +g[b+48>>2];l=r*+g[b+16>>2]+p*+g[b+20>>2]+n*+g[b+24>>2]+ +g[b+52>>2];n=r*+g[b+32>>2]+p*+g[b+36>>2]+n*+g[b+40>>2]+ +g[b+56>>2];p=k*+g[d>>2]+l*+g[d+4>>2]+n*+g[d+8>>2];if(p<+g[e>>2]){g[e>>2]=p;g[h>>2]=k;g[h+4>>2]=l;g[h+8>>2]=n;g[h+12>>2]=0.0}if(p>+g[f>>2]){g[f>>2]=p;g[i>>2]=k;g[i+4>>2]=l;g[i+8>>2]=n;g[i+12>>2]=0.0}m=m+1|0}while((m|0)!=(o|0));r=+g[f>>2];l=r;m=(g[j>>2]=r,c[j>>2]|0)}else{l=-3402823466385288598117041.0e14;m=-8388609}k=+g[e>>2];if(!(k>l)){sa=q;return}c[e>>2]=m;g[f>>2]=k;c[q>>2]=c[h>>2];c[q+4>>2]=c[h+4>>2];c[q+8>>2]=c[h+8>>2];c[q+12>>2]=c[h+12>>2];c[h>>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];c[i>>2]=c[q>>2];c[i+4>>2]=c[q+4>>2];c[i+8>>2]=c[q+8>>2];c[i+12>>2]=c[q+12>>2];sa=q;return}function mg(a,b){a=a|0;b=b|0;var d=0,e=0;d=sa;sa=sa+48|0;e=(c[a+48>>2]|0)+4|0;c[e>>2]=c[b>>2];c[e+4>>2]=c[b+4>>2];c[e+8>>2]=c[b+8>>2];c[e+12>>2]=c[b+12>>2];b=d+32+4|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;g[d+32>>2]=1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d+16|0,a,d+32|0);g[a+32>>2]=+g[d+16>>2]+ +g[a+12>>2];g[d+32>>2]=-1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d,a,d+32|0);c[d+16>>2]=c[d>>2];c[d+16+4>>2]=c[d+4>>2];c[d+16+8>>2]=c[d+8>>2];c[d+16+12>>2]=c[d+12>>2];g[a+16>>2]=+g[d+16>>2]-+g[a+12>>2];c[d+32>>2]=0;c[d+32+4>>2]=0;c[d+32+8>>2]=0;c[d+32+12>>2]=0;g[b>>2]=1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d+16|0,a,d+32|0);g[a+36>>2]=+g[d+16+4>>2]+ +g[a+12>>2];g[b>>2]=-1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d,a,d+32|0);c[d+16>>2]=c[d>>2];c[d+16+4>>2]=c[d+4>>2];c[d+16+8>>2]=c[d+8>>2];c[d+16+12>>2]=c[d+12>>2];g[a+20>>2]=+g[d+16+4>>2]-+g[a+12>>2];c[d+32>>2]=0;c[d+32+4>>2]=0;c[d+32+8>>2]=0;c[d+32+12>>2]=0;g[d+32+8>>2]=1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d+16|0,a,d+32|0);g[a+40>>2]=+g[d+16+8>>2]+ +g[a+12>>2];g[d+32+8>>2]=-1.0;Za[c[(c[a>>2]|0)+68>>2]&127](d,a,d+32|0);c[d+16>>2]=c[d>>2];c[d+16+4>>2]=c[d+4>>2];c[d+16+8>>2]=c[d+8>>2];c[d+16+12>>2]=c[d+12>>2];g[a+24>>2]=+g[d+16+8>>2]-+g[a+12>>2];sa=d;return}function ng(b,d,e){b=b|0;d=+d;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;f=c[b+8>>2]|0;if(f|0?(c[f+204>>2]&3|0)==0:0){if((c[f+216>>2]&-2|0)!=4)c[f+216>>2]=1;g[f+220>>2]=0.0}f=c[b+12>>2]|0;if(f|0?(c[f+204>>2]&3|0)==0:0){if((c[f+216>>2]&-2|0)!=4)c[f+216>>2]=1;g[f+220>>2]=0.0}f=c[b+20>>2]|0;if(f|0?(c[f+204>>2]&3|0)==0:0){if((c[f+216>>2]&-2|0)!=4)c[f+216>>2]=1;g[f+220>>2]=0.0}f=c[b+24>>2]|0;if(f|0?(c[f+204>>2]&3|0)==0:0){if((c[f+216>>2]&-2|0)!=4)c[f+216>>2]=1;g[f+220>>2]=0.0}f=c[b+156>>2]|0;c[b+156>>2]=f+1;a[b+152>>0]=(f|0)>=(c[b+160>>2]|0)&1;if(f|0){c[b+72>>2]=0;c[b+72+4>>2]=0;c[b+72+8>>2]=0;c[b+72+12>>2]=0;c[b+72+16>>2]=0;c[b+72+20>>2]=0;c[b+72+24>>2]=0;c[b+72+28>>2]=0;return}j=+g[b+64>>2];i=1.0/d*+g[b+72>>2]*j;h=1.0/d*j*+g[b+76>>2];d=1.0/d*j*+g[b+80>>2];g[b+72>>2]=i;g[b+76>>2]=h;g[b+80>>2]=d;g[b+84>>2]=0.0;j=+g[b+68>>2];if(j>0.0){l=j*i*+g[b+120>>2]+j*h*+g[b+124>>2]+j*d*+g[b+128>>2];k=j*i*+g[b+136>>2]+j*h*+g[b+140>>2]+j*d*+g[b+144>>2];g[b+88>>2]=j*i*+g[b+104>>2]+j*h*+g[b+108>>2]+j*d*+g[b+112>>2];g[b+92>>2]=l;g[b+96>>2]=k;g[b+100>>2]=0.0;g[b+72>>2]=(1.0-j)*i;g[b+76>>2]=(1.0-j)*h;g[b+80>>2]=(1.0-j)*d;i=(1.0-j)*i;h=(1.0-j)*h;d=(1.0-j)*d}g[b+72>>2]=1.0/+(e|0)*i;g[b+76>>2]=1.0/+(e|0)*h;g[b+80>>2]=1.0/+(e|0)*d;return}function og(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0;j=sa;sa=sa+48|0;m=+g[d>>2];n=+g[d+4>>2];l=+g[d+8>>2];o=m*+g[b+4>>2]+n*+g[b+20>>2]+l*+g[b+36>>2];p=m*+g[b+8>>2]+n*+g[b+24>>2]+l*+g[b+40>>2];g[j+32>>2]=+g[b>>2]*m+ +g[b+16>>2]*n+ +g[b+32>>2]*l;g[j+32+4>>2]=o;g[j+32+8>>2]=p;g[j+32+12>>2]=0.0;Za[c[(c[a>>2]|0)+64>>2]&127](j+16|0,a,j+32|0);p=+g[j+16>>2];o=+g[j+16+4>>2];l=+g[j+16+8>>2];n=p*+g[b>>2]+o*+g[b+4>>2]+l*+g[b+8>>2]+ +g[b+48>>2];m=p*+g[b+16>>2]+o*+g[b+20>>2]+l*+g[b+24>>2]+ +g[b+52>>2];l=p*+g[b+32>>2]+o*+g[b+36>>2]+l*+g[b+40>>2]+ +g[b+56>>2];q=c[(c[a>>2]|0)+64>>2]|0;o=-+g[j+32+4>>2];p=-+g[j+32+8>>2];g[j>>2]=-+g[j+32>>2];g[j+4>>2]=o;g[j+8>>2]=p;g[j+12>>2]=0.0;Za[q&127](j+16|0,a,j);p=+g[j+16>>2];o=+g[j+16+4>>2];h=+g[j+16+8>>2];k=p*+g[b>>2]+o*+g[b+4>>2]+h*+g[b+8>>2]+ +g[b+48>>2];i=p*+g[b+16>>2]+o*+g[b+20>>2]+h*+g[b+24>>2]+ +g[b+52>>2];h=p*+g[b+32>>2]+o*+g[b+36>>2]+h*+g[b+40>>2]+ +g[b+56>>2];g[e>>2]=n*+g[d>>2]+m*+g[d+4>>2]+l*+g[d+8>>2];h=k*+g[d>>2]+i*+g[d+4>>2]+h*+g[d+8>>2];g[f>>2]=h;i=+g[e>>2];if(!(i>h)){sa=j;return}g[e>>2]=h;g[f>>2]=i;sa=j;return}function pg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=sa;sa=sa+16|0;j=c[a+12>>2]|0;k=c[j+(((d+b|0)/2|0)<<4)>>2]|0;l=c[j+(((d+b|0)/2|0)<<4)+4>>2]|0;m=c[j+(((d+b|0)/2|0)<<4)+8>>2]|0;f=d;e=b;while(1){while(1){i=j+(e<<4)|0;g=c[j+(e<<4)+4>>2]|0;if((g|0)>=(l|0)){if((g|0)!=(l|0))break;g=c[i>>2]|0;if((g|0)>=(k|0)){if((g|0)!=(k|0))break;if((c[j+(e<<4)+8>>2]|0)>=(m|0))break}}e=e+1|0}while(1){h=j+(f<<4)|0;g=c[j+(f<<4)+4>>2]|0;if((l|0)>=(g|0)){if((l|0)!=(g|0))break;g=c[h>>2]|0;if((k|0)>=(g|0)){if((k|0)!=(g|0))break;if((m|0)>=(c[j+(f<<4)+8>>2]|0))break}}f=f+-1|0}if((e|0)<=(f|0)){c[n>>2]=c[i>>2];c[n+4>>2]=c[i+4>>2];c[n+8>>2]=c[i+8>>2];c[n+12>>2]=c[i+12>>2];c[i>>2]=c[h>>2];c[i+4>>2]=c[h+4>>2];c[i+8>>2]=c[h+8>>2];c[i+12>>2]=c[h+12>>2];j=(c[a+12>>2]|0)+(f<<4)|0;c[j>>2]=c[n>>2];c[j+4>>2]=c[n+4>>2];c[j+8>>2]=c[n+8>>2];c[j+12>>2]=c[n+12>>2];f=f+-1|0;e=e+1|0}if((e|0)>(f|0))break;j=c[a+12>>2]|0}if((f|0)>(b|0))pg(a,b,f);if((e|0)>=(d|0)){sa=n;return}pg(a,e,d);sa=n;return}function qg(a){a=a|0;var b=0,d=0,e=0.0,f=0.0,h=0.0,i=0,j=0;i=c[a+28>>2]|0;e=0.0;f=0.0;h=0.0;j=0;a:while(1){switch(j&2147483647|0){case 0:{e=+g[a+80>>2]+ +g[a+64>>2];f=+g[a+84>>2]+ +g[a+68>>2];h=+g[a+88>>2]+ +g[a+72>>2];break}case 1:{e=+g[a+80>>2]+ +g[a+64>>2];f=+g[a+84>>2]+ +g[a+68>>2];h=+g[a+72>>2]-+g[a+88>>2];break}case 2:{e=+g[a+80>>2]+ +g[a+64>>2];f=+g[a+68>>2]-+g[a+84>>2];h=+g[a+88>>2]+ +g[a+72>>2];break}case 3:{e=+g[a+80>>2]+ +g[a+64>>2];f=+g[a+68>>2]-+g[a+84>>2];h=+g[a+72>>2]-+g[a+88>>2];break}case 4:{e=+g[a+64>>2]-+g[a+80>>2];f=+g[a+84>>2]+ +g[a+68>>2];h=+g[a+88>>2]+ +g[a+72>>2];break}case 5:{e=+g[a+64>>2]-+g[a+80>>2];f=+g[a+84>>2]+ +g[a+68>>2];h=+g[a+72>>2]-+g[a+88>>2];break}case 6:{e=+g[a+64>>2]-+g[a+80>>2];f=+g[a+68>>2]-+g[a+84>>2];h=+g[a+88>>2]+ +g[a+72>>2];break}case 7:{e=+g[a+64>>2]-+g[a+80>>2];f=+g[a+68>>2]-+g[a+84>>2];h=+g[a+72>>2]-+g[a+88>>2];break}default:{}}if((i|0)>0){d=c[a+36>>2]|0;b=0;do{if(+g[d+(b*36|0)+32>>2]+(e*+g[d+(b*36|0)+20>>2]+f*+g[d+(b*36|0)+24>>2]+h*+g[d+(b*36|0)+28>>2])>0.0){b=0;d=16;break a}b=b+1|0}while((b|0)<(i|0))}j=j+1|0;if(j>>>0>=8){b=1;d=16;break}}if((d|0)==16)return b|0;return 0}function rg(a,b,d,e,f,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0;q=sa;sa=sa+16|0;g[e>>2]=3402823466385288598117041.0e14;g[f>>2]=-3402823466385288598117041.0e14;p=c[a+8>>2]|0;if((p|0)>0){m=0;do{s=c[a+16>>2]|0;r=+g[s+(m<<4)>>2];o=+g[s+(m<<4)+4>>2];n=+g[s+(m<<4)+8>>2];k=r*+g[b>>2]+o*+g[b+4>>2]+n*+g[b+8>>2]+ +g[b+48>>2];l=r*+g[b+16>>2]+o*+g[b+20>>2]+n*+g[b+24>>2]+ +g[b+52>>2];n=r*+g[b+32>>2]+o*+g[b+36>>2]+n*+g[b+40>>2]+ +g[b+56>>2];o=k*+g[d>>2]+l*+g[d+4>>2]+n*+g[d+8>>2];if(o<+g[e>>2]){g[e>>2]=o;g[h>>2]=k;g[h+4>>2]=l;g[h+8>>2]=n;g[h+12>>2]=0.0}if(o>+g[f>>2]){g[f>>2]=o;g[i>>2]=k;g[i+4>>2]=l;g[i+8>>2]=n;g[i+12>>2]=0.0}m=m+1|0}while((m|0)!=(p|0));r=+g[f>>2];l=r;m=(g[j>>2]=r,c[j>>2]|0)}else{l=-3402823466385288598117041.0e14;m=-8388609}k=+g[e>>2];if(!(k>l)){sa=q;return}c[e>>2]=m;g[f>>2]=k;c[q>>2]=c[h>>2];c[q+4>>2]=c[h+4>>2];c[q+8>>2]=c[h+8>>2];c[q+12>>2]=c[h+12>>2];c[h>>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];c[i>>2]=c[q>>2];c[i+4>>2]=c[q+4>>2];c[i+8>>2]=c[q+8>>2];c[i+12>>2]=c[q+12>>2];sa=q;return}function sg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0;if((c[a>>2]|0)==(b|0)){c[a>>2]=0;a=0;return a|0}e=c[b+32>>2]|0;d=c[e+32>>2]|0;b=c[e+36+(((c[e+40>>2]|0)!=(b|0)&1)<<2)>>2]|0;if(!d){c[a>>2]=b;c[b+32>>2]=0;d=c[a+4>>2]|0;if(!d)d=b;else{c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[a>>2]|0}c[a+4>>2]=e;a=d;return a|0}c[d+36+(((c[d+40>>2]|0)==(e|0)&1)<<2)>>2]=b;c[b+32>>2]=d;b=c[a+4>>2]|0;if(b|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}c[a+4>>2]=e;do{q=+g[d>>2];x=d+4|0;o=+g[x>>2];v=d+8|0;m=+g[v>>2];y=d+16|0;s=+g[y>>2];w=d+20|0;k=+g[w>>2];e=d+24|0;i=+g[e>>2];u=c[d+36>>2]|0;b=c[d+40>>2]|0;t=+g[u>>2];p=+g[b>>2];p=t>2]=p;t=+g[u+16>>2];r=+g[b+16>>2];r=t>r?t:r;g[y>>2]=r;t=+g[u+4>>2];n=+g[b+4>>2];n=t>2]=n;t=+g[u+20>>2];j=+g[b+20>>2];j=t>j?t:j;g[w>>2]=j;t=+g[u+8>>2];l=+g[b+8>>2];l=t>2]=l;t=+g[u+24>>2];h=+g[b+24>>2];h=t>h?t:h;g[e>>2]=h;if(!(s!=r|(q!=p|o!=n|m!=l))?!(k!=j|i!=h):0){f=14;break}d=c[d+32>>2]|0}while((d|0)!=0);if((f|0)==14)return d|0;y=c[a>>2]|0;return y|0}function tg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0.0,k=0.0,l=0,m=0,n=0.0,o=0.0,p=0;m=sa;sa=sa+16|0;if((f|0)>-3){c[7182]=(c[7182]|0)+1;a=xb((f+3<<4|3)+16|0)|0;if(!a)l=0;else{c[(a+4+15&-16)+-4>>2]=a;l=a+4+15&-16}a=0;do{i=l+(a<<4)|0;c[i>>2]=c[m>>2];c[i+4>>2]=c[m+4>>2];c[i+8>>2]=c[m+8>>2];c[i+12>>2]=c[m+12>>2];a=a+1|0}while((a|0)!=(f+3|0));h=0;i=l;while(1){if(!h)j=0.0;else{a=h;j=0.0;k=.5;while(1){j=(a&1|0)==0?j:j+k;a=1?a>>1:a;if(!a)break;else k=k*.5}}k=j*2.0+-1.0;o=(+(h<<1|0)*3.1415927410125732+3.1415927410125732)/+(f+3|0);n=+x(+(1.0-k*k));j=+A(+o)*n;g[i>>2]=+z(+o)*n;g[i+4>>2]=j;g[i+8>>2]=k;g[i+12>>2]=0.0;h=h+1|0;if((h|0)==(f+3|0))break;else i=i+16|0}a=0;do{p=l+(a<<4)|0;h=l+(a<<4)+4|0;i=l+(a<<4)+8|0;n=+g[h>>2]*+g[e+4>>2]+ +g[d+4>>2];o=+g[i>>2]*+g[e+8>>2]+ +g[d+8>>2];g[p>>2]=+g[p>>2]*+g[e>>2]+ +g[d>>2];g[h>>2]=n;g[i>>2]=o;g[l+(a<<4)+12>>2]=0.0;a=a+1|0}while((a|0)<(f+3|0));i=l;h=l}else{i=0;h=0}a=Jc(b,i,f+3|0,1)|0;if((i|0)==0|(h|0)==0){sa=m;return a|0}c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);sa=m;return a|0}function ug(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=sa;sa=sa+32|0;j=(a[b+28>>0]|0)!=0;k=j?e:d;j=j?d:e;h=c[k+4>>2]|0;i=c[h+16>>2]|0;g=c[b+12>>2]|0;if((g|0)<(i|0)){if((c[b+16>>2]|0)<(i|0)){if(!i){d=0;f=g}else{c[7182]=(c[7182]|0)+1;d=xb((i<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=c[b+12>>2]|0}if((f|0)>0){e=0;do{c[d+(e<<2)>>2]=c[(c[b+20>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}e=c[b+20>>2]|0;if(e|0){if(a[b+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+20>>2]=0}a[b+24>>0]=1;c[b+20>>2]=d;c[b+16>>2]=i;e=b+20|0}else e=b+20|0;d=g;do{c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=(i|0))}c[b+12>>2]=i;if((i|0)<=0){sa=l;return}d=0;do{if(!(c[h+64>>2]|0)){e=c[(c[h+24>>2]|0)+(d*80|0)+64>>2]|0;f=c[k+8>>2]|0;g=c[k+12>>2]|0;c[l>>2]=k;c[l+4>>2]=e;c[l+8>>2]=f;c[l+12>>2]=g;c[l+16>>2]=-1;c[l+20>>2]=d;g=c[b+4>>2]|0;g=Ka[c[(c[g>>2]|0)+8>>2]&31](g,l,j,c[b+32>>2]|0)|0;c[(c[b+20>>2]|0)+(d<<2)>>2]=g}else c[(c[b+20>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=(i|0));sa=l;return}function vg(a,b,e){a=a|0;b=b|0;e=e|0;ih(a,b,e)|0;c[b+52>>2]=c[a+48>>2];c[b+56>>2]=c[a+52>>2];c[b+60>>2]=c[a+56>>2];c[b+64>>2]=c[a+60>>2];c[b+68>>2]=c[a+64>>2];c[b+72>>2]=c[a+68>>2];c[b+76>>2]=c[a+72>>2];c[b+80>>2]=c[a+76>>2];c[b+84>>2]=c[a+80>>2];c[b+88>>2]=c[a+84>>2];c[b+92>>2]=c[a+88>>2];c[b+96>>2]=c[a+92>>2];c[b+100>>2]=c[a+96>>2];c[b+104>>2]=c[a+100>>2];c[b+108>>2]=c[a+104>>2];c[b+112>>2]=c[a+108>>2];c[b+116>>2]=c[a+112>>2];c[b+120>>2]=c[a+116>>2];c[b+124>>2]=c[a+120>>2];c[b+128>>2]=c[a+124>>2];c[b+132>>2]=c[a+128>>2];c[b+136>>2]=c[a+132>>2];c[b+140>>2]=c[a+136>>2];c[b+144>>2]=c[a+140>>2];c[b+148>>2]=c[a+144>>2];c[b+152>>2]=c[a+148>>2];c[b+156>>2]=c[a+152>>2];c[b+160>>2]=c[a+156>>2];c[b+164>>2]=c[a+160>>2];c[b+168>>2]=c[a+164>>2];c[b+172>>2]=c[a+168>>2];c[b+176>>2]=c[a+172>>2];c[b+228>>2]=c[a+868>>2];c[b+212>>2]=c[a+872>>2];c[b+196>>2]=c[a+680>>2];c[b+180>>2]=c[a+696>>2];c[b+232>>2]=c[a+932>>2];c[b+216>>2]=c[a+936>>2];c[b+200>>2]=c[a+684>>2];c[b+184>>2]=c[a+700>>2];c[b+236>>2]=c[a+996>>2];c[b+220>>2]=c[a+1e3>>2];c[b+204>>2]=c[a+688>>2];c[b+188>>2]=c[a+704>>2];c[b+244>>2]=d[a+1300>>0];c[b+248>>2]=d[a+1301>>0];return 16760}function wg(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;e=c[b+32>>2]|0;if(!e)f=0;else f=c[b+40>>2]|0;i=c[b+52>>2]|0;if(!i)g=0;else g=c[b+60>>2]|0;d=c[b+72>>2]|0;if(!d)h=0;else h=c[b+80>>2]|0;j=c[b+8>>2]|0;+Ea[c[(c[j>>2]|0)+12>>2]&3](j,f,e,g,i,h,d,c[b+4>>2]|0,c[b+20>>2]|0,c[b+24>>2]|0);d=c[b+32>>2]|0;if((d|0)<0){if((c[b+36>>2]|0)<0){e=c[b+40>>2]|0;if(e|0){if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+40>>2]=0}a[b+44>>0]=1;c[b+40>>2]=0;c[b+36>>2]=0}do{c[(c[b+40>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=0)}c[b+32>>2]=0;d=c[b+52>>2]|0;if((d|0)<0){if((c[b+56>>2]|0)<0){e=c[b+60>>2]|0;if(e|0){if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+60>>2]=0}a[b+64>>0]=1;c[b+60>>2]=0;c[b+56>>2]=0}do{c[(c[b+60>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=0)}c[b+52>>2]=0;d=c[b+72>>2]|0;if((d|0)>=0){c[b+72>>2]=0;return}if((c[b+76>>2]|0)<0){e=c[b+80>>2]|0;if(e|0){if(a[b+84>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+80>>2]=0}a[b+84>>0]=1;c[b+80>>2]=0;c[b+76>>2]=0}do{c[(c[b+80>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=0);c[b+72>>2]=0;return}function xg(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;c[7182]=(c[7182]|0)+1;d=xb(39)|0;if(!d)g=0;else{c[(d+4+15&-16)+-4>>2]=d;g=d+4+15&-16}h=g;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;if((c[b+872>>2]|0)>0){i=c[c[b+880>>2]>>2]|0;c[g>>2]=c[i>>2];c[g+4>>2]=c[i+4>>2];c[g+8>>2]=c[i+8>>2];c[g+12>>2]=c[i+12>>2];c[g+16>>2]=c[i+16>>2]}else{c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0}e=c[b+872>>2]|0;if((e|0)!=(c[b+876>>2]|0)){i=e;f=b+880|0;f=c[f>>2]|0;f=f+(i<<2)|0;c[f>>2]=h;i=i+1|0;c[b+872>>2]=i;return g|0}i=(e|0)==0?1:e<<1;if((e|0)>=(i|0)){i=e;f=b+880|0;f=c[f>>2]|0;f=f+(i<<2)|0;c[f>>2]=h;i=i+1|0;c[b+872>>2]=i;return g|0}if(!i)d=0;else{c[7182]=(c[7182]|0)+1;d=xb((i<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}e=c[b+872>>2]|0}if((e|0)>0){f=0;do{c[d+(f<<2)>>2]=c[(c[b+880>>2]|0)+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0))}f=c[b+880>>2]|0;if(f){if(a[b+884>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);e=c[b+872>>2]|0}c[b+880>>2]=0}a[b+884>>0]=1;c[b+880>>2]=d;c[b+876>>2]=i;i=e;f=b+880|0;f=c[f>>2]|0;f=f+(i<<2)|0;c[f>>2]=h;i=i+1|0;c[b+872>>2]=i;return g|0}function yg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=c[b+4>>2]|0;if((e|0)==(c[b+8>>2]|0)){Om(b,(e|0)==0?1:e<<1);e=c[b+4>>2]|0}o=c[b+12>>2]|0;j=o+(e*36|0)+16|0;a[j>>0]=1;k=o+(e*36|0)+12|0;c[k>>2]=0;l=o+(e*36|0)+4|0;c[l>>2]=0;m=o+(e*36|0)+8|0;c[m>>2]=0;p=c[d+4>>2]|0;if((p|0)<=0){c[l>>2]=p;p=o+(e*36|0)+20|0;d=d+20|0;c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];d=c[b+4>>2]|0;d=d+1|0;c[b+4>>2]=d;return}c[7182]=(c[7182]|0)+1;f=xb((p<<2|3)+16|0)|0;if(!f)g=0;else{c[(f+4+15&-16)+-4>>2]=f;g=f+4+15&-16}h=c[l>>2]|0;i=c[k>>2]|0;if((h|0)<=0){if(i|0)n=10}else{f=0;do{c[g+(f<<2)>>2]=c[i+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0));n=10}if((n|0)==10?a[j>>0]|0:0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}a[j>>0]=1;c[k>>2]=g;c[m>>2]=p;mk(g|0,0,p<<2|0)|0;c[l>>2]=p;g=c[k>>2]|0;h=c[d+12>>2]|0;f=0;do{c[g+(f<<2)>>2]=c[h+(f<<2)>>2];f=f+1|0}while((f|0)!=(p|0));p=o+(e*36|0)+20|0;d=d+20|0;c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];d=c[b+4>>2]|0;d=d+1|0;c[b+4>>2]=d;return}function zg(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,k=0,l=0,m=0.0,n=0,o=0,p=0.0,q=0.0;ab[c[(c[a>>2]|0)+8>>2]&127](a,b,f,h);n=c[h>>2]|0;k=c[h+4>>2]|0;b=c[h+8>>2]|0;l=c[f>>2]|0;o=c[f+4>>2]|0;i=c[f+8>>2]|0;m=+g[d>>2];p=+g[d+4>>2];q=+g[d+8>>2];if(m>0.0)n=(g[j>>2]=m+(c[j>>2]=n,+g[j>>2]),c[j>>2]|0);else l=(g[j>>2]=m+(c[j>>2]=l,+g[j>>2]),c[j>>2]|0);if(p>0.0){d=o;k=(g[j>>2]=p+(c[j>>2]=k,+g[j>>2]),c[j>>2]|0)}else d=(g[j>>2]=p+(c[j>>2]=o,+g[j>>2]),c[j>>2]|0);if(q>0.0)b=(g[j>>2]=q+(c[j>>2]=b,+g[j>>2]),c[j>>2]|0);else i=(g[j>>2]=q+(c[j>>2]=i,+g[j>>2]),c[j>>2]|0);m=+g[e>>2];p=+g[e+4>>2];q=+g[e+8>>2];q=+x(+(m*m+p*p+q*q));q=q*+va[c[(c[a>>2]|0)+16>>2]&15](a);c[f>>2]=l;c[f+4>>2]=d;c[f+8>>2]=i;g[f+12>>2]=0.0;c[h>>2]=n;c[h+4>>2]=k;c[h+8>>2]=b;g[h+12>>2]=0.0;g[f>>2]=+g[f>>2]-q;g[f+4>>2]=+g[f+4>>2]-q;g[f+8>>2]=+g[f+8>>2]-q;g[h>>2]=q+ +g[h>>2];g[h+4>>2]=q+ +g[h+4>>2];g[h+8>>2]=q+ +g[h+8>>2];return}function Ag(b,d,e){b=b|0;d=+d;e=e|0;var f=0,h=0.0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0;j=c[b+712>>2]|0;if(e){if((j|0)>0){f=c[b+720>>2]|0;e=0;do{g[f+(e*104|0)+88>>2]=0.0;e=e+1|0}while((e|0)!=(j|0))}f=c[b+752>>2]|0;if((f|0)>0){i=c[b+760>>2]|0;e=0;do{m=c[i+(e*44|0)+8>>2]|0;l=c[i+(e*44|0)+12>>2]|0;k=c[i+(e*44|0)+16>>2]|0;o=+g[m+8>>2];q=+g[m+12>>2];h=+g[m+16>>2];n=+g[l+8>>2]-o;r=+g[l+12>>2]-q;p=+g[l+16>>2]-h;o=+g[k+8>>2]-o;q=+g[k+12>>2]-q;h=+g[k+16>>2]-h;h=+x(+((n*q-r*o)*(n*q-r*o)+((r*h-p*q)*(r*h-p*q)+(p*o-n*h)*(p*o-n*h))));g[m+88>>2]=h+ +g[m+88>>2];g[l+88>>2]=h+ +g[l+88>>2];g[k+88>>2]=h+ +g[k+88>>2];e=e+1|0}while((e|0)!=(f|0))}if((j|0)<=0){m=b+924|0;a[m>>0]=1;return}f=c[b+720>>2]|0;e=0;do{m=f+(e*104|0)+88|0;g[m>>2]=1.0/+g[m>>2];e=e+1|0}while((e|0)!=(j|0))}if((j|0)<=0){m=b+924|0;a[m>>0]=1;return}f=c[b+720>>2]|0;e=0;h=0.0;do{r=+g[f+(e*104|0)+88>>2];h=h+(r>0.0?1.0/r:0.0);e=e+1|0}while((e|0)!=(j|0));h=1.0/h*d;e=0;do{m=f+(e*104|0)+88|0;g[m>>2]=+g[m>>2]/h;e=e+1|0}while((e|0)!=(j|0));m=b+924|0;a[m>>0]=1;return}function Bg(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;var h=0,i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;l=+g[d>>2];if(+g[b>>2]<=l){j=+g[d+4>>2];if((((+g[b+4>>2]<=j?+g[b+8>>2]<=+g[d+8>>2]:0)?+g[b+16>>2]>=+g[d+16>>2]:0)?+g[b+20>>2]>=+g[d+20>>2]:0)?+g[b+24>>2]>=+g[d+24>>2]:0){d=0;return d|0}else h=d+4|0}else{h=d+4|0;j=+g[d+4>>2]}g[d>>2]=l-f;n=j-f;g[h>>2]=n;j=+g[d+8>>2]-f;g[d+8>>2]=j;q=+g[d+16>>2]+f;g[d+16>>2]=q;o=+g[d+20>>2]+f;g[d+20>>2]=o;m=+g[d+24>>2]+f;g[d+24>>2]=m;p=+g[e>>2];g[(p>0.0?d+16|0:d)>>2]=(p>0.0?q:l-f)+p;l=+g[e+4>>2];g[(l>0.0?d+20|0:h)>>2]=(l>0.0?o:n)+l;l=+g[e+8>>2];g[(l>0.0?d+24|0:d+8|0)>>2]=(l>0.0?m:j)+l;h=sg(a,b)|0;a:do if(h){k=c[a+8>>2]|0;if((k|0)<=-1){h=c[a>>2]|0;break}if(k){e=0;while(1){i=c[h+32>>2]|0;e=e+1|0;if(!i)break a;if((e|0)>=(k|0)){h=i;break}else h=i}}}else h=0;while(0);c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];ue(a,h,b);d=1;return d|0}function Cg(b,d){b=b|0;d=d|0;var e=0,f=0,h=0.0,i=0,j=0,k=0.0,l=0.0;e=c[d+204>>2]|0;if((e&3|0)==0?(c[d+504>>2]&1|0)==0:0){h=+g[d+344>>2];if(h!=0.0){l=1.0/h*+g[b+252>>2];k=1.0/h*+g[b+256>>2];g[d+364>>2]=1.0/h*+g[b+248>>2];g[d+368>>2]=l;g[d+372>>2]=k;g[d+376>>2]=0.0}c[d+380>>2]=c[b+248>>2];c[d+380+4>>2]=c[b+248+4>>2];c[d+380+8>>2]=c[b+248+8>>2];c[d+380+12>>2]=c[b+248+12>>2]}if(!(c[d+192>>2]|0))return;if(e&1)if((c[d+216>>2]&-2|0)==4)e=e&3;else{c[d+216>>2]=2;e=e&3}else{f=c[b+232>>2]|0;if((f|0)==(c[b+236>>2]|0)?(j=(f|0)==0?1:f<<1,(f|0)<(j|0)):0){if(!j)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((j<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[b+232>>2]|0}if((f|0)>0){i=0;do{c[e+(i<<2)>>2]=c[(c[b+240>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(f|0))}i=c[b+240>>2]|0;if(i){if(a[b+244>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);f=c[b+232>>2]|0}c[b+240>>2]=0}a[b+244>>0]=1;c[b+240>>2]=e;c[b+236>>2]=j;e=c[d+204>>2]&3}else e=e&3;c[(c[b+240>>2]|0)+(f<<2)>>2]=d;c[b+232>>2]=f+1}j=(e|0)!=0;ab[c[(c[b>>2]|0)+36>>2]&127](b,d,j?2:1,j?-3:-1);return}function Dg(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var h=0,i=0.0,j=0.0;h=sa;sa=sa+240|0;Wp(h+224|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],d);Fj(b,h+208|0,h+192|0);Wp(h+160|0,+g[h+208>>2],+g[h+208+4>>2],+g[h+208+8>>2],100.0);j=+g[h+224>>2];i=+g[h+224+4>>2];d=+g[h+224+8>>2];qp(h+176|0,j,i,d,+g[h+160>>2],+g[h+160+4>>2],+g[h+160+8>>2]);Wp(h+128|0,+g[h+208>>2],+g[h+208+4>>2],+g[h+208+8>>2],100.0);sp(h+144|0,j,i,d,+g[h+128>>2],+g[h+128+4>>2],+g[h+128+8>>2]);Wp(h+96|0,+g[h+192>>2],+g[h+192+4>>2],+g[h+192+8>>2],100.0);qp(h+112|0,j,i,d,+g[h+96>>2],+g[h+96+4>>2],+g[h+96+8>>2]);Wp(h+64|0,+g[h+192>>2],+g[h+192+4>>2],+g[h+192+8>>2],100.0);sp(h+80|0,j,i,d,+g[h+64>>2],+g[h+64+4>>2],+g[h+64+8>>2]);b=c[(c[a>>2]|0)+8>>2]|0;Qv(h+48|0,e,+g[h+176>>2],+g[h+176+4>>2],+g[h+176+8>>2]);Qv(h+32|0,e,+g[h+144>>2],+g[h+144+4>>2],+g[h+144+8>>2]);ab[b&127](a,h+48|0,h+32|0,f);b=c[(c[a>>2]|0)+8>>2]|0;Qv(h+16|0,e,+g[h+112>>2],+g[h+112+4>>2],+g[h+112+8>>2]);Qv(h,e,+g[h+80>>2],+g[h+80+4>>2],+g[h+80+8>>2]);ab[b&127](a,h+16|0,h,f);sa=h;return}function Eg(a,b,d,e,f,h,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0.0,n=0.0;a=sa;sa=sa+80|0;n=+g[h+52>>2]-+g[f+52>>2];m=+g[h+56>>2]-+g[f+56>>2];g[a+56>>2]=+g[h+48>>2]-+g[f+48>>2];g[a+56+4>>2]=n;g[a+56+8>>2]=m;g[a+56+12>>2]=0.0;if(Ob(d,f,e,h,a+56|0,a,1)|0){c[j>>2]=c[a+4>>2];c[j+4>>2]=c[a+4+4>>2];c[j+8>>2]=c[a+4+8>>2];c[j+12>>2]=c[a+4+12>>2];c[k>>2]=c[a+20>>2];c[k+4>>2]=c[a+20+4>>2];c[k+8>>2]=c[a+20+8>>2];c[k+12>>2]=c[a+20+12>>2];c[i>>2]=c[a+36>>2];c[i+4>>2]=c[a+36+4>>2];c[i+8>>2]=c[a+36+8>>2];c[i+12>>2]=c[a+36+12>>2];k=1;sa=a;return k|0}if(!(Rc(d,f,e,h,a+56|0,a)|0)){k=0;sa=a;return k|0}c[j>>2]=c[a+4>>2];c[j+4>>2]=c[a+4+4>>2];c[j+8>>2]=c[a+4+8>>2];c[j+12>>2]=c[a+4+12>>2];c[k>>2]=c[a+20>>2];c[k+4>>2]=c[a+20+4>>2];c[k+8>>2]=c[a+20+8>>2];c[k+12>>2]=c[a+20+12>>2];c[i>>2]=c[a+36>>2];c[i+4>>2]=c[a+36+4>>2];c[i+8>>2]=c[a+36+8>>2];c[i+12>>2]=c[a+36+12>>2];k=0;sa=a;return k|0}function Fg(b,e,f,h,i,j){b=b|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;var k=0;if((d[h+55>>0]|0|0)==(e|0)){h=0;return h|0}k=c[7784+(i<<2)>>2]|0;if(+g[h>>2]*+g[f+16>>2]+ +g[h+4>>2]*+g[f+20>>2]+ +g[h+8>>2]*+g[f+24>>2]-+g[h+16>>2]<-9.999999747378752e-06){e=de(b,c[h+20+(k<<2)>>2]|0,c[h+20+(i<<2)>>2]|0,f,0)|0;if(!e){h=0;return h|0}a[e+52>>0]=i;c[e+32>>2]=h;a[h+52+i>>0]=0;c[h+32+(i<<2)>>2]=e;i=c[j>>2]|0;if(!i)c[j+4>>2]=e;else{a[i+53>>0]=2;c[i+36>>2]=e;a[e+54>>0]=1;c[e+40>>2]=i}c[j>>2]=e;c[j+8>>2]=(c[j+8>>2]|0)+1;h=1;return h|0}i=c[7796+(i<<2)>>2]|0;a[h+55>>0]=e;if(!(Fg(b,e,f,c[h+32+(k<<2)>>2]|0,d[h+52+k>>0]|0,j)|0)){h=0;return h|0}if(!(Fg(b,e,f,c[h+32+(i<<2)>>2]|0,d[h+52+i>>0]|0,j)|0)){h=0;return h|0}i=c[h+48>>2]|0;if(i|0)c[i+44>>2]=c[h+44>>2];i=c[h+44>>2]|0;if(i|0)c[i+48>>2]=c[h+48>>2];if((c[b+9280>>2]|0)==(h|0))c[b+9280>>2]=c[h+48>>2];c[b+9284>>2]=(c[b+9284>>2]|0)+-1;c[h+44>>2]=0;c[h+48>>2]=c[b+9288>>2];i=c[b+9288>>2]|0;if(i|0)c[i+44>>2]=h;c[b+9288>>2]=h;c[b+9292>>2]=(c[b+9292>>2]|0)+1;h=1;return h|0}function Gg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0,j=0,k=0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0;o=sa;sa=sa+2048|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;e=+g[d>>2];h=+g[d+4>>2];f=+g[d+8>>2];if(e*e+h*h+f*f<9.999999747378752e-05){m=1.0;l=0.0;h=0.0}else{p=1.0/+x(+(e*e+h*h+f*f));m=e*p;l=h*p;h=f*p}if((Fa[c[(c[b>>2]|0)+96>>2]&127](b)|0)<=0){sa=o;return}k=0;f=-999999984306749440.0;while(1){if(((Fa[c[(c[b>>2]|0)+96>>2]&127](b)|0)-k|0)<128){d=(Fa[c[(c[b>>2]|0)+96>>2]&127](b)|0)-k|0;if((d|0)>0)n=8;else{e=-3402823466385288598117041.0e14;d=-1}}else{d=128;n=8}if((n|0)==8){n=0;i=0;do{Za[c[(c[b>>2]|0)+108>>2]&127](b,i,o+(i<<4)|0);i=i+1|0}while((i|0)!=(d|0));i=-1;j=0;e=-3402823466385288598117041.0e14;do{p=m*+g[o+(j<<4)>>2]+l*+g[o+(j<<4)+4>>2]+h*+g[o+(j<<4)+8>>2];q=p>e;i=q?j:i;e=q?p:e;j=j+1|0}while((j|0)!=(d|0));d=i}if(e>f){q=o+(d<<4)|0;c[a>>2]=c[q>>2];c[a+4>>2]=c[q+4>>2];c[a+8>>2]=c[q+8>>2];c[a+12>>2]=c[q+12>>2]}else e=f;k=k+128|0;if((k|0)>=(Fa[c[(c[b>>2]|0)+96>>2]&127](b)|0))break;else f=e}sa=o;return}function Hg(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;i=c[a+68+(d<<2)>>2]|0;j=b[i+((f&65535)<<2)+-4>>1]|0;if((e[i+((f&65535)<<2)>>1]|0)>=(j&65535))return;k=c[a+60>>2]|0;m=k+((e[i+((f&65535)<<2)+2>>1]|0)<<6)+54+(d<<1)|0;h=i+((f&65535)<<2)+-4|0;l=i+((f&65535)<<2)|0;while(1){i=e[l+-2>>1]|0;if(!(j&1)){f=e[l+2>>1]|0;if(((((e[k+(f<<6)+54+((1<>1]|0)>=(e[k+(i<<6)+48+((1<>1]|0)?(e[k+(i<<6)+54+((1<>1]|0)>=(e[k+(f<<6)+48+((1<>1]|0):0)?(e[k+(f<<6)+54+((1<<(1<>1]|0)>=(e[k+(i<<6)+48+((1<<(1<>1]|0):0)?(e[k+(i<<6)+54+((1<<(1<>1]|0)>=(e[k+(f<<6)+48+((1<<(1<>1]|0):0)?(p=c[a+92>>2]|0,n=k+(f<<6)|0,o=k+(i<<6)|0,Ka[c[(c[p>>2]|0)+12>>2]&31](p,n,o,g)|0,p=c[a+96>>2]|0,p|0):0)Ka[c[(c[p>>2]|0)+12>>2]&31](p,n,o,g)|0;f=k+(i<<6)+48+(d<<1)|0}else f=k+(i<<6)+54+(d<<1)|0;b[f>>1]=(b[f>>1]|0)+1<<16>>16;b[m>>1]=(b[m>>1]|0)+-1<<16>>16;f=e[l>>1]|e[l+2>>1]<<16;j=e[h>>1]|e[h+2>>1]<<16;b[l>>1]=j;b[l+2>>1]=j>>>16;b[h>>1]=f;b[h+2>>1]=f>>>16;f=l+-4|0;h=h+-4|0;j=b[h>>1]|0;if((e[f>>1]|0)>=(j&65535))break;l=f;k=c[a+60>>2]|0}return}function Ig(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0,k=0,l=0,m=0.0,n=0.0;h=c[d+204>>2]|0;if((h&3|0)==0?(c[d+504>>2]&1|0)==0:0){i=+g[d+344>>2];if(i!=0.0){n=1.0/i*+g[b+252>>2];m=1.0/i*+g[b+256>>2];g[d+364>>2]=1.0/i*+g[b+248>>2];g[d+368>>2]=n;g[d+372>>2]=m;g[d+376>>2]=0.0}c[d+380>>2]=c[b+248>>2];c[d+380+4>>2]=c[b+248+4>>2];c[d+380+8>>2]=c[b+248+8>>2];c[d+380+12>>2]=c[b+248+12>>2]}if(!(c[d+192>>2]|0))return;if(h&1){if((c[d+216>>2]&-2|0)!=4)c[d+216>>2]=2}else{h=c[b+232>>2]|0;if((h|0)==(c[b+236>>2]|0)?(l=(h|0)==0?1:h<<1,(h|0)<(l|0)):0){if(!l)k=0;else{c[7182]=(c[7182]|0)+1;h=xb((l<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}k=h;h=c[b+232>>2]|0}if((h|0)>0){j=0;do{c[k+(j<<2)>>2]=c[(c[b+240>>2]|0)+(j<<2)>>2];j=j+1|0}while((j|0)!=(h|0))}j=c[b+240>>2]|0;if(j){if(a[b+244>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);h=c[b+232>>2]|0}c[b+240>>2]=0}a[b+244>>0]=1;c[b+240>>2]=k;c[b+236>>2]=l}c[(c[b+240>>2]|0)+(h<<2)>>2]=d;c[b+232>>2]=h+1}ab[c[(c[b>>2]|0)+36>>2]&127](b,d,e,f);return}function Jg(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;g=c[a+68+(d<<2)>>2]|0;l=c[a+60>>2]|0;m=e[g+((f&65535)<<2)+2>>1]|0;h=b[g+((f&65535)<<2)+6>>1]|0;if(!(h<<16>>16))return;k=g+((f&65535)<<2)|0;while(1){j=k;k=k+4|0;g=b[k>>1]|0;if((e[j>>1]|0)<(g&65535)){f=14;break}i=c[a+60>>2]|0;f=h&65535;if(!(g&1)){if(((((e[l+(m<<6)+54+((1<>1]|0)>=(e[i+(f<<6)+48+((1<>1]|0)?(e[i+(f<<6)+54+((1<>1]|0)>=(e[l+(m<<6)+48+((1<>1]|0):0)?(e[l+(m<<6)+54+((1<<(1<>1]|0)>=(e[i+(f<<6)+48+((1<<(1<>1]|0):0)?(e[i+(f<<6)+54+((1<<(1<>1]|0)>=(e[l+(m<<6)+48+((1<<(1<>1]|0):0)?(o=c[a+92>>2]|0,n=i+((e[j+2>>1]|0)<<6)|0,Ja[c[(c[o>>2]|0)+8>>2]&63](o,n,i+(f<<6)|0)|0,o=c[a+96>>2]|0,o|0):0)Ja[c[(c[o>>2]|0)+8>>2]&63](o,n,i+(f<<6)|0)|0;f=i+(f<<6)+48+(d<<1)|0}else f=i+(f<<6)+54+(d<<1)|0;b[f>>1]=(b[f>>1]|0)+-1<<16>>16;b[l+(m<<6)+54+(d<<1)>>1]=(b[l+(m<<6)+54+(d<<1)>>1]|0)+1<<16>>16;h=e[j>>1]|e[j+2>>1]<<16;i=e[k>>1]|e[k+2>>1]<<16;b[j>>1]=i;b[j+2>>1]=i>>>16;b[k>>1]=h;b[k+2>>1]=h>>>16;h=b[j+10>>1]|0;if(!(h<<16>>16)){f=14;break}}if((f|0)==14)return}function Kg(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=c[a+68+(d<<2)>>2]|0;i=b[h+((f&65535)<<2)+6>>1]|0;if(!(i<<16>>16))return;m=(c[a+60>>2]|0)+((e[h+((f&65535)<<2)+2>>1]|0)<<6)+48+(d<<1)|0;l=h+((f&65535)<<2)|0;while(1){k=l;l=l+4|0;f=b[l>>1]|0;if((e[k>>1]|0)<(f&65535)){f=14;break}j=c[a+60>>2]|0;h=i&65535;if(!(f&1))f=j+(h<<6)+48+(d<<1)|0;else{f=e[k+2>>1]|0;if(((((e[j+(f<<6)+54+((1<>1]|0)>=(e[j+(h<<6)+48+((1<>1]|0)?(e[j+(h<<6)+54+((1<>1]|0)>=(e[j+(f<<6)+48+((1<>1]|0):0)?(e[j+(f<<6)+54+((1<<(1<>1]|0)>=(e[j+(h<<6)+48+((1<<(1<>1]|0):0)?(e[j+(h<<6)+54+((1<<(1<>1]|0)>=(e[j+(f<<6)+48+((1<<(1<>1]|0):0)?(n=c[a+92>>2]|0,Ka[c[(c[n>>2]|0)+12>>2]&31](n,j+(f<<6)|0,j+(h<<6)|0,g)|0,n=c[a+96>>2]|0,n|0):0)Ka[c[(c[n>>2]|0)+12>>2]&31](n,j+(f<<6)|0,j+(h<<6)|0,g)|0;f=j+(h<<6)+54+(d<<1)|0}b[f>>1]=(b[f>>1]|0)+-1<<16>>16;b[m>>1]=(b[m>>1]|0)+1<<16>>16;i=e[k>>1]|e[k+2>>1]<<16;j=e[l>>1]|e[l+2>>1]<<16;b[k>>1]=j;b[k+2>>1]=j>>>16;b[l>>1]=i;b[l+2>>1]=i>>>16;i=b[k+10>>1]|0;if(!(i<<16>>16)){f=14;break}}if((f|0)==14)return}function Lg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0;o=(+g[a+32>>2]-+g[a+16>>2])*.5;l=(+g[a+36>>2]-+g[a+20>>2])*.5;i=(+g[a+40>>2]-+g[a+24>>2])*.5;n=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=i+ +va[c[(c[a>>2]|0)+48>>2]&15](a);C=(+g[a+32>>2]+ +g[a+16>>2])*.5;A=(+g[a+36>>2]+ +g[a+20>>2])*.5;y=(+g[a+40>>2]+ +g[a+24>>2])*.5;G=+g[b>>2];x=+w(+G);F=+g[b+4>>2];v=+w(+F);t=+g[b+8>>2];u=+w(+t);E=+g[b+16>>2];s=+w(+E);D=+g[b+20>>2];r=+w(+D);p=+g[b+24>>2];q=+w(+p);B=+g[b+32>>2];m=+w(+B);z=+g[b+36>>2];j=+w(+z);f=+g[b+40>>2];h=+w(+f);t=C*G+A*F+y*t+ +g[b+48>>2];p=C*E+A*D+y*p+ +g[b+52>>2];f=C*B+A*z+y*f+ +g[b+56>>2];g[d>>2]=t-((o+n)*x+(l+k)*v+i*u);g[d+4>>2]=p-((o+n)*s+(l+k)*r+i*q);g[d+8>>2]=f-((o+n)*m+(l+k)*j+i*h);g[d+12>>2]=0.0;g[e>>2]=(o+n)*x+(l+k)*v+i*u+t;g[e+4>>2]=(o+n)*s+(l+k)*r+i*q+p;g[e+8>>2]=(o+n)*m+(l+k)*j+i*h+f;g[e+12>>2]=0.0;return}function Mg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0,H=0.0,I=0.0;I=+g[a+48>>2];A=+g[a+32>>2];H=+g[a+52>>2];y=+g[a+36>>2];F=+g[a+56>>2];v=+g[a+40>>2];G=(c[a+16>>2]|0)==0;m=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=+va[c[(c[a>>2]|0)+48>>2]&15](a);m=(G?0.0:(I-A)*.5)+m;k=(G?0.0:(H-y)*.5)+k;i=(G?0.0:(F-v)*.5)+i;E=+g[b>>2];u=+w(+E);D=+g[b+4>>2];t=+w(+D);r=+g[b+8>>2];s=+w(+r);C=+g[b+16>>2];q=+w(+C);B=+g[b+20>>2];p=+w(+B);n=+g[b+24>>2];o=+w(+n);z=+g[b+32>>2];l=+w(+z);x=+g[b+36>>2];j=+w(+x);f=+g[b+40>>2];h=+w(+f);A=G?0.0:(I+A)*.5;y=G?0.0:(H+y)*.5;v=G?0.0:(F+v)*.5;r=A*E+y*D+v*r+ +g[b+48>>2];n=A*C+y*B+v*n+ +g[b+52>>2];f=A*z+y*x+v*f+ +g[b+56>>2];g[d>>2]=r-(m*u+k*t+i*s);g[d+4>>2]=n-(m*q+k*p+i*o);g[d+8>>2]=f-(m*l+k*j+i*h);g[d+12>>2]=0.0;g[e>>2]=m*u+k*t+i*s+r;g[e+4>>2]=m*q+k*p+i*o+n;g[e+8>>2]=m*l+k*j+i*h+f;g[e+12>>2]=0.0;return}function Ng(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=c[a+68+(d<<2)>>2]|0;k=c[a+60>>2]|0;l=e[h+((f&65535)<<2)+2>>1]|0;i=b[h+((f&65535)<<2)+-4>>1]|0;if((e[h+((f&65535)<<2)>>1]|0)>=(i&65535))return;g=h+((f&65535)<<2)+-4|0;j=h+((f&65535)<<2)|0;h=k;while(1){f=e[j+-2>>1]|0;if(!(i&1))f=h+(f<<6)+48+(d<<1)|0;else{if(((((e[k+(l<<6)+54+((1<>1]|0)>=(e[h+(f<<6)+48+((1<>1]|0)?(e[h+(f<<6)+54+((1<>1]|0)>=(e[k+(l<<6)+48+((1<>1]|0):0)?(e[k+(l<<6)+54+((1<<(1<>1]|0)>=(e[h+(f<<6)+48+((1<<(1<>1]|0):0)?(e[h+(f<<6)+54+((1<<(1<>1]|0)>=(e[k+(l<<6)+48+((1<<(1<>1]|0):0)?(n=c[a+92>>2]|0,m=h+(f<<6)|0,Ja[c[(c[n>>2]|0)+8>>2]&63](n,k+(l<<6)|0,m)|0,n=c[a+96>>2]|0,n|0):0)Ja[c[(c[n>>2]|0)+8>>2]&63](n,k+(l<<6)|0,m)|0;f=h+(f<<6)+54+(d<<1)|0}b[f>>1]=(b[f>>1]|0)+1<<16>>16;b[k+(l<<6)+48+(d<<1)>>1]=(b[k+(l<<6)+48+(d<<1)>>1]|0)+-1<<16>>16;f=e[j>>1]|e[j+2>>1]<<16;i=e[g>>1]|e[g+2>>1]<<16;b[j>>1]=i;b[j+2>>1]=i>>>16;b[g>>1]=f;b[g+2>>1]=f>>>16;f=j+-4|0;g=g+-4|0;i=b[g>>1]|0;if((e[f>>1]|0)>=(i&65535))break;j=f;h=c[a+60>>2]|0}return}function Og(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0,f=0,h=0,i=0,j=0,k=0;f=sa;sa=sa+16|0;d=+g[(JI(a)|0)>>2];e=+g[(oI(a+16|0)|0)>>2];c=+g[(nI(a+32|0)|0)>>2];if(d+e+c>0.0){e=+wI(d+e+c+1.0);g[f+12>>2]=e*.5;d=+g[(oI(a+32|0)|0)>>2];g[f>>2]=(d-+g[(nI(a+16|0)|0)>>2])*(.5/e);d=+g[(nI(a)|0)>>2];g[f+4>>2]=(d-+g[(JI(a+32|0)|0)>>2])*(.5/e);d=+g[(JI(a+16|0)|0)>>2];g[f+8>>2]=(d-+g[(oI(a)|0)>>2])*(.5/e);i=f+4|0;h=f+8|0;a=f+12|0;j=f;tr(b,j,i,h,a);sa=f;return}else{h=d>2];k=JI(a+((((h+1|0)>>>0)%3|0)<<4)|0)|0;e=e-+g[k+((((h+1|0)>>>0)%3|0)<<2)>>2];j=JI(a+((((h+2|0)>>>0)%3|0)<<4)|0)|0;e=+wI(e-+g[j+((((h+2|0)>>>0)%3|0)<<2)>>2]+1.0);g[f+(h<<2)>>2]=e*.5;g[f+12>>2]=(+g[j+((((h+1|0)>>>0)%3|0)<<2)>>2]-+g[k+((((h+2|0)>>>0)%3|0)<<2)>>2])*(.5/e);g[f+((((h+1|0)>>>0)%3|0)<<2)>>2]=(+g[k+(h<<2)>>2]+ +g[i+((((h+1|0)>>>0)%3|0)<<2)>>2])*(.5/e);g[f+((((h+2|0)>>>0)%3|0)<<2)>>2]=(+g[j+(h<<2)>>2]+ +g[i+((((h+2|0)>>>0)%3|0)<<2)>>2])*(.5/e);h=f+4|0;i=f+8|0;j=f+12|0;a=f;tr(b,a,h,i,j);sa=f;return}}function Pg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+212>>2]|0;a:do if((f|0)>0){g=c[a+220>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0))break a}if((d|0)<(f|0)){c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+220>>2]|0)+(f+-1<<2)>>2]=b;c[a+212>>2]=f+-1}}while(0);g=c[b+28>>2]|0;d=c[g+488>>2]|0;b:do if((d|0)>0){f=c[g+496>>2]|0;e=0;while(1){a=f+(e<<2)|0;if((c[a>>2]|0)==(b|0))break;e=e+1|0;if((e|0)>=(d|0))break b}if((e|0)<(d|0)){c[a>>2]=c[f+(d+-1<<2)>>2];c[(c[g+496>>2]|0)+(d+-1<<2)>>2]=b;c[g+488>>2]=d+-1;d=d+-1|0}}while(0);c[g+256>>2]=(d|0)>0&1;g=c[b+32>>2]|0;d=c[g+488>>2]|0;if((d|0)<=0){b=d;b=(b|0)>0;b=b&1;h=g+256|0;c[h>>2]=b;return}f=c[g+496>>2]|0;e=0;while(1){a=f+(e<<2)|0;if((c[a>>2]|0)==(b|0))break;e=e+1|0;if((e|0)>=(d|0)){h=19;break}}if((h|0)==19){b=(d|0)>0;b=b&1;h=g+256|0;c[h>>2]=b;return}if((e|0)>=(d|0)){b=d;b=(b|0)>0;b=b&1;h=g+256|0;c[h>>2]=b;return}c[a>>2]=c[f+(d+-1<<2)>>2];c[(c[g+496>>2]|0)+(d+-1<<2)>>2]=b;c[g+488>>2]=d+-1;b=d+-1|0;b=(b|0)>0;b=b&1;h=g+256|0;c[h>>2]=b;return}function Qg(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0;j=Fa[c[(c[b>>2]|0)+28>>2]&127](b)|0;i=+g[j>>2]-+g[d>>2];h=+g[j+4>>2]-+g[d+4>>2];f=+g[j+8>>2]-+g[d+8>>2];if(!(i*i+h*h+f*f>1.1920928955078125e-07))return;mg(b,d);if((a[b+61>>0]|0)!=0?(e=c[b+52>>2]|0,Pa[c[c[e>>2]>>2]&511](e),e=c[b+52>>2]|0,(e|0)!=0):0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);e=b+52|0}else e=b+52|0;c[7182]=(c[7182]|0)+1;d=xb(191)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}c[d+52>>2]=282;a[d+60>>0]=0;a[d+80>>0]=1;c[d+76>>2]=0;c[d+68>>2]=0;c[d+72>>2]=0;a[d+100>>0]=1;c[d+96>>2]=0;c[d+88>>2]=0;c[d+92>>2]=0;a[d+120>>0]=1;c[d+116>>2]=0;c[d+108>>2]=0;c[d+112>>2]=0;a[d+140>>0]=1;c[d+136>>2]=0;c[d+128>>2]=0;c[d+132>>2]=0;c[d+144>>2]=0;a[d+164>>0]=1;c[d+160>>2]=0;c[d+152>>2]=0;c[d+156>>2]=0;c[d+168>>2]=0;c[d+4>>2]=-8388609;c[d+8>>2]=-8388609;c[d+12>>2]=-8388609;g[d+16>>2]=0.0;c[d+20>>2]=2139095039;c[d+24>>2]=2139095039;c[d+28>>2]=2139095039;g[d+32>>2]=0.0;c[d>>2]=10888;c[e>>2]=d;pc(d,c[b+48>>2]|0,(a[b+60>>0]|0)!=0,b+16|0,b+32|0);a[b+61>>0]=1;return}function Rg(b,d){b=b|0;d=d|0;var e=0.0,f=0.0;if(a[b+1309>>0]|0){e=(+g[b+1256>>2]-+g[b+1316>>2])*+g[b+1340>>2];g[b+792>>2]=e*(+g[d>>2]*+g[b+1364>>2]/+(c[d+48>>2]|0));e=+w(+e);g[b+808>>2]=e/+g[d>>2]}if(a[b+1310>>0]|0){e=(+g[b+1260>>2]-+g[b+1320>>2])*+g[b+1344>>2];g[b+796>>2]=e*(+g[d>>2]*+g[b+1368>>2]/+(c[d+48>>2]|0));e=+w(+e);g[b+812>>2]=e/+g[d>>2]}if(a[b+1311>>0]|0){e=(+g[b+1264>>2]-+g[b+1324>>2])*+g[b+1348>>2];g[b+800>>2]=e*(+g[d>>2]*+g[b+1372>>2]/+(c[d+48>>2]|0));e=+w(+e);g[b+816>>2]=e/+g[d>>2]}if(a[b+1312>>0]|0){f=-((+g[b+1192>>2]-+g[b+1328>>2])*+g[b+1352>>2]);e=+g[d>>2];g[b+876>>2]=e*+g[b+1376>>2]/+(c[d+48>>2]|0)*f;g[b+880>>2]=+w(+f)/e}if(a[b+1313>>0]|0){e=-((+g[b+1196>>2]-+g[b+1332>>2])*+g[b+1356>>2]);f=+g[d>>2];g[b+940>>2]=f*+g[b+1380>>2]/+(c[d+48>>2]|0)*e;g[b+944>>2]=+w(+e)/f}if(!(a[b+1314>>0]|0)){zj(b,d);return}e=-((+g[b+1200>>2]-+g[b+1336>>2])*+g[b+1360>>2]);f=+g[d>>2];g[b+1004>>2]=f*+g[b+1384>>2]/+(c[d+48>>2]|0)*e;g[b+1008>>2]=+w(+e)/f;zj(b,d);return}function Sg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0.0,i=0.0,j=0.0;e=sa;sa=sa+160|0;c[e+136>>2]=0;c[e+136+4>>2]=0;c[e+136+8>>2]=0;c[e+136+12>>2]=0;c[e+136+16>>2]=0;c[e+32>>2]=9816;f=e+32+4|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[e+32+20>>2]=1065353216;c[e+32+24>>2]=0;c[e+32+24+4>>2]=0;c[e+32+24+8>>2]=0;c[e+32+24+12>>2]=0;c[e+32+40>>2]=1065353216;c[e+32+44>>2]=0;c[e+32+44+4>>2]=0;c[e+32+44+8>>2]=0;c[e+32+44+12>>2]=0;c[e+32+60>>2]=1065353216;c[e+32+64>>2]=0;c[e+32+68>>2]=c[e+136+4>>2];c[e+32+68+4>>2]=c[e+136+4+4>>2];c[e+32+68+8>>2]=c[e+136+4+8>>2];c[e+32+68+12>>2]=c[e+136+4+12>>2];g[e+32+84>>2]=-999999984306749440.0;j=+g[d>>2];i=+g[d+4>>2];h=+g[d+8>>2];g[e+32+88>>2]=j+i*0.0+h*0.0;g[e+32+92>>2]=j*0.0+i+h*0.0;g[e+32+96>>2]=j*0.0+i*0.0+h;g[e+32+100>>2]=0.0;c[e+16>>2]=1566444395;c[e+16+4>>2]=1566444395;c[e+16+8>>2]=1566444395;g[e+16+12>>2]=0.0;d=c[(c[b>>2]|0)+64>>2]|0;g[e>>2]=-999999984306749440.0;g[e+4>>2]=-999999984306749440.0;g[e+8>>2]=-999999984306749440.0;g[e+12>>2]=0.0;ab[d&127](b,e+32|0,e,e+16|0);c[a>>2]=c[f>>2];c[a+4>>2]=c[f+4>>2];c[a+8>>2]=c[f+8>>2];c[a+12>>2]=c[f+12>>2];sa=e;return}function Tg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0;p=sa;sa=sa+16|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;e=+g[d>>2];f=+g[d+4>>2];h=+g[d+8>>2];if(e*e+f*f+h*h<9.999999747378752e-05){o=1.0;n=0.0;m=0.0}else{m=1.0/+x(+(e*e+f*f+h*h));o=e*m;n=f*m;m=h*m}d=c[b+52>>2]|0;l=+g[b+28+(((d+2|0)%3|0)<<2)>>2];c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[p+(d<<2)>>2]=c[b+28+(d<<2)>>2];j=o*l;k=n*l;l=m*l;e=j+ +g[p>>2];f=k+ +g[p+4>>2];i=l+ +g[p+8>>2];h=+va[c[(c[b>>2]|0)+48>>2]&15](b);e=e-o*h;f=f-n*h;h=i-m*h;i=m*h+(o*e+n*f);if(i>-999999984306749440.0){g[a>>2]=e;g[a+4>>2]=f;g[a+8>>2]=h;g[a+12>>2]=0.0}else i=-999999984306749440.0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;d=c[b+52>>2]|0;g[p+(d<<2)>>2]=-+g[b+28+(d<<2)>>2];e=j+ +g[p>>2];f=k+ +g[p+4>>2];l=l+ +g[p+8>>2];h=+va[c[(c[b>>2]|0)+48>>2]&15](b);e=e-o*h;f=f-n*h;h=l-m*h;if(!(m*h+(o*e+n*f)>i)){sa=p;return}g[a>>2]=e;g[a+4>>2]=f;g[a+8>>2]=h;g[a+12>>2]=0.0;sa=p;return}function Ug(b){b=b|0;var d=0,e=0;if(!b)return;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;d=c[b+12>>2]|0;do if(d){if(!(a[b+16>>0]|0)){a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;d=b+8|0;e=14;break}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+32>>2]|0;a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;if(d){if(!(a[b+36>>0]|0)){a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;d=b+8|0;break}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+12>>2]|0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;if(!d)d=b+8|0;else{if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+12>>2]=0;d=b+8|0}}else{d=b+8|0;e=14}}else{a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;d=b+8|0;e=14}while(0);if((e|0)==14){a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0}a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[d>>2]=0;Sx(b);return}function Vg(a,b,d,e,f,h,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;h=+h;i=+i;j=+j;k=+k;l=+l;var m=0;m=sa;sa=sa+128|0;c[m+80>>2]=c[a+4>>2];c[m+80+4>>2]=c[a+20>>2];c[m+80+8>>2]=c[a+36>>2];g[m+80+12>>2]=0.0;c[m+80+16>>2]=c[a+8>>2];c[m+80+20>>2]=c[a+24>>2];c[m+80+24>>2]=c[a+40>>2];g[m+80+28>>2]=0.0;c[m+80+32>>2]=c[a+12>>2];c[m+80+36>>2]=c[a+28>>2];c[m+80+40>>2]=c[a+44>>2];g[m+80+44>>2]=0.0;c[m+32>>2]=c[b+4>>2];c[m+32+4>>2]=c[b+20>>2];c[m+32+8>>2]=c[b+36>>2];g[m+32+12>>2]=0.0;c[m+32+16>>2]=c[b+8>>2];c[m+32+20>>2]=c[b+24>>2];c[m+32+24>>2]=c[b+40>>2];g[m+32+28>>2]=0.0;c[m+32+32>>2]=c[b+12>>2];c[m+32+36>>2]=c[b+28>>2];c[m+32+40>>2]=c[b+44>>2];g[m+32+44>>2]=0.0;h=h-+g[a+56>>2];i=i-+g[a+60>>2];g[m+16>>2]=f-+g[a+52>>2];g[m+16+4>>2]=h;g[m+16+8>>2]=i;g[m+16+12>>2]=0.0;i=k-+g[b+56>>2];l=l-+g[b+60>>2];g[m>>2]=j-+g[b+52>>2];g[m+4>>2]=i;g[m+8>>2]=l;g[m+12>>2]=0.0;fg(d,m+80|0,m+32|0,m+16|0,m,e,a+396|0,+g[a+344>>2],b+396|0,+g[b+344>>2]);sa=m;return}function Wg(a,b,d,e,f){a=a|0;b=+b;d=+d;e=+e;f=f|0;var h=0,i=0,j=0,k=0,l=0.0,m=0.0;j=sa;sa=sa+48|0;l=1.0/+x(+(b*b+d*d+e*e));g[f>>2]=l*b;g[f+4>>2]=l*d;g[f+8>>2]=l*e;g[f+12>>2]=0.0;h=c[a+120>>2]|0;k=c[a+124>>2]|0;i=(c[a>>2]|0)+(1?k>>1:k)|0;if(k&1)h=c[(c[i>>2]|0)+h>>2]|0;Za[h&127](j,i,f);b=-+g[f>>2];d=-+g[f+4>>2];e=-+g[f+8>>2];h=c[a+120>>2]|0;k=c[a+124>>2]|0;i=(c[a+4>>2]|0)+(1?k>>1:k)|0;if(k&1)h=c[(c[i>>2]|0)+h>>2]|0;l=+g[a+24>>2]*b+ +g[a+28>>2]*d+ +g[a+32>>2]*e;m=+g[a+40>>2]*b+ +g[a+44>>2]*d+ +g[a+48>>2]*e;g[j+16>>2]=+g[a+8>>2]*b+ +g[a+12>>2]*d+ +g[a+16>>2]*e;g[j+16+4>>2]=l;g[j+16+8>>2]=m;g[j+16+12>>2]=0.0;Za[h&127](j+32|0,i,j+16|0);m=+g[j+32>>2];b=+g[j+32+4>>2];d=+g[j+32+8>>2];e=+g[j+4>>2]-(m*+g[a+72>>2]+b*+g[a+76>>2]+d*+g[a+80>>2]+ +g[a+108>>2]);l=+g[j+8>>2]-(m*+g[a+88>>2]+b*+g[a+92>>2]+d*+g[a+96>>2]+ +g[a+112>>2]);g[f+16>>2]=+g[j>>2]-(m*+g[a+56>>2]+b*+g[a+60>>2]+d*+g[a+64>>2]+ +g[a+104>>2]);g[f+20>>2]=e;g[f+24>>2]=l;g[f+28>>2]=0.0;sa=j;return}function Xg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0,j=0.0,k=0.0;i=c[b>>2]|0;if((i|0)==(c[a+80>>2]|0)){h=1.0;return +h}if(c[i+204>>2]&4|0){h=1.0;return +h}if(d){e=+g[b+8>>2];f=+g[b+12>>2];h=+g[b+16>>2]}else{k=+g[b+8>>2];j=+g[b+12>>2];h=+g[b+16>>2];e=+g[i+4>>2]*k+ +g[i+8>>2]*j+ +g[i+12>>2]*h;f=k*+g[i+20>>2]+j*+g[i+24>>2]+h*+g[i+28>>2];h=k*+g[i+36>>2]+j*+g[i+40>>2]+h*+g[i+44>>2]}if(e*+g[a+84>>2]+f*+g[a+88>>2]+h*+g[a+92>>2]<+g[a+100>>2]){k=1.0;return +k}c[a+4>>2]=c[b+40>>2];c[a+76>>2]=i;if(d){c[a+44>>2]=c[b+8>>2];c[a+44+4>>2]=c[b+8+4>>2];c[a+44+8>>2]=c[b+8+8>>2];c[a+44+12>>2]=c[b+8+12>>2]}else{e=+g[b+8>>2];f=+g[b+12>>2];h=+g[b+16>>2];j=e*+g[i+20>>2]+f*+g[i+24>>2]+h*+g[i+28>>2];k=e*+g[i+36>>2]+f*+g[i+40>>2]+h*+g[i+44>>2];g[a+44>>2]=+g[i+4>>2]*e+ +g[i+8>>2]*f+ +g[i+12>>2]*h;g[a+48>>2]=j;g[a+52>>2]=k;g[a+56>>2]=0.0}c[a+60>>2]=c[b+24>>2];c[a+60+4>>2]=c[b+24+4>>2];c[a+60+8>>2]=c[b+24+8>>2];c[a+60+12>>2]=c[b+24+12>>2];k=+g[b+40>>2];return +k}function Yg(a,b,c,d,e,f,h,i,j,k,l,m,n,o){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;i=+i;j=+j;k=+k;l=+l;m=+m;n=+n;o=+o;var p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0;q=(j-f)*(n-h)-(k-h)*(m-f);r=(k-h)*(l-e)-(i-e)*(n-h);s=(i-e)*(m-f)-(j-f)*(l-e);if(+w(+(s*d+(q*b+r*c)))<1.1920928955078125e-07){s=-1.0;return +s}t=+g[a>>2];v=+g[a+4>>2];u=+g[a+8>>2];p=-(q*t+r*v+s*u-(s*h+(q*e+r*f)))/(s*d+(q*b+r*c));if(((p>1.1920928955078125e-06&p-1.1920928955078125e-06:0)?s*((m-(v+p*c))*(i-(t+p*b))-(j-(v+p*c))*(l-(t+p*b)))+(q*((j-(v+p*c))*(n-(u+p*d))-(k-(u+p*d))*(m-(v+p*c)))+r*((k-(u+p*d))*(l-(t+p*b))-(n-(u+p*d))*(i-(t+p*b))))>-1.1920928955078125e-06:0)?s*((f-(v+p*c))*(l-(t+p*b))-(m-(v+p*c))*(e-(t+p*b)))+(q*((m-(v+p*c))*(h-(u+p*d))-(n-(u+p*d))*(f-(v+p*c)))+r*((n-(u+p*d))*(e-(t+p*b))-(h-(u+p*d))*(l-(t+p*b))))>-1.1920928955078125e-06:0){v=p;return +v}v=-1.0;return +v}function Zg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;if(a[b+165>>0]|0){if((c[b+92>>2]|0)>=(d|0))return;if((d|0)!=0?(c[7182]=(c[7182]|0)+1,e=xb((d<<4|3)+16|0)|0,(e|0)!=0):0){c[(e+4+15&-16)+-4>>2]=e;g=e+4+15&-16}else g=0;f=c[b+88>>2]|0;if((f|0)>0){e=0;do{i=g+(e<<4)|0;h=(c[b+96>>2]|0)+(e<<4)|0;c[i>>2]=c[h>>2];c[i+4>>2]=c[h+4>>2];c[i+8>>2]=c[h+8>>2];c[i+12>>2]=c[h+12>>2];e=e+1|0}while((e|0)!=(f|0))}e=c[b+96>>2]|0;if(e|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=g;c[b+92>>2]=d;return}if((c[b+112>>2]|0)>=(d|0))return;if((d|0)!=0?(c[7182]=(c[7182]|0)+1,f=xb((d<<2|3)+16|0)|0,(f|0)!=0):0){c[(f+4+15&-16)+-4>>2]=f;h=f+4+15&-16}else h=0;f=c[b+108>>2]|0;g=c[b+116>>2]|0;if((f|0)<=0)if(!g)e=b+120|0;else i=23;else{e=0;do{c[h+(e<<2)>>2]=c[g+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0));i=23}if((i|0)==23){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[b+116>>2]=0;e=b+120|0}a[e>>0]=1;c[b+116>>2]=h;c[b+112>>2]=d;return}function _g(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;if(!(c[i+44>>2]|0))return;b=c[i+20>>2]|0;if(!(c[i+64>>2]&256)){if((b|0)<=0)return;e=0;do{d=c[a+28>>2]|0;if((d|0)>0){b=0;do{j=c[(c[a+116>>2]|0)+(b<<2)>>2]|0;h=c[a+36>>2]|0;g=c[a+16>>2]|0;Rf(g+((c[h+(j*152|0)+144>>2]|0)*244|0)|0,g+((c[h+(j*152|0)+148>>2]|0)*244|0)|0,h+(j*152|0)|0);b=b+1|0}while((b|0)!=(d|0));b=c[i+20>>2]|0}e=e+1|0}while((e|0)<(b|0));return}else{if((b|0)<=0)return;e=0;do{d=c[a+28>>2]|0;if((d|0)>0){b=0;do{j=c[(c[a+116>>2]|0)+(b<<2)>>2]|0;h=c[a+36>>2]|0;g=c[a+16>>2]|0;Rf(g+((c[h+(j*152|0)+144>>2]|0)*244|0)|0,g+((c[h+(j*152|0)+148>>2]|0)*244|0)|0,h+(j*152|0)|0);b=b+1|0}while((b|0)!=(d|0));b=c[i+20>>2]|0}e=e+1|0}while((e|0)<(b|0));return}}function $g(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if(!(a[d+164>>0]|0)){if((c[d+152>>2]|0)>=(e|0))return;if((e|0)!=0?(c[7182]=(c[7182]|0)+1,g=xb((e<<1)+19|0)|0,(g|0)!=0):0){c[(g+4+15&-16)+-4>>2]=g;i=g+4+15&-16}else i=0;g=c[d+148>>2]|0;h=c[d+156>>2]|0;if((g|0)<=0)if(!h)f=d+160|0;else j=24;else{f=0;do{b[i+(f<<1)>>1]=b[h+(f<<1)>>1]|0;f=f+1|0}while((f|0)!=(g|0));j=24}if((j|0)==24){if(a[d+160>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[d+156>>2]=0;f=d+160|0}a[f>>0]=1;c[d+156>>2]=i;c[d+152>>2]=e;return}else{if((c[d+132>>2]|0)>=(e|0))return;if((e|0)!=0?(c[7182]=(c[7182]|0)+1,f=xb((e<<2|3)+16|0)|0,(f|0)!=0):0){c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}else i=0;g=c[d+128>>2]|0;h=c[d+136>>2]|0;if((g|0)<=0)if(!h)f=d+140|0;else j=11;else{f=0;do{c[i+(f<<2)>>2]=c[h+(f<<2)>>2];f=f+1|0}while((f|0)!=(g|0));j=11}if((j|0)==11){if(a[d+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[d+136>>2]=0;f=d+140|0}a[f>>0]=1;c[d+136>>2]=i;c[d+132>>2]=e;return}}function ah(a,b,d){a=a|0;b=b|0;d=d|0;ih(a,b,d)|0;c[b+52>>2]=c[a+300>>2];c[b+56>>2]=c[a+304>>2];c[b+60>>2]=c[a+308>>2];c[b+64>>2]=c[a+312>>2];c[b+68>>2]=c[a+316>>2];c[b+72>>2]=c[a+320>>2];c[b+76>>2]=c[a+324>>2];c[b+80>>2]=c[a+328>>2];c[b+84>>2]=c[a+332>>2];c[b+88>>2]=c[a+336>>2];c[b+92>>2]=c[a+340>>2];c[b+96>>2]=c[a+344>>2];c[b+100>>2]=c[a+348>>2];c[b+104>>2]=c[a+352>>2];c[b+108>>2]=c[a+356>>2];c[b+112>>2]=c[a+360>>2];c[b+116>>2]=c[a+364>>2];c[b+120>>2]=c[a+368>>2];c[b+124>>2]=c[a+372>>2];c[b+128>>2]=c[a+376>>2];c[b+132>>2]=c[a+380>>2];c[b+136>>2]=c[a+384>>2];c[b+140>>2]=c[a+388>>2];c[b+144>>2]=c[a+392>>2];c[b+148>>2]=c[a+396>>2];c[b+152>>2]=c[a+400>>2];c[b+156>>2]=c[a+404>>2];c[b+160>>2]=c[a+408>>2];c[b+164>>2]=c[a+412>>2];c[b+168>>2]=c[a+416>>2];c[b+172>>2]=c[a+420>>2];c[b+176>>2]=c[a+424>>2];c[b+180>>2]=c[a+444>>2];c[b+184>>2]=c[a+448>>2];c[b+188>>2]=c[a+452>>2];c[b+192>>2]=c[a+428>>2];c[b+196>>2]=c[a+432>>2];c[b+200>>2]=c[a+436>>2];c[b+204>>2]=c[a+440>>2];return 17046}function bh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0;c[7182]=(c[7182]|0)+1;h=xb(55)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}c[j>>2]=d;c[j+4>>2]=e;c[j+8>>2]=f;c[j+12>>2]=-1;c[j+16>>2]=-1;c[j+20>>2]=-1;c[j+28>>2]=-1;g[j+32>>2]=0.0;f=j;d=c[b+4>>2]|0;c[j+24>>2]=d;if((d|0)!=(c[b+8>>2]|0)){i=d;e=b+12|0;e=c[e>>2]|0;e=e+(i<<2)|0;c[e>>2]=f;i=i+1|0;c[b+4>>2]=i;return j|0}i=(d|0)==0?1:d<<1;if((d|0)>=(i|0)){i=d;e=b+12|0;e=c[e>>2]|0;e=e+(i<<2)|0;c[e>>2]=f;i=i+1|0;c[b+4>>2]=i;return j|0}if(!i)h=0;else{c[7182]=(c[7182]|0)+1;h=xb((i<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}d=c[b+4>>2]|0}if((d|0)>0){e=0;do{c[h+(e<<2)>>2]=c[(c[b+12>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(d|0))}e=c[b+12>>2]|0;if(e){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+4>>2]|0}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=h;c[b+8>>2]=i;i=d;e=b+12|0;e=c[e>>2]|0;e=e+(i<<2)|0;c[e>>2]=f;i=i+1|0;c[b+4>>2]=i;return j|0}function ch(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0;o=+va[c[(c[a>>2]|0)+48>>2]&15](a);u=+g[a+72>>2];t=+g[a+56>>2];r=+g[a+76>>2];q=+g[a+60>>2];n=+g[a+80>>2];m=+g[a+64>>2];F=+g[b>>2];z=+w(+F);E=+g[b+4>>2];y=+w(+E);k=+g[b+8>>2];l=+w(+k);D=+g[b+16>>2];x=+w(+D);C=+g[b+20>>2];v=+w(+C);i=+g[b+24>>2];j=+w(+i);B=+g[b+32>>2];s=+w(+B);A=+g[b+36>>2];p=+w(+A);f=+g[b+40>>2];h=+w(+f);k=(u+t)*.5*F+(r+q)*.5*E+(n+m)*.5*k+ +g[b+48>>2];i=(u+t)*.5*D+(r+q)*.5*C+(n+m)*.5*i+ +g[b+52>>2];f=(u+t)*.5*B+(r+q)*.5*A+(n+m)*.5*f+ +g[b+56>>2];l=(o+(u-t)*.5)*z+(o+(r-q)*.5)*y+(o+(n-m)*.5)*l;j=(o+(u-t)*.5)*x+(o+(r-q)*.5)*v+(o+(n-m)*.5)*j;h=(o+(u-t)*.5)*s+(o+(r-q)*.5)*p+(o+(n-m)*.5)*h;g[d>>2]=k-l;g[d+4>>2]=i-j;g[d+8>>2]=f-h;g[d+12>>2]=0.0;g[e>>2]=l+k;g[e+4>>2]=j+i;g[e+8>>2]=h+f;g[e+12>>2]=0.0;return}function dh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;if(a[d+32>>0]&1){f=c[b+4>>2]|0;if(f|0)Bk(f,d,e);f=c[b>>2]|0;if(f|0){n=+g[d>>2];l=+g[f+128>>2];m=+g[d+4>>2];k=+g[d+8>>2];h=+g[e+4>>2];p=+g[e+8>>2];o=+g[e>>2];j=+g[f+180>>2]*(k*h-m*p)+ +g[f+184>>2]*(n*p-k*o)+(m*o-n*h)*+g[f+188>>2];i=(k*h-m*p)*+g[f+196>>2]+(n*p-k*o)*+g[f+200>>2]+(m*o-n*h)*+g[f+204>>2];h=(k*h-m*p)*+g[f+212>>2]+(n*p-k*o)*+g[f+216>>2]+(m*o-n*h)*+g[f+220>>2];g[f+244>>2]=n*l+ +g[f+244>>2];g[f+248>>2]=l*m+ +g[f+248>>2];g[f+252>>2]=l*k+ +g[f+252>>2];g[f+316>>2]=n*l+ +g[f+316>>2];g[f+320>>2]=l*m+ +g[f+320>>2];g[f+324>>2]=l*k+ +g[f+324>>2];g[f+260>>2]=j+ +g[f+260>>2];g[f+264>>2]=i+ +g[f+264>>2];g[f+268>>2]=h+ +g[f+268>>2];g[f+332>>2]=j+ +g[f+332>>2];g[f+336>>2]=i+ +g[f+336>>2];g[f+340>>2]=h+ +g[f+340>>2];c[f+308>>2]=(c[f+308>>2]|0)+1}}if(!(a[d+32>>0]&2))return;ti(b,d+16|0,e);return}function eh(a){a=a|0;var b=0,d=0,e=0,f=0;d=sa;sa=sa+16|0;Ki(18619);Pa[c[(c[a>>2]|0)+8>>2]&511](a);Pa[c[(c[a>>2]|0)+12>>2]&511](a);b=c[a+24>>2]|0;Ki(18653);if(b|0){f=c[(c[b>>2]|0)+32>>2]|0;e=c[a+68>>2]|0;e=Fa[c[(c[e>>2]|0)+36>>2]&127](e)|0;ab[f&127](b,e,a+28|0,c[a+24>>2]|0)}b=c[3084]|0;f=(c[b+16>>2]|0)+-1|0;c[b+16>>2]=f;do if(!f){if(c[b+4>>2]|0){la(d|0,0)|0;a=c[7181]|0;g[b+8>>2]=+g[b+8>>2]+ +(((c[d+4>>2]|0)-(c[a+4>>2]|0)+(((c[d>>2]|0)-(c[a>>2]|0)|0)*1e6|0)-(c[b+12>>2]|0)|0)>>>0)/1.0e3;a=c[3084]|0;if(c[b+16>>2]|0)break}else a=b;a=c[a+20>>2]|0;c[3084]=a}else a=b;while(0);b=a+16|0;f=(c[b>>2]|0)+-1|0;c[b>>2]=f;if(f|0){sa=d;return}do if(c[a+4>>2]|0){la(d|0,0)|0;e=c[7181]|0;f=a+8|0;g[f>>2]=+g[f>>2]+ +(((c[d+4>>2]|0)-(c[e+4>>2]|0)+(((c[d>>2]|0)-(c[e>>2]|0)|0)*1e6|0)-(c[a+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[b>>2]|0)){a=c[3084]|0;break}else{sa=d;return}}while(0);c[3084]=c[a+20>>2];sa=d;return}function fh(b,d){b=b|0;d=d|0;var e=0;c[b>>2]=11748;a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=-1;c[b+16>>2]=0;c[b+20>>2]=0;a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;c[b+64>>2]=0;c[b+68>>2]=0;c[b+72>>2]=-1;c[b+76>>2]=0;c[b+80>>2]=0;a[b+193>>0]=0;a[b+194>>0]=1;a[b+192>>0]=((d|0)!=0^1)&1;g[b+140>>2]=0.0;c[b+144>>2]=0;c[b+164>>2]=0;c[b+148>>2]=1;c[b+152>>2]=0;c[b+156>>2]=10;c[b+160>>2]=1;c[b+168>>2]=0;c[b+172>>2]=0;g[b+176>>2]=0.0;if(d|0){e=d;d=b+136|0;c[d>>2]=e;d=b+188|0;c[d>>2]=0;d=b+180|0;c[d>>2]=0;d=b+184|0;c[d>>2]=0;b=b+124|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;return}c[7182]=(c[7182]|0)+1;d=xb(95)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}Th(d);e=b+136|0;c[e>>2]=d;e=b+188|0;c[e>>2]=0;e=b+180|0;c[e>>2]=0;e=b+184|0;c[e>>2]=0;e=b+124|0;c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;return}function gh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=c[b+16>>2]|0;if(d|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;d=c[b+40>>2]|0;if(d|0){if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+40>>2]=0}a[b+44>>0]=1;c[b+40>>2]=0;c[b+32>>2]=0;c[b+36>>2]=0;d=c[b+60>>2]|0;if(d|0){if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+60>>2]=0}a[b+64>>0]=1;c[b+60>>2]=0;c[b+52>>2]=0;c[b+56>>2]=0;if((c[b+12>>2]|0)>=2){Te(b);return}c[7182]=(c[7182]|0)+1;d=xb(43)|0;if(!d)f=0;else{c[(d+4+15&-16)+-4>>2]=d;f=d+4+15&-16}e=c[b+8>>2]|0;if((e|0)>0){d=0;do{g=f+(d*12|0)|0;h=(c[b+16>>2]|0)+(d*12|0)|0;c[g>>2]=c[h>>2];c[g+4>>2]=c[h+4>>2];c[g+8>>2]=c[h+8>>2];d=d+1|0}while((d|0)!=(e|0))}d=c[b+16>>2]|0;if(d|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=f;c[b+12>>2]=2;Te(b);return}function hh(a,b,e){a=a|0;b=b|0;e=e|0;ih(a,b,e)|0;c[b+52>>2]=c[a+52>>2];c[b+56>>2]=c[a+56>>2];c[b+60>>2]=c[a+60>>2];c[b+64>>2]=c[a+64>>2];c[b+68>>2]=c[a+68>>2];c[b+72>>2]=c[a+72>>2];c[b+76>>2]=c[a+76>>2];c[b+80>>2]=c[a+80>>2];c[b+84>>2]=c[a+84>>2];c[b+88>>2]=c[a+88>>2];c[b+92>>2]=c[a+92>>2];c[b+96>>2]=c[a+96>>2];c[b+100>>2]=c[a+100>>2];c[b+104>>2]=c[a+104>>2];c[b+108>>2]=c[a+108>>2];c[b+112>>2]=c[a+112>>2];c[b+116>>2]=c[a+116>>2];c[b+120>>2]=c[a+120>>2];c[b+124>>2]=c[a+124>>2];c[b+128>>2]=c[a+128>>2];c[b+132>>2]=c[a+132>>2];c[b+136>>2]=c[a+136>>2];c[b+140>>2]=c[a+140>>2];c[b+144>>2]=c[a+144>>2];c[b+148>>2]=c[a+148>>2];c[b+152>>2]=c[a+152>>2];c[b+156>>2]=c[a+156>>2];c[b+160>>2]=c[a+160>>2];c[b+164>>2]=c[a+164>>2];c[b+168>>2]=c[a+168>>2];c[b+172>>2]=c[a+172>>2];c[b+176>>2]=c[a+176>>2];c[b+180>>2]=c[a+188>>2];c[b+184>>2]=c[a+184>>2];c[b+188>>2]=c[a+196>>2];c[b+192>>2]=c[a+192>>2];c[b+196>>2]=d[a+180>>0];c[b+200>>2]=d[a+49>>0];return 17002}function ih(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0;c[b>>2]=Ha[c[(c[e>>2]|0)+28>>2]&31](e,c[a+28>>2]|0)|0;c[b+4>>2]=Ha[c[(c[e>>2]|0)+28>>2]&31](e,c[a+32>>2]|0)|0;f=Ha[c[(c[e>>2]|0)+40>>2]&31](e,a)|0;g=Ha[c[(c[e>>2]|0)+28>>2]&31](e,f)|0;c[b+8>>2]=g;if(g|0)Va[c[(c[e>>2]|0)+48>>2]&127](e,f);c[b+12>>2]=c[a+4>>2];c[b+24>>2]=d[a+21>>0];c[b+40>>2]=c[a+24>>2];c[b+44>>2]=c[a+16>>2];c[b+48>>2]=d[a+20>>0];c[b+20>>2]=c[a+12>>2];c[b+16>>2]=c[a+8>>2];c[b+28>>2]=c[a+36>>2];c[b+32>>2]=c[a+40>>2];c[b+36>>2]=0;f=c[a+28>>2]|0;g=c[f+488>>2]|0;if((g|0)>0){e=c[f+496>>2]|0;if((c[e>>2]|0)==(a|0))c[b+36>>2]=1;if((g|0)>1){f=1;do{if((c[e+(f<<2)>>2]|0)==(a|0))c[b+36>>2]=1;f=f+1|0}while((f|0)!=(g|0))}}f=c[a+32>>2]|0;g=c[f+488>>2]|0;if((g|0)<=0)return 16939;e=c[f+496>>2]|0;if((c[e>>2]|0)==(a|0))c[b+36>>2]=1;if((g|0)<=1)return 16939;f=1;do{if((c[e+(f<<2)>>2]|0)==(a|0))c[b+36>>2]=1;f=f+1|0}while((f|0)!=(g|0));return 16939}function jh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0;f=sa;sa=sa+16|0;x=c[a+52>>2]|0;m=+g[a+28+(((x+2|0)%3|0)<<2)>>2];g[f>>2]=m;g[f+4>>2]=m;g[f+8>>2]=m;g[f+12>>2]=0.0;g[f+(x<<2)>>2]=m+ +g[a+28+(x<<2)>>2];m=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=+va[c[(c[a>>2]|0)+48>>2]&15](a);m=m+ +g[f>>2];g[f>>2]=m;k=k+ +g[f+4>>2];g[f+4>>2]=k;i=i+ +g[f+8>>2];v=+w(+(+g[b>>2]));u=+w(+(+g[b+4>>2]));t=+w(+(+g[b+8>>2]));r=+w(+(+g[b+16>>2]));q=+w(+(+g[b+20>>2]));p=+w(+(+g[b+24>>2]));l=+w(+(+g[b+32>>2]));j=+w(+(+g[b+36>>2]));h=+w(+(+g[b+40>>2]));s=+g[b+48>>2];o=+g[b+52>>2];n=+g[b+56>>2];g[d>>2]=s-(m*v+k*u+i*t);g[d+4>>2]=o-(m*r+k*q+i*p);g[d+8>>2]=n-(m*l+k*j+i*h);g[d+12>>2]=0.0;g[e>>2]=m*v+k*u+i*t+s;g[e+4>>2]=m*r+k*q+i*p+o;g[e+8>>2]=n+(m*l+k*j+i*h);g[e+12>>2]=0.0;sa=f;return}function kh(){var b=0,d=0,e=0;b=fs(288)|0;c[b+164>>2]=1065353216;c[b+168>>2]=1065353216;c[b+172>>2]=1065353216;g[b+176>>2]=0.0;c[b+180>>2]=0;g[b+184>>2]=999999984306749440.0;c[b+188>>2]=0;c[b+188+4>>2]=0;c[b+188+8>>2]=0;c[b+188+12>>2]=0;c[b+204>>2]=1;c[b+208>>2]=-1;c[b+212>>2]=-1;c[b+216>>2]=1;g[b+220>>2]=0.0;g[b+224>>2]=.5;g[b+228>>2]=0.0;g[b+232>>2]=0.0;c[b+240>>2]=0;g[b+244>>2]=1.0;c[b+248>>2]=0;c[b+248+4>>2]=0;c[b+248+8>>2]=0;c[b+248+12>>2]=0;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+48+4>>2]=0;c[b+48+8>>2]=0;c[b+48+12>>2]=0;c[b+48+16>>2]=0;a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;c[b+272>>2]=0;c[b+236>>2]=4;c[b>>2]=7896;c[7182]=(c[7182]|0)+1;d=xb(95)|0;if(!d){e=0;Th(e);d=b+284|0;c[d>>2]=e;return b|0}c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16;Th(d);e=b+284|0;c[e>>2]=d;return b|0}function lh(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0;h=sa;sa=sa+96|0;g[h+4>>2]=1.0;c[h+8>>2]=0;b[h+12>>1]=1;b[h+14>>1]=-1;c[h+16>>2]=0;c[h>>2]=5536;c[h+20>>2]=c[d>>2];c[h+20+4>>2]=c[d+4>>2];c[h+20+8>>2]=c[d+8>>2];c[h+20+12>>2]=c[d+12>>2];c[h+36>>2]=c[e>>2];c[h+36+4>>2]=c[e+4>>2];c[h+36+8>>2]=c[e+8>>2];c[h+36+12>>2]=c[e+12>>2];a=c[a+4>>2]|0;ab[c[(c[a>>2]|0)+32>>2]&127](a,d,e,h);a=c[h+8>>2]|0;if(!a){f=0;sa=h;return f|0}if(!(c[a+236>>2]&2)){f=0;sa=h;return f|0}if(c[a+204>>2]&4|0){f=0;sa=h;return f|0}c[f>>2]=c[h+68>>2];c[f+4>>2]=c[h+68+4>>2];c[f+8>>2]=c[h+68+8>>2];c[f+12>>2]=c[h+68+12>>2];c[f+16>>2]=c[h+52>>2];c[f+16+4>>2]=c[h+52+4>>2];c[f+16+8>>2]=c[h+52+8>>2];c[f+16+12>>2]=c[h+52+12>>2];l=+g[f+16>>2];k=+g[f+20>>2];j=+g[f+24>>2];i=1.0/+x(+(l*l+k*k+j*j));g[f+16>>2]=l*i;g[f+20>>2]=k*i;g[f+24>>2]=j*i;c[f+32>>2]=c[h+4>>2];f=a;sa=h;return f|0}function mh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;Pa[c[(c[b>>2]|0)+32>>2]&511](b);e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,104,1)|0;d=c[e+8>>2]|0;f=d;g=f+104|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));c[d+88>>2]=c[a+248>>2];c[d+92>>2]=c[a+252>>2];c[d+96>>2]=c[a+256>>2];c[d+100>>2]=c[a+260>>2];c[d>>2]=c[a+92>>2];c[d+4>>2]=c[a+96>>2];c[d+8>>2]=c[a+100>>2];c[d+12>>2]=c[a+104>>2];c[d+16>>2]=c[a+108>>2];c[d+20>>2]=c[a+116>>2];c[d+24>>2]=c[a+120>>2];c[d+28>>2]=c[a+124>>2];c[d+32>>2]=c[a+128>>2];c[d+36>>2]=c[a+132>>2];c[d+40>>2]=c[a+140>>2];c[d+44>>2]=c[a+144>>2];c[d+48>>2]=c[a+148>>2];c[d+52>>2]=c[a+152>>2];c[d+56>>2]=c[a+168>>2];c[d+60>>2]=c[a+172>>2];c[d+64>>2]=c[a+112>>2];c[d+68>>2]=c[a+156>>2];c[d+72>>2]=c[a+160>>2];c[d+76>>2]=c[a+164>>2];c[d+80>>2]=c[a+136>>2];eb[c[(c[b>>2]|0)+20>>2]&31](b,e,16580,1145853764,d);wi(a,b);Ac(a,b);Pa[c[(c[b>>2]|0)+36>>2]&511](b);return}function nh(b,d){b=b|0;d=d|0;if((c[b+16>>2]|0)!=(0-(c[b+76>>2]|0)|0))return;d=c[b+4>>2]|0;if(d|0)Gm(b+4|0,d);d=c[b+8>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+8>>2]=0;c[b+12>>2]=-1;d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;c[b+20>>2]=0;d=c[b+64>>2]|0;if(d|0)Gm(b+64|0,d);d=c[b+68>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+68>>2]=0;c[b+72>>2]=-1;d=c[b+96>>2]|0;if(d|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;c[b+80>>2]=0;a[b+193>>0]=0;a[b+194>>0]=1;c[b+144>>2]=0;c[b+164>>2]=0;c[b+148>>2]=1;c[b+152>>2]=0;c[b+156>>2]=10;c[b+160>>2]=1;c[b+124>>2]=0;c[b+124+4>>2]=0;c[b+124+8>>2]=0;c[b+168>>2]=0;c[b+168+4>>2]=0;c[b+168+8>>2]=0;c[b+168+12>>2]=0;c[b+168+16>>2]=0;c[b+168+20>>2]=0;return}function oh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;l=sa;sa=sa+48|0;g=l;h=g+44|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));if(!d)j=c[c[b+880>>2]>>2]|0;else j=d;d=c[b+732>>2]|0;if((d|0)==(c[b+736>>2]|0)?(k=(d|0)==0?1:d<<1,(d|0)<(k|0)):0){if(!k)i=0;else{c[7182]=(c[7182]|0)+1;d=xb((k*52|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}i=d;d=c[b+732>>2]|0}if((d|0)>0){e=0;do{g=i+(e*52|0)|0;f=(c[b+740>>2]|0)+(e*52|0)|0;h=g+52|0;do{c[g>>2]=c[f>>2];g=g+4|0;f=f+4|0}while((g|0)<(h|0));e=e+1|0}while((e|0)!=(d|0))}d=c[b+740>>2]|0;if(d|0){if(a[b+744>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+740>>2]=0}a[b+744>>0]=1;c[b+740>>2]=i;c[b+736>>2]=k;d=c[b+732>>2]|0}g=c[b+740>>2]|0;c[g+(d*52|0)>>2]=0;c[g+(d*52|0)+4>>2]=j;g=g+(d*52|0)+8|0;f=l;h=g+44|0;do{c[g>>2]=c[f>>2];g=g+4|0;f=f+4|0}while((g|0)<(h|0));c[b+732>>2]=(c[b+732>>2]|0)+1;sa=l;return}function ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,h=0.0;e=sa;sa=sa+32|0;d=c[b+388>>2]|0;switch(c[a+388>>2]&48&d&63){case 32:{if((a|0)==(b|0)&(d&64|0)==0){sa=e;return}g[e+4>>2]=1.0;c[e+8+4>>2]=0;c[e+8+4+4>>2]=0;c[e+8+4+8>>2]=0;c[e>>2]=6300;c[e+8>>2]=c[a+456>>2];d=c[a+192>>2]|0;h=+va[c[(c[d>>2]|0)+48>>2]&15](d);d=c[b+192>>2]|0;g[e+12>>2]=h+ +va[c[(c[d>>2]|0)+48>>2]&15](d);h=+g[a+316>>2];f=+g[b+316>>2];g[e+16>>2]=h>2]=a;c[e+28>>2]=b;Od(c[a+1048>>2]|0,c[b+1048>>2]|0,e);sa=e;return}case 16:{if((a|0)==(b|0)){sa=e;return}c[e>>2]=6336;d=c[a+192>>2]|0;h=+va[c[(c[d>>2]|0)+48>>2]&15](d);d=c[b+192>>2]|0;g[e+12>>2]=h+ +va[c[(c[d>>2]|0)+48>>2]&15](d);c[e+4>>2]=a;c[e+8>>2]=b;Od(c[a+928>>2]|0,c[b+988>>2]|0,e);c[e+4>>2]=b;c[e+8>>2]=a;Od(c[b+928>>2]|0,c[a+988>>2]|0,e);sa=e;return}default:{sa=e;return}}}function qh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0,j=0.0;i=sa;sa=sa+32|0;c[i+16>>2]=c[d>>2];c[i+16+4>>2]=c[d+4>>2];c[i+16+8>>2]=c[d+8>>2];c[i+16+12>>2]=c[d+12>>2];f=+g[i+16>>2];h=+g[i+16+4>>2];e=+g[i+16+8>>2];if(f*f+h*h+e*e<1.4210854715202004e-14){c[i+16>>2]=-1082130432;c[i+16+4>>2]=-1082130432;c[i+16+8>>2]=-1082130432;g[i+16+12>>2]=0.0;f=-1.0;h=-1.0;e=-1.0}j=1.0/+x(+(f*f+h*h+e*e));g[i+16>>2]=f*j;g[i+16+4>>2]=h*j;g[i+16+8>>2]=e*j;Nc(i,b,i+16|0);switch(c[b+4>>2]|0){case 8:{e=+g[b+28>>2]*+g[b+12>>2];break}case 0:{e=+g[b+44>>2];break}case 1:{e=+g[b+44>>2];break}case 13:{e=+g[b+44>>2];break}case 11:{e=+g[b+44>>2];break}case 10:{e=+g[b+44>>2];break}case 4:case 5:{e=+g[b+44>>2];break}default:e=+va[c[(c[b>>2]|0)+48>>2]&15](b)}h=e*+g[i+16+4>>2]+ +g[i+4>>2];j=e*+g[i+16+8>>2]+ +g[i+8>>2];g[a>>2]=e*+g[i+16>>2]+ +g[i>>2];g[a+4>>2]=h;g[a+8>>2]=j;g[a+12>>2]=0.0;sa=i;return}function rh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0.0,k=0,l=0,m=0,n=0.0;l=sa;sa=sa+80|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;e=+g[d>>2];f=+g[d+4>>2];i=+g[d+8>>2];if(e*e+f*f+i*i<9.999999747378752e-05){k=1065353216;h=0;e=0.0;d=0}else{n=1.0/+x(+(e*e+f*f+i*i));k=(g[j>>2]=e*n,c[j>>2]|0);m=(g[j>>2]=f*n,c[j>>2]|0);h=(g[j>>2]=i*n,c[j>>2]|0);e=+g[d+12>>2];d=m}c[l+32>>2]=10732;m=l+32+4|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;g[l+32+20>>2]=-999999984306749440.0;c[l+32+24>>2]=k;c[l+32+28>>2]=d;c[l+32+32>>2]=h;g[l+32+36>>2]=e;c[l+16>>2]=1566444395;c[l+16+4>>2]=1566444395;c[l+16+8>>2]=1566444395;g[l+16+12>>2]=0.0;b=c[b+92>>2]|0;k=c[(c[b>>2]|0)+8>>2]|0;g[l>>2]=-999999984306749440.0;g[l+4>>2]=-999999984306749440.0;g[l+8>>2]=-999999984306749440.0;g[l+12>>2]=0.0;ab[k&127](b,l+32|0,l,l+16|0);c[a>>2]=c[m>>2];c[a+4>>2]=c[m+4>>2];c[a+8>>2]=c[m+8>>2];c[a+12>>2]=c[m+12>>2];sa=l;return}function sh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;g=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=g;if(g|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+28>>2]=c[a+28>>2];c[b+32>>2]=c[a+32>>2];c[b+36>>2]=c[a+36>>2];c[b+40>>2]=c[a+40>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+20>>2]=c[a+20>>2];c[b+24>>2]=c[a+24>>2];c[b+44>>2]=c[a+44>>2];f=c[a+96>>2]|0;c[b+60>>2]=f;if(!f){c[b+52>>2]=0;c[b+56>>2]=0;return 21626}c[b+52>>2]=Ha[c[(c[d>>2]|0)+28>>2]&31](d,c[a+104>>2]|0)|0;c[b+56>>2]=0;g=Ja[c[(c[d>>2]|0)+16>>2]&63](d,16,f)|0;if((f|0)>0){e=c[a+104>>2]|0;b=c[g+8>>2]|0;a=0;while(1){c[b>>2]=c[e+(a<<4)>>2];c[b+4>>2]=c[e+(a<<4)+4>>2];c[b+8>>2]=c[e+(a<<4)+8>>2];c[b+12>>2]=c[e+(a<<4)+12>>2];a=a+1|0;if((a|0)==(f|0))break;else b=b+16|0}}else e=c[a+104>>2]|0;eb[c[(c[d>>2]|0)+20>>2]&31](d,g,23625,1497453121,e);return 21626}function th(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0.0,j=0.0,k=0.0,l=0,m=0.0;k=+g[b+60>>2]*.5;l=c[b+68>>2]|0;f=+g[d>>2];i=+g[d+4>>2];j=+g[d+8>>2];j=+x(+(f*f+i*i+j*j));h=c[b+64>>2]|0;do if(!(+g[d+(l<<2)>>2]>+g[b+52>>2]*j)){f=+g[d+(h<<2)>>2];e=c[b+72>>2]|0;i=+g[d+(e<<2)>>2];j=+x(+(f*f+i*i));if(j>1.1920928955078125e-07){j=+g[b+56>>2]/j;g[a+(h<<2)>>2]=f*j;g[a+(l<<2)>>2]=-k;f=i*j;break}else{g[a+(h<<2)>>2]=0.0;g[a+(l<<2)>>2]=-k;f=0.0;break}}else{g[a+(h<<2)>>2]=0.0;g[a+(l<<2)>>2]=k;f=0.0;e=c[b+72>>2]|0}while(0);g[a+(e<<2)>>2]=f;if(!(+va[c[(c[b>>2]|0)+48>>2]&15](b)!=0.0))return;i=+g[d>>2];k=+g[d+4>>2];j=+g[d+8>>2];m=i*i+k*k+j*j<1.4210854715202004e-14?-1.0:i;f=i*i+k*k+j*j<1.4210854715202004e-14?-1.0:k;j=i*i+k*k+j*j<1.4210854715202004e-14?-1.0:j;k=1.0/+x(+(j*j+(m*m+f*f)));i=+va[c[(c[b>>2]|0)+48>>2]&15](b);g[a>>2]=+g[a>>2]+i*m*k;g[a+4>>2]=+g[a+4>>2]+i*f*k;g[a+8>>2]=+g[a+8>>2]+i*j*k;return}function uh(a,b,d){a=a|0;b=b|0;d=d|0;c[a+300>>2]=c[b>>2];c[a+300+4>>2]=c[b+4>>2];c[a+300+8>>2]=c[b+8>>2];c[a+300+12>>2]=c[b+12>>2];c[a+316>>2]=c[b+16>>2];c[a+316+4>>2]=c[b+16+4>>2];c[a+316+8>>2]=c[b+16+8>>2];c[a+316+12>>2]=c[b+16+12>>2];c[a+332>>2]=c[b+32>>2];c[a+332+4>>2]=c[b+32+4>>2];c[a+332+8>>2]=c[b+32+8>>2];c[a+332+12>>2]=c[b+32+12>>2];c[a+348>>2]=c[b+48>>2];c[a+348+4>>2]=c[b+48+4>>2];c[a+348+8>>2]=c[b+48+8>>2];c[a+348+12>>2]=c[b+48+12>>2];c[a+364>>2]=c[d>>2];c[a+364+4>>2]=c[d+4>>2];c[a+364+8>>2]=c[d+8>>2];c[a+364+12>>2]=c[d+12>>2];c[a+380>>2]=c[d+16>>2];c[a+380+4>>2]=c[d+16+4>>2];c[a+380+8>>2]=c[d+16+8>>2];c[a+380+12>>2]=c[d+16+12>>2];c[a+396>>2]=c[d+32>>2];c[a+396+4>>2]=c[d+32+4>>2];c[a+396+8>>2]=c[d+32+8>>2];c[a+396+12>>2]=c[d+32+12>>2];c[a+412>>2]=c[d+48>>2];c[a+412+4>>2]=c[d+48+4>>2];c[a+412+8>>2]=c[d+48+8>>2];c[a+412+12>>2]=c[d+48+12>>2];Pa[c[(c[a>>2]|0)+8>>2]&511](a);return}function vh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0;n=c[a+4>>2]|0;a=c[a+64>>2]|0;do if(!n)if(!a){e=0.0;m=0.0;j=0.0;l=0.0;i=0.0;k=0.0;h=0.0;f=0.0}else{e=+g[a>>2];m=+g[a+12>>2];j=+g[a+16>>2];l=+g[a+20>>2];i=+g[a+24>>2];k=+g[a+28>>2];h=+g[a+4>>2];f=+g[a+8>>2]}else{e=+g[n>>2];if(!a){m=+g[n+12>>2];j=+g[n+16>>2];l=+g[n+20>>2];i=+g[n+24>>2];k=+g[n+28>>2];h=+g[n+4>>2];f=+g[n+8>>2];break}k=+g[a>>2];e=e>2];j=+g[a+16>>2];j=k>j?k:j;k=+g[n+4>>2];h=+g[a+4>>2];h=k>2];l=+g[a+20>>2];l=k>l?k:l;k=+g[n+8>>2];f=+g[a+8>>2];f=k>2];i=+g[a+24>>2];if(k>i){m=0.0;i=k;k=0.0}else{m=0.0;k=0.0}}while(0);g[b>>2]=e;g[b+4>>2]=h;g[b+8>>2]=f;g[b+12>>2]=m;g[d>>2]=j;g[d+4>>2]=l;g[d+8>>2]=i;g[d+12>>2]=k;return}function wh(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;c=sa;sa=sa+48|0;Og(a+364|0,c+16|0);h=-+g[c+16>>2];e=-+g[c+16+4>>2];l=-+g[c+16+8>>2];k=+g[c+16+12>>2];f=+g[b>>2];m=+g[b+12>>2];j=+g[b+8>>2];i=+g[b+4>>2];Og(a+300|0,c);o=+g[c>>2];p=+g[c+12>>2];d=+g[c+8>>2];n=+g[c+4>>2];g[c+32>>2]=(k*m-f*h-i*e-j*l)*o+(k*f+m*h+j*e-i*l)*p+(f*l+(m*e+k*i)-j*h)*d-(m*l+k*j+i*h-f*e)*n;g[c+32+4>>2]=o*(m*l+k*j+i*h-f*e)+(p*(f*l+(m*e+k*i)-j*h)+(k*m-f*h-i*e-j*l)*n)-(k*f+m*h+j*e-i*l)*d;g[c+32+8>>2]=(m*l+k*j+i*h-f*e)*p+(k*m-f*h-i*e-j*l)*d+(k*f+m*h+j*e-i*l)*n-o*(f*l+(m*e+k*i)-j*h);g[c+32+12>>2]=(k*m-f*h-i*e-j*l)*p-(k*f+m*h+j*e-i*l)*o-(f*l+(m*e+k*i)-j*h)*n-(m*l+k*j+i*h-f*e)*d;ee(a,c+32|0);sa=c;return}function xh(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;do if(!(RC(b,c[d+8>>2]|0)|0)){if(!(RC(b,c[d>>2]|0)|0)){b=c[b+8>>2]|0;eb[c[(c[b>>2]|0)+24>>2]&31](b,d,e,f,g);break}if((c[d+16>>2]|0)!=(e|0)?(c[d+20>>2]|0)!=(e|0):0){c[d+32>>2]=f;if((c[d+44>>2]|0)==4)break;a[d+52>>0]=0;a[d+53>>0]=0;f=c[b+8>>2]|0;gb[c[(c[f>>2]|0)+20>>2]&7](f,d,e,e,1,g);if(a[d+53>>0]|0)if(!(a[d+52>>0]|0)){b=1;f=11}else f=15;else{b=0;f=11}do if((f|0)==11){c[d+20>>2]=e;c[d+40>>2]=(c[d+40>>2]|0)+1;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==2:0){a[d+54>>0]=1;if(b){f=15;break}else{b=4;break}}if(b)f=15;else b=4}while(0);if((f|0)==15)b=3;c[d+44>>2]=b;break}if((f|0)==1)c[d+32>>2]=1}else Er(d,e,f);while(0);return}function yh(b){b=b|0;var d=0;d=c[b>>2]|0;if(d|0)Gm(b,d);d=c[b+4>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+4>>2]=0;c[b+8>>2]=-1;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;c[b+16>>2]=0;d=c[b+52>>2]|0;if(!d){a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}if(!(a[b+56>>0]|0)){a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+32>>2]|0;a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;if(!d){a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}function zh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if(!e)e=c[b+188>>2]|0;j=c[d>>2]|0;f=c[b+268>>2]|0;a:do if((f|0)>0){h=c[b+276>>2]|0;g=0;while(1){if((c[h+(g<<2)>>2]|0)==(j|0))break;g=g+1|0;if((g|0)>=(f|0))break a}if((g|0)!=(f|0))return}while(0);if((f|0)==(c[b+272>>2]|0)?(i=(f|0)==0?1:f<<1,(f|0)<(i|0)):0){if(!i)h=0;else{c[7182]=(c[7182]|0)+1;f=xb((i<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=f;f=c[b+268>>2]|0}if((f|0)>0){g=0;do{c[h+(g<<2)>>2]=c[(c[b+276>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0))}g=c[b+276>>2]|0;if(g){if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);f=c[b+268>>2]|0}c[b+276>>2]=0}a[b+280>>0]=1;c[b+276>>2]=h;c[b+272>>2]=i}c[(c[b+276>>2]|0)+(f<<2)>>2]=j;c[b+268>>2]=f+1;b=c[b+284>>2]|0;Ja[c[(c[b>>2]|0)+8>>2]&63](b,e,d)|0;return}function Ah(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;i=sa;sa=sa+32|0;h=Bs()|0;c[h+4>>2]=11;c[h+8>>2]=-1;c[h+12>>2]=-1;g[h+16>>2]=3402823466385288598117041.0e14;a[h+20>>0]=1;a[h+21>>0]=0;c[h+24>>2]=-1;c[h+28>>2]=b;c[h+32>>2]=d;g[h+36>>2]=0.0;g[h+40>>2]=.30000001192092896;c[h+44>>2]=0;c[h>>2]=7136;c[h+48>>2]=c[e+48>>2];c[h+48+4>>2]=c[e+48+4>>2];c[h+48+8>>2]=c[e+48+8>>2];c[h+48+12>>2]=c[e+48+12>>2];c[h+64>>2]=c[f+48>>2];c[h+64+4>>2]=c[f+48+4>>2];c[h+64+8>>2]=c[f+48+8>>2];c[h+64+12>>2]=c[f+48+12>>2];Og(e,i+16|0);Og(f,i);n=-+g[i>>2];l=-+g[i+4>>2];j=-+g[i+8>>2];q=+g[i+12>>2];p=+g[i+16+12>>2];o=+g[i+16>>2];m=+g[i+16+4>>2];k=+g[i+16+8>>2];g[h+80>>2]=p*n+q*o+m*j-k*l;g[h+84>>2]=k*n+(p*l+q*m)-o*j;g[h+88>>2]=o*l+(p*j+q*k)-m*n;g[h+92>>2]=q*p-o*n-m*l-k*j;sa=i;return h|0}function Bh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192){ja(b|0,d|0,e|0)|0;return b|0}h=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return h|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}e=g&-4|0;f=e-64|0;while((b|0)<=(f|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0}while((b|0)<(e|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0}}else{e=g-4|0;while((b|0)<(e|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}return h|0}function Ch(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;if(Fa[c[(c[d>>2]|0)+16>>2]&127](d)|0)return;i=c[b+712>>2]|0;h=Fa[c[(c[d>>2]|0)+36>>2]&127](d)|0;if(Fa[c[(c[d>>2]|0)+8>>2]&127](d)|0?(e=Fa[c[(c[d>>2]|0)+20>>2]&127](d)|0,g=Fa[c[(c[d>>2]|0)+24>>2]&127](d)|0,(i|0)>0):0){f=c[b+720>>2]|0;a=h+(e<<2)|0;e=0;while(1){k=c[f+(e*104|0)+12>>2]|0;j=c[f+(e*104|0)+16>>2]|0;c[a>>2]=c[f+(e*104|0)+8>>2];c[a+4>>2]=k;c[a+8>>2]=j;e=e+1|0;if((e|0)==(i|0))break;else a=a+(g<<2)|0}}if(!(Fa[c[(c[d>>2]|0)+12>>2]&127](d)|0))return;a=Fa[c[(c[d>>2]|0)+28>>2]&127](d)|0;g=Fa[c[(c[d>>2]|0)+32>>2]&127](d)|0;if((i|0)<=0)return;f=c[b+720>>2]|0;a=h+(a<<2)|0;e=0;while(1){j=c[f+(e*104|0)+76>>2]|0;k=c[f+(e*104|0)+80>>2]|0;c[a>>2]=c[f+(e*104|0)+72>>2];c[a+4>>2]=j;c[a+8>>2]=k;e=e+1|0;if((e|0)==(i|0))break;else a=a+(g<<2)|0}return}function Dh(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;c[b>>2]=12260;d=c[b+56>>2]|0;if(d|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;f=c[b+28>>2]|0;if((f|0)>0){d=0;do{g=c[b+36>>2]|0;h=g+(d*36|0)+4|0;i=g+(d*36|0)+12|0;j=c[i>>2]|0;e=g+(d*36|0)+16|0;if(j|0){if(a[e>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[i>>2]=0}a[e>>0]=1;c[i>>2]=0;c[h>>2]=0;c[g+(d*36|0)+8>>2]=0;d=d+1|0}while((d|0)!=(f|0))}d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function Eh(b){b=b|0;var d=0;c[b>>2]=11360;d=c[b+156>>2]|0;if(d|0){if(a[b+160>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+156>>2]=0}a[b+160>>0]=1;c[b+156>>2]=0;c[b+148>>2]=0;c[b+152>>2]=0;d=c[b+136>>2]|0;if(d|0){if(a[b+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+136>>2]=0}a[b+140>>0]=1;c[b+136>>2]=0;c[b+128>>2]=0;c[b+132>>2]=0;d=c[b+116>>2]|0;if(d|0){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+116>>2]=0}a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;d=c[b+96>>2]|0;if(d|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;c[b>>2]=12276;d=c[b+32>>2]|0;if(!d){a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;b=b+28|0;c[b>>2]=0;return}if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;b=b+28|0;c[b>>2]=0;return}function Fh(b){b=b|0;var d=0;c[b>>2]=11920;d=c[b+160>>2]|0;if(d|0){if(a[b+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+160>>2]=0}a[b+164>>0]=1;c[b+160>>2]=0;c[b+152>>2]=0;c[b+156>>2]=0;d=c[b+136>>2]|0;if(d|0){if(a[b+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+136>>2]=0}a[b+140>>0]=1;c[b+136>>2]=0;c[b+128>>2]=0;c[b+132>>2]=0;d=c[b+116>>2]|0;if(d|0){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+116>>2]=0}a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;d=c[b+96>>2]|0;if(d|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;d=c[b+76>>2]|0;if(!d){a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;b=b+72|0;c[b>>2]=0;return}if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+76>>2]=0;a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;b=b+72|0;c[b>>2]=0;return}function Gh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0,o=0;o=sa;sa=sa+16|0;if((e|0)<=0){sa=o;return}n=0;do{h=+g[a+60>>2]*.5;i=c[a+68>>2]|0;k=+g[b+(n<<4)>>2];l=+g[b+(n<<4)+4>>2];m=+g[b+(n<<4)+8>>2];m=+x(+(k*k+l*l+m*m));j=c[a+64>>2]|0;do if(!(+g[b+(n<<4)+(i<<2)>>2]>+g[a+52>>2]*m)){k=+g[b+(n<<4)+(j<<2)>>2];f=c[a+72>>2]|0;l=+g[b+(n<<4)+(f<<2)>>2];m=+x(+(k*k+l*l));if(m>1.1920928955078125e-07){m=+g[a+56>>2]/m;g[o+(j<<2)>>2]=k*m;g[o+(i<<2)>>2]=-h;h=l*m;break}else{g[o+(j<<2)>>2]=0.0;g[o+(i<<2)>>2]=-h;h=0.0;break}}else{g[o+(j<<2)>>2]=0.0;g[o+(i<<2)>>2]=h;h=0.0;f=c[a+72>>2]|0}while(0);g[o+(f<<2)>>2]=h;j=d+(n<<4)|0;c[j>>2]=c[o>>2];c[j+4>>2]=c[o+4>>2];c[j+8>>2]=c[o+8>>2];c[j+12>>2]=c[o+12>>2];n=n+1|0}while((n|0)!=(e|0));sa=o;return}function Hh(b){b=b|0;var d=0;c[b>>2]=7628;d=c[b+144>>2]|0;if(d|0){if(a[b+148>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+144>>2]=0}a[b+148>>0]=1;c[b+144>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;d=c[b+76>>2]|0;if(d|0){if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+76>>2]=0}a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;c[b+72>>2]=0;d=c[b+56>>2]|0;if(d|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function Ih(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0;o=(+g[a+32>>2]-+g[a+16>>2])*+g[a+108>>2]*.5;m=(+g[a+36>>2]-+g[a+20>>2])*+g[a+112>>2]*.5;k=(+g[a+40>>2]-+g[a+24>>2])*+g[a+116>>2]*.5;t=+w(+(+g[b>>2]));s=+w(+(+g[b+4>>2]));r=+w(+(+g[b+8>>2]));n=+w(+(+g[b+16>>2]));l=+w(+(+g[b+20>>2]));j=+w(+(+g[b+24>>2]));x=+w(+(+g[b+32>>2]));v=+w(+(+g[b+36>>2]));f=+w(+(+g[b+40>>2]));u=+g[b+48>>2];p=+g[b+52>>2];h=+g[b+56>>2];q=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=+va[c[(c[a>>2]|0)+48>>2]&15](a);f=o*x+m*v+k*f+ +va[c[(c[a>>2]|0)+48>>2]&15](a);g[d>>2]=u-(o*t+m*s+k*r+q);g[d+4>>2]=p-(o*n+m*l+k*j+i);g[d+8>>2]=h-f;g[d+12>>2]=0.0;g[e>>2]=u+(o*t+m*s+k*r+q);g[e+4>>2]=p+(o*n+m*l+k*j+i);g[e+8>>2]=h+f;g[e+12>>2]=0.0;return}function Jh(b){b=b|0;var d=0;if((a[26664]|0)==0?mz(26664)|0:0){if((a[26616]|0)==0?mz(26616)|0:0){if((a[26624]|0)==0?mz(26624)|0:0){c[6774]=1065353216;c[6775]=0;c[6776]=0;c[6777]=0;c[6778]=0;c[6779]=1065353216;c[6780]=0;c[6781]=0;c[6782]=0;c[6783]=0;c[6784]=1065353216;g[6785]=0.0}c[6758]=c[6774];c[6759]=c[6775];c[6760]=c[6776];c[6761]=c[6777];c[6762]=c[6778];c[6763]=c[6779];c[6764]=c[6780];c[6765]=c[6781];c[6766]=c[6782];c[6767]=c[6783];c[6768]=c[6784];c[6769]=c[6785];c[6770]=0;c[6771]=0;c[6772]=0;c[6773]=0}c[6810]=c[6758];c[6811]=c[6759];c[6812]=c[6760];c[6813]=c[6761];c[6814]=c[6762];c[6815]=c[6763];c[6816]=c[6764];c[6817]=c[6765];c[6818]=c[6766];c[6819]=c[6767];c[6820]=c[6768];c[6821]=c[6769];c[6822]=c[6770];c[6823]=c[6771];c[6824]=c[6772];c[6825]=c[6773]}d=c[b+8>>2]|0;if(!d){d=c[b>>2]|0;return ((d|0)==0?27240:d+60|0)|0}else return d+4|0;return 0}function Kh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;e=c[b>>2]|0;if((e|0)==(c[a+80>>2]|0)){f=1.0;return +f}if(c[e+204>>2]&4|0){f=1.0;return +f}if((+g[a+28>>2]-+g[a+12>>2])*+g[b+8>>2]+(+g[a+32>>2]-+g[a+16>>2])*+g[b+12>>2]+(+g[a+36>>2]-+g[a+20>>2])*+g[b+16>>2]>=-+g[a+84>>2]){f=1.0;return +f}c[a+4>>2]=c[b+40>>2];c[a+76>>2]=e;if(d){c[a+44>>2]=c[b+8>>2];c[a+44+4>>2]=c[b+8+4>>2];c[a+44+8>>2]=c[b+8+8>>2];c[a+44+12>>2]=c[b+8+12>>2]}else{k=+g[b+8>>2];j=+g[b+12>>2];i=+g[b+16>>2];h=k*+g[e+20>>2]+j*+g[e+24>>2]+i*+g[e+28>>2];f=k*+g[e+36>>2]+j*+g[e+40>>2]+i*+g[e+44>>2];g[a+44>>2]=+g[e+4>>2]*k+ +g[e+8>>2]*j+ +g[e+12>>2]*i;g[a+48>>2]=h;g[a+52>>2]=f;g[a+56>>2]=0.0}c[a+60>>2]=c[b+24>>2];c[a+60+4>>2]=c[b+24+4>>2];c[a+60+8>>2]=c[b+24+8>>2];c[a+60+12>>2]=c[b+24+12>>2];k=+g[b+40>>2];return +k}function Lh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0;i=sa;sa=sa+48|0;e=c[a+28>>2]|0;c[i>>2]=e;e=(c[a+20>>2]|0)-e|0;c[i+4>>2]=e;c[i+8>>2]=b;c[i+12>>2]=d;c[i+16>>2]=c[a+60>>2];c[i+16+4>>2]=i;c[i+16+8>>2]=2;f=pC($(146,i+16|0)|0)|0;a:do if((e+d|0)!=(f|0)){b=2;g=e+d|0;e=i;while(1){if((f|0)<0)break;g=g-f|0;j=c[e+4>>2]|0;k=f>>>0>j>>>0;e=k?e+8|0:e;b=b+(k<<31>>31)|0;j=f-(k?j:0)|0;c[e>>2]=(c[e>>2]|0)+j;c[e+4>>2]=(c[e+4>>2]|0)-j;c[i+32>>2]=c[a+60>>2];c[i+32+4>>2]=e;c[i+32+8>>2]=b;f=pC($(146,i+32|0)|0)|0;if((g|0)==(f|0)){h=3;break a}}c[a+16>>2]=0;c[a+28>>2]=0;c[a+20>>2]=0;c[a>>2]=c[a>>2]|32;if((b|0)==2)d=0;else d=d-(c[e+4>>2]|0)|0}else h=3;while(0);if((h|0)==3){k=c[a+44>>2]|0;c[a+16>>2]=k+(c[a+48>>2]|0);c[a+28>>2]=k;c[a+20>>2]=k}sa=i;return d|0}function Mh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=c[b+96>>2]|0;if((f|0)==(c[b+100>>2]|0)?(i=(f|0)==0?1:f<<1,(f|0)<(i|0)):0){if(!i)h=0;else{c[7182]=(c[7182]|0)+1;f=xb((i<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=f;f=c[b+96>>2]|0}if((f|0)>0){g=0;do{j=h+(g<<4)|0;k=(c[b+104>>2]|0)+(g<<4)|0;c[j>>2]=c[k>>2];c[j+4>>2]=c[k+4>>2];c[j+8>>2]=c[k+8>>2];c[j+12>>2]=c[k+12>>2];g=g+1|0}while((g|0)!=(f|0))}f=c[b+104>>2]|0;if(f|0){if(a[b+108>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+104>>2]=0}a[b+108>>0]=1;c[b+104>>2]=h;c[b+100>>2]=i;f=c[b+96>>2]|0}k=(c[b+104>>2]|0)+(f<<4)|0;c[k>>2]=c[d>>2];c[k+4>>2]=c[d+4>>2];c[k+8>>2]=c[d+8>>2];c[k+12>>2]=c[d+12>>2];c[b+96>>2]=(c[b+96>>2]|0)+1;if(!e)return;Oi(b);return}function Nh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0;i=sa;sa=sa+80|0;if((e|0)<=0){sa=i;return}f=0;do{g[d+(f<<4)+12>>2]=-999999984306749440.0;f=f+1|0}while((f|0)!=(e|0));h=i+32+4|0;f=0;do{j=b+(f<<4)|0;c[i+32>>2]=10732;c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;g[i+32+20>>2]=-999999984306749440.0;c[i+32+24>>2]=c[j>>2];c[i+32+24+4>>2]=c[j+4>>2];c[i+32+24+8>>2]=c[j+8>>2];c[i+32+24+12>>2]=c[j+12>>2];c[i+16>>2]=1566444395;c[i+16+4>>2]=1566444395;c[i+16+8>>2]=1566444395;g[i+16+12>>2]=0.0;j=c[a+92>>2]|0;k=c[(c[j>>2]|0)+8>>2]|0;g[i>>2]=-999999984306749440.0;g[i+4>>2]=-999999984306749440.0;g[i+8>>2]=-999999984306749440.0;g[i+12>>2]=0.0;ab[k&127](j,i+32|0,i,i+16|0);j=d+(f<<4)|0;c[j>>2]=c[h>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];f=f+1|0}while((f|0)<(e|0));sa=i;return}function Oh(b){b=b|0;var d=0,e=0,f=0,h=0;c[b+32>>2]=262144;d=c[b+4>>2]|0;if((d|0)<2383){if((c[b+8>>2]|0)<2383){c[7182]=(c[7182]|0)+1;e=xb(9551)|0;if(!e)h=0;else{c[(e+4+15&-16)+-4>>2]=e;h=e+4+15&-16}f=c[b+4>>2]|0;if((f|0)>0){e=0;do{c[h+(e<<2)>>2]=c[(c[b+12>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(f|0))}e=c[b+12>>2]|0;if(e|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=h;c[b+8>>2]=2383;e=b+12|0}else e=b+12|0;do{c[(c[e>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=2383)}c[b+4>>2]=2383;e=0;do{h=(c[b+12>>2]|0)+(e<<2)|0;d=c[h>>2]|0;c[h>>2]=0;if(d|0)do{h=d;d=c[d+280>>2]|0;GI(h)}while((d|0)!=0);e=e+1|0}while((e|0)!=2383);g[b+20>>2]=.25;c[b+24>>2]=0;c[b+28>>2]=0;c[b+36>>2]=1;c[b+40>>2]=1;return}function Ph(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=sa;sa=sa+96|0;b=c[b>>2]|0;if((b|0)==(c[a+4>>2]|0)){sa=d;return 1}e=c[a+12>>2]|0;if(!(Ha[c[(c[e>>2]|0)+8>>2]&31](e,c[b+188>>2]|0)|0)){sa=d;return 1}e=c[a+4>>2]|0;f=c[e+192>>2]|0;c[d+64>>2]=0;c[d+64+4>>2]=f;c[d+64+8>>2]=e;c[d+64+12>>2]=e+4;c[d+64+16>>2]=-1;c[d+64+20>>2]=-1;e=c[b+192>>2]|0;c[d+40>>2]=0;c[d+40+4>>2]=e;c[d+40+8>>2]=b;c[d+40+12>>2]=b+4;c[d+40+16>>2]=-1;c[d+40+20>>2]=-1;b=c[(c[a+8>>2]|0)+24>>2]|0;b=Ka[c[(c[b>>2]|0)+8>>2]&31](b,d+64|0,d+40|0,0)|0;if(b|0){f=c[a+12>>2]|0;c[d+4>>2]=0;c[d+8>>2]=d+64;c[d+12>>2]=d+40;c[d>>2]=8784;c[d+32>>2]=f;eb[c[(c[b>>2]|0)+8>>2]&31](b,d+64|0,d+40|0,(c[a+8>>2]|0)+28|0,d);Pa[c[c[b>>2]>>2]&511](b);f=c[(c[a+8>>2]|0)+24>>2]|0;Va[c[(c[f>>2]|0)+60>>2]&127](f,b)}sa=d;return 1}function Qh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,h=0,i=0,j=0,k=0;k=sa;sa=sa+80|0;i=c[c[a>>2]>>2]|0;h=c[c[a+4>>2]>>2]|0;if(!(Ja[c[(c[b>>2]|0)+24>>2]&63](b,i,h)|0)){sa=k;return}f=c[i+192>>2]|0;c[k+56>>2]=0;c[k+56+4>>2]=f;c[k+56+8>>2]=i;c[k+56+12>>2]=i+4;c[k+56+16>>2]=-1;c[k+56+20>>2]=-1;f=c[h+192>>2]|0;c[k+32>>2]=0;c[k+32+4>>2]=f;c[k+32+8>>2]=h;c[k+32+12>>2]=h+4;c[k+32+16>>2]=-1;c[k+32+20>>2]=-1;f=c[a+8>>2]|0;if(!f){f=Ka[c[(c[b>>2]|0)+8>>2]&31](b,k+56|0,k+32|0,0)|0;c[a+8>>2]=f;if(f|0)j=4}else j=4;if((j|0)==4){c[k>>2]=8412;c[k+4>>2]=0;c[k+8>>2]=k+56;c[k+12>>2]=k+32;if((c[d+8>>2]|0)!=1){e=+Ba[c[(c[f>>2]|0)+12>>2]&15](f,i,h,d,k);if(+g[d+12>>2]>e)g[d+12>>2]=e}else eb[c[(c[f>>2]|0)+8>>2]&31](f,k+56|0,k+32|0,d,k)}sa=k;return}function Rh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[b+488>>2]|0;a:do if((e|0)>0){g=c[b+496>>2]|0;f=0;while(1){if((c[g+(f<<2)>>2]|0)==(d|0))break;f=f+1|0;if((f|0)>=(e|0))break a}if((f|0)!=(e|0)){d=b+256|0;c[d>>2]=1;return}}while(0);if((e|0)==(c[b+492>>2]|0)?(h=(e|0)==0?1:e<<1,(e|0)<(h|0)):0){if(!h)g=0;else{c[7182]=(c[7182]|0)+1;e=xb((h<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}g=e;e=c[b+488>>2]|0}if((e|0)>0){f=0;do{c[g+(f<<2)>>2]=c[(c[b+496>>2]|0)+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0))}f=c[b+496>>2]|0;if(f){if(a[b+500>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);e=c[b+488>>2]|0}c[b+496>>2]=0}a[b+500>>0]=1;c[b+496>>2]=g;c[b+492>>2]=h}c[(c[b+496>>2]|0)+(e<<2)>>2]=d;c[b+488>>2]=e+1;d=b+256|0;c[d>>2]=1;return}function Sh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=c[d+4>>2]|0;f=c[b+24>>2]|0;if((f|0)<(i|0)){if((c[b+28>>2]|0)<(i|0)){if(!i){e=0;h=f}else{c[7182]=(c[7182]|0)+1;e=xb((i<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+24>>2]|0}if((h|0)>0){g=0;do{c[e+(g<<2)>>2]=c[(c[b+32>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(h|0))}g=c[b+32>>2]|0;if(g|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=e;c[b+28>>2]=i;e=b+32|0}else e=b+32|0;do{c[(c[e>>2]|0)+(f<<2)>>2]=0;f=f+1|0}while((f|0)!=(i|0))}else e=b+32|0;c[b+24>>2]=i;f=c[e>>2]|0;if((i|0)<=0)return;e=0;do{c[f+(e<<2)>>2]=c[(c[d+12>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(i|0));return}function Th(b){b=b|0;var d=0,e=0,f=0,g=0;c[b>>2]=11632;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+24>>2]=0;a[b+28>>0]=0;a[b+48>>0]=1;c[b+44>>2]=0;c[b+36>>2]=0;c[b+40>>2]=0;a[b+68>>0]=1;c[b+64>>2]=0;c[b+56>>2]=0;c[b+60>>2]=0;c[b+72>>2]=0;c[7182]=(c[7182]|0)+1;d=xb(51)|0;if(!d)f=0;else{c[(d+4+15&-16)+-4>>2]=d;f=d+4+15&-16}e=c[b+8>>2]|0;if((e|0)>0){d=0;do{g=c[b+16>>2]|0;c[f+(d<<4)>>2]=c[g+(d<<4)>>2];c[f+(d<<4)+4>>2]=c[g+(d<<4)+4>>2];c[f+(d<<4)+8>>2]=c[g+(d<<4)+8>>2];c[f+(d<<4)+12>>2]=c[g+(d<<4)+12>>2];d=d+1|0}while((d|0)!=(e|0))}d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=f;c[b+12>>2]=2;Re(b);return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=f;c[b+12>>2]=2;Re(b);return}function Uh(a,b,d){a=a|0;b=b|0;d=d|0;do if(!((b|0)==32&(d|0)==32)){if((b|0)==32){if((d|0)<20){a=a+96|0;break}if((d+-21|0)>>>0<9){a=a+104|0;break}}else{if((b|0)<20&(d|0)==32){a=a+100|0;break}if((b+-21|0)>>>0<9&(d|0)==32){a=a+108|0;break}if((b|0)==8&(d|0)==8){a=a+60|0;break}if((b|0)==8&(d|0)==1){a=a+76|0;break}if((b|0)==1&(d|0)==8){a=a+80|0;break}}if(!(d|b)){a=a+72|0;break}if((b|0)<20&(d|0)==28){a=a+88|0;break}if((b|0)==28&(d|0)<20){a=a+84|0;break}if((b|0)<20){if((d|0)<20){a=a+32|0;break}if((d+-21|0)>>>0<9){a=a+36|0;break}}else{if((d|0)<20&(b+-21|0)>>>0<9){a=a+40|0;break}if((b|0)==31)if((d|0)==31){a=a+48|0;break}else{a=a+44|0;break}}if((d|0)==31){a=a+52|0;break}else{a=a+56|0;break}}else a=a+92|0;while(0);return c[a>>2]|0}function Vh(a,b,c,d,e,f,h,i,j,k,l){a=a|0;b=b|0;c=+c;d=+d;e=+e;f=+f;h=+h;i=+i;j=j|0;k=k|0;l=+l;var m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0;x=+g[a>>2]*f+ +g[a+16>>2]*h+ +g[a+32>>2]*i;v=+g[a+4>>2]*f+ +g[a+20>>2]*h+ +g[a+36>>2]*i;t=+g[a+8>>2]*f+ +g[a+24>>2]*h+ +g[a+40>>2]*i;s=+g[b>>2]*f+ +g[b+16>>2]*h+ +g[b+32>>2]*i;q=+g[b+4>>2]*f+ +g[b+20>>2]*h+ +g[b+36>>2]*i;o=+g[b+8>>2]*f+ +g[b+24>>2]*h+ +g[b+40>>2]*i;w=+g[j+80>>2];u=+g[j+84>>2];p=+g[j+88>>2];r=+g[k+80>>2];m=+g[k+84>>2];n=+g[k+88>>2];p=x*(x<0.0?-w:w)+v*(v<0.0?-u:u)+t*(t<0.0?-p:p);n=s*(s<0.0?-r:r)+q*(q<0.0?-m:m)+o*(o<0.0?-n:n);o=+g[j+96>>2];m=+g[k+96>>2];m=(p>o?p:o)+(n>m?n:m);return !((c*f+d*h+e*i+ml)|0}function Wh(b){b=b|0;var d=0;d=fs(616)|0;c[d+164>>2]=1065353216;c[d+168>>2]=1065353216;c[d+172>>2]=1065353216;g[d+176>>2]=0.0;c[d+180>>2]=0;g[d+184>>2]=999999984306749440.0;c[d+188>>2]=0;c[d+188+4>>2]=0;c[d+188+8>>2]=0;c[d+188+12>>2]=0;c[d+204>>2]=1;c[d+208>>2]=-1;c[d+212>>2]=-1;c[d+216>>2]=1;g[d+220>>2]=0.0;g[d+224>>2]=.5;g[d+228>>2]=0.0;g[d+232>>2]=0.0;c[d+236>>2]=1;c[d+240>>2]=0;g[d+244>>2]=1.0;c[d+248>>2]=0;c[d+248+4>>2]=0;c[d+248+8>>2]=0;c[d+248+12>>2]=0;c[d+4>>2]=1065353216;c[d+8>>2]=0;c[d+8+4>>2]=0;c[d+8+8>>2]=0;c[d+8+12>>2]=0;c[d+24>>2]=1065353216;c[d+28>>2]=0;c[d+28+4>>2]=0;c[d+28+8>>2]=0;c[d+28+12>>2]=0;c[d+44>>2]=1065353216;c[d+48>>2]=0;c[d+48+4>>2]=0;c[d+48+8>>2]=0;c[d+48+12>>2]=0;c[d+48+16>>2]=0;c[d>>2]=6868;a[d+500>>0]=1;c[d+496>>2]=0;c[d+488>>2]=0;c[d+492>>2]=0;Qc(d,b);return d|0}function Xh(a,b,d,e,f,h,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0;n=sa;sa=sa+16|0;Ki(17143);jb[c[(c[a>>2]|0)+32>>2]&1](a,b,d,e,f,h,i,j,k);m=c[a+184>>2]|0;l=c[j+20>>2]|0;l=(m|0)>(l|0)?m:l;if((l|0)>0){m=0;do{+Ea[c[(c[a>>2]|0)+40>>2]&3](a,m,b,d,e,f,h,i,j,k);m=m+1|0}while((m|0)<(l|0))}l=c[3084]|0;k=(c[l+16>>2]|0)+-1|0;c[l+16>>2]=k;if(k|0){sa=n;return 0.0}do if(c[l+4>>2]|0){la(n|0,0)|0;k=c[7181]|0;g[l+8>>2]=+g[l+8>>2]+ +(((c[n+4>>2]|0)-(c[k+4>>2]|0)+(((c[n>>2]|0)-(c[k>>2]|0)|0)*1e6|0)-(c[l+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[l+16>>2]|0)){l=c[3084]|0;break}else{sa=n;return 0.0}}while(0);c[3084]=c[l+20>>2];sa=n;return 0.0}function Yh(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0,r=0,s=0.0,t=0;if((e|0)<=0)return;f=0;do{g[d+(f<<4)+12>>2]=-999999984306749440.0;f=f+1|0}while((f|0)!=(e|0));r=0;do{j=+g[a+12>>2];k=+g[b+(r<<4)>>2]*j;l=+g[a+16>>2];m=+g[b+(r<<4)+4>>2]*l;n=+g[a+20>>2];o=+g[b+(r<<4)+8>>2]*n;p=c[a+96>>2]|0;if((p|0)>0){q=c[a+104>>2]|0;f=-1;i=0;h=-3402823466385288598117041.0e14;do{s=k*+g[q+(i<<4)>>2]+m*+g[q+(i<<4)+4>>2]+o*+g[q+(i<<4)+8>>2];t=s>h;f=t?i:f;h=t?s:h;i=i+1|0}while((i|0)!=(p|0));o=+g[q+(f<<4)+4>>2]*l;s=+g[q+(f<<4)+8>>2]*n;g[d+(r<<4)>>2]=+g[q+(f<<4)>>2]*j;g[d+(r<<4)+4>>2]=o;g[d+(r<<4)+8>>2]=s}else h=-999999984306749440.0;g[d+(r<<4)+12>>2]=h;r=r+1|0}while((r|0)!=(e|0));return}function Zh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=c[d>>2]|0;d=c[b+268>>2]|0;a:do if((d|0)>0){f=c[b+276>>2]|0;e=0;while(1){if((c[f+(e<<2)>>2]|0)==(g|0))break;e=e+1|0;if((e|0)>=(d|0))break a}if((e|0)!=(d|0))return}while(0);if((d|0)==(c[b+272>>2]|0)?(h=(d|0)==0?1:d<<1,(d|0)<(h|0)):0){if(!h)f=0;else{c[7182]=(c[7182]|0)+1;d=xb((h<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=d;d=c[b+268>>2]|0}if((d|0)>0){e=0;do{c[f+(e<<2)>>2]=c[(c[b+276>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(d|0))}e=c[b+276>>2]|0;if(e){if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+268>>2]|0}c[b+276>>2]=0}a[b+280>>0]=1;c[b+276>>2]=f;c[b+272>>2]=h}c[(c[b+276>>2]|0)+(d<<2)>>2]=g;c[b+268>>2]=d+1;return}function _h(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+232>>2]|0;a:do if((f|0)>0){g=c[a+240>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0))break a}if((d|0)<(f|0)){c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+240>>2]|0)+(f+-1<<2)>>2]=b;c[a+232>>2]=f+-1}}while(0);d=c[b+188>>2]|0;if(d|0){g=c[a+68>>2]|0;g=Fa[c[(c[g>>2]|0)+36>>2]&127](g)|0;Za[c[(c[g>>2]|0)+40>>2]&127](g,d,c[a+24>>2]|0);g=c[a+68>>2]|0;Za[c[(c[g>>2]|0)+12>>2]&127](g,d,c[a+24>>2]|0);c[b+188>>2]=0}f=c[a+8>>2]|0;if((f|0)<=0)return;g=c[a+16>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0)){h=15;break}}if((h|0)==15)return;if((d|0)>=(f|0))return;c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+16>>2]|0)+(f+-1<<2)>>2]=b;c[a+8>>2]=f+-1;return}function $h(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+328>>2]|0;a:do if((f|0)>0){g=c[a+336>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0))break a}if((d|0)<(f|0)){c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+336>>2]|0)+(f+-1<<2)>>2]=b;c[a+328>>2]=f+-1}}while(0);d=c[b+188>>2]|0;if(d|0){g=c[a+68>>2]|0;g=Fa[c[(c[g>>2]|0)+36>>2]&127](g)|0;Za[c[(c[g>>2]|0)+40>>2]&127](g,d,c[a+24>>2]|0);g=c[a+68>>2]|0;Za[c[(c[g>>2]|0)+12>>2]&127](g,d,c[a+24>>2]|0);c[b+188>>2]=0}f=c[a+8>>2]|0;if((f|0)<=0)return;g=c[a+16>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0)){h=15;break}}if((h|0)==15)return;if((d|0)>=(f|0))return;c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+16>>2]|0)+(f+-1<<2)>>2]=b;c[a+8>>2]=f+-1;return}function ai(a){a=a|0;var b=0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0;b=Xs()|0;c[b+8>>2]=0;c[b+12>>2]=1065353216;c[b+16>>2]=1065353216;c[b+20>>2]=1065353216;g[b+24>>2]=0.0;g[b+44>>2]=.03999999910593033;c[b+52>>2]=0;c[b>>2]=10752;c[b+4>>2]=0;f=+g[a>>2];e=+g[a+4>>2];d=+g[a+8>>2];d=+g[a+((f>2]*.10000000149011612;if(d<.03999999910593033){i=+cG(b);h=+cG(b);f=+cG(b);i=i+ +g[b+28>>2];h=h+ +g[b+32>>2];f=f+ +g[b+36>>2];g[b+44>>2]=d;d=+cG(b);e=+cG(b);f=f-+cG(b);g[b+28>>2]=i-d;g[b+32>>2]=h-e;g[b+36>>2]=f;g[b+40>>2]=0.0}f=+cG(b);h=+cG(b);i=+cG(b);h=+g[a+4>>2]-h;i=+g[a+8>>2]-i;g[b+28>>2]=+g[a>>2]-f;g[b+32>>2]=h;g[b+36>>2]=i;g[b+40>>2]=0.0;return b|0}function bi(b){b=b|0;var d=0,e=0;d=c[b+92>>2]|0;if(d|0){if(a[b+96>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+92>>2]=0}a[b+96>>0]=1;c[b+92>>2]=0;c[b+84>>2]=0;c[b+88>>2]=0;d=c[b+64>>2]|0;if(d|0)do{c[b+64>>2]=c[d+8>>2];e=c[d>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+64>>2]|0}while((d|0)!=0);d=c[b+48>>2]|0;if(d|0)do{c[b+48>>2]=c[d+8>>2];e=c[d>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+48>>2]|0}while((d|0)!=0);d=c[b+32>>2]|0;if(!d)return;do{c[b+32>>2]=c[d+8>>2];e=c[d>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+32>>2]|0}while((d|0)!=0);return}function ci(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0;c[a+4>>2]=35;c[a+8>>2]=0;c[a+12>>2]=1065353216;c[a+16>>2]=1065353216;c[a+20>>2]=1065353216;g[a+24>>2]=0.0;g[a+44>>2]=.03999999910593033;c[a>>2]=11048;c[a+52>>2]=1;f=+g[b>>2];e=+g[b+4>>2];d=+g[b+8>>2];d=+g[b+((f>2]*.10000000149011612;if(d<.03999999910593033){i=+cG(a);h=+cG(a);f=+cG(a);i=i+ +g[a+28>>2];h=h+ +g[a+32>>2];f=f+ +g[a+36>>2];g[a+44>>2]=d;d=+cG(a);e=+cG(a);f=f-+cG(a);g[a+28>>2]=i-d;g[a+32>>2]=h-e;g[a+36>>2]=f;g[a+40>>2]=0.0}f=+cG(a);h=+cG(a);i=+cG(a);h=+g[b+4>>2]-h;i=+g[b+8>>2]-i;g[a+28>>2]=+g[b>>2]-f;g[a+32>>2]=h;g[a+36>>2]=i;g[a+40>>2]=0.0;c[a+4>>2]=13;return}function di(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=(c[b>>2]|0)+1794895138|0;h=OA(c[b+8>>2]|0,n)|0;f=OA(c[b+12>>2]|0,n)|0;g=OA(c[b+16>>2]|0,n)|0;a:do if((h>>>0<(2?d>>>2:d)>>>0?f>>>0<(d-(h<<2)|0)>>>0&g>>>0<(d-(h<<2)|0)>>>0:0)?((g|f)&3|0)==0:0){l=2?f>>>2:f;m=2?g>>>2:g;j=0;while(1){i=1?h>>>1:h;k=j+i|0;f=OA(c[b+((k<<1)+l<<2)>>2]|0,n)|0;g=OA(c[b+((k<<1)+l+1<<2)>>2]|0,n)|0;if(!(g>>>0>>0&f>>>0<(d-g|0)>>>0)){f=0;break a}if(a[b+(g+f)>>0]|0){f=0;break a}f=Vn(e,b+g|0)|0;if(!f)break;if((h|0)==1){f=0;break a}j=(f|0)<0?j:k;h=(f|0)<0?i:h-i|0}g=OA(c[b+((k<<1)+m<<2)>>2]|0,n)|0;f=OA(c[b+((k<<1)+m+1<<2)>>2]|0,n)|0;if(f>>>0>>0&g>>>0<(d-f|0)>>>0)f=(a[b+(f+g)>>0]|0)==0?b+f|0:0;else f=0}else f=0;while(0);return f|0}function ei(a,b,d){a=a|0;b=+b;d=+d;var e=0.0,f=0.0,h=0.0;f=+g[a+692>>2];do if(f>0.0){h=+g[a+688>>2];if(!((b-h)%6.2831854820251465<-3.1415927410125732))if((b-h)%6.2831854820251465>3.1415927410125732)e=(b-h)%6.2831854820251465+-6.2831854820251465;else e=(b-h)%6.2831854820251465;else e=(b-h)%6.2831854820251465+6.2831854820251465;if(!(!(e<-f)&e<=f))if(e>0.0){if((f+h)%6.2831854820251465<-3.1415927410125732){b=(f+h)%6.2831854820251465+6.2831854820251465;break}if(!((f+h)%6.2831854820251465>3.1415927410125732)){b=(f+h)%6.2831854820251465;break}b=(f+h)%6.2831854820251465+-6.2831854820251465;break}else{if((h-f)%6.2831854820251465<-3.1415927410125732){b=(h-f)%6.2831854820251465+6.2831854820251465;break}if(!((h-f)%6.2831854820251465>3.1415927410125732)){b=(h-f)%6.2831854820251465;break}b=(h-f)%6.2831854820251465+-6.2831854820251465;break}}while(0);g[a+680>>2]=(b-+ui(a,(c[a+28>>2]|0)+4|0,(c[a+32>>2]|0)+4|0))/d;return}function fi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;i=c[d>>2]|0;i=Ha[c[(c[i>>2]|0)+56>>2]&31](i,28)|0;j=(a[b+4>>0]|0)==0;h=c[b+8>>2]|0;g=c[b+12>>2]|0;b=c[d>>2]|0;c[i+4>>2]=b;c[i>>2]=8288;a[i+8>>0]=0;c[i+12>>2]=0;if(j){a[i+16>>0]=0;c[i+20>>2]=h;c[i+24>>2]=g;if(!(Ja[c[(c[b>>2]|0)+24>>2]&63](b,c[e+8>>2]|0,c[f+8>>2]|0)|0))return i|0;j=c[i+4>>2]|0;c[i+12>>2]=Ja[c[(c[j>>2]|0)+12>>2]&63](j,c[e+8>>2]|0,c[f+8>>2]|0)|0;a[i+8>>0]=1;return i|0}else{a[i+16>>0]=1;c[i+20>>2]=h;c[i+24>>2]=g;if(!(Ja[c[(c[b>>2]|0)+24>>2]&63](b,c[f+8>>2]|0,c[e+8>>2]|0)|0))return i|0;j=c[i+4>>2]|0;c[i+12>>2]=Ja[c[(c[j>>2]|0)+12>>2]&63](j,c[f+8>>2]|0,c[e+8>>2]|0)|0;a[i+8>>0]=1;return i|0}return 0}function gi(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;if(RC(b,c[d+8>>2]|0)|0)Ck(d,e,f,g);else{j=a[d+52>>0]|0;k=a[d+53>>0]|0;l=c[b+12>>2]|0;a[d+52>>0]=0;a[d+53>>0]=0;dn(b+16|0,d,e,f,g,h);a:do if((l|0)>1){i=b+24|0;do{if(a[d+54>>0]|0)break a;if(!(a[d+52>>0]|0)){if(a[d+53>>0]|0?(c[b+8>>2]&1|0)==0:0)break a}else{if((c[d+24>>2]|0)==1)break a;if(!(c[b+8>>2]&2))break a}a[d+52>>0]=0;a[d+53>>0]=0;dn(i,d,e,f,g,h);i=i+8|0}while(i>>>0<(b+16+(l<<3)|0)>>>0)}while(0);a[d+52>>0]=j;a[d+53>>0]=k}return} -function Kc(b,d,e,f,h,i,j,k,l,m,n,o,p){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,K=0.0,L=0.0;A=J(c[l+24>>2]|0,m)|0;y=a[d+44>>0]|0;B=c[d+56>>2]|0;if(!(y<<24>>24!=0|(B|0)!=0)){l=0;return l|0}C=c[(o|0?l+12|0:l+8|0)>>2]|0;m=c[(o|0?l+20|0:l+16|0)>>2]|0;c[C+(A<<2)>>2]=c[n>>2];c[C+(A+1<<2)>>2]=c[n+4>>2];c[C+(A+2<<2)>>2]=c[n+8>>2];g[m+(A<<2)>>2]=-+g[n>>2];g[m+(A+1<<2)>>2]=-+g[n+4>>2];g[m+(A+2<<2)>>2]=-+g[n+8>>2];do if(!o){q=+g[b+1176>>2];if(!(a[b+1301>>0]|0)){t=q-+g[e+48>>2];w=+g[b+1180>>2]-+g[e+52>>2];x=+g[b+1184>>2]-+g[e+56>>2];v=+g[n+8>>2];s=+g[n+4>>2];u=+g[n>>2];C=c[l+12>>2]|0;g[C+(A<<2)>>2]=w*v-x*s;g[C+(A+1<<2)>>2]=x*u-t*v;g[C+(A+2<<2)>>2]=t*s-w*u;u=+g[b+1176>>2]-+g[f+48>>2];w=+g[b+1180>>2]-+g[f+52>>2];s=+g[b+1184>>2]-+g[f+56>>2];t=+g[n+8>>2];v=+g[n+4>>2];x=+g[n>>2];C=c[l+20>>2]|0;g[C+(A<<2)>>2]=-(w*t-s*v);g[C+(A+1<<2)>>2]=-(s*x-u*t);g[C+(A+2<<2)>>2]=-(u*v-w*x);break}I=q-+g[f+48>>2];G=+g[b+1180>>2]-+g[f+52>>2];E=+g[b+1184>>2]-+g[f+56>>2];H=+g[n>>2];F=+g[n+4>>2];D=+g[n+8>>2];L=+g[b+1112>>2]-+g[e+48>>2];s=+g[b+1116>>2]-+g[e+52>>2];t=+g[b+1120>>2]-+g[e+56>>2];r=+g[d+52>>2]-+g[d+48>>2];K=H*(H*L+F*s+D*t)+H*r-H*(I*H+G*F+E*D);q=F*(H*L+F*s+D*t)+F*r-F*(I*H+G*F+E*D);r=D*(H*L+F*s+D*t)+D*r-D*(I*H+G*F+E*D);w=+g[b+1272>>2];x=+g[b+1276>>2];u=D*(s-F*(H*L+F*s+D*t)+w*q)-F*(t-D*(H*L+F*s+D*t)+w*r);v=H*(t-D*(H*L+F*s+D*t)+w*r)-D*(L-H*(H*L+F*s+D*t)+w*K);t=F*(L-H*(H*L+F*s+D*t)+w*K)-H*(s-F*(H*L+F*s+D*t)+w*q);s=D*(G-F*(I*H+G*F+E*D)-x*q)-F*(E-D*(I*H+G*F+E*D)-x*r);r=H*(E-D*(I*H+G*F+E*D)-x*r)-D*(I-H*(I*H+G*F+E*D)-x*K);q=F*(I-H*(I*H+G*F+E*D)-x*K)-H*(G-F*(I*H+G*F+E*D)-x*q);if(!((p|0)!=0|(a[b+1280>>0]|0)==0)){u=w*u;v=w*v;t=w*t;s=x*s;r=x*r;q=x*q}C=(c[l+12>>2]|0)+(A<<2)|0;g[C>>2]=u;g[C+4>>2]=v;g[C+8>>2]=t;C=c[l+20>>2]|0;g[C+(A<<2)>>2]=-s;g[C+(A+1<<2)>>2]=-r;g[C+(A+2<<2)>>2]=-q}while(0);if(B|0?+g[d>>2]==+g[d+4>>2]:0){e=(c[l+28>>2]|0)+(A<<2)|0;g[e>>2]=0.0;q=0.0}else z=11;do if((z|0)==11){m=(c[l+28>>2]|0)+(A<<2)|0;g[m>>2]=0.0;if(!(y<<24>>24)){if(B|0){e=m;q=0.0;break}else i=1;return i|0}c[(c[l+32>>2]|0)+(A<<2)>>2]=c[d+28>>2];if(B|0){e=m;q=+g[m>>2];break}v=+g[d+8>>2];q=o|0?v:-v;r=+g[d+52>>2];s=+g[d>>2];t=+g[d+4>>2];u=+g[l>>2]*+g[d+32>>2];do if(!(s>t))if(!(s==t)){if(q/u<0.0)if(r>=s?s-q/u>r:0){q=(s-r)/(q/u);break}else{q=r0.0)if(r<=t?t-q/ut?0.0:1.0;break}else q=0.0}else q=0.0;else q=1.0;while(0);g[m>>2]=q*v+ +g[m>>2];g[(c[l+36>>2]|0)+(A<<2)>>2]=-+g[d+12>>2];c[(c[l+40>>2]|0)+(A<<2)>>2]=c[d+12>>2];C=1;return C|0}while(0);L=+g[l>>2]*+g[d+32>>2]*+g[d+48>>2];g[e>>2]=q+(o|0?-L:L);c[(c[l+32>>2]|0)+(A<<2)>>2]=c[d+36>>2];if(+g[d>>2]==+g[d+4>>2]){g[(c[l+36>>2]|0)+(A<<2)>>2]=-3402823466385288598117041.0e14;g[(c[l+40>>2]|0)+(A<<2)>>2]=3402823466385288598117041.0e14;C=1;return C|0}g[(c[l+36>>2]|0)+(A<<2)>>2]=(B|0)==1?0.0:-3402823466385288598117041.0e14;g[(c[l+40>>2]|0)+(A<<2)>>2]=(B|0)==1?3402823466385288598117041.0e14:0.0;v=+g[d+40>>2];if(!(v>0.0)){C=1;return C|0}if(o|0){L=+g[n>>2];r=+g[n+4>>2];q=+g[n+8>>2];s=q;t=r;u=L;i=k;r=+g[j>>2]*L+ +g[j+4>>2]*r;q=+g[j+8>>2]*q}else{L=+g[n>>2];r=+g[n+4>>2];q=+g[n+8>>2];s=q;t=r;u=L;r=+g[h>>2]*L+ +g[h+4>>2]*r;q=+g[h+8>>2]*q}q=r+q-(u*+g[i>>2]+t*+g[i+4>>2]+s*+g[i+8>>2]);if((B|0)==1){if(!(q<0.0)){C=1;return C|0}if(!(+g[e>>2]<-(v*q))){C=1;return C|0}g[e>>2]=-(v*q);C=1;return C|0}else{if(!(q>0.0)){C=1;return C|0}if(!(+g[e>>2]>-(v*q))){C=1;return C|0}g[e>>2]=-(v*q);C=1;return C|0}return 0}function Lc(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var k=0.0,l=0,m=0.0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0,u=0.0,v=0.0;t=sa;sa=sa+288|0;p=c[b+4>>2]|0;a[p+312>>0]=0;c[p>>2]=0;a[p+356>>0]=1;c[p+292>>2]=1566444395;c[p+296>>2]=1566444395;c[p+300>>2]=1566444395;g[p+304>>2]=0.0;c[p+336>>2]=0;c[p+336+4>>2]=0;c[p+336+8>>2]=0;c[p+336+12>>2]=0;a[p+336+16>>0]=0;a[p+332>>0]=a[p+332>>0]&-16;q=+g[e+48>>2]-+g[d+48>>2]-(+g[h+48>>2]-+g[f+48>>2]);r=+g[e+52>>2]-+g[d+52>>2]-(+g[h+52>>2]-+g[f+52>>2]);s=+g[e+56>>2]-+g[d+56>>2]-(+g[h+56>>2]-+g[f+56>>2]);c[t+216>>2]=12068;g[t+216+36>>2]=999999984306749440.0;a[t+216+40>>0]=0;p=c[b+8>>2]|0;o=c[b+12>>2]|0;n=c[b+4>>2]|0;c[t+136>>2]=12116;c[t+136+4>>2]=0;c[t+136+8>>2]=1065353216;c[t+136+12>>2]=0;g[t+136+16>>2]=0.0;c[t+136+20>>2]=0;c[t+136+24>>2]=n;c[t+136+28>>2]=p;c[t+136+32>>2]=o;c[t+136+36>>2]=c[p+4>>2];c[t+136+40>>2]=c[o+4>>2];g[t+136+44>>2]=+va[c[(c[p>>2]|0)+48>>2]&15](p);g[t+136+48>>2]=+va[c[(c[o>>2]|0)+48>>2]&15](o);a[t+136+52>>0]=0;c[t+136+60>>2]=-1;c[t+136+72>>2]=1;c[t+136+76>>2]=1;g[t+128>>2]=999999984306749440.0;c[t>>2]=c[d>>2];c[t+4>>2]=c[d+4>>2];c[t+8>>2]=c[d+8>>2];c[t+12>>2]=c[d+12>>2];c[t+16>>2]=c[d+16>>2];c[t+16+4>>2]=c[d+16+4>>2];c[t+16+8>>2]=c[d+16+8>>2];c[t+16+12>>2]=c[d+16+12>>2];c[t+32>>2]=c[d+32>>2];c[t+32+4>>2]=c[d+32+4>>2];c[t+32+8>>2]=c[d+32+8>>2];c[t+32+12>>2]=c[d+32+12>>2];c[t+48>>2]=c[d+48>>2];c[t+48+4>>2]=c[d+48+4>>2];c[t+48+8>>2]=c[d+48+8>>2];c[t+48+12>>2]=c[d+48+12>>2];c[t+64>>2]=c[f>>2];c[t+64+4>>2]=c[f+4>>2];c[t+64+8>>2]=c[f+8>>2];c[t+64+12>>2]=c[f+12>>2];c[t+80>>2]=c[f+16>>2];c[t+80+4>>2]=c[f+16+4>>2];c[t+80+8>>2]=c[f+16+8>>2];c[t+80+12>>2]=c[f+16+12>>2];c[t+96>>2]=c[f+32>>2];c[t+96+4>>2]=c[f+32+4>>2];c[t+96+8>>2]=c[f+32+8>>2];c[t+96+12>>2]=c[f+32+12>>2];c[t+112>>2]=c[f+48>>2];c[t+112+4>>2]=c[f+48+4>>2];c[t+112+8>>2]=c[f+48+8>>2];c[t+112+12>>2]=c[f+48+12>>2];Ub(t+136|0,t,t+216|0,0,0);o=(a[t+216+40>>0]|0)==0;p=t+216+20|0;c[t+264>>2]=c[p>>2];c[t+264+4>>2]=c[p+4>>2];c[t+264+8>>2]=c[p+8>>2];c[t+264+12>>2]=c[p+12>>2];if(o){i=0;sa=t;return i|0}m=+g[t+216+36>>2];k=+g[t+216+16>>2];b=c[t+216+12>>2]|0;l=c[t+216+8>>2]|0;n=c[t+216+4>>2]|0;do if(m>1.0000000474974513e-03){o=0;k=0.0;while(1){if(o>>>0>31){b=0;o=13;break}v=q*(c[j>>2]=n,+g[j>>2]);v=r*(c[j>>2]=l,+g[j>>2])+v;u=k;k=k-m/(s*(c[j>>2]=b,+g[j>>2])+v);if(!(!(k<=u)&(!(k<0.0)&!(k>1.0)))){b=0;o=13;break}Qa[c[c[i>>2]>>2]&31](i,k);v=1.0-k;g[t+48>>2]=v*+g[d+48>>2]+k*+g[e+48>>2];g[t+52>>2]=v*+g[d+52>>2]+k*+g[e+52>>2];g[t+56>>2]=v*+g[d+56>>2]+k*+g[e+56>>2];g[t+112>>2]=v*+g[f+48>>2]+k*+g[h+48>>2];g[t+116>>2]=v*+g[f+52>>2]+k*+g[h+52>>2];g[t+120>>2]=v*+g[f+56>>2]+k*+g[h+56>>2];Ub(t+136|0,t,t+216|0,0,0);if(!(a[t+216+40>>0]|0)){b=0;o=13;break}m=+g[t+216+36>>2];if(m<0.0){o=8;break}c[t+264>>2]=c[p>>2];c[t+264+4>>2]=c[p+4>>2];c[t+264+8>>2]=c[p+8>>2];c[t+264+12>>2]=c[p+12>>2];b=c[t+216+12>>2]|0;l=c[t+216+8>>2]|0;n=c[t+216+4>>2]|0;if(!(m>1.0000000474974513e-03)){o=10;break}else o=o+1|0}if((o|0)==8){g[i+164>>2]=k;e=c[t+216+8>>2]|0;f=c[t+216+12>>2]|0;h=c[t+216+16>>2]|0;c[i+132>>2]=c[t+216+4>>2];c[i+136>>2]=e;c[i+140>>2]=f;c[i+144>>2]=h;c[i+148>>2]=c[p>>2];c[i+148+4>>2]=c[p+4>>2];c[i+148+8>>2]=c[p+8>>2];c[i+148+12>>2]=c[p+12>>2];i=1;sa=t;return i|0}else if((o|0)==10){m=k;k=+g[t+216+16>>2];break}else if((o|0)==13){sa=t;return b|0}}else m=0.0;while(0);v=q*(c[j>>2]=n,+g[j>>2]);v=r*(c[j>>2]=l,+g[j>>2])+v;if(s*(c[j>>2]=b,+g[j>>2])+v>=-+g[i+172>>2]){i=0;sa=t;return i|0}g[i+164>>2]=m;c[i+132>>2]=n;c[i+136>>2]=l;c[i+140>>2]=b;g[i+144>>2]=k;c[i+148>>2]=c[t+264>>2];c[i+148+4>>2]=c[t+264+4>>2];c[i+148+8>>2]=c[t+264+8>>2];c[i+148+12>>2]=c[t+264+12>>2];i=1;sa=t;return i|0}function Mc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0;l=sa;sa=sa+240|0;c[a+4>>2]=(c[a+4>>2]|0)+1;j=c[b+36>>2]|0;i=c[d+36>>2]|0;J=c[a+8>>2]|0;f=c[a+12>>2]|0;K=c[(c[J+4>>2]|0)+24>>2]|0;d=c[K+(j*80|0)+64>>2]|0;b=(c[f+4>>2]|0)+24|0;e=c[(c[b>>2]|0)+(i*80|0)+64>>2]|0;J=c[J+12>>2]|0;m=+g[J>>2];H=+g[J+4>>2];I=+g[J+8>>2];p=+g[J+16>>2];r=+g[J+20>>2];t=+g[J+24>>2];q=+g[J+32>>2];u=+g[J+36>>2];C=+g[J+40>>2];v=+g[K+(j*80|0)>>2];w=+g[K+(j*80|0)+16>>2];x=+g[K+(j*80|0)+32>>2];y=+g[K+(j*80|0)+4>>2];z=+g[K+(j*80|0)+20>>2];A=+g[K+(j*80|0)+36>>2];s=+g[K+(j*80|0)+8>>2];B=+g[K+(j*80|0)+24>>2];D=+g[K+(j*80|0)+40>>2];n=+g[K+(j*80|0)+48>>2];o=+g[K+(j*80|0)+52>>2];G=+g[K+(j*80|0)+56>>2];E=+g[J+48>>2]+(m*n+H*o+I*G);F=+g[J+52>>2]+(p*n+r*o+t*G);G=+g[J+56>>2]+(q*n+u*o+C*G);g[l+176>>2]=m*v+H*w+I*x;g[l+176+4>>2]=m*y+H*z+I*A;g[l+176+8>>2]=m*s+H*B+I*D;g[l+176+12>>2]=0.0;g[l+176+16>>2]=p*v+r*w+t*x;g[l+176+20>>2]=p*y+r*z+t*A;g[l+176+24>>2]=p*s+r*B+t*D;g[l+176+28>>2]=0.0;g[l+176+32>>2]=q*v+u*w+C*x;g[l+176+36>>2]=q*y+u*z+C*A;g[l+176+40>>2]=q*s+u*B+C*D;g[l+176+44>>2]=0.0;g[l+176+48>>2]=E;g[l+176+52>>2]=F;g[l+176+56>>2]=G;g[l+176+60>>2]=0.0;f=c[f+12>>2]|0;G=+g[f>>2];F=+g[f+4>>2];E=+g[f+8>>2];D=+g[f+16>>2];C=+g[f+20>>2];B=+g[f+24>>2];u=+g[f+32>>2];s=+g[f+36>>2];q=+g[f+40>>2];b=c[b>>2]|0;A=+g[b+(i*80|0)>>2];z=+g[b+(i*80|0)+16>>2];y=+g[b+(i*80|0)+32>>2];x=+g[b+(i*80|0)+4>>2];w=+g[b+(i*80|0)+20>>2];v=+g[b+(i*80|0)+36>>2];t=+g[b+(i*80|0)+8>>2];r=+g[b+(i*80|0)+24>>2];p=+g[b+(i*80|0)+40>>2];I=+g[b+(i*80|0)+48>>2];H=+g[b+(i*80|0)+52>>2];m=+g[b+(i*80|0)+56>>2];o=+g[f+48>>2]+(G*I+F*H+E*m);n=+g[f+52>>2]+(D*I+C*H+B*m);m=+g[f+56>>2]+(u*I+s*H+q*m);g[l+112>>2]=G*A+F*z+E*y;g[l+112+4>>2]=G*x+F*w+E*v;g[l+112+8>>2]=G*t+F*r+E*p;g[l+112+12>>2]=0.0;g[l+112+16>>2]=D*A+C*z+B*y;g[l+112+20>>2]=D*x+C*w+B*v;g[l+112+24>>2]=D*t+C*r+B*p;g[l+112+28>>2]=0.0;g[l+112+32>>2]=u*A+s*z+q*y;g[l+112+36>>2]=u*x+s*w+q*v;g[l+112+40>>2]=u*t+s*r+q*p;g[l+112+44>>2]=0.0;g[l+112+48>>2]=o;g[l+112+52>>2]=n;g[l+112+56>>2]=m;g[l+112+60>>2]=0.0;ab[c[(c[d>>2]|0)+8>>2]&127](d,l+176|0,l+96|0,l+80|0);ab[c[(c[e>>2]|0)+8>>2]&127](e,l+112|0,l+64|0,l+48|0);if(!(+g[l+96>>2]>+g[l+48>>2])?!(+g[l+80>>2]<+g[l+64>>2]):0)b=1;else b=0;if(!(!(+g[l+96+8>>2]>+g[l+48+8>>2])?!(+g[l+80+8>>2]<+g[l+64+8>>2]):0))b=0;if(+g[l+96+4>>2]>+g[l+48+4>>2]){sa=l;return}if(+g[l+80+4>>2]<+g[l+64+4>>2]|b^1){sa=l;return}f=c[a+8>>2]|0;b=c[f+8>>2]|0;c[l+24>>2]=f;c[l+24+4>>2]=d;c[l+24+8>>2]=b;c[l+24+12>>2]=l+176;c[l+24+16>>2]=-1;c[l+24+20>>2]=j;b=c[a+12>>2]|0;f=c[b+8>>2]|0;c[l>>2]=b;c[l+4>>2]=e;c[l+8>>2]=f;c[l+12>>2]=l+112;c[l+16>>2]=-1;c[l+20>>2]=i;f=c[a+28>>2]|0;c[7170]=(c[7170]|0)+1;b=(i<<16|j)+~((i<<16|j)<<15)|0;b=((10?b>>10:b)^b)*9|0;b=(6?b>>6:b)^b;b=(c[f+12>>2]|0)+-1&((16?b+~(b<<11)>>16:b+~(b<<11)|0)^b+~(b<<11));a:do if((b|0)<(c[f+32>>2]|0)?(h=c[(c[f+40>>2]|0)+(b<<2)>>2]|0,(h|0)!=-1):0){e=c[f+16>>2]|0;b=h;while(1){d=e+(b*12|0)|0;if((c[d>>2]|0)==(j|0)?(c[e+(b*12|0)+4>>2]|0)==(i|0):0)break;b=c[(c[f+60>>2]|0)+(b<<2)>>2]|0;if((b|0)==-1){k=16;break a}}if(d)b=c[e+(b*12|0)+8>>2]|0;else k=16}else k=16;while(0);if((k|0)==16){b=c[a+16>>2]|0;b=Ka[c[(c[b>>2]|0)+8>>2]&31](b,l+24|0,l,c[a+32>>2]|0)|0;K=c[a+28>>2]|0;c[(Ja[c[(c[K>>2]|0)+12>>2]&63](K,j,i)|0)+8>>2]=b}K=c[a+24>>2]|0;k=c[K+8>>2]|0;J=c[K+12>>2]|0;c[K+8>>2]=l+24;c[K+12>>2]=l;Za[c[(c[K>>2]|0)+8>>2]&127](K,-1,j);K=c[a+24>>2]|0;Za[c[(c[K>>2]|0)+12>>2]&127](K,-1,i);eb[c[(c[b>>2]|0)+8>>2]&31](b,l+24|0,l,c[a+20>>2]|0,c[a+24>>2]|0);K=c[a+24>>2]|0;c[K+8>>2]=k;c[K+12>>2]=J;sa=l;return}function Nc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0;z=sa;sa=sa+48|0;switch(c[b+4>>2]|0){case 8:{c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;sa=z;return}case 0:{v=+g[b+28>>2];w=+g[b+28+4>>2];w=+g[d+4>>2]>=0.0?w:-w;y=+g[b+28+8>>2];y=+g[d+8>>2]>=0.0?y:-y;g[a>>2]=+g[d>>2]>=0.0?v:-v;g[a+4>>2]=w;g[a+8>>2]=y;g[a+12>>2]=0.0;sa=z;return}case 1:{t=+g[d>>2];u=+g[d+4>>2];y=+g[d+8>>2];w=t*+g[b+56>>2]+u*+g[b+56+4>>2]+y*+g[b+56+8>>2];v=t*+g[b+56+16>>2]+u*+g[b+56+20>>2]+y*+g[b+56+24>>2];y=t*+g[b+56+32>>2]+u*+g[b+56+36>>2]+y*+g[b+56+40>>2];n=w>2]|0;r=c[b+56+(n<<4)+8>>2]|0;c[a>>2]=c[b+56+(n<<4)>>2];c[a+4>>2]=o;c[a+8>>2]=r;g[a+12>>2]=0.0;sa=z;return}case 13:{c[z+32>>2]=c[b+28>>2];c[z+32+4>>2]=c[b+28+4>>2];c[z+32+8>>2]=c[b+28+8>>2];c[z+32+12>>2]=c[b+28+12>>2];c[z+16>>2]=c[d>>2];e=c[d+4>>2]|0;c[z+16+4>>2]=e;r=c[d+8>>2]|0;c[z+16+8>>2]=r;g[z+16+12>>2]=0.0;d=c[b+52>>2]|0;f=(c[j>>2]=r,+g[j>>2]);switch(d|0){case 2:{b=0;n=2;o=1;h=(c[j>>2]=e,+g[j>>2]);break}case 1:{b=0;n=1;o=2;h=f;break}default:{b=1;n=0;o=2;h=f}}f=+g[z+32+(b<<2)>>2];i=+g[z+32+(d<<2)>>2];m=+g[z+16+(b<<2)>>2];l=+x(+(m*m+h*h));if(l!=0.0){k=h*(f/l);h=+g[z+16+(n<<2)>>2]<0.0?-i:i;f=m*(f/l)}else{k=0.0;h=+g[z+16+(n<<2)>>2]<0.0?-i:i}g[z+(b<<2)>>2]=f;g[z+(n<<2)>>2]=h;g[z+(o<<2)>>2]=k;c[a>>2]=c[z>>2];c[a+4>>2]=c[z+4>>2];c[a+8>>2]=c[z+8>>2];g[a+12>>2]=0.0;sa=z;return}case 10:{f=+g[d>>2];h=+g[d+4>>2];i=+g[d+8>>2];e=c[b+52>>2]|0;w=+g[b+28+(e<<2)>>2];k=+g[b+28+(((e+2|0)%3|0)<<2)>>2];if(f*f+h*h+i*i<9.999999747378752e-05){y=1.0;v=0.0;u=0.0}else{u=1.0/+x(+(f*f+h*h+i*i));y=f*u;v=h*u;u=i*u}c[z+32>>2]=0;c[z+32+4>>2]=0;c[z+32+8>>2]=0;c[z+32+12>>2]=0;g[z+32+(e<<2)>>2]=w;s=k*y;t=k*v;q=k*u;p=+g[b+44>>2];l=y*p;m=v*p;p=u*p;k=s+ +g[z+32>>2]-l;f=t+ +g[z+32+4>>2]-m;h=q+ +g[z+32+8>>2]-p;i=u*h+(y*k+v*f);if(i>-999999984306749440.0){o=(g[j>>2]=h,c[j>>2]|0);r=(g[j>>2]=f,c[j>>2]|0);n=(g[j>>2]=k,c[j>>2]|0)}else{i=-999999984306749440.0;n=0;o=0;r=0}c[z+32>>2]=0;c[z+32+4>>2]=0;c[z+32+8>>2]=0;c[z+32+12>>2]=0;g[z+32+(e<<2)>>2]=-w;s=s+ +g[z+32>>2]-l;w=t+ +g[z+32+4>>2]-m;f=q+ +g[z+32+8>>2]-p;e=y*s+v*w+u*f>i;d=(g[j>>2]=s,c[j>>2]|0);b=(g[j>>2]=w,c[j>>2]|0);o=e?(g[j>>2]=f,c[j>>2]|0):o;c[a>>2]=e?d:n;c[a+4>>2]=e?b:r;c[a+8>>2]=o;g[a+12>>2]=0.0;sa=z;return}case 5:{o=c[b+92>>2]|0;n=c[b+96>>2]|0;p=+g[b+12>>2];q=+g[b+16>>2];m=+g[b+20>>2];k=+g[d>>2]*p;l=+g[d+4>>2]*q;h=+g[d+8>>2]*m;if((n|0)>0){e=-1;d=0;f=-3402823466385288598117041.0e14;while(1){i=k*+g[o+(d<<4)>>2]+l*+g[o+(d<<4)+4>>2]+h*+g[o+(d<<4)+8>>2];b=i>f;e=b?d:e;d=d+1|0;if((d|0)==(n|0))break;else f=b?i:f}}else e=-1;w=q*+g[o+(e<<4)+4>>2];y=m*+g[o+(e<<4)+8>>2];g[a>>2]=p*+g[o+(e<<4)>>2];g[a+4>>2]=w;g[a+8>>2]=y;g[a+12>>2]=0.0;sa=z;return}case 4:{o=c[b+104>>2]|0;n=c[b+96>>2]|0;p=+g[b+12>>2];q=+g[b+16>>2];m=+g[b+20>>2];k=+g[d>>2]*p;l=+g[d+4>>2]*q;h=+g[d+8>>2]*m;if((n|0)>0){e=-1;d=0;f=-3402823466385288598117041.0e14;while(1){i=k*+g[o+(d<<4)>>2]+l*+g[o+(d<<4)+4>>2]+h*+g[o+(d<<4)+8>>2];b=i>f;e=b?d:e;d=d+1|0;if((d|0)==(n|0))break;else f=b?i:f}}else e=-1;w=q*+g[o+(e<<4)+4>>2];y=m*+g[o+(e<<4)+8>>2];g[a>>2]=p*+g[o+(e<<4)>>2];g[a+4>>2]=w;g[a+8>>2]=y;g[a+12>>2]=0.0;sa=z;return}default:{Za[c[(c[b>>2]|0)+68>>2]&127](a,b,d);sa=z;return}}}function Oc(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var k=0,l=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0,C=0,D=0;D=c[b+88>>2]|0;if((D|0)==(c[b+92>>2]|0)?(o=(D|0)==0?1:D<<1,(D|0)<(o|0)):0){if(!o){k=0;m=D}else{c[7182]=(c[7182]|0)+1;k=xb((o*152|3)+16|0)|0;if(!k)k=0;else{c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16}m=c[b+88>>2]|0}if((m|0)>0){l=0;do{Bh(k+(l*152|0)|0,(c[b+96>>2]|0)+(l*152|0)|0,152)|0;l=l+1|0}while((l|0)!=(m|0))}l=c[b+96>>2]|0;if(l|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=k;c[b+92>>2]=o;k=c[b+88>>2]|0}else k=D;c[b+88>>2]=k+1;C=c[b+96>>2]|0;c[C+(D*152|0)+140>>2]=h;c[C+(D*152|0)+16>>2]=0;c[C+(D*152|0)+16+4>>2]=0;c[C+(D*152|0)+16+8>>2]=0;c[C+(D*152|0)+16+12>>2]=0;g[C+(D*152|0)+48>>2]=-0.0;g[C+(D*152|0)+52>>2]=-0.0;g[C+(D*152|0)+56>>2]=-0.0;g[C+(D*152|0)+60>>2]=0.0;h=c[b+16>>2]|0;o=c[h+(e*244|0)+240>>2]|0;B=c[h+(f*244|0)+240>>2]|0;c[C+(D*152|0)+144>>2]=e;c[C+(D*152|0)+148>>2]=f;b=c[i+88>>2]|0;c[C+(D*152|0)+104>>2]=b;c[C+(D*152|0)+132>>2]=0;g[C+(D*152|0)+100>>2]=0.0;g[C+(D*152|0)+96>>2]=0.0;x=-+g[d>>2];y=-+g[d+4>>2];z=-+g[d+8>>2];g[C+(D*152|0)>>2]=x;g[C+(D*152|0)+4>>2]=y;g[C+(D*152|0)+8>>2]=z;g[C+(D*152|0)+12>>2]=0.0;A=(c[j>>2]=b,+g[j>>2]);if(o|0){k=(g[j>>2]=(+g[o+264>>2]*x+ +g[o+268>>2]*y+ +g[o+272>>2]*z)*+g[o+544>>2],c[j>>2]|0);l=(g[j>>2]=(+g[o+280>>2]*x+ +g[o+284>>2]*y+ +g[o+288>>2]*z)*+g[o+548>>2],c[j>>2]|0);m=(g[j>>2]=(+g[o+296>>2]*x+ +g[o+300>>2]*y+ +g[o+304>>2]*z)*+g[o+552>>2],c[j>>2]|0)}else{k=0;l=0;m=0}c[C+(D*152|0)+64>>2]=k;c[C+(D*152|0)+68>>2]=l;c[C+(D*152|0)+72>>2]=m;g[C+(D*152|0)+76>>2]=0.0;u=+g[d>>2];v=+g[d+4>>2];w=+g[d+8>>2];d=c[d+12>>2]|0;g[C+(D*152|0)+32>>2]=u;g[C+(D*152|0)+36>>2]=v;g[C+(D*152|0)+40>>2]=w;c[C+(D*152|0)+44>>2]=d;if(B|0){k=(g[j>>2]=(u*+g[B+264>>2]+v*+g[B+268>>2]+w*+g[B+272>>2])*+g[B+544>>2],c[j>>2]|0);l=(g[j>>2]=(u*+g[B+280>>2]+v*+g[B+284>>2]+w*+g[B+288>>2])*+g[B+548>>2],c[j>>2]|0);m=(g[j>>2]=(u*+g[B+296>>2]+v*+g[B+300>>2]+w*+g[B+304>>2])*+g[B+552>>2],c[j>>2]|0)}else{k=0;l=0;m=0}c[C+(D*152|0)+80>>2]=k;c[C+(D*152|0)+84>>2]=l;c[C+(D*152|0)+88>>2]=m;g[C+(D*152|0)+92>>2]=0.0;if(o|0){n=+g[o+264>>2]*x+ +g[o+268>>2]*y+ +g[o+272>>2]*z;p=+g[o+280>>2]*x+ +g[o+284>>2]*y+ +g[o+288>>2]*z;q=+g[o+296>>2]*x+ +g[o+300>>2]*y+ +g[o+304>>2]*z}else{n=0.0;p=0.0;q=0.0}if(B|0){r=+g[B+264>>2]*u+ +g[B+268>>2]*v+ +g[B+272>>2]*w;s=u*+g[B+280>>2]+v*+g[B+284>>2]+w*+g[B+288>>2];t=u*+g[B+296>>2]+v*+g[B+300>>2]+w*+g[B+304>>2]}else{r=0.0;s=0.0;t=0.0}s=1.0/(n*x+p*y+q*z+0.0+(r*u+s*v+t*w));g[C+(D*152|0)+108>>2]=s;if(o|0){p=+g[h+(e*244|0)+192>>2];q=+g[h+(e*244|0)+196>>2];r=+g[h+(e*244|0)+200>>2];n=(+g[h+(e*244|0)+176>>2]+ +g[h+(e*244|0)+208>>2])*0.0+(+g[h+(e*244|0)+180>>2]+ +g[h+(e*244|0)+212>>2])*0.0+(+g[h+(e*244|0)+184>>2]+ +g[h+(e*244|0)+216>>2])*0.0}else{p=0.0;q=0.0;r=0.0;n=0.0}n=n+(r*z+(q*y+p*x));if(!B){z=0.0;t=0.0;x=0.0;y=-0.0;z=u*z;v=v*t;z=v+z;x=w*x;z=x+z;z=y+z;z=n+z;z=0.0-z;z=s*z;f=C+(D*152|0)+112|0;g[f>>2]=z;f=C+(D*152|0)+116|0;g[f>>2]=0.0;A=-A;f=C+(D*152|0)+120|0;g[f>>2]=A;D=C+(D*152|0)+124|0;c[D>>2]=b;return}z=+g[h+(f*244|0)+192>>2];t=+g[h+(f*244|0)+196>>2];x=+g[h+(f*244|0)+200>>2];y=(+g[h+(f*244|0)+176>>2]+ +g[h+(f*244|0)+208>>2])*-0.0+(+g[h+(f*244|0)+180>>2]+ +g[h+(f*244|0)+212>>2])*-0.0+(+g[h+(f*244|0)+184>>2]+ +g[h+(f*244|0)+216>>2])*-0.0;z=u*z;v=v*t;z=v+z;x=w*x;z=x+z;z=y+z;z=n+z;z=0.0-z;z=s*z;f=C+(D*152|0)+112|0;g[f>>2]=z;f=C+(D*152|0)+116|0;g[f>>2]=0.0;A=-A;f=C+(D*152|0)+120|0;g[f>>2]=A;D=C+(D*152|0)+124|0;c[D>>2]=b;return}function Pc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0;h=sa;sa=sa+240|0;if(!(c[b+16>>2]|0)){J=c[b+12>>2]|0;b=c[b+20>>2]|0;w=+g[d>>2];p=+g[d+4>>2];t=+g[d+8>>2];j=+g[d+16>>2];q=+g[d+20>>2];i=+g[d+24>>2];l=+g[d+32>>2];r=+g[d+36>>2];m=+g[d+40>>2];E=+g[d+48>>2];D=+g[d+52>>2];C=+g[d+56>>2];I=+g[e>>2];H=+g[e+16>>2];y=+g[e+32>>2];G=+g[e+4>>2];F=+g[e+20>>2];x=+g[e+36>>2];u=+g[e+8>>2];k=+g[e+24>>2];o=+g[e+40>>2];B=-+g[e+48>>2];A=-+g[e+52>>2];v=-+g[e+56>>2];d=c[(c[J>>2]|0)+64>>2]|0;z=-+g[b+48>>2];s=-+g[b+52>>2];n=-+g[b+56>>2];g[h+16>>2]=(w*I+j*H+l*y)*z+(w*G+j*F+l*x)*s+(w*u+j*k+l*o)*n;g[h+16+4>>2]=(p*I+q*H+r*y)*z+(p*G+q*F+r*x)*s+(p*u+q*k+r*o)*n;g[h+16+8>>2]=(t*I+i*H+m*y)*z+(t*G+i*F+m*x)*s+(t*u+i*k+m*o)*n;g[h+16+12>>2]=0.0;Za[d&127](h+152|0,J,h+16|0);n=+g[h+152>>2];s=+g[h+152+4>>2];z=+g[h+152+8>>2];y=E*I+D*H+C*y+(I*B+H*A+y*v)+((w*I+j*H+l*y)*n+(p*I+q*H+r*y)*s+(t*I+i*H+m*y)*z);x=E*G+D*F+C*x+(G*B+F*A+x*v)+((w*G+j*F+l*x)*n+(p*G+q*F+r*x)*s+(t*G+i*F+m*x)*z);z=E*u+D*k+C*o+(u*B+k*A+o*v)+((w*u+j*k+l*o)*n+(p*u+q*k+r*o)*s+(t*u+i*k+m*o)*z);o=+g[b+48>>2];m=+g[b+52>>2];k=+g[b+56>>2];i=k*z+(o*y+m*x)-+g[b+64>>2];u=+g[e>>2];t=+g[e+4>>2];s=+g[e+8>>2];r=+g[e+16>>2];q=+g[e+20>>2];p=+g[e+24>>2];n=+g[e+32>>2];l=+g[e+36>>2];j=+g[e+40>>2];w=(y-o*i)*r+(x-m*i)*q+(z-k*i)*p+ +g[e+52>>2];v=(y-o*i)*n+(x-m*i)*l+(z-k*i)*j+ +g[e+56>>2];g[h+16>>2]=s*(z-k*i)+(u*(y-o*i)+t*(x-m*i))+ +g[e+48>>2];g[h+16+4>>2]=w;g[h+16+8>>2]=v;g[h+16+12>>2]=0.0;g[h>>2]=o*u+m*t+k*s;g[h+4>>2]=o*r+m*q+k*p;g[h+8>>2]=o*n+m*l+k*j;g[h+12>>2]=0.0;_a[c[(c[f>>2]|0)+16>>2]&15](f,h,h+16|0,i);sa=h;return}else{M=c[b+4>>2]|0;a[M+312>>0]=0;c[M>>2]=0;a[M+356>>0]=1;c[M+292>>2]=1566444395;c[M+296>>2]=1566444395;c[M+300>>2]=1566444395;g[M+304>>2]=0.0;c[M+336>>2]=0;c[M+336+4>>2]=0;c[M+336+8>>2]=0;c[M+336+12>>2]=0;a[M+336+16>>0]=0;a[M+332>>0]=a[M+332>>0]&-16;M=c[b+12>>2]|0;L=c[b+16>>2]|0;K=c[M+4>>2]|0;J=c[L+4>>2]|0;H=+va[c[(c[M>>2]|0)+48>>2]&15](M);N=c[b+16>>2]|0;I=+va[c[(c[N>>2]|0)+48>>2]&15](N);N=c[b+4>>2]|0;b=c[b+8>>2]|0;c[h+152>>2]=12116;c[h+152+4>>2]=0;c[h+152+8>>2]=1065353216;c[h+152+12>>2]=0;g[h+152+16>>2]=0.0;c[h+152+20>>2]=b;c[h+152+24>>2]=N;c[h+152+28>>2]=M;c[h+152+32>>2]=L;c[h+152+36>>2]=K;c[h+152+40>>2]=J;g[h+152+44>>2]=H;g[h+152+48>>2]=I;a[h+152+52>>0]=0;c[h+152+60>>2]=-1;c[h+152+72>>2]=1;c[h+152+76>>2]=1;g[h+16+128>>2]=999999984306749440.0;c[h+16>>2]=c[d>>2];c[h+16+4>>2]=c[d+4>>2];c[h+16+8>>2]=c[d+8>>2];c[h+16+12>>2]=c[d+12>>2];c[h+16+16>>2]=c[d+16>>2];c[h+16+16+4>>2]=c[d+16+4>>2];c[h+16+16+8>>2]=c[d+16+8>>2];c[h+16+16+12>>2]=c[d+16+12>>2];c[h+16+32>>2]=c[d+32>>2];c[h+16+32+4>>2]=c[d+32+4>>2];c[h+16+32+8>>2]=c[d+32+8>>2];c[h+16+32+12>>2]=c[d+32+12>>2];c[h+16+48>>2]=c[d+48>>2];c[h+16+48+4>>2]=c[d+48+4>>2];c[h+16+48+8>>2]=c[d+48+8>>2];c[h+16+48+12>>2]=c[d+48+12>>2];c[h+16+64>>2]=c[e>>2];c[h+16+64+4>>2]=c[e+4>>2];c[h+16+64+8>>2]=c[e+8>>2];c[h+16+64+12>>2]=c[e+12>>2];c[h+16+80>>2]=c[e+16>>2];c[h+16+80+4>>2]=c[e+16+4>>2];c[h+16+80+8>>2]=c[e+16+8>>2];c[h+16+80+12>>2]=c[e+16+12>>2];c[h+16+96>>2]=c[e+32>>2];c[h+16+96+4>>2]=c[e+32+4>>2];c[h+16+96+8>>2]=c[e+32+8>>2];c[h+16+96+12>>2]=c[e+32+12>>2];c[h+16+112>>2]=c[e+48>>2];c[h+16+112+4>>2]=c[e+48+4>>2];c[h+16+112+8>>2]=c[e+48+8>>2];c[h+16+112+12>>2]=c[e+48+12>>2];Ub(h+152|0,h+16|0,f,0,0);sa=h;return}}function Qc(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0,k=0,l=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0;m=sa;sa=sa+16|0;c[b+236>>2]=2;c[b+312>>2]=0;c[b+312+4>>2]=0;c[b+312+8>>2]=0;c[b+312+12>>2]=0;c[b+312+16>>2]=0;c[b+312+20>>2]=0;c[b+312+24>>2]=0;c[b+312+28>>2]=0;c[b+544>>2]=1065353216;c[b+548>>2]=1065353216;c[b+552>>2]=1065353216;g[b+556>>2]=0.0;c[b+348>>2]=1065353216;c[b+352>>2]=1065353216;c[b+356>>2]=1065353216;e=b+360|0;h=e+36|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0));c[b+412>>2]=0;c[b+412+4>>2]=0;c[b+412+8>>2]=0;c[b+412+12>>2]=0;c[b+412+16>>2]=0;c[b+412+20>>2]=0;c[b+412+24>>2]=0;c[b+412+28>>2]=0;f=+g[d+92>>2];l=+g[d+96>>2];g[m+12>>2]=f;g[m+8>>2]=l;g[m+4>>2]=0.0;g[m>>2]=1.0;c[b+444>>2]=c[(f<0.0?m+4|0:f>1.0?m:m+12|0)>>2];g[m+4>>2]=0.0;g[m>>2]=1.0;c[b+448>>2]=c[(l<0.0?m+4|0:l>1.0?m:m+8|0)>>2];c[b+472>>2]=c[d+112>>2];c[b+476>>2]=c[d+116>>2];e=c[d+4>>2]|0;c[b+480>>2]=e;c[b+608>>2]=0;c[b+612>>2]=0;a[b+452>>0]=a[d+120>>0]|0;c[b+456>>2]=c[d+124>>2];c[b+460>>2]=c[d+128>>2];c[b+464>>2]=c[d+132>>2];c[b+468>>2]=c[d+136>>2];if(!e){c[b+4>>2]=c[d+8>>2];c[b+4+4>>2]=c[d+8+4>>2];c[b+4+8>>2]=c[d+8+8>>2];c[b+4+12>>2]=c[d+8+12>>2];c[b+20>>2]=c[d+24>>2];c[b+20+4>>2]=c[d+24+4>>2];c[b+20+8>>2]=c[d+24+8>>2];c[b+20+12>>2]=c[d+24+12>>2];c[b+36>>2]=c[d+40>>2];c[b+36+4>>2]=c[d+40+4>>2];c[b+36+8>>2]=c[d+40+8>>2];c[b+36+12>>2]=c[d+40+12>>2];c[b+52>>2]=c[d+56>>2];c[b+52+4>>2]=c[d+56+4>>2];c[b+52+8>>2]=c[d+56+8>>2];c[b+52+12>>2]=c[d+56+12>>2];e=b+20|0;h=b+36|0;i=b+52|0;k=b+4|0}else{Va[c[(c[e>>2]|0)+8>>2]&127](e,b+4|0);e=b+20|0;h=b+36|0;i=b+52|0;k=b+4|0}c[b+68>>2]=c[k>>2];c[b+68+4>>2]=c[k+4>>2];c[b+68+8>>2]=c[k+8>>2];c[b+68+12>>2]=c[k+12>>2];c[b+84>>2]=c[e>>2];c[b+84+4>>2]=c[e+4>>2];c[b+84+8>>2]=c[e+8>>2];c[b+84+12>>2]=c[e+12>>2];c[b+100>>2]=c[h>>2];c[b+100+4>>2]=c[h+4>>2];c[b+100+8>>2]=c[h+8>>2];c[b+100+12>>2]=c[h+12>>2];c[b+116>>2]=c[i>>2];c[b+116+4>>2]=c[i+4>>2];c[b+116+8>>2]=c[i+8>>2];c[b+116+12>>2]=c[i+12>>2];c[b+132>>2]=0;c[b+132+4>>2]=0;c[b+132+8>>2]=0;c[b+132+12>>2]=0;c[b+132+16>>2]=0;c[b+132+20>>2]=0;c[b+132+24>>2]=0;c[b+132+28>>2]=0;c[b+224>>2]=c[d+100>>2];c[b+232>>2]=c[d+104>>2];c[b+228>>2]=c[d+108>>2];Va[c[(c[b>>2]|0)+12>>2]&127](b,c[d+72>>2]|0);e=c[6846]|0;c[6846]=e+1;c[b+508>>2]=e;f=+g[d>>2];e=c[b+204>>2]|0;if(f==0.0){c[b+204>>2]=e|1;l=0.0}else{c[b+204>>2]=e&-2;l=1.0/f}g[b+344>>2]=l;o=f*+g[b+384>>2];n=f*+g[b+388>>2];g[b+364>>2]=f*+g[b+380>>2];g[b+368>>2]=o;g[b+372>>2]=n;g[b+376>>2]=0.0;f=+g[d+76>>2];h=f!=0.0?(g[j>>2]=1.0/f,c[j>>2]|0):0;f=+g[d+80>>2];e=f!=0.0?(g[j>>2]=1.0/f,c[j>>2]|0):0;f=+g[d+84>>2];d=f!=0.0?(g[j>>2]=1.0/f,c[j>>2]|0):0;c[b+396>>2]=h;c[b+400>>2]=e;c[b+404>>2]=d;g[b+408>>2]=0.0;q=l*+g[b+352>>2];x=l*+g[b+356>>2];g[b+560>>2]=l*+g[b+348>>2];g[b+564>>2]=q;g[b+568>>2]=x;g[b+572>>2]=0.0;x=+g[b+4>>2];q=(c[j>>2]=h,+g[j>>2]);w=+g[b+8>>2];f=(c[j>>2]=e,+g[j>>2]);v=+g[b+12>>2];n=(c[j>>2]=d,+g[j>>2]);u=+g[b+20>>2];t=+g[b+24>>2];s=+g[b+28>>2];r=+g[b+36>>2];p=+g[b+40>>2];o=+g[b+44>>2];g[b+264>>2]=x*x*q+w*w*f+v*v*n;g[b+268>>2]=x*q*u+w*f*t+v*n*s;g[b+272>>2]=x*q*r+w*f*p+v*n*o;g[b+276>>2]=0.0;g[b+280>>2]=x*u*q+w*t*f+v*s*n;g[b+284>>2]=u*u*q+t*t*f+s*s*n;g[b+288>>2]=u*q*r+t*f*p+s*n*o;g[b+292>>2]=0.0;g[b+296>>2]=x*r*q+w*p*f+v*o*n;g[b+300>>2]=u*r*q+t*p*f+s*o*n;g[b+304>>2]=r*r*q+p*p*f+o*o*n;g[b+308>>2]=0.0;c[b+504>>2]=0;c[b+512>>2]=0;c[b+512+4>>2]=0;c[b+512+8>>2]=0;c[b+512+12>>2]=0;c[b+512+16>>2]=0;c[b+512+20>>2]=0;c[b+512+24>>2]=0;c[b+512+28>>2]=0;n=l*+g[b+352>>2];o=l*+g[b+356>>2];g[b+560>>2]=l*+g[b+348>>2];g[b+564>>2]=n;g[b+568>>2]=o;e=b+572|0;h=e+36|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0));sa=m;return}function Rc(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0;u=sa;sa=sa+544|0;j=h;k=j+36|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[u+384>>2]=a;c[u+384+4>>2]=d;A=+g[e>>2];G=+g[b>>2];z=+g[e+16>>2];F=+g[b+16>>2];y=+g[e+32>>2];E=+g[b+32>>2];D=+g[b+4>>2];C=+g[b+20>>2];B=+g[b+36>>2];l=+g[b+8>>2];n=+g[b+24>>2];p=+g[b+40>>2];w=+g[e+4>>2];v=+g[e+20>>2];i=+g[e+36>>2];m=+g[e+8>>2];o=+g[e+24>>2];q=+g[e+40>>2];g[u+384+8>>2]=A*G+z*F+y*E;g[u+384+12>>2]=A*D+z*C+y*B;g[u+384+16>>2]=A*l+z*n+y*p;g[u+384+20>>2]=0.0;g[u+384+24>>2]=G*w+F*v+E*i;g[u+384+28>>2]=D*w+C*v+B*i;g[u+384+32>>2]=l*w+n*v+p*i;g[u+384+36>>2]=0.0;g[u+384+40>>2]=G*m+F*o+E*q;g[u+384+44>>2]=D*m+C*o+B*q;g[u+384+48>>2]=l*m+n*o+p*q;g[u+384+52>>2]=0.0;I=+g[e+48>>2]-+g[b+48>>2];H=+g[e+52>>2]-+g[b+52>>2];t=+g[e+56>>2]-+g[b+56>>2];r=I*+g[b>>2]+H*+g[b+16>>2]+t*+g[b+32>>2];s=I*+g[b+4>>2]+H*+g[b+20>>2]+t*+g[b+36>>2];t=I*+g[b+8>>2]+H*+g[b+24>>2]+t*+g[b+40>>2];g[u+384+56>>2]=A*G+z*F+y*E;g[u+384+60>>2]=G*w+F*v+E*i;g[u+384+64>>2]=G*m+F*o+E*q;g[u+384+68>>2]=0.0;g[u+384+72>>2]=A*D+z*C+y*B;g[u+384+76>>2]=D*w+C*v+B*i;g[u+384+80>>2]=D*m+C*o+B*q;g[u+384+84>>2]=0.0;g[u+384+88>>2]=A*l+z*n+y*p;g[u+384+92>>2]=l*w+n*v+p*i;g[u+384+96>>2]=l*m+n*o+p*q;g[u+384+100>>2]=0.0;g[u+384+104>>2]=r;g[u+384+108>>2]=s;g[u+384+112>>2]=t;g[u+384+116>>2]=0.0;c[u+384+120>>2]=81;c[u+384+124>>2]=0;c[u+364>>2]=0;c[u+128>>2]=0;c[u+128+4>>2]=0;c[u+128+8>>2]=0;c[u+128+12>>2]=0;c[u+376>>2]=2;c[u+368>>2]=0;g[u+144>>2]=0.0;a=Rb(u,u+384|0,f)|0;if(a|0){c[h>>2]=(a|0)==1?1:2;h=0;sa=u;return h|0}a=c[u+372>>2]|0;if(!(c[a+32>>2]|0)){p=0.0;o=0.0;n=0.0;m=0.0;l=0.0;i=0.0}else{f=0;n=0.0;o=0.0;p=0.0;i=0.0;l=0.0;m=0.0;do{t=+g[a+16+(f<<2)>>2];d=c[u+384+120>>2]|0;k=c[u+384+124>>2]|0;e=(c[u+384>>2]|0)+(1?k>>1:k)|0;if(k&1)d=c[(c[e>>2]|0)+d>>2]|0;Za[d&127](u+528|0,e,c[a+(f<<2)>>2]|0);n=n+t*+g[u+528>>2];o=o+t*+g[u+528+4>>2];p=p+t*+g[u+528+8>>2];a=c[(c[u+372>>2]|0)+(f<<2)>>2]|0;q=-+g[a>>2];r=-+g[a+4>>2];s=-+g[a+8>>2];a=c[u+384+120>>2]|0;k=c[u+384+124>>2]|0;d=(c[u+384+4>>2]|0)+(1?k>>1:k)|0;if(k&1)a=c[(c[d>>2]|0)+a>>2]|0;H=+g[u+384+24>>2]*q+ +g[u+384+28>>2]*r+ +g[u+384+32>>2]*s;G=+g[u+384+40>>2]*q+ +g[u+384+44>>2]*r+ +g[u+384+48>>2]*s;g[u+512>>2]=+g[u+384+8>>2]*q+ +g[u+384+12>>2]*r+ +g[u+384+16>>2]*s;g[u+512+4>>2]=H;g[u+512+8>>2]=G;g[u+512+12>>2]=0.0;Za[a&127](u+528|0,d,u+512|0);G=+g[u+528>>2];H=+g[u+528+4>>2];I=+g[u+528+8>>2];i=i+t*(G*+g[u+384+56>>2]+H*+g[u+384+60>>2]+I*+g[u+384+64>>2]+ +g[u+384+104>>2]);l=l+t*(G*+g[u+384+72>>2]+H*+g[u+384+76>>2]+I*+g[u+384+80>>2]+ +g[u+384+108>>2]);m=m+t*(G*+g[u+384+88>>2]+H*+g[u+384+92>>2]+I*+g[u+384+96>>2]+ +g[u+384+112>>2]);f=f+1|0;a=c[u+372>>2]|0}while(f>>>0<(c[a+32>>2]|0)>>>0)}F=n*+g[b+16>>2]+o*+g[b+20>>2]+p*+g[b+24>>2]+ +g[b+52>>2];G=n*+g[b+32>>2]+o*+g[b+36>>2]+p*+g[b+40>>2]+ +g[b+56>>2];g[h+4>>2]=n*+g[b>>2]+o*+g[b+4>>2]+p*+g[b+8>>2]+ +g[b+48>>2];g[h+8>>2]=F;g[h+12>>2]=G;g[h+16>>2]=0.0;G=i*+g[b+16>>2]+l*+g[b+20>>2]+m*+g[b+24>>2]+ +g[b+52>>2];F=i*+g[b+32>>2]+l*+g[b+36>>2]+m*+g[b+40>>2]+ +g[b+56>>2];g[h+20>>2]=i*+g[b>>2]+l*+g[b+4>>2]+m*+g[b+8>>2]+ +g[b+48>>2];g[h+24>>2]=G;g[h+28>>2]=F;g[h+32>>2]=0.0;F=n-i;G=o-l;H=p-m;g[h+48>>2]=0.0;I=+x(+(F*F+G*G+H*H));g[h+52>>2]=I;I=I>9.999999747378752e-05?1.0/I:1.0;g[h+36>>2]=F*I;g[h+40>>2]=G*I;g[h+44>>2]=H*I;h=1;sa=u;return h|0}function Sc(a,b,d,e,f,h){a=a|0;b=+b;d=+d;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0;p=sa;sa=sa+704|0;o=IH(f)|0;l=+g[o>>2];m=+g[o+4>>2];n=+g[o+8>>2];g[p+680>>2]=0.0;g[p+676>>2]=0.0;g[p+672>>2]=0.0;ns(p+688|0,p+680|0,p+676|0,p+672|0);g[(JI(p+688|0)|0)+(e<<2)>>2]=d*.5;g[p+648>>2]=0.0;g[p+644>>2]=0.0;g[p+640>>2]=0.0;ns(p+656|0,p+648|0,p+644|0,p+640|0);g[(JI(p+656|0)|0)+(((e+1|0)%3|0)<<2)>>2]=b;g[p+616>>2]=0.0;g[p+612>>2]=0.0;g[p+608>>2]=0.0;ns(p+624|0,p+616|0,p+612|0,p+608|0);g[(JI(p+624|0)|0)+(((e+2|0)%3|0)<<2)>>2]=b;g[p+584>>2]=0.0;g[p+580>>2]=0.0;g[p+576>>2]=0.0;ns(p+592|0,p+584|0,p+580|0,p+576|0);o=JI(p+592|0)|0;g[o+(e<<2)>>2]=-(d*.5);j=p+688+4|0;k=p+688+8|0;i=0;while(1){if(i>>>0>=360)break;d=+(i|0)*.01745329238474369;g[o+(((e+1|0)%3|0)<<2)>>2]=+yI(d)*b;g[o+(((e+2|0)%3|0)<<2)>>2]=+zI(d)*b;q=c[(c[a>>2]|0)+8>>2]|0;r=JI(f)|0;vl(p+544|0,r,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+560|0,l,m,n,+g[p+544>>2],+g[p+544+4>>2],+g[p+544+8>>2]);vl(p+512|0,r,+g[p+592>>2],+g[p+592+4>>2],+g[p+592+8>>2]);qp(p+528|0,l,m,n,+g[p+512>>2],+g[p+512+4>>2],+g[p+512+8>>2]);ab[q&127](a,p+560|0,p+528|0,h);i=i+30|0}r=c[(c[a>>2]|0)+8>>2]|0;q=JI(f)|0;vl(p+480|0,q,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+496|0,l,m,n,+g[p+480>>2],+g[p+480+4>>2],+g[p+480+8>>2]);Lq(p+416|0,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+432|0,+g[p+416>>2],+g[p+416+4>>2],+g[p+416+8>>2],+g[p+656>>2],+g[p+656+4>>2],+g[p+656+8>>2]);vl(p+448|0,q,+g[p+432>>2],+g[p+432+4>>2],+g[p+432+8>>2]);qp(p+464|0,l,m,n,+g[p+448>>2],+g[p+448+4>>2],+g[p+448+8>>2]);ab[r&127](a,p+496|0,p+464|0,h);r=c[(c[a>>2]|0)+8>>2]|0;vl(p+384|0,q,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+400|0,l,m,n,+g[p+384>>2],+g[p+384+4>>2],+g[p+384+8>>2]);Lq(p+320|0,+g[p+688>>2],+g[j>>2],+g[k>>2]);sp(p+336|0,+g[p+320>>2],+g[p+320+4>>2],+g[p+320+8>>2],+g[p+656>>2],+g[p+656+4>>2],+g[p+656+8>>2]);vl(p+352|0,q,+g[p+336>>2],+g[p+336+4>>2],+g[p+336+8>>2]);qp(p+368|0,l,m,n,+g[p+352>>2],+g[p+352+4>>2],+g[p+352+8>>2]);ab[r&127](a,p+400|0,p+368|0,h);r=c[(c[a>>2]|0)+8>>2]|0;vl(p+288|0,q,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+304|0,l,m,n,+g[p+288>>2],+g[p+288+4>>2],+g[p+288+8>>2]);Lq(p+224|0,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+240|0,+g[p+224>>2],+g[p+224+4>>2],+g[p+224+8>>2],+g[p+624>>2],+g[p+624+4>>2],+g[p+624+8>>2]);vl(p+256|0,q,+g[p+240>>2],+g[p+240+4>>2],+g[p+240+8>>2]);qp(p+272|0,l,m,n,+g[p+256>>2],+g[p+256+4>>2],+g[p+256+8>>2]);ab[r&127](a,p+304|0,p+272|0,h);r=c[(c[a>>2]|0)+8>>2]|0;vl(p+192|0,q,+g[p+688>>2],+g[j>>2],+g[k>>2]);qp(p+208|0,l,m,n,+g[p+192>>2],+g[p+192+4>>2],+g[p+192+8>>2]);Lq(p+128|0,+g[p+688>>2],+g[j>>2],+g[k>>2]);sp(p+144|0,+g[p+128>>2],+g[p+128+4>>2],+g[p+128+8>>2],+g[p+624>>2],+g[p+624+4>>2],+g[p+624+8>>2]);vl(p+160|0,q,+g[p+144>>2],+g[p+144+4>>2],+g[p+144+8>>2]);qp(p+176|0,l,m,n,+g[p+160>>2],+g[p+160+4>>2],+g[p+160+8>>2]);ab[r&127](a,p+208|0,p+176|0,h);g[p+104>>2]=0.0;g[p+100>>2]=0.0;g[p+96>>2]=0.0;ns(p+112|0,p+104|0,p+100|0,p+96|0);g[(JI(p+112|0)|0)+(e<<2)>>2]=1.0;g[p+72>>2]=0.0;g[p+68>>2]=0.0;g[p+64>>2]=0.0;ns(p+80|0,p+72|0,p+68|0,p+64|0);g[(JI(p+80|0)|0)+(((e+1|0)%3|0)<<2)>>2]=1.0;r=c[(c[a>>2]|0)+60>>2]|0;vl(p+32|0,q,+g[p+688>>2],+g[j>>2],+g[k>>2]);sp(p+48|0,l,m,n,+g[p+32>>2],+g[p+32+4>>2],+g[p+32+8>>2]);vl(p+16|0,q,+g[p+112>>2],+g[p+112+4>>2],+g[p+112+8>>2]);vl(p,q,+g[p+80>>2],+g[p+80+4>>2],+g[p+80+8>>2]);db[r&1](a,p+48|0,p+16|0,p,b,b,0.0,6.2831854820251465,h,0,10.0);sa=p;return}function Tc(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;var i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0;i=sa;sa=sa+464|0;Ki(20054);c[i+128>>2]=c[d>>2];c[i+128+4>>2]=c[d+4>>2];c[i+128+8>>2]=c[d+8>>2];c[i+128+12>>2]=c[d+12>>2];c[i+128+16>>2]=c[d+16>>2];c[i+128+16+4>>2]=c[d+16+4>>2];c[i+128+16+8>>2]=c[d+16+8>>2];c[i+128+16+12>>2]=c[d+16+12>>2];c[i+128+32>>2]=c[d+32>>2];c[i+128+32+4>>2]=c[d+32+4>>2];c[i+128+32+8>>2]=c[d+32+8>>2];c[i+128+32+12>>2]=c[d+32+12>>2];k=i+128+48|0;c[k>>2]=c[d+48>>2];c[k+4>>2]=c[d+48+4>>2];c[k+8>>2]=c[d+48+8>>2];c[k+12>>2]=c[d+48+12>>2];c[i+64>>2]=c[e>>2];c[i+64+4>>2]=c[e+4>>2];c[i+64+8>>2]=c[e+8>>2];c[i+64+12>>2]=c[e+12>>2];c[i+64+16>>2]=c[e+16>>2];c[i+64+16+4>>2]=c[e+16+4>>2];c[i+64+16+8>>2]=c[e+16+8>>2];c[i+64+16+12>>2]=c[e+16+12>>2];c[i+64+32>>2]=c[e+32>>2];c[i+64+32+4>>2]=c[e+32+4>>2];c[i+64+32+8>>2]=c[e+32+8>>2];c[i+64+32+12>>2]=c[e+32+12>>2];j=i+64+48|0;c[j>>2]=c[e+48>>2];c[j+4>>2]=c[e+48+4>>2];c[j+8>>2]=c[e+48+8>>2];c[j+12>>2]=c[e+48+12>>2];Se(i+128|0,i+64|0,i+256|0,i+192|0);s=+g[i+192>>2];l=s*+g[i+256+4>>2];q=s*+g[i+256+8>>2];g[i+16>>2]=+g[i+256>>2]*s;g[i+16+4>>2]=l;g[i+16+8>>2]=q;g[i+16+12>>2]=0.0;c[i+256>>2]=0;c[i+256+4>>2]=0;c[i+256+8>>2]=0;c[i+256+12>>2]=0;c[i+192+48>>2]=0;c[i+192+48+4>>2]=0;c[i+192+48+8>>2]=0;c[i+192+48+12>>2]=0;Og(i+128|0,i);q=+g[i>>2];l=+g[i+4>>2];s=+g[i+8>>2];p=+g[i+12>>2];n=q*(2.0/(q*q+l*l+s*s+p*p));m=l*(2.0/(q*q+l*l+s*s+p*p));o=s*(2.0/(q*q+l*l+s*s+p*p));g[i+192>>2]=1.0-(l*m+s*o);g[i+192+4>>2]=q*m-p*o;g[i+192+8>>2]=q*o+p*m;g[i+192+12>>2]=0.0;g[i+192+16>>2]=q*m+p*o;g[i+192+20>>2]=1.0-(q*n+s*o);g[i+192+24>>2]=l*o-p*n;g[i+192+28>>2]=0.0;g[i+192+32>>2]=q*o-p*m;g[i+192+36>>2]=l*o+p*n;g[i+192+40>>2]=1.0-(q*n+l*m);g[i+192+44>>2]=0.0;zg(b,i+192|0,i+256|0,i+16|0,i+48|0,i+32|0);c[i+256>>2]=8744;c[i+256+36>>2]=c[d>>2];c[i+256+36+4>>2]=c[d+4>>2];c[i+256+36+8>>2]=c[d+8>>2];c[i+256+36+12>>2]=c[d+12>>2];c[i+256+52>>2]=c[d+16>>2];c[i+256+52+4>>2]=c[d+16+4>>2];c[i+256+52+8>>2]=c[d+16+8>>2];c[i+256+52+12>>2]=c[d+16+12>>2];c[i+256+68>>2]=c[d+32>>2];c[i+256+68+4>>2]=c[d+32+4>>2];c[i+256+68+8>>2]=c[d+32+8>>2];c[i+256+68+12>>2]=c[d+32+12>>2];r=i+256+84|0;c[r>>2]=c[d+48>>2];c[r+4>>2]=c[d+48+4>>2];c[r+8>>2]=c[d+48+8>>2];c[r+12>>2]=c[d+48+12>>2];c[i+256+100>>2]=c[e>>2];c[i+256+100+4>>2]=c[e+4>>2];c[i+256+100+8>>2]=c[e+8>>2];c[i+256+100+12>>2]=c[e+12>>2];c[i+256+116>>2]=c[e+16>>2];c[i+256+116+4>>2]=c[e+16+4>>2];c[i+256+116+8>>2]=c[e+16+8>>2];c[i+256+116+12>>2]=c[e+16+12>>2];c[i+256+132>>2]=c[e+32>>2];c[i+256+132+4>>2]=c[e+32+4>>2];c[i+256+132+8>>2]=c[e+32+8>>2];c[i+256+132+12>>2]=c[e+32+12>>2];d=i+256+148|0;c[d>>2]=c[e+48>>2];c[d+4>>2]=c[e+48+4>>2];c[d+8>>2]=c[e+48+8>>2];c[d+12>>2]=c[e+48+12>>2];c[i+256+180>>2]=a;c[i+256+184>>2]=f;g[i+256+188>>2]=h;c[i+256+192>>2]=b;m=+g[d>>2]-+g[r>>2];l=+g[i+256+152>>2]-+g[i+256+88>>2];n=+g[i+256+156>>2]-+g[i+256+92>>2];h=1.0/+x(+(m*m+l*l+n*n));q=m*h==0.0?999999984306749440.0:1.0/(m*h);g[i+256+4>>2]=q;p=l*h==0.0?999999984306749440.0:1.0/(l*h);g[i+256+8>>2]=p;o=n*h==0.0?999999984306749440.0:1.0/(n*h);g[i+256+12>>2]=o;c[i+256+20>>2]=q<0.0&1;c[i+256+24>>2]=p<0.0&1;c[i+256+28>>2]=o<0.0&1;g[i+256+32>>2]=n*n*h+(m*m*h+l*l*h);a=c[a+68>>2]|0;gb[c[(c[a>>2]|0)+24>>2]&7](a,k,j,i+256|0,i+48|0,i+32|0);a=c[3084]|0;f=(c[a+16>>2]|0)+-1|0;c[a+16>>2]=f;if(f|0){sa=i;return}do if(c[a+4>>2]|0){la(i+256|0,0)|0;r=c[7181]|0;g[a+8>>2]=+g[a+8>>2]+ +(((c[i+256+4>>2]|0)-(c[r+4>>2]|0)+(((c[i+256>>2]|0)-(c[r>>2]|0)|0)*1e6|0)-(c[a+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[a+16>>2]|0)){a=c[3084]|0;break}else{sa=i;return}}while(0);c[3084]=c[a+20>>2];sa=i;return}function Uc(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;s=sa;sa=sa+32|0;g=Fa[c[(c[d>>2]|0)+28>>2]&127](d)|0;c[e+20>>2]=g;c[e>>2]=0;if(!g){r=d+4|0;f=e+4|0;r=c[r>>2]|0;c[f>>2]=r;f=d+8|0;f=c[f>>2]|0;r=e+8|0;c[r>>2]=f;r=d+12|0;r=c[r>>2]|0;f=e+12|0;c[f>>2]=r;d=d+16|0;d=c[d>>2]|0;f=e+16|0;c[f>>2]=d;sa=s;return 23679}r=Ja[c[(c[f>>2]|0)+16>>2]&63](f,32,g)|0;g=c[r+8>>2]|0;c[e>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,g)|0;q=Fa[c[(c[d>>2]|0)+28>>2]&127](d)|0;a:do if((q|0)>0){p=0;while(1){kb[c[(c[d>>2]|0)+16>>2]&3](d,s+28|0,s+4|0,s+16|0,s+8|0,s+24|0,s+20|0,s,s+12|0,p);i=c[s>>2]|0;c[g+24>>2]=i;c[g+28>>2]=c[s+4>>2];j=g+12|0;l=g+16|0;o=g+4|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;switch(c[s+12>>2]|0){case 2:{if(i|0){j=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,i*3|0)|0;k=c[j+8>>2]|0;c[g+8>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,k)|0;if((c[s>>2]|0)>0){l=c[s+24>>2]|0;i=0;do{m=l+(J(c[s+20>>2]|0,i)|0)|0;n=i*3|0;c[k+(n<<2)>>2]=c[m>>2];c[k+(n+1<<2)>>2]=c[m+4>>2];c[k+(n+2<<2)>>2]=c[m+8>>2];i=i+1|0}while((i|0)<(c[s>>2]|0))}eb[c[(c[f>>2]|0)+20>>2]&31](f,j,23560,1497453121,c[j+8>>2]|0)}break}case 3:{if(i|0){m=Ja[c[(c[f>>2]|0)+16>>2]&63](f,8,i)|0;n=c[m+8>>2]|0;c[j>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,n)|0;j=c[s>>2]|0;if((j|0)>0){k=c[s+24>>2]|0;l=c[s+20>>2]|0;i=0;do{t=k+(J(l,i)|0)|0;b[n+(i<<3)>>1]=b[t>>1]|0;b[n+(i<<3)+2>>1]=b[t+2>>1]|0;b[n+(i<<3)+4>>1]=b[t+4>>1]|0;i=i+1|0}while((i|0)!=(j|0))}eb[c[(c[f>>2]|0)+20>>2]&31](f,m,23575,1497453121,c[m+8>>2]|0)}break}case 5:{if(i|0){j=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,i)|0;k=c[j+8>>2]|0;c[l>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,k)|0;if((c[s>>2]|0)>0){i=0;do{t=(c[s+24>>2]|0)+(J(c[s+20>>2]|0,i)|0)|0;a[k+(i<<2)>>0]=a[t>>0]|0;a[k+(i<<2)+1>>0]=a[t+1>>0]|0;a[k+(i<<2)+2>>0]=a[t+2>>0]|0;i=i+1|0}while((i|0)<(c[s>>2]|0))}eb[c[(c[f>>2]|0)+20>>2]&31](f,j,23602,1497453121,c[j+8>>2]|0)}break}default:{}}switch(c[s+16>>2]|0){case 0:{i=c[s+4>>2]|0;if(i|0){j=Ja[c[(c[f>>2]|0)+16>>2]&63](f,16,i)|0;k=c[j+8>>2]|0;c[g>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,k)|0;l=c[s+4>>2]|0;if((l|0)>0){m=c[s+28>>2]|0;n=c[s+8>>2]|0;i=0;do{t=m+(J(n,i)|0)|0;c[k+(i<<4)>>2]=c[t>>2];c[k+(i<<4)+4>>2]=c[t+4>>2];c[k+(i<<4)+8>>2]=c[t+8>>2];i=i+1|0}while((i|0)!=(l|0))}eb[c[(c[f>>2]|0)+20>>2]&31](f,j,23625,1497453121,c[j+8>>2]|0)}break}case 1:{i=c[s+4>>2]|0;if(i|0){m=Ja[c[(c[f>>2]|0)+16>>2]&63](f,32,i)|0;n=c[m+8>>2]|0;c[o>>2]=Ha[c[(c[f>>2]|0)+28>>2]&31](f,n)|0;j=c[s+4>>2]|0;if((j|0)>0){k=c[s+28>>2]|0;l=c[s+8>>2]|0;i=0;do{t=k+(J(l,i)|0)|0;h[n+(i<<5)>>3]=+h[t>>3];h[n+(i<<5)+8>>3]=+h[t+8>>3];h[n+(i<<5)+16>>3]=+h[t+16>>3];i=i+1|0}while((i|0)!=(j|0))}eb[c[(c[f>>2]|0)+20>>2]&31](f,m,23644,1497453121,c[m+8>>2]|0)}break}default:{}}Va[c[(c[d>>2]|0)+24>>2]&127](d,p);p=p+1|0;if((p|0)==(q|0)){g=f;break a}else g=g+32|0}}else g=f;while(0);eb[c[(c[g>>2]|0)+20>>2]&31](f,r,23664,1497453121,c[r+8>>2]|0);t=d+4|0;f=e+4|0;t=c[t>>2]|0;c[f>>2]=t;f=d+8|0;f=c[f>>2]|0;t=e+8|0;c[t>>2]=f;t=d+12|0;t=c[t>>2]|0;f=e+12|0;c[f>>2]=t;f=d+16|0;f=c[f>>2]|0;t=e+16|0;c[t>>2]=f;sa=s;return 23679}function Vc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0;o=c[a+192>>2]|0;n=+va[c[(c[o>>2]|0)+48>>2]&15](o);o=c[a+712>>2]|0;if((o|0)>0){i=0;do{m=c[a+720>>2]|0;f=m+(i*104|0)+8|0;q=+g[f>>2];h=m+(i*104|0)+12|0;p=+g[h>>2];d=m+(i*104|0)+16|0;l=+g[d>>2];j=q*+g[b>>2]+p*+g[b+4>>2]+l*+g[b+8>>2]+ +g[b+48>>2];k=q*+g[b+16>>2]+p*+g[b+20>>2]+l*+g[b+24>>2]+ +g[b+52>>2];l=q*+g[b+32>>2]+p*+g[b+36>>2]+l*+g[b+40>>2]+ +g[b+56>>2];g[f>>2]=j;g[h>>2]=k;g[d>>2]=l;g[m+(i*104|0)+20>>2]=0.0;d=m+(i*104|0)+24|0;p=+g[d>>2];h=m+(i*104|0)+28|0;q=+g[h>>2];f=m+(i*104|0)+32|0;r=+g[f>>2];s=p*+g[b+16>>2]+q*+g[b+20>>2]+r*+g[b+24>>2]+ +g[b+52>>2];t=p*+g[b+32>>2]+q*+g[b+36>>2]+r*+g[b+40>>2]+ +g[b+56>>2];g[d>>2]=p*+g[b>>2]+q*+g[b+4>>2]+r*+g[b+8>>2]+ +g[b+48>>2];g[h>>2]=s;g[f>>2]=t;g[m+(i*104|0)+36>>2]=0.0;f=m+(i*104|0)+72|0;t=+g[f>>2];h=m+(i*104|0)+76|0;s=+g[h>>2];d=m+(i*104|0)+80|0;r=+g[d>>2];q=t*+g[b+16>>2]+s*+g[b+20>>2]+r*+g[b+24>>2];p=t*+g[b+32>>2]+s*+g[b+36>>2]+r*+g[b+40>>2];g[f>>2]=+g[b>>2]*t+ +g[b+4>>2]*s+ +g[b+8>>2]*r;g[h>>2]=q;g[d>>2]=p;g[m+(i*104|0)+84>>2]=0.0;m=c[m+(i*104|0)+96>>2]|0;d=sg(a+928|0,m)|0;a:do if(d){h=c[a+936>>2]|0;if((h|0)<=-1){d=c[a+928>>2]|0;break}if(h){e=0;while(1){f=c[d+32>>2]|0;e=e+1|0;if(!f)break a;if((e|0)>=(h|0)){d=f;break}else d=f}}}else d=0;while(0);g[m>>2]=j-n;g[m+4>>2]=k-n;g[m+8>>2]=l-n;g[m+12>>2]=0.0;g[m+16>>2]=n+j;g[m+20>>2]=n+k;g[m+24>>2]=n+l;g[m+28>>2]=0.0;ue(a+928|0,d,m);i=i+1|0}while((i|0)!=(o|0))}Nf(a);d=c[a+928>>2]|0;if(d){o=c[a+192>>2]|0;r=+va[c[(c[o>>2]|0)+48>>2]&15](o);t=+g[d+4>>2]-r;s=+g[d+8>>2]-r;g[a+892>>2]=+g[d>>2]-r;g[a+896>>2]=t;g[a+900>>2]=s;g[a+904>>2]=0.0;s=r+ +g[d+20>>2];t=r+ +g[d+24>>2];g[a+908>>2]=r+ +g[d+16>>2];g[a+912>>2]=s;g[a+916>>2]=t;g[a+920>>2]=0.0;d=c[a+188>>2]|0;if(d|0){o=c[a+684>>2]|0;m=c[o+32>>2]|0;eb[c[(c[m>>2]|0)+16>>2]&31](m,d,a+892|0,a+908|0,c[o+36>>2]|0)}}else{c[a+892>>2]=0;c[a+892+4>>2]=0;c[a+892+8>>2]=0;c[a+892+12>>2]=0;c[a+892+16>>2]=0;c[a+892+20>>2]=0;c[a+892+24>>2]=0;c[a+892+28>>2]=0}e=c[a+732>>2]|0;if((e|0)<=0){cf(a);o=a+1148|0;c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];o=b+16|0;m=a+1164|0;c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];m=b+32|0;o=a+1180|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];o=b+48|0;b=a+1196|0;c[b>>2]=c[o>>2];c[b+4>>2]=c[o+4>>2];c[b+8>>2]=c[o+8>>2];c[b+12>>2]=c[o+12>>2];return}f=c[a+740>>2]|0;d=0;do{m=c[f+(d*52|0)+8>>2]|0;o=c[f+(d*52|0)+12>>2]|0;r=+g[m+8>>2]-+g[o+8>>2];s=+g[m+12>>2]-+g[o+12>>2];t=+g[m+16>>2]-+g[o+16>>2];t=+x(+(r*r+s*s+t*t));g[f+(d*52|0)+16>>2]=t;g[f+(d*52|0)+28>>2]=t*t;d=d+1|0}while((d|0)!=(e|0));d=0;do{g[f+(d*52|0)+24>>2]=(+g[(c[f+(d*52|0)+8>>2]|0)+88>>2]+ +g[(c[f+(d*52|0)+12>>2]|0)+88>>2])/+g[(c[f+(d*52|0)+4>>2]|0)+4>>2];d=d+1|0}while((d|0)!=(e|0));cf(a);o=a+1148|0;c[o>>2]=c[b>>2];c[o+4>>2]=c[b+4>>2];c[o+8>>2]=c[b+8>>2];c[o+12>>2]=c[b+12>>2];o=b+16|0;m=a+1164|0;c[m>>2]=c[o>>2];c[m+4>>2]=c[o+4>>2];c[m+8>>2]=c[o+8>>2];c[m+12>>2]=c[o+12>>2];m=b+32|0;o=a+1180|0;c[o>>2]=c[m>>2];c[o+4>>2]=c[m+4>>2];c[o+8>>2]=c[m+8>>2];c[o+12>>2]=c[m+12>>2];o=b+48|0;b=a+1196|0;c[b>>2]=c[o>>2];c[b+4>>2]=c[o+4>>2];c[b+8>>2]=c[o+8>>2];c[b+12>>2]=c[o+12>>2];return}function Wc(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,y=0.0,z=0.0,A=0.0,B=0;w=sa;sa=sa+64|0;if((h|0)>0){b=0;j=0;do{v=c[f+(j<<2)>>2]|0;b=(v|0)>(b|0)?v:b;j=j+1|0}while((j|0)<(h*3|0))}else b=0;s=b+1|0;k=J(s,s)|0;if(!k)j=0;else{c[7182]=(c[7182]|0)+1;j=xb(k+19|0)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}mk(j|0,0,k|0)|0}if((b|0)>-1){c[7182]=(c[7182]|0)+1;b=xb((s<<4|3)+16|0)|0;if(!b)l=0;else{c[(b+4+15&-16)+-4>>2]=b;l=b+4+15&-16}b=0;do{v=l+(b<<4)|0;c[v>>2]=c[w>>2];c[v+4>>2]=c[w+4>>2];c[v+8>>2]=c[w+8>>2];c[v+12>>2]=c[w+12>>2];b=b+1|0}while((b|0)!=(s|0));b=0;k=0;while(1){u=c[e+(k+1<<2)>>2]|0;v=c[e+(k+2<<2)>>2]|0;c[l+(b<<4)>>2]=c[e+(k<<2)>>2];c[l+(b<<4)+4>>2]=u;c[l+(b<<4)+8>>2]=v;g[l+(b<<4)+12>>2]=0.0;k=k+3|0;if((k|0)>=(s*3|0)){v=l;u=l;break}else b=b+1|0}}else{v=0;u=0}c[7182]=(c[7182]|0)+1;b=xb(1271)|0;if(!b)t=0;else{c[(b+4+15&-16)+-4>>2]=b;t=b+4+15&-16}Hb(t,d,s,v,0);if((h|0)>0){d=t+720|0;m=t+732|0;n=t+740|0;o=t+924|0;e=0;do{p=c[f+(e<<2)>>2]|0;q=c[f+(e+1<<2)>>2]|0;r=c[f+(e+2<<2)>>2]|0;l=J(p,s)|0;b=j+(l+r)|0;if(!(a[b>>0]|0)){a[b>>0]=1;a[j+((J(r,s)|0)+p)>>0]=1;B=c[d>>2]|0;oh(t,0);k=(c[m>>2]|0)+-1|0;b=c[n>>2]|0;c[b+(k*52|0)+8>>2]=B+(r*104|0);c[b+(k*52|0)+12>>2]=B+(p*104|0);A=+g[B+(r*104|0)+8>>2]-+g[B+(p*104|0)+8>>2];z=+g[B+(r*104|0)+12>>2]-+g[B+(p*104|0)+12>>2];y=+g[B+(r*104|0)+16>>2]-+g[B+(p*104|0)+16>>2];g[b+(k*52|0)+16>>2]=+x(+(A*A+z*z+y*y));a[o>>0]=1}k=J(q,s)|0;b=j+(k+p)|0;if(!(a[b>>0]|0)){a[b>>0]=1;a[j+(l+q)>>0]=1;b=c[d>>2]|0;oh(t,0);B=(c[m>>2]|0)+-1|0;l=c[n>>2]|0;c[l+(B*52|0)+8>>2]=b+(p*104|0);c[l+(B*52|0)+12>>2]=b+(q*104|0);y=+g[b+(p*104|0)+8>>2]-+g[b+(q*104|0)+8>>2];z=+g[b+(p*104|0)+12>>2]-+g[b+(q*104|0)+12>>2];A=+g[b+(p*104|0)+16>>2]-+g[b+(q*104|0)+16>>2];g[l+(B*52|0)+16>>2]=+x(+(y*y+z*z+A*A));a[o>>0]=1}b=j+((J(r,s)|0)+q)|0;if(!(a[b>>0]|0)){a[b>>0]=1;a[j+(k+r)>>0]=1;k=c[d>>2]|0;oh(t,0);B=(c[m>>2]|0)+-1|0;l=c[n>>2]|0;c[l+(B*52|0)+8>>2]=k+(q*104|0);c[l+(B*52|0)+12>>2]=k+(r*104|0);y=+g[k+(q*104|0)+8>>2]-+g[k+(r*104|0)+8>>2];z=+g[k+(q*104|0)+12>>2]-+g[k+(r*104|0)+12>>2];A=+g[k+(q*104|0)+16>>2]-+g[k+(r*104|0)+16>>2];g[l+(B*52|0)+16>>2]=+x(+(y*y+z*z+A*A));a[o>>0]=1}mf(t,p,q,r,0);e=e+3|0}while((e|0)<(h*3|0))}if(i){l=c[t+732>>2]|0;if((l|0)>0){e=t+740|0;b=243703;k=0;do{d=c[e>>2]|0;m=d+(k*52|0)|0;b=(J(b,1664525)|0)+1013904223|0;n=w;o=m;p=n+52|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));n=m;o=d+(((b>>>0)%(l>>>0)|0)*52|0)|0;p=n+52|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));n=d+(((b>>>0)%(l>>>0)|0)*52|0)|0;o=w;p=n+52|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));k=k+1|0}while((k|0)!=(l|0))}else b=243703;d=c[t+752>>2]|0;if((d|0)>0){m=t+760|0;k=0;do{e=c[m>>2]|0;l=e+(k*44|0)|0;b=(J(b,1664525)|0)+1013904223|0;e=e+(((b>>>0)%(d>>>0)|0)*44|0)|0;n=w;o=l;p=n+44|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));n=l;o=e;p=n+44|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));n=e;o=w;p=n+44|0;do{c[n>>2]=c[o>>2];n=n+4|0;o=o+4|0}while((n|0)<(p|0));k=k+1|0}while((k|0)!=(d|0))}}if(!((v|0)==0|(u|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[u+-4>>2]|0)}if(!j){sa=w;return t|0}c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);sa=w;return t|0}function Xc(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0;i=sa;sa=sa+256|0;e=c[b+212>>2]|0;if((e|0)>-1){b=e;sa=i;return b|0}h=(c[b+236>>2]&2|0)==0;e=h?0:b;do if(!h){if(!(+g[e+344>>2]!=0.0)?(c[e+204>>2]&2|0)==0:0)break;h=c[a+8>>2]|0;mk(i|0,0,244)|0;a=Pe(a+4|0,i)|0;f=(c[b+236>>2]&2|0)==0;e=f?0:b;c[a+64>>2]=0;c[a+64+4>>2]=0;c[a+64+8>>2]=0;c[a+64+12>>2]=0;c[a+64+16>>2]=0;c[a+64+20>>2]=0;c[a+64+24>>2]=0;c[a+64+28>>2]=0;c[a+144>>2]=0;c[a+144+4>>2]=0;c[a+144+8>>2]=0;c[a+144+12>>2]=0;c[a+144+16>>2]=0;c[a+144+20>>2]=0;c[a+144+24>>2]=0;c[a+144+28>>2]=0;if(f){c[a>>2]=1065353216;c[a+4>>2]=0;c[a+4+4>>2]=0;c[a+4+8>>2]=0;c[a+4+12>>2]=0;c[a+20>>2]=1065353216;c[a+24>>2]=0;c[a+24+4>>2]=0;c[a+24+8>>2]=0;c[a+24+12>>2]=0;c[a+40>>2]=1065353216;c[a+44>>2]=0;c[a+44+4>>2]=0;c[a+44+8>>2]=0;c[a+44+12>>2]=0;c[a+44+16>>2]=0;c[a+240>>2]=0;c[a+128>>2]=0;c[a+128+4>>2]=0;c[a+128+8>>2]=0;c[a+128+12>>2]=0;c[a+96>>2]=1065353216;c[a+100>>2]=1065353216;c[a+104>>2]=1065353216;g[a+108>>2]=0.0;c[a+112>>2]=1065353216;c[a+116>>2]=1065353216;c[a+120>>2]=1065353216;g[a+124>>2]=0.0;e=a+176|0;f=e+60|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0))}else{c[a>>2]=c[e+4>>2];c[a+4>>2]=c[e+4+4>>2];c[a+8>>2]=c[e+4+8>>2];c[a+12>>2]=c[e+4+12>>2];c[a+16>>2]=c[e+20>>2];c[a+16+4>>2]=c[e+20+4>>2];c[a+16+8>>2]=c[e+20+8>>2];c[a+16+12>>2]=c[e+20+12>>2];c[a+32>>2]=c[e+36>>2];c[a+32+4>>2]=c[e+36+4>>2];c[a+32+8>>2]=c[e+36+8>>2];c[a+32+12>>2]=c[e+36+12>>2];c[a+48>>2]=c[e+52>>2];c[a+48+4>>2]=c[e+52+4>>2];c[a+48+8>>2]=c[e+52+8>>2];c[a+48+12>>2]=c[e+52+12>>2];n=+g[e+344>>2];m=n*+g[e+352>>2];l=n*+g[e+356>>2];g[a+128>>2]=n*+g[e+348>>2];g[a+132>>2]=m;g[a+136>>2]=l;g[a+140>>2]=0.0;c[a+240>>2]=e;c[a+96>>2]=c[e+544>>2];c[a+96+4>>2]=c[e+544+4>>2];c[a+96+8>>2]=c[e+544+8>>2];c[a+96+12>>2]=c[e+544+12>>2];c[a+112>>2]=c[e+348>>2];c[a+112+4>>2]=c[e+348+4>>2];c[a+112+8>>2]=c[e+348+8>>2];c[a+112+12>>2]=c[e+348+12>>2];c[a+176>>2]=c[e+312>>2];c[a+176+4>>2]=c[e+312+4>>2];c[a+176+8>>2]=c[e+312+8>>2];c[a+176+12>>2]=c[e+312+12>>2];c[a+192>>2]=c[e+328>>2];c[a+192+4>>2]=c[e+328+4>>2];c[a+192+8>>2]=c[e+328+8>>2];c[a+192+12>>2]=c[e+328+12>>2];l=+g[e+344>>2];m=l*+g[e+416>>2]*d;n=l*+g[e+420>>2]*d;g[a+208>>2]=l*+g[e+412>>2]*d;g[a+212>>2]=m;g[a+216>>2]=n;g[a+220>>2]=0.0;n=+g[e+428>>2];m=+g[e+432>>2];l=+g[e+436>>2];k=(n*+g[e+268>>2]+m*+g[e+284>>2]+l*+g[e+300>>2])*d;j=(n*+g[e+272>>2]+m*+g[e+288>>2]+l*+g[e+304>>2])*d;g[a+224>>2]=(+g[e+264>>2]*n+ +g[e+280>>2]*m+ +g[e+296>>2]*l)*d;g[a+228>>2]=k;g[a+232>>2]=j}g[a+236>>2]=0.0;c[b+212>>2]=h;b=h;sa=i;return b|0}while(0);e=c[a+188>>2]|0;if((e|0)>=0){b=e;sa=i;return b|0}c[a+188>>2]=c[a+8>>2];mk(i|0,0,244)|0;e=Pe(a+4|0,i)|0;c[e+64>>2]=0;c[e+64+4>>2]=0;c[e+64+8>>2]=0;c[e+64+12>>2]=0;c[e+64+16>>2]=0;c[e+64+20>>2]=0;c[e+64+24>>2]=0;c[e+64+28>>2]=0;c[e+144>>2]=0;c[e+144+4>>2]=0;c[e+144+8>>2]=0;c[e+144+12>>2]=0;c[e+144+16>>2]=0;c[e+144+20>>2]=0;c[e+144+24>>2]=0;c[e+144+28>>2]=0;c[e>>2]=1065353216;c[e+4>>2]=0;c[e+4+4>>2]=0;c[e+4+8>>2]=0;c[e+4+12>>2]=0;c[e+20>>2]=1065353216;c[e+24>>2]=0;c[e+24+4>>2]=0;c[e+24+8>>2]=0;c[e+24+12>>2]=0;c[e+40>>2]=1065353216;c[e+44>>2]=0;c[e+44+4>>2]=0;c[e+44+8>>2]=0;c[e+44+12>>2]=0;c[e+44+16>>2]=0;c[e+240>>2]=0;c[e+128>>2]=0;c[e+128+4>>2]=0;c[e+128+8>>2]=0;c[e+128+12>>2]=0;c[e+96>>2]=1065353216;c[e+100>>2]=1065353216;c[e+104>>2]=1065353216;g[e+108>>2]=0.0;c[e+112>>2]=1065353216;c[e+116>>2]=1065353216;c[e+120>>2]=1065353216;g[e+124>>2]=0.0;e=e+176|0;f=e+64|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));b=c[a+188>>2]|0;sa=i;return b|0}function Yc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0.0,r=0.0,s=0.0;if(a[b+165>>0]|0){h=c[b+88>>2]|0;a:do if((h|0)>0&e){f=c[b+96>>2]|0;k=+g[d>>2];l=+g[d+4>>2];m=+g[d+8>>2];n=+g[b+168>>2];e=0;while(1){s=+g[f+(e<<4)>>2]-k;r=+g[f+(e<<4)+4>>2]-l;q=+g[f+(e<<4)+8>>2]-m;if(s*s+r*r+q*q<=n)break;e=e+1|0;if((e|0)>=(h|0))break a}return e|0}while(0);p=(c[b+32>>2]|0)+12|0;c[p>>2]=(c[p>>2]|0)+1;if((h|0)==(c[b+92>>2]|0)?(i=(h|0)==0?1:h<<1,(h|0)<(i|0)):0){if(!i)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((i<<4|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+88>>2]|0}if((h|0)>0){f=0;do{p=e+(f<<4)|0;o=(c[b+96>>2]|0)+(f<<4)|0;c[p>>2]=c[o>>2];c[p+4>>2]=c[o+4>>2];c[p+8>>2]=c[o+8>>2];c[p+12>>2]=c[o+12>>2];f=f+1|0}while((f|0)!=(h|0))}f=c[b+96>>2]|0;if(f|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=e;c[b+92>>2]=i;e=c[b+88>>2]|0}else e=h;p=(c[b+96>>2]|0)+(e<<4)|0;c[p>>2]=c[d>>2];c[p+4>>2]=c[d+4>>2];c[p+8>>2]=c[d+8>>2];c[p+12>>2]=c[d+12>>2];d=c[b+88>>2]|0;c[b+88>>2]=d+1;c[(c[b+32>>2]|0)+16>>2]=c[b+96>>2];return d|0}j=c[b+108>>2]|0;b:do if((j|0)>0&e){f=c[b+116>>2]|0;k=+g[d>>2];l=+g[d+4>>2];m=+g[d+8>>2];n=+g[b+168>>2];e=0;while(1){q=+g[f+(e<<2)>>2]-k;r=+g[f+(e+1<<2)>>2]-l;s=+g[f+(e+2<<2)>>2]-m;h=e+3|0;if(q*q+r*r+s*s<=n)break;if((h|0)<(j|0))e=h;else break b}d=(e>>>0)/3|0;return d|0}while(0);e=c[b+112>>2]|0;if((j|0)==(e|0)){e=(j|0)==0?1:j<<1;if((j|0)<(e|0)){if(!e)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((e<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=c[b+108>>2]|0}i=c[b+116>>2]|0;if((j|0)<=0)if(!i){i=b+120|0;h=j}else p=36;else{h=0;do{c[f+(h<<2)>>2]=c[i+(h<<2)>>2];h=h+1|0}while((h|0)!=(j|0));p=36}if((p|0)==36){if(!(a[b+120>>0]|0))h=j;else{c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[b+108>>2]|0}c[b+116>>2]=0;i=b+120|0}a[i>>0]=1;c[b+116>>2]=f;c[b+112>>2]=e}else{h=j;e=j}}else h=j;j=c[b+116>>2]|0;c[j+(h<<2)>>2]=c[d>>2];f=h+1|0;c[b+108>>2]=f;if((f|0)==(e|0)){o=(e|0)==0?1:e<<1;if((e|0)<(o|0)){if(!o){i=0;h=j}else{c[7182]=(c[7182]|0)+1;e=xb((o<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}i=e;e=c[b+108>>2]|0;h=c[b+116>>2]|0}if((e|0)<=0)if(!h)f=b+120|0;else p=51;else{f=0;do{c[i+(f<<2)>>2]=c[h+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0));p=51}if((p|0)==51){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);e=c[b+108>>2]|0}c[b+116>>2]=0;f=b+120|0}a[f>>0]=1;c[b+116>>2]=i;c[b+112>>2]=o;f=e;e=o}else{i=j;f=e}}else i=j;c[i+(f<<2)>>2]=c[d+4>>2];f=f+1|0;c[b+108>>2]=f;if((f|0)==(e|0)){j=(e|0)==0?1:e<<1;if((e|0)<(j|0)){if(!j)h=0;else{c[7182]=(c[7182]|0)+1;e=xb((j<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=e;e=c[b+108>>2]|0;i=c[b+116>>2]|0}if((e|0)<=0)if(!i)f=b+120|0;else p=66;else{f=0;do{c[h+(f<<2)>>2]=c[i+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0));p=66}if((p|0)==66){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);e=c[b+108>>2]|0}c[b+116>>2]=0;f=b+120|0}a[f>>0]=1;c[b+116>>2]=h;c[b+112>>2]=j}else h=i}else{h=i;e=f}c[h+(e<<2)>>2]=c[d+8>>2];d=e+1|0;c[b+108>>2]=d;b=c[b+32>>2]|0;c[b+12>>2]=(c[b+12>>2]|0)+1;c[b+16>>2]=h;d=((d|0)/3|0)+-1|0;return d|0}function Zc(a,b){a=a|0;b=b|0;var d=0.0,e=0,f=0,h=0.0,i=0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,y=0.0,z=0.0,A=0.0,B=0.0,D=0.0,E=0.0,F=0.0,G=0.0;v=sa;sa=sa+64|0;i=c[a+28>>2]|0;l=c[a+32>>2]|0;k=c[b+8>>2]|0;g[k>>2]=1.0;f=c[b+24>>2]|0;g[k+(f+1<<2)>>2]=1.0;g[k+((f<<1)+2<<2)>>2]=1.0;t=+g[a+48>>2];u=+g[a+52>>2];j=+g[a+56>>2];d=+g[i+4>>2]*t+ +g[i+8>>2]*u+ +g[i+12>>2]*j;h=t*+g[i+20>>2]+u*+g[i+24>>2]+j*+g[i+28>>2];j=t*+g[i+36>>2]+u*+g[i+40>>2]+j*+g[i+44>>2];k=c[b+12>>2]|0;c[k>>2]=0;g[k+4>>2]=j;g[k+8>>2]=-h;g[k+12>>2]=0.0;g[k+(f<<2)>>2]=-j;c[k+(f<<2)+4>>2]=0;g[k+(f<<2)+8>>2]=d;g[k+(f<<2)+12>>2]=0.0;g[k+(f<<1<<2)>>2]=h;g[k+(f<<1<<2)+4>>2]=-d;c[k+(f<<1<<2)+8>>2]=0;g[k+(f<<1<<2)+12>>2]=0.0;e=c[b+16>>2]|0;if(e|0){g[e>>2]=-1.0;g[e+(f+1<<2)>>2]=-1.0;g[e+((f<<1)+2<<2)>>2]=-1.0}q=+g[a+64>>2];u=+g[a+68>>2];t=+g[a+72>>2];r=+g[l+4>>2]*q+ +g[l+8>>2]*u+ +g[l+12>>2]*t;s=q*+g[l+20>>2]+u*+g[l+24>>2]+t*+g[l+28>>2];t=q*+g[l+36>>2]+u*+g[l+40>>2]+t*+g[l+44>>2];e=c[b+20>>2]|0;c[e>>2]=0;g[e+4>>2]=-t;g[e+8>>2]=s;g[e+12>>2]=0.0;g[e+(f<<2)>>2]=t;c[e+(f<<2)+4>>2]=0;g[e+(f<<2)+8>>2]=-r;g[e+(f<<2)+12>>2]=0.0;g[e+(f<<1<<2)>>2]=-s;g[e+(f<<1<<2)+4>>2]=r;c[e+(f<<1<<2)+8>>2]=0;g[e+(f<<1<<2)+12>>2]=0.0;u=+g[b>>2]*+g[b+4>>2];s=u*(s+ +g[l+56>>2]-h-+g[i+56>>2]);t=u*(t+ +g[l+60>>2]-j-+g[i+60>>2]);w=c[b+28>>2]|0;g[w>>2]=u*(r+ +g[l+52>>2]-d-+g[i+52>>2]);g[w+(f<<2)>>2]=s;g[w+(f<<1<<2)>>2]=t;g[k+(f*3<<2)>>2]=1.0;g[k+((f<<2|1)<<2)>>2]=1.0;g[k+((f*5|0)+2<<2)>>2]=1.0;if(e|0){g[e+(f*3<<2)>>2]=-1.0;g[e+((f<<2|1)<<2)>>2]=-1.0;g[e+((f*5|0)+2<<2)>>2]=-1.0}m=+g[l+24>>2];z=+g[l+44>>2];j=+g[l+28>>2];n=+g[l+40>>2];y=+g[l+36>>2];h=+g[l+20>>2];t=+g[l+4>>2];s=+g[l+8>>2];p=+g[l+12>>2];d=1.0/((m*z-j*n)*t+s*(j*y-z*h)+(n*h-m*y)*p);F=+g[i+4>>2];E=+g[i+8>>2];G=+g[i+12>>2];D=+g[i+20>>2];B=+g[i+24>>2];A=+g[i+28>>2];o=+g[i+36>>2];q=+g[i+40>>2];r=+g[i+44>>2];g[v+16>>2]=G*(n*h-m*y)*d+(F*(m*z-j*n)*d+E*(j*y-z*h)*d);g[v+16+4>>2]=G*(y*s-n*t)*d+(F*(n*p-z*s)*d+E*(z*t-y*p)*d);g[v+16+8>>2]=G*(m*t-h*s)*d+(F*(j*s-m*p)*d+E*(h*p-j*t)*d);g[v+16+12>>2]=0.0;g[v+16+16>>2]=(m*z-j*n)*d*D+(j*y-z*h)*d*B+(n*h-m*y)*d*A;g[v+16+20>>2]=(n*p-z*s)*d*D+(z*t-y*p)*d*B+(y*s-n*t)*d*A;g[v+16+24>>2]=(j*s-m*p)*d*D+(h*p-j*t)*d*B+(m*t-h*s)*d*A;g[v+16+28>>2]=0.0;g[v+16+32>>2]=(m*z-j*n)*d*o+(j*y-z*h)*d*q+(n*h-m*y)*d*r;g[v+16+36>>2]=(n*p-z*s)*d*o+(z*t-y*p)*d*q+(y*s-n*t)*d*r;g[v+16+40>>2]=(j*s-m*p)*d*o+(h*p-j*t)*d*q+(m*t-h*s)*d*r;g[v+16+44>>2]=0.0;Og(v+16|0,v);r=+g[a+80>>2];d=+g[v>>2];s=+g[a+84>>2];h=+g[v+4>>2];t=+g[a+88>>2];m=+g[v+8>>2];q=+g[a+92>>2];j=+g[v+12>>2];if(!((r-d)*(r-d)+(s-h)*(s-h)+(t-m)*(t-m)+(q-j)*(q-j)<(r+d)*(r+d)+(s+h)*(s+h)+(t+m)*(t+m)+(q+j)*(q+j))){d=-d;h=-h;m=-m;j=-j}n=h*-t+(j*-r+d*q)-m*-s;o=m*-r+(j*-s+h*q)-d*-t;p=d*-s+(j*-t+m*q)-h*-r;d=j*q-d*-r-h*-s-m*-t;d=d<-1.0?-1.0:d;d=+C(+(d>1.0?1.0:d))*2.0;if(n*n+o*o+p*p<1.4210854715202004e-14){E=1.0;F=0.0;D=0.0;G=-d;E=E*G;F=F*G;G=D*G;a=c[b+28>>2]|0;w=c[b+24>>2]|0;E=u*E;b=w*3|0;b=a+(b<<2)|0;g[b>>2]=E;F=u*F;b=w<<2;b=a+(b<<2)|0;g[b>>2]=F;G=u*G;w=w*5|0;w=a+(w<<2)|0;g[w>>2]=G;sa=v;return}D=1.0/+x(+(n*n+o*o+p*p));E=n*D;F=o*D;D=p*D;G=-d;E=E*G;F=F*G;G=D*G;a=c[b+28>>2]|0;w=c[b+24>>2]|0;E=u*E;b=w*3|0;b=a+(b<<2)|0;g[b>>2]=E;F=u*F;b=w<<2;b=a+(b<<2)|0;g[b>>2]=F;G=u*G;w=w*5|0;w=a+(w<<2)|0;g[w>>2]=G;sa=v;return}function _c(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,h=0,i=0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0,q=0,r=0;o=sa;sa=sa+128|0;c[b+68>>2]=(c[b+68>>2]|0)+1;c[o>>2]=c[d>>2];c[o+4>>2]=c[d+4>>2];c[o+8>>2]=c[d+8>>2];c[o+12>>2]=c[d+12>>2];c[o+16>>2]=c[d+16>>2];c[o+16+4>>2]=c[d+16+4>>2];c[o+16+8>>2]=c[d+16+8>>2];c[o+16+12>>2]=c[d+16+12>>2];c[o+32>>2]=c[d+32>>2];c[o+32+4>>2]=c[d+32+4>>2];c[o+32+8>>2]=c[d+32+8>>2];c[o+32+12>>2]=c[d+32+12>>2];c[o+48>>2]=c[d+48>>2];c[o+48+4>>2]=c[d+48+4>>2];c[o+48+8>>2]=c[d+48+8>>2];c[o+48+12>>2]=c[d+48+12>>2];m=c[e+4>>2]|0;n=+va[c[(c[e>>2]|0)+48>>2]&15](e);ab[c[(c[e>>2]|0)+8>>2]&127](e,d,o+112|0,o+96|0);f=+g[o+112>>2];if(+g[b+32>>2]>f)g[b+32>>2]=f;f=+g[o+96>>2];if(+g[b+48>>2]>2]=f;f=+g[o+112+4>>2];if(+g[b+36>>2]>f)g[b+36>>2]=f;f=+g[o+96+4>>2];if(+g[b+52>>2]>2]=f;f=+g[o+112+8>>2];if(+g[b+40>>2]>f)g[b+40>>2]=f;f=+g[o+96+8>>2];if(+g[b+56>>2]>2]=f;k=c[b+64>>2]|0;if(!k){k=b+16|0;j=0}else{c[o+64>>2]=c[o+112>>2];c[o+64+4>>2]=c[o+112+4>>2];c[o+64+8>>2]=c[o+112+8>>2];c[o+64+12>>2]=c[o+112+12>>2];c[o+64+16>>2]=c[o+96>>2];c[o+64+16+4>>2]=c[o+96+4>>2];c[o+64+16+8>>2]=c[o+96+8>>2];c[o+64+16+12>>2]=c[o+96+12>>2];j=c[b+16>>2]|0;d=c[k+4>>2]|0;if(!d){c[7182]=(c[7182]|0)+1;d=xb(63)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}h=d;i=h+44|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(i|0))}else c[k+4>>2]=0;c[d+32>>2]=0;c[d+36>>2]=j;c[d+40>>2]=0;c[d>>2]=c[o+64>>2];c[d+4>>2]=c[o+64+4>>2];c[d+8>>2]=c[o+64+8>>2];c[d+12>>2]=c[o+64+12>>2];c[d+16>>2]=c[o+64+16>>2];c[d+20>>2]=c[o+64+20>>2];c[d+24>>2]=c[o+64+24>>2];c[d+28>>2]=c[o+64+28>>2];ue(k,c[k>>2]|0,d);c[k+12>>2]=(c[k+12>>2]|0)+1;k=b+16|0;j=d}d=c[k>>2]|0;if((d|0)==(c[b+20>>2]|0)?(l=(d|0)==0?1:d<<1,(d|0)<(l|0)):0){if(!l)i=0;else{c[7182]=(c[7182]|0)+1;d=xb((l*80|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}i=d;d=c[k>>2]|0}if((d|0)>0){h=0;do{p=i+(h*80|0)|0;q=c[b+24>>2]|0;r=q+(h*80|0)|0;c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];p=q+(h*80|0)+16|0;r=i+(h*80|0)+16|0;c[r>>2]=c[p>>2];c[r+4>>2]=c[p+4>>2];c[r+8>>2]=c[p+8>>2];c[r+12>>2]=c[p+12>>2];r=q+(h*80|0)+32|0;p=i+(h*80|0)+32|0;c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];p=i+(h*80|0)+48|0;r=q+(h*80|0)+48|0;c[p>>2]=c[r>>2];c[p+4>>2]=c[r+4>>2];c[p+8>>2]=c[r+8>>2];c[p+12>>2]=c[r+12>>2];p=i+(h*80|0)+64|0;q=q+(h*80|0)+64|0;c[p>>2]=c[q>>2];c[p+4>>2]=c[q+4>>2];c[p+8>>2]=c[q+8>>2];c[p+12>>2]=c[q+12>>2];h=h+1|0}while((h|0)!=(d|0))}d=c[b+24>>2]|0;if(d|0){if(a[b+28>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+24>>2]=0}a[b+28>>0]=1;c[b+24>>2]=i;c[b+20>>2]=l;d=c[k>>2]|0}r=c[b+24>>2]|0;q=r+(d*80|0)|0;c[q>>2]=c[o>>2];c[q+4>>2]=c[o+4>>2];c[q+8>>2]=c[o+8>>2];c[q+12>>2]=c[o+12>>2];q=r+(d*80|0)+16|0;c[q>>2]=c[o+16>>2];c[q+4>>2]=c[o+16+4>>2];c[q+8>>2]=c[o+16+8>>2];c[q+12>>2]=c[o+16+12>>2];q=r+(d*80|0)+32|0;c[q>>2]=c[o+32>>2];c[q+4>>2]=c[o+32+4>>2];c[q+8>>2]=c[o+32+8>>2];c[q+12>>2]=c[o+32+12>>2];q=r+(d*80|0)+48|0;c[q>>2]=c[o+48>>2];c[q+4>>2]=c[o+48+4>>2];c[q+8>>2]=c[o+48+8>>2];c[q+12>>2]=c[o+48+12>>2];r=r+(d*80|0)+64|0;c[r>>2]=e;c[r+4>>2]=m;g[r+8>>2]=n;c[r+12>>2]=j;c[k>>2]=(c[k>>2]|0)+1;sa=o;return}function $c(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0;l=sa;sa=sa+384|0;f=c[d+36>>2]|0;d=c[e+36>>2]|0;e=c[b+24>>2]|0;if(((e|0)==(c[b+28>>2]|0)?c[e+1132>>2]|0:0)?(j=(J(c[d+380>>2]|0,c[e+1112>>2]|0)|0)+(c[f+380>>2]|0)|0,a[(c[e+1140>>2]|0)+j>>0]|0):0){c[6845]=(c[6845]|0)+1;sa=l;return}c[l+328+4>>2]=35;c[l+328+8>>2]=0;c[l+328+12>>2]=1065353216;c[l+328+16>>2]=1065353216;c[l+328+20>>2]=1065353216;g[l+328+24>>2]=0.0;c[l+328>>2]=6196;c[l+328+52>>2]=f;g[l+328+44>>2]=0.0;c[l+272+4>>2]=35;c[l+272+8>>2]=0;c[l+272+12>>2]=1065353216;c[l+272+16>>2]=1065353216;c[l+272+20>>2]=1065353216;g[l+272+24>>2]=0.0;c[l+272>>2]=6196;c[l+272+52>>2]=d;g[l+272+44>>2]=0.0;if((a[26616]|0)==0?mz(26616)|0:0){if((a[26624]|0)==0?mz(26624)|0:0){c[6774]=1065353216;c[6775]=0;c[6776]=0;c[6777]=0;c[6778]=0;c[6779]=1065353216;c[6780]=0;c[6781]=0;c[6782]=0;c[6783]=0;c[6784]=1065353216;g[6785]=0.0}c[6758]=c[6774];c[6759]=c[6775];c[6760]=c[6776];c[6761]=c[6777];c[6762]=c[6778];c[6763]=c[6779];c[6764]=c[6780];c[6765]=c[6781];c[6766]=c[6782];c[6767]=c[6783];c[6768]=c[6784];c[6769]=c[6785];c[6770]=0;c[6771]=0;c[6772]=0;c[6773]=0}if((a[26616]|0)==0?mz(26616)|0:0){if((a[26624]|0)==0?mz(26624)|0:0){c[6774]=1065353216;c[6775]=0;c[6776]=0;c[6777]=0;c[6778]=0;c[6779]=1065353216;c[6780]=0;c[6781]=0;c[6782]=0;c[6783]=0;c[6784]=1065353216;g[6785]=0.0}c[6758]=c[6774];c[6759]=c[6775];c[6760]=c[6776];c[6761]=c[6777];c[6762]=c[6778];c[6763]=c[6779];c[6764]=c[6780];c[6765]=c[6781];c[6766]=c[6782];c[6767]=c[6783];c[6768]=c[6784];c[6769]=c[6785];c[6770]=0;c[6771]=0;c[6772]=0;c[6773]=0}n=+g[f+232>>2]-+g[d+232>>2];m=+g[f+236>>2]-+g[d+236>>2];g[l>>2]=+g[f+228>>2]-+g[d+228>>2];g[l+4>>2]=n;g[l+8>>2]=m;g[l+12>>2]=0.0;if(!(!(Rc(l+328|0,27032,l+272|0,27032,l,l+216|0)|0)?!(Ob(l+328|0,27032,l+272|0,27032,l,l+216|0,0)|0):0))h=19;if((h|0)==19?(c[l+4>>2]=0,c[l+4+4>>2]=0,c[l+4+8>>2]=0,c[l+4+12>>2]=0,c[l+4+16>>2]=0,c[l+4+20>>2]=0,a[l+152>>0]=0,c[l>>2]=6016,jc(b,l+216|0,f,0,0,d,0,0,l)|0):0){c[7182]=(c[7182]|0)+1;d=xb(235)|0;if(!d)j=0;else{c[(d+4+15&-16)+-4>>2]=d;j=d+4+15&-16}e=j+4|0;d=j+152|0;mk(e|0,0,212)|0;c[j>>2]=6016;f=l+4|0;h=e+100|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(h|0));e=j+104|0;c[e>>2]=c[l+104>>2];c[e+4>>2]=c[l+104+4>>2];c[e+8>>2]=c[l+104+8>>2];c[e+12>>2]=c[l+104+12>>2];e=j+120|0;c[e>>2]=c[l+120>>2];c[e+4>>2]=c[l+120+4>>2];c[e+8>>2]=c[l+120+8>>2];c[e+12>>2]=c[l+120+12>>2];e=j+136|0;c[e>>2]=c[l+136>>2];c[e+4>>2]=c[l+136+4>>2];c[e+8>>2]=c[l+136+8>>2];c[e+12>>2]=c[l+136+12>>2];a[d>>0]=a[l+152>>0]|0;e=j+156|0;f=l+156|0;h=e+60|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(h|0));h=c[b+24>>2]|0;i=j;d=c[h+852>>2]|0;if((d|0)==(c[h+856>>2]|0)?(k=(d|0)==0?1:d<<1,(d|0)<(k|0)):0){if(!k)f=0;else{c[7182]=(c[7182]|0)+1;d=xb((k<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=d;d=c[h+852>>2]|0}if((d|0)>0){e=0;do{c[f+(e<<2)>>2]=c[(c[h+860>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(d|0))}e=c[h+860>>2]|0;if(e){if(a[h+864>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[h+852>>2]|0}c[h+860>>2]=0}a[h+864>>0]=1;c[h+860>>2]=f;c[h+856>>2]=k}c[(c[h+860>>2]|0)+(d<<2)>>2]=i;c[h+852>>2]=d+1;i=c[b+24>>2]|0;k=c[b+28>>2]|0;m=+g[i+348>>2];n=+g[k+348>>2];b=j+64|0;g[b>>2]=+g[b>>2]*(m>n?m:n);b=j+68|0;g[b>>2]=+g[b>>2]*(+g[i+360>>2]+ +g[k+360>>2])*.5}sa=l;return}function ad(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;F=sa;sa=sa+16|0;Ki(15377);E=c[a+712>>2]|0;if((E|0)>0){c[7182]=(c[7182]|0)+1;d=xb((E<<4|3)+16|0)|0;if(!d)h=0;else{c[(d+4+15&-16)+-4>>2]=d;h=d+4+15&-16}mk(h|0,0,E<<4|0)|0;f=c[a+712>>2]|0;if((f|0)>0){c[7182]=(c[7182]|0)+1;d=xb((f<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}mk(d|0,0,f<<2|0)|0;C=d;D=h;A=d;z=h}else{C=0;D=h;A=0;z=h}}else{C=0;D=0;A=0;z=0}y=c[a+1112>>2]|0;if(b){if((y|0)>0){f=c[a+1120>>2]|0;d=0;do{h=c[f+(d<<2)>>2]|0;i=c[h+312>>2]|0;if(i|0){g[h+276>>2]=1.0/+(i|0)*+g[h+276>>2];g[h+280>>2]=1.0/+(i|0)*+g[h+280>>2];g[h+284>>2]=1.0/+(i|0)*+g[h+284>>2];g[h+292>>2]=1.0/+(i|0)*+g[h+292>>2];g[h+296>>2]=1.0/+(i|0)*+g[h+296>>2];g[h+300>>2]=1.0/+(i|0)*+g[h+300>>2]}d=d+1|0}while((d|0)!=(y|0));B=14}}else B=14;if((B|0)==14?(y|0)>0:0){k=c[a+1120>>2]|0;if(b){f=0;do{b=c[k+(f<<2)>>2]|0;if((c[b+312>>2]|0)>0?(w=+g[a+452>>2],r=+g[b+276>>2]*w,s=w*+g[b+280>>2],t=w*+g[b+284>>2],u=w*+g[b+292>>2],v=w*+g[b+296>>2],w=w*+g[b+300>>2],x=c[b+24>>2]|0,(x|0)>0):0){j=c[b+32>>2]|0;h=c[a+720>>2]|0;i=c[b+12>>2]|0;d=0;do{q=c[j+(d<<2)>>2]|0;p=+g[i+(d<<2)>>2];o=+g[q+8>>2]-+g[b+228>>2];n=+g[q+12>>2]-+g[b+232>>2];m=+g[q+16>>2]-+g[b+236>>2];G=D+(((q-h|0)/104|0)<<4)|0;g[G>>2]=+g[G>>2]+p*(r+(v*m-w*n));G=D+(((q-h|0)/104|0)<<4)+4|0;g[G>>2]=+g[G>>2]+p*(s+(w*o-u*m));G=D+(((q-h|0)/104|0)<<4)+8|0;g[G>>2]=p*(t+(u*n-v*o))+ +g[G>>2];q=C+(((q-h|0)/104|0)<<2)|0;g[q>>2]=p+ +g[q>>2];d=d+1|0}while((d|0)!=(x|0))}f=f+1|0}while((f|0)!=(y|0))}else{f=0;do{h=c[k+(f<<2)>>2]|0;if((c[h+308>>2]|0)>0?(p=+g[a+452>>2],e=+g[h+244>>2]*p,l=p*+g[h+248>>2],m=p*+g[h+252>>2],n=p*+g[h+260>>2],o=p*+g[h+264>>2],p=p*+g[h+268>>2],q=c[h+24>>2]|0,(q|0)>0):0){i=c[h+32>>2]|0;b=c[a+720>>2]|0;j=c[h+12>>2]|0;d=0;do{G=c[i+(d<<2)>>2]|0;w=+g[j+(d<<2)>>2];v=+g[G+8>>2]-+g[h+228>>2];u=+g[G+12>>2]-+g[h+232>>2];t=+g[G+16>>2]-+g[h+236>>2];x=D+(((G-b|0)/104|0)<<4)|0;g[x>>2]=+g[x>>2]+w*(e+(o*t-p*u));x=D+(((G-b|0)/104|0)<<4)+4|0;g[x>>2]=+g[x>>2]+w*(l+(p*v-n*t));x=D+(((G-b|0)/104|0)<<4)+8|0;g[x>>2]=w*(m+(n*u-o*v))+ +g[x>>2];G=C+(((G-b|0)/104|0)<<2)|0;g[G>>2]=w+ +g[G>>2];d=d+1|0}while((d|0)!=(q|0))}f=f+1|0}while((f|0)!=(y|0))}}if((E|0)>0){d=0;do{e=+g[C+(d<<2)>>2];if(e>0.0){v=1.0/e*+g[D+(d<<4)+4>>2];w=1.0/e*+g[D+(d<<4)+8>>2];G=c[a+720>>2]|0;y=G+(d*104|0)+8|0;g[y>>2]=1.0/e*+g[D+(d<<4)>>2]+ +g[y>>2];y=G+(d*104|0)+12|0;g[y>>2]=v+ +g[y>>2];G=G+(d*104|0)+16|0;g[G>>2]=w+ +g[G>>2]}d=d+1|0}while((d|0)!=(E|0));if(A|0)B=35}else if(!((C|0)==0|(A|0)==0))B=35;if((B|0)==35){c[7183]=(c[7183]|0)+1;Hc(c[A+-4>>2]|0)}if(!((D|0)==0|(z|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[z+-4>>2]|0)}d=c[3084]|0;G=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=G;if(G|0){sa=F;return}do if(c[d+4>>2]|0){la(F|0,0)|0;G=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[F+4>>2]|0)-(c[G+4>>2]|0)+(((c[F>>2]|0)-(c[G>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=F;return}}while(0);c[3084]=c[d+20>>2];sa=F;return}function bd(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var k=0,l=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0;C=sa;sa=sa+272|0;z=+g[e+48>>2]-+g[d+48>>2];A=+g[e+52>>2]-+g[d+52>>2];B=+g[e+56>>2]-+g[d+56>>2];Se(d,e,C+256|0,C+208|0);u=+g[C+208>>2];s=+g[C+256>>2]*u;t=u*+g[C+256+4>>2];u=u*+g[C+256+8>>2];g[C+192>>2]=s;g[C+192+4>>2]=t;g[C+192+8>>2]=u;g[C+192+12>>2]=0.0;v=+g[h+48>>2]-+g[f+48>>2];w=+g[h+52>>2]-+g[f+52>>2];y=+g[h+56>>2]-+g[f+56>>2];Se(f,h,C+256|0,C+208|0);q=+g[C+208>>2];o=+g[C+256>>2]*q;p=q*+g[C+256+4>>2];q=q*+g[C+256+8>>2];g[C+176>>2]=o;g[C+176+4>>2]=p;g[C+176+8>>2]=q;g[C+176+12>>2]=0.0;e=c[b+12>>2]|0;r=+va[c[(c[e>>2]|0)+16>>2]&15](e);e=c[b+16>>2]|0;if(!e)l=0.0;else l=+va[c[(c[e>>2]|0)+16>>2]&15](e);r=r*+x(+(s*s+t*t+u*u))+l*+x(+(o*o+p*p+q*q));if(r+ +x(+((v-z)*(v-z)+(w-A)*(w-A)+(y-B)*(y-B)))==0.0){i=0;sa=C;return i|0}c[C+208>>2]=12068;g[C+208+36>>2]=999999984306749440.0;a[C+208+40>>0]=0;Pc(b,d,f,C+208|0);h=(a[C+208+40>>0]|0)==0;c[C+256>>2]=c[C+208+20>>2];c[C+256+4>>2]=c[C+208+20+4>>2];c[C+256+8>>2]=c[C+208+20+8>>2];c[C+256+12>>2]=c[C+208+20+12>>2];a:do if(!h?(n=c[C+208+4>>2]|0,k=c[C+208+8>>2]|0,m=c[C+208+12>>2]|0,u=(v-z)*(c[j>>2]=n,+g[j>>2]),u=u+(w-A)*(c[j>>2]=k,+g[j>>2]),!(r+(u+(y-B)*(c[j>>2]=m,+g[j>>2]))<=1.1920928955078125e-07)):0){l=+g[C+208+16>>2];o=+g[i+172>>2]+ +g[C+208+36>>2];b:do if(o>1.0000000474974513e-03){h=0;p=0.0;q=o;while(1){e=c[i+168>>2]|0;if(e|0){D=c[(c[e>>2]|0)+20>>2]|0;c[C+112>>2]=1065353216;c[C+112+4>>2]=1065353216;c[C+112+8>>2]=1065353216;g[C+112+12>>2]=0.0;Xa[D&7](e,C+256|0,.20000000298023224,C+112|0)}l=(v-z)*(c[j>>2]=n,+g[j>>2]);l=l+(w-A)*(c[j>>2]=k,+g[j>>2]);l=r+(l+(y-B)*(c[j>>2]=m,+g[j>>2]));if(l<=1.1920928955078125e-07){k=0;break a}o=p+q/l;if(!(!(o<=p)&(!(o<0.0)&!(o>1.0)))){k=0;break a}jg(d,z,A,B,C+192|0,o,C+112|0);jg(f,v,w,y,C+176|0,o,C+48|0);k=c[i+168>>2]|0;if(k|0){D=c[(c[k>>2]|0)+20>>2]|0;c[C>>2]=1065353216;c[C+4>>2]=0;c[C+8>>2]=0;g[C+12>>2]=0.0;Xa[D&7](k,C+112+48|0,.20000000298023224,C)}Qa[c[c[i>>2]>>2]&31](i,o);c[C>>2]=12068;g[C+36>>2]=999999984306749440.0;a[C+40>>0]=0;Pc(b,C+112|0,C+48|0,C);if(!(a[C+40>>0]|0)){k=17;break}q=+g[C+36>>2]+ +g[i+172>>2];c[C+256>>2]=c[C+20>>2];c[C+256+4>>2]=c[C+20+4>>2];c[C+256+8>>2]=c[C+20+8>>2];c[C+256+12>>2]=c[C+20+12>>2];n=c[C+4>>2]|0;k=c[C+8>>2]|0;m=c[C+12>>2]|0;e=h+1|0;if(h>>>0>63){k=18;break}if(!(q>1.0000000474974513e-03)){l=+g[C+16>>2];break b}else{h=e;p=o}}if((k|0)==17)Za[c[(c[i>>2]|0)+8>>2]&127](i,-1,h);else if((k|0)==18)Za[c[(c[i>>2]|0)+8>>2]&127](i,-2,e);k=0;break a}else o=0.0;while(0);g[i+164>>2]=o;c[i+132>>2]=n;c[i+136>>2]=k;c[i+140>>2]=m;g[i+144>>2]=l;c[i+148>>2]=c[C+256>>2];c[i+148+4>>2]=c[C+256+4>>2];c[i+148+8>>2]=c[C+256+8>>2];c[i+148+12>>2]=c[C+256+12>>2];k=1}else k=0;while(0);D=k;sa=C;return D|0}function cd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0;h=sa;sa=sa+768|0;j=c[(c[a>>2]|0)+8>>2]|0;i=JI(b)|0;ns(h+736|0,i,i+4|0,i+8|0);Qv(h+752|0,e,+g[h+736>>2],+g[h+736+4>>2],+g[h+736+8>>2]);b=JI(d)|0;ns(h+704|0,b,i+4|0,i+8|0);Qv(h+720|0,e,+g[h+704>>2],+g[h+704+4>>2],+g[h+704+8>>2]);ab[j&127](a,h+752|0,h+720|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+672|0,b,i+4|0,i+8|0);Qv(h+688|0,e,+g[h+672>>2],+g[h+672+4>>2],+g[h+672+8>>2]);ns(h+640|0,b,b+4|0,i+8|0);Qv(h+656|0,e,+g[h+640>>2],+g[h+640+4>>2],+g[h+640+8>>2]);ab[d&127](a,h+688|0,h+656|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+608|0,b,b+4|0,i+8|0);Qv(h+624|0,e,+g[h+608>>2],+g[h+608+4>>2],+g[h+608+8>>2]);ns(h+576|0,i,b+4|0,i+8|0);Qv(h+592|0,e,+g[h+576>>2],+g[h+576+4>>2],+g[h+576+8>>2]);ab[d&127](a,h+624|0,h+592|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+544|0,i,b+4|0,i+8|0);Qv(h+560|0,e,+g[h+544>>2],+g[h+544+4>>2],+g[h+544+8>>2]);ns(h+512|0,i,i+4|0,i+8|0);Qv(h+528|0,e,+g[h+512>>2],+g[h+512+4>>2],+g[h+512+8>>2]);ab[d&127](a,h+560|0,h+528|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+480|0,i,i+4|0,i+8|0);Qv(h+496|0,e,+g[h+480>>2],+g[h+480+4>>2],+g[h+480+8>>2]);ns(h+448|0,i,i+4|0,b+8|0);Qv(h+464|0,e,+g[h+448>>2],+g[h+448+4>>2],+g[h+448+8>>2]);ab[d&127](a,h+496|0,h+464|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+416|0,b,i+4|0,i+8|0);Qv(h+432|0,e,+g[h+416>>2],+g[h+416+4>>2],+g[h+416+8>>2]);ns(h+384|0,b,i+4|0,b+8|0);Qv(h+400|0,e,+g[h+384>>2],+g[h+384+4>>2],+g[h+384+8>>2]);ab[d&127](a,h+432|0,h+400|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+352|0,b,b+4|0,i+8|0);Qv(h+368|0,e,+g[h+352>>2],+g[h+352+4>>2],+g[h+352+8>>2]);ns(h+320|0,b,b+4|0,b+8|0);Qv(h+336|0,e,+g[h+320>>2],+g[h+320+4>>2],+g[h+320+8>>2]);ab[d&127](a,h+368|0,h+336|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+288|0,i,b+4|0,i+8|0);Qv(h+304|0,e,+g[h+288>>2],+g[h+288+4>>2],+g[h+288+8>>2]);ns(h+256|0,i,b+4|0,b+8|0);Qv(h+272|0,e,+g[h+256>>2],+g[h+256+4>>2],+g[h+256+8>>2]);ab[d&127](a,h+304|0,h+272|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+224|0,i,i+4|0,b+8|0);Qv(h+240|0,e,+g[h+224>>2],+g[h+224+4>>2],+g[h+224+8>>2]);ns(h+192|0,b,i+4|0,b+8|0);Qv(h+208|0,e,+g[h+192>>2],+g[h+192+4>>2],+g[h+192+8>>2]);ab[d&127](a,h+240|0,h+208|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+160|0,b,i+4|0,b+8|0);Qv(h+176|0,e,+g[h+160>>2],+g[h+160+4>>2],+g[h+160+8>>2]);ns(h+128|0,b,b+4|0,b+8|0);Qv(h+144|0,e,+g[h+128>>2],+g[h+128+4>>2],+g[h+128+8>>2]);ab[d&127](a,h+176|0,h+144|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+96|0,b,b+4|0,b+8|0);Qv(h+112|0,e,+g[h+96>>2],+g[h+96+4>>2],+g[h+96+8>>2]);ns(h+64|0,i,b+4|0,b+8|0);Qv(h+80|0,e,+g[h+64>>2],+g[h+64+4>>2],+g[h+64+8>>2]);ab[d&127](a,h+112|0,h+80|0,f);d=c[(c[a>>2]|0)+8>>2]|0;ns(h+32|0,i,b+4|0,b+8|0);Qv(h+48|0,e,+g[h+32>>2],+g[h+32+4>>2],+g[h+32+8>>2]);ns(h,i,i+4|0,b+8|0);Qv(h+16|0,e,+g[h>>2],+g[h+4>>2],+g[h+8>>2]);ab[d&127](a,h+48|0,h+16|0,f);sa=h;return}function dd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0,A=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0;E=sa;sa=sa+32|0;A=+g[b+48>>2]-+g[b+112>>2];h=+g[b+52>>2]-+g[b+116>>2];D=+g[b+56>>2]-+g[b+120>>2];B=A*+g[b+64>>2]+h*+g[b+80>>2]+D*+g[b+96>>2];C=A*+g[b+68>>2]+h*+g[b+84>>2]+D*+g[b+100>>2];D=A*+g[b+72>>2]+h*+g[b+88>>2]+D*+g[b+104>>2];e=c[a+8>>2]|0;z=c[a+4>>2]|0;h=+g[z+28>>2]*+g[z+12>>2];A=h+ +g[a+12>>2];o=+g[e+72>>2];p=+g[e+56>>2];q=+g[e+76>>2];r=+g[e+60>>2];s=+g[e+80>>2];t=+g[e+64>>2];u=+g[e+88>>2];v=+g[e+92>>2];w=+g[e+96>>2];j=(q-r)*(w-t)-(s-t)*(v-r);l=(s-t)*(u-p)-(o-p)*(w-t);n=(o-p)*(v-r)-(q-r)*(u-p);m=1.0/+x(+(n*n+(j*j+l*l)));i=(D-t)*n*m+((B-p)*j*m+(C-r)*l*m);if(i<0.0){y=-i;k=-(j*m);i=-(l*m);j=-(n*m)}else{y=i;k=j*m;i=l*m;j=n*m}if(!(y0.0&(n>0.0&s>0.0)|w<=0.0&(n<=0.0&s<=0.0))){if((Fa[c[(c[e>>2]|0)+100>>2]&127](e)|0)<=0){sa=E;return}e=0;z=0;r=0.0;q=0.0;p=0.0;do{F=c[a+8>>2]|0;ab[c[(c[F>>2]|0)+104>>2]&127](F,z,E+16|0,E);o=+g[E+16>>2];w=+g[E+16+4>>2];t=+g[E+16+8>>2];s=+g[E>>2]-o;y=+g[E+4>>2]-w;u=+g[E+8>>2]-t;do if((B-o)*s+(C-w)*y+(D-t)*u>0.0)if((B-o)*s+(C-w)*y+(D-t)*u>2]|0}while((z|0)<(Fa[c[(c[F>>2]|0)+100>>2]&127](F)|0));if(!(e&1)){sa=E;return}else o=A*A}else{o=A*A;r=B-y*k;q=D-y*j;p=C-y*i}m=B-r;n=C-p;l=D-q;if(!(m*m+n*n+l*l1.1920928955078125e-07){i=+x(+(m*m+n*n+l*l));h=h-i;k=m*(1.0/i);j=l*(1.0/i);i=n*(1.0/i)}h=-h;if(f){w=+g[b+64>>2];y=+g[b+68>>2];A=+g[b+72>>2];B=w*k+y*i+A*j;n=+g[b+80>>2];o=+g[b+84>>2];s=+g[b+88>>2];C=k*n+i*o+j*s;t=+g[b+96>>2];u=+g[b+100>>2];v=+g[b+104>>2];D=k*t+i*u+j*v;g[E+16>>2]=-B;g[E+16+4>>2]=-C;g[E+16+8>>2]=-D;g[E+16+12>>2]=0.0;C=r*n+p*o+q*s+ +g[b+116>>2]+C*h;D=r*t+p*u+q*v+ +g[b+120>>2]+D*h;g[E>>2]=r*w+p*y+q*A+ +g[b+112>>2]+B*h;g[E+4>>2]=C;g[E+8>>2]=D;g[E+12>>2]=0.0;_a[c[(c[d>>2]|0)+16>>2]&15](d,E+16|0,E,h);sa=E;return}else{F=c[(c[d>>2]|0)+16>>2]|0;y=+g[b+64>>2];A=+g[b+68>>2];B=+g[b+72>>2];t=+g[b+80>>2];u=+g[b+84>>2];C=+g[b+88>>2];v=+g[b+96>>2];w=+g[b+100>>2];D=+g[b+104>>2];g[E+16>>2]=y*k+A*i+B*j;g[E+16+4>>2]=k*t+i*u+j*C;g[E+16+8>>2]=k*v+i*w+j*D;g[E+16+12>>2]=0.0;C=r*t+p*u+q*C+ +g[b+116>>2];D=r*v+p*w+q*D+ +g[b+120>>2];g[E>>2]=r*y+p*A+q*B+ +g[b+112>>2];g[E+4>>2]=C;g[E+8>>2]=D;g[E+12>>2]=0.0;_a[F&15](d,E+16|0,E,h);sa=E;return}}function ed(b,d){b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0;c[b>>2]=8032;c[7182]=(c[7182]|0)+1;e=xb(379)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}g[e+308>>2]=9.999999747378752e-05;l=e+332|0;a[l>>0]=a[l>>0]&-16;c[b+24>>2]=e;l=(c[d+20>>2]|0)==0;c[7182]=(c[7182]|0)+1;e=xb(23)|0;c[(e+4+15&-16)+-4>>2]=e;c[(e+4+15&-16)>>2]=l?11980:12028;c[b+28>>2]=e+4+15&-16;c[7182]=(c[7182]|0)+1;e=xb(43)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}k=c[b+24>>2]|0;l=c[b+28>>2]|0;a[e+4>>0]=0;c[e>>2]=8840;c[e+16>>2]=0;c[e+20>>2]=3;c[e+12>>2]=k;c[e+8>>2]=l;c[b+32>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8064;c[b+36>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8084;c[b+40>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8104;c[b+44>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8124;c[b+48>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8144;c[b+52>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8164;c[b+56>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8184;c[b+60>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8204;c[b+76>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=8204;c[b+80>>2]=e;a[e+4>>0]=1;c[7182]=(c[7182]|0)+1;e=xb(27)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8224;c[b+72>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(35)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}a[e+4>>0]=0;c[e>>2]=8244;c[e+8>>2]=1;c[e+12>>2]=0;c[b+88>>2]=e;c[7182]=(c[7182]|0)+1;e=xb(35)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=8244;c[e+8>>2]=1;c[e+12>>2]=0;c[b+84>>2]=e;a[e+4>>0]=1;l=c[d+16>>2]|0;l=(l|0)>80?l:80;e=c[d>>2]|0;if(!e){a[b+12>>0]=1;c[7182]=(c[7182]|0)+1;e=xb(39)|0;if(!e)k=0;else{c[(e+4+15&-16)+-4>>2]=e;k=e+4+15&-16}e=c[d+8>>2]|0;c[k>>2]=772;f=k+4|0;c[f>>2]=e;c[7182]=(c[7182]|0)+1;e=xb((e*772|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[k+16>>2]=e;c[k+12>>2]=e;h=c[f>>2]|0;c[k+8>>2]=h;if(h+-1|0){i=c[k>>2]|0;f=e;j=h+-1|0;do{m=f;f=f+i|0;c[m>>2]=f;j=j+-1|0}while((j|0)!=0);e=e+(J(i,h+-1|0)|0)|0}c[e>>2]=0;c[b+8>>2]=k}else{a[b+12>>0]=0;c[b+8>>2]=e}e=c[d+4>>2]|0;if(e|0){a[b+20>>0]=0;c[b+16>>2]=e;return}a[b+20>>0]=1;c[7182]=(c[7182]|0)+1;e=xb(39)|0;if(!e)k=0;else{c[(e+4+15&-16)+-4>>2]=e;k=e+4+15&-16}e=c[d+12>>2]|0;c[k>>2]=l;f=k+4|0;c[f>>2]=e;e=J(e,l)|0;c[7182]=(c[7182]|0)+1;e=xb(e+19|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[k+16>>2]=e;c[k+12>>2]=e;h=c[f>>2]|0;c[k+8>>2]=h;if(h+-1|0){i=c[k>>2]|0;f=e;j=h+-1|0;do{m=f;f=f+i|0;c[m>>2]=f;j=j+-1|0}while((j|0)!=0);e=e+(J(i,h+-1|0)|0)|0}c[e>>2]=0;c[b+16>>2]=k;return}function fd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0;i=sa;sa=sa+16|0;if((a[26704]|0)==0?mz(26704)|0:0){c[i>>2]=0;c[i+4>>2]=0;c[i+8>>2]=0;c[i+12>>2]=0;Cf(27392,0.0,0,0,i)}c[6899]=c[6899]|1;g[6934]=0.0;j=+g[6944]*0.0;k=+g[6945]*0.0;g[6939]=+g[6943]*0.0;g[6940]=j;g[6941]=k;g[6942]=0.0;c[6947]=0;c[6948]=0;c[6949]=0;c[6950]=0;k=+g[6936]*0.0;j=+g[6937]*0.0;g[6988]=+g[6935]*0.0;g[6989]=k;g[6990]=j;g[6991]=0.0;c[b+4>>2]=6;c[b+8>>2]=-1;c[b+12>>2]=-1;g[b+16>>2]=3402823466385288598117041.0e14;a[b+20>>0]=1;a[b+21>>0]=0;c[b+24>>2]=-1;c[b+28>>2]=27392;c[b+32>>2]=d;g[b+36>>2]=0.0;g[b+40>>2]=.30000001192092896;c[b+44>>2]=0;c[b>>2]=7188;c[b+112>>2]=c[e>>2];c[b+112+4>>2]=c[e+4>>2];c[b+112+8>>2]=c[e+8>>2];c[b+112+12>>2]=c[e+12>>2];c[b+128>>2]=c[e+16>>2];c[b+128+4>>2]=c[e+16+4>>2];c[b+128+8>>2]=c[e+16+8>>2];c[b+128+12>>2]=c[e+16+12>>2];c[b+144>>2]=c[e+32>>2];c[b+144+4>>2]=c[e+32+4>>2];c[b+144+8>>2]=c[e+32+8>>2];c[b+144+12>>2]=c[e+32+12>>2];c[b+160>>2]=c[e+48>>2];c[b+160+4>>2]=c[e+48+4>>2];c[b+160+8>>2]=c[e+48+8>>2];c[b+160+12>>2]=c[e+48+12>>2];e=b+680|0;h=e+48|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(h|0));c[b+740>>2]=0;c[b+740+4>>2]=0;c[b+740+8>>2]=0;c[b+740+12>>2]=0;c[b+756>>2]=1045220557;c[b+760>>2]=1045220557;c[b+764>>2]=1045220557;c[b+768>>2]=0;c[b+768+4>>2]=0;c[b+768+8>>2]=0;c[b+768+12>>2]=0;c[b+768+16>>2]=0;g[b+728>>2]=.699999988079071;g[b+732>>2]=1.0;g[b+736>>2]=.5;a[b+788>>0]=0;a[b+788+1>>0]=0;a[b+788+2>>0]=0;c[b+792>>2]=0;c[b+792+4>>2]=0;c[b+792+8>>2]=0;c[b+808>>2]=0;c[b+808+4>>2]=0;c[b+808+8>>2]=0;g[b+928>>2]=0.0;g[b+876>>2]=0.0;g[b+880>>2]=.10000000149011612;g[b+884>>2]=300.0;g[b+868>>2]=1.0;g[b+872>>2]=-1.0;g[b+896>>2]=0.0;g[b+900>>2]=.20000000298023224;g[b+904>>2]=0.0;g[b+908>>2]=0.0;g[b+888>>2]=1.0;g[b+892>>2]=.5;c[b+924>>2]=0;g[b+916>>2]=0.0;a[b+912>>0]=0;g[b+992>>2]=0.0;g[b+940>>2]=0.0;g[b+944>>2]=.10000000149011612;g[b+948>>2]=300.0;g[b+932>>2]=1.0;g[b+936>>2]=-1.0;g[b+960>>2]=0.0;g[b+964>>2]=.20000000298023224;g[b+968>>2]=0.0;g[b+972>>2]=0.0;g[b+952>>2]=1.0;g[b+956>>2]=.5;c[b+988>>2]=0;g[b+980>>2]=0.0;a[b+976>>0]=0;g[b+1056>>2]=0.0;g[b+1004>>2]=0.0;g[b+1008>>2]=.10000000149011612;g[b+1012>>2]=300.0;g[b+996>>2]=1.0;g[b+1e3>>2]=-1.0;g[b+1024>>2]=0.0;g[b+1028>>2]=.20000000298023224;g[b+1032>>2]=0.0;g[b+1036>>2]=0.0;g[b+1016>>2]=1.0;g[b+1020>>2]=.5;c[b+1052>>2]=0;g[b+1044>>2]=0.0;a[b+1040>>0]=0;a[b+1300>>0]=f&1;a[b+1301>>0]=1;c[b+1304>>2]=0;a[b+1308>>0]=0;x=+g[b+112>>2];D=+g[d+4>>2];w=+g[b+128>>2];C=+g[d+8>>2];v=+g[b+144>>2];B=+g[d+12>>2];u=+g[b+116>>2];t=+g[b+132>>2];s=+g[b+148>>2];r=+g[b+120>>2];p=+g[b+136>>2];n=+g[b+152>>2];A=+g[d+20>>2];z=+g[d+24>>2];y=+g[d+28>>2];q=+g[d+36>>2];o=+g[d+40>>2];m=+g[d+44>>2];F=+g[b+160>>2];E=+g[b+164>>2];k=+g[b+168>>2];l=+g[d+52>>2]+(D*F+C*E+B*k);j=A*F+z*E+y*k+ +g[d+56>>2];k=q*F+o*E+m*k+ +g[d+60>>2];g[b+48>>2]=x*D+w*C+v*B;g[b+52>>2]=D*u+C*t+B*s;g[b+56>>2]=D*r+C*p+B*n;g[b+60>>2]=0.0;g[b+64>>2]=x*A+w*z+v*y;g[b+68>>2]=u*A+t*z+s*y;g[b+72>>2]=r*A+p*z+n*y;g[b+76>>2]=0.0;g[b+80>>2]=x*q+w*o+v*m;g[b+84>>2]=u*q+t*o+s*m;g[b+88>>2]=r*q+p*o+n*m;g[b+92>>2]=0.0;g[b+96>>2]=l;g[b+100>>2]=j;g[b+104>>2]=k;g[b+108>>2]=0.0;tc(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);sa=i;return}function gd(b,d,e,f,h,i,j,k){b=b|0;d=d|0;e=e|0;f=f|0;h=+h;i=+i;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=sa;sa=sa+288|0;c[v+208>>2]=c[d>>2];c[v+208+4>>2]=c[d+4>>2];c[v+208+8>>2]=c[d+8>>2];c[v+208+12>>2]=c[d+12>>2];n=v+208+16|0;c[n>>2]=c[e>>2];c[n+4>>2]=c[e+4>>2];c[n+8>>2]=c[e+8>>2];c[n+12>>2]=c[e+12>>2];e=v+208+32|0;c[e>>2]=c[f>>2];c[e+4>>2]=c[f+4>>2];c[e+8>>2]=c[f+8>>2];c[e+12>>2]=c[f+12>>2];u=c[j>>2]|0;p=c[j+4>>2]|0;q=c[j+8>>2]|0;r=c[j+16>>2]|0;s=c[j+12>>2]|0;o=c[j+20>>2]|0;c[v+156>>2]=c[v+208>>2];c[v+156+4>>2]=c[v+208+4>>2];c[v+156+8>>2]=c[v+208+8>>2];c[v+156+12>>2]=c[v+208+12>>2];c[v+172>>2]=c[n>>2];c[v+172+4>>2]=c[n+4>>2];c[v+172+8>>2]=c[n+8>>2];c[v+172+12>>2]=c[n+12>>2];c[v+188>>2]=c[e>>2];c[v+188+4>>2]=c[e+4>>2];c[v+188+8>>2]=c[e+8>>2];c[v+188+12>>2]=c[e+12>>2];e=c[b+136>>2]|0;if((e|0)==(c[b+140>>2]|0)?(t=(e|0)==0?1:e<<1,(e|0)<(t|0)):0){if(!t)d=0;else{c[7182]=(c[7182]|0)+1;d=xb((t*284|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}e=c[b+136>>2]|0}if((e|0)>0){f=0;do{j=c[b+144>>2]|0;l=d+(f*284|0)|0;m=j+(f*284|0)|0;n=l+92|0;do{c[l>>2]=c[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));l=d+(f*284|0)+92|0;m=j+(f*284|0)+92|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];l=j+(f*284|0)+108|0;m=d+(f*284|0)+108|0;c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];m=j+(f*284|0)+124|0;l=d+(f*284|0)+124|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];l=d+(f*284|0)+140|0;m=j+(f*284|0)+140|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];l=d+(f*284|0)+156|0;m=j+(f*284|0)+156|0;n=l+128|0;do{c[l>>2]=c[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));f=f+1|0}while((f|0)!=(e|0))}e=c[b+144>>2]|0;if(e|0){if(a[b+148>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+144>>2]=0}a[b+148>>0]=1;c[b+144>>2]=d;c[b+140>>2]=t;e=c[b+136>>2]|0}d=c[b+144>>2]|0;l=d+(e*284|0)|0;m=v;n=l+92|0;do{c[l>>2]=c[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));l=d+(e*284|0)+92|0;c[l>>2]=c[v+92>>2];c[l+4>>2]=c[v+92+4>>2];c[l+8>>2]=c[v+92+8>>2];c[l+12>>2]=c[v+92+12>>2];l=d+(e*284|0)+108|0;c[l>>2]=c[v+108>>2];c[l+4>>2]=c[v+108+4>>2];c[l+8>>2]=c[v+108+8>>2];c[l+12>>2]=c[v+108+12>>2];l=d+(e*284|0)+124|0;c[l>>2]=c[v+124>>2];c[l+4>>2]=c[v+124+4>>2];c[l+8>>2]=c[v+124+8>>2];c[l+12>>2]=c[v+124+12>>2];l=d+(e*284|0)+140|0;c[l>>2]=c[v+140>>2];c[l+4>>2]=c[v+140+4>>2];c[l+8>>2]=c[v+140+8>>2];c[l+12>>2]=c[v+140+12>>2];d=d+(e*284|0)+156|0;l=d;m=v+156|0;n=l+48|0;do{c[l>>2]=c[m>>2];l=l+4|0;m=m+4|0}while((l|0)<(n|0));g[d+48>>2]=h;c[d+52>>2]=s;g[d+56>>2]=i;c[d+60>>2]=u;c[d+64>>2]=p;c[d+68>>2]=q;c[d+72>>2]=r;g[d+76>>2]=0.0;g[d+80>>2]=0.0;g[d+84>>2]=0.0;g[d+88>>2]=.10000000149011612;c[d+92>>2]=o;g[d+96>>2]=0.0;g[d+100>>2]=0.0;a[d+104>>0]=k&1;l=d+105|0;m=v+256|0;n=l+23|0;do{a[l>>0]=a[m>>0]|0;l=l+1|0;m=m+1|0}while((l|0)<(n|0));k=c[b+136>>2]|0;c[b+136>>2]=k+1;k=(c[b+144>>2]|0)+(k*284|0)|0;dg(c[b+116>>2]|0,k,0);Ld(c[b+116>>2]|0,c[b+144>>2]|0,(c[b+136>>2]|0)+-1|0,0);sa=v;return k|0}function hd(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0;if((h|0)<0){h=c[b+8>>2]|0;+Ea[c[(c[h>>2]|0)+12>>2]&3](h,d,e,f,g,c[b+12>>2]|0,c[b+16>>2]|0,c[b+4>>2]|0,c[b+20>>2]|0,c[b+24>>2]|0);return}o=c[b+16>>2]|0;a:do if((o|0)>0){l=c[b+12>>2]|0;i=0;while(1){m=l+(i<<2)|0;k=c[m>>2]|0;j=c[(c[k+28>>2]|0)+208>>2]|0;if((j|0)<=-1)j=c[(c[k+32>>2]|0)+208>>2]|0;if((j|0)==(h|0))break a;i=i+1|0;if((i|0)>=(o|0)){m=0;break}}}else{i=0;m=0}while(0);if((i|0)<(o|0)){n=c[b+12>>2]|0;j=0;do{l=c[n+(i<<2)>>2]|0;k=c[(c[l+28>>2]|0)+208>>2]|0;if((k|0)<=-1)k=c[(c[l+32>>2]|0)+208>>2]|0;j=j+((k|0)==(h|0)&1)|0;i=i+1|0}while((i|0)!=(o|0));h=j}else h=0;i=c[b+4>>2]|0;if((c[i+72>>2]|0)<2){o=c[b+8>>2]|0;+Ea[c[(c[o>>2]|0)+12>>2]&3](o,d,e,f,g,m,h,i,c[b+20>>2]|0,c[b+24>>2]|0);return}if((e|0)>0){n=0;i=c[b+32>>2]|0;j=c[b+36>>2]|0;do{o=d+(n<<2)|0;if((i|0)==(j|0)){l=(j|0)==0?1:j<<1;if((j|0)<(l|0)){if(!l)i=0;else{c[7182]=(c[7182]|0)+1;i=xb((l<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}j=c[b+32>>2]|0}if((j|0)>0){k=0;do{c[i+(k<<2)>>2]=c[(c[b+40>>2]|0)+(k<<2)>>2];k=k+1|0}while((k|0)!=(j|0))}k=c[b+40>>2]|0;if(k){if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);j=c[b+32>>2]|0}c[b+40>>2]=0}a[b+44>>0]=1;c[b+40>>2]=i;c[b+36>>2]=l;i=j;j=l}else i=j}c[(c[b+40>>2]|0)+(i<<2)>>2]=c[o>>2];i=i+1|0;c[b+32>>2]=i;n=n+1|0}while((n|0)!=(e|0))}if((g|0)>0){n=0;i=c[b+52>>2]|0;j=c[b+56>>2]|0;do{o=f+(n<<2)|0;if((i|0)==(j|0)){l=(j|0)==0?1:j<<1;if((j|0)<(l|0)){if(!l)i=0;else{c[7182]=(c[7182]|0)+1;i=xb((l<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}j=c[b+52>>2]|0}if((j|0)>0){k=0;do{c[i+(k<<2)>>2]=c[(c[b+60>>2]|0)+(k<<2)>>2];k=k+1|0}while((k|0)!=(j|0))}k=c[b+60>>2]|0;if(k){if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);j=c[b+52>>2]|0}c[b+60>>2]=0}a[b+64>>0]=1;c[b+60>>2]=i;c[b+56>>2]=l;i=j;j=l}else i=j}c[(c[b+60>>2]|0)+(i<<2)>>2]=c[o>>2];i=i+1|0;c[b+52>>2]=i;n=n+1|0}while((n|0)!=(g|0))}if(!h)i=c[b+72>>2]|0;else{o=0;i=c[b+72>>2]|0;j=c[b+76>>2]|0;do{n=m+(o<<2)|0;if((i|0)==(j|0)){l=(j|0)==0?1:j<<1;if((j|0)<(l|0)){if(!l){k=0;i=j}else{c[7182]=(c[7182]|0)+1;i=xb((l<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}k=i;i=c[b+72>>2]|0}if((i|0)>0){j=0;do{c[k+(j<<2)>>2]=c[(c[b+80>>2]|0)+(j<<2)>>2];j=j+1|0}while((j|0)!=(i|0))}j=c[b+80>>2]|0;if(j){if(a[b+84>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);i=c[b+72>>2]|0}c[b+80>>2]=0}a[b+84>>0]=1;c[b+80>>2]=k;c[b+76>>2]=l;j=l}else i=j}c[(c[b+80>>2]|0)+(i<<2)>>2]=c[n>>2];i=i+1|0;c[b+72>>2]=i;o=o+1|0}while((o|0)!=(h|0))}if(((c[b+52>>2]|0)+i|0)<=(c[(c[b+4>>2]|0)+72>>2]|0))return;wg(b);return}function id(d,f,h,i){d=d|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0;v=sa;sa=sa+80|0;u=c[d+48>>2]|0;c[v>>2]=9672;c[v+4>>2]=u;c[v+8>>2]=f;u=c[d+52>>2]|0;if(!(a[u+60>>0]|0)){f=c[u+56>>2]|0;if((f|0)>0){o=0;d=0;n=c[u+96>>2]|0;while(1){d=d+1|0;if(!(+g[h>>2]>+g[n+16>>2])?!(+g[i>>2]<+g[n>>2]):0)j=1;else j=0;if(!(!(+g[h+8>>2]>+g[n+24>>2])?!(+g[i+8>>2]<+g[n+8>>2]):0))j=0;if(!(+g[h+4>>2]>+g[n+20>>2])?!(+g[i+4>>2]<+g[n+4>>2]):0){k=c[n+32>>2]|0;if(j&(k|0)==-1){Za[c[(c[v>>2]|0)+8>>2]&127](v,c[n+36>>2]|0,c[n+40>>2]|0);f=c[u+56>>2]|0;m=44}else{l=(k|0)==-1;m=43}}else{k=c[n+32>>2]|0;j=0;l=(k|0)==-1;m=43}if((m|0)==43){m=0;if(l|j)m=44;else{l=n+(k<<6)|0;j=k+o|0}}if((m|0)==44){l=n+64|0;j=o+1|0}if((j|0)<(f|0)){o=j;n=l}else break}}else d=0;if((c[7162]|0)>=(d|0)){sa=v;return}c[7162]=d;sa=v;return}x=+g[h>>2];B=+g[h+4>>2];F=+g[h+8>>2];E=+g[u+4>>2];x=x>2];B=B>2];F=F>2];C=+g[u+24>>2];y=+g[u+28>>2];H=+g[u+36>>2];D=+g[u+40>>2];z=+g[u+44>>2];r=~~(((G>1]=r;s=~~(((C>1]=s;b[v+66+4>>1]=t;F=+g[i>>2];B=+g[i+4>>2];x=+g[i+8>>2];F=F>1]=i;p=~~(D*((C>1]=p;b[v+60+4>>1]=q;switch(c[u+144>>2]|0){case 0:{n=c[u+56>>2]|0;if((n|0)>0){d=0;f=c[u+136>>2]|0;j=0;do{d=d+1|0;k=((i&65535)>=(e[f>>1]|0)?(r&65535)<=(e[f+6>>1]|0):0)&(t&65535)<=(e[f+10>>1]|0)&(q&65535)>=(e[f+4>>1]|0)&(s&65535)<=(e[f+8>>1]|0)&(p&65535)>=(e[f+2>>1]|0);l=f+12|0;m=c[l>>2]|0;if((m|0)>-1&k)Za[c[(c[v>>2]|0)+8>>2]&127](v,21?m>>>21:m,m&2097151);if(k|(m|0)>-1){j=j+1|0;f=f+16|0}else{u=c[l>>2]|0;j=j-u|0;f=f+(0-u<<4)|0}}while((j|0)<(n|0))}else d=0;if((c[7162]|0)<(d|0))c[7162]=d;break}case 1:{if((c[u+152>>2]|0)>0){h=0;do{d=c[u+160>>2]|0;if(((i&65535)>=(e[d+(h<<5)>>1]|0)?(r&65535)<=(e[d+(h<<5)+6>>1]|0):0)&(t&65535)<=(e[d+(h<<5)+10>>1]|0)&(q&65535)>=(e[d+(h<<5)+4>>1]|0)&(s&65535)<=(e[d+(h<<5)+8>>1]|0)&(p&65535)>=(e[d+(h<<5)+2>>1]|0)){o=c[d+(h<<5)+12>>2]|0;n=c[d+(h<<5)+16>>2]|0;a:do if((n|0)>0){d=0;f=(c[u+136>>2]|0)+(o<<4)|0;j=o;while(1){d=d+1|0;k=((i&65535)>=(e[f>>1]|0)?(r&65535)<=(e[f+6>>1]|0):0)&(t&65535)<=(e[f+10>>1]|0)&(q&65535)>=(e[f+4>>1]|0)&(s&65535)<=(e[f+8>>1]|0)&(p&65535)>=(e[f+2>>1]|0);l=f+12|0;m=c[l>>2]|0;if((m|0)>-1&k)Za[c[(c[v>>2]|0)+8>>2]&127](v,21?m>>>21:m,m&2097151);if(k|(m|0)>-1){j=j+1|0;f=f+16|0}else{m=c[l>>2]|0;j=j-m|0;f=f+(0-m<<4)|0}if((j|0)>=(n+o|0))break a}}else d=0;while(0);if((c[7162]|0)<(d|0))c[7162]=d}h=h+1|0}while((h|0)<(c[u+152>>2]|0))}break}case 2:{Wj(c[u+136>>2]|0,v,v+66|0,v+60|0);break}default:{}}sa=v;return}function jd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+24>>2]=d;g[b+28>>2]=0.0;c[b+32>>2]=0;c[b+36>>2]=1;g[b+40>>2]=1.0;a[b+44>>0]=1;c[b+48>>2]=0;a[b+52>>0]=0;a[b+53>>0]=1;a[b+54>>0]=1;g[b+56>>2]=.03999999910593033;a[b+60>>0]=0;g[b+64>>2]=0.0;c[b+68>>2]=e;c[b+72>>2]=0;a[b+76>>0]=1;c[b+80>>2]=0;c[b+84>>2]=0;c[b+88>>2]=0;g[b+92>>2]=.6000000238418579;g[b+96>>2]=1.0;g[b+100>>2]=.30000001192092896;g[b+104>>2]=.01666666753590107;g[b+108>>2]=0.0;g[b+116>>2]=20.0;c[b+112>>2]=10;g[b+124>>2]=.20000000298023224;g[b+128>>2]=.800000011920929;g[b+132>>2]=0.0;g[b+120>>2]=1.0;c[b+136>>2]=1;g[b+140>>2]=-.03999999910593033;g[b+144>>2]=.10000000149011612;g[b+148>>2]=0.0;g[b+152>>2]=.8500000238418579;c[b+156>>2]=260;c[b+160>>2]=2;c[b+164>>2]=128;g[b+168>>2]=100.0;g[b+172>>2]=1000000015047466219876688.0e6;c[b>>2]=6904;a[b+192>>0]=1;c[b+188>>2]=0;c[b+180>>2]=0;c[b+184>>2]=0;c[b+196>>2]=0;c[b+200>>2]=f;a[b+224>>0]=1;c[b+220>>2]=0;c[b+212>>2]=0;c[b+216>>2]=0;a[b+244>>0]=1;c[b+240>>2]=0;c[b+232>>2]=0;c[b+236>>2]=0;c[b+248>>2]=0;c[b+252>>2]=-1054867456;a[b+274>>0]=0;a[b+275>>0]=0;c[b+256>>2]=0;c[b+256+4>>2]=0;c[b+256+8>>2]=0;c[b+256+12>>2]=0;a[b+292>>0]=1;c[b+288>>2]=0;c[b+280>>2]=0;c[b+284>>2]=0;c[b+296>>2]=0;a[b+300>>0]=1;a[b+320>>0]=1;c[b+316>>2]=0;c[b+308>>2]=0;c[b+312>>2]=0;if(!f){c[7182]=(c[7182]|0)+1;e=xb(215)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=7568;a[e+20>>0]=1;c[e+16>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;a[e+40>>0]=1;c[e+36>>2]=0;c[e+28>>2]=0;c[e+32>>2]=0;a[e+60>>0]=1;c[e+56>>2]=0;c[e+48>>2]=0;c[e+52>>2]=0;a[e+80>>0]=1;c[e+76>>2]=0;c[e+68>>2]=0;c[e+72>>2]=0;a[e+100>>0]=1;c[e+96>>2]=0;c[e+88>>2]=0;c[e+92>>2]=0;a[e+120>>0]=1;c[e+116>>2]=0;c[e+108>>2]=0;c[e+112>>2]=0;a[e+140>>0]=1;c[e+136>>2]=0;c[e+128>>2]=0;c[e+132>>2]=0;a[e+160>>0]=1;c[e+156>>2]=0;c[e+148>>2]=0;c[e+152>>2]=0;a[e+180>>0]=1;c[e+176>>2]=0;c[e+168>>2]=0;c[e+172>>2]=0;c[e+192>>2]=0;c[b+200>>2]=e;e=1}else e=0;a[b+273>>0]=e;c[7182]=(c[7182]|0)+1;e=xb(87)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}c[e>>2]=8264;a[e+20>>0]=1;c[e+16>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;a[e+40>>0]=1;c[e+36>>2]=0;c[e+28>>2]=0;c[e+32>>2]=0;a[e+60>>0]=1;c[e+56>>2]=0;c[e+48>>2]=0;c[e+52>>2]=0;a[e+64>>0]=1;c[b+204>>2]=e;a[b+272>>0]=1;c[7182]=(c[7182]|0)+1;e=xb(107)|0;if(!e){f=0;h=c[b+200>>2]|0;c[f>>2]=7116;e=f+4|0;c[e>>2]=0;e=f+8|0;c[e>>2]=h;e=f+12|0;c[e>>2]=0;e=f+16|0;c[e>>2]=0;e=f+20|0;c[e>>2]=0;e=f+24|0;c[e>>2]=d;d=f+44|0;a[d>>0]=1;d=f+40|0;c[d>>2]=0;d=f+32|0;c[d>>2]=0;d=f+36|0;c[d>>2]=0;d=f+64|0;a[d>>0]=1;d=f+60|0;c[d>>2]=0;d=f+52|0;c[d>>2]=0;d=f+56|0;c[d>>2]=0;d=f+84|0;a[d>>0]=1;d=f+80|0;c[d>>2]=0;d=f+72|0;c[d>>2]=0;d=f+76|0;c[d>>2]=0;c[b+196>>2]=f;return}c[(e+4+15&-16)+-4>>2]=e;h=e+4+15&-16;e=c[b+200>>2]|0;c[h>>2]=7116;f=h+4|0;c[f>>2]=0;f=h+8|0;c[f>>2]=e;f=h+12|0;c[f>>2]=0;f=h+16|0;c[f>>2]=0;f=h+20|0;c[f>>2]=0;f=h+24|0;c[f>>2]=d;d=h+44|0;a[d>>0]=1;d=h+40|0;c[d>>2]=0;d=h+32|0;c[d>>2]=0;d=h+36|0;c[d>>2]=0;d=h+64|0;a[d>>0]=1;d=h+60|0;c[d>>2]=0;d=h+52|0;c[d>>2]=0;d=h+56|0;c[d>>2]=0;d=h+84|0;a[d>>0]=1;d=h+80|0;c[d>>2]=0;d=h+72|0;c[d>>2]=0;d=h+76|0;c[d>>2]=0;c[b+196>>2]=h;return}function kd(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0,i=0,j=0.0,k=0,l=0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0,v=0.0;t=sa;sa=sa+96|0;r=c[b+12>>2]|0;ab[c[(c[r>>2]|0)+8>>2]&127](r,(c[b+8>>2]|0)+4|0,t+80|0,t+64|0);r=c[d+68>>2]|0;eb[c[(c[r>>2]|0)+16>>2]&31](r,c[(c[b+8>>2]|0)+188>>2]|0,t+80|0,t+64|0,c[d+24>>2]|0);r=c[d+24>>2]|0;ab[c[(c[r>>2]|0)+32>>2]&127](r,c[(c[b+8>>2]|0)+284>>2]|0,d+28|0,r);r=c[b+8>>2]|0;c[b+92>>2]=c[r+52>>2];c[b+92+4>>2]=c[r+52+4>>2];c[b+92+8>>2]=c[r+52+8>>2];c[b+92+12>>2]=c[r+52+12>>2];r=c[r+284>>2]|0;if((Fa[c[(c[r>>2]|0)+36>>2]&127](r)|0)>0){d=0;f=0.0;r=0;do{e=c[b+132>>2]|0;if((e|0)<0){if((c[b+136>>2]|0)<0){h=c[b+140>>2]|0;if(h|0){if(a[b+144>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+140>>2]=0}a[b+144>>0]=1;c[b+140>>2]=0;c[b+136>>2]=0}do{c[(c[b+140>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[b+132>>2]=0;e=c[(c[b+8>>2]|0)+284>>2]|0;e=c[(Fa[c[(c[e>>2]|0)+28>>2]&127](e)|0)+12>>2]|0;q=c[c[e+(r<<4)>>2]>>2]|0;h=c[c[e+(r<<4)+4>>2]>>2]|0;if(!((q|0)!=0?(c[q+204>>2]&4|0)!=0:0))s=15;do if((s|0)==15){s=0;if(h|0?c[h+204>>2]&4|0:0)break;e=c[e+(r<<4)+8>>2]|0;if(e|0)Va[c[(c[e>>2]|0)+16>>2]&127](e,b+128|0);q=c[b+132>>2]|0;if((q|0)>0){o=c[b+140>>2]|0;p=c[b+8>>2]|0;n=0;do{l=c[o+(n<<2)>>2]|0;m=(c[l+740>>2]|0)==(p|0)?-1.0:1.0;e=c[l+748>>2]|0;if((e|0)>0){k=0;do{j=+g[l+4+(k*184|0)+80>>2];if(j<0.0){i=l+4+(k*184|0)+64|0;if(j>2];h=l+4+(k*184|0)+72|0;f=m*+g[h>>2];g[b+152>>2]=m*+g[i>>2];g[b+156>>2]=u;g[b+160>>2]=f;g[b+164>>2]=0.0;f=j;e=c[l+748>>2]|0}else{d=l+4+(k*184|0)+68|0;h=l+4+(k*184|0)+72|0}v=j*m*+g[d>>2]*.20000000298023224;u=j*m*+g[h>>2]*.20000000298023224;g[b+92>>2]=j*m*+g[i>>2]*.20000000298023224+ +g[b+92>>2];g[b+96>>2]=v+ +g[b+96>>2];g[b+100>>2]=u+ +g[b+100>>2];d=1}k=k+1|0}while((k|0)<(e|0))}n=n+1|0}while((n|0)!=(q|0))}}while(0);r=r+1|0;q=c[(c[b+8>>2]|0)+284>>2]|0}while((r|0)<(Fa[c[(c[q>>2]|0)+36>>2]&127](q)|0))}else d=0;s=c[b+8>>2]|0;c[t>>2]=c[s+4>>2];c[t+4>>2]=c[s+4+4>>2];c[t+8>>2]=c[s+4+8>>2];c[t+12>>2]=c[s+4+12>>2];c[t+16>>2]=c[s+20>>2];c[t+16+4>>2]=c[s+20+4>>2];c[t+16+8>>2]=c[s+20+8>>2];c[t+16+12>>2]=c[s+20+12>>2];c[t+32>>2]=c[s+36>>2];c[t+32+4>>2]=c[s+36+4>>2];c[t+32+8>>2]=c[s+36+8>>2];c[t+32+12>>2]=c[s+36+12>>2];c[t+48>>2]=c[b+92>>2];c[t+48+4>>2]=c[b+92+4>>2];c[t+48+8>>2]=c[b+92+8>>2];c[t+48+12>>2]=c[b+92+12>>2];c[s+260>>2]=(c[s+260>>2]|0)+1;c[s+4>>2]=c[t>>2];c[s+4+4>>2]=c[t+4>>2];c[s+4+8>>2]=c[t+8>>2];c[s+4+12>>2]=c[t+12>>2];c[s+20>>2]=c[t+16>>2];c[s+20+4>>2]=c[t+16+4>>2];c[s+20+8>>2]=c[t+16+8>>2];c[s+20+12>>2]=c[t+16+12>>2];c[s+36>>2]=c[t+32>>2];c[s+36+4>>2]=c[t+32+4>>2];c[s+36+8>>2]=c[t+32+8>>2];c[s+36+12>>2]=c[t+32+12>>2];c[s+52>>2]=c[t+48>>2];c[s+52+4>>2]=c[t+48+4>>2];c[s+52+8>>2]=c[t+48+8>>2];c[s+52+12>>2]=c[t+48+12>>2];sa=t;return d|0}function ld(d,e,f,h,i){d=d|0;e=e|0;f=+f;h=+h;i=+i;var j=0,k=0.0,l=0.0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0;m=sa;sa=sa+240|0;k=+g[d+96>>2]+h;l=+g[d+100>>2]+i;g[d+112>>2]=+g[d+92>>2]+f;g[d+116>>2]=k;g[d+120>>2]=l;g[d+124>>2]=0.0;c[m+168>>2]=1065353216;c[m+168+4>>2]=0;c[m+168+4+4>>2]=0;c[m+168+4+8>>2]=0;c[m+168+4+12>>2]=0;c[m+168+20>>2]=1065353216;c[m+168+24>>2]=0;c[m+168+24+4>>2]=0;c[m+168+24+8>>2]=0;c[m+168+24+12>>2]=0;c[m+168+40>>2]=1065353216;j=m+168+44|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;c[m+104>>2]=1065353216;c[m+104+4>>2]=0;c[m+104+4+4>>2]=0;c[m+104+4+8>>2]=0;c[m+104+4+12>>2]=0;c[m+104+20>>2]=1065353216;c[m+104+24>>2]=0;c[m+104+24+4>>2]=0;c[m+104+24+8>>2]=0;c[m+104+24+12>>2]=0;c[m+104+40>>2]=1065353216;j=m+104+44|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;l=1.0;j=10;while(1){if(!j){j=15;break}j=j+-1|0;c[m+168+48>>2]=c[d+92>>2];c[m+168+48+4>>2]=c[d+92+4>>2];c[m+168+48+8>>2]=c[d+92+8>>2];c[m+168+48+12>>2]=c[d+92+12>>2];c[m+104+48>>2]=c[d+112>>2];c[m+104+48+4>>2]=c[d+112+4>>2];c[m+104+48+8>>2]=c[d+112+8>>2];c[m+104+48+12>>2]=c[d+112+12>>2];i=+g[d+92>>2]-+g[d+112>>2];k=+g[d+96>>2]-+g[d+116>>2];f=+g[d+100>>2]-+g[d+120>>2];n=c[d+8>>2]|0;g[m+4>>2]=1.0;c[m+76>>2]=0;c[m+12>>2]=0;c[m+12+4>>2]=0;c[m+12+8>>2]=0;c[m+12+12>>2]=0;c[m+12+16>>2]=0;c[m+12+20>>2]=0;c[m+12+24>>2]=0;c[m+12+28>>2]=0;c[m>>2]=7748;c[m+80>>2]=n;g[m+84>>2]=i;g[m+88>>2]=k;g[m+92>>2]=f;g[m+96>>2]=0.0;g[m+100>>2]=0.0;n=c[n+188>>2]|0;b[m+8>>1]=b[n+4>>1]|0;b[m+10>>1]=b[n+6>>1]|0;n=c[d+12>>2]|0;f=+va[c[(c[n>>2]|0)+48>>2]&15](n);n=c[d+12>>2]|0;Qa[c[(c[n>>2]|0)+44>>2]&31](n,f+ +g[d+56>>2]);if(!(a[d+170>>0]|0))Tc(e,c[d+12>>2]|0,m+168|0,m+104|0,m,+g[e+56>>2]);else yc(c[d+8>>2]|0,c[d+12>>2]|0,m+168|0,m+104|0,m,+g[e+56>>2]);n=c[d+12>>2]|0;Qa[c[(c[n>>2]|0)+44>>2]&31](n,f);k=+g[m+4>>2];l=l-k;if(k<1.0){h=+g[d+112>>2]-+g[d+92>>2];i=+g[d+116>>2]-+g[d+96>>2];k=+g[d+120>>2]-+g[d+100>>2];f=+x(+(h*h+i*i+k*k));if(f>1.1920928955078125e-07){o=+g[m+44>>2];t=+g[m+48>>2];q=+g[m+52>>2];s=(h*(1.0/f)*o+i*(1.0/f)*t+k*(1.0/f)*q)*2.0;r=1.0/+x(+((k*(1.0/f)-q*s)*(k*(1.0/f)-q*s)+((h*(1.0/f)-o*s)*(h*(1.0/f)-o*s)+(i*(1.0/f)-t*s)*(i*(1.0/f)-t*s))));p=q*(k*(1.0/f)-q*s)*r+(o*(h*(1.0/f)-o*s)*r+t*(i*(1.0/f)-t*s)*r);c[d+112>>2]=c[d+92>>2];c[d+112+4>>2]=c[d+92+4>>2];c[d+112+8>>2]=c[d+92+8>>2];c[d+112+12>>2]=c[d+92+12>>2];o=f*((h*(1.0/f)-o*s)*r-o*p)+ +g[d+112>>2];g[d+112>>2]=o;h=f*((i*(1.0/f)-t*s)*r-t*p)+ +g[d+116>>2];g[d+116>>2]=h;k=f*((k*(1.0/f)-q*s)*r-q*p)+ +g[d+120>>2];g[d+120>>2]=k;f=o}else{f=+g[d+112>>2];h=+g[d+116>>2];k=+g[d+120>>2]}i=f-+g[d+92>>2];h=h-+g[d+96>>2];f=k-+g[d+100>>2];if(!(i*i+h*h+f*f>1.1920928955078125e-07)){j=13;break}t=1.0/+x(+(i*i+h*h+f*f));if(i*t*+g[d+76>>2]+h*t*+g[d+80>>2]+f*t*+g[d+84>>2]<=0.0){j=13;break}}else{c[d+92>>2]=c[d+112>>2];c[d+92+4>>2]=c[d+112+4>>2];c[d+92+8>>2]=c[d+112+8>>2];c[d+92+12>>2]=c[d+112+12>>2]}if(!(l>.009999999776482582)){j=15;break}}if((j|0)==13){sa=m;return}else if((j|0)==15){sa=m;return}}function md(b,d,e){b=b|0;d=+d;e=+e;var f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0.0;r=sa;sa=sa+80|0;f=c[b+8>>2]|0;if(!f){f=c[b+4>>2]|0;if(!f){d=0.0;j=0.0;m=0.0;n=0.0;k=0.0;l=0.0}else{q=+g[f+336>>2];m=+g[b+172>>2];n=+g[f+340>>2];o=+g[b+168>>2];l=+g[b+164>>2];p=+g[f+332>>2];d=q*m-n*o;j=+g[f+316>>2];m=n*l-m*p;n=+g[f+320>>2];k=+g[f+324>>2];l=o*p-q*l}}else{q=+g[f+332>>2];m=+g[b+172>>2];n=+g[f+336>>2];o=+g[b+168>>2];l=+g[b+164>>2];p=+g[f+328>>2];d=q*m-n*o;j=+g[f+312>>2];m=n*l-m*p;n=+g[f+316>>2];k=+g[f+320>>2];l=o*p-q*l}o=j+d;q=n+m;p=k+l;f=c[b+20>>2]|0;if(!f){f=c[b+16>>2]|0;if(!f){d=0.0;j=0.0;m=0.0;n=0.0;k=0.0;l=0.0}else{s=+g[f+336>>2];m=+g[b+188>>2];n=+g[f+340>>2];u=+g[b+184>>2];l=+g[b+180>>2];t=+g[f+332>>2];d=s*m-n*u;j=+g[f+316>>2];m=n*l-m*t;n=+g[f+320>>2];k=+g[f+324>>2];l=u*t-s*l}}else{u=+g[f+332>>2];m=+g[b+188>>2];n=+g[f+336>>2];s=+g[b+184>>2];l=+g[b+180>>2];t=+g[f+328>>2];d=u*m-n*s;j=+g[f+312>>2];m=n*l-m*t;n=+g[f+316>>2];k=+g[f+320>>2];l=s*t-u*l}o=o-(j+d);m=q-(n+m);d=p-(k+l);j=+g[b+196>>2];k=+g[b+200>>2];l=+g[b+204>>2];a[r+36+32>>0]=1;c[r+36+16>>2]=0;c[r+36+16+4>>2]=0;c[r+36+16+8>>2]=0;c[r+36+16+12>>2]=0;c[r+36>>2]=c[b+72>>2];c[r+36+4>>2]=c[b+72+4>>2];c[r+36+8>>2]=c[b+72+8>>2];c[r+36+12>>2]=c[b+72+12>>2];if(j*o+m*k+d*l<0.0){s=+g[b+212>>2];t=+g[r+36>>2]+(j*(j*o+m*k+d*l)+(o-j*(j*o+m*k+d*l))*s);g[r+36>>2]=t;u=k*(j*o+m*k+d*l)+(m-k*(j*o+m*k+d*l))*s+ +g[r+36+4>>2];g[r+36+4>>2]=u;k=l*(j*o+m*k+d*l)+(d-l*(j*o+m*k+d*l))*s+ +g[r+36+8>>2];g[r+36+8>>2]=k;f=r+36+4|0;h=r+36+8|0;i=r+36|0;d=t;j=u}else{f=r+36+4|0;h=r+36+8|0;i=r+36|0;d=+g[r+36>>2];j=+g[r+36+4>>2];k=+g[r+36+8>>2]}l=(+g[b+104>>2]*d+ +g[b+108>>2]*j+ +g[b+112>>2]*k)*e;m=(d*+g[b+120>>2]+j*+g[b+124>>2]+k*+g[b+128>>2])*e;d=(d*+g[b+136>>2]+j*+g[b+140>>2]+k*+g[b+144>>2])*e;g[i>>2]=l;g[f>>2]=m;g[h>>2]=d;g[r+36+12>>2]=0.0;f=c[b+4>>2]|0;if((f|0)!=(c[b+16>>2]|0)){f=r;h=r+36|0;i=f+36|0;do{c[f>>2]=c[h>>2];f=f+4|0;h=h+4|0}while((f|0)<(i|0));u=-+g[r+4>>2];t=-+g[r+8>>2];g[r>>2]=-+g[r>>2];g[r+4>>2]=u;g[r+8>>2]=t;g[r+12>>2]=0.0;t=-+g[r+20>>2];u=-+g[r+24>>2];g[r+16>>2]=-+g[r+16>>2];g[r+20>>2]=t;g[r+24>>2]=u;g[r+28>>2]=0.0;dh(b+4|0,r,b+164|0);dh(b+16|0,r+36|0,b+180|0);sa=r;return}if(!(l==l&m==m&(d==d&0.0==0.0))){sa=r;return}u=+x(+(l*l+m*m+d*d));if(u<+g[f+368>>2]){sa=r;return}h=c[r+36+32>>2]|0;u=+g[f+372>>2];g[r+12>>2]=0.0;g[r+28>>2]=0.0;c[r+32>>2]=h;g[r>>2]=-(l*u);g[r+4>>2]=-(m*u);g[r+8>>2]=-(d*u);g[r+16>>2]=u*-0.0;g[r+20>>2]=u*-0.0;g[r+24>>2]=u*-0.0;dh(b+4|0,r,b+164|0);d=+g[(c[b+4>>2]|0)+372>>2];f=r;h=r+36|0;i=f+36|0;do{c[f>>2]=c[h>>2];f=f+4|0;h=h+4|0}while((f|0)<(i|0));g[r>>2]=d*+g[r>>2];g[r+4>>2]=d*+g[r+4>>2];g[r+8>>2]=d*+g[r+8>>2];g[r+16>>2]=d*+g[r+16>>2];g[r+20>>2]=d*+g[r+20>>2];g[r+24>>2]=d*+g[r+24>>2];dh(b+16|0,r,b+180|0);sa=r;return}function nd(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0.0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0,r=0,s=0.0,t=0.0;r=sa;sa=sa+48|0;c[r+16>>2]=c[e>>2];c[r+16+4>>2]=c[e+4>>2];c[r+16+8>>2]=c[e+8>>2];c[r+16+12>>2]=c[e+12>>2];c[r+16+16>>2]=c[f>>2];c[r+16+16+4>>2]=c[f+4>>2];c[r+16+16+8>>2]=c[f+8>>2];c[r+16+16+12>>2]=c[f+12>>2];do if((c[d+60>>2]|0)==2){h=c[d+48>>2]|0;sg(b+64|0,h)|0;i=c[b+68>>2]|0;if(i|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+68>>2]=h;c[b+76>>2]=(c[b+76>>2]|0)+-1;h=c[b+8>>2]|0;if(!h){c[7182]=(c[7182]|0)+1;h=xb(63)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}i=h;j=i+44|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(j|0))}else c[b+8>>2]=0;c[h+32>>2]=0;c[h+36>>2]=d;c[h+40>>2]=0;c[h>>2]=c[r+16>>2];c[h+4>>2]=c[r+16+4>>2];c[h+8>>2]=c[r+16+8>>2];c[h+12>>2]=c[r+16+12>>2];c[h+16>>2]=c[r+16+16>>2];c[h+20>>2]=c[r+16+20>>2];c[h+24>>2]=c[r+16+24>>2];c[h+28>>2]=c[r+16+28>>2];ue(b+4|0,c[b+4>>2]|0,h);c[b+16>>2]=(c[b+16>>2]|0)+1;c[d+48>>2]=h;h=1}else{c[b+168>>2]=(c[b+168>>2]|0)+1;q=c[d+48>>2]|0;if(((((+g[q>>2]<=+g[r+16+16>>2]?+g[q+16>>2]>=+g[r+16>>2]:0)?+g[q+4>>2]<=+g[r+16+20>>2]:0)?+g[q+20>>2]>=+g[r+16+4>>2]:0)?+g[q+8>>2]<=+g[r+16+24>>2]:0)?+g[q+24>>2]>=+g[r+16+8>>2]:0){k=+g[d+16>>2];s=+g[e>>2]-k;l=+g[d+20>>2];o=+g[e+4>>2]-l;m=+g[d+24>>2];p=+g[e+8>>2]-m;t=+g[b+140>>2];k=(+g[d+32>>2]-k)*.5*t;l=t*(+g[d+36>>2]-l)*.5;m=t*(+g[d+40>>2]-m)*.5;g[r>>2]=k;g[r+4>>2]=l;g[r+8>>2]=m;g[r+12>>2]=0.0;if(s<0.0)g[r>>2]=-k;if(o<0.0)g[r+4>>2]=-l;if(p<0.0)g[r+8>>2]=-m;if(Bg(b+4|0,q,r+16|0,r,.05000000074505806)|0){c[b+172>>2]=(c[b+172>>2]|0)+1;h=1}else h=0;break}h=sg(b+4|0,q)|0;a:do if(h){n=c[b+12>>2]|0;if((n|0)<=-1){h=c[b+4>>2]|0;break}if(n){i=0;while(1){j=c[h+32>>2]|0;i=i+1|0;if(!j)break a;if((i|0)>=(n|0)){h=j;break}else h=j}}}else h=0;while(0);c[q>>2]=c[r+16>>2];c[q+4>>2]=c[r+16+4>>2];c[q+8>>2]=c[r+16+8>>2];c[q+12>>2]=c[r+16+12>>2];c[q+16>>2]=c[r+16+16>>2];c[q+20>>2]=c[r+16+20>>2];c[q+24>>2]=c[r+16+24>>2];c[q+28>>2]=c[r+16+28>>2];ue(b+4|0,h,q);c[b+172>>2]=(c[b+172>>2]|0)+1;h=1}while(0);i=c[d+52>>2]|0;if(!i)i=b+124+(c[d+60>>2]<<2)|0;else i=i+56|0;c[i>>2]=c[d+56>>2];i=c[d+56>>2]|0;if(i|0)c[i+52>>2]=c[d+52>>2];c[d+16>>2]=c[e>>2];c[d+16+4>>2]=c[e+4>>2];c[d+16+8>>2]=c[e+8>>2];c[d+16+12>>2]=c[e+12>>2];c[d+32>>2]=c[f>>2];c[d+32+4>>2]=c[f+4>>2];c[d+32+8>>2]=c[f+8>>2];c[d+32+12>>2]=c[f+12>>2];i=c[b+144>>2]|0;c[d+60>>2]=i;c[d+52>>2]=0;c[d+56>>2]=c[b+124+(i<<2)>>2];j=c[b+124+(i<<2)>>2]|0;if(j|0)c[j+52>>2]=d;c[b+124+(i<<2)>>2]=d;if(!h){sa=r;return}a[b+194>>0]=1;if(a[b+193>>0]|0){sa=r;return}c[r>>2]=11812;c[r+4>>2]=b;zd(b+64|0,c[b+64>>2]|0,c[d+48>>2]|0,r);zd(b+4|0,c[b+4>>2]|0,c[d+48>>2]|0,r);sa=r;return}function od(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0;G=+g[a>>2];H=+g[b>>2];I=+g[a+4>>2];w=+g[b+4>>2];y=+g[a+8>>2];z=+g[b+8>>2];A=+g[d>>2];B=+g[d+4>>2];C=+g[d+8>>2];D=(I-w)*(z-C)-(y-z)*(w-B);E=(y-z)*(H-A)-(G-H)*(z-C);F=(G-H)*(w-B)-(I-w)*(H-A);if(!(F*F+(D*D+E*E)>0.0)){I=-1.0;return +I}if(G*(F*(I-w)-E*(y-z))+I*(D*(y-z)-F*(G-H))+(E*(G-H)-D*(I-w))*y>0.0){do if((H-G)*(H-G)+(w-I)*(w-I)+(z-y)*(z-y)>0.0){h=-(G*(H-G)+I*(w-I)+y*(z-y))/((H-G)*(H-G)+(w-I)*(w-I)+(z-y)*(z-y));if(h>=1.0){l=2;i=H*H+w*w+z*z;m=0;k=1065353216;break}if(!(h<=0.0)){k=(g[j>>2]=h,c[j>>2]|0);l=3;i=(y+(z-y)*h)*(y+(z-y)*h)+((G+(H-G)*h)*(G+(H-G)*h)+(I+(w-I)*h)*(I+(w-I)*h));m=(g[j>>2]=1.0-h,c[j>>2]|0);break}else{l=1;i=G*G+I*I+y*y;m=1065353216;k=0;break}}else{l=0;i=-1.0;m=0;k=0}while(0);c[f>>2]=l;c[e>>2]=m;c[e+4>>2]=k;g[e+8>>2]=0.0;q=+g[b>>2];r=+g[b+4>>2];s=+g[b+8>>2]}else{i=-1.0;l=0;m=0;k=0;q=H;r=w;s=z}if(q*(F*(w-B)-E*(z-C))+r*(D*(z-C)-F*(H-A))+(E*(H-A)-D*(w-B))*s>0.0){t=+g[d>>2];h=t-q;u=+g[d+4>>2];o=u-r;v=+g[d+8>>2];p=v-s;do if(h*h+o*o+p*p>0.0){n=-(q*h+r*o+s*p)/(h*h+o*o+p*p);if(n>=1.0){l=2;h=t*t+u*u+v*v;m=0;k=1065353216;break}if(!(n<=0.0)){k=(g[j>>2]=n,c[j>>2]|0);v=q+h*n;h=r+o*n;u=s+p*n;l=3;h=u*u+(v*v+h*h);m=(g[j>>2]=1.0-n,c[j>>2]|0);break}else{l=1;h=q*q+r*r+s*s;m=1065353216;k=0;break}}else h=-1.0;while(0);if(i<0.0|h>2]=l<<1&6;c[e+4>>2]=m;c[e+8>>2]=k;g[e>>2]=0.0;i=h}}h=+g[d>>2];o=+g[d+4>>2];p=+g[d+8>>2];if(h*(F*(B-I)-E*(C-y))+o*(D*(C-y)-F*(A-G))+(E*(A-G)-D*(B-I))*p>0.0){q=+g[a>>2];r=+g[a+4>>2];s=+g[a+8>>2];do if((q-h)*(q-h)+(r-o)*(r-o)+(s-p)*(s-p)>0.0){n=-(h*(q-h)+o*(r-o)+p*(s-p))/((q-h)*(q-h)+(r-o)*(r-o)+(s-p)*(s-p));if(n>=1.0){l=2;h=q*q+r*r+s*s;m=0;k=1065353216;break}if(!(n<=0.0)){k=(g[j>>2]=n,c[j>>2]|0);l=3;h=(p+(s-p)*n)*(p+(s-p)*n)+((h+(q-h)*n)*(h+(q-h)*n)+(o+(r-o)*n)*(o+(r-o)*n));m=(g[j>>2]=1.0-n,c[j>>2]|0);break}else{l=1;h=h*h+o*o+p*p;m=1065353216;k=0;break}}else h=-1.0;while(0);if(i<0.0|h>2]=l<<2&4|(1?l>>>1:l)&1;c[e+8>>2]=m;c[e>>2]=k;g[e+4>>2]=0.0}else h=i}else h=i;if(!(h<0.0)){I=h;return +I}u=+x(+(F*F+(D*D+E*E)));v=(D*+g[a>>2]+E*+g[a+4>>2]+F*+g[a+8>>2])/(F*F+(D*D+E*E));c[f>>2]=7;s=+g[b>>2]-D*v;r=+g[b+4>>2]-E*v;t=+g[b+8>>2]-F*v;H=+x(+(((H-A)*r-(w-B)*s)*((H-A)*r-(w-B)*s)+(((w-B)*t-(z-C)*r)*((w-B)*t-(z-C)*r)+((z-C)*s-(H-A)*t)*((z-C)*s-(H-A)*t))))/u;g[e>>2]=H;w=+g[d>>2]-D*v;t=+g[d+4>>2]-E*v;z=+g[d+8>>2]-F*v;I=+x(+(((A-G)*t-(B-I)*w)*((A-G)*t-(B-I)*w)+(((B-I)*z-(C-y)*t)*((B-I)*z-(C-y)*t)+((C-y)*w-(A-G)*z)*((C-y)*w-(A-G)*z))))/u;g[e+4>>2]=I;g[e+8>>2]=1.0-(H+I);I=F*v*F*v+(D*v*D*v+E*v*E*v);return +I}function pd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;var h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0,y=0,z=0,A=0.0,B=0.0,C=0,D=0,E=0;z=sa;sa=sa+192|0;o=c[b+4>>2]|0;q=+g[o+752>>2];if(q>2]|0;y=c[(c[b+8>>2]|0)+8>>2]|0;j=+g[e>>2];k=+g[d>>2]*f+j;l=+g[e+4>>2];m=+g[d+4>>2]*f+l;n=+g[e+8>>2];p=+g[d+8>>2]*f+n;if((v|0)!=(y|0)){i=c[(c[b+12>>2]|0)+8>>2]|0;B=k-+g[i+52>>2];A=m-+g[i+56>>2];t=p-+g[i+60>>2];u=b+12|0;h=y;r=B*+g[i+4>>2]+A*+g[i+20>>2]+t*+g[i+36>>2];s=B*+g[i+8>>2]+A*+g[i+24>>2]+t*+g[i+40>>2];t=B*+g[i+12>>2]+A*+g[i+28>>2]+t*+g[i+44>>2]}else{A=k-+g[v+52>>2];B=m-+g[v+56>>2];t=p-+g[v+60>>2];u=b+12|0;h=c[(c[b+12>>2]|0)+8>>2]|0;r=A*+g[v+4>>2]+B*+g[v+20>>2]+t*+g[v+36>>2];s=A*+g[v+8>>2]+B*+g[v+24>>2]+t*+g[v+40>>2];t=A*+g[v+12>>2]+B*+g[v+28>>2]+t*+g[v+44>>2]}j=j-+g[h+52>>2];l=l-+g[h+56>>2];B=n-+g[h+60>>2];n=j*+g[h+4>>2]+l*+g[h+20>>2]+B*+g[h+36>>2];A=j*+g[h+8>>2]+l*+g[h+24>>2]+B*+g[h+40>>2];B=j*+g[h+12>>2]+l*+g[h+28>>2]+B*+g[h+44>>2];g[z>>2]=r;g[z+4>>2]=s;g[z+8>>2]=t;g[z+12>>2]=0.0;g[z+16>>2]=n;g[z+20>>2]=A;g[z+24>>2]=B;g[z+28>>2]=0.0;c[z+64>>2]=c[d>>2];c[z+64+4>>2]=c[d+4>>2];c[z+64+8>>2]=c[d+8>>2];c[z+64+12>>2]=c[d+12>>2];g[z+80>>2]=f;g[z+84>>2]=0.0;g[z+88>>2]=0.0;g[z+92>>2]=0.0;c[z+112>>2]=0;a[z+116>>0]=0;c[z+120>>2]=0;c[z+120+4>>2]=0;c[z+120+8>>2]=0;c[z+120+12>>2]=0;c[z+120+16>>2]=0;c[z+120+20>>2]=0;c[z+120+24>>2]=0;c[z+120+28>>2]=0;g[z+48>>2]=k;g[z+52>>2]=m;g[z+56>>2]=p;g[z+60>>2]=0.0;c[z+32>>2]=c[e>>2];c[z+32+4>>2]=c[e+4>>2];c[z+32+8>>2]=c[e+8>>2];c[z+32+12>>2]=c[e+12>>2];i=c[o+748>>2]|0;if((i|0)>0){h=-1;e=0;j=q*q;while(1){k=+g[o+4+(e*184|0)>>2]-r;l=+g[o+4+(e*184|0)+4>>2]-s;m=+g[o+4+(e*184|0)+8>>2]-t;d=k*k+l*l+m*m>2]|0)+8>>2]|0;u=c[(c[u>>2]|0)+8>>2]|0;j=+g[i+224>>2]*+g[u+224>>2];j=j<-10.0?-10.0:j;g[z+84>>2]=j>10.0?10.0:j;g[z+92>>2]=+g[i+228>>2]*+g[u+228>>2];j=+g[i+232>>2]*+g[u+232>>2];j=j<-10.0?-10.0:j;g[z+88>>2]=j>10.0?10.0:j;j=+g[z+72>>2];if(+w(+j)>.7071067690849304){n=+g[z+68>>2];k=1.0/+x(+(j*j+n*n));m=+g[z+64>>2];l=-(m*n*k);m=m*-(j*k);f=(j*j+n*n)*k;n=n*k;j=-(j*k);k=0.0}else{A=+g[z+64>>2];B=+g[z+68>>2];k=1.0/+x(+(A*A+B*B));l=j*-(B*k);m=(A*A+B*B)*k;f=-(j*A*k);n=0.0;j=A*k;k=-(B*k)}g[z+152>>2]=k;g[z+156>>2]=j;g[z+160>>2]=n;g[z+168>>2]=f;g[z+172>>2]=l;g[z+176>>2]=m;if((v|0)!=(y|0)){h=b+24|0;d=b+28|0;e=b+16|0;i=b+20|0}else{h=b+28|0;d=b+24|0;e=b+20|0;i=b+16|0}h=c[h>>2]|0;y=c[d>>2]|0;v=c[e>>2]|0;c[z+96>>2]=c[i>>2];c[z+100>>2]=v;c[z+104>>2]=y;c[z+108>>2]=h;h=c[b+4>>2]|0;if((o|0)>-1){b=h+4+(o*184|0)+148|0;y=c[b>>2]|0;d=h+4+(o*184|0)+120|0;C=c[d>>2]|0;i=h+4+(o*184|0)+124|0;e=c[i>>2]|0;v=h+4+(o*184|0)+128|0;u=c[v>>2]|0;D=h+4+(o*184|0)+112|0;E=c[D>>2]|0;Bh(h+4+(o*184|0)|0,z|0,184)|0;c[D>>2]=E;c[d>>2]=C;c[i>>2]=e;c[v>>2]=u;c[b>>2]=y}else Ce(h,z)|0;sa=z;return}function qd(b){b=b|0;var d=0.0,e=0,f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0;p=sa;sa=sa+80|0;if((Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0?(j=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,(Fa[c[(c[j>>2]|0)+48>>2]&127](j)|0)&8|0):0)?(h=c[b+24>>2]|0,h=Fa[c[(c[h>>2]|0)+36>>2]&127](h)|0,c[p+64>>2]=1065353216,c[p+64+4>>2]=1065353216,c[p+64+8>>2]=0,g[p+64+12>>2]=0.0,(h|0)>0):0){e=0;do{i=c[b+24>>2]|0;i=Ha[c[(c[i>>2]|0)+40>>2]&31](i,e)|0;j=c[i+748>>2]|0;if((j|0)>0){f=0;do{q=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;$a[c[(c[q>>2]|0)+32>>2]&1](q,i+4+(f*184|0)+32|0,i+4+(f*184|0)+64|0,+g[i+4+(f*184|0)+80>>2],c[i+4+(f*184|0)+148>>2]|0,p+64|0);f=f+1|0}while((f|0)!=(j|0))}e=e+1|0}while((e|0)!=(h|0))}if(!(Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0)){sa=p;return}q=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;if(!((Fa[c[(c[q>>2]|0)+48>>2]&127](q)|0)&3)){sa=p;return}if((c[b+8>>2]|0)<=0){sa=p;return}j=0;do{i=c[(c[b+16>>2]|0)+(j<<2)>>2]|0;if(!(c[i+204>>2]&32)){if(Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0?(q=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,(Fa[c[(c[q>>2]|0)+48>>2]&127](q)|0)&1|0):0){c[p+64>>2]=1065353216;c[p+64+4>>2]=1065353216;c[p+64+8>>2]=1065353216;g[p+64+12>>2]=0.0;switch(c[i+216>>2]|0){case 1:{e=1065353216;f=1065353216;h=1065353216;break}case 2:{e=0;f=1065353216;h=0;break}case 3:{e=1065353216;f=1065353216;h=0;break}case 4:{e=0;f=0;h=1065353216;break}case 5:{e=0;f=1065353216;h=1065353216;break}default:{e=0;f=0;h=1065353216}}c[p+64>>2]=h;c[p+64+4>>2]=f;c[p+64+8>>2]=e;g[p+64+12>>2]=0.0;ab[c[(c[b>>2]|0)+28>>2]&127](b,i+4|0,c[i+192>>2]|0,p+64|0)}e=c[b+72>>2]|0;if(e|0?(Fa[c[(c[e>>2]|0)+48>>2]&127](e)|0)&2|0:0){c[p+32>>2]=1065353216;c[p+32+4>>2]=0;c[p+32+8>>2]=0;g[p+32+12>>2]=0.0;q=c[i+192>>2]|0;ab[c[(c[q>>2]|0)+8>>2]&127](q,i+4|0,p+64|0,p+48|0);g[p+64>>2]=+g[p+64>>2]+-.019999999552965164;g[p+64+4>>2]=+g[p+64+4>>2]+-.019999999552965164;g[p+64+8>>2]=+g[p+64+8>>2]+-.019999999552965164;g[p+48>>2]=+g[p+48>>2]+.019999999552965164;g[p+48+4>>2]=+g[p+48+4>>2]+.019999999552965164;g[p+48+8>>2]=+g[p+48+8>>2]+.019999999552965164;do if((a[b+44>>0]|0?(c[i+236>>2]|0)==2:0)?(c[i+204>>2]&3|0)==0:0){q=c[i+192>>2]|0;ab[c[(c[q>>2]|0)+8>>2]&127](q,i+68|0,p+16|0,p);d=+g[p+16>>2]+-.019999999552965164;g[p+16>>2]=d;k=+g[p+16+4>>2]+-.019999999552965164;g[p+16+4>>2]=k;l=+g[p+16+8>>2]+-.019999999552965164;g[p+16+8>>2]=l;m=+g[p>>2]+.019999999552965164;g[p>>2]=m;n=+g[p+4>>2]+.019999999552965164;g[p+4>>2]=n;o=+g[p+8>>2]+.019999999552965164;g[p+8>>2]=o;if(d<+g[p+64>>2])g[p+64>>2]=d;if(k<+g[p+64+4>>2])g[p+64+4>>2]=k;if(l<+g[p+64+8>>2])g[p+64+8>>2]=l;d=+g[p+16+12>>2];if(d<+g[p+64+12>>2])g[p+64+12>>2]=d;if(+g[p+48>>2]>2]=m;if(+g[p+48+4>>2]>2]=n;if(+g[p+48+8>>2]>2]=o;d=+g[p+12>>2];if(!(+g[p+48+12>>2]>2]=d}while(0);q=c[b+72>>2]|0;ab[c[(c[q>>2]|0)+52>>2]&127](q,p+64|0,p+48|0,p+32|0)}}j=j+1|0}while((j|0)<(c[b+8>>2]|0));sa=p;return}function rd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=c[b>>2]|0;m=c[b+4>>2]|0;i=c[b+8>>2]|0;n=c[a+4>>2]|0;p=bh(a,d,m,i)|0;c[p+12>>2]=c[b+12>>2];c[p+16>>2]=n+1;c[p+20>>2]=n+2;h=c[(c[a+12>>2]|0)+(c[b+12>>2]<<2)>>2]|0;e=c[h>>2]|0;f=c[h+4>>2]|0;do if((e|0)==(m|0)&(f|0)==(i|0)){e=2;o=2}else{if(!((e|0)==(i|0)&(f|0)==(m|0))){g=c[h+8>>2]|0;if((f|0)==(m|0)&(g|0)==(i|0)){e=0;o=2;break}if(!((f|0)==(i|0)&(g|0)==(m|0))){if(!((g|0)!=(m|0)|(e|0)==(i|0)^1)){e=1;o=2;break}if((g|0)!=(i|0)|(e|0)==(m|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=h+12+(e<<2)|0}while(0);if((o|0)==2)e=h+12+(e<<2)|0;c[e>>2]=n;k=bh(a,d,i,l)|0;c[k+12>>2]=c[b+12+4>>2];c[k+16>>2]=n+2;c[k+20>>2]=n;h=c[(c[a+12>>2]|0)+(c[b+12+4>>2]<<2)>>2]|0;e=c[h>>2]|0;f=c[h+4>>2]|0;do if((e|0)==(i|0)&(f|0)==(l|0)){e=2;o=10}else{if(!((e|0)==(l|0)&(f|0)==(i|0))){g=c[h+8>>2]|0;if((f|0)==(i|0)&(g|0)==(l|0)){e=0;o=10;break}if(!((f|0)==(l|0)&(g|0)==(i|0))){if(!((g|0)!=(i|0)|(e|0)==(l|0)^1)){e=1;o=10;break}if((g|0)!=(l|0)|(e|0)==(i|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=h+12+(e<<2)|0}while(0);if((o|0)==10)e=h+12+(e<<2)|0;c[e>>2]=n+1;j=bh(a,d,l,m)|0;c[j+12>>2]=c[b+12+8>>2];c[j+16>>2]=n;c[j+20>>2]=n+1;e=c[a+12>>2]|0;i=c[e+(c[b+12+8>>2]<<2)>>2]|0;f=c[i>>2]|0;g=c[i+4>>2]|0;do if((f|0)==(l|0)&(g|0)==(m|0)){f=2;o=18}else{if(!((f|0)==(m|0)&(g|0)==(l|0))){h=c[i+8>>2]|0;if((g|0)==(l|0)&(h|0)==(m|0)){f=0;o=18;break}if(!((g|0)==(m|0)&(h|0)==(l|0))){if(!((h|0)!=(l|0)|(f|0)==(m|0)^1)){f=1;o=18;break}if((h|0)!=(m|0)|(f|0)==(l|0)^1){f=12340;break}else f=1}else f=0}else f=2;f=i+12+(f<<2)|0}while(0);if((o|0)==18)f=i+12+(f<<2)|0;c[f>>2]=n+2;f=c[e+(c[p+12>>2]<<2)>>2]|0;if(!(((c[f>>2]|0)!=(d|0)?(c[f+4>>2]|0)!=(d|0):0)?(c[f+8>>2]|0)!=(d|0):0)){wd(e,p,f);c[(c[a+12>>2]|0)+(c[p+24>>2]<<2)>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[p+-4>>2]|0);c[(c[a+12>>2]|0)+(c[f+24>>2]<<2)>>2]=0;if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}e=c[a+12>>2]|0}f=c[e+(c[k+12>>2]<<2)>>2]|0;if(!(((c[f>>2]|0)!=(d|0)?(c[f+4>>2]|0)!=(d|0):0)?(c[f+8>>2]|0)!=(d|0):0)){wd(e,k,f);c[(c[a+12>>2]|0)+(c[k+24>>2]<<2)>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);c[(c[a+12>>2]|0)+(c[f+24>>2]<<2)>>2]=0;if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}e=c[a+12>>2]|0}f=c[e+(c[j+12>>2]<<2)>>2]|0;if(((c[f>>2]|0)!=(d|0)?(c[f+4>>2]|0)!=(d|0):0)?(c[f+8>>2]|0)!=(d|0):0){a=e;d=b+24|0;d=c[d>>2]|0;d=a+(d<<2)|0;c[d>>2]=0;d=c[7183]|0;d=d+1|0;c[7183]=d;d=b+-4|0;d=c[d>>2]|0;Hc(d);return}wd(e,j,f);c[(c[a+12>>2]|0)+(c[j+24>>2]<<2)>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);c[(c[a+12>>2]|0)+(c[f+24>>2]<<2)>>2]=0;if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}a=c[a+12>>2]|0;d=b+24|0;d=c[d>>2]|0;d=a+(d<<2)|0;c[d>>2]=0;d=c[7183]|0;d=d+1|0;c[7183]=d;d=b+-4|0;d=c[d>>2]|0;Hc(d);return}function sd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0;o=sa;sa=sa+144|0;if((c[a+16>>2]|0)<=0){n=a+76|0;c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];n=c[a>>2]|0;n=n+68|0;n=c[n>>2]|0;Pa[n&511](a);sa=o;return}j=o+16+16|0;k=o+16+32|0;l=o+16+48|0;i=0;do{n=c[a+24>>2]|0;m=n+(i*80|0)|0;c[o+16>>2]=c[m>>2];c[o+16+4>>2]=c[m+4>>2];c[o+16+8>>2]=c[m+8>>2];c[o+16+12>>2]=c[m+12>>2];m=n+(i*80|0)+16|0;c[j>>2]=c[m>>2];c[j+4>>2]=c[m+4>>2];c[j+8>>2]=c[m+8>>2];c[j+12>>2]=c[m+12>>2];m=n+(i*80|0)+32|0;c[k>>2]=c[m>>2];c[k+4>>2]=c[m+4>>2];c[k+8>>2]=c[m+8>>2];c[k+12>>2]=c[m+12>>2];m=n+(i*80|0)+48|0;c[l>>2]=c[m>>2];c[l+4>>2]=c[m+4>>2];c[l+8>>2]=c[m+8>>2];c[l+12>>2]=c[m+12>>2];n=c[n+(i*80|0)+64>>2]|0;n=Fa[c[(c[n>>2]|0)+28>>2]&127](n)|0;c[o>>2]=c[n>>2];c[o+4>>2]=c[n+4>>2];c[o+8>>2]=c[n+8>>2];p=+g[o+4>>2]*+g[b+4>>2]/+g[a+80>>2];q=+g[o+8>>2]*+g[b+8>>2]/+g[a+84>>2];g[o>>2]=+g[o>>2]*+g[b>>2]/+g[a+76>>2];g[o+4>>2]=p;g[o+8>>2]=q;g[o+12>>2]=0.0;n=c[(c[a+24>>2]|0)+(i*80|0)+64>>2]|0;Va[c[(c[n>>2]|0)+24>>2]&127](n,o);q=+g[o+16+52>>2]*+g[b+4>>2]/+g[a+80>>2];p=+g[o+16+56>>2]*+g[b+8>>2]/+g[a+84>>2];g[o+16+48>>2]=+g[l>>2]*+g[b>>2]/+g[a+76>>2];g[o+16+52>>2]=q;g[o+16+56>>2]=p;g[o+16+60>>2]=0.0;n=c[a+24>>2]|0;m=n+(i*80|0)|0;c[m>>2]=c[o+16>>2];c[m+4>>2]=c[o+16+4>>2];c[m+8>>2]=c[o+16+8>>2];c[m+12>>2]=c[o+16+12>>2];m=n+(i*80|0)+16|0;c[m>>2]=c[j>>2];c[m+4>>2]=c[j+4>>2];c[m+8>>2]=c[j+8>>2];c[m+12>>2]=c[j+12>>2];m=n+(i*80|0)+32|0;c[m>>2]=c[k>>2];c[m+4>>2]=c[k+4>>2];c[m+8>>2]=c[k+8>>2];c[m+12>>2]=c[k+12>>2];n=n+(i*80|0)+48|0;c[n>>2]=c[l>>2];c[n+4>>2]=c[l+4>>2];c[n+8>>2]=c[l+8>>2];c[n+12>>2]=c[l+12>>2];if(c[a+64>>2]|0){m=c[(c[a+24>>2]|0)+(i*80|0)+64>>2]|0;ab[c[(c[m>>2]|0)+8>>2]&127](m,o+16|0,o+128|0,o+112|0);c[o+80>>2]=c[o+128>>2];c[o+80+4>>2]=c[o+128+4>>2];c[o+80+8>>2]=c[o+128+8>>2];c[o+80+12>>2]=c[o+128+12>>2];c[o+80+16>>2]=c[o+112>>2];c[o+80+16+4>>2]=c[o+112+4>>2];c[o+80+16+8>>2]=c[o+112+8>>2];c[o+80+16+12>>2]=c[o+112+12>>2];m=c[a+64>>2]|0;n=c[(c[a+24>>2]|0)+(i*80|0)+76>>2]|0;d=sg(m,n)|0;a:do if(d){h=c[m+8>>2]|0;if((h|0)<=-1){d=c[m>>2]|0;break}if(h){e=0;while(1){f=c[d+32>>2]|0;e=e+1|0;if(!f)break a;if((e|0)>=(h|0)){d=f;break}else d=f}}}else d=0;while(0);c[n>>2]=c[o+80>>2];c[n+4>>2]=c[o+80+4>>2];c[n+8>>2]=c[o+80+8>>2];c[n+12>>2]=c[o+80+12>>2];c[n+16>>2]=c[o+80+16>>2];c[n+20>>2]=c[o+80+20>>2];c[n+24>>2]=c[o+80+24>>2];c[n+28>>2]=c[o+80+28>>2];ue(m,d,n)}i=i+1|0}while((i|0)<(c[a+16>>2]|0));n=a+76|0;c[n>>2]=c[b>>2];c[n+4>>2]=c[b+4>>2];c[n+8>>2]=c[b+8>>2];c[n+12>>2]=c[b+12>>2];n=c[a>>2]|0;n=n+68|0;n=c[n>>2]|0;Pa[n&511](a);sa=o;return}function td(d,f,h,i,j,k){d=d|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0.0,m=0.0,n=0.0;c[d>>2]=11492;b[d+4>>1]=-2;b[d+6>>1]=-1;c[d+92>>2]=j;c[d+96>>2]=0;a[d+100>>0]=0;c[d+104>>2]=0;c[d+108>>2]=0;if(!j){c[7182]=(c[7182]|0)+1;j=xb(95)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}Th(j);c[d+92>>2]=j;a[d+100>>0]=1}if(!k){c[7182]=(c[7182]|0)+1;j=xb(43)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}k=j+4|0;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[j>>2]=11556;a[j+20>>0]=1;c[j+16>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[d+112>>2]=j;c[7182]=(c[7182]|0)+1;j=xb(215)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}fh(j,c[d+112>>2]|0);c[d+108>>2]=j;a[j+193>>0]=1}c[d+8>>2]=c[f>>2];c[d+8+4>>2]=c[f+4>>2];c[d+8+8>>2]=c[f+8>>2];c[d+8+12>>2]=c[f+12>>2];c[d+24>>2]=c[h>>2];c[d+24+4>>2]=c[h+4>>2];c[d+24+8>>2]=c[h+8>>2];c[d+24+12>>2]=c[h+12>>2];n=+(e[d+6>>1]|0);m=n/(+g[d+28>>2]-+g[d+12>>2]);l=n/(+g[d+32>>2]-+g[d+16>>2]);g[d+40>>2]=n/(+g[d+24>>2]-+g[d+8>>2]);g[d+44>>2]=m;g[d+48>>2]=l;g[d+52>>2]=0.0;h=i+1&65535;c[7182]=(c[7182]|0)+1;j=xb(h<<6|19)|0;if(!j)f=0;else{c[(j+4+15&-16)+-4>>2]=j;f=j+4+15&-16}if(i+1<<16>>16<<16>>16){j=f+(h<<6)|0;k=f;do{c[k>>2]=0;c[k+8>>2]=0;k=k+64|0}while((k|0)!=(j|0))}c[d+60>>2]=f;b[d+58>>1]=(i&65535)+1;b[d+56>>1]=0;b[d+64>>1]=1;if((i+1&65535)>1?(b[f+112>>1]=2,i+1<<16>>16<<16>>16!=2):0){j=2;do{i=j;j=j+1|0;b[f+(i<<6)+48>>1]=j}while((j|0)!=(h|0))}b[f+(h+-1<<6)+48>>1]=0;c[7182]=(c[7182]|0)+1;j=xb((h<<3|3)+16|0)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}c[d+80>>2]=j;c[d+68>>2]=j;c[7182]=(c[7182]|0)+1;j=xb((h<<3|3)+16|0)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}c[d+84>>2]=j;c[d+72>>2]=j;c[7182]=(c[7182]|0)+1;j=xb((h<<3|3)+16|0)|0;if(!j){f=0;i=d+88|0;c[i>>2]=f;i=d+76|0;c[i>>2]=f;f=c[d+60>>2]|0;c[f>>2]=0;h=f+48|0;b[h>>1]=0;h=f+54|0;b[h>>1]=1;h=c[d+68>>2]|0;b[h>>1]=0;k=h+2|0;b[k>>1]=0;k=b[d+6>>1]|0;j=h+4|0;b[j>>1]=k;h=h+6|0;b[h>>1]=0;h=f+50|0;b[h>>1]=0;h=f+56|0;b[h>>1]=1;h=c[d+72>>2]|0;b[h>>1]=0;j=h+2|0;b[j>>1]=0;j=b[d+6>>1]|0;k=h+4|0;b[k>>1]=j;h=h+6|0;b[h>>1]=0;h=f+52|0;b[h>>1]=0;f=f+58|0;b[f>>1]=1;i=c[i>>2]|0;b[i>>1]=0;f=i+2|0;b[f>>1]=0;f=b[d+6>>1]|0;h=i+4|0;b[h>>1]=f;i=i+6|0;b[i>>1]=0;c[d>>2]=11428;return}c[(j+4+15&-16)+-4>>2]=j;f=j+4+15&-16;i=d+88|0;c[i>>2]=f;i=d+76|0;c[i>>2]=f;f=c[d+60>>2]|0;c[f>>2]=0;h=f+48|0;b[h>>1]=0;h=f+54|0;b[h>>1]=1;h=c[d+68>>2]|0;b[h>>1]=0;k=h+2|0;b[k>>1]=0;k=b[d+6>>1]|0;j=h+4|0;b[j>>1]=k;h=h+6|0;b[h>>1]=0;h=f+50|0;b[h>>1]=0;h=f+56|0;b[h>>1]=1;h=c[d+72>>2]|0;b[h>>1]=0;j=h+2|0;b[j>>1]=0;j=b[d+6>>1]|0;k=h+4|0;b[k>>1]=j;h=h+6|0;b[h>>1]=0;h=f+52|0;b[h>>1]=0;f=f+58|0;b[f>>1]=1;i=c[i>>2]|0;b[i>>1]=0;f=i+2|0;b[f>>1]=0;f=b[d+6>>1]|0;h=i+4|0;b[h>>1]=f;i=i+6|0;b[i>>1]=0;c[d>>2]=11428;return}function ud(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0,W=0.0,X=0.0;V=sa;sa=sa+240|0;f=(a[b+8>>0]|0)!=0;h=f?e:d;f=f?d:e;R=+g[h+116>>2]-+g[h+52>>2];S=+g[h+120>>2]-+g[h+56>>2];T=+g[h+124>>2]-+g[h+60>>2];U=+g[h+252>>2];if(R*R+S*S+T*T>2];H=+g[f+20>>2];I=+g[f+36>>2];J=+g[f+8>>2];K=+g[f+24>>2];L=+g[f+40>>2];M=+g[f+12>>2];N=+g[f+28>>2];O=+g[f+44>>2];j=-+g[f+52>>2];k=-+g[f+56>>2];l=-+g[f+60>>2];P=+g[h+4>>2];Q=+g[h+20>>2];R=+g[h+36>>2];S=+g[h+8>>2];T=+g[h+24>>2];U=+g[h+40>>2];o=+g[h+12>>2];p=+g[h+28>>2];q=+g[h+44>>2];v=+g[h+52>>2];u=+g[h+56>>2];t=+g[h+60>>2];r=G*j+H*k+I*l+(G*v+H*u+I*t);s=J*j+K*k+L*l+(J*v+K*u+L*t);t=M*j+N*k+O*l+(M*v+N*u+O*t);u=+g[h+68>>2];v=+g[h+84>>2];w=+g[h+100>>2];x=+g[h+72>>2];y=+g[h+88>>2];z=+g[h+104>>2];A=+g[h+76>>2];B=+g[h+92>>2];C=+g[h+108>>2];m=+g[h+116>>2];n=+g[h+120>>2];F=+g[h+124>>2];D=G*j+H*k+I*l+(G*m+H*n+I*F);E=J*j+K*k+L*l+(J*m+K*n+L*F);F=M*j+N*k+O*l+(M*m+N*n+O*F);f=c[f+192>>2]|0;if(((c[f+4>>2]|0)+-21|0)>>>0>=9){W=1.0;sa=V;return +W}g[V+224>>2]=r;g[V+224+4>>2]=s;g[V+224+8>>2]=t;g[V+224+12>>2]=0.0;if(D>2]=D;i=D}else i=r;if(E>2]=E;j=E}else j=s;if(F>2]=F;k=F}else k=t;g[V+208>>2]=r;g[V+208+4>>2]=s;g[V+208+8>>2]=t;g[V+208+12>>2]=0.0;if(r>2]=D;l=D}else l=r;if(s>2]=E;m=E}else m=s;if(t>2]=F;n=F}else n=t;X=+g[h+248>>2];g[V+224>>2]=i-X;g[V+224+4>>2]=j-X;g[V+224+8>>2]=k-X;g[V+208>>2]=X+l;g[V+208+4>>2]=X+m;g[V+208+8>>2]=X+n;c[V>>2]=6428;g[V+4>>2]=G*P+H*Q+I*R;g[V+8>>2]=G*S+H*T+I*U;g[V+12>>2]=G*o+H*p+I*q;g[V+16>>2]=0.0;g[V+20>>2]=J*P+K*Q+L*R;g[V+24>>2]=J*S+K*T+L*U;g[V+28>>2]=J*o+K*p+L*q;g[V+32>>2]=0.0;g[V+36>>2]=M*P+N*Q+O*R;g[V+40>>2]=M*S+N*T+O*U;g[V+44>>2]=M*o+N*p+O*q;g[V+48>>2]=0.0;g[V+52>>2]=r;g[V+56>>2]=s;g[V+60>>2]=t;g[V+64>>2]=0.0;g[V+68>>2]=G*u+H*v+I*w;g[V+72>>2]=G*x+H*y+I*z;g[V+76>>2]=G*A+H*B+I*C;g[V+80>>2]=0.0;g[V+84>>2]=J*u+K*v+L*w;g[V+88>>2]=J*x+K*y+L*z;g[V+92>>2]=J*A+K*B+L*C;g[V+96>>2]=0.0;g[V+100>>2]=M*u+N*v+O*w;g[V+104>>2]=M*x+N*y+O*z;g[V+108>>2]=M*A+N*B+O*C;g[V+112>>2]=0.0;g[V+116>>2]=D;g[V+120>>2]=E;g[V+124>>2]=F;g[V+128>>2]=0.0;g[V+196>>2]=X;c[V+200>>2]=c[h+244>>2];if(f|0?(ab[c[(c[f>>2]|0)+64>>2]&127](f,V,V+224|0,V+208|0),W=+g[V+200>>2],W<+g[h+244>>2]):0){g[h+244>>2]=W;X=W;sa=V;return +X}X=1.0;sa=V;return +X}function vd(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0,W=0.0,X=0.0;V=sa;sa=sa+240|0;f=(a[b+8>>0]|0)!=0;h=f?e:d;f=f?d:e;R=+g[h+116>>2]-+g[h+52>>2];S=+g[h+120>>2]-+g[h+56>>2];T=+g[h+124>>2]-+g[h+60>>2];U=+g[h+252>>2];if(R*R+S*S+T*T>2];H=+g[f+20>>2];I=+g[f+36>>2];J=+g[f+8>>2];K=+g[f+24>>2];L=+g[f+40>>2];M=+g[f+12>>2];N=+g[f+28>>2];O=+g[f+44>>2];j=-+g[f+52>>2];k=-+g[f+56>>2];l=-+g[f+60>>2];P=+g[h+4>>2];Q=+g[h+20>>2];R=+g[h+36>>2];S=+g[h+8>>2];T=+g[h+24>>2];U=+g[h+40>>2];o=+g[h+12>>2];p=+g[h+28>>2];q=+g[h+44>>2];v=+g[h+52>>2];u=+g[h+56>>2];t=+g[h+60>>2];r=G*j+H*k+I*l+(G*v+H*u+I*t);s=J*j+K*k+L*l+(J*v+K*u+L*t);t=M*j+N*k+O*l+(M*v+N*u+O*t);u=+g[h+68>>2];v=+g[h+84>>2];w=+g[h+100>>2];x=+g[h+72>>2];y=+g[h+88>>2];z=+g[h+104>>2];A=+g[h+76>>2];B=+g[h+92>>2];C=+g[h+108>>2];m=+g[h+116>>2];n=+g[h+120>>2];F=+g[h+124>>2];D=G*j+H*k+I*l+(G*m+H*n+I*F);E=J*j+K*k+L*l+(J*m+K*n+L*F);F=M*j+N*k+O*l+(M*m+N*n+O*F);f=c[f+192>>2]|0;if(((c[f+4>>2]|0)+-21|0)>>>0>=9){W=1.0;sa=V;return +W}g[V+224>>2]=r;g[V+224+4>>2]=s;g[V+224+8>>2]=t;g[V+224+12>>2]=0.0;if(D>2]=D;i=D}else i=r;if(E>2]=E;j=E}else j=s;if(F>2]=F;k=F}else k=t;g[V+208>>2]=r;g[V+208+4>>2]=s;g[V+208+8>>2]=t;g[V+208+12>>2]=0.0;if(r>2]=D;l=D}else l=r;if(s>2]=E;m=E}else m=s;if(t>2]=F;n=F}else n=t;X=+g[h+248>>2];g[V+224>>2]=i-X;g[V+224+4>>2]=j-X;g[V+224+8>>2]=k-X;g[V+208>>2]=X+l;g[V+208+4>>2]=X+m;g[V+208+8>>2]=X+n;c[V>>2]=8344;g[V+4>>2]=G*P+H*Q+I*R;g[V+8>>2]=G*S+H*T+I*U;g[V+12>>2]=G*o+H*p+I*q;g[V+16>>2]=0.0;g[V+20>>2]=J*P+K*Q+L*R;g[V+24>>2]=J*S+K*T+L*U;g[V+28>>2]=J*o+K*p+L*q;g[V+32>>2]=0.0;g[V+36>>2]=M*P+N*Q+O*R;g[V+40>>2]=M*S+N*T+O*U;g[V+44>>2]=M*o+N*p+O*q;g[V+48>>2]=0.0;g[V+52>>2]=r;g[V+56>>2]=s;g[V+60>>2]=t;g[V+64>>2]=0.0;g[V+68>>2]=G*u+H*v+I*w;g[V+72>>2]=G*x+H*y+I*z;g[V+76>>2]=G*A+H*B+I*C;g[V+80>>2]=0.0;g[V+84>>2]=J*u+K*v+L*w;g[V+88>>2]=J*x+K*y+L*z;g[V+92>>2]=J*A+K*B+L*C;g[V+96>>2]=0.0;g[V+100>>2]=M*u+N*v+O*w;g[V+104>>2]=M*x+N*y+O*z;g[V+108>>2]=M*A+N*B+O*C;g[V+112>>2]=0.0;g[V+116>>2]=D;g[V+120>>2]=E;g[V+124>>2]=F;g[V+128>>2]=0.0;g[V+196>>2]=X;c[V+200>>2]=c[h+244>>2];if(f|0?(ab[c[(c[f>>2]|0)+64>>2]&127](f,V,V+224|0,V+208|0),W=+g[V+200>>2],W<+g[h+244>>2]):0){g[h+244>>2]=W;X=W;sa=V;return +X}X=1.0;sa=V;return +X}function wd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;l=0;do{k=l;l=l+1|0;m=(l|0)==3;j=c[b+((m?0:l)<<2)>>2]|0;k=c[b+((((k+2|0)>>>0)%3|0)<<2)>>2]|0;e=c[d>>2]|0;f=c[d+4>>2]|0;do if((e|0)==(k|0)&(f|0)==(j|0)){e=2;n=3}else{if(!((e|0)==(j|0)&(f|0)==(k|0))){g=c[d+8>>2]|0;if((f|0)==(k|0)&(g|0)==(j|0)){e=0;n=3;break}if(!((f|0)==(j|0)&(g|0)==(k|0))){if(!((g|0)!=(k|0)|(e|0)==(j|0)^1)){e=1;n=3;break}if((g|0)!=(j|0)|(e|0)==(k|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=d+12+(e<<2)|0}while(0);if((n|0)==3){n=0;e=d+12+(e<<2)|0}i=c[e>>2]|0;e=c[b>>2]|0;f=c[b+4>>2]|0;do if((e|0)==(j|0)&(f|0)==(k|0)){e=2;n=11}else{if(!((e|0)==(k|0)&(f|0)==(j|0))){g=c[b+8>>2]|0;if((f|0)==(j|0)&(g|0)==(k|0)){e=0;n=11;break}if(!((f|0)==(k|0)&(g|0)==(j|0))){if(!((g|0)!=(j|0)|(e|0)==(k|0)^1)){e=1;n=11;break}if((g|0)!=(k|0)|(e|0)==(j|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=b+12+(e<<2)|0}while(0);if((n|0)==11){n=0;e=b+12+(e<<2)|0}h=c[a+(c[e>>2]<<2)>>2]|0;e=c[h>>2]|0;f=c[h+4>>2]|0;do if((e|0)==(k|0)&(f|0)==(j|0)){e=2;n=19}else{if(!((e|0)==(j|0)&(f|0)==(k|0))){g=c[h+8>>2]|0;if((f|0)==(k|0)&(g|0)==(j|0)){e=0;n=19;break}if(!((f|0)==(j|0)&(g|0)==(k|0))){if(!((g|0)!=(k|0)|(e|0)==(j|0)^1)){e=1;n=19;break}if((g|0)!=(j|0)|(e|0)==(k|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=h+12+(e<<2)|0}while(0);if((n|0)==19){n=0;e=h+12+(e<<2)|0}c[e>>2]=i;e=c[b>>2]|0;f=c[b+4>>2]|0;do if((e|0)==(j|0)&(f|0)==(k|0)){e=2;n=27}else{if(!((e|0)==(k|0)&(f|0)==(j|0))){g=c[b+8>>2]|0;if((f|0)==(j|0)&(g|0)==(k|0)){e=0;n=27;break}if(!((f|0)==(k|0)&(g|0)==(j|0))){if(!((g|0)!=(j|0)|(e|0)==(k|0)^1)){e=1;n=27;break}if((g|0)!=(k|0)|(e|0)==(j|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=b+12+(e<<2)|0}while(0);if((n|0)==27){n=0;e=b+12+(e<<2)|0}i=c[e>>2]|0;e=c[d>>2]|0;f=c[d+4>>2]|0;do if((e|0)==(k|0)&(f|0)==(j|0)){e=2;n=35}else{if(!((e|0)==(j|0)&(f|0)==(k|0))){g=c[d+8>>2]|0;if((f|0)==(k|0)&(g|0)==(j|0)){e=0;n=35;break}if(!((f|0)==(j|0)&(g|0)==(k|0))){if(!((g|0)!=(k|0)|(e|0)==(j|0)^1)){e=1;n=35;break}if((g|0)!=(j|0)|(e|0)==(k|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=d+12+(e<<2)|0}while(0);if((n|0)==35){n=0;e=d+12+(e<<2)|0}h=c[a+(c[e>>2]<<2)>>2]|0;f=c[h>>2]|0;g=c[h+4>>2]|0;do if((f|0)==(j|0)&(g|0)==(k|0)){e=2;n=43}else{if(!((f|0)==(k|0)&(g|0)==(j|0))){e=c[h+8>>2]|0;if((g|0)==(j|0)&(e|0)==(k|0)){e=0;n=43;break}if(!((g|0)==(k|0)&(e|0)==(j|0))){if(!((e|0)!=(j|0)|(f|0)==(k|0)^1)){e=1;n=43;break}if((e|0)!=(k|0)|(f|0)==(j|0)^1){e=12340;break}else e=1}else e=0}else e=2;e=h+12+(e<<2)|0}while(0);if((n|0)==43){n=0;e=h+12+(e<<2)|0}c[e>>2]=i}while(!m);return}function xd(d,e,f,h){d=d|0;e=e|0;f=f|0;h=h|0;var i=0,k=0,l=0,m=0.0,n=0,o=0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0;p=+g[e>>2];i=(g[j>>2]=p,c[j>>2]|0);u=p<999999984306749440.0?i:1566444395;m=+g[e+4>>2];l=(g[j>>2]=m,c[j>>2]|0);v=m<999999984306749440.0?l:1566444395;y=+g[e+8>>2];o=(g[j>>2]=y,c[j>>2]|0);w=y<999999984306749440.0?o:1566444395;i=p>-999999984306749440.0?i:-581039253;l=m>-999999984306749440.0?l:-581039253;o=y>-999999984306749440.0?o:-581039253;y=+g[e+16>>2];t=y<(c[j>>2]=u,+g[j>>2]);k=(g[j>>2]=y,c[j>>2]|0);u=t?k:u;m=+g[e+20>>2];t=m<(c[j>>2]=v,+g[j>>2]);n=(g[j>>2]=m,c[j>>2]|0);v=t?n:v;p=+g[e+24>>2];t=p<(c[j>>2]=w,+g[j>>2]);q=(g[j>>2]=p,c[j>>2]|0);w=t?q:w;k=y>(c[j>>2]=i,+g[j>>2])?k:i;i=m>(c[j>>2]=l,+g[j>>2])?n:l;o=p>(c[j>>2]=o,+g[j>>2])?q:o;y=+g[e+32>>2];q=y<(c[j>>2]=u,+g[j>>2]);r=(g[j>>2]=y,c[j>>2]|0);m=+g[e+36>>2];s=m<(c[j>>2]=v,+g[j>>2]);t=(g[j>>2]=m,c[j>>2]|0);p=+g[e+40>>2];l=p<(c[j>>2]=w,+g[j>>2]);n=(g[j>>2]=p,c[j>>2]|0);k=y>(c[j>>2]=k,+g[j>>2])?r:k;i=m>(c[j>>2]=i,+g[j>>2])?t:i;o=p>(c[j>>2]=o,+g[j>>2])?n:o;G=(c[j>>2]=k,+g[j>>2]);H=(c[j>>2]=q?r:u,+g[j>>2]);C=(c[j>>2]=i,+g[j>>2]);D=(c[j>>2]=s?t:v,+g[j>>2]);m=(c[j>>2]=o,+g[j>>2]);z=(c[j>>2]=l?n:w,+g[j>>2]);o=c[d+8>>2]|0;F=+g[o+4>>2];B=+g[o+8>>2];p=+g[o+12>>2];E=+g[o+36>>2];A=+g[o+40>>2];y=+g[o+44>>2];o=~~(((G-H<2.0000000949949026e-03?H+-1.0000000474974513e-03:H)-F)*E)&65535&-2;q=~~(((C-D<2.0000000949949026e-03?D+-1.0000000474974513e-03:D)-B)*A)&65535&-2;r=~~(((m-z<2.0000000949949026e-03?z+-1.0000000474974513e-03:z)-p)*y)&65535&-2;s=~~(((G-H<2.0000000949949026e-03?G+1.0000000474974513e-03:G)-F)*E+1.0)&65535|1;t=~~(((C-D<2.0000000949949026e-03?C+1.0000000474974513e-03:C)-B)*A+1.0)&65535|1;e=~~(((m-z<2.0000000949949026e-03?m+1.0000000474974513e-03:m)-p)*y+1.0)&65535|1;n=c[d+4>>2]|0;i=c[n+4>>2]|0;if((i|0)==(c[n+8>>2]|0)?(x=(i|0)==0?1:i<<1,(i|0)<(x|0)):0){if(!x)l=0;else{c[7182]=(c[7182]|0)+1;i=xb((x<<4|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}l=i;i=c[n+4>>2]|0}if((i|0)>0){k=0;do{d=l+(k<<4)|0;w=(c[n+12>>2]|0)+(k<<4)|0;c[d>>2]=c[w>>2];c[d+4>>2]=c[w+4>>2];c[d+8>>2]=c[w+8>>2];c[d+12>>2]=c[w+12>>2];k=k+1|0}while((k|0)!=(i|0))}i=c[n+12>>2]|0;if(i|0){if(a[n+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[n+12>>2]=0}a[n+16>>0]=1;c[n+12>>2]=l;c[n+8>>2]=x;i=c[n+4>>2]|0}x=c[n+12>>2]|0;b[x+(i<<4)>>1]=o;b[x+(i<<4)+2>>1]=q;b[x+(i<<4)+4>>1]=r;b[x+(i<<4)+6>>1]=s;b[x+(i<<4)+8>>1]=t;b[x+(i<<4)+10>>1]=e;c[x+(i<<4)+12>>2]=f<<21|h;c[n+4>>2]=(c[n+4>>2]|0)+1;return}function yd(b,d){b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0;l=sa;sa=sa+336|0;f=c[d+36>>2]|0;c[l+272+4>>2]=35;c[l+272+8>>2]=0;c[l+272+12>>2]=1065353216;c[l+272+16>>2]=1065353216;c[l+272+20>>2]=1065353216;g[l+272+24>>2]=0.0;c[l+272>>2]=6196;c[l+272+52>>2]=f;g[l+272+44>>2]=0.0;j=c[b+28>>2]|0;d=c[j+4>>2]|0;if(c[(c[j+8>>2]|0)+204>>2]&3|0?a[f+376>>0]|0:0){sa=l;return}if((a[26616]|0)==0?mz(26616)|0:0){if((a[26624]|0)==0?mz(26624)|0:0){c[6774]=1065353216;c[6775]=0;c[6776]=0;c[6777]=0;c[6778]=0;c[6779]=1065353216;c[6780]=0;c[6781]=0;c[6782]=0;c[6783]=0;c[6784]=1065353216;g[6785]=0.0}c[6758]=c[6774];c[6759]=c[6775];c[6760]=c[6776];c[6761]=c[6777];c[6762]=c[6778];c[6763]=c[6779];c[6764]=c[6780];c[6765]=c[6781];c[6766]=c[6782];c[6767]=c[6783];c[6768]=c[6784];c[6769]=c[6785];c[6770]=0;c[6771]=0;c[6772]=0;c[6773]=0}e=c[(c[b+28>>2]|0)+12>>2]|0;c[l>>2]=1065353216;c[l+4>>2]=0;c[l+8>>2]=0;g[l+12>>2]=0.0;if(!(!(Rc(l+272|0,27032,d,e,l,l+216|0)|0)?!(Ob(l+272|0,27032,d,e,l,l+216|0,0)|0):0))h=12;if((h|0)==12?(c[l+4>>2]=0,c[l+4+4>>2]=0,c[l+4+8>>2]=0,c[l+4+12>>2]=0,c[l+4+16>>2]=0,c[l+4+20>>2]=0,a[l+152>>0]=0,c[l>>2]=6016,j=c[(c[b+28>>2]|0)+8>>2]|0,jc(b,l+216|0,f,0,0,0,(c[j+236>>2]&2|0)==0?0:j,j,l)|0):0){c[7182]=(c[7182]|0)+1;d=xb(235)|0;if(!d)j=0;else{c[(d+4+15&-16)+-4>>2]=d;j=d+4+15&-16}e=j+4|0;d=j+152|0;mk(e|0,0,212)|0;c[j>>2]=6016;f=l+4|0;h=e+100|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(h|0));e=j+104|0;c[e>>2]=c[l+104>>2];c[e+4>>2]=c[l+104+4>>2];c[e+8>>2]=c[l+104+8>>2];c[e+12>>2]=c[l+104+12>>2];e=j+120|0;c[e>>2]=c[l+120>>2];c[e+4>>2]=c[l+120+4>>2];c[e+8>>2]=c[l+120+8>>2];c[e+12>>2]=c[l+120+12>>2];e=j+136|0;c[e>>2]=c[l+136>>2];c[e+4>>2]=c[l+136+4>>2];c[e+8>>2]=c[l+136+8>>2];c[e+12>>2]=c[l+136+12>>2];a[d>>0]=a[l+152>>0]|0;e=j+156|0;f=l+156|0;h=e+60|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(h|0));h=c[b+24>>2]|0;i=j;d=c[h+852>>2]|0;if((d|0)==(c[h+856>>2]|0)?(k=(d|0)==0?1:d<<1,(d|0)<(k|0)):0){if(!k)f=0;else{c[7182]=(c[7182]|0)+1;d=xb((k<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}f=d;d=c[h+852>>2]|0}if((d|0)>0){e=0;do{c[f+(e<<2)>>2]=c[(c[h+860>>2]|0)+(e<<2)>>2];e=e+1|0}while((e|0)!=(d|0))}e=c[h+860>>2]|0;if(e){if(a[h+864>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[h+852>>2]|0}c[h+860>>2]=0}a[h+864>>0]=1;c[h+860>>2]=f;c[h+856>>2]=k}c[(c[h+860>>2]|0)+(d<<2)>>2]=i;c[h+852>>2]=d+1;d=c[b+24>>2]|0;if(!(c[(c[(c[b+28>>2]|0)+8>>2]|0)+204>>2]&3)){b=j+64|0;g[b>>2]=+g[d+340>>2]*+g[b>>2];d=d+352|0}else{b=j+64|0;g[b>>2]=+g[d+344>>2]*+g[b>>2];d=d+356|0}b=j+68|0;g[b>>2]=+g[d>>2]*+g[b>>2]}sa=l;return}function zd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if(!((d|0)!=0&(e|0)!=0))return;if((c[b+24>>2]|0)<128?(c[b+28>>2]|0)<128:0){c[7182]=(c[7182]|0)+1;h=xb(1043)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}i=c[b+24>>2]|0;if((i|0)>0){h=0;do{l=(c[b+32>>2]|0)+(h<<3)|0;m=c[l+4>>2]|0;n=j+(h<<3)|0;c[n>>2]=c[l>>2];c[n+4>>2]=m;h=h+1|0}while((h|0)!=(i|0))}h=c[b+32>>2]|0;if(h|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=j;c[b+28>>2]=128}c[b+24>>2]=128;h=c[b+32>>2]|0;c[h>>2]=d;c[h+4>>2]=e;h=1;i=124;do{n=h+-1|0;j=c[b+32>>2]|0;l=c[j+(n<<3)>>2]|0;m=c[j+(n<<3)+4>>2]|0;if((n|0)>(i|0)){k=c[b+24>>2]|0;if((k|0)<(k<<1|0)?(c[b+28>>2]|0)<(k<<1|0):0){if(k){c[7182]=(c[7182]|0)+1;i=xb((k<<4|3)+16|0)|0;if(!i)e=0;else{c[(i+4+15&-16)+-4>>2]=i;e=i+4+15&-16}j=c[b+24>>2]|0;if((j|0)>0){i=0;do{p=(c[b+32>>2]|0)+(i<<3)|0;o=c[p+4>>2]|0;d=e+(i<<3)|0;c[d>>2]=c[p>>2];c[d+4>>2]=o;i=i+1|0}while((i|0)!=(j|0));d=e;j=e}else{d=e;j=e}}else{d=0;j=0}i=c[b+32>>2]|0;if(i|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=d;c[b+28>>2]=k<<1}c[b+24>>2]=k<<1;i=(k<<1)+-4|0}do if((l|0)==(m|0))if(!(c[l+40>>2]|0))h=n;else{o=c[l+36>>2]|0;c[j+(n<<3)>>2]=o;c[j+(n<<3)+4>>2]=o;o=c[l+40>>2]|0;p=h+1|0;n=c[b+32>>2]|0;c[n+(h<<3)>>2]=o;c[n+(h<<3)+4>>2]=o;n=c[l+40>>2]|0;o=c[b+32>>2]|0;c[o+(p<<3)>>2]=c[l+36>>2];c[o+(p<<3)+4>>2]=n;h=h+2|0}else if(((((+g[l>>2]<=+g[m+16>>2]?+g[l+16>>2]>=+g[m>>2]:0)?+g[l+4>>2]<=+g[m+20>>2]:0)?+g[l+20>>2]>=+g[m+4>>2]:0)?+g[l+8>>2]<=+g[m+24>>2]:0)?+g[l+24>>2]>=+g[m+8>>2]:0){d=(c[m+40>>2]|0)!=0;if(!(c[l+40>>2]|0))if(d){o=c[m+36>>2]|0;c[j+(n<<3)>>2]=l;c[j+(n<<3)+4>>2]=o;o=c[m+40>>2]|0;p=c[b+32>>2]|0;c[p+(h<<3)>>2]=l;c[p+(h<<3)+4>>2]=o;h=h+1|0;break}else{Za[c[(c[f>>2]|0)+8>>2]&127](f,l,m);h=n;break}else{e=c[l+36>>2]|0;if(d){p=c[m+36>>2]|0;c[j+(n<<3)>>2]=e;c[j+(n<<3)+4>>2]=p;p=c[m+36>>2]|0;n=h+1|0;k=c[b+32>>2]|0;c[k+(h<<3)>>2]=c[l+40>>2];c[k+(h<<3)+4>>2]=p;k=c[m+40>>2]|0;p=h+2|0;o=c[b+32>>2]|0;c[o+(n<<3)>>2]=c[l+36>>2];c[o+(n<<3)+4>>2]=k;n=c[m+40>>2]|0;o=c[b+32>>2]|0;c[o+(p<<3)>>2]=c[l+40>>2];c[o+(p<<3)+4>>2]=n;h=h+3|0;break}else{c[j+(n<<3)>>2]=e;c[j+(n<<3)+4>>2]=m;p=c[b+32>>2]|0;c[p+(h<<3)>>2]=c[l+40>>2];c[p+(h<<3)+4>>2]=m;h=h+1|0;break}}}else h=n;while(0)}while((h|0)!=0);return}function Ad(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0;h=sa;sa=sa+16|0;f=xs()|0;if((a[26704]|0)==0?mz(26704)|0:0){c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;Cf(27392,0.0,0,0,h)}c[6899]=c[6899]|1;g[6934]=0.0;w=+g[6944]*0.0;C=+g[6945]*0.0;g[6939]=+g[6943]*0.0;g[6940]=w;g[6941]=C;g[6942]=0.0;c[6947]=0;c[6948]=0;c[6949]=0;c[6950]=0;C=+g[6936]*0.0;w=+g[6937]*0.0;g[6988]=+g[6935]*0.0;g[6989]=C;g[6990]=w;g[6991]=0.0;c[f+4>>2]=7;c[f+8>>2]=-1;c[f+12>>2]=-1;g[f+16>>2]=3402823466385288598117041.0e14;a[f+20>>0]=1;a[f+21>>0]=0;c[f+24>>2]=-1;c[f+28>>2]=27392;c[f+32>>2]=b;g[f+36>>2]=0.0;g[f+40>>2]=.30000001192092896;c[f+44>>2]=0;c[f>>2]=7408;a[f+48>>0]=0;c[f+116>>2]=c[d>>2];c[f+116+4>>2]=c[d+4>>2];c[f+116+8>>2]=c[d+8>>2];c[f+116+12>>2]=c[d+12>>2];c[f+132>>2]=c[d+16>>2];c[f+132+4>>2]=c[d+16+4>>2];c[f+132+8>>2]=c[d+16+8>>2];c[f+132+12>>2]=c[d+16+12>>2];c[f+148>>2]=c[d+32>>2];c[f+148+4>>2]=c[d+32+4>>2];c[f+148+8>>2]=c[d+32+8>>2];c[f+148+12>>2]=c[d+32+12>>2];c[f+164>>2]=c[d+48>>2];c[f+164+4>>2]=c[d+48+4>>2];c[f+164+8>>2]=c[d+48+8>>2];c[f+164+12>>2]=c[d+48+12>>2];a[f+180>>0]=e&1;w=+g[f+116>>2];C=+g[b+4>>2];v=+g[f+132>>2];B=+g[b+8>>2];u=+g[f+148>>2];A=+g[b+12>>2];t=+g[f+120>>2];s=+g[f+136>>2];r=+g[f+152>>2];q=+g[f+124>>2];o=+g[f+140>>2];m=+g[f+156>>2];z=+g[b+20>>2];y=+g[b+24>>2];x=+g[b+28>>2];p=+g[b+36>>2];n=+g[b+40>>2];l=+g[b+44>>2];E=+g[f+164>>2];D=+g[f+168>>2];i=+g[f+172>>2];k=+g[b+52>>2]+(C*E+B*D+A*i);j=z*E+y*D+x*i+ +g[b+56>>2];i=p*E+n*D+l*i+ +g[b+60>>2];g[f+52>>2]=w*C+v*B+u*A;g[f+56>>2]=C*t+B*s+A*r;g[f+60>>2]=C*q+B*o+A*m;g[f+64>>2]=0.0;g[f+68>>2]=w*z+v*y+u*x;g[f+72>>2]=t*z+s*y+r*x;g[f+76>>2]=q*z+o*y+m*x;g[f+80>>2]=0.0;g[f+84>>2]=w*p+v*n+u*l;g[f+88>>2]=t*p+s*n+r*l;g[f+92>>2]=q*p+o*n+m*l;g[f+96>>2]=0.0;g[f+100>>2]=k;g[f+104>>2]=j;g[f+108>>2]=i;g[f+112>>2]=0.0;g[f+184>>2]=1.0;g[f+188>>2]=-1.0;g[f+192>>2]=0.0;g[f+196>>2]=0.0;g[f+200>>2]=1.0;g[f+204>>2]=.699999988079071;g[f+208>>2]=0.0;g[f+212>>2]=0.0;g[f+216>>2]=1.0;g[f+220>>2]=.699999988079071;g[f+224>>2]=0.0;g[f+228>>2]=0.0;g[f+264>>2]=1.0;g[f+268>>2]=.699999988079071;g[f+272>>2]=1.0;g[f+276>>2]=0.0;g[f+280>>2]=1.0;g[f+284>>2]=.699999988079071;g[f+288>>2]=1.0;g[f+292>>2]=0.0;g[f+232>>2]=1.0;g[f+236>>2]=.699999988079071;g[f+240>>2]=1.0;g[f+244>>2]=0.0;g[f+248>>2]=1.0;g[f+252>>2]=.699999988079071;g[f+256>>2]=1.0;g[f+260>>2]=0.0;a[f+1096>>0]=0;g[f+1116>>2]=0.0;g[f+1120>>2]=0.0;g[f+1124>>2]=0.0;c[f+300>>2]=0;c[f+1100>>2]=0;c[f+1100+4>>2]=0;c[f+1100+8>>2]=0;a[f+1100+12>>0]=0;a[f+49>>0]=1;kc(f,(c[f+28>>2]|0)+4|0,(c[f+32>>2]|0)+4|0);sa=h;return f|0}function Bd(b,d){b=b|0;d=d|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=c[b+92>>2]|0;if(!(Fa[c[(c[o>>2]|0)+56>>2]&127](o)|0))return;o=c[b+92>>2]|0;o=Fa[c[(c[o>>2]|0)+28>>2]&127](o)|0;f=c[o+4>>2]|0;if((f|0)>1){Ed(o,0,f+-1|0);j=c[o+4>>2]|0}else j=f;m=c[b+104>>2]|0;f=j-m|0;if((m|0)<0){if((c[o+8>>2]|0)<(f|0)){if(!f){g=0;i=j}else{c[7182]=(c[7182]|0)+1;g=xb((f<<4|3)+16|0)|0;if(!g)g=0;else{c[(g+4+15&-16)+-4>>2]=g;g=g+4+15&-16}i=c[o+4>>2]|0}if((i|0)>0){h=0;do{m=c[o+12>>2]|0;c[g+(h<<4)>>2]=c[m+(h<<4)>>2];c[g+(h<<4)+4>>2]=c[m+(h<<4)+4>>2];c[g+(h<<4)+8>>2]=c[m+(h<<4)+8>>2];c[g+(h<<4)+12>>2]=c[m+(h<<4)+12>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[o+12>>2]|0;if(h|0){if(a[o+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[o+12>>2]=0}a[o+16>>0]=1;c[o+12>>2]=g;c[o+8>>2]=f;h=o+12|0}else h=o+12|0;g=j;do{m=(c[h>>2]|0)+(g<<4)|0;g=g+1|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0}while((g|0)!=(f|0))}c[o+4>>2]=f;c[b+104>>2]=0;if((f|0)>0){l=0;m=0;g=0;h=0;do{k=c[o+12>>2]|0;j=k+(l<<4)|0;p=m;m=c[j>>2]|0;k=k+(l<<4)+4|0;i=c[k>>2]|0;if(!((m|0)==(p|0)&(i|0)==(g|0))){p=m+54|0;g=m+48|0;if((((((e[p>>1]|0)>=(e[i+48>>1]|0)?(e[i+54>>1]|0)>=(e[g>>1]|0):0)?(e[p+2>>1]|0)>=(e[i+48+2>>1]|0):0)?(e[i+54+2>>1]|0)>=(e[g+2>>1]|0):0)?(e[p+4>>1]|0)>=(e[i+52>>1]|0):0)?(e[i+54+4>>1]|0)>=(e[m+52>>1]|0):0)g=i;else{f=i;n=30}}else{f=g;n=30}if((n|0)==30){n=0;h=c[b+92>>2]|0;Za[c[(c[h>>2]|0)+32>>2]&127](h,j,d);c[j>>2]=0;c[k>>2]=0;h=(c[b+104>>2]|0)+1|0;c[b+104>>2]=h;c[7158]=(c[7158]|0)+-1;g=f;f=c[o+4>>2]|0}l=l+1|0}while((l|0)<(f|0));if((f|0)>1){Ed(o,0,f+-1|0);h=c[b+104>>2]|0;g=c[o+4>>2]|0}else g=f;f=g-h|0;if((h|0)<0){if((c[o+8>>2]|0)<(f|0)){if(!f){h=0;j=g}else{c[7182]=(c[7182]|0)+1;h=xb((f<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[o+4>>2]|0}if((j|0)>0){i=0;do{p=c[o+12>>2]|0;c[h+(i<<4)>>2]=c[p+(i<<4)>>2];c[h+(i<<4)+4>>2]=c[p+(i<<4)+4>>2];c[h+(i<<4)+8>>2]=c[p+(i<<4)+8>>2];c[h+(i<<4)+12>>2]=c[p+(i<<4)+12>>2];i=i+1|0}while((i|0)!=(j|0))}i=c[o+12>>2]|0;if(i|0){if(a[o+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[o+12>>2]=0}a[o+16>>0]=1;c[o+12>>2]=h;c[o+8>>2]=f}do{p=(c[o+12>>2]|0)+(g<<4)|0;g=g+1|0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0}while((g|0)!=(f|0))}}c[o+4>>2]=f;c[b+104>>2]=0;return}function Cd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;g=sa;sa=sa+80|0;c[a+68>>2]=(c[a+68>>2]|0)+1;f=c[a+64>>2]|0;if(f|0){d=c[(c[a+24>>2]|0)+(b*80|0)+76>>2]|0;sg(f,d)|0;e=c[f+4>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[f+4>>2]=d;c[f+12>>2]=(c[f+12>>2]|0)+-1}f=(c[a+16>>2]|0)+-1|0;e=c[a+24>>2]|0;c[g>>2]=c[e+(b*80|0)>>2];c[g+4>>2]=c[e+(b*80|0)+4>>2];c[g+8>>2]=c[e+(b*80|0)+8>>2];c[g+12>>2]=c[e+(b*80|0)+12>>2];c[g+16>>2]=c[e+(b*80|0)+16>>2];c[g+16+4>>2]=c[e+(b*80|0)+16+4>>2];c[g+16+8>>2]=c[e+(b*80|0)+16+8>>2];c[g+16+12>>2]=c[e+(b*80|0)+16+12>>2];c[g+32>>2]=c[e+(b*80|0)+32>>2];c[g+32+4>>2]=c[e+(b*80|0)+32+4>>2];c[g+32+8>>2]=c[e+(b*80|0)+32+8>>2];c[g+32+12>>2]=c[e+(b*80|0)+32+12>>2];c[g+48>>2]=c[e+(b*80|0)+48>>2];c[g+48+4>>2]=c[e+(b*80|0)+48+4>>2];c[g+48+8>>2]=c[e+(b*80|0)+48+8>>2];c[g+48+12>>2]=c[e+(b*80|0)+48+12>>2];c[g+64>>2]=c[e+(b*80|0)+64>>2];c[g+64+4>>2]=c[e+(b*80|0)+64+4>>2];c[g+64+8>>2]=c[e+(b*80|0)+64+8>>2];c[g+64+12>>2]=c[e+(b*80|0)+64+12>>2];c[e+(b*80|0)>>2]=c[e+(f*80|0)>>2];c[e+(b*80|0)+4>>2]=c[e+(f*80|0)+4>>2];c[e+(b*80|0)+8>>2]=c[e+(f*80|0)+8>>2];c[e+(b*80|0)+12>>2]=c[e+(f*80|0)+12>>2];c[e+(b*80|0)+16>>2]=c[e+(f*80|0)+16>>2];c[e+(b*80|0)+16+4>>2]=c[e+(f*80|0)+16+4>>2];c[e+(b*80|0)+16+8>>2]=c[e+(f*80|0)+16+8>>2];c[e+(b*80|0)+16+12>>2]=c[e+(f*80|0)+16+12>>2];c[e+(b*80|0)+32>>2]=c[e+(f*80|0)+32>>2];c[e+(b*80|0)+32+4>>2]=c[e+(f*80|0)+32+4>>2];c[e+(b*80|0)+32+8>>2]=c[e+(f*80|0)+32+8>>2];c[e+(b*80|0)+32+12>>2]=c[e+(f*80|0)+32+12>>2];c[e+(b*80|0)+48>>2]=c[e+(f*80|0)+48>>2];c[e+(b*80|0)+48+4>>2]=c[e+(f*80|0)+48+4>>2];c[e+(b*80|0)+48+8>>2]=c[e+(f*80|0)+48+8>>2];c[e+(b*80|0)+48+12>>2]=c[e+(f*80|0)+48+12>>2];c[e+(b*80|0)+64>>2]=c[e+(f*80|0)+64>>2];c[e+(b*80|0)+64+4>>2]=c[e+(f*80|0)+64+4>>2];c[e+(b*80|0)+64+8>>2]=c[e+(f*80|0)+64+8>>2];c[e+(b*80|0)+64+12>>2]=c[e+(f*80|0)+64+12>>2];e=c[a+24>>2]|0;c[e+(f*80|0)>>2]=c[g>>2];c[e+(f*80|0)+4>>2]=c[g+4>>2];c[e+(f*80|0)+8>>2]=c[g+8>>2];c[e+(f*80|0)+12>>2]=c[g+12>>2];c[e+(f*80|0)+16>>2]=c[g+16>>2];c[e+(f*80|0)+16+4>>2]=c[g+16+4>>2];c[e+(f*80|0)+16+8>>2]=c[g+16+8>>2];c[e+(f*80|0)+16+12>>2]=c[g+16+12>>2];c[e+(f*80|0)+32>>2]=c[g+32>>2];c[e+(f*80|0)+32+4>>2]=c[g+32+4>>2];c[e+(f*80|0)+32+8>>2]=c[g+32+8>>2];c[e+(f*80|0)+32+12>>2]=c[g+32+12>>2];c[e+(f*80|0)+48>>2]=c[g+48>>2];c[e+(f*80|0)+48+4>>2]=c[g+48+4>>2];c[e+(f*80|0)+48+8>>2]=c[g+48+8>>2];c[e+(f*80|0)+48+12>>2]=c[g+48+12>>2];c[e+(f*80|0)+64>>2]=c[g+64>>2];c[e+(f*80|0)+64+4>>2]=c[g+64+4>>2];c[e+(f*80|0)+64+8>>2]=c[g+64+8>>2];c[e+(f*80|0)+64+12>>2]=c[g+64+12>>2];if(!(c[a+64>>2]|0)){f=c[a+16>>2]|0;f=f+-1|0;c[a+16>>2]=f;sa=g;return}c[(c[(c[a+24>>2]|0)+(b*80|0)+76>>2]|0)+36>>2]=b;f=c[a+16>>2]|0;f=f+-1|0;c[a+16>>2]=f;sa=g;return}function Dd(a,d,f,h,i,j,k,l,m){a=a|0;d=d|0;f=f|0;h=+h;i=+i;j=+j;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0,G=0,H=0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0,S=0,T=0,U=0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0;U=sa;sa=sa+32|0;Q=+g[f>>2];E=+g[f+4>>2];I=+g[f+8>>2];J=1.0/+x(+((h-Q)*(h-Q)+(i-E)*(i-E)+(j-I)*(j-I)));N=(h-Q)*J==0.0?999999984306749440.0:1.0/((h-Q)*J);O=(i-E)*J==0.0?999999984306749440.0:1.0/((i-E)*J);P=(j-I)*J==0.0?999999984306749440.0:1.0/((j-I)*J);da=(Q>h?h:Q)+ +g[k>>2];ca=(E>i?i:E)+ +g[k+4>>2];ba=(I>j?j:I)+ +g[k+8>>2];$=(Q>2];X=(E>2];s=(I>2];_=+g[a+4>>2];da=da<_?_:da;W=+g[a+8>>2];ca=ca>2];ba=ba>2];Y=+g[a+24>>2];r=+g[a+28>>2];Z=+g[a+36>>2];V=+g[a+40>>2];u=+g[a+44>>2];R=~~(((aa0){o=0;n=0;p=c[a+136>>2]|0;do{n=n+1|0;q=p+6|0;v=b[p>>1]|0;w=p+10|0;y=b[p+4>>1]|0;z=p+8|0;A=b[p+2>>1]|0;B=p+12|0;C=(c[B>>2]|0)>-1;do if(((F&65535)>=(v&65535)?(R&65535)<=(e[q>>1]|0):0)&(T&65535)<=(e[w>>1]|0)&(H&65535)>=(y&65535)&(S&65535)<=(e[z>>1]|0)&(G&65535)>=(A&65535)){$=+g[a+36>>2];ba=+g[a+40>>2];da=+g[a+44>>2];aa=+g[a+4>>2];ca=+g[a+8>>2];t=+g[a+12>>2];g[U+12>>2]=0.0;u=aa+ +(e[q>>1]|0)/$;r=ca+ +(e[z>>1]|0)/ba;s=t+ +(e[w>>1]|0)/da;g[U+28>>2]=0.0;g[U>>2]=+(v&65535)/$+aa-+g[l>>2];g[U+4>>2]=+(A&65535)/ba+ca-+g[l+4>>2];g[U+8>>2]=+(y&65535)/da+t-+g[l+8>>2];g[U+16>>2]=u-+g[k>>2];g[U+20>>2]=r-+g[k+4>>2];g[U+24>>2]=s-+g[k+8>>2];s=+g[f>>2];r=N*(+g[U+((N<0.0&1)<<4)>>2]-s);s=N*(+g[U+(((N<0.0^1)&1)<<4)>>2]-s);u=+g[f+4>>2];t=O*(+g[U+((O<0.0&1)<<4)+4>>2]-u);u=O*(+g[U+(((O<0.0^1)&1)<<4)+4>>2]-u);if(!(t>s|r>u)?(K=t>r?t:r,D=u>2],L=P*(+g[U+((P<0.0&1)<<4)+8>>2]-M),M=P*(+g[U+(((P<0.0^1)&1)<<4)+8>>2]-M),!(L>D|K>M)):0){q=(M0.0?(L>K?L:K)<(j-I)*(j-I)*J+((h-Q)*(h-Q)*J+(i-E)*(i-E)*J):0;if(!(C&q)){v=9;break}v=c[B>>2]|0;Za[c[(c[d>>2]|0)+8>>2]&127](d,21?v>>21:v,v&2097151);v=10;break}q=0;v=9}else{q=0;v=9}while(0);if((v|0)==9){v=0;if(C|q)v=10;else{C=c[B>>2]|0;o=o-C|0;p=p+(0-C<<4)|0}}if((v|0)==10){o=o+1|0;p=p+16|0}}while((o|0)<(m|0))}else n=0;if((c[7162]|0)>=(n|0)){sa=U;return}c[7162]=n;sa=U;return}function Ed(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;while(1){o=c[a+12>>2]|0;q=(b+d|0)/2|0;r=c[o+(q<<4)>>2]|0;p=c[o+(q<<4)+4>>2]|0;q=c[o+(q<<4)+8>>2]|0;e=d;f=b;while(1){a:do if(!r)while(1){l=o+(f<<4)|0;j=c[l>>2]|0;if(!j)g=-1;else g=c[j+12>>2]|0;k=c[o+(f<<4)+4>>2]|0;if(!k)h=-1;else h=c[k+12>>2]|0;if(!p)i=-1;else i=c[p+12>>2]|0;do if((g|0)<=-1){g=(h|0)>(i|0);if(g|(j|0)==0^1)if((j|0)==0&g)break;else break a;if((k|0)!=(p|0))break a;if((c[o+(f<<4)+8>>2]|0)>>>0<=q>>>0)break a}while(0);f=f+1|0}else{m=c[r+12>>2]|0;while(1){l=o+(f<<4)|0;j=c[l>>2]|0;if(!j)g=-1;else g=c[j+12>>2]|0;k=c[o+(f<<4)+4>>2]|0;if(!k)h=-1;else h=c[k+12>>2]|0;if(!p)i=-1;else i=c[p+12>>2]|0;do if((g|0)<=(m|0)){g=(h|0)>(i|0);if(g|(j|0)==(r|0)^1)if((j|0)==(r|0)&g)break;else break a;if((k|0)!=(p|0))break a;if((c[o+(f<<4)+8>>2]|0)>>>0<=q>>>0)break a}while(0);f=f+1|0}}while(0);b:do if(!r)while(1){g=o+(e<<4)|0;k=c[g>>2]|0;if(!k)h=-1;else h=c[k+12>>2]|0;if(!p)i=-1;else i=c[p+12>>2]|0;m=c[o+(e<<4)+4>>2]|0;if(!m)j=-1;else j=c[m+12>>2]|0;do if((h|0)>=-1){h=(i|0)>(j|0);if(h|(k|0)==0^1)if((k|0)==0&h)break;else break b;if((p|0)!=(m|0))break b;if((c[o+(e<<4)+8>>2]|0)>>>0>=q>>>0)break b}while(0);e=e+-1|0}else{n=c[r+12>>2]|0;while(1){g=o+(e<<4)|0;k=c[g>>2]|0;if(!k)h=-1;else h=c[k+12>>2]|0;if(!p)i=-1;else i=c[p+12>>2]|0;m=c[o+(e<<4)+4>>2]|0;if(!m)j=-1;else j=c[m+12>>2]|0;do if((n|0)<=(h|0)){h=(i|0)>(j|0);if(h|(r|0)==(k|0)^1)if((r|0)==(k|0)&h)break;else break b;if((p|0)!=(m|0))break b;if((c[o+(e<<4)+8>>2]|0)>>>0>=q>>>0)break b}while(0);e=e+-1|0}}while(0);if((f|0)<=(e|0)){j=c[l>>2]|0;k=c[o+(f<<4)+4>>2]|0;m=c[o+(f<<4)+8>>2]|0;n=c[o+(f<<4)+12>>2]|0;c[l>>2]=c[g>>2];c[l+4>>2]=c[g+4>>2];c[l+8>>2]=c[g+8>>2];c[l+12>>2]=c[g+12>>2];o=c[a+12>>2]|0;c[o+(e<<4)>>2]=j;c[o+(e<<4)+4>>2]=k;c[o+(e<<4)+8>>2]=m;c[o+(e<<4)+12>>2]=n;e=e+-1|0;f=f+1|0}if((f|0)>(e|0))break;o=c[a+12>>2]|0}if((e|0)>(b|0))Ed(a,b,e);if((f|0)<(d|0))b=f;else break}return}function Fd(b,d,e,f,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=+i;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0,E=0.0;D=sa;sa=sa+32|0;if(!d){sa=D;return}m=c[b+44>>2]|0;if((m|0)<128){if((c[b+48>>2]|0)<128){c[7182]=(c[7182]|0)+1;n=xb(531)|0;if(!n)p=0;else{c[(n+4+15&-16)+-4>>2]=n;p=n+4+15&-16}o=c[b+44>>2]|0;if((o|0)>0){n=0;do{c[p+(n<<2)>>2]=c[(c[b+52>>2]|0)+(n<<2)>>2];n=n+1|0}while((n|0)!=(o|0))}n=c[b+52>>2]|0;if(n|0){if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[n+-4>>2]|0)}c[b+52>>2]=0}a[b+56>>0]=1;c[b+52>>2]=p;c[b+48>>2]=128;n=b+52|0}else n=b+52|0;do{c[(c[n>>2]|0)+(m<<2)>>2]=0;m=m+1|0}while((m|0)!=128);y=b+48|0}else{n=b+52|0;y=b+48|0}c[b+44>>2]=128;c[c[n>>2]>>2]=d;o=1;m=126;do{w=o+-1|0;p=c[n>>2]|0;x=c[p+(w<<2)>>2]|0;u=+g[x+4>>2]-+g[k+4>>2];s=+g[x+8>>2]-+g[k+8>>2];g[D>>2]=+g[x>>2]-+g[k>>2];g[D+4>>2]=u;g[D+8>>2]=s;g[D+12>>2]=0.0;s=+g[x+20>>2]-+g[j+4>>2];u=+g[x+24>>2]-+g[j+8>>2];g[D+16>>2]=+g[x+16>>2]-+g[j>>2];g[D+20>>2]=s;g[D+24>>2]=u;g[D+28>>2]=0.0;v=c[h>>2]|0;u=+g[e>>2];s=+g[f>>2];t=(+g[D+(v<<4)>>2]-u)*s;u=s*(+g[D+(1-v<<4)>>2]-u);v=c[h+4>>2]|0;s=+g[e+4>>2];E=+g[f+4>>2];r=(+g[D+(v<<4)+4>>2]-s)*E;s=E*(+g[D+(1-v<<4)+4>>2]-s);do if((!(r>u|t>s)?(A=r>t?r:t,z=s>2]|0,C=+g[e+8>>2],E=+g[f+8>>2],B=(+g[D+(v<<4)+8>>2]-C)*E,C=E*(+g[D+(1-v<<4)+8>>2]-C),!(B>z|A>C)):0)?((C0.0?(B>A?B:A)>2]|0)){Va[c[(c[l>>2]|0)+12>>2]&127](l,x);o=w;break}if((w|0)>(m|0)){v=c[b+44>>2]|0;if((v|0)<(v<<1|0)){if((c[y>>2]|0)<(v<<1|0)){if(v){c[7182]=(c[7182]|0)+1;m=xb((v<<3|3)+16|0)|0;if(!m)q=0;else{c[(m+4+15&-16)+-4>>2]=m;q=m+4+15&-16}p=c[b+44>>2]|0;if((p|0)>0){m=0;do{c[q+(m<<2)>>2]=c[(c[n>>2]|0)+(m<<2)>>2];m=m+1|0}while((m|0)!=(p|0));d=q;m=q}else{d=q;m=q}}else{d=0;m=0}p=c[n>>2]|0;if(p|0){if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[p+-4>>2]|0)}c[n>>2]=0}a[b+56>>0]=1;c[n>>2]=d;c[y>>2]=v<<1}else m=p;p=v;do{c[m+(p<<2)>>2]=0;p=p+1|0;m=c[n>>2]|0}while((p|0)!=(v<<1|0));p=m+(w<<2)|0}else p=p+(w<<2)|0;c[b+44>>2]=v<<1;m=(v<<1)+-2|0}else p=p+(w<<2)|0;c[p>>2]=c[x+36>>2];c[(c[n>>2]|0)+(o<<2)>>2]=c[x+40>>2];o=o+1|0}else o=w;while(0)}while((o|0)!=0);sa=D;return}function Gd(a,b,d,e,f,h,i,j,k,l,m,n){a=a|0;b=b|0;d=d|0;e=e|0;f=+f;h=+h;i=+i;j=+j;k=+k;l=l|0;m=+m;n=n|0;var o=0.0,p=0.0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0,B=0,C=0,D=0,E=0;E=sa;sa=sa+2560|0;Wp(E+2528|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],f);qp(E+2544|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[E+2528>>2],+g[E+2528+4>>2],+g[E+2528+8>>2]);Wp(E+2496|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],f);sp(E+2512|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[E+2496>>2],+g[E+2496+4>>2],+g[E+2496+8>>2]);Co(E+2464|0,+g[d>>2],+g[d+4>>2],+g[d+8>>2],+g[e>>2],+g[e+4>>2],+g[e+8>>2]);p=!(h<=-1.5707963705062866)?h:m*.01745329238474369+-1.5707963705062866;o=!(i>=1.5707963705062866)?i:1.5707963705062866-m*.01745329238474369;if(p>o){D=1;C=1;p=m*.01745329238474369+-1.5707963705062866;o=1.5707963705062866-m*.01745329238474369}else{D=!(i>=1.5707963705062866)^1;C=!(h<=-1.5707963705062866)^1}A=o-p;B=(~~(A/(m*.01745329238474369))|0)<1?2:~~(A/(m*.01745329238474369))+1|0;if(!(j>k))if(!(k-j>=6.2831854820251465)){o=k;z=0}else{o=k;z=1}else{j=m*.01745329238474369+-3.1415927410125732;o=3.1415927410125732;z=1}h=o-j;y=(~~(h/(m*.01745329238474369))|0)<1?2:~~(h/(m*.01745329238474369))+1|0;r=0;s=E+1184|0;t=E;while(1){if((r|0)>=(B|0))break;i=p+A/+(B+-1|0)*+(r|0);o=+yI(i)*f;i=+zI(i)*f;u=(r|0)==0;v=(r|0)==(B+-1|0);q=0;while(1){if((q|0)>=(y|0))break;k=j+h/+(y+-1|0)*+(q|0);m=+yI(k);k=i*+zI(k);yy(E+2400|0,k,+g[e>>2],+g[e+4>>2],+g[e+8>>2]);qp(E+2416|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[E+2400>>2],+g[E+2400+4>>2],+g[E+2400+8>>2]);yy(E+2384|0,i*m,+g[E+2464>>2],+g[E+2464+4>>2],+g[E+2464+8>>2]);qp(E+2432|0,+g[E+2416>>2],+g[E+2416+4>>2],+g[E+2416+8>>2],+g[E+2384>>2],+g[E+2384+4>>2],+g[E+2384+8>>2]);yy(E+2368|0,o,+g[d>>2],+g[d+4>>2],+g[d+8>>2]);qp(E+2448|0,+g[E+2432>>2],+g[E+2432+4>>2],+g[E+2432+8>>2],+g[E+2368>>2],+g[E+2368+4>>2],+g[E+2368+8>>2]);w=t+(q<<4)|0;c[w>>2]=c[E+2448>>2];c[w+4>>2]=c[E+2448+4>>2];c[w+8>>2]=c[E+2448+8>>2];c[w+12>>2]=c[E+2448+12>>2];if(u){if(D)ab[c[(c[a>>2]|0)+8>>2]&127](a,E+2512|0,w,l)}else ab[c[(c[a>>2]|0)+8>>2]&127](a,s+(q<<4)|0,w,l);x=(q|0)==0;if(x){c[E+2480>>2]=c[t>>2];c[E+2480+4>>2]=c[t+4>>2];c[E+2480+8>>2]=c[t+8>>2];c[E+2480+12>>2]=c[t+12>>2]}else ab[c[(c[a>>2]|0)+8>>2]&127](a,t+(q+-1<<4)|0,w,l);if(v&C)ab[c[(c[a>>2]|0)+8>>2]&127](a,E+2544|0,w,l);do if(n)if(z){if((q|0)!=(y+-1|0))break;ab[c[(c[a>>2]|0)+8>>2]&127](a,E+2480|0,t+(y+-1<<4)|0,l);break}else{if(!((u|v)&(x|(q|0)==(y+-1|0))))break;ab[c[(c[a>>2]|0)+8>>2]&127](a,b,w,l);break}while(0);q=q+1|0}x=t;r=r+1|0;t=s;s=x}sa=E;return}function Hd(b,d){b=b|0;d=+d;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=sa;sa=sa+16|0;n=c[b+452>>2]|0;Za[c[(c[n>>2]|0)+16>>2]&127](n,b+324|0,0);n=c[b+452>>2]|0;Fa[c[(c[n>>2]|0)+12>>2]&127](n)|0;Xb(b,d);Ki(15967);n=c[b+328>>2]|0;if((n|0)>0){f=c[b+336>>2]|0;e=0;k=0;do{m=c[(c[f+(e<<2)>>2]|0)+384>>2]|0;k=(k|0)>(m|0)?k:m;e=e+1|0}while((e|0)!=(n|0));e=0;while(1){h=c[f+(e<<2)>>2]|0;if((c[h+852>>2]|0)>0){f=0;do{m=c[(c[h+860>>2]|0)+(f<<2)>>2]|0;Ta[c[(c[m>>2]|0)+8>>2]&15](m,+g[h+452>>2],k);f=f+1|0}while((f|0)<(c[h+852>>2]|0))}e=e+1|0;if((e|0)==(n|0))break;f=c[b+336>>2]|0}if((k|0)>0){h=0;do{e=0;do{i=c[(c[b+336>>2]|0)+(e<<2)>>2]|0;j=c[i+852>>2]|0;if((j|0)>0){f=0;do{m=c[(c[i+860>>2]|0)+(f<<2)>>2]|0;Ra[c[(c[m>>2]|0)+12>>2]&7](m,+g[i+452>>2],1.0);f=f+1|0}while((f|0)!=(j|0))}e=e+1|0}while((e|0)!=(n|0));h=h+1|0}while((h|0)!=(k|0))}l=0;do{m=c[(c[b+336>>2]|0)+(l<<2)>>2]|0;if((c[m+852>>2]|0)>0){e=0;do{f=c[(c[m+860>>2]|0)+(e<<2)>>2]|0;Qa[c[(c[f>>2]|0)+16>>2]&31](f,+g[m+452>>2]);f=c[m+860>>2]|0;h=c[f+(e<<2)>>2]|0;a:do if(a[h+152>>0]|0){if(!h)k=f;else{c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);k=c[m+860>>2]|0}j=e+-1|0;f=c[m+852>>2]|0;if((f|0)>0){i=c[k+(e<<2)>>2]|0;e=0;while(1){h=k+(e<<2)|0;if((c[h>>2]|0)==(i|0))break;e=e+1|0;if((e|0)>=(f|0)){e=j;break a}}if((e|0)<(f|0)){c[h>>2]=c[k+(f+-1<<2)>>2];c[(c[m+860>>2]|0)+(f+-1<<2)>>2]=i;c[m+852>>2]=f+-1;e=j;f=f+-1|0}else e=j}else e=j}else f=c[m+852>>2]|0;while(0);e=e+1|0}while((e|0)<(f|0))}l=l+1|0}while((l|0)!=(n|0))}e=c[b+452>>2]|0;Qa[c[(c[e>>2]|0)+28>>2]&31](e,+g[e+12>>2]*d);e=c[3084]|0;n=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=n;do if(!n){if(c[e+4>>2]|0){la(o|0,0)|0;n=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[o+4>>2]|0)-(c[n+4>>2]|0)+(((c[o>>2]|0)-(c[n>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(c[e+16>>2]|0)break;e=c[3084]|0}c[3084]=c[e+20>>2]}while(0);if((c[b+328>>2]|0)<=0){b=c[b+452>>2]|0;n=c[b>>2]|0;n=n+32|0;n=c[n>>2]|0;Pa[n&511](b);sa=o;return}e=0;do{n=c[(c[b+336>>2]|0)+(e<<2)>>2]|0;ph(n,n);e=e+1|0}while((e|0)<(c[b+328>>2]|0));b=c[b+452>>2]|0;n=c[b>>2]|0;n=n+32|0;n=c[n>>2]|0;Pa[n&511](b);sa=o;return}function Id(b,d){b=b|0;d=+d;var e=0,f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0;r=sa;sa=sa+32|0;e=c[b+136>>2]|0;if((e|0)>0){f=0;do{Ld(c[b+116>>2]|0,c[b+144>>2]|0,f,0);f=f+1|0;e=c[b+136>>2]|0}while((f|0)<(e|0))}q=c[b+116>>2]|0;l=+g[q+312>>2];m=+g[q+316>>2];h=+g[q+320>>2];h=+x(+(l*l+m*m+h*h))*3.5999999046325684;g[b+112>>2]=h;p=c[b+128>>2]|0;if(+g[q+4+(p<<2)>>2]*+g[q+312>>2]+ +g[q+20+(p<<2)>>2]*+g[q+316>>2]+ +g[q+36+(p<<2)>>2]*+g[q+320>>2]<0.0)g[b+112>>2]=-h;if((e|0)>0){e=0;do{+ze(b,(c[b+144>>2]|0)+(e*284|0)|0);e=e+1|0;f=c[b+136>>2]|0}while((e|0)<(f|0));i=1.0/+g[(c[b+116>>2]|0)+344>>2];if((f|0)>0){f=0;do{e=c[b+144>>2]|0;if(!(a[e+(f*284|0)+84>>0]|0))h=0.0;else{h=+g[e+(f*284|0)+272>>2];h=i*(+g[e+(f*284|0)+216>>2]*(+g[e+(f*284|0)+204>>2]-+g[e+(f*284|0)+32>>2])*+g[e+(f*284|0)+268>>2]-h*+g[(h<0.0?e+(f*284|0)+220|0:e+(f*284|0)+224|0)>>2]);h=h<0.0?0.0:h}g[e+(f*284|0)+276>>2]=h;f=f+1|0;e=c[b+136>>2]|0}while((f|0)<(e|0));if((e|0)>0){e=0;do{p=c[b+144>>2]|0;k=+g[p+(e*284|0)+276>>2];m=+g[p+(e*284|0)+248>>2];k=k>m?m:k;m=k*+g[p+(e*284|0)+4>>2]*d;l=k*+g[p+(e*284|0)+8>>2]*d;g[r+16>>2]=+g[p+(e*284|0)>>2]*k*d;g[r+16+4>>2]=m;g[r+16+8>>2]=l;g[r+16+12>>2]=0.0;q=c[b+116>>2]|0;l=+g[p+(e*284|0)+20>>2]-+g[q+56>>2];m=+g[p+(e*284|0)+24>>2]-+g[q+60>>2];g[r>>2]=+g[p+(e*284|0)+16>>2]-+g[q+52>>2];g[r+4>>2]=l;g[r+8>>2]=m;g[r+12>>2]=0.0;Bk(q,r+16|0,r);e=e+1|0}while((e|0)<(c[b+136>>2]|0))}}}Qa[c[(c[b>>2]|0)+20>>2]&31](b,d);o=c[b+136>>2]|0;if((o|0)<=0){sa=r;return}p=c[b+144>>2]|0;q=c[b+116>>2]|0;n=0;do{h=+g[p+(n*284|0)+36>>2]-+g[q+52>>2];i=+g[p+(n*284|0)+40>>2]-+g[q+56>>2];j=+g[p+(n*284|0)+44>>2]-+g[q+60>>2];k=+g[q+332>>2];l=+g[q+336>>2];m=+g[q+328>>2];if(!(a[p+(n*284|0)+84>>0]|0)){e=p+(n*284|0)+240|0;j=+g[e>>2];s=p+(n*284|0)+236|0;f=s;h=j;i=+g[s>>2]}else{e=c[b+128>>2]|0;z=+g[q+4+(e<<2)>>2];w=+g[q+20+(e<<2)>>2];u=+g[q+36+(e<<2)>>2];y=+g[p+(n*284|0)>>2];v=+g[p+(n*284|0)+4>>2];t=+g[p+(n*284|0)+8>>2];j=((i*m-h*k+ +g[q+320>>2])*(u-t*(z*y+w*v+u*t))+((k*j-i*l+ +g[q+312>>2])*(z-y*(z*y+w*v+u*t))+(h*l-j*m+ +g[q+316>>2])*(w-v*(z*y+w*v+u*t))))*d/+g[p+(n*284|0)+212>>2];e=p+(n*284|0)+240|0;g[e>>2]=j;s=p+(n*284|0)+236|0;f=s;h=+g[s>>2];i=j}g[f>>2]=h+i;g[e>>2]=j*.9900000095367432;n=n+1|0}while((n|0)!=(o|0));sa=r;return}function Jd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,k=0,l=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0,C=0,D=0.0;C=sa;sa=sa+32|0;p=+g[d>>2];h=(g[j>>2]=p,c[j>>2]|0);s=p<999999984306749440.0?h:1566444395;o=+g[d+4>>2];k=(g[j>>2]=o,c[j>>2]|0);t=o<999999984306749440.0?k:1566444395;D=+g[d+8>>2];m=(g[j>>2]=D,c[j>>2]|0);v=D<999999984306749440.0?m:1566444395;q=+g[d+12>>2];x=q<0.0?q:0.0;h=p>-999999984306749440.0?h:-581039253;k=o>-999999984306749440.0?k:-581039253;m=D>-999999984306749440.0?m:-581039253;q=q>0.0?q:0.0;D=+g[d+16>>2];A=D<(c[j>>2]=s,+g[j>>2]);i=(g[j>>2]=D,c[j>>2]|0);s=A?i:s;o=+g[d+20>>2];A=o<(c[j>>2]=t,+g[j>>2]);l=(g[j>>2]=o,c[j>>2]|0);t=A?l:t;p=+g[d+24>>2];A=p<(c[j>>2]=v,+g[j>>2]);n=(g[j>>2]=p,c[j>>2]|0);v=A?n:v;r=+g[d+28>>2];x=r(c[j>>2]=h,+g[j>>2])?i:h;u=o>(c[j>>2]=k,+g[j>>2])?l:k;l=p>(c[j>>2]=m,+g[j>>2])?n:m;r=q>2];A=D<(c[j>>2]=s,+g[j>>2]);h=(g[j>>2]=D,c[j>>2]|0);A=A?h:s;p=+g[d+36>>2];z=p<(c[j>>2]=t,+g[j>>2]);i=(g[j>>2]=p,c[j>>2]|0);z=z?i:t;q=+g[d+40>>2];y=q<(c[j>>2]=v,+g[j>>2]);k=(g[j>>2]=q,c[j>>2]|0);y=y?k:v;o=+g[d+44>>2];x=o(c[j>>2]=w,+g[j>>2])?h:w;u=p>(c[j>>2]=u,+g[j>>2])?i:u;t=q>(c[j>>2]=l,+g[j>>2])?k:l;o=r>2]|0;h=c[s+4>>2]|0;if((h|0)==(c[s+8>>2]|0)?(B=(h|0)==0?1:h<<1,(h|0)<(B|0)):0){if(!B)n=0;else{c[7182]=(c[7182]|0)+1;h=xb(B<<6|19)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}n=h;h=c[s+4>>2]|0}if((h|0)>0){i=0;do{k=n+(i<<6)|0;l=(c[s+12>>2]|0)+(i<<6)|0;m=k+64|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(m|0));i=i+1|0}while((i|0)!=(h|0))}h=c[s+12>>2]|0;if(h|0){if(a[s+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[s+12>>2]=0}a[s+16>>0]=1;c[s+12>>2]=n;c[s+8>>2]=B;h=c[s+4>>2]|0}B=c[s+12>>2]|0;c[B+(h<<6)>>2]=A;c[B+(h<<6)+4>>2]=z;c[B+(h<<6)+8>>2]=y;g[B+(h<<6)+12>>2]=x;c[B+(h<<6)+16>>2]=v;c[B+(h<<6)+20>>2]=u;c[B+(h<<6)+24>>2]=t;g[B+(h<<6)+28>>2]=o;c[B+(h<<6)+32>>2]=-1;c[B+(h<<6)+36>>2]=e;c[B+(h<<6)+40>>2]=f;f=B+(h<<6)+44|0;c[f>>2]=c[C>>2];c[f+4>>2]=c[C+4>>2];c[f+8>>2]=c[C+8>>2];c[f+12>>2]=c[C+12>>2];c[f+16>>2]=c[C+16>>2];c[s+4>>2]=(c[s+4>>2]|0)+1;sa=C;return}function Kd(a,b,d){a=a|0;b=b|0;d=d|0;var f=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;r=sa;sa=sa+80|0;n=c[a+4>>2]|0;kb[c[(c[n>>2]|0)+16>>2]&3](n,r+76|0,r+72|0,r+68|0,r+64|0,r+60|0,r+56|0,r+52|0,r+48|0,b);n=(c[r+60>>2]|0)+(J(c[r+56>>2]|0,d)|0)|0;q=c[a+4>>2]|0;p=(c[r+68>>2]|0)==0;o=c[r+76>>2]|0;if((c[r+48>>2]|0)==3){m=c[r+64>>2]|0;k=o+(J(m,e[n+4>>1]|0)|0)|0;if(p){i=+g[k+4>>2]*+g[q+8>>2];j=+g[k>>2]*+g[q+4>>2];l=k+8|0;f=+g[q+12>>2]}else{i=+g[q+8>>2]*+h[k+8>>3];j=+g[q+4>>2]*+h[k>>3];l=q+12|0;f=+h[k+16>>3]}f=+g[l>>2]*f;g[r+32>>2]=j;g[r+36>>2]=i;g[r+40>>2]=f;g[r+44>>2]=0.0;k=o+(J(m,e[n+2>>1]|0)|0)|0;if(p){i=+g[k+4>>2]*+g[q+8>>2];j=+g[k>>2]*+g[q+4>>2];l=k+8|0;f=+g[q+12>>2]}else{i=+g[q+8>>2]*+h[k+8>>3];j=+g[q+4>>2]*+h[k>>3];l=q+12|0;f=+h[k+16>>3]}f=+g[l>>2]*f;g[r+16>>2]=j;g[r+20>>2]=i;g[r+24>>2]=f;g[r+28>>2]=0.0;l=o+(J(m,e[n>>1]|0)|0)|0;if(p){i=+g[l+4>>2]*+g[q+8>>2];j=+g[l>>2]*+g[q+4>>2];k=l+8|0;f=+g[q+12>>2]}else{i=+g[q+8>>2]*+h[l+8>>3];j=+g[q+4>>2]*+h[l>>3];k=q+12|0;f=+h[l+16>>3]}f=+g[k>>2]*f;g[r>>2]=j;q=r+4|0;g[q>>2]=i;q=r+8|0;g[q>>2]=f;q=r+12|0;g[q>>2]=0.0;q=a+8|0;q=c[q>>2]|0;p=c[q>>2]|0;p=p+8|0;p=c[p>>2]|0;ab[p&127](q,r,b,d);d=c[a+4>>2]|0;a=c[d>>2]|0;a=a+24|0;a=c[a>>2]|0;Va[a&127](d,b);sa=r;return}else{m=c[r+64>>2]|0;k=o+(J(m,c[n+8>>2]|0)|0)|0;if(p){l=k+8|0;i=+g[k+4>>2]*+g[q+8>>2];j=+g[k>>2]*+g[q+4>>2];f=+g[q+12>>2]}else{l=q+12|0;i=+g[q+8>>2]*+h[k+8>>3];j=+g[q+4>>2]*+h[k>>3];f=+h[k+16>>3]}f=+g[l>>2]*f;g[r+32>>2]=j;g[r+36>>2]=i;g[r+40>>2]=f;g[r+44>>2]=0.0;k=o+(J(m,c[n+4>>2]|0)|0)|0;if(p){i=+g[k+4>>2]*+g[q+8>>2];j=+g[k>>2]*+g[q+4>>2];l=k+8|0;f=+g[q+12>>2]}else{i=+g[q+8>>2]*+h[k+8>>3];j=+g[q+4>>2]*+h[k>>3];l=q+12|0;f=+h[k+16>>3]}f=+g[l>>2]*f;g[r+16>>2]=j;g[r+20>>2]=i;g[r+24>>2]=f;g[r+28>>2]=0.0;l=o+(J(m,c[n>>2]|0)|0)|0;if(p){i=+g[l+4>>2]*+g[q+8>>2];j=+g[l>>2]*+g[q+4>>2];k=l+8|0;f=+g[q+12>>2]}else{i=+g[q+8>>2]*+h[l+8>>3];j=+g[q+4>>2]*+h[l>>3];k=q+12|0;f=+h[l+16>>3]}f=+g[k>>2]*f;g[r>>2]=j;q=r+4|0;g[q>>2]=i;q=r+8|0;g[q>>2]=f;q=r+12|0;g[q>>2]=0.0;q=a+8|0;q=c[q>>2]|0;p=c[q>>2]|0;p=p+8|0;p=c[p>>2]|0;ab[p&127](q,r,b,d);d=c[a+4>>2]|0;a=c[d>>2]|0;a=a+24|0;a=c[a>>2]|0;Va[a&127](d,b);sa=r;return}}function Ld(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0;dg(a,b+(c*284|0)|0,d);i=+g[b+(c*284|0)+52>>2];f=+g[b+(c*284|0)+56>>2];e=+g[b+(c*284|0)+60>>2];J=+g[b+(c*284|0)+76>>2];y=+g[b+(c*284|0)+72>>2];C=+g[b+(c*284|0)+68>>2];w=1.0/+x(+((y*-i-C*-f)*(y*-i-C*-f)+((J*-f-y*-e)*(J*-f-y*-e)+(C*-e-J*-i)*(C*-e-J*-i))));v=(J*-f-y*-e)*w;u=(C*-e-J*-i)*w;w=(y*-i-C*-f)*w;j=+g[b+(c*284|0)+232>>2]*.5;n=+A(+j)/+x(+(i*i+f*f+e*e));j=+z(+j);m=2.0/(j*j+(n*-e*n*-e+(n*-i*n*-i+n*-f*n*-f)));H=1.0-(n*-f*n*-f*m+n*-e*n*-e*m);G=n*-i*n*-f*m-j*n*-e*m;I=n*-i*n*-e*m+j*n*-f*m;E=n*-i*n*-f*m+j*n*-e*m;D=1.0-(n*-i*n*-i*m+n*-e*n*-e*m);F=n*-f*n*-e*m-j*n*-i*m;l=n*-i*n*-e*m-j*n*-f*m;j=n*-f*n*-e*m+j*n*-i*m;m=1.0-(n*-i*n*-i*m+n*-f*n*-f*m);n=+g[b+(c*284|0)+236>>2]*-.5;B=+A(+n)/+x(+(J*J+(y*y+C*C)));n=+z(+n);r=2.0/(n*n+(J*B*J*B+(C*B*C*B+y*B*y*B)));o=1.0-(y*B*y*B*r+J*B*J*B*r);k=C*B*y*B*r-n*J*B*r;t=C*B*J*B*r+n*y*B*r;p=C*B*y*B*r+n*J*B*r;h=1.0-(C*B*C*B*r+J*B*J*B*r);s=y*B*J*B*r-n*C*B*r;q=C*B*J*B*r-n*y*B*r;n=y*B*J*B*r+n*C*B*r;r=1.0-(C*B*C*B*r+y*B*y*B*r);B=+g[b+(c*284|0)+68>>2];y=+g[b+(c*284|0)+72>>2];C=+g[b+(c*284|0)+76>>2];g[b+(c*284|0)+92>>2]=C*(H*t+G*s+I*r)+(B*(I*q+(G*p+H*o))+y*(I*n+(H*k+G*h)));g[b+(c*284|0)+96>>2]=w*(H*t+G*s+I*r)+(v*(I*q+(G*p+H*o))+u*(I*n+(H*k+G*h)));g[b+(c*284|0)+100>>2]=(H*t+G*s+I*r)*-e+((I*q+(G*p+H*o))*-i+(I*n+(H*k+G*h))*-f);g[b+(c*284|0)+104>>2]=0.0;g[b+(c*284|0)+108>>2]=C*(E*t+s*D+F*r)+(B*(F*q+(p*D+E*o))+y*(F*n+(E*k+D*h)));g[b+(c*284|0)+112>>2]=w*(E*t+s*D+F*r)+(v*(F*q+(p*D+E*o))+u*(F*n+(E*k+D*h)));g[b+(c*284|0)+116>>2]=(E*t+s*D+F*r)*-e+((F*q+(p*D+E*o))*-i+(F*n+(E*k+D*h))*-f);g[b+(c*284|0)+120>>2]=0.0;g[b+(c*284|0)+124>>2]=C*(l*t+j*s+m*r)+(B*(q*m+(j*p+l*o))+y*(n*m+(l*k+j*h)));g[b+(c*284|0)+128>>2]=w*(l*t+j*s+m*r)+(v*(q*m+(j*p+l*o))+u*(n*m+(l*k+j*h)));g[b+(c*284|0)+132>>2]=(l*t+j*s+m*r)*-e+((q*m+(j*p+l*o))*-i+(n*m+(l*k+j*h))*-f);g[b+(c*284|0)+136>>2]=0.0;h=+g[b+(c*284|0)+32>>2];f=f*h+ +g[b+(c*284|0)+40>>2];e=e*h+ +g[b+(c*284|0)+44>>2];g[b+(c*284|0)+140>>2]=+g[b+(c*284|0)+36>>2]+i*h;g[b+(c*284|0)+144>>2]=f;g[b+(c*284|0)+148>>2]=e;g[b+(c*284|0)+152>>2]=0.0;return}function Md(b,d,e,f,h,i,k,l){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;k=k|0;l=l|0;var m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0.0,v=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0;c[b+4>>2]=4;c[b+8>>2]=-1;c[b+12>>2]=-1;g[b+16>>2]=3402823466385288598117041.0e14;a[b+20>>0]=1;a[b+21>>0]=0;c[b+24>>2]=-1;c[b+28>>2]=d;c[b+32>>2]=e;g[b+36>>2]=0.0;g[b+40>>2]=.30000001192092896;c[b+44>>2]=0;c[b>>2]=7516;g[b+688>>2]=0.0;g[b+692>>2]=-1.0;g[b+696>>2]=.8999999761581421;g[b+700>>2]=.30000001192092896;g[b+704>>2]=1.0;g[b+708>>2]=0.0;g[b+712>>2]=0.0;a[b+716>>0]=0;a[b+736>>0]=0;a[b+737>>0]=0;a[b+738>>0]=0;a[b+739>>0]=1;a[b+740>>0]=l&1;c[b+748>>2]=0;c[b+600>>2]=c[f>>2];c[b+600+4>>2]=c[f+4>>2];c[b+600+8>>2]=c[f+8>>2];c[b+600+12>>2]=c[f+12>>2];m=+g[d+4>>2];n=+g[d+20>>2];o=+g[d+36>>2];p=+g[i>>2];q=+g[i+4>>2];r=+g[i+8>>2];do if(!(m*p+n*q+o*r>=.9999998807907104))if(!(m*p+n*q+o*r<=-.9999998807907104)){e=(g[j>>2]=o*q-n*r,c[j>>2]|0);s=(g[j>>2]=m*r-o*p,c[j>>2]|0);f=(g[j>>2]=n*p-m*q,c[j>>2]|0);z=r*(m*r-o*p)-q*(n*p-m*q);A=p*(n*p-m*q)-r*(o*q-n*r);y=q*(o*q-n*r)-p*(m*r-o*p);break}else{e=c[d+8>>2]|0;f=c[d+40>>2]|0;s=c[d+24>>2]|0;z=+g[d+12>>2];A=+g[d+28>>2];y=+g[d+44>>2];break}else{e=c[d+8>>2]|0;f=c[d+40>>2]|0;s=c[d+24>>2]|0;z=-+g[d+12>>2];A=-+g[d+28>>2];y=-+g[d+44>>2]}while(0);g[b+552>>2]=z;c[b+556>>2]=e;c[b+560>>2]=c[i>>2];g[b+564>>2]=0.0;g[b+568>>2]=A;c[b+572>>2]=s;c[b+576>>2]=c[i+4>>2];g[b+580>>2]=0.0;g[b+584>>2]=y;c[b+588>>2]=f;c[b+592>>2]=c[i+8>>2];g[b+596>>2]=0.0;p=+g[i+4>>2];t=+g[k+8>>2];q=+g[i+8>>2];u=+g[k+4>>2];v=+g[k>>2];m=+g[i>>2];do if(t*q+(p*u+v*m)<-.9999998807907104)if(+w(+q)>.7071067690849304){n=1.0/+x(+(p*p+q*q));o=-(q*n);r=0.0;n=p*n;m=0.0;break}else{q=1.0/+x(+(p*p+m*m));o=m*q;r=0.0;n=0.0;m=-(p*q);break}else{B=+x(+((t*q+(p*u+v*m)+1.0)*2.0));o=(q*v-t*m)*(1.0/B);r=B*.5;n=(u*m-p*v)*(1.0/B);m=(p*t-q*u)*(1.0/B)}while(0);D=z*r+y*o-A*n;q=A*r+z*n-y*m;p=y*r+A*m-z*o;C=-(z*m)-A*o-y*n;z=-m;o=-o;y=-n;B=q*y+(r*D+C*z)-p*o;A=p*z+(r*q+C*o)-D*y;z=D*o+(C*y+r*p)-q*z;c[b+664>>2]=c[h>>2];c[b+664+4>>2]=c[h+4>>2];c[b+664+8>>2]=c[h+8>>2];c[b+664+12>>2]=c[h+12>>2];g[b+616>>2]=B;g[b+620>>2]=u*z-t*A;c[b+624>>2]=c[k>>2];g[b+628>>2]=0.0;g[b+632>>2]=A;g[b+636>>2]=t*B-v*z;c[b+640>>2]=c[k+4>>2];g[b+644>>2]=0.0;g[b+648>>2]=z;g[b+652>>2]=v*A-u*B;c[b+656>>2]=c[k+8>>2];g[b+660>>2]=0.0;g[b+732>>2]=l?-1.0:1.0;return}function Nd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;var h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0;n=sa;sa=sa+16|0;m=+g[d>>2];i=+g[d+4>>2];j=+g[d+8>>2];k=+g[e>>2];l=+g[e+4>>2];h=+g[e+8>>2];if(!(a[b+228>>0]|0)){y=+g[b+100>>2];v=+g[b+116>>2];B=+g[b+132>>2];x=+g[b+104>>2];t=+g[b+120>>2];A=+g[b+136>>2];w=+g[b+108>>2];r=+g[b+124>>2];z=+g[b+140>>2];E=-+g[b+148>>2];D=-+g[b+152>>2];C=-+g[b+156>>2];I=+g[b+164>>2];H=+g[b+168>>2];q=+g[b+172>>2];G=+g[b+180>>2];F=+g[b+184>>2];p=+g[b+188>>2];u=+g[b+196>>2];s=+g[b+200>>2];o=+g[b+204>>2];q=h*(B*I+A*H+z*q)+(k*(y*I+x*H+w*q)+l*(v*I+t*H+r*q))+(I*(y*E+v*D+B*C)+(x*E+t*D+A*C)*H+(w*E+r*D+z*C)*q+ +g[b+212>>2]);p=h*(B*G+A*F+z*p)+(k*(y*G+x*F+w*p)+l*(v*G+t*F+r*p))+((y*E+v*D+B*C)*G+(x*E+t*D+A*C)*F+(w*E+r*D+z*C)*p+ +g[b+216>>2]);o=(y*E+v*D+B*C)*u+(x*E+t*D+A*C)*s+(w*E+r*D+z*C)*o+ +g[b+220>>2]+(h*(B*u+A*s+z*o)+(k*(y*u+x*s+w*o)+l*(v*u+t*s+r*o)));g[n>>2]=q;g[n+4>>2]=p;g[n+8>>2]=o;m=m*(m*f+k-q)+i*(i*f+l-p)+j*(j*f+h-o);e=n+12|0;g[e>>2]=0.0;b=b+32|0;b=c[b>>2]|0;e=c[b>>2]|0;e=e+16|0;e=c[e>>2]|0;_a[e&15](b,d,n,m);sa=n;return}else{y=+g[b+36>>2];B=+g[b+52>>2];v=+g[b+68>>2];z=+g[b+40>>2];D=+g[b+56>>2];w=+g[b+72>>2];A=+g[b+44>>2];F=+g[b+60>>2];x=+g[b+76>>2];s=-+g[b+84>>2];t=-+g[b+88>>2];u=-+g[b+92>>2];o=+g[b+164>>2];p=+g[b+168>>2];G=+g[b+172>>2];q=+g[b+180>>2];r=+g[b+184>>2];H=+g[b+188>>2];C=+g[b+196>>2];E=+g[b+200>>2];I=+g[b+204>>2];G=(j*f+h)*(v*o+w*p+x*G)+((m*f+k)*(y*o+z*p+A*G)+(i*f+l)*(B*o+D*p+F*G))+(o*(y*s+B*t+v*u)+(z*s+D*t+w*u)*p+(A*s+F*t+x*u)*G+ +g[b+212>>2]);H=(j*f+h)*(v*q+w*r+x*H)+((m*f+k)*(y*q+z*r+A*H)+(i*f+l)*(B*q+D*r+F*H))+((y*s+B*t+v*u)*q+(z*s+D*t+w*u)*r+(A*s+F*t+x*u)*H+ +g[b+216>>2]);I=(y*s+B*t+v*u)*C+(z*s+D*t+w*u)*E+(A*s+F*t+x*u)*I+ +g[b+220>>2]+((j*f+h)*(v*C+w*E+x*I)+((m*f+k)*(y*C+z*E+A*I)+(i*f+l)*(B*C+D*E+F*I)));g[n>>2]=G+m*(m*(G-k)+i*(H-l)+j*(I-h));g[n+4>>2]=H+i*(m*(G-k)+i*(H-l)+j*(I-h));g[n+8>>2]=I+j*(m*(G-k)+i*(H-l)+j*(I-h));I=m*(G-k)+i*(H-l)+j*(I-h);e=n+12|0;g[e>>2]=0.0;b=b+32|0;b=c[b>>2]|0;e=c[b>>2]|0;e=e+16|0;e=c[e>>2]|0;_a[e&15](b,d,n,I);sa=n;return}}function Od(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;if(!((a|0)!=0&(b|0)!=0))return;c[7182]=(c[7182]|0)+1;e=xb(1043)|0;if(!e)f=0;else{c[(e+4+15&-16)+-4>>2]=e;f=e+4+15&-16}c[f>>2]=a;c[f+4>>2]=b;e=1;b=124;h=128;a=f;l=128;k=f;i=f;o=f;while(1){r=e+-1|0;p=c[a+(r<<3)>>2]|0;q=c[a+(r<<3)+4>>2]|0;if((r|0)>(b|0)){n=l<<1;do if((l|0)<(n|0)&(h|0)<(n|0)){if(l){c[7182]=(c[7182]|0)+1;b=xb((l<<4|3)+16|0)|0;if(!b)f=0;else{c[(b+4+15&-16)+-4>>2]=b;f=b+4+15&-16}if((l|0)>0){b=0;do{j=a+(b<<3)|0;k=c[j+4>>2]|0;m=f+(b<<3)|0;c[m>>2]=c[j>>2];c[m+4>>2]=k;b=b+1|0}while((b|0)!=(l|0));h=f;a=f}else{h=f;b=f;s=13}}else{h=0;b=0;s=13}if((s|0)==13){s=0;if(!a){j=n;a=b;f=h;i=h;b=h;break}else a=b}if(!o){j=n;f=h;i=h;b=h}else{c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0);j=n;f=h;i=h;b=h}}else{j=h;f=k;b=o}while(0);m=n+-4|0;h=j;l=n;k=f;j=b}else{m=b;j=o}do if((p|0)==(q|0))if(!(c[p+40>>2]|0))e=r;else{q=c[p+36>>2]|0;c[a+(r<<3)>>2]=q;c[a+(r<<3)+4>>2]=q;q=c[p+40>>2]|0;r=e+1|0;c[a+(e<<3)>>2]=q;c[a+(e<<3)+4>>2]=q;q=c[p+40>>2]|0;c[a+(r<<3)>>2]=c[p+36>>2];c[a+(r<<3)+4>>2]=q;e=e+2|0}else if(((((+g[p>>2]<=+g[q+16>>2]?+g[p+16>>2]>=+g[q>>2]:0)?+g[p+4>>2]<=+g[q+20>>2]:0)?+g[p+20>>2]>=+g[q+4>>2]:0)?+g[p+8>>2]<=+g[q+24>>2]:0)?+g[p+24>>2]>=+g[q+8>>2]:0){b=(c[q+40>>2]|0)!=0;if(!(c[p+40>>2]|0))if(b){o=c[q+36>>2]|0;c[a+(r<<3)>>2]=p;c[a+(r<<3)+4>>2]=o;r=c[q+40>>2]|0;c[a+(e<<3)>>2]=p;c[a+(e<<3)+4>>2]=r;e=e+1|0;break}else{Za[c[(c[d>>2]|0)+8>>2]&127](d,p,q);e=r;break}else{f=c[p+36>>2]|0;if(b){n=c[q+36>>2]|0;c[a+(r<<3)>>2]=f;c[a+(r<<3)+4>>2]=n;n=c[q+36>>2]|0;o=e+1|0;c[a+(e<<3)>>2]=c[p+40>>2];c[a+(e<<3)+4>>2]=n;n=c[q+40>>2]|0;r=e+2|0;c[a+(o<<3)>>2]=c[p+36>>2];c[a+(o<<3)+4>>2]=n;q=c[q+40>>2]|0;c[a+(r<<3)>>2]=c[p+40>>2];c[a+(r<<3)+4>>2]=q;e=e+3|0;break}else{c[a+(r<<3)>>2]=f;c[a+(r<<3)+4>>2]=q;c[a+(e<<3)>>2]=c[p+40>>2];c[a+(e<<3)+4>>2]=q;e=e+1|0;break}}}else e=r;while(0);if(!e)break;else{b=m;o=j}}if((a|0)==0|(k|0)==0)return;c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);return}function Pd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0,J=0;J=sa;sa=sa+32|0;if(!a){sa=J;return}E=+g[d>>2]-+g[b>>2];D=+g[d+4>>2]-+g[b+4>>2];w=+g[d+8>>2]-+g[b+8>>2];y=1.0/+x(+(E*E+D*D+w*w));z=E*y==0.0?999999984306749440.0:1.0/(E*y);A=D*y==0.0?999999984306749440.0:1.0/(D*y);B=w*y==0.0?999999984306749440.0:1.0/(w*y);c[7182]=(c[7182]|0)+1;d=xb(531)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}mk(d+4|0,0,508)|0;c[d>>2]=a;p=1;o=126;n=128;s=d;t=128;v=d;l=d;f=d;while(1){q=p+-1|0;d=s+(q<<2)|0;u=c[d>>2]|0;c[J>>2]=c[u>>2];c[J+4>>2]=c[u+4>>2];c[J+8>>2]=c[u+8>>2];c[J+12>>2]=c[u+12>>2];c[J+16>>2]=c[u+16>>2];c[J+16+4>>2]=c[u+16+4>>2];c[J+16+8>>2]=c[u+16+8>>2];c[J+16+12>>2]=c[u+16+12>>2];i=+g[b>>2];h=z*(+g[J+((z<0.0&1)<<4)>>2]-i);i=z*(+g[J+(((z<0.0^1)&1)<<4)>>2]-i);k=+g[b+4>>2];j=A*(+g[J+((A<0.0&1)<<4)+4>>2]-k);k=A*(+g[J+(((A<0.0^1)&1)<<4)+4>>2]-k);do if((!(j>i|h>k)?(F=j>h?j:h,C=k>2],G=B*(+g[J+((B<0.0&1)<<4)+8>>2]-H),H=B*(+g[J+(((B<0.0^1)&1)<<4)+8>>2]-H),!(G>C|F>H)):0)?((H0.0?(G>F?G:F)>2]|0)){Va[c[(c[e>>2]|0)+12>>2]&127](e,u);p=q;d=s;m=t;a=v;break}if((q|0)>(o|0)){r=t<<1;if((t|0)<(r|0)){do if((n|0)<(r|0)){if(t){c[7182]=(c[7182]|0)+1;d=xb((t<<3|3)+16|0)|0;if(!d)a=0;else{c[(d+4+15&-16)+-4>>2]=d;a=d+4+15&-16}if((t|0)>0){d=0;do{c[a+(d<<2)>>2]=c[s+(d<<2)>>2];d=d+1|0}while((d|0)!=(t|0));f=a;d=a}else{f=a;d=a;I=18}}else{f=0;d=0;I=18}if((I|0)==18){I=0;if(!s){n=r;l=f;m=f;a=f;break}}if(!v){n=r;l=f;m=f;a=f}else{c[7183]=(c[7183]|0)+1;Hc(c[v+-4>>2]|0);n=r;l=f;m=f;a=f}}else{d=s;m=f;a=v}while(0);mk(d+(t<<2)|0,0,t<<2|0)|0;o=d+(q<<2)|0;f=m}else{o=d;d=s;a=v}q=r+-2|0;m=r}else{q=o;o=d;d=s;m=t;a=v}c[o>>2]=c[u+36>>2];c[d+(p<<2)>>2]=c[u+40>>2];p=p+1|0;o=q}else{p=q;d=s;m=t;a=v}while(0);if(!p)break;s=d;t=m;v=a}if((d|0)==0|(l|0)==0){sa=J;return}c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0);sa=J;return}function Qd(b){b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;o=sa;sa=sa+16|0;Ki(16410);k=c[b+204>>2]|0;Za[c[(c[k>>2]|0)+8>>2]&127](k,b,c[b+24>>2]|0);k=c[b+308>>2]|0;if((k|0)>0){l=c[b+316>>2]|0;j=0;do{e=c[l+(j<<2)>>2]|0;d=c[e+740>>2]|0;e=c[e+744>>2]|0;if((d|0?(e|0?(c[d+204>>2]&3|0)==0:0):0)?(c[e+204>>2]&3|0)==0:0){f=c[d+208>>2]|0;d=c[e+208>>2]|0;i=c[(c[b+204>>2]|0)+16>>2]|0;e=c[i+(f<<3)>>2]|0;if((e|0)!=(f|0)){c[i+(f<<3)>>2]=c[i+(e<<3)>>2];f=c[i+(e<<3)>>2]|0;e=c[i+(f<<3)>>2]|0;if((f|0)!=(e|0)){h=i+(f<<3)|0;do{f=i+(e<<3)|0;c[h>>2]=c[f>>2];f=c[f>>2]|0;h=i+(f<<3)|0;e=c[h>>2]|0}while((f|0)!=(e|0))}}e=c[i+(d<<3)>>2]|0;if((e|0)!=(d|0)){c[i+(d<<3)>>2]=c[i+(e<<3)>>2];d=c[i+(e<<3)>>2]|0;e=c[i+(d<<3)>>2]|0;if((d|0)!=(e|0)){h=i+(d<<3)|0;do{d=i+(e<<3)|0;c[h>>2]=c[d>>2];d=c[d>>2]|0;h=i+(d<<3)|0;e=c[h>>2]|0}while((d|0)!=(e|0))}}if((f|0)!=(d|0)){c[i+(f<<3)>>2]=d;h=i+(d<<3)+4|0;c[h>>2]=(c[h>>2]|0)+(c[i+(f<<3)+4>>2]|0)}}j=j+1|0}while((j|0)!=(k|0))}k=c[b+212>>2]|0;if((k|0)>0){l=c[b+220>>2]|0;j=0;do{d=c[l+(j<<2)>>2]|0;if((a[d+20>>0]|0?(m=c[d+28>>2]|0,(c[m+204>>2]&3|0)==0):0)?(n=c[d+32>>2]|0,(c[n+204>>2]&3|0)==0):0){e=c[m+208>>2]|0;d=c[n+208>>2]|0;i=c[(c[b+204>>2]|0)+16>>2]|0;f=c[i+(e<<3)>>2]|0;if((f|0)!=(e|0)){c[i+(e<<3)>>2]=c[i+(f<<3)>>2];e=c[i+(f<<3)>>2]|0;f=c[i+(e<<3)>>2]|0;if((e|0)!=(f|0)){h=i+(e<<3)|0;do{e=i+(f<<3)|0;c[h>>2]=c[e>>2];e=c[e>>2]|0;h=i+(e<<3)|0;f=c[h>>2]|0}while((e|0)!=(f|0))}}f=c[i+(d<<3)>>2]|0;if((f|0)!=(d|0)){c[i+(d<<3)>>2]=c[i+(f<<3)>>2];d=c[i+(f<<3)>>2]|0;f=c[i+(d<<3)>>2]|0;if((d|0)!=(f|0)){h=i+(d<<3)|0;do{d=i+(f<<3)|0;c[h>>2]=c[d>>2];d=c[d>>2]|0;h=i+(d<<3)|0;f=c[h>>2]|0}while((d|0)!=(f|0))}}if((e|0)!=(d|0)){c[i+(e<<3)>>2]=d;h=i+(d<<3)+4|0;c[h>>2]=(c[h>>2]|0)+(c[i+(e<<3)+4>>2]|0)}}j=j+1|0}while((j|0)!=(k|0))}d=c[b+204>>2]|0;Va[c[(c[d>>2]|0)+12>>2]&127](d,b);d=c[3084]|0;n=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=n;if(n|0){sa=o;return}do if(c[d+4>>2]|0){la(o|0,0)|0;n=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[o+4>>2]|0)-(c[n+4>>2]|0)+(((c[o>>2]|0)-(c[n>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=o;return}}while(0);c[3084]=c[d+20>>2];sa=o;return}function Rd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0,G=0.0,H=0.0,I=0.0;d=sa;sa=sa+96|0;k=+g[b>>2];l=+g[a+28>>2];m=+g[b+4>>2];n=+g[a+32>>2];o=+g[b+8>>2];p=+g[a+36>>2];q=+g[a+44>>2];r=+g[a+48>>2];s=+g[a+52>>2];t=+g[a+60>>2];u=+g[a+64>>2];v=+g[a+68>>2];w=+g[a+76>>2];y=+g[a+80>>2];z=+g[a+84>>2];g[d+80>>2]=k*l+m*n+o*p+w;g[d+80+4>>2]=k*q+m*r+o*s+y;g[d+80+8>>2]=k*t+m*u+o*v+z;g[d+80+12>>2]=0.0;A=+g[b+16>>2];B=+g[b+20>>2];C=+g[b+24>>2];g[d+64>>2]=w+(l*A+n*B+p*C);g[d+64+4>>2]=y+(q*A+r*B+s*C);g[d+64+8>>2]=z+(t*A+u*B+v*C);g[d+64+12>>2]=0.0;D=+g[b+32>>2];E=+g[b+36>>2];j=+g[b+40>>2];g[d+48>>2]=w+(l*D+n*E+p*j);g[d+48+4>>2]=y+(q*D+r*E+s*j);g[d+48+8>>2]=z+(t*D+u*E+v*j);g[d+48+12>>2]=0.0;f=(k*l+m*n+o*p+w+(w+(l*A+n*B+p*C))+(w+(l*D+n*E+p*j)))*.3333333432674408;h=(k*q+m*r+o*s+y+(y+(q*A+r*B+s*C))+(y+(q*D+r*E+s*j)))*.3333333432674408;i=(k*t+m*u+o*v+z+(z+(t*A+u*B+v*C))+(z+(t*D+u*E+v*j)))*.3333333432674408;g[d+32>>2]=f;g[d+32+4>>2]=h;g[d+32+8>>2]=i;g[d+32+12>>2]=0.0;b=c[a+8>>2]|0;if(!((Fa[c[(c[b>>2]|0)+48>>2]&127](b)|0)&16384)){e=c[a+8>>2]|0;F=c[e>>2]|0;F=F+8|0;F=c[F>>2]|0;b=a+12|0;ab[F&127](e,d+80|0,d+64|0,b);e=c[a+8>>2]|0;F=c[e>>2]|0;F=F+8|0;F=c[F>>2]|0;ab[F&127](e,d+64|0,d+48|0,b);a=c[a+8>>2]|0;e=c[a>>2]|0;e=e+8|0;e=c[e>>2]|0;ab[e&127](a,d+48|0,d+80|0,b);sa=d;return}I=+g[d+80>>2];H=y+(q*A+r*B+s*C)-(k*q+m*r+o*s+y);G=z+(t*A+u*B+v*C)-(k*t+m*u+o*v+z);y=y+(q*D+r*E+s*j)-(k*q+m*r+o*s+y);v=z+(t*D+u*E+v*j)-(k*t+m*u+o*v+z);z=G*(w+(l*D+n*E+p*j)-I)-(w+(l*A+n*B+p*C)-I)*v;D=(w+(l*A+n*B+p*C)-I)*y-H*(w+(l*D+n*E+p*j)-I);E=1.0/+x(+(D*D+((H*v-G*y)*(H*v-G*y)+z*z)));c[d+16>>2]=1065353216;c[d+16+4>>2]=1065353216;c[d+16+8>>2]=0;g[d+16+12>>2]=0.0;b=c[a+8>>2]|0;e=c[(c[b>>2]|0)+8>>2]|0;g[d>>2]=(H*v-G*y)*E+f;g[d+4>>2]=z*E+h;g[d+8>>2]=D*E+i;g[d+12>>2]=0.0;ab[e&127](b,d+32|0,d,d+16|0);b=c[a+8>>2]|0;e=c[b>>2]|0;e=e+8|0;e=c[e>>2]|0;F=a+12|0;ab[e&127](b,d+80|0,d+64|0,F);b=c[a+8>>2]|0;e=c[b>>2]|0;e=e+8|0;e=c[e>>2]|0;ab[e&127](b,d+64|0,d+48|0,F);a=c[a+8>>2]|0;b=c[a>>2]|0;b=b+8|0;b=c[b>>2]|0;ab[b&127](a,d+48|0,d+80|0,F);sa=d;return}function Sd(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;var h=0,i=0.0,j=0.0,k=0.0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0,v=0.0,w=0.0,x=0,y=0;t=sa;sa=sa+192|0;s=c[(c[b+4>>2]|0)+740>>2]|0;l=c[(c[b+8>>2]|0)+8>>2]|0;m=+g[e>>2];n=+g[d>>2]*f+m;o=+g[e+4>>2];p=+g[d+4>>2]*f+o;q=+g[e+8>>2];r=+g[d+8>>2]*f+q;if((s|0)!=(l|0)){u=c[(c[b+12>>2]|0)+8>>2]|0;w=n-+g[u+52>>2];v=p-+g[u+56>>2];k=r-+g[u+60>>2];h=l;i=w*+g[u+4>>2]+v*+g[u+20>>2]+k*+g[u+36>>2];j=w*+g[u+8>>2]+v*+g[u+24>>2]+k*+g[u+40>>2];k=w*+g[u+12>>2]+v*+g[u+28>>2]+k*+g[u+44>>2]}else{v=n-+g[s+52>>2];w=p-+g[s+56>>2];k=r-+g[s+60>>2];h=c[(c[b+12>>2]|0)+8>>2]|0;i=v*+g[s+4>>2]+w*+g[s+20>>2]+k*+g[s+36>>2];j=v*+g[s+8>>2]+w*+g[s+24>>2]+k*+g[s+40>>2];k=v*+g[s+12>>2]+w*+g[s+28>>2]+k*+g[s+44>>2]}m=m-+g[h+52>>2];o=o-+g[h+56>>2];w=q-+g[h+60>>2];q=m*+g[h+4>>2]+o*+g[h+20>>2]+w*+g[h+36>>2];v=m*+g[h+8>>2]+o*+g[h+24>>2]+w*+g[h+40>>2];w=m*+g[h+12>>2]+o*+g[h+28>>2]+w*+g[h+44>>2];g[t>>2]=i;g[t+4>>2]=j;g[t+8>>2]=k;g[t+12>>2]=0.0;g[t+16>>2]=q;g[t+20>>2]=v;g[t+24>>2]=w;g[t+28>>2]=0.0;c[t+64>>2]=c[d>>2];c[t+64+4>>2]=c[d+4>>2];c[t+64+8>>2]=c[d+8>>2];c[t+64+12>>2]=c[d+12>>2];g[t+80>>2]=f;g[t+84>>2]=0.0;g[t+88>>2]=0.0;g[t+92>>2]=0.0;c[t+112>>2]=0;a[t+116>>0]=0;c[t+120>>2]=0;c[t+120+4>>2]=0;c[t+120+8>>2]=0;c[t+120+12>>2]=0;c[t+120+16>>2]=0;c[t+120+20>>2]=0;c[t+120+24>>2]=0;c[t+120+28>>2]=0;g[t+48>>2]=n;g[t+52>>2]=p;g[t+56>>2]=r;g[t+60>>2]=0.0;c[t+32>>2]=c[e>>2];c[t+32+4>>2]=c[e+4>>2];c[t+32+8>>2]=c[e+8>>2];c[t+32+12>>2]=c[e+12>>2];if((s|0)!=(l|0)){u=b+24|0;d=b+28|0;e=b+16|0;h=b+20|0;u=c[u>>2]|0;d=c[d>>2]|0;e=c[e>>2]|0;h=c[h>>2]|0;y=t+96|0;c[y>>2]=h;y=t+100|0;c[y>>2]=e;y=t+104|0;c[y>>2]=d;y=t+108|0;c[y>>2]=u;y=b+12|0;x=(s|0)!=(l|0)?y:b+8|0;x=c[x>>2]|0;s=(s|0)!=(l|0)?b+8|0:y;s=c[s>>2]|0;l=b+32|0;l=c[l>>2]|0;b=c[l>>2]|0;b=b+12|0;b=c[b>>2]|0;+Ca[b&1](l,t,x,h,d,s,e,u);sa=t;return}else{y=b+28|0;e=b+24|0;x=b+20|0;d=b+16|0;y=c[y>>2]|0;e=c[e>>2]|0;x=c[x>>2]|0;d=c[d>>2]|0;u=t+96|0;c[u>>2]=d;u=t+100|0;c[u>>2]=x;u=t+104|0;c[u>>2]=e;u=t+108|0;c[u>>2]=y;u=b+12|0;h=(s|0)!=(l|0)?u:b+8|0;h=c[h>>2]|0;u=(s|0)!=(l|0)?b+8|0:u;u=c[u>>2]|0;s=b+32|0;s=c[s>>2]|0;l=c[s>>2]|0;l=l+12|0;l=c[l>>2]|0;+Ca[l&1](s,t,h,d,e,u,x,y);sa=t;return}}function Td(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;c[b+4>>2]=6;c[b+8>>2]=-1;c[b+12>>2]=-1;g[b+16>>2]=3402823466385288598117041.0e14;a[b+20>>0]=1;a[b+21>>0]=0;c[b+24>>2]=-1;c[b+28>>2]=d;c[b+32>>2]=e;g[b+36>>2]=0.0;g[b+40>>2]=.30000001192092896;c[b+44>>2]=0;c[b>>2]=7188;c[b+48>>2]=c[f>>2];c[b+48+4>>2]=c[f+4>>2];c[b+48+8>>2]=c[f+8>>2];c[b+48+12>>2]=c[f+12>>2];c[b+64>>2]=c[f+16>>2];c[b+64+4>>2]=c[f+16+4>>2];c[b+64+8>>2]=c[f+16+8>>2];c[b+64+12>>2]=c[f+16+12>>2];c[b+80>>2]=c[f+32>>2];c[b+80+4>>2]=c[f+32+4>>2];c[b+80+8>>2]=c[f+32+8>>2];c[b+80+12>>2]=c[f+32+12>>2];c[b+96>>2]=c[f+48>>2];c[b+96+4>>2]=c[f+48+4>>2];c[b+96+8>>2]=c[f+48+8>>2];c[b+96+12>>2]=c[f+48+12>>2];c[b+112>>2]=c[h>>2];c[b+112+4>>2]=c[h+4>>2];c[b+112+8>>2]=c[h+8>>2];c[b+112+12>>2]=c[h+12>>2];c[b+128>>2]=c[h+16>>2];c[b+128+4>>2]=c[h+16+4>>2];c[b+128+8>>2]=c[h+16+8>>2];c[b+128+12>>2]=c[h+16+12>>2];c[b+144>>2]=c[h+32>>2];c[b+144+4>>2]=c[h+32+4>>2];c[b+144+8>>2]=c[h+32+8>>2];c[b+144+12>>2]=c[h+32+12>>2];c[b+160>>2]=c[h+48>>2];c[b+160+4>>2]=c[h+48+4>>2];c[b+160+8>>2]=c[h+48+8>>2];c[b+160+12>>2]=c[h+48+12>>2];d=b+680|0;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));c[b+740>>2]=0;c[b+740+4>>2]=0;c[b+740+8>>2]=0;c[b+740+12>>2]=0;c[b+756>>2]=1045220557;c[b+760>>2]=1045220557;c[b+764>>2]=1045220557;c[b+768>>2]=0;c[b+768+4>>2]=0;c[b+768+8>>2]=0;c[b+768+12>>2]=0;c[b+768+16>>2]=0;g[b+728>>2]=.699999988079071;g[b+732>>2]=1.0;g[b+736>>2]=.5;a[b+788>>0]=0;a[b+788+1>>0]=0;a[b+788+2>>0]=0;c[b+792>>2]=0;c[b+792+4>>2]=0;c[b+792+8>>2]=0;c[b+808>>2]=0;c[b+808+4>>2]=0;c[b+808+8>>2]=0;g[b+928>>2]=0.0;g[b+876>>2]=0.0;g[b+880>>2]=.10000000149011612;g[b+884>>2]=300.0;g[b+868>>2]=1.0;g[b+872>>2]=-1.0;g[b+896>>2]=0.0;g[b+900>>2]=.20000000298023224;g[b+904>>2]=0.0;g[b+908>>2]=0.0;g[b+888>>2]=1.0;g[b+892>>2]=.5;c[b+924>>2]=0;g[b+916>>2]=0.0;a[b+912>>0]=0;g[b+992>>2]=0.0;g[b+940>>2]=0.0;g[b+944>>2]=.10000000149011612;g[b+948>>2]=300.0;g[b+932>>2]=1.0;g[b+936>>2]=-1.0;g[b+960>>2]=0.0;g[b+964>>2]=.20000000298023224;g[b+968>>2]=0.0;g[b+972>>2]=0.0;g[b+952>>2]=1.0;g[b+956>>2]=.5;c[b+988>>2]=0;g[b+980>>2]=0.0;a[b+976>>0]=0;g[b+1056>>2]=0.0;g[b+1004>>2]=0.0;g[b+1008>>2]=.10000000149011612;g[b+1012>>2]=300.0;g[b+996>>2]=1.0;g[b+1e3>>2]=-1.0;g[b+1024>>2]=0.0;g[b+1028>>2]=.20000000298023224;g[b+1032>>2]=0.0;g[b+1036>>2]=0.0;g[b+1016>>2]=1.0;g[b+1020>>2]=.5;c[b+1052>>2]=0;g[b+1044>>2]=0.0;a[b+1040>>0]=0;a[b+1300>>0]=i&1;a[b+1301>>0]=1;c[b+1304>>2]=0;a[b+1308>>0]=0;tc(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);return}function Ud(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0,j=0.0;a=sa;sa=sa+144|0;switch(c[b+388>>2]&15){case 1:{c[a+112>>2]=6124;h=c[d+8>>2]|0;h=(c[h+236>>2]&2|0)==0?0:h;i=c[d+12>>2]|0;j=+g[i+48>>2];e=+g[i+52>>2];f=+g[i+56>>2];f=+x(+((j-j)*(j-j)+(e-e)*(e-e)+(f-f)*(f-f)));i=c[b+192>>2]|0;e=+va[c[(c[i>>2]|0)+48>>2]&15](i);i=c[d+4>>2]|0;ab[c[(c[i>>2]|0)+8>>2]&127](i,c[d+12>>2]|0,a+96|0,a+64|0);c[a>>2]=c[a+96>>2];c[a+4>>2]=c[a+96+4>>2];c[a+8>>2]=c[a+96+8>>2];c[a+12>>2]=c[a+96+12>>2];c[a+16>>2]=c[a+64>>2];c[a+16+4>>2]=c[a+64+4>>2];c[a+16+8>>2]=c[a+64+8>>2];c[a+16+12>>2]=c[a+64+12>>2];c[a+32>>2]=c[a>>2];c[a+32+4>>2]=c[a+4>>2];c[a+32+8>>2]=c[a+8>>2];c[a+32+12>>2]=c[a+12>>2];c[a+32+16>>2]=c[a+16>>2];c[a+32+20>>2]=c[a+20>>2];c[a+32+24>>2]=c[a+24>>2];c[a+32+28>>2]=c[a+28>>2];g[a+32>>2]=+g[a+32>>2]-e;g[a+32+4>>2]=+g[a+32+4>>2]-e;g[a+32+8>>2]=+g[a+32+8>>2]-e;g[a+32+16>>2]=e+ +g[a+32+16>>2];g[a+32+20>>2]=e+ +g[a+32+20>>2];g[a+32+24>>2]=e+ +g[a+32+24>>2];c[a+112+4>>2]=b;c[a+112+8>>2]=d;c[a+112+12>>2]=h;g[a+112+16>>2]=e+f;g[a+112+20>>2]=e;le(c[b+928>>2]|0,a+32|0,a+112|0);sa=a;return}case 2:{g[a+4>>2]=1.0;c[a+8+4>>2]=0;c[a+8+4+4>>2]=0;c[a+8+4+8>>2]=0;c[a>>2]=6160;c[a+24>>2]=b;c[a+28>>2]=d;c[a+8>>2]=c[b+456>>2];i=c[d+4>>2]|0;j=+va[c[(c[i>>2]|0)+48>>2]&15](i);i=c[b+192>>2]|0;j=j+ +va[c[(c[i>>2]|0)+48>>2]&15](i);g[a+12>>2]=j;f=+g[(c[d+8>>2]|0)+224>>2];g[a+112>>2]=f;c[a+16>>2]=c[(+g[b+316>>2]>2];i=c[d+4>>2]|0;ab[c[(c[i>>2]|0)+8>>2]&127](i,c[d+12>>2]|0,a+112|0,a+96|0);c[a+32>>2]=c[a+112>>2];c[a+32+4>>2]=c[a+112+4>>2];c[a+32+8>>2]=c[a+112+8>>2];c[a+32+12>>2]=c[a+112+12>>2];c[a+32+16>>2]=c[a+96>>2];c[a+32+16+4>>2]=c[a+96+4>>2];c[a+32+16+8>>2]=c[a+96+8>>2];c[a+32+16+12>>2]=c[a+96+12>>2];c[a+64>>2]=c[a+32>>2];c[a+64+4>>2]=c[a+32+4>>2];c[a+64+8>>2]=c[a+32+8>>2];c[a+64+12>>2]=c[a+32+12>>2];c[a+64+16>>2]=c[a+32+16>>2];c[a+64+20>>2]=c[a+32+20>>2];c[a+64+24>>2]=c[a+32+24>>2];c[a+64+28>>2]=c[a+32+28>>2];g[a+64>>2]=+g[a+64>>2]-j;g[a+64+4>>2]=+g[a+64+4>>2]-j;g[a+64+8>>2]=+g[a+64+8>>2]-j;g[a+64+16>>2]=j+ +g[a+64+16>>2];g[a+64+20>>2]=j+ +g[a+64+20>>2];g[a+64+24>>2]=j+ +g[a+64+24>>2];le(c[b+1048>>2]|0,a+64|0,a);sa=a;return}default:{sa=a;return}}}function Vd(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;c[e+16>>2]=c[a+20>>2];c[e+20>>2]=c[a+24>>2];c[e+24>>2]=c[a+28>>2];c[e+28>>2]=c[a+32>>2];c[e>>2]=c[a+4>>2];c[e+4>>2]=c[a+8>>2];c[e+8>>2]=c[a+12>>2];c[e+12>>2]=c[a+16>>2];c[e+32>>2]=c[a+36>>2];c[e+36>>2]=c[a+40>>2];c[e+40>>2]=c[a+44>>2];c[e+44>>2]=c[a+48>>2];c[e+48>>2]=c[a+56>>2];c[e+52>>2]=d[a+60>>0];k=c[a+88>>2]|0;c[e+56>>2]=k;if(k){k=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[a+96>>2]|0)|0;c[e+64>>2]=k;if(k|0){j=c[a+88>>2]|0;k=Ja[c[(c[f>>2]|0)+16>>2]&63](f,48,j)|0;if((j|0)>0){g=c[a+96>>2]|0;h=c[k+8>>2]|0;i=0;while(1){c[h+16>>2]=c[g+(i<<6)+16>>2];c[h+20>>2]=c[g+(i<<6)+20>>2];c[h+24>>2]=c[g+(i<<6)+24>>2];c[h+28>>2]=c[g+(i<<6)+28>>2];c[h>>2]=c[g+(i<<6)>>2];c[h+4>>2]=c[g+(i<<6)+4>>2];c[h+8>>2]=c[g+(i<<6)+8>>2];c[h+12>>2]=c[g+(i<<6)+12>>2];c[h+32>>2]=c[g+(i<<6)+32>>2];c[h+36>>2]=c[g+(i<<6)+36>>2];c[h+40>>2]=c[g+(i<<6)+40>>2];i=i+1|0;if((i|0)==(j|0))break;else h=h+48|0}}else g=c[a+96>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,k,22787,1497453121,g)}}else c[e+64>>2]=0;k=c[a+128>>2]|0;c[e+60>>2]=k;if(k){k=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[a+136>>2]|0)|0;c[e+68>>2]=k;if(k|0){j=c[a+128>>2]|0;k=Ja[c[(c[f>>2]|0)+16>>2]&63](f,16,j)|0;if((j|0)>0){g=c[a+136>>2]|0;h=c[k+8>>2]|0;i=0;while(1){c[h+12>>2]=c[g+(i<<4)+12>>2];b[h+6>>1]=b[g+(i<<4)+6>>1]|0;b[h+8>>1]=b[g+(i<<4)+8>>1]|0;b[h+10>>1]=b[g+(i<<4)+10>>1]|0;b[h>>1]=b[g+(i<<4)>>1]|0;b[h+2>>1]=b[g+(i<<4)+2>>1]|0;b[h+4>>1]=b[g+(i<<4)+4>>1]|0;i=i+1|0;if((i|0)==(j|0))break;else h=h+16|0}}else g=c[a+136>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,k,22810,1497453121,g)}}else c[e+68>>2]=0;c[e+76>>2]=c[a+144>>2];k=c[a+152>>2]|0;c[e+80>>2]=k;if(!k){c[e+72>>2]=0;return 22854}k=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[a+160>>2]|0)|0;c[e+72>>2]=k;if(!k)return 22854;j=c[a+152>>2]|0;k=Ja[c[(c[f>>2]|0)+16>>2]&63](f,20,j)|0;if((j|0)>0){g=c[a+160>>2]|0;h=c[k+8>>2]|0;i=0;while(1){b[h+14>>1]=b[g+(i<<5)+6>>1]|0;b[h+16>>1]=b[g+(i<<5)+8>>1]|0;b[h+18>>1]=b[g+(i<<5)+10>>1]|0;b[h+8>>1]=b[g+(i<<5)>>1]|0;b[h+10>>1]=b[g+(i<<5)+2>>1]|0;b[h+12>>1]=b[g+(i<<5)+4>>1]|0;c[h>>2]=c[g+(i<<5)+12>>2];c[h+4>>2]=c[g+(i<<5)+16>>2];i=i+1|0;if((i|0)==(j|0))break;else h=h+20|0}}else g=c[a+160>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,k,22833,1497453121,g);return 22854}function Wd(a,d,f,h,i){a=a|0;d=d|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;c[d+16>>2]=c[f>>2];c[d+16+4>>2]=c[f+4>>2];c[d+16+8>>2]=c[f+8>>2];c[d+16+12>>2]=c[f+12>>2];c[d+32>>2]=c[h>>2];c[d+32+4>>2]=c[h+4>>2];c[d+32+8>>2]=c[h+8>>2];c[d+32+12>>2]=c[h+12>>2];B=c[a+60>>2]|0;C=c[d+12>>2]&65535;r=+g[a+8>>2];t=+g[a+12>>2];v=+g[a+16>>2];s=+g[a+40>>2];n=(+g[f>>2]-r)*s;u=+g[a+44>>2];o=(+g[f+4>>2]-t)*u;w=+g[a+48>>2];p=(+g[f+8>>2]-v)*w;if(!(n<=0.0)){z=b[a+6>>1]|0;z=b[a+4>>1]&(!(n>=+(z&65535))?~~n&65535:z)}else z=0;if(!(o<=0.0)){A=b[a+6>>1]|0;A=b[a+4>>1]&(!(o>=+(A&65535))?~~o&65535:A)}else A=0;if(!(p<=0.0)){D=b[a+6>>1]|0;D=b[a+4>>1]&(!(p>=+(D&65535))?~~p&65535:D)}else D=0;p=(+g[h>>2]-r)*s;o=(+g[h+4>>2]-t)*u;n=(+g[h+8>>2]-v)*w;if(!(p<=0.0)){q=b[a+6>>1]|0;q=b[a+4>>1]&(!(p>=+(q&65535))?~~p&65535:q)|1}else q=1;if(!(o<=0.0)){x=b[a+6>>1]|0;x=b[a+4>>1]&(!(o>=+(x&65535))?~~o&65535:x)|1}else x=1;if(!(n<=0.0)){y=b[a+6>>1]|0;y=b[a+4>>1]&(!(n>=+(y&65535))?~~n&65535:y)|1}else y=1;j=b[B+(C<<6)+48>>1]|0;k=b[B+(C<<6)+54>>1]|0;E=c[a+68>>2]|0;l=(z&65535)-(e[E+((j&65535)<<2)>>1]|0)|0;m=(q&65535)-(e[E+((k&65535)<<2)>>1]|0)|0;b[E+((j&65535)<<2)>>1]=z;b[E+((k&65535)<<2)>>1]=q;if((l|0)<0)Ng(a,0,j);if((m|0)>0)Jg(a,0,k);if((l|0)>0)Kg(a,0,j,i);if((m|0)<0)Hg(a,0,k,i);j=b[B+(C<<6)+50>>1]|0;k=b[B+(C<<6)+56>>1]|0;E=c[a+72>>2]|0;l=(A&65535)-(e[E+((j&65535)<<2)>>1]|0)|0;m=(x&65535)-(e[E+((k&65535)<<2)>>1]|0)|0;b[E+((j&65535)<<2)>>1]=A;b[E+((k&65535)<<2)>>1]=x;if((l|0)<0)Ng(a,1,j);if((m|0)>0)Jg(a,1,k);if((l|0)>0)Kg(a,1,j,i);if((m|0)<0)Hg(a,1,k,i);m=b[B+(C<<6)+52>>1]|0;j=b[B+(C<<6)+58>>1]|0;E=c[a+76>>2]|0;k=(D&65535)-(e[E+((m&65535)<<2)>>1]|0)|0;l=(y&65535)-(e[E+((j&65535)<<2)>>1]|0)|0;b[E+((m&65535)<<2)>>1]=D;b[E+((j&65535)<<2)>>1]=y;if((k|0)<0)Ng(a,2,m);if((l|0)>0)Jg(a,2,j);if((k|0)>0)Kg(a,2,m,i);if((l|0)<0)Hg(a,2,j,i);j=c[a+108>>2]|0;if(!j)return;eb[c[(c[j>>2]|0)+16>>2]&31](j,c[d+60>>2]|0,f,h,i);return}function Xd(a,b,d,e,f,h,i,j){a=a|0;b=b|0;d=d|0;e=+e;f=+f;h=+h;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,w=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0;U=sa;sa=sa+32|0;A=+g[d>>2];C=+g[d+4>>2];B=+g[d+8>>2];v=+g[i>>2];s=+g[i+4>>2];q=+g[i+8>>2];p=+g[j>>2];r=+g[j+4>>2];u=+g[j+8>>2];K=1.0/+x(+((e-A)*(e-A)+(f-C)*(f-C)+(h-B)*(h-B)));L=(e-A)*K==0.0?999999984306749440.0:1.0/((e-A)*K);M=(f-C)*K==0.0?999999984306749440.0:1.0/((f-C)*K);N=(h-B)*K==0.0?999999984306749440.0:1.0/((h-B)*K);O=(A>e?e:A)+v;P=(C>f?f:C)+s;Q=(B>h?h:B)+q;R=(A>2]|0;a:do if((l|0)>0){n=c[a+96>>2]|0;k=0;y=0;w=l;while(1){k=k+1|0;c[U>>2]=c[n>>2];c[U+4>>2]=c[n+4>>2];c[U+8>>2]=c[n+8>>2];c[U+12>>2]=c[n+12>>2];t=n+16|0;c[U+16>>2]=c[t>>2];c[U+16+4>>2]=c[t+4>>2];c[U+16+8>>2]=c[t+8>>2];c[U+16+12>>2]=c[t+12>>2];g[U>>2]=+g[U>>2]-p;g[U+4>>2]=+g[U+4>>2]-r;g[U+8>>2]=+g[U+8>>2]-u;g[U+16>>2]=+g[U+16>>2]-v;g[U+20>>2]=+g[U+20>>2]-s;g[U+24>>2]=+g[U+24>>2]-q;if(!(O>+g[t>>2])?!(R<+g[n>>2]):0)l=1;else l=0;if(!(!(Q>+g[n+24>>2])?!(T<+g[n+8>>2]):0))l=0;if(((!(P>+g[n+20>>2])?!(S<+g[n+4>>2]|l^1):0)?(E=+g[d>>2],D=L*(+g[U+((L<0.0&1)<<4)>>2]-E),E=L*(+g[U+(((L<0.0^1)&1)<<4)>>2]-E),G=+g[d+4>>2],F=M*(+g[U+((M<0.0&1)<<4)+4>>2]-G),G=M*(+g[U+(((M<0.0^1)&1)<<4)+4>>2]-G),!(F>E|D>G)):0)?(H=F>D?F:D,z=G>2],I=N*(+g[U+((N<0.0&1)<<4)+8>>2]-J),J=N*(+g[U+(((N<0.0^1)&1)<<4)+8>>2]-J),!(I>z|H>J)):0){l=(J0.0?(I>H?I:H)<(h-B)*(h-B)*K+((e-A)*(e-A)*K+(f-C)*(f-C)*K):0;m=c[n+32>>2]|0;if(l&(m|0)==-1){Za[c[(c[b>>2]|0)+8>>2]&127](b,c[n+36>>2]|0,c[n+40>>2]|0);l=c[a+56>>2]|0;t=17}else{o=(m|0)==-1;t=16}}else{m=c[n+32>>2]|0;l=0;o=(m|0)==-1;t=16}if((t|0)==16){t=0;if(o|l){l=w;t=17}else{n=n+(m<<6)|0;m=m+y|0;l=w}}if((t|0)==17){n=n+64|0;m=y+1|0}if((m|0)>=(l|0))break a;y=m;w=l;p=+g[j>>2];r=+g[j+4>>2];u=+g[j+8>>2];v=+g[i>>2];s=+g[i+4>>2];q=+g[i+8>>2]}}else k=0;while(0);if((c[7162]|0)>=(k|0)){sa=U;return}c[7162]=k;sa=U;return}function Yd(a){a=a|0;var b=0,d=0,e=0,f=0,h=0,i=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=sa;sa=sa+144|0;g[a+36>>2]=0.0;c[d+128>>2]=0;c[d+128+4>>2]=0;c[d+128+8>>2]=0;c[d+128+12>>2]=0;b=0;do{e=d+128+(b<<2)|0;g[e>>2]=1.0;h=c[a+28>>2]|0;H=c[h+4>>2]|0;c[d+80>>2]=H;E=c[h+20>>2]|0;c[d+80+4>>2]=E;B=c[h+36>>2]|0;c[d+80+8>>2]=B;g[d+80+12>>2]=0.0;G=c[h+8>>2]|0;c[d+80+16>>2]=G;D=c[h+24>>2]|0;c[d+80+20>>2]=D;A=c[h+40>>2]|0;c[d+80+24>>2]=A;g[d+80+28>>2]=0.0;F=c[h+12>>2]|0;c[d+80+32>>2]=F;C=c[h+28>>2]|0;c[d+80+36>>2]=C;z=c[h+44>>2]|0;c[d+80+40>>2]=z;g[d+80+44>>2]=0.0;f=c[a+32>>2]|0;y=c[f+4>>2]|0;c[d+32>>2]=y;v=c[f+20>>2]|0;c[d+32+4>>2]=v;s=c[f+36>>2]|0;c[d+32+8>>2]=s;g[d+32+12>>2]=0.0;x=c[f+8>>2]|0;c[d+32+16>>2]=x;u=c[f+24>>2]|0;c[d+32+20>>2]=u;r=c[f+40>>2]|0;c[d+32+24>>2]=r;g[d+32+28>>2]=0.0;w=c[f+12>>2]|0;c[d+32+32>>2]=w;t=c[f+28>>2]|0;c[d+32+36>>2]=t;o=c[f+44>>2]|0;c[d+32+40>>2]=o;g[d+32+44>>2]=0.0;p=+g[a+300>>2];l=p*(c[j>>2]=H,+g[j>>2]);i=+g[a+304>>2];l=l+i*(c[j>>2]=G,+g[j>>2]);k=+g[a+308>>2];l=l+k*(c[j>>2]=F,+g[j>>2]);q=p*(c[j>>2]=E,+g[j>>2]);q=q+i*(c[j>>2]=D,+g[j>>2]);q=q+k*(c[j>>2]=C,+g[j>>2]);p=p*(c[j>>2]=B,+g[j>>2]);i=p+i*(c[j>>2]=A,+g[j>>2]);p=+g[h+52>>2];n=+g[h+56>>2];m=+g[h+60>>2];m=i+k*(c[j>>2]=z,+g[j>>2])+m-m;g[d+16>>2]=l+p-p;g[d+16+4>>2]=q+n-n;g[d+16+8>>2]=m;g[d+16+12>>2]=0.0;m=+g[a+316>>2];n=m*(c[j>>2]=y,+g[j>>2]);q=+g[a+320>>2];n=n+q*(c[j>>2]=x,+g[j>>2]);p=+g[a+324>>2];n=n+p*(c[j>>2]=w,+g[j>>2]);l=m*(c[j>>2]=v,+g[j>>2]);l=l+q*(c[j>>2]=u,+g[j>>2]);l=l+p*(c[j>>2]=t,+g[j>>2]);m=m*(c[j>>2]=s,+g[j>>2]);q=m+q*(c[j>>2]=r,+g[j>>2]);m=+g[f+52>>2];k=+g[f+56>>2];i=+g[f+60>>2];i=q+p*(c[j>>2]=o,+g[j>>2])+i-i;g[d>>2]=n+m-m;g[d+4>>2]=l+k-k;g[d+8>>2]=i;g[d+12>>2]=0.0;fg(a+48+(b*84|0)|0,d+80|0,d+32|0,d+16|0,d,d+128|0,h+396|0,+g[h+344>>2],f+396|0,+g[f+344>>2]);g[e>>2]=0.0;b=b+1|0}while((b|0)!=3);sa=d;return}function Zd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0;D=+g[a+452>>2];v=+g[a+304>>2];s=+g[a+300>>2];if(v>0.0|s>0.0)h=(c[a+288>>2]|0)<4;else h=0;E=c[a+720>>2]|0;z=+g[E+(d*104|0)+88>>2];if(!(z>0.0))return;o=c[c[a+684>>2]>>2]|0;if(!h)return;A=+g[E+(d*104|0)+40>>2];m=A-+g[b>>2];B=+g[E+(d*104|0)+44>>2];n=B-+g[b+4>>2];C=+g[E+(d*104|0)+48>>2];k=C-+g[b+8>>2];l=+x(+(m*m+n*n+k*k));if(!(m*m+n*n+k*k>1.1920928955078125e-07))return;u=m*(1.0/l);w=n*(1.0/l);y=k*(1.0/l);q=+g[E+(d*104|0)+72>>2];r=+g[E+(d*104|0)+76>>2];t=+g[E+(d*104|0)+80>>2];switch(c[a+288>>2]|0){case 2:{p=m*q+n*r+k*t<0.0?-1.0:1.0;f=y*t*p+(u*q*p+w*r*p);i=+g[E+(d*104|0)+92>>2]*.5;e=(c[j>>2]=o,+g[j>>2]);n=f*s*.5*e*(m*m+n*n+k*k)*i;if(f>0.0&f<.9847999811172485){k=+x(+(1.0-f*f))*v*.5*e*l*i;l=(y*(u*t*p-y*q*p)-w*(w*q*p-u*r*p))*k;m=(u*(w*q*p-u*r*p)-y*(y*r*p-w*t*p))*k;k=(w*(y*r*p-w*t*p)-u*(u*t*p-y*q*p))*k}else{l=0.0;m=0.0;k=0.0}e=D*z*-(y*n)*D*z*-(y*n)+(D*z*-(u*n)*D*z*-(u*n)+D*z*-(w*n)*D*z*-(w*n));if(e>0.0?e>=A*A+B*B+C*C:0){e=+x(+(A*A+B*B+C*C))/+x(+e)*.800000011920929;i=e*-(u*n);f=e*-(y*n);e=e*-(w*n)}else{i=-(u*n);f=-(y*n);e=-(w*n)}C=e+ +g[E+(d*104|0)+60>>2];D=f+ +g[E+(d*104|0)+64>>2];g[E+(d*104|0)+56>>2]=l+(i+ +g[E+(d*104|0)+56>>2]);g[E+(d*104|0)+60>>2]=m+C;g[E+(d*104|0)+64>>2]=k+D;return}case 1:case 3:case 0:{e=m*q+n*r+k*t<0.0?-1.0:1.0;if(!(k*t*e+(m*q*e+n*r*e)>0.0))return;p=-((m*m+n*n+k*k)*(k*t*e+(m*q*e+n*r*e))*+g[E+(d*104|0)+92>>2]*.5*(c[j>>2]=o,+g[j>>2]));i=u*s*p+(q*e*v*p+0.0);f=w*s*p+(r*e*v*p+0.0);e=y*s*p+(t*e*v*p+0.0);if(D*z*e*D*z*e+(D*z*i*D*z*i+D*z*f*D*z*f)>A*A+B*B+C*C){y=1.0/+x(+(e*e+(i*i+f*f)));g[E+(d*104|0)+56>>2]=+g[E+(d*104|0)+56>>2]-1.0/(D*z)*i*y*(C*e*y+(A*i*y+B*f*y));g[E+(d*104|0)+60>>2]=+g[E+(d*104|0)+60>>2]-1.0/(D*z)*f*y*(C*e*y+(A*i*y+B*f*y));g[E+(d*104|0)+64>>2]=+g[E+(d*104|0)+64>>2]-1.0/(D*z)*e*y*(C*e*y+(A*i*y+B*f*y));return}else{g[E+(d*104|0)+56>>2]=i+ +g[E+(d*104|0)+56>>2];g[E+(d*104|0)+60>>2]=f+ +g[E+(d*104|0)+60>>2];g[E+(d*104|0)+64>>2]=e+ +g[E+(d*104|0)+64>>2];return}}default:return}}function _d(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,w=0.0,y=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0,H=0.0;a:while(1){F=c[e+12>>2]|0;if((b|0)>0){k=+g[d>>2];i=+g[d+4>>2];j=+g[d+8>>2];f=-1;h=0;do{do if(c[F+(h<<2)>>2]|0){if((f|0)!=-1?!(k*+g[a+(h<<4)>>2]+i*+g[a+(h<<4)+4>>2]+j*+g[a+(h<<4)+8>>2]>k*+g[a+(f<<4)>>2]+i*+g[a+(f<<4)+4>>2]+j*+g[a+(f<<4)+8>>2]):0)break;f=h}while(0);h=h+1|0}while((h|0)!=(b|0))}else f=-1;E=F+(f<<2)|0;if((c[E>>2]|0)==3){G=40;break}B=+g[d+4>>2];C=+g[d+8>>2];D=+g[d>>2];i=+x(+((B-C*0.0)*(B-C*0.0)+(C*0.0-D)*(C*0.0-D)+(D*0.0-B*0.0)*(D*0.0-B*0.0)));j=+x(+((D-B*0.0)*(D-B*0.0)+((B*0.0-C)*(B*0.0-C)+(C*0.0-D*0.0)*(C*0.0-D*0.0))));if(i>j){w=(B-C*0.0)*(1.0/i);y=(D*0.0-B*0.0)*(1.0/i);q=(C*0.0-D)*(1.0/i)}else{w=(B*0.0-C)*(1.0/j);y=(D-B*0.0)*(1.0/j);q=(C*0.0-D*0.0)*(1.0/j)}r=C*q-B*y;s=D*y-C*w;t=B*w-D*q;u=(f|0)==-1;p=0;h=-1;while(1){v=+(p|0);o=+A(+(v*.01745329238474369));k=+z(+(v*.01745329238474369));i=D+(w*o+r*k)*.02500000037252903;j=B+(q*o+s*k)*.02500000037252903;k=C+(y*o+t*k)*.02500000037252903;if((b|0)>0){l=-1;m=0;do{do if(c[F+(m<<2)>>2]|0){if((l|0)!=-1?!(i*+g[a+(m<<4)>>2]+j*+g[a+(m<<4)+4>>2]+k*+g[a+(m<<4)+8>>2]>i*+g[a+(l<<4)>>2]+j*+g[a+(l<<4)+4>>2]+k*+g[a+(l<<4)+8>>2]):0)break;l=m}while(0);m=m+1|0}while((m|0)!=(b|0))}else l=-1;if((h|0)==(f|0)&(l|0)==(f|0))break a;b:do if(!((h|0)==-1|(h|0)==(l|0))?v+-40.0<=v:0){if((b|0)<=0){i=v+-40.0;while(1){if((h|0)==(f|0)&u){f=-1;break a}i=i+5.0;if(!(i<=v))break b;else h=-1}}o=v+-40.0;while(1){k=o*.01745329238474369;H=+A(+k);k=+z(+k);i=D+(w*H+r*k)*.02500000037252903;j=B+(q*H+s*k)*.02500000037252903;k=C+(y*H+t*k)*.02500000037252903;m=-1;n=0;do{do if(c[F+(n<<2)>>2]|0){if((m|0)!=-1?!(i*+g[a+(n<<4)>>2]+j*+g[a+(n<<4)+4>>2]+k*+g[a+(n<<4)+8>>2]>i*+g[a+(m<<4)>>2]+j*+g[a+(m<<4)+4>>2]+k*+g[a+(m<<4)+8>>2]):0)break;m=n}while(0);n=n+1|0}while((n|0)!=(b|0));if((h|0)==(f|0)&(m|0)==(f|0))break a;o=o+5.0;if(!(o<=v))break;else h=m}}while(0);p=p+45|0;if(p>>>0>360)break;else h=l}c[E>>2]=0}if((G|0)==40)return f|0;c[E>>2]=3;G=f;return G|0}function $d(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0;if(!(c[a+204>>2]&2)){c[a+68>>2]=c[b>>2];c[a+68+4>>2]=c[b+4>>2];c[a+68+8>>2]=c[b+8>>2];c[a+68+12>>2]=c[b+12>>2];c[a+84>>2]=c[b+16>>2];c[a+84+4>>2]=c[b+16+4>>2];c[a+84+8>>2]=c[b+16+8>>2];c[a+84+12>>2]=c[b+16+12>>2];c[a+100>>2]=c[b+32>>2];c[a+100+4>>2]=c[b+32+4>>2];c[a+100+8>>2]=c[b+32+8>>2];c[a+100+12>>2]=c[b+32+12>>2];c[a+116>>2]=c[b+48>>2];c[a+116+4>>2]=c[b+48+4>>2];c[a+116+8>>2]=c[b+48+8>>2];c[a+116+12>>2]=c[b+48+12>>2];d=a+20|0;e=b+16|0;f=a+36|0;h=b+32|0;i=a+52|0;j=b+48|0;k=a+4|0}else{c[a+68>>2]=c[a+4>>2];c[a+68+4>>2]=c[a+4+4>>2];c[a+68+8>>2]=c[a+4+8>>2];c[a+68+12>>2]=c[a+4+12>>2];c[a+84>>2]=c[a+20>>2];c[a+84+4>>2]=c[a+20+4>>2];c[a+84+8>>2]=c[a+20+8>>2];c[a+84+12>>2]=c[a+20+12>>2];c[a+100>>2]=c[a+36>>2];c[a+100+4>>2]=c[a+36+4>>2];c[a+100+8>>2]=c[a+36+8>>2];c[a+100+12>>2]=c[a+36+12>>2];c[a+116>>2]=c[a+52>>2];c[a+116+4>>2]=c[a+52+4>>2];c[a+116+8>>2]=c[a+52+8>>2];c[a+116+12>>2]=c[a+52+12>>2];d=a+20|0;e=b+16|0;f=a+36|0;h=b+32|0;i=a+52|0;j=b+48|0;k=a+4|0}c[a+132>>2]=c[a+312>>2];c[a+132+4>>2]=c[a+312+4>>2];c[a+132+8>>2]=c[a+312+8>>2];c[a+132+12>>2]=c[a+312+12>>2];c[a+148>>2]=c[a+328>>2];c[a+148+4>>2]=c[a+328+4>>2];c[a+148+8>>2]=c[a+328+8>>2];c[a+148+12>>2]=c[a+328+12>>2];c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];c[f>>2]=c[h>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];c[f+12>>2]=c[h+12>>2];c[i>>2]=c[j>>2];c[i+4>>2]=c[j+4>>2];c[i+8>>2]=c[j+8>>2];c[i+12>>2]=c[j+12>>2];w=+g[a+4>>2];q=+g[a+396>>2];v=+g[a+8>>2];o=+g[a+400>>2];u=+g[a+12>>2];m=+g[a+404>>2];t=+g[a+20>>2];s=+g[a+24>>2];r=+g[a+28>>2];p=+g[a+36>>2];n=+g[a+40>>2];l=+g[a+44>>2];g[a+264>>2]=w*w*q+v*v*o+u*u*m;g[a+268>>2]=w*q*t+v*o*s+u*m*r;g[a+272>>2]=w*q*p+v*o*n+u*m*l;g[a+276>>2]=0.0;g[a+280>>2]=w*q*t+v*o*s+u*m*r;g[a+284>>2]=t*q*t+s*o*s+r*m*r;g[a+288>>2]=q*t*p+o*s*n+m*r*l;g[a+292>>2]=0.0;g[a+296>>2]=w*q*p+v*o*n+u*m*l;g[a+300>>2]=t*q*p+s*o*n+r*m*l;g[a+304>>2]=p*q*p+n*o*n+l*m*l;g[a+308>>2]=0.0;return}function ae(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0;h=sa;sa=sa+160|0;e=c[a+4>>2]|0;f=c[e+12>>2]|0;C=+g[f>>2];B=+g[f+4>>2];A=+g[f+8>>2];z=+g[f+16>>2];y=+g[f+20>>2];x=+g[f+24>>2];q=+g[f+32>>2];o=+g[f+36>>2];m=+g[f+40>>2];e=c[(c[e+4>>2]|0)+24>>2]|0;w=+g[e+(d*80|0)>>2];v=+g[e+(d*80|0)+16>>2];u=+g[e+(d*80|0)+32>>2];t=+g[e+(d*80|0)+4>>2];s=+g[e+(d*80|0)+20>>2];r=+g[e+(d*80|0)+36>>2];p=+g[e+(d*80|0)+8>>2];n=+g[e+(d*80|0)+24>>2];l=+g[e+(d*80|0)+40>>2];E=+g[e+(d*80|0)+48>>2];D=+g[e+(d*80|0)+52>>2];i=+g[e+(d*80|0)+56>>2];k=+g[f+48>>2]+(C*E+B*D+A*i);j=+g[f+52>>2]+(z*E+y*D+x*i);i=+g[f+56>>2]+(q*E+o*D+m*i);g[h+88>>2]=C*w+B*v+A*u;g[h+88+4>>2]=C*t+B*s+A*r;g[h+88+8>>2]=C*p+B*n+A*l;g[h+88+12>>2]=0.0;g[h+88+16>>2]=z*w+y*v+x*u;g[h+88+20>>2]=z*t+y*s+x*r;g[h+88+24>>2]=z*p+y*n+x*l;g[h+88+28>>2]=0.0;g[h+88+32>>2]=q*w+o*v+m*u;g[h+88+36>>2]=q*t+o*s+m*r;g[h+88+40>>2]=q*p+o*n+m*l;g[h+88+44>>2]=0.0;g[h+88+48>>2]=k;g[h+88+52>>2]=j;g[h+88+56>>2]=i;g[h+88+60>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,h+88|0,h+72|0,h+56|0);f=c[a+8>>2]|0;e=c[f+4>>2]|0;ab[c[(c[e>>2]|0)+8>>2]&127](e,c[f+12>>2]|0,h+40|0,h+24|0);if(!(+g[h+72>>2]>+g[h+24>>2])?!(+g[h+56>>2]<+g[h+40>>2]):0)e=1;else e=0;if(!(!(+g[h+72+8>>2]>+g[h+24+8>>2])?!(+g[h+56+8>>2]<+g[h+40+8>>2]):0))e=0;if(+g[h+72+4>>2]>+g[h+24+4>>2]){sa=h;return}if(+g[h+56+4>>2]<+g[h+40+4>>2]|e^1){sa=h;return}e=c[a+4>>2]|0;f=c[e+8>>2]|0;c[h>>2]=e;c[h+4>>2]=b;c[h+8>>2]=f;c[h+12>>2]=h+88;c[h+16>>2]=-1;c[h+20>>2]=d;if(!(c[(c[a+24>>2]|0)+(d<<2)>>2]|0)){b=c[a+12>>2]|0;b=Ka[c[(c[b>>2]|0)+8>>2]&31](b,h,c[a+8>>2]|0,c[a+28>>2]|0)|0;c[(c[a+24>>2]|0)+(d<<2)>>2]=b;b=(c[a+4>>2]|0)+8|0}else b=e+8|0;f=c[a+20>>2]|0;e=c[f+8>>2]|0;if((c[e+8>>2]|0)==(c[b>>2]|0)){c[f+8>>2]=h;Za[c[(c[f>>2]|0)+8>>2]&127](f,-1,d)}else{e=c[f+12>>2]|0;c[f+12>>2]=h;Za[c[(c[f>>2]|0)+12>>2]&127](f,-1,d)}d=c[(c[a+24>>2]|0)+(d<<2)>>2]|0;eb[c[(c[d>>2]|0)+8>>2]&31](d,h,c[a+8>>2]|0,c[a+16>>2]|0,c[a+20>>2]|0);d=c[a+20>>2]|0;c[((c[(c[d+8>>2]|0)+8>>2]|0)==(c[(c[a+4>>2]|0)+8>>2]|0)?d+8|0:d+12|0)>>2]=e;sa=h;return}function be(){if(a[26744]|0)return;if(!(mz(26744)|0))return;c[6388]=0;c[6389]=-2147483648;c[6390]=-1082130432;g[6391]=0.0;c[6392]=1060716128;c[6393]=-1090087446;c[6394]=-1092290076;g[6395]=0.0;c[6396]=-1098022214;c[6397]=-1084636126;c[6398]=-1092290076;g[6399]=0.0;c[6400]=-1083901670;c[6401]=-2147483648;c[6402]=-1092290177;g[6403]=0.0;c[6404]=-1098022214;c[6405]=1062847522;c[6406]=-1092290043;g[6407]=0.0;c[6408]=1060716128;c[6409]=1057396202;c[6410]=-1092290076;g[6411]=0.0;c[6412]=1049461434;c[6413]=-1084636126;c[6414]=1055193605;g[6415]=0.0;c[6416]=-1086767520;c[6417]=-1090087446;c[6418]=1055193572;g[6419]=0.0;c[6420]=-1086767520;c[6421]=1057396202;c[6422]=1055193572;g[6423]=0.0;c[6424]=1049461434;c[6425]=1062847522;c[6426]=1055193572;g[6427]=0.0;c[6428]=1063581978;c[6429]=0;c[6430]=1055193471;g[6431]=0.0;c[6432]=-2147483648;c[6433]=0;c[6434]=1065353216;g[6435]=0.0;c[6436]=1054458864;c[6437]=-1096927567;c[6438]=-1084636042;g[6439]=0.0;c[6440]=-1104782626;c[6441]=-1090519208;c[6442]=-1084636042;g[6443]=0.0;c[6444]=1049007812;c[6445]=-1085334679;c[6446]=-1090087228;g[6447]=0.0;c[6448]=1054458864;c[6449]=1050556081;c[6450]=-1084636042;g[6451]=0.0;c[6452]=1062847505;c[6453]=-2147483648;c[6454]=-1090087262;g[6455]=0.0;c[6456]=-1090087362;c[6457]=-2147483648;c[6458]=-1084636076;g[6459]=0.0;c[6460]=-1087361736;c[6461]=-1090519141;c[6462]=-1090087262;g[6463]=0.0;c[6464]=-1104782626;c[6465]=1056964440;c[6466]=-1084636042;g[6467]=0.0;c[6468]=-1087361736;c[6469]=1056964507;c[6470]=-1090087262;g[6471]=0.0;c[6472]=1049007812;c[6473]=1062148969;c[6474]=-1090087228;g[6475]=0.0;c[6476]=1064532105;c[6477]=1050556148;c[6478]=0;g[6479]=0.0;c[6480]=1064532105;c[6481]=-1096927500;c[6482]=0;g[6483]=0.0;c[6484]=1058437413;c[6485]=-1085334595;c[6486]=0;g[6487]=0.0;c[6488]=0;c[6489]=-1082130432;c[6490]=0;g[6491]=0.0;c[6492]=-1089046235;c[6493]=-1085334595;c[6494]=0;g[6495]=0.0;c[6496]=-1082951543;c[6497]=-1096927500;c[6498]=-2147483648;g[6499]=0.0;c[6500]=-1082951543;c[6501]=1050556148;c[6502]=-2147483648;g[6503]=0.0;c[6504]=-1089046235;c[6505]=1062149053;c[6506]=-2147483648;g[6507]=0.0;c[6508]=-2147483648;c[6509]=1065353216;c[6510]=-2147483648;g[6511]=0.0;c[6512]=1058437413;c[6513]=1062149053;c[6514]=-2147483648;g[6515]=0.0;c[6516]=1060121912;c[6517]=-1090519141;c[6518]=1057396386;g[6519]=0.0;c[6520]=-1098475836;c[6521]=-1085334679;c[6522]=1057396420;g[6523]=0.0;c[6524]=-1084636143;c[6525]=0;c[6526]=1057396386;g[6527]=0.0;c[6528]=-1098475836;c[6529]=1062148969;c[6530]=1057396420;g[6531]=0.0;c[6532]=1060121912;c[6533]=1056964507;c[6534]=1057396386;g[6535]=0.0;c[6536]=1057396286;c[6537]=0;c[6538]=1062847572;g[6539]=0.0;c[6540]=1042701022;c[6541]=-1090519208;c[6542]=1062847606;g[6543]=0.0;c[6544]=-1093024784;c[6545]=-1096927567;c[6546]=1062847606;g[6547]=0.0;c[6548]=-1093024784;c[6549]=1050556081;c[6550]=1062847606;g[6551]=0.0;c[6552]=1042701022;c[6553]=1056964440;c[6554]=1062847606;g[6555]=0.0;return}function ce(){if(a[26728]|0)return;if(!(mz(26728)|0))return;c[6116]=0;c[6117]=-2147483648;c[6118]=-1082130432;g[6119]=0.0;c[6120]=1060716128;c[6121]=-1090087446;c[6122]=-1092290076;g[6123]=0.0;c[6124]=-1098022214;c[6125]=-1084636126;c[6126]=-1092290076;g[6127]=0.0;c[6128]=-1083901670;c[6129]=-2147483648;c[6130]=-1092290177;g[6131]=0.0;c[6132]=-1098022214;c[6133]=1062847522;c[6134]=-1092290043;g[6135]=0.0;c[6136]=1060716128;c[6137]=1057396202;c[6138]=-1092290076;g[6139]=0.0;c[6140]=1049461434;c[6141]=-1084636126;c[6142]=1055193605;g[6143]=0.0;c[6144]=-1086767520;c[6145]=-1090087446;c[6146]=1055193572;g[6147]=0.0;c[6148]=-1086767520;c[6149]=1057396202;c[6150]=1055193572;g[6151]=0.0;c[6152]=1049461434;c[6153]=1062847522;c[6154]=1055193572;g[6155]=0.0;c[6156]=1063581978;c[6157]=0;c[6158]=1055193471;g[6159]=0.0;c[6160]=-2147483648;c[6161]=0;c[6162]=1065353216;g[6163]=0.0;c[6164]=1054458864;c[6165]=-1096927567;c[6166]=-1084636042;g[6167]=0.0;c[6168]=-1104782626;c[6169]=-1090519208;c[6170]=-1084636042;g[6171]=0.0;c[6172]=1049007812;c[6173]=-1085334679;c[6174]=-1090087228;g[6175]=0.0;c[6176]=1054458864;c[6177]=1050556081;c[6178]=-1084636042;g[6179]=0.0;c[6180]=1062847505;c[6181]=-2147483648;c[6182]=-1090087262;g[6183]=0.0;c[6184]=-1090087362;c[6185]=-2147483648;c[6186]=-1084636076;g[6187]=0.0;c[6188]=-1087361736;c[6189]=-1090519141;c[6190]=-1090087262;g[6191]=0.0;c[6192]=-1104782626;c[6193]=1056964440;c[6194]=-1084636042;g[6195]=0.0;c[6196]=-1087361736;c[6197]=1056964507;c[6198]=-1090087262;g[6199]=0.0;c[6200]=1049007812;c[6201]=1062148969;c[6202]=-1090087228;g[6203]=0.0;c[6204]=1064532105;c[6205]=1050556148;c[6206]=0;g[6207]=0.0;c[6208]=1064532105;c[6209]=-1096927500;c[6210]=0;g[6211]=0.0;c[6212]=1058437413;c[6213]=-1085334595;c[6214]=0;g[6215]=0.0;c[6216]=0;c[6217]=-1082130432;c[6218]=0;g[6219]=0.0;c[6220]=-1089046235;c[6221]=-1085334595;c[6222]=0;g[6223]=0.0;c[6224]=-1082951543;c[6225]=-1096927500;c[6226]=-2147483648;g[6227]=0.0;c[6228]=-1082951543;c[6229]=1050556148;c[6230]=-2147483648;g[6231]=0.0;c[6232]=-1089046235;c[6233]=1062149053;c[6234]=-2147483648;g[6235]=0.0;c[6236]=-2147483648;c[6237]=1065353216;c[6238]=-2147483648;g[6239]=0.0;c[6240]=1058437413;c[6241]=1062149053;c[6242]=-2147483648;g[6243]=0.0;c[6244]=1060121912;c[6245]=-1090519141;c[6246]=1057396386;g[6247]=0.0;c[6248]=-1098475836;c[6249]=-1085334679;c[6250]=1057396420;g[6251]=0.0;c[6252]=-1084636143;c[6253]=0;c[6254]=1057396386;g[6255]=0.0;c[6256]=-1098475836;c[6257]=1062148969;c[6258]=1057396420;g[6259]=0.0;c[6260]=1060121912;c[6261]=1056964507;c[6262]=1057396386;g[6263]=0.0;c[6264]=1057396286;c[6265]=0;c[6266]=1062847572;g[6267]=0.0;c[6268]=1042701022;c[6269]=-1090519208;c[6270]=1062847606;g[6271]=0.0;c[6272]=-1093024784;c[6273]=-1096927567;c[6274]=1062847606;g[6275]=0.0;c[6276]=-1093024784;c[6277]=1050556081;c[6278]=1062847606;g[6279]=0.0;c[6280]=1042701022;c[6281]=1056964440;c[6282]=1062847606;g[6283]=0.0;return}function de(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;k=c[b+9288>>2]|0;if(!k){c[b>>2]=5;k=0;return k|0}i=c[k+48>>2]|0;if(i|0)c[i+44>>2]=c[k+44>>2];i=c[k+44>>2]|0;if(i|0)c[i+48>>2]=c[k+48>>2];if((c[b+9288>>2]|0)==(k|0))c[b+9288>>2]=c[k+48>>2];c[b+9292>>2]=(c[b+9292>>2]|0)+-1;c[k+44>>2]=0;c[k+48>>2]=c[b+9280>>2];i=c[b+9280>>2]|0;if(i|0)c[i+44>>2]=k;c[b+9280>>2]=k;c[b+9284>>2]=(c[b+9284>>2]|0)+1;a[k+55>>0]=0;c[k+20>>2]=d;c[k+24>>2]=e;c[k+28>>2]=f;j=+g[d+16>>2];n=+g[e+16>>2]-j;m=+g[d+20>>2];l=+g[e+20>>2]-m;o=+g[d+24>>2];p=+g[e+24>>2]-o;j=+g[f+16>>2]-j;m=+g[f+20>>2]-m;o=+g[f+24>>2]-o;g[k>>2]=l*o-p*m;g[k+4>>2]=p*j-n*o;g[k+8>>2]=n*m-l*j;g[k+12>>2]=0.0;j=+x(+((l*o-p*m)*(l*o-p*m)+(p*j-n*o)*(p*j-n*o)+(n*m-l*j)*(n*m-l*j)));if(!(j>9.999999747378752e-05)){c[b>>2]=2;i=c[k+48>>2]|0;if(i|0)c[i+44>>2]=c[k+44>>2];i=c[k+44>>2]|0;if(i|0)c[i+48>>2]=c[k+48>>2];if((c[b+9280>>2]|0)==(k|0))c[b+9280>>2]=c[k+48>>2];c[b+9284>>2]=(c[b+9284>>2]|0)+-1;c[k+44>>2]=0;c[k+48>>2]=c[b+9288>>2];i=c[b+9288>>2]|0;if(i|0)c[i+44>>2]=k;c[b+9288>>2]=k;c[b+9292>>2]=(c[b+9292>>2]|0)+1;k=0;return k|0}if((!(nk(+g[k>>2],+g[k+4>>2],+g[k+8>>2],+g[d+16>>2],+g[d+20>>2],+g[d+24>>2],+g[e+16>>2],+g[e+20>>2],+g[e+24>>2],k+16|0)|0)?!(nk(+g[k>>2],+g[k+4>>2],+g[k+8>>2],+g[e+16>>2],+g[e+20>>2],+g[e+24>>2],+g[f+16>>2],+g[f+20>>2],+g[f+24>>2],k+16|0)|0):0)?!(nk(+g[k>>2],+g[k+4>>2],+g[k+8>>2],+g[f+16>>2],+g[f+20>>2],+g[f+24>>2],+g[d+16>>2],+g[d+20>>2],+g[d+24>>2],k+16|0)|0):0)g[k+16>>2]=(+g[d+16>>2]*+g[k>>2]+ +g[d+20>>2]*+g[k+4>>2]+ +g[d+24>>2]*+g[k+8>>2])/j;g[k>>2]=1.0/j*+g[k>>2];g[k+4>>2]=1.0/j*+g[k+4>>2];g[k+8>>2]=1.0/j*+g[k+8>>2];if(h)return k|0;if(+g[k+16>>2]>=-9.999999747378752e-06)return k|0;c[b>>2]=3;i=c[k+48>>2]|0;if(i|0)c[i+44>>2]=c[k+44>>2];i=c[k+44>>2]|0;if(i|0)c[i+48>>2]=c[k+48>>2];if((c[b+9280>>2]|0)==(k|0))c[b+9280>>2]=c[k+48>>2];c[b+9284>>2]=(c[b+9284>>2]|0)+-1;c[k+44>>2]=0;c[k+48>>2]=c[b+9288>>2];i=c[b+9288>>2]|0;if(i|0)c[i+44>>2]=k;c[b+9288>>2]=k;c[b+9292>>2]=(c[b+9292>>2]|0)+1;k=0;return k|0}function ee(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0;c[a+556>>2]=c[b>>2];c[a+556+4>>2]=c[b+4>>2];c[a+556+8>>2]=c[b+8>>2];c[a+556+12>>2]=c[b+12>>2];k=+g[a+568>>2];l=+g[a+560>>2];i=+g[a+564>>2];j=+g[a+556>>2];d=-j-l*0.0-i*0.0;e=(i+k*0.0-j*0.0)*-i+(k*(k+l*0.0-i*0.0)+d*-j)-(k*0.0+j*0.0-l)*-l;f=(k*0.0+j*0.0-l)*-j+(k*(i+k*0.0-j*0.0)+d*-l)-(k+l*0.0-i*0.0)*-i;d=(k+l*0.0-i*0.0)*-l+(d*-i+k*(k*0.0+j*0.0-l))-(i+k*0.0-j*0.0)*-j;if(d*0.0+(f*0.0+e)<-.9999998807907104){h=1.0;d=-0.0;e=0.0;f=0.0}else{s=+x(+((d*0.0+(f*0.0+e)+1.0)*2.0));h=(e*0.0-d)*(1.0/s);d=(d*0.0-f*0.0)*(1.0/s);e=(f-e*0.0)*(1.0/s);f=s*.5}m=1.0/+x(+(d*d+h*h+e*e+f*f));o=d*m;n=h*m;p=e*m;m=f*m;r=1.0/+x(+((k*m-j*-o-l*-n-i*-p)*(k*m-j*-o-l*-n-i*-p)+((l*-o+(i*m+k*-p)-j*-n)*(l*-o+(i*m+k*-p)-j*-n)+((i*-n+(j*m+k*-o)-l*-p)*(i*-n+(j*m+k*-o)-l*-p)+(j*-p+(k*-n+l*m)-i*-o)*(j*-p+(k*-n+l*m)-i*-o)))));h=(i*-n+(j*m+k*-o)-l*-p)*r;s=(j*-p+(k*-n+l*m)-i*-o)*r;f=(l*-o+(i*m+k*-p)-j*-n)*r;r=(k*m-j*-o-l*-n-i*-p)*r;e=+g[a+444>>2];if(e>=.05000000074505806?(q=+g[a+448>>2],q>=.05000000074505806):0){d=m<-1.0?-1.0:m;d=+C(+(d>1.0?1.0:d))*2.0;if(d>1.1920928955078125e-07){i=1.0/+x(+(p*p+(o*o+n*n)));if(+w(+(n*i))>1.1920928955078125e-07){k=o*i;j=n*i;l=p*i;e=+x(+((p*i*p*i/(n*i*n*i)+1.0)/(p*i*p*i/(n*i*n*i)/(e*e)+1.0/(q*q))))}else{k=o*i;j=n*i;l=p*i}}else{k=0.0;j=0.0;l=0.0;e=0.0}if(+w(+d)>1.1920928955078125e-07){if(!(d>e)){e=-e;if(d>2];if(k>=.05000000074505806){d=r<-1.0?-1.0:r;d=+C(+(d>1.0?1.0:d))*2.0;if(d>3.1415927410125732){d=-r<-1.0?-1.0:-r;d=+C(+(d>1.0?1.0:d))*2.0;e=-h;i=-s;j=-f}else{e=h;i=s;j=f}if(d>1.1920928955078125e-07){q=1.0/+x(+(e*e+i*i+j*j));e=e*q;i=i*q;j=j*q}if(+w(+d)>1.1920928955078125e-07){if(!(d>k)){if(d<-k)d=-k}else d=k;s=d*.5;d=+A(+s)/+x(+(j*j+(i*i+e*e)));h=e*d;f=j*d;e=+z(+s);d=i*d}else{e=r;d=s}}else{e=r;d=s}g[a+556>>2]=n*f+(m*h+o*e)-l*d;g[a+560>>2]=l*h+(m*d+n*e)-o*f;g[a+564>>2]=o*d+(m*f+l*e)-n*h;g[a+568>>2]=m*e-o*h-n*d-l*f;return}function fe(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0;o=c[a+192>>2]|0;n=+va[c[(c[o>>2]|0)+48>>2]&15](o);o=c[a+712>>2]|0;if((o|0)>0){i=0;do{m=c[a+720>>2]|0;d=m+(i*104|0)+8|0;j=+g[b>>2]*+g[d>>2];g[d>>2]=j;d=m+(i*104|0)+12|0;k=+g[b+4>>2]*+g[d>>2];g[d>>2]=k;d=m+(i*104|0)+16|0;l=+g[b+8>>2]*+g[d>>2];g[d>>2]=l;d=m+(i*104|0)+24|0;g[d>>2]=+g[b>>2]*+g[d>>2];d=m+(i*104|0)+28|0;g[d>>2]=+g[b+4>>2]*+g[d>>2];d=m+(i*104|0)+32|0;g[d>>2]=+g[b+8>>2]*+g[d>>2];m=c[m+(i*104|0)+96>>2]|0;d=sg(a+928|0,m)|0;a:do if(d){h=c[a+936>>2]|0;if((h|0)<=-1){d=c[a+928>>2]|0;break}if(h){e=0;while(1){f=c[d+32>>2]|0;e=e+1|0;if(!f)break a;if((e|0)>=(h|0)){d=f;break}else d=f}}}else d=0;while(0);g[m>>2]=j-n;g[m+4>>2]=k-n;g[m+8>>2]=l-n;g[m+12>>2]=0.0;g[m+16>>2]=n+j;g[m+20>>2]=n+k;g[m+24>>2]=n+l;g[m+28>>2]=0.0;ue(a+928|0,d,m);i=i+1|0}while((i|0)!=(o|0))}Nf(a);d=c[a+928>>2]|0;if(d){o=c[a+192>>2]|0;k=+va[c[(c[o>>2]|0)+48>>2]&15](o);n=+g[d+4>>2]-k;l=+g[d+8>>2]-k;g[a+892>>2]=+g[d>>2]-k;g[a+896>>2]=n;g[a+900>>2]=l;g[a+904>>2]=0.0;l=k+ +g[d+20>>2];n=k+ +g[d+24>>2];g[a+908>>2]=k+ +g[d+16>>2];g[a+912>>2]=l;g[a+916>>2]=n;g[a+920>>2]=0.0;d=c[a+188>>2]|0;if(d|0){o=c[a+684>>2]|0;m=c[o+32>>2]|0;eb[c[(c[m>>2]|0)+16>>2]&31](m,d,a+892|0,a+908|0,c[o+36>>2]|0)}}else{c[a+892>>2]=0;c[a+892+4>>2]=0;c[a+892+8>>2]=0;c[a+892+12>>2]=0;c[a+892+16>>2]=0;c[a+892+20>>2]=0;c[a+892+24>>2]=0;c[a+892+28>>2]=0}e=c[a+732>>2]|0;if((e|0)<=0){cf(a);return}f=c[a+740>>2]|0;d=0;do{m=c[f+(d*52|0)+8>>2]|0;o=c[f+(d*52|0)+12>>2]|0;k=+g[m+8>>2]-+g[o+8>>2];l=+g[m+12>>2]-+g[o+12>>2];n=+g[m+16>>2]-+g[o+16>>2];n=+x(+(k*k+l*l+n*n));g[f+(d*52|0)+16>>2]=n;g[f+(d*52|0)+28>>2]=n*n;d=d+1|0}while((d|0)!=(e|0));d=0;do{g[f+(d*52|0)+24>>2]=(+g[(c[f+(d*52|0)+8>>2]|0)+88>>2]+ +g[(c[f+(d*52|0)+12>>2]|0)+88>>2])/+g[(c[f+(d*52|0)+4>>2]|0)+4>>2];d=d+1|0}while((d|0)!=(e|0));cf(a);return}function ge(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if(!b)if(!e){if(f|0){c[f>>2]=(a>>>0)%(d>>>0);c[f+4>>2]=0}e=0;f=(a>>>0)/(d>>>0)>>>0;return (P(e|0),f)|0}else{if(!f){e=0;f=0;return (P(e|0),f)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;e=0;f=0;return (P(e|0),f)|0}do if(d){if(e|0){h=(M(e|0)|0)-(M(b|0)|0)|0;if(h>>>0<=31){n=h+1|0;i=a>>>((h+1|0)>>>0)&h-31>>31|b<<31-h;m=b>>>((h+1|0)>>>0)&h-31>>31;g=0;h=a<<31-h;break}if(!f){e=0;f=0;return (P(e|0),f)|0}c[f>>2]=a|0;c[f+4>>2]=b|b&0;e=0;f=0;return (P(e|0),f)|0}if(d-1&d|0){h=(M(d|0)|0)+33-(M(b|0)|0)|0;n=h;i=32-h-1>>31&b>>>((h-32|0)>>>0)|(b<<32-h|a>>>(h>>>0))&h-32>>31;m=h-32>>31&b>>>(h>>>0);g=a<<64-h&32-h>>31;h=(b<<64-h|a>>>((h-32|0)>>>0))&32-h>>31|a<<32-h&h-33>>31;break}if(f|0){c[f>>2]=d-1&a;c[f+4>>2]=0}if((d|0)==1){e=b|b&0;f=a|0|0;return (P(e|0),f)|0}else{f=eF(d|0)|0;e=b>>>(f>>>0)|0;f=b<<32-f|a>>>(f>>>0)|0;return (P(e|0),f)|0}}else{if(!e){if(f|0){c[f>>2]=(b>>>0)%(d>>>0);c[f+4>>2]=0}e=0;f=(b>>>0)/(d>>>0)>>>0;return (P(e|0),f)|0}if(!a){if(f|0){c[f>>2]=0;c[f+4>>2]=(b>>>0)%(e>>>0)}d=0;f=(b>>>0)/(e>>>0)>>>0;return (P(d|0),f)|0}if(!(e-1&e)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=e-1&b|b&0}d=0;f=b>>>((eF(e|0)|0)>>>0);return (P(d|0),f)|0}h=(M(e|0)|0)-(M(b|0)|0)|0;if(h>>>0<=30){n=h+1|0;i=b<<31-h|a>>>((h+1|0)>>>0);m=b>>>((h+1|0)>>>0);g=0;h=a<<31-h;break}if(!f){e=0;f=0;return (P(e|0),f)|0}c[f>>2]=a|0;c[f+4>>2]=b|b&0;e=0;f=0;return (P(e|0),f)|0}while(0);if(!n){j=h;b=m;a=0;h=0}else{k=xv(d|0|0,e|e&0|0,-1,-1)|0;l=Q()|0;j=h;b=m;a=n;h=0;do{p=j;j=g>>>31|j<<1;g=h|g<<1;p=i<<1|p>>>31|0;o=i>>>31|b<<1|0;lv(k|0,l|0,p|0,o|0)|0;n=Q()|0;m=n>>31|((n|0)<0?-1:0)<<1;h=m&1;i=lv(p|0,o|0,m&(d|0)|0,(((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1)&(e|e&0)|0)|0;b=Q()|0;a=a-1|0}while((a|0)!=0);a=0}if(f|0){c[f>>2]=i;c[f+4>>2]=b}o=(g|0)>>>31|j<<1|(0<<1|g>>>31)&0|a;p=(g<<1|0>>>31)&-2|h;return (P(o|0),p)|0}function he(a,b,d,e,f,h){a=a|0;b=+b;d=+d;e=e|0;f=f|0;h=h|0;var i=0,j=0.0,k=0.0,l=0.0,m=0,n=0,o=0,p=0,q=0,r=0.0;o=sa;sa=sa+352|0;m=IH(f)|0;j=+g[m>>2];k=+g[m+4>>2];l=+g[m+8>>2];g[o+328>>2]=0.0;g[o+324>>2]=0.0;g[o+320>>2]=0.0;ns(o+336|0,o+328|0,o+324|0,o+320|0);g[(JI(o+336|0)|0)+(e<<2)>>2]=d;g[o+296>>2]=0.0;g[o+292>>2]=0.0;g[o+288>>2]=0.0;ns(o+304|0,o+296|0,o+292|0,o+288|0);m=JI(o+304|0)|0;g[m+(e<<2)>>2]=-d;g[o+264>>2]=0.0;g[o+260>>2]=0.0;g[o+256>>2]=0.0;ns(o+272|0,o+264|0,o+260|0,o+256|0);n=JI(o+272|0)|0;g[n+(e<<2)>>2]=d;i=0;while(1){if(i>>>0>=360)break;d=+(i|0)*.01745329238474369;r=+yI(d)*b;g[m+(((e+1|0)%3|0)<<2)>>2]=r;g[n+(((e+1|0)%3|0)<<2)>>2]=r;d=+zI(d)*b;g[m+(((e+2|0)%3|0)<<2)>>2]=d;g[n+(((e+2|0)%3|0)<<2)>>2]=d;p=c[(c[a>>2]|0)+8>>2]|0;q=JI(f)|0;vl(o+224|0,q,+g[o+304>>2],+g[o+304+4>>2],+g[o+304+8>>2]);qp(o+240|0,j,k,l,+g[o+224>>2],+g[o+224+4>>2],+g[o+224+8>>2]);vl(o+192|0,q,+g[o+272>>2],+g[o+272+4>>2],+g[o+272+8>>2]);qp(o+208|0,j,k,l,+g[o+192>>2],+g[o+192+4>>2],+g[o+192+8>>2]);ab[p&127](a,o+240|0,o+208|0,h);i=i+30|0}g[o+168>>2]=0.0;g[o+164>>2]=0.0;g[o+160>>2]=0.0;ns(o+176|0,o+168|0,o+164|0,o+160|0);g[(JI(o+176|0)|0)+(e<<2)>>2]=1.0;g[o+136>>2]=0.0;g[o+132>>2]=0.0;g[o+128>>2]=0.0;ns(o+144|0,o+136|0,o+132|0,o+128|0);g[(JI(o+144|0)|0)+(((e+1|0)%3|0)<<2)>>2]=1.0;q=c[(c[a>>2]|0)+60>>2]|0;p=JI(f)|0;vl(o+96|0,p,+g[o+336>>2],+g[o+336+4>>2],+g[o+336+8>>2]);sp(o+112|0,j,k,l,+g[o+96>>2],+g[o+96+4>>2],+g[o+96+8>>2]);vl(o+80|0,p,+g[o+176>>2],+g[o+176+4>>2],+g[o+176+8>>2]);vl(o+64|0,p,+g[o+144>>2],+g[o+144+4>>2],+g[o+144+8>>2]);db[q&1](a,o+112|0,o+80|0,o+64|0,b,b,0.0,6.2831854820251465,h,0,10.0);q=c[(c[a>>2]|0)+60>>2]|0;vl(o+32|0,p,+g[o+336>>2],+g[o+336+4>>2],+g[o+336+8>>2]);qp(o+48|0,j,k,l,+g[o+32>>2],+g[o+32+4>>2],+g[o+32+8>>2]);vl(o+16|0,p,+g[o+176>>2],+g[o+176+4>>2],+g[o+176+8>>2]);vl(o,p,+g[o+144>>2],+g[o+144+4>>2],+g[o+144+8>>2]);db[q&1](a,o+48|0,o+16|0,o,b,b,0.0,6.2831854820251465,h,0,10.0);sa=o;return}function ie(a,b,d,e,f,h){a=a|0;b=+b;d=+d;e=e|0;f=f|0;h=h|0;var i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0;n=sa;sa=sa+400|0;g[n+376>>2]=0.0;g[n+372>>2]=0.0;g[n+368>>2]=0.0;ns(n+384|0,n+376|0,n+372|0,n+368|0);l=JI(n+384|0)|0;g[l+(e<<2)>>2]=-d;g[n+344>>2]=0.0;g[n+340>>2]=0.0;g[n+336>>2]=0.0;ns(n+352|0,n+344|0,n+340|0,n+336|0);m=JI(n+352|0)|0;g[m+(e<<2)>>2]=d;Dq(n+272|0,f);Qv(n+256|0,f,+g[n+384>>2],+g[n+384+4>>2],+g[n+384+8>>2]);i=IH(n+272|0)|0;c[i>>2]=c[n+256>>2];c[i+4>>2]=c[n+256+4>>2];c[i+8>>2]=c[n+256+8>>2];c[i+12>>2]=c[n+256+12>>2];c[n+240>>2]=c[n+256>>2];c[n+240+4>>2]=c[n+256+4>>2];c[n+240+8>>2]=c[n+256+8>>2];c[n+240+12>>2]=c[n+256+12>>2];i=JI(n+272|0)|0;sr(n+224|0,i,(e+1|0)%3|0);sr(n+192|0,i,e);Lq(n+208|0,+g[n+192>>2],+g[n+192+4>>2],+g[n+192+8>>2]);cb[c[(c[a>>2]|0)+64>>2]&1](a,n+240|0,n+224|0,n+208|0,b,-1.5707963705062866,1.5707963705062866,-1.5707963705062866,1.5707963705062866,h,30.0,0);Dq(n+128|0,f);Qv(n+112|0,f,+g[n+352>>2],+g[n+352+4>>2],+g[n+352+8>>2]);i=IH(n+128|0)|0;c[i>>2]=c[n+112>>2];c[i+4>>2]=c[n+112+4>>2];c[i+8>>2]=c[n+112+8>>2];c[i+12>>2]=c[n+112+12>>2];c[n+96>>2]=c[n+112>>2];c[n+96+4>>2]=c[n+112+4>>2];c[n+96+8>>2]=c[n+112+8>>2];c[n+96+12>>2]=c[n+112+12>>2];i=JI(n+128|0)|0;sr(n+80|0,i,(e+1|0)%3|0);sr(n+64|0,i,e);cb[c[(c[a>>2]|0)+64>>2]&1](a,n+96|0,n+80|0,n+64|0,b,-1.5707963705062866,1.5707963705062866,-1.5707963705062866,1.5707963705062866,h,30.0,0);i=IH(f)|0;d=+g[i>>2];j=+g[i+4>>2];k=+g[i+8>>2];i=0;while(1){if(i>>>0>=360)break;q=+(i|0)*.01745329238474369;r=+yI(q)*b;g[l+(((e+1|0)%3|0)<<2)>>2]=r;g[m+(((e+1|0)%3|0)<<2)>>2]=r;q=+zI(q)*b;g[l+(((e+2|0)%3|0)<<2)>>2]=q;g[m+(((e+2|0)%3|0)<<2)>>2]=q;o=c[(c[a>>2]|0)+8>>2]|0;p=JI(f)|0;vl(n+32|0,p,+g[n+384>>2],+g[n+384+4>>2],+g[n+384+8>>2]);qp(n+48|0,d,j,k,+g[n+32>>2],+g[n+32+4>>2],+g[n+32+8>>2]);vl(n,p,+g[n+352>>2],+g[n+352+4>>2],+g[n+352+8>>2]);qp(n+16|0,d,j,k,+g[n>>2],+g[n+4>>2],+g[n+8>>2]);ab[o&127](a,n+48|0,n+16|0,h);i=i+30|0}sa=n;return}function je(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0;h=c[d+8>>2]|0;if((h|0)>0){i=c[d+16>>2]|0;f=0;e=0;do{j=c[i+(f<<2)>>2]|0;if(!(c[j+204>>2]&3)){c[j+208>>2]=e;e=e+1|0}c[j+212>>2]=-1;g[j+244>>2]=1.0;f=f+1|0}while((f|0)!=(h|0));j=e}else j=0;i=c[b+8>>2]|0;if((i|0)<(j|0)){if((c[b+12>>2]|0)<(j|0)){if(!j){e=0;h=i}else{c[7182]=(c[7182]|0)+1;e=xb((j<<3|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+8>>2]|0}if((h|0)>0){f=0;do{m=(c[b+16>>2]|0)+(f<<3)|0;k=c[m+4>>2]|0;l=e+(f<<3)|0;c[l>>2]=c[m>>2];c[l+4>>2]=k;f=f+1|0}while((f|0)!=(h|0))}f=c[b+16>>2]|0;if(f|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=e;c[b+12>>2]=j;f=b+16|0}else f=b+16|0;e=i;do{m=(c[f>>2]|0)+(e<<3)|0;c[m>>2]=0;c[m+4>>2]=0;e=e+1|0}while((e|0)!=(j|0))}c[b+8>>2]=j;if((j|0)>0){f=c[b+16>>2]|0;e=0;do{c[f+(e<<3)>>2]=e;c[f+(e<<3)+4>>2]=1;e=e+1|0}while((e|0)!=(j|0))}e=c[d+68>>2]|0;e=Fa[c[(c[e>>2]|0)+36>>2]&127](e)|0;l=Fa[c[(c[e>>2]|0)+36>>2]&127](e)|0;if(!l)return;k=Fa[c[(c[e>>2]|0)+20>>2]&127](e)|0;if((l|0)<=0)return;d=0;do{e=c[c[k+(d<<4)>>2]>>2]|0;f=c[c[k+(d<<4)+4>>2]>>2]|0;if((e|0?(f|0?(c[e+204>>2]&7|0)==0:0):0)?(c[f+204>>2]&7|0)==0:0){h=c[e+208>>2]|0;e=c[f+208>>2]|0;j=c[b+16>>2]|0;f=c[j+(h<<3)>>2]|0;if((f|0)!=(h|0)){c[j+(h<<3)>>2]=c[j+(f<<3)>>2];h=c[j+(f<<3)>>2]|0;f=c[j+(h<<3)>>2]|0;if((h|0)!=(f|0)){i=j+(h<<3)|0;do{h=j+(f<<3)|0;c[i>>2]=c[h>>2];h=c[h>>2]|0;i=j+(h<<3)|0;f=c[i>>2]|0}while((h|0)!=(f|0))}}f=c[j+(e<<3)>>2]|0;if((f|0)!=(e|0)){c[j+(e<<3)>>2]=c[j+(f<<3)>>2];e=c[j+(f<<3)>>2]|0;f=c[j+(e<<3)>>2]|0;if((e|0)!=(f|0)){i=j+(e<<3)|0;do{e=j+(f<<3)|0;c[i>>2]=c[e>>2];e=c[e>>2]|0;i=j+(e<<3)|0;f=c[i>>2]|0}while((e|0)!=(f|0))}}if((h|0)!=(e|0)){c[j+(h<<3)>>2]=e;m=j+(e<<3)+4|0;c[m>>2]=(c[m>>2]|0)+(c[j+(h<<3)+4>>2]|0)}}d=d+1|0}while((d|0)!=(l|0));return}function ke(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0;h=sa;sa=sa+48|0;c[b+8>>2]=0;g[b+12>>2]=0.0;c[b>>2]=9732;c[b+48>>2]=d;c[b+4>>2]=21;if(Fa[c[(c[d>>2]|0)+40>>2]&127](d)|0)Za[c[(c[d>>2]|0)+48>>2]&127](d,b+16|0,b+32|0);else{d=h+32+4|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;g[h+32>>2]=1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h+16|0,b,h+32|0);g[b+32>>2]=+g[h+16>>2]+ +g[b+12>>2];g[h+32>>2]=-1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h,b,h+32|0);c[h+16>>2]=c[h>>2];c[h+16+4>>2]=c[h+4>>2];c[h+16+8>>2]=c[h+8>>2];c[h+16+12>>2]=c[h+12>>2];g[b+16>>2]=+g[h+16>>2]-+g[b+12>>2];c[h+32>>2]=0;c[h+32+4>>2]=0;c[h+32+8>>2]=0;c[h+32+12>>2]=0;g[d>>2]=1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h+16|0,b,h+32|0);g[b+36>>2]=+g[h+16+4>>2]+ +g[b+12>>2];g[d>>2]=-1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h,b,h+32|0);c[h+16>>2]=c[h>>2];c[h+16+4>>2]=c[h+4>>2];c[h+16+8>>2]=c[h+8>>2];c[h+16+12>>2]=c[h+12>>2];g[b+20>>2]=+g[h+16+4>>2]-+g[b+12>>2];c[h+32>>2]=0;c[h+32+4>>2]=0;c[h+32+8>>2]=0;c[h+32+12>>2]=0;g[h+32+8>>2]=1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h+16|0,b,h+32|0);g[b+40>>2]=+g[h+16+8>>2]+ +g[b+12>>2];g[h+32+8>>2]=-1.0;Za[c[(c[b>>2]|0)+68>>2]&127](h,b,h+32|0);c[h+16>>2]=c[h>>2];c[h+16+4>>2]=c[h+4>>2];c[h+16+8>>2]=c[h+8>>2];c[h+16+12>>2]=c[h+12>>2];g[b+24>>2]=+g[h+16+8>>2]-+g[b+12>>2]}c[b>>2]=9580;c[b+52>>2]=0;c[b+56>>2]=0;a[b+60>>0]=e&1;a[b+61>>0]=0;c[b+4>>2]=21;if(!f){sa=h;return}c[7182]=(c[7182]|0)+1;d=xb(191)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}c[d+52>>2]=282;a[d+60>>0]=0;a[d+80>>0]=1;c[d+76>>2]=0;c[d+68>>2]=0;c[d+72>>2]=0;a[d+100>>0]=1;c[d+96>>2]=0;c[d+88>>2]=0;c[d+92>>2]=0;a[d+120>>0]=1;c[d+116>>2]=0;c[d+108>>2]=0;c[d+112>>2]=0;a[d+140>>0]=1;c[d+136>>2]=0;c[d+128>>2]=0;c[d+132>>2]=0;c[d+144>>2]=0;a[d+164>>0]=1;c[d+160>>2]=0;c[d+152>>2]=0;c[d+156>>2]=0;c[d+168>>2]=0;c[d+4>>2]=-8388609;c[d+8>>2]=-8388609;c[d+12>>2]=-8388609;g[d+16>>2]=0.0;c[d+20>>2]=2139095039;c[d+24>>2]=2139095039;c[d+28>>2]=2139095039;g[d+32>>2]=0.0;c[d>>2]=10888;c[b+52>>2]=d;pc(d,c[b+48>>2]|0,(a[b+60>>0]|0)!=0,b+16|0,b+32|0);a[b+61>>0]=1;sa=h;return}function le(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0,x=0;if(!a)return;q=+g[b>>2];r=+g[b+4>>2];s=+g[b+8>>2];t=+g[b+16>>2];u=+g[b+20>>2];p=+g[b+24>>2];c[7182]=(c[7182]|0)+1;b=xb(275)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}c[b>>2]=a;o=64;j=1;h=b;i=b;f=b;e=b;m=b;while(1){k=j+-1|0;n=c[h+(k<<2)>>2]|0;do if(((((+g[n>>2]<=t?+g[n+16>>2]>=q:0)?+g[n+4>>2]<=u:0)?+g[n+20>>2]>=r:0)?+g[n+8>>2]<=p:0)?+g[n+24>>2]>=s:0){if(!(c[n+40>>2]|0)){Va[c[(c[d>>2]|0)+12>>2]&127](d,n);a=o;b=m;break}l=c[n+36>>2]|0;do if((k|0)==(o|0)){a=(o|0)==0?1:o<<1;if((j|0)<=(a|0)){if((a|0)!=0?(c[7182]=(c[7182]|0)+1,v=xb((a<<2|3)+16|0)|0,(v|0)!=0):0){c[(v+4+15&-16)+-4>>2]=v;e=v+4+15&-16}else e=0;if((j|0)<=1){if(!h){h=e;j=e;i=e;f=e;b=e;k=0;break}}else{b=0;do{c[e+(b<<2)>>2]=c[h+(b<<2)>>2];b=b+1|0}while((b|0)!=(o|0))}if(!m){h=e;j=e;i=e;f=e;b=e;k=o}else{c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0);h=e;j=e;i=e;f=e;b=e;k=o}}else{a=o;j=e;b=m;k=o}}else{a=o;j=e;b=m}while(0);c[h+(k<<2)>>2]=l;m=k+1|0;l=c[n+40>>2]|0;do if((m|0)==(a|0)?(w=(a|0)==0?1:a<<1,(a|0)<(w|0)):0){if((w|0)!=0?(c[7182]=(c[7182]|0)+1,x=xb((w<<2|3)+16|0)|0,(x|0)!=0):0){c[(x+4+15&-16)+-4>>2]=x;e=x+4+15&-16}else e=0;if((k|0)>-1){b=0;do{c[e+(b<<2)>>2]=c[h+(b<<2)>>2];b=b+1|0}while((b|0)!=(a|0));if(!j){a=w;h=e;i=e;f=e;j=e;b=e;break}}else if((h|0)==0|(j|0)==0){a=w;h=e;i=e;f=e;j=e;b=e;break}c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);a=w;h=e;i=e;f=e;j=e;b=e}while(0);c[h+(m<<2)>>2]=l;k=k+2|0;e=j}else{a=o;b=m}while(0);if((k|0)<=0)break;o=a;j=k;m=b}if((h|0)==0|(i|0)==0)return;c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);return}function me(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0;j=sa;sa=sa+64|0;k=(a[b+8>>0]|0)!=0;i=k?e:d;d=k?d:e;e=c[d+4>>2]|0;if(((c[e+4>>2]|0)+-21|0)>>>0>=9){sa=j;return}if((c[(c[i+4>>2]|0)+4>>2]|0)>=20){sa=j;return}l=+va[c[(c[e>>2]|0)+48>>2]&15](e);c[h+4>>2]=c[b+76>>2];c[b+16>>2]=i;c[b+20>>2]=d;c[b+64>>2]=f;g[b+68>>2]=l;c[b+56>>2]=h;k=c[d+12>>2]|0;A=+g[k>>2];z=+g[k+16>>2];y=+g[k+32>>2];x=+g[k+4>>2];w=+g[k+20>>2];v=+g[k+36>>2];r=+g[k+8>>2];p=+g[k+24>>2];n=+g[k+40>>2];u=-+g[k+48>>2];t=-+g[k+52>>2];s=-+g[k+56>>2];k=c[i+12>>2]|0;J=+g[k>>2];I=+g[k+16>>2];H=+g[k+32>>2];G=+g[k+4>>2];F=+g[k+20>>2];E=+g[k+36>>2];D=+g[k+8>>2];C=+g[k+24>>2];B=+g[k+40>>2];q=+g[k+48>>2];o=+g[k+52>>2];m=+g[k+56>>2];g[j>>2]=A*J+z*I+y*H;g[j+4>>2]=A*G+z*F+y*E;g[j+8>>2]=A*D+z*C+y*B;g[j+12>>2]=0.0;g[j+16>>2]=x*J+w*I+v*H;g[j+20>>2]=x*G+w*F+v*E;g[j+24>>2]=x*D+w*C+v*B;g[j+28>>2]=0.0;g[j+32>>2]=r*J+p*I+n*H;g[j+36>>2]=r*G+p*F+n*E;g[j+40>>2]=r*D+p*C+n*B;g[j+44>>2]=0.0;g[j+48>>2]=A*u+z*t+y*s+(A*q+z*o+y*m);g[j+52>>2]=x*u+w*t+v*s+(x*q+w*o+v*m);g[j+56>>2]=r*u+p*t+n*s+(r*q+p*o+n*m);g[j+60>>2]=0.0;k=c[i+4>>2]|0;ab[c[(c[k>>2]|0)+8>>2]&127](k,j,b+24|0,b+40|0);g[b+40>>2]=+g[b+40>>2]+l;g[b+44>>2]=+g[b+44>>2]+l;g[b+48>>2]=+g[b+48>>2]+l;g[b+24>>2]=+g[b+24>>2]-l;g[b+28>>2]=+g[b+28>>2]-l;g[b+32>>2]=+g[b+32>>2]-l;k=c[b+76>>2]|0;d=c[d+8>>2]|0;c[k+740>>2]=c[i+8>>2];c[k+744>>2]=d;ab[c[(c[e>>2]|0)+64>>2]&127](e,b+12|0,b+24|0,b+40|0);d=c[h+4>>2]|0;do if(c[d+748>>2]|0){e=c[d+740>>2]|0;f=c[(c[h+8>>2]|0)+8>>2]|0;if((e|0)==(f|0)){re(d,e+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(d,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,f+4|0);break}}while(0);c[b+16>>2]=0;c[b+20>>2]=0;sa=j;return}function ne(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0;n=sa;sa=sa+128|0;i=+g[b>>2];j=+g[b+16>>2];o=i>2];if((o+g[a+28>>2]){sa=n;return}l=i>j?b:b+16|0;if(+g[(+g[l>>2]>h?l:b+32|0)>>2]<+g[a+12>>2]){sa=n;return}h=+g[b+8>>2];i=+g[b+24>>2];o=h>2];if((o+g[a+36>>2]){sa=n;return}l=h>i?b+8|0:b+24|0;if(+g[(+g[l>>2]>j?l:b+40|0)>>2]<+g[a+20>>2]){sa=n;return}h=+g[b+4>>2];i=+g[b+20>>2];o=h>2];if((o+g[a+32>>2]){sa=n;return}l=h>i?b+4|0:b+20|0;if(+g[(+g[l>>2]>j?l:b+36|0)>>2]<+g[a+16>>2]){sa=n;return}f=c[a+4>>2]|0;if((c[(c[f+4>>2]|0)+4>>2]|0)>=20){sa=n;return}l=c[a+48>>2]|0;c[n+24+8>>2]=0;c[n+24+12>>2]=1065353216;c[n+24+16>>2]=1065353216;c[n+24+20>>2]=1065353216;g[n+24+24>>2]=0.0;c[n+24+52>>2]=0;c[n+24>>2]=6476;c[n+24+4>>2]=1;c[n+24+56>>2]=c[b>>2];c[n+24+56+4>>2]=c[b+4>>2];c[n+24+56+8>>2]=c[b+8>>2];c[n+24+56+12>>2]=c[b+12>>2];c[n+24+72>>2]=c[b+16>>2];c[n+24+72+4>>2]=c[b+16+4>>2];c[n+24+72+8>>2]=c[b+16+8>>2];c[n+24+72+12>>2]=c[b+16+12>>2];c[n+24+88>>2]=c[b+32>>2];c[n+24+88+4>>2]=c[b+32+4>>2];c[n+24+88+8>>2]=c[b+32+8>>2];c[n+24+88+12>>2]=c[b+32+12>>2];c[n+24+44>>2]=c[a+56>>2];p=c[a+8>>2]|0;b=c[p+8>>2]|0;k=c[p+12>>2]|0;c[n>>2]=p;c[n+4>>2]=n+24;c[n+8>>2]=b;c[n+12>>2]=k;c[n+16>>2]=d;c[n+20>>2]=e;k=Ka[c[(c[l>>2]|0)+8>>2]&31](l,f,n,c[a+64>>2]|0)|0;b=c[a+44>>2]|0;f=c[b+8>>2]|0;if((c[f+8>>2]|0)==(c[(c[a+8>>2]|0)+8>>2]|0)){c[b+8>>2]=n;Za[c[(c[b>>2]|0)+8>>2]&127](b,d,e)}else{f=c[b+12>>2]|0;c[b+12>>2]=n;Za[c[(c[b>>2]|0)+12>>2]&127](b,d,e)}eb[c[(c[k>>2]|0)+8>>2]&31](k,c[a+4>>2]|0,n,c[a+52>>2]|0,c[a+44>>2]|0);p=c[a+44>>2]|0;c[((c[(c[p+8>>2]|0)+8>>2]|0)==(c[(c[a+8>>2]|0)+8>>2]|0)?p+8|0:p+12|0)>>2]=f;Pa[c[c[k>>2]>>2]&511](k);Va[c[(c[l>>2]|0)+60>>2]&127](l,k);c[n+24>>2]=9932;f=c[n+24+52>>2]|0;if(f|0?(Pa[c[c[f>>2]>>2]&511](f),m=c[n+24+52>>2]|0,m|0):0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}sa=n;return}function oe(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0.0,x=0.0,y=0.0,z=0.0;v=a[h+16>>0]&-16;a[h+16>>0]=v;w=+g[e>>2];x=+g[d>>2];n=+g[e+4>>2];o=+g[d+4>>2];p=+g[e+8>>2];q=+g[d+8>>2];r=+g[f>>2];s=+g[f+4>>2];t=+g[f+8>>2];l=+g[b>>2];m=+g[b+4>>2];i=+g[b+8>>2];y=(w-x)*(l-x)+(n-o)*(m-o)+(p-q)*(i-q);z=(r-x)*(l-x)+(s-o)*(m-o)+(t-q)*(i-q);do if(y<=0.0&z<=0.0){c[h>>2]=c[d>>2];c[h+4>>2]=c[d+4>>2];c[h+8>>2]=c[d+8>>2];c[h+12>>2]=c[d+12>>2];a[h+16>>0]=v|1;j=0.0;k=0.0;i=1.0}else{u=(w-x)*(l-w)+(n-o)*(m-n)+(p-q)*(i-p);k=(r-x)*(l-w)+(s-o)*(m-n)+(t-q)*(i-p);if(!(!(u>=0.0)|!(k<=u))){c[h>>2]=c[e>>2];c[h+4>>2]=c[e+4>>2];c[h+8>>2]=c[e+8>>2];c[h+12>>2]=c[e+12>>2];a[h+16>>0]=v|2;j=0.0;k=1.0;i=0.0;break}if(u<=0.0&(y>=0.0?y*k-u*z<=0.0:0)){g[h>>2]=x+(w-x)*(y/(y-u));g[h+4>>2]=o+(n-o)*(y/(y-u));g[h+8>>2]=q+(p-q)*(y/(y-u));g[h+12>>2]=0.0;a[h+16>>0]=v|3;j=0.0;k=y/(y-u);i=1.0-y/(y-u);break}j=(w-x)*(l-r)+(n-o)*(m-s)+(p-q)*(i-t);i=(r-x)*(l-r)+(s-o)*(m-s)+(t-q)*(i-t);if(!(!(i>=0.0)|!(j<=i))){c[h>>2]=c[f>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];c[h+12>>2]=c[f+12>>2];a[h+16>>0]=v|4;j=1.0;k=0.0;i=0.0;break}if(i<=0.0&(z>=0.0?j*z-y*i<=0.0:0)){g[h>>2]=x+(r-x)*(z/(z-i));g[h+4>>2]=o+(s-o)*(z/(z-i));g[h+8>>2]=q+(t-q)*(z/(z-i));g[h+12>>2]=0.0;a[h+16>>0]=v|5;j=z/(z-i);k=0.0;i=1.0-z/(z-i);break}if((u*i-j*k<=0.0?k-u>=0.0:0)?j-i>=0.0:0){k=(k-u)/(k-u+(j-i));g[h>>2]=w+(r-w)*k;g[h+4>>2]=n+(s-n)*k;g[h+8>>2]=p+(t-p)*k;g[h+12>>2]=0.0;a[h+16>>0]=v|6;j=k;k=1.0-k;i=0.0;break}l=1.0/(y*k-u*z+(u*i-j*k+(j*z-y*i)));m=(j*z-y*i)*l;i=(y*k-u*z)*l;g[h>>2]=(r-x)*i+(x+(w-x)*m);g[h+4>>2]=(s-o)*i+(o+(n-o)*m);g[h+8>>2]=(t-q)*i+(q+(p-q)*m);g[h+12>>2]=0.0;a[h+16>>0]=v|7;j=i;k=m;i=1.0-m-i}while(0);g[h+20>>2]=i;g[h+24>>2]=k;g[h+28>>2]=j;g[h+32>>2]=0.0;return}function pe(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0;f=sa;sa=sa+256|0;Ki(16022);c[f+32>>2]=6820;k=f+32+36|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];c[k+8>>2]=c[b+8>>2];c[k+12>>2]=c[b+12>>2];l=f+32+52|0;c[l>>2]=c[d>>2];c[l+4>>2]=c[d+4>>2];c[l+8>>2]=c[d+8>>2];c[l+12>>2]=c[d+12>>2];c[f+32+212>>2]=a;c[f+32+216>>2]=e;c[f+32+68>>2]=1065353216;c[f+32+72>>2]=0;c[f+32+72+4>>2]=0;c[f+32+72+8>>2]=0;c[f+32+72+12>>2]=0;c[f+32+88>>2]=1065353216;c[f+32+92>>2]=0;c[f+32+92+4>>2]=0;c[f+32+92+8>>2]=0;c[f+32+92+12>>2]=0;c[f+32+108>>2]=1065353216;c[f+32+112>>2]=0;c[f+32+116>>2]=c[k>>2];c[f+32+116+4>>2]=c[k+4>>2];c[f+32+116+8>>2]=c[k+8>>2];c[f+32+116+12>>2]=c[k+12>>2];c[f+32+132>>2]=1065353216;c[f+32+136>>2]=0;c[f+32+136+4>>2]=0;c[f+32+136+8>>2]=0;c[f+32+136+12>>2]=0;c[f+32+152>>2]=1065353216;c[f+32+156>>2]=0;c[f+32+156+4>>2]=0;c[f+32+156+8>>2]=0;c[f+32+156+12>>2]=0;c[f+32+172>>2]=1065353216;c[f+32+176>>2]=0;c[f+32+180>>2]=c[d>>2];c[f+32+180+4>>2]=c[d+4>>2];c[f+32+180+8>>2]=c[d+8>>2];c[f+32+180+12>>2]=c[d+12>>2];m=+g[d>>2]-+g[b>>2];j=+g[d+4>>2]-+g[b+4>>2];i=+g[d+8>>2]-+g[b+8>>2];h=1.0/+x(+(m*m+j*j+i*i));p=m*h==0.0?1000000015047466219876688.0e6:1.0/(m*h);g[f+32+4>>2]=p;o=j*h==0.0?1000000015047466219876688.0e6:1.0/(j*h);g[f+32+8>>2]=o;n=i*h==0.0?1000000015047466219876688.0e6:1.0/(i*h);g[f+32+12>>2]=n;c[f+32+20>>2]=p<0.0&1;c[f+32+24>>2]=o<0.0&1;c[f+32+28>>2]=n<0.0&1;g[f+32+32>>2]=m*h*(+g[l>>2]-+g[k>>2])+j*h*(+g[f+32+56>>2]-+g[f+32+40>>2])+i*h*(+g[f+32+60>>2]-+g[f+32+44>>2]);a=c[a+68>>2]|0;e=c[(c[a>>2]|0)+24>>2]|0;c[f+16>>2]=0;c[f+16+4>>2]=0;c[f+16+8>>2]=0;c[f+16+12>>2]=0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;gb[e&7](a,b,d,f+32|0,f+16|0,f);a=c[3084]|0;e=(c[a+16>>2]|0)+-1|0;c[a+16>>2]=e;if(e|0){sa=f;return}do if(c[a+4>>2]|0){la(f+32|0,0)|0;l=c[7181]|0;g[a+8>>2]=+g[a+8>>2]+ +(((c[f+32+4>>2]|0)-(c[l+4>>2]|0)+(((c[f+32>>2]|0)-(c[l>>2]|0)|0)*1e6|0)-(c[a+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[a+16>>2]|0)){a=c[3084]|0;break}else{sa=f;return}}while(0);c[3084]=c[a+20>>2];sa=f;return}function qe(a,b,f){a=a|0;b=b|0;f=f|0;var i=0,j=0.0,k=0,l=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0.0;t=sa;sa=sa+32|0;n=c[a+4>>2]|0;kb[c[(c[n>>2]|0)+16>>2]&3](n,t+28|0,t+24|0,t+20|0,t+16|0,t+12|0,t+8|0,t+4|0,t,b);n=(c[t+12>>2]|0)+(J(c[t+8>>2]|0,f)|0)|0;r=c[a+4>>2]|0;o=c[t>>2]|0;switch(o|0){case 3:{i=e[n+4>>1]|0;break}case 2:{i=c[n+8>>2]|0;break}default:i=d[n+2>>0]|0}s=(c[t+20>>2]|0)==0;p=c[t+28>>2]|0;q=c[t+16>>2]|0;i=p+(J(q,i)|0)|0;if(s){l=+g[i+4>>2]*+g[r+8>>2];m=+g[i>>2]*+g[r+4>>2];k=i+8|0;j=+g[r+12>>2]}else{l=+g[r+8>>2]*+h[i+8>>3];m=+g[r+4>>2]*+h[i>>3];k=r+12|0;j=+h[i+16>>3]}j=+g[k>>2]*j;g[a+44>>2]=m;g[a+48>>2]=l;g[a+52>>2]=j;g[a+56>>2]=0.0;switch(o|0){case 3:{i=e[n+2>>1]|0;break}case 2:{i=c[n+4>>2]|0;break}default:i=d[n+1>>0]|0}i=p+(J(q,i)|0)|0;if(s){k=i+8|0;l=+g[i+4>>2]*+g[r+8>>2];m=+g[i>>2]*+g[r+4>>2];j=+g[r+12>>2]}else{k=r+12|0;l=+g[r+8>>2]*+h[i+8>>3];m=+g[r+4>>2]*+h[i>>3];j=+h[i+16>>3]}j=+g[k>>2]*j;g[a+28>>2]=m;g[a+32>>2]=l;g[a+36>>2]=j;g[a+40>>2]=0.0;switch(o|0){case 3:{i=e[n>>1]|0;break}case 2:{i=c[n>>2]|0;break}default:i=d[n>>0]|0}i=p+(J(q,i)|0)|0;if(s){l=+g[i+4>>2]*+g[r+8>>2];j=+g[i>>2]*+g[r+4>>2];q=i+8|0;m=+g[r+12>>2];u=+g[q>>2];m=u*m;r=a+12|0;g[r>>2]=j;r=a+16|0;g[r>>2]=l;r=a+20|0;g[r>>2]=m;r=a+24|0;g[r>>2]=0.0;r=a+8|0;r=c[r>>2]|0;q=c[r>>2]|0;q=q+8|0;q=c[q>>2]|0;s=a+12|0;ab[q&127](r,s,b,f);s=c[a+4>>2]|0;r=c[s>>2]|0;r=r+24|0;r=c[r>>2]|0;Va[r&127](s,b);sa=t;return}else{m=+g[r+8>>2]*+h[i+8>>3];l=+g[r+4>>2]*+h[i>>3];r=r+12|0;u=+h[i+16>>3];j=+g[r>>2];u=j*u;r=a+12|0;g[r>>2]=l;r=a+16|0;g[r>>2]=m;r=a+20|0;g[r>>2]=u;r=a+24|0;g[r>>2]=0.0;r=a+8|0;r=c[r>>2]|0;q=c[r>>2]|0;q=q+8|0;q=c[q>>2]|0;s=a+12|0;ab[q&127](r,s,b,f);s=c[a+4>>2]|0;r=c[s>>2]|0;r=r+24|0;r=c[r>>2]|0;Va[r&127](s,b);sa=t;return}}function re(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;f=c[b+748>>2]|0;if((f|0)<=0)return;do{j=f;f=f+-1|0;p=+g[b+4+(f*184|0)>>2];q=+g[b+4+(f*184|0)+4>>2];h=+g[b+4+(f*184|0)+8>>2];o=p*+g[d>>2]+q*+g[d+4>>2]+h*+g[d+8>>2]+ +g[d+48>>2];m=p*+g[d+16>>2]+q*+g[d+20>>2]+h*+g[d+24>>2]+ +g[d+52>>2];h=p*+g[d+32>>2]+q*+g[d+36>>2]+h*+g[d+40>>2]+ +g[d+56>>2];g[b+4+(f*184|0)+48>>2]=o;g[b+4+(f*184|0)+52>>2]=m;g[b+4+(f*184|0)+56>>2]=h;g[b+4+(f*184|0)+60>>2]=0.0;q=+g[b+4+(f*184|0)+16>>2];p=+g[b+4+(f*184|0)+20>>2];i=+g[b+4+(f*184|0)+24>>2];n=q*+g[e>>2]+p*+g[e+4>>2]+i*+g[e+8>>2]+ +g[e+48>>2];l=q*+g[e+16>>2]+p*+g[e+20>>2]+i*+g[e+24>>2]+ +g[e+52>>2];i=q*+g[e+32>>2]+p*+g[e+36>>2]+i*+g[e+40>>2]+ +g[e+56>>2];g[b+4+(f*184|0)+32>>2]=n;g[b+4+(f*184|0)+36>>2]=l;g[b+4+(f*184|0)+40>>2]=i;g[b+4+(f*184|0)+44>>2]=0.0;g[b+4+(f*184|0)+80>>2]=(o-n)*+g[b+4+(f*184|0)+64>>2]+(m-l)*+g[b+4+(f*184|0)+68>>2]+(h-i)*+g[b+4+(f*184|0)+72>>2];k=b+4+(f*184|0)+148|0;c[k>>2]=(c[k>>2]|0)+1}while((j|0)>1);f=c[b+748>>2]|0;if((f|0)<=0)return;j=f;do{e=j;j=j+-1|0;d=b+4+(j*184|0)|0;h=+g[b+4+(j*184|0)+80>>2];i=+g[b+752>>2];if(h<=i){o=+g[b+4+(j*184|0)+32>>2]-(+g[b+4+(j*184|0)+48>>2]-+g[b+4+(j*184|0)+64>>2]*h);p=+g[b+4+(j*184|0)+36>>2]-(+g[b+4+(j*184|0)+52>>2]-h*+g[b+4+(j*184|0)+68>>2]);q=+g[b+4+(j*184|0)+40>>2]-(+g[b+4+(j*184|0)+56>>2]-h*+g[b+4+(j*184|0)+72>>2]);if(o*o+p*p+q*q>i*i){f=f+-1|0;if((f|0)==(j|0))f=j;else{Bh(d|0,b+4+(f*184|0)|0,184)|0;c[b+4+(f*184|0)+112>>2]=0;g[b+4+(f*184|0)+120>>2]=0.0;a[b+4+(f*184|0)+116>>0]=0;g[b+4+(f*184|0)+124>>2]=0.0;g[b+4+(f*184|0)+128>>2]=0.0;c[b+4+(f*184|0)+148>>2]=0;f=(c[b+748>>2]|0)+-1|0}c[b+748>>2]=f}}else{f=f+-1|0;if((f|0)==(j|0))f=j;else{Bh(d|0,b+4+(f*184|0)|0,184)|0;c[b+4+(f*184|0)+112>>2]=0;g[b+4+(f*184|0)+120>>2]=0.0;a[b+4+(f*184|0)+116>>0]=0;g[b+4+(f*184|0)+124>>2]=0.0;g[b+4+(f*184|0)+128>>2]=0.0;c[b+4+(f*184|0)+148>>2]=0;f=(c[b+748>>2]|0)+-1|0}c[b+748>>2]=f}}while((e|0)>1);return}function se(b){b=b|0;var d=0,e=0;c[b>>2]=8032;if(a[b+20>>0]|0){d=c[b+16>>2]|0;e=c[d+16>>2]|0;if(e){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+16>>2]|0}if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}}if(a[b+12>>0]|0){d=c[b+8>>2]|0;e=c[d+16>>2]|0;if(e){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+8>>2]|0}if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}}d=c[b+32>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+32>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+36>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+36>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+40>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+40>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+44>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+44>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+48>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+48>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+52>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+52>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+56>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+56>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+60>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+60>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+76>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+76>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+80>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+80>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+72>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+72>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+88>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+88>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+84>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+84>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+24>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+28>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+28>>2]|0;if(!d)return;c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);return} -function vb(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var h=0.0,i=0.0,k=0,l=0,m=0.0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0,E=0,G=0,H=0,I=0,K=0.0,L=0.0,M=0.0,N=0.0,O=0,P=0,Q=0,R=0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0,ba=0.0,ca=0.0,da=0.0,ea=0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0.0,ma=0.0,na=0.0,oa=0.0,pa=0.0,qa=0.0,ra=0.0,ta=0.0,ua=0.0,wa=0.0,xa=0.0,ya=0.0,za=0.0,Aa=0.0,Ba=0.0,Ca=0.0,Da=0,Ea=0,Fa=0;Fa=sa;sa=sa+480|0;c[Fa+48>>2]=c[b>>2];c[Fa>>2]=c[b+64>>2];f=Fa+48+4|0;c[f>>2]=c[b+4>>2];c[Fa+4>>2]=c[b+68>>2];e=Fa+48+8|0;c[e>>2]=c[b+8>>2];c[Fa+8>>2]=c[b+72>>2];E=Fa+48+16|0;c[E>>2]=c[b+16>>2];c[Fa+16>>2]=c[b+80>>2];k=Fa+48+20|0;c[k>>2]=c[b+20>>2];c[Fa+20>>2]=c[b+84>>2];n=Fa+48+24|0;c[n>>2]=c[b+24>>2];c[Fa+24>>2]=c[b+88>>2];D=Fa+48+32|0;c[D>>2]=c[b+32>>2];c[Fa+32>>2]=c[b+96>>2];Q=Fa+48+36|0;c[Q>>2]=c[b+36>>2];c[Fa+36>>2]=c[b+100>>2];l=Fa+48+40|0;c[l>>2]=c[b+40>>2];c[Fa+40>>2]=c[b+104>>2];Ea=c[a+4>>2]|0;ta=+g[Ea+28>>2];ua=+g[Ea+32>>2];ya=+g[Ea+36>>2];wa=+va[c[(c[Ea>>2]|0)+48>>2]&15](Ea);xa=+va[c[(c[Ea>>2]|0)+48>>2]&15](Ea);ya=(ya+ +va[c[(c[Ea>>2]|0)+48>>2]&15](Ea))*2.0;Ea=c[a+8>>2]|0;za=+g[Ea+28>>2];Aa=+g[Ea+32>>2];V=+g[Ea+36>>2];Ba=+va[c[(c[Ea>>2]|0)+48>>2]&15](Ea);Ca=+va[c[(c[Ea>>2]|0)+48>>2]&15](Ea);V=(V+ +va[c[(c[Ea>>2]|0)+48>>2]&15](Ea))*2.0;ba=+g[b+112>>2]-+g[b+48>>2];ca=+g[b+116>>2]-+g[b+52>>2];da=+g[b+120>>2]-+g[b+56>>2];ra=+g[Fa+48>>2];oa=+g[E>>2];pa=+g[D>>2];la=+g[f>>2];ja=+g[k>>2];ka=+g[Q>>2];L=+g[e>>2];C=+g[n>>2];K=+g[l>>2];g[Fa+468>>2]=(ta+wa)*2.0*.5;g[Fa+468+4>>2]=(ua+xa)*2.0*.5;g[Fa+468+8>>2]=ya*.5;g[Fa+456>>2]=(za+Ba)*2.0*.5;g[Fa+456+4>>2]=(Aa+Ca)*2.0*.5;g[Fa+456+8>>2]=V*.5;U=+g[Fa>>2];S=+g[Fa+16>>2];T=+g[Fa+32>>2];$=+g[Fa+4>>2];Z=+g[Fa+20>>2];_=+g[Fa+36>>2];qa=+g[Fa+8>>2];ma=+g[Fa+24>>2];na=+g[Fa+40>>2];M=+w(+(ra*U+oa*S+pa*T));W=+w(+(ra*$+oa*Z+pa*_));fa=+w(+(ra*qa+oa*ma+pa*na));N=+w(+(la*U+ja*S+ka*T));X=+w(+(la*$+ja*Z+ka*_));ga=+w(+(la*qa+ja*ma+ka*na));ha=+w(+(L*U+C*S+K*T));ia=+w(+(L*$+C*Z+K*_));Y=+w(+(L*qa+C*ma+K*na));o=+w(+(ba*ra+ca*oa+da*pa))-((ta+wa)*2.0*.5+(za+Ba)*2.0*.5*M+(Aa+Ca)*2.0*.5*W+V*.5*fa);if(o>0.0){sa=Fa;return}if(o>-3402823466385288598117041.0e14){G=Fa+48|0;a=1;H=ba*ra+ca*oa+da*pa<0.0&1}else{G=0;a=0;H=0;o=-3402823466385288598117041.0e14}h=+w(+(ba*la+ca*ja+da*ka))-((ua+xa)*2.0*.5+(za+Ba)*2.0*.5*N+(Aa+Ca)*2.0*.5*X+V*.5*ga);if(h>0.0){sa=Fa;return}if(h>o){G=f;a=2;H=ba*la+ca*ja+da*ka<0.0&1;o=h}h=+w(+(ba*L+ca*C+da*K))-(ya*.5+(za+Ba)*2.0*.5*ha+(Aa+Ca)*2.0*.5*ia+V*.5*Y);if(h>0.0){sa=Fa;return}if(h>o){G=e;a=3;H=ba*L+ca*C+da*K<0.0&1;o=h}h=+w(+(ba*U+ca*S+da*T))-((za+Ba)*2.0*.5+(ya*.5*ha+((ta+wa)*2.0*.5*M+(ua+xa)*2.0*.5*N)));if(h>0.0){sa=Fa;return}if(h>o){G=Fa;a=4;H=ba*U+ca*S+da*T<0.0&1;o=h}h=+w(+(ba*$+ca*Z+da*_))-((Aa+Ca)*2.0*.5+(ya*.5*ia+((ta+wa)*2.0*.5*W+(ua+xa)*2.0*.5*X)));if(h>0.0){sa=Fa;return}if(h>o){G=Fa+4|0;a=5;H=ba*$+ca*Z+da*_<0.0&1;o=h}h=+w(+(ba*qa+ca*ma+da*na))-(V*.5+(ya*.5*Y+((ta+wa)*2.0*.5*fa+(ua+xa)*2.0*.5*ga)));if(h>0.0){sa=Fa;return}if(h>o){G=Fa+8|0;a=6;H=ba*qa+ca*ma+da*na<0.0&1;o=h}h=(ba*L+ca*C+da*K)*(la*U+ja*S+ka*T)-(ba*la+ca*ja+da*ka)*(L*U+C*S+K*T);i=+w(+h)-(V*.5*(W+9.999999747378752e-06)+((ua+xa)*2.0*.5*(ha+9.999999747378752e-06)+ya*.5*(N+9.999999747378752e-06)+(Aa+Ca)*2.0*.5*(fa+9.999999747378752e-06)));if(i>1.1920928955078125e-07){sa=Fa;return}s=(L*U+C*S+K*T)*(L*U+C*S+K*T)+0.0;z=(la*U+ja*S+ka*T)*(la*U+ja*S+ka*T);p=+x(+(z+s));if(p>1.1920928955078125e-07?i/p*1.0499999523162842>o:0){G=0;a=7;H=h<0.0&1;o=i/p;m=0.0/p;i=-(L*U+C*S+K*T)/p;h=(la*U+ja*S+ka*T)/p}else{m=0.0;i=0.0;h=0.0}p=(ba*L+ca*C+da*K)*(la*$+ja*Z+ka*_)-(ba*la+ca*ja+da*ka)*(L*$+C*Z+K*_);q=+w(+p)-(V*.5*(M+9.999999747378752e-06)+((ua+xa)*2.0*.5*(ia+9.999999747378752e-06)+ya*.5*(X+9.999999747378752e-06)+(za+Ba)*2.0*.5*(fa+9.999999747378752e-06)));if(q>1.1920928955078125e-07){sa=Fa;return}t=(L*$+C*Z+K*_)*(L*$+C*Z+K*_)+0.0;A=(la*$+ja*Z+ka*_)*(la*$+ja*Z+ka*_);r=+x(+(A+t));if(r>1.1920928955078125e-07?q/r*1.0499999523162842>o:0){G=0;a=8;H=p<0.0&1;o=q/r;m=0.0/r;i=-(L*$+C*Z+K*_)/r;h=(la*$+ja*Z+ka*_)/r}p=(ba*L+ca*C+da*K)*(la*qa+ja*ma+ka*na)-(ba*la+ca*ja+da*ka)*(L*qa+C*ma+K*na);q=+w(+p)-((Aa+Ca)*2.0*.5*(M+9.999999747378752e-06)+((za+Ba)*2.0*.5*(W+9.999999747378752e-06)+((ua+xa)*2.0*.5*(Y+9.999999747378752e-06)+ya*.5*(ga+9.999999747378752e-06))));if(q>1.1920928955078125e-07){sa=Fa;return}v=(L*qa+C*ma+K*na)*(L*qa+C*ma+K*na)+0.0;B=(la*qa+ja*ma+ka*na)*(la*qa+ja*ma+ka*na);r=+x(+(B+v));if(r>1.1920928955078125e-07?q/r*1.0499999523162842>o:0){G=0;a=9;H=p<0.0&1;o=q/r;m=0.0/r;i=-(L*qa+C*ma+K*na)/r;h=(la*qa+ja*ma+ka*na)/r}p=(ba*ra+ca*oa+da*pa)*(L*U+C*S+K*T)-(ba*L+ca*C+da*K)*(ra*U+oa*S+pa*T);q=+w(+p)-(V*.5*(X+9.999999747378752e-06)+((ta+wa)*2.0*.5*(ha+9.999999747378752e-06)+ya*.5*(M+9.999999747378752e-06)+(Aa+Ca)*2.0*.5*(ga+9.999999747378752e-06)));if(q>1.1920928955078125e-07){sa=Fa;return}y=(ra*U+oa*S+pa*T)*(ra*U+oa*S+pa*T);r=+x(+(y+s));do if(r>1.1920928955078125e-07){if(!(q/r*1.0499999523162842>o))break;G=0;a=10;H=p<0.0&1;o=q/r;m=(L*U+C*S+K*T)/r;i=0.0/r;h=-(ra*U+oa*S+pa*T)/r}while(0);p=(ba*ra+ca*oa+da*pa)*(L*$+C*Z+K*_)-(ba*L+ca*C+da*K)*(ra*$+oa*Z+pa*_);q=+w(+p)-(V*.5*(N+9.999999747378752e-06)+((ta+wa)*2.0*.5*(ia+9.999999747378752e-06)+ya*.5*(W+9.999999747378752e-06)+(za+Ba)*2.0*.5*(ga+9.999999747378752e-06)));if(q>1.1920928955078125e-07){sa=Fa;return}u=(ra*$+oa*Z+pa*_)*(ra*$+oa*Z+pa*_);r=+x(+(u+t));do if(r>1.1920928955078125e-07){if(!(q/r*1.0499999523162842>o))break;G=0;a=11;H=p<0.0&1;o=q/r;m=(L*$+C*Z+K*_)/r;i=0.0/r;h=-(ra*$+oa*Z+pa*_)/r}while(0);p=(ba*ra+ca*oa+da*pa)*(L*qa+C*ma+K*na)-(ba*L+ca*C+da*K)*(ra*qa+oa*ma+pa*na);q=+w(+p)-((Aa+Ca)*2.0*.5*(N+9.999999747378752e-06)+((za+Ba)*2.0*.5*(X+9.999999747378752e-06)+((ta+wa)*2.0*.5*(Y+9.999999747378752e-06)+ya*.5*(fa+9.999999747378752e-06))));if(q>1.1920928955078125e-07){sa=Fa;return}s=(ra*qa+oa*ma+pa*na)*(ra*qa+oa*ma+pa*na);r=+x(+(s+v));do if(r>1.1920928955078125e-07){if(!(q/r*1.0499999523162842>o))break;G=0;a=12;H=p<0.0&1;o=q/r;m=(L*qa+C*ma+K*na)/r;i=0.0/r;h=-(ra*qa+oa*ma+pa*na)/r}while(0);q=(ba*la+ca*ja+da*ka)*(ra*U+oa*S+pa*T)-(ba*ra+ca*oa+da*pa)*(la*U+ja*S+ka*T);p=+w(+q)-(V*.5*(ia+9.999999747378752e-06)+((ta+wa)*2.0*.5*(N+9.999999747378752e-06)+(ua+xa)*2.0*.5*(M+9.999999747378752e-06)+(Aa+Ca)*2.0*.5*(Y+9.999999747378752e-06)));if(p>1.1920928955078125e-07){sa=Fa;return}r=+x(+(z+y+0.0));do if(r>1.1920928955078125e-07){if(!(p/r*1.0499999523162842>o))break;G=0;a=13;H=q<0.0&1;o=p/r;m=-(la*U+ja*S+ka*T)/r;i=(ra*U+oa*S+pa*T)/r;h=0.0/r}while(0);r=(ba*la+ca*ja+da*ka)*(ra*$+oa*Z+pa*_)-(ba*ra+ca*oa+da*pa)*(la*$+ja*Z+ka*_);p=+w(+r)-(V*.5*(ha+9.999999747378752e-06)+((ta+wa)*2.0*.5*(X+9.999999747378752e-06)+(ua+xa)*2.0*.5*(W+9.999999747378752e-06)+(za+Ba)*2.0*.5*(Y+9.999999747378752e-06)));if(p>1.1920928955078125e-07){sa=Fa;return}q=+x(+(A+u+0.0));do if(q>1.1920928955078125e-07){if(!(p/q*1.0499999523162842>o))break;G=0;a=14;H=r<0.0&1;o=p/q;m=-(la*$+ja*Z+ka*_)/q;i=(ra*$+oa*Z+pa*_)/q;h=0.0/q}while(0);r=(ba*la+ca*ja+da*ka)*(ra*qa+oa*ma+pa*na)-(ba*ra+ca*oa+da*pa)*(la*qa+ja*ma+ka*na);p=+w(+r)-((Aa+Ca)*2.0*.5*(ha+9.999999747378752e-06)+((za+Ba)*2.0*.5*(ia+9.999999747378752e-06)+((ta+wa)*2.0*.5*(ga+9.999999747378752e-06)+(ua+xa)*2.0*.5*(fa+9.999999747378752e-06))));if(p>1.1920928955078125e-07){sa=Fa;return}q=+x(+(B+s+0.0));do if(q>1.1920928955078125e-07){if(!(p/q*1.0499999523162842>o)){O=55;break}a=15;H=r<0.0&1;o=p/q;m=-(la*qa+ja*ma+ka*na)/q;i=(ra*qa+oa*ma+pa*na)/q;h=0.0/q;O=58}else O=55;while(0);do if((O|0)==55){if(!a){sa=Fa;return}if(!G){O=58;break}Da=c[G>>2]|0;I=c[G+16>>2]|0;Ea=c[G+32>>2]|0;h=(c[j>>2]=Da,+g[j>>2]);i=(c[j>>2]=I,+g[j>>2]);P=a;N=o;a=Da;G=I;I=Ea;m=(c[j>>2]=Ea,+g[j>>2])}while(0);if((O|0)==58){qa=ra*m+i*+g[f>>2]+h*+g[e>>2];I=(g[j>>2]=qa,c[j>>2]|0);ra=m*+g[E>>2]+i*+g[k>>2]+h*+g[n>>2];G=(g[j>>2]=ra,c[j>>2]|0);m=m*+g[D>>2]+i*+g[Q>>2]+h*+g[l>>2];P=a;N=o;a=I;I=(g[j>>2]=m,c[j>>2]|0);h=qa;i=ra}if(H){a=(g[j>>2]=-h,c[j>>2]|0);G=(g[j>>2]=-i,c[j>>2]|0);I=(g[j>>2]=-m,c[j>>2]|0)}if((P|0)>6){M=(c[j>>2]=a,+g[j>>2]);L=(c[j>>2]=G,+g[j>>2]);K=(c[j>>2]=I,+g[j>>2]);t=+g[Fa+48>>2];v=+g[E>>2];p=+g[D>>2];h=(t*M+v*L+p*K>0.0?1.0:-1.0)*(ta+wa)*2.0*.5;i=+g[f>>2];u=+g[k>>2];s=+g[Q>>2];z=(i*M+u*L+s*K>0.0?1.0:-1.0)*(ua+xa)*2.0*.5;A=+g[e>>2];B=+g[n>>2];C=+g[l>>2];m=(A*M+B*L+C*K>0.0?1.0:-1.0)*ya*.5;A=+g[b+48>>2]+h*t+z*i+m*A;B=+g[b+52>>2]+h*v+z*u+m*B;C=+g[b+56>>2]+h*p+z*s+m*C;c[Fa+352>>2]=c[b+112>>2];c[Fa+352+4>>2]=c[b+112+4>>2];c[Fa+352+8>>2]=c[b+112+8>>2];m=+g[Fa>>2];s=+g[Fa+16>>2];z=+g[Fa+32>>2];p=(m*M+s*L+z*K>0.0?-1.0:1.0)*(za+Ba)*2.0*.5;h=+g[Fa+4>>2];u=+g[Fa+20>>2];v=+g[Fa+36>>2];i=(h*M+u*L+v*K>0.0?-1.0:1.0)*(Aa+Ca)*2.0*.5;u=+g[Fa+352+4>>2]+p*s+i*u;v=+g[Fa+352+8>>2]+p*z+i*v;z=+g[Fa+8>>2];s=+g[Fa+24>>2];t=+g[Fa+40>>2];y=(z*M+s*L+t*K>0.0?-1.0:1.0)*+g[Fa+456+8>>2];z=+g[Fa+352>>2]+p*m+i*h+y*z;g[Fa+352>>2]=z;g[Fa+352+4>>2]=u+y*s;g[Fa+352+8>>2]=v+y*t;Ea=P+-7|0;h=+g[Fa+48+(((Ea|0)/3|0)<<2)>>2];i=+g[Fa+48+(((Ea|0)/3|0)+4<<2)>>2];m=+g[Fa+48+(((Ea|0)/3|0)+8<<2)>>2];Ea=Ea+(J((Ea|0)/3|0,-3)|0)|0;p=+g[Fa+(Ea<<2)>>2];q=+g[Fa+(Ea+4<<2)>>2];r=+g[Fa+(Ea+8<<2)>>2];o=1.0-(h*p+i*q+m*r)*(h*p+i*q+m*r);if(!(o<=9.999999747378752e-05))h=(((z-A)*h+(u+y*s-B)*i+(v+y*t-C)*m)*(h*p+i*q+m*r)-((z-A)*p+(u+y*s-B)*q+(v+y*t-C)*r))*(1.0/o);else h=0.0;g[Fa+352>>2]=z+h*p;g[Fa+352+4>>2]=u+y*s+h*q;g[Fa+352+8>>2]=v+y*t+h*r;Ea=c[(c[d>>2]|0)+16>>2]|0;g[Fa+320>>2]=-M;g[Fa+320+4>>2]=-L;g[Fa+320+8>>2]=-K;g[Fa+320+12>>2]=0.0;_a[Ea&15](d,Fa+320|0,Fa+352|0,N);sa=Fa;return}Da=(P|0)<4;fa=(c[j>>2]=a,+g[j>>2]);if(Da){ca=(c[j>>2]=G,+g[j>>2]);O=Fa+456|0;aa=Fa+468|0;H=b+112|0;Ea=b+48|0;E=Fa+16|0;D=Fa+32|0;ea=Fa;b=Fa+48|0;n=Fa+24|0;l=Fa+40|0;k=Fa+20|0;a=Fa+36|0;f=Fa+4|0;e=Fa+8|0;ba=fa;da=(c[j>>2]=I,+g[j>>2])}else{ca=-(c[j>>2]=G,+g[j>>2]);O=Fa+468|0;aa=Fa+456|0;H=b+48|0;Ea=b+112|0;ea=Fa+48|0;b=Fa;a=Q;ba=-fa;da=-(c[j>>2]=I,+g[j>>2])}v=ba*+g[ea>>2]+ca*+g[E>>2]+da*+g[D>>2];g[Fa+440>>2]=v;y=ba*+g[f>>2]+ca*+g[k>>2]+da*+g[a>>2];g[Fa+440+4>>2]=y;z=ba*+g[e>>2]+ca*+g[n>>2]+da*+g[l>>2];g[Fa+440+8>>2]=z;v=+w(+v);y=+w(+y);z=+w(+z);e=y>v?(y>z?1:2):v>z?0:2;R=(y>v?y>z:v>z)?2:1;m=+g[O+(e<<2)>>2];h=+g[H>>2]-+g[Ea>>2];i=m*+g[ea+(e<<2)>>2];if(+g[Fa+440+(e<<2)>>2]<0.0){$=+g[H+8>>2]-+g[Ea+8>>2]+m*+g[ea+((e|8)<<2)>>2];_=h+i;Z=+g[H+4>>2]-+g[Ea+4>>2]+m*+g[ea+((e|4)<<2)>>2]}else{$=+g[H+8>>2]-+g[Ea+8>>2]-m*+g[ea+((e|8)<<2)>>2];_=h-i;Z=+g[H+4>>2]-+g[Ea+4>>2]-m*+g[ea+((e|4)<<2)>>2]}P=(Da?-1:-4)+P|0;switch(P|0){case 0:{f=2;e=1;break}case 1:{f=2;e=0;break}default:{f=1;e=0}}Q=b+(e<<2)|0;X=+g[Q>>2];V=+g[Q+16>>2];W=+g[Q+32>>2];Y=_*X+Z*V+$*W;b=b+(f<<2)|0;N=+g[b>>2];A=+g[b+16>>2];B=+g[b+32>>2];U=_*N+Z*A+$*B;b=ea+((v>z&(y>v^1)&1)<<2)|0;T=+g[b>>2];L=+g[b+16>>2];M=+g[b+32>>2];Q=ea+(R<<2)|0;S=+g[Q>>2];C=+g[Q+16>>2];K=+g[Q+32>>2];u=+g[O+((v>z&(y>v^1)&1)<<2)>>2];t=+g[O+(R<<2)>>2];s=(X*S+V*C+W*K)*t;t=(N*S+A*C+B*K)*t;q=Y-(X*T+V*L+W*M)*u-s;r=U-(N*T+A*L+B*M)*u-t;h=Y-(X*T+V*L+W*M)*u+s;g[Fa+416>>2]=h;m=U-(N*T+A*L+B*M)*u+t;o=Y+(X*T+V*L+W*M)*u+s;p=U+(N*T+A*L+B*M)*u+t;s=Y+(X*T+V*L+W*M)*u-s;t=U+(N*T+A*L+B*M)*u-t;E=c[aa+(e<<2)>>2]|0;H=c[aa+(f<<2)>>2]|0;u=(c[j>>2]=E,+g[j>>2]);do if(!(u>-q))if(u>-h){f=Fa+256|0;e=1;a=1;i=-h;O=78}else{f=Fa+256|0;e=0;i=-h;O=153}else{g[Fa+256>>2]=q;g[Fa+256+4>>2]=r;if(!(u>-h)){f=Fa+256+8|0;e=2;a=u>-h;i=-h;O=78;break}g[Fa+256+8>>2]=h;g[Fa+256+8+4>>2]=m;f=Fa+256+8|0;e=2;O=152}while(0);do if((O|0)==78){g[f+4>>2]=r+(-u-q)*((m-r)/(h-q));g[f>>2]=-u;f=f+8|0;if(!a){O=153;break}g[f>>2]=h;g[f+4>>2]=m;if(!(e+1&8)){e=e+1|0;O=152}else{e=e+1|0;O=102}}while(0);if((O|0)==152){h=+g[Fa+416>>2];f=f+8|0;i=-h;O=153}a:do if((O|0)==153){if(i-o){g[f+4>>2]=m+(-u-h)*((p-m)/(o-h));g[f>>2]=-u;e=e+1|0;if(!(e&8))f=f+8|0;else{O=102;break}}if(u>-o){g[f>>2]=o;g[f+4>>2]=p;e=e+1|0;if(e&8|0){O=102;break}f=f+8|0;if(u>-o^u>-s){a=u>-s;O=159}else{a=u>-s;O=161}}else if(u>-o^u>-s){a=u>-s;O=159}else{a=u>-s;O=161}if((O|0)==159){g[f+4>>2]=p+(-u-o)*((t-p)/(s-o));g[f>>2]=-u;e=e+1|0;if(e&8|0){O=102;break}f=f+8|0;if(a)O=162;else O=163}else if((O|0)==161)if(a)O=162;else O=163;do if((O|0)==162){g[f>>2]=s;g[f+4>>2]=t;e=e+1|0;if(e&8|0){O=102;break a}if(a^u>-q){f=f+8|0;O=165}else O=167}else if((O|0)==163){if(u>-q){O=165;break}if((e|0)>0)O=167;else{e=0;O=79}}while(0);if((O|0)==165){g[f+4>>2]=t+(-u-s)*((r-t)/(q-s));g[f>>2]=-u;e=e+1|0;if(!(e&8))O=167;else{O=102;break}}b:do if((O|0)==167){a=Fa+352|0;D=Fa+256|0;f=0;while(1){h=+g[D>>2];if(h>2]=h;c[a+4>>2]=c[D+4>>2];f=f+1|0;if(f&8|0){e=f;O=79;break b}a=a+8|0;h=+g[D>>2]}n=(e|0)>1;k=D;D=D+8|0;l=n?D:Fa+256|0;i=+g[l>>2];if(h>2];g[a+4>>2]=Ca+(u-h)*((+g[l+4>>2]-Ca)/(i-h));c[a>>2]=E;f=f+1|0;if(!(f&8))a=a+8|0;else{e=f;O=79;break b}}if(!n)break;else e=e+-1|0}if((f|0)<=0){e=0;O=79;break}o=(c[j>>2]=H,+g[j>>2]);a=Fa+256|0;D=Fa+352|0;e=0;while(1){k=D+4|0;h=+g[k>>2];if(o>-h){c[a>>2]=c[D>>2];c[a+4>>2]=c[k>>2];e=e+1|0;if(e&8|0)break b;h=+g[k>>2];a=a+8|0;m=-h}else m=-h;n=(f|0)>1;k=D;D=D+8|0;l=n?D:Fa+352|0;i=+g[l+4>>2];if(m-i){Ca=+g[k>>2];g[a>>2]=Ca+(-o-h)*((+g[l>>2]-Ca)/(i-h));g[a+4>>2]=-o;e=e+1|0;if(!(e&8))a=a+8|0;else break b}if(!n)break;else f=f+-1|0}if((e|0)<=0){e=0;O=79;break}n=e;f=Fa+352|0;D=Fa+256|0;e=0;while(1){a=D+4|0;h=+g[a>>2];if(h>2]=c[D>>2];c[f+4>>2]=c[a>>2];e=e+1|0;if(e&8|0){O=79;break b}f=f+8|0;h=+g[a>>2]}l=(n|0)>1;a=D;D=D+8|0;k=l?D:Fa+256|0;i=+g[k+4>>2];if(h>2];g[f>>2]=Ca+(o-h)*((+g[k>>2]-Ca)/(i-h));c[f+4>>2]=H;e=e+1|0;if(!(e&8))f=f+8|0;else{O=79;break b}}if(!l){O=79;break}else n=n+-1|0}}while(0);if((O|0)==79)Bh(Fa+256|0,Fa+352|0,e<<3|0)|0;if((e|0)>=1)O=104}while(0);if((O|0)==102)O=104;if((O|0)==104){u=1.0/((X*T+V*L+W*M)*(N*S+A*C+B*K)-(N*T+A*L+B*M)*(X*S+V*C+W*K));t=+g[aa+(P<<2)>>2];s=+g[b>>2];p=+g[Q>>2];q=+g[ea+((v>z&(y>v^1)&1|4)<<2)>>2];r=+g[ea+((R|4)<<2)>>2];o=+g[ea+((v>z&(y>v^1)&1|8)<<2)>>2];m=+g[ea+((R|8)<<2)>>2];n=0;a=0;do{f=a<<1;h=+g[Fa+256+(f<<2)>>2];i=+g[Fa+256+((f|1)<<2)>>2];za=(N*S+A*C+B*K)*u*(h-Y)-(X*S+V*C+W*K)*u*(i-U);Ca=(X*T+V*L+W*M)*u*(i-U)-(N*T+A*L+B*M)*u*(h-Y);f=n*3|0;Aa=_+za*s+Ca*p;g[Fa+160+(f<<2)>>2]=Aa;Ba=Z+za*q+Ca*r;g[Fa+160+(f+1<<2)>>2]=Ba;Ca=$+za*o+Ca*m;g[Fa+160+(f+2<<2)>>2]=Ca;Ca=t-(ba*Aa+ca*Ba+da*Ca);g[Fa+128+(n<<2)>>2]=Ca;f=n<<1;if(Ca>=0.0){g[Fa+256+(f<<2)>>2]=h;g[Fa+256+((f|1)<<2)>>2]=i;n=n+1|0}a=a+1|0}while((a|0)!=(e|0));c:do if((n|0)>=1){D=(n|0)<4?n:4;E=(D|0)>1?D:1;if((n|0)<=(E|0))if(Da){f=Ea+4|0;a=Ea+8|0;i=-(c[j>>2]=G,+g[j>>2]);h=-(c[j>>2]=I,+g[j>>2]);e=0;while(1){Da=e*3|0;g[Fa+352>>2]=+g[Fa+160+(Da<<2)>>2]+ +g[Ea>>2];g[Fa+352+4>>2]=+g[Fa+160+(Da+1<<2)>>2]+ +g[f>>2];g[Fa+352+8>>2]=+g[Fa+160+(Da+2<<2)>>2]+ +g[a>>2];Da=c[(c[d>>2]|0)+16>>2]|0;g[Fa+320>>2]=-fa;g[Fa+320+4>>2]=i;g[Fa+320+8>>2]=h;g[Fa+320+12>>2]=0.0;_a[Da&15](d,Fa+320|0,Fa+352|0,-+g[Fa+128+(e<<2)>>2]);e=e+1|0;if((e|0)==(n|0))break c}}else{f=Ea+4|0;a=Ea+8|0;i=(c[j>>2]=G,+g[j>>2]);h=(c[j>>2]=I,+g[j>>2]);e=0;while(1){Da=e*3|0;Ca=+g[Fa+128+(e<<2)>>2];g[Fa+352>>2]=+g[Fa+160+(Da<<2)>>2]+ +g[Ea>>2]-Ca*fa;g[Fa+352+4>>2]=+g[Fa+160+(Da+1<<2)>>2]+ +g[f>>2]-Ca*i;g[Fa+352+8>>2]=+g[Fa+160+(Da+2<<2)>>2]+ +g[a>>2]-Ca*h;Da=c[(c[d>>2]|0)+16>>2]|0;g[Fa+320>>2]=-fa;g[Fa+320+4>>2]=-i;g[Fa+320+8>>2]=-h;g[Fa+320+12>>2]=0.0;_a[Da&15](d,Fa+320|0,Fa+352|0,-Ca);e=e+1|0;if((e|0)==(n|0))break c}}d:do if((n|0)>1){h=+g[Fa+128>>2];e=0;f=1;while(1){i=+g[Fa+128+(f<<2)>>2];a=i>h;e=a?f:e;f=f+1|0;if((f|0)==(n|0))break;else h=a?i:h}switch(n|0){case 1:{f=1;a=Fa+96|0;k=Fa+96|0;O=120;break d}case 2:{h=(+g[Fa+256+4>>2]+ +g[Fa+256+12>>2])*.5;i=(+g[Fa+256>>2]+ +g[Fa+256+8>>2])*.5;f=2;a=Fa+96|0;k=Fa+96|0;O=124;break d}default:{}}a=n+-1|0;r=0.0;s=0.0;h=0.0;f=0;do{ea=f<<1;za=+g[Fa+256+(ea<<2)>>2];Aa=+g[Fa+256+(ea+3<<2)>>2];Ba=+g[Fa+256+(ea+2<<2)>>2];Ca=+g[Fa+256+((ea|1)<<2)>>2];h=h+(za*Aa-Ba*Ca);s=s+(za+Ba)*(za*Aa-Ba*Ca);r=r+(Aa+Ca)*(za*Aa-Ba*Ca);f=f+1|0}while((f|0)!=(a|0));ea=n<<1;m=+g[Fa+256+(ea+-2<<2)>>2];o=+g[Fa+256+4>>2];p=+g[Fa+256>>2];q=+g[Fa+256+(ea+-1<<2)>>2];i=h+(m*o-p*q);ea=+w(+i)>1.1920928955078125e-07;i=ea?1.0/(i*3.0):999999984306749440.0;if((n|0)>0){h=(r+(o+q)*(m*o-p*q))*i;i=(s+(m+p)*(m*o-p*q))*i;a=Fa+96|0;k=Fa+96|0;l=Fa+352|0;O=127;break}l=e;e=Fa+96|0;f=0}else{e=0;f=n;a=Fa+96|0;k=Fa+96|0;O=120}while(0);if((O|0)==120){h=+g[Fa+256+4>>2];i=+g[Fa+256>>2];O=124}if((O|0)==124){n=f;l=Fa+352|0;O=127}if((O|0)==127){f=0;do{ea=f<<1;g[Fa+352+(f<<2)>>2]=+F(+(+g[Fa+256+((ea|1)<<2)>>2]-h),+(+g[Fa+256+(ea<<2)>>2]-i));f=f+1|0}while((f|0)!=(n|0));f=0;do{c[Fa+320+(f<<2)>>2]=1;f=f+1|0}while((f|0)!=(n|0));l=e;e=a;f=1}a=Fa+320+(l<<2)|0;c[a>>2]=0;c[e>>2]=l;e:do if((D|0)>1){o=+g[Fa+352+(l<<2)>>2];if(!f){e=1;f=Fa+96+4|0;while(1){c[f>>2]=l;c[a>>2]=0;e=e+1|0;if((e|0)==(E|0))break e;else f=f+4|0}}f=1;a=Fa+96+4|0;while(1){m=6.2831854820251465/+(E|0)*+(f|0)+o;m=m>3.1415927410125732?m+-6.2831854820251465:m;c[a>>2]=l;i=1.0e9;k=0;e=l;while(1){do if(!(c[Fa+320+(k<<2)>>2]|0))h=i;else{h=+w(+(+g[Fa+352+(k<<2)>>2]-m));h=h>3.1415927410125732?6.2831854820251465-h:h;if(!(h>2]=k;e=k}while(0);k=k+1|0;if((k|0)==(n|0))break;else i=h}c[Fa+320+(e<<2)>>2]=0;f=f+1|0;if((f|0)==(E|0))break;else a=a+4|0}}while(0);if((E|0)>0){f=Ea+4|0;a=Ea+8|0;i=(c[j>>2]=G,+g[j>>2]);h=(c[j>>2]=I,+g[j>>2]);if(Da){e=0;do{Da=c[Fa+96+(e<<2)>>2]|0;g[Fa+352>>2]=+g[Fa+160+(Da*3<<2)>>2]+ +g[Ea>>2];g[Fa+352+4>>2]=+g[Fa+160+((Da*3|0)+1<<2)>>2]+ +g[f>>2];g[Fa+352+8>>2]=+g[Fa+160+((Da*3|0)+2<<2)>>2]+ +g[a>>2];ea=c[(c[d>>2]|0)+16>>2]|0;g[Fa+320>>2]=-fa;g[Fa+320+4>>2]=-i;g[Fa+320+8>>2]=-h;g[Fa+320+12>>2]=0.0;_a[ea&15](d,Fa+320|0,Fa+352|0,-+g[Fa+128+(Da<<2)>>2]);e=e+1|0}while(e>>>0>>0)}else{e=0;do{ea=c[Fa+96+(e<<2)>>2]|0;za=+g[Fa+160+(ea*3<<2)>>2]+ +g[Ea>>2];g[Fa+352>>2]=za;Aa=+g[Fa+160+((ea*3|0)+1<<2)>>2]+ +g[f>>2];g[Fa+352+4>>2]=Aa;Ba=+g[Fa+160+((ea*3|0)+2<<2)>>2]+ +g[a>>2];g[Fa+352+8>>2]=Ba;Da=c[(c[d>>2]|0)+16>>2]|0;g[Fa+320>>2]=-fa;g[Fa+320+4>>2]=-i;g[Fa+320+8>>2]=-h;g[Fa+320+12>>2]=0.0;Ca=+g[Fa+128+(ea<<2)>>2];g[Fa+424>>2]=za-Ca*fa;g[Fa+424+4>>2]=Aa-Ca*i;g[Fa+424+8>>2]=Ba-Ca*h;g[Fa+424+12>>2]=0.0;_a[Da&15](d,Fa+320|0,Fa+424|0,-Ca);e=e+1|0}while(e>>>0>>0)}}}while(0)}sa=Fa;return}function wb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;var h=0,i=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0.0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0;P=sa;sa=sa+448|0;if(!(a[b+527>>0]|0)){sa=P;return}J=c[b+28>>2]|0;C=+g[b+348>>2];B=+g[b+352>>2];I=+g[b+356>>2];D=+g[J+52>>2];E=C*+g[J+4>>2]+B*+g[J+8>>2]+I*+g[J+12>>2]+D;F=+g[J+56>>2];G=C*+g[J+20>>2]+B*+g[J+24>>2]+I*+g[J+28>>2]+F;H=+g[J+60>>2];I=C*+g[J+36>>2]+B*+g[J+40>>2]+I*+g[J+44>>2]+H;K=c[b+32>>2]|0;B=+g[b+412>>2];C=+g[b+416>>2];s=+g[b+420>>2];k=+g[K+52>>2];l=B*+g[K+4>>2]+C*+g[K+8>>2]+s*+g[K+12>>2]+k;m=+g[K+56>>2];n=B*+g[K+20>>2]+C*+g[K+24>>2]+s*+g[K+28>>2]+m;r=+g[K+60>>2];s=B*+g[K+36>>2]+C*+g[K+40>>2]+s*+g[K+44>>2]+r;if(!(a[b+524>>0]|0)){A=+g[d+192>>2]+ +g[d+80>>2];B=+g[d+196>>2]+ +g[d+84>>2];z=+g[d+200>>2]+ +g[d+88>>2];C=+g[e+192>>2]+ +g[e+80>>2];w=+g[e+196>>2]+ +g[e+84>>2];u=+g[e+200>>2]+ +g[e+88>>2];t=+g[d+176>>2]+ +g[d+64>>2]+((I-H)*B-(G-F)*z)-(+g[e+176>>2]+ +g[e+64>>2]+((s-r)*w-(n-m)*u));u=+g[d+180>>2]+ +g[d+68>>2]+((E-D)*z-(I-H)*A)-(+g[e+180>>2]+ +g[e+68>>2]+((l-k)*u-(s-r)*C));w=+g[d+184>>2]+ +g[d+72>>2]+((G-F)*A-(E-D)*B)-(+g[e+184>>2]+ +g[e+72>>2]+((n-m)*C-(l-k)*w));o=(c[d+240>>2]|0)==0;p=(c[e+240>>2]|0)==0;h=0;do{C=1.0/+g[b+48+(h*84|0)+80>>2];q=b+48+(h*84|0)|0;B=+g[q>>2];v=b+48+(h*84|0)+4|0;A=+g[v>>2];y=b+48+(h*84|0)+8|0;z=+g[y>>2];z=C*(((E-l)*B+(G-n)*A+(I-s)*z)*-.30000001192092896/f)-C*(t*B+u*A+w*z);g[b+36>>2]=+g[b+36>>2]+z;A=+g[y>>2];B=+g[v>>2];C=+g[q>>2];i=+g[J+344>>2];if(!o){S=((G-F)*A-(I-H)*B)*+g[J+296>>2]+((I-H)*C-(E-D)*A)*+g[J+300>>2]+((E-D)*B-(G-F)*C)*+g[J+304>>2];Q=((G-F)*A-(I-H)*B)*+g[J+280>>2]+((I-H)*C-(E-D)*A)*+g[J+284>>2]+((E-D)*B-(G-F)*C)*+g[J+288>>2];R=((G-F)*A-(I-H)*B)*+g[J+264>>2]+((I-H)*C-(E-D)*A)*+g[J+268>>2]+((E-D)*B-(G-F)*C)*+g[J+272>>2];U=z*B*i*+g[d+116>>2];T=z*A*i*+g[d+120>>2];g[d+64>>2]=z*C*i*+g[d+112>>2]+ +g[d+64>>2];g[d+68>>2]=U+ +g[d+68>>2];g[d+72>>2]=T+ +g[d+72>>2];Q=Q*z*+g[d+100>>2];i=S*z*+g[d+104>>2];g[d+80>>2]=R*z*+g[d+96>>2]+ +g[d+80>>2];g[d+84>>2]=Q+ +g[d+84>>2];g[d+88>>2]=i+ +g[d+88>>2]}i=+g[K+344>>2];if(!p){U=((n-m)*A-(s-r)*B)*+g[K+296>>2]+((s-r)*C-(l-k)*A)*+g[K+300>>2]+((l-k)*B-(n-m)*C)*+g[K+304>>2];T=((n-m)*A-(s-r)*B)*+g[K+280>>2]+((s-r)*C-(l-k)*A)*+g[K+284>>2]+((l-k)*B-(n-m)*C)*+g[K+288>>2];S=((n-m)*A-(s-r)*B)*+g[K+264>>2]+((s-r)*C-(l-k)*A)*+g[K+268>>2]+((l-k)*B-(n-m)*C)*+g[K+272>>2];Q=i*+g[v>>2]*-z*+g[e+116>>2];R=i*+g[y>>2]*-z*+g[e+120>>2];g[e+64>>2]=+g[e+112>>2]*i*+g[q>>2]*-z+ +g[e+64>>2];g[e+68>>2]=Q+ +g[e+68>>2];g[e+72>>2]=R+ +g[e+72>>2];T=T*+g[e+100>>2]*-z;U=U*+g[e+104>>2]*-z;g[e+80>>2]=S*+g[e+96>>2]*-z+ +g[e+80>>2];g[e+84>>2]=T+ +g[e+84>>2];g[e+88>>2]=U+ +g[e+88>>2]}h=h+1|0}while((h|0)!=3)}do if(!(a[b+552>>0]|0)){i=+g[b+440>>2];if(!(i>1.1920928955078125e-07)){h=d+192|0;J=d+80|0;o=d+196|0;K=d+84|0;p=d+200|0;L=d+88|0;q=e+192|0;M=e+80|0;v=e+196|0;N=e+84|0;y=e+200|0;O=e+88|0;break}t=+g[d+80>>2];u=+g[d+84>>2];w=+g[d+88>>2];k=+g[e+192>>2]+ +g[e+80>>2]-(+g[d+192>>2]+t);m=+g[e+196>>2]+ +g[e+84>>2]-(+g[d+196>>2]+u);r=+g[e+200>>2]+ +g[e+88>>2]-(+g[d+200>>2]+w);if(k*k+m*m+r*r>1.1920928955078125e-07){n=1.0/+x(+(k*k+m*m+r*r));z=+g[J+264>>2];A=+g[J+280>>2];B=+g[J+296>>2];C=+g[J+268>>2];D=+g[J+284>>2];E=+g[J+300>>2];F=+g[J+272>>2];G=+g[J+288>>2];s=+g[J+304>>2];i=i*(1.0/(k*n*(k*n*z+m*n*A+r*n*B)+m*n*(k*n*C+m*n*D+r*n*E)+r*n*(k*n*F+m*n*G+r*n*s)+(k*n*(k*n*+g[K+264>>2]+m*n*+g[K+280>>2]+r*n*+g[K+296>>2])+m*n*(k*n*+g[K+268>>2]+m*n*+g[K+284>>2]+r*n*+g[K+300>>2])+r*n*(k*n*+g[K+272>>2]+m*n*+g[K+288>>2]+r*n*+g[K+304>>2]))));n=+x(+(r*i*r*i+(k*i*k*i+m*i*m*i)));l=k*i*(1.0/n);k=m*i*(1.0/n);i=r*i*(1.0/n);if(c[d+240>>2]|0){U=n*0.0*+g[d+116>>2];T=n*0.0*+g[d+120>>2];g[d+64>>2]=n*0.0*+g[d+112>>2]+ +g[d+64>>2];g[d+68>>2]=U+ +g[d+68>>2];g[d+72>>2]=T+ +g[d+72>>2];T=(l*A+k*D+i*G)*n*+g[d+100>>2];U=(l*B+k*E+i*s)*n*+g[d+104>>2];g[d+80>>2]=t+(l*z+k*C+i*F)*n*+g[d+96>>2];g[d+84>>2]=u+T;g[d+88>>2]=w+U}if(c[e+240>>2]|0){U=l*+g[K+296>>2]+k*+g[K+300>>2]+i*+g[K+304>>2];T=l*+g[K+280>>2]+k*+g[K+284>>2]+i*+g[K+288>>2];S=l*+g[K+264>>2]+k*+g[K+268>>2]+i*+g[K+272>>2];Q=n*-0.0*+g[e+116>>2];R=n*-0.0*+g[e+120>>2];g[e+64>>2]=n*-0.0*+g[e+112>>2]+ +g[e+64>>2];g[e+68>>2]=Q+ +g[e+68>>2];g[e+72>>2]=R+ +g[e+72>>2];T=T*+g[e+100>>2]*-n;U=U*+g[e+104>>2]*-n;g[e+80>>2]=S*+g[e+96>>2]*-n+ +g[e+80>>2];g[e+84>>2]=T+ +g[e+84>>2];g[e+88>>2]=U+ +g[e+88>>2];h=d+192|0;J=d+80|0;o=d+196|0;K=d+84|0;p=d+200|0;L=d+88|0;q=e+192|0;M=e+80|0;v=e+196|0;N=e+84|0;y=e+200|0;O=e+88|0}else{h=d+192|0;J=d+80|0;o=d+196|0;K=d+84|0;p=d+200|0;L=d+88|0;q=e+192|0;M=e+80|0;v=e+196|0;N=e+84|0;y=e+200|0;O=e+88|0}}else{h=d+192|0;J=d+80|0;o=d+196|0;K=d+84|0;p=d+200|0;L=d+88|0;q=e+192|0;M=e+80|0;v=e+196|0;N=e+84|0;y=e+200|0;O=e+88|0}}else{c[P+352>>2]=c[J+4>>2];c[P+352+4>>2]=c[J+4+4>>2];c[P+352+8>>2]=c[J+4+8>>2];c[P+352+12>>2]=c[J+4+12>>2];c[P+352+16>>2]=c[J+20>>2];c[P+352+16+4>>2]=c[J+20+4>>2];c[P+352+16+8>>2]=c[J+20+8>>2];c[P+352+16+12>>2]=c[J+20+12>>2];c[P+352+32>>2]=c[J+36>>2];c[P+352+32+4>>2]=c[J+36+4>>2];c[P+352+32+8>>2]=c[J+36+8>>2];c[P+352+32+12>>2]=c[J+36+12>>2];c[P+352+48>>2]=c[J+52>>2];c[P+352+48+4>>2]=c[J+52+4>>2];c[P+352+48+8>>2]=c[J+52+8>>2];c[P+352+48+12>>2]=c[J+52+12>>2];c[P+288>>2]=c[K+4>>2];c[P+288+4>>2]=c[K+4+4>>2];c[P+288+8>>2]=c[K+4+8>>2];c[P+288+12>>2]=c[K+4+12>>2];c[P+288+16>>2]=c[K+20>>2];c[P+288+16+4>>2]=c[K+20+4>>2];c[P+288+16+8>>2]=c[K+20+8>>2];c[P+288+16+12>>2]=c[K+20+12>>2];c[P+288+32>>2]=c[K+36>>2];c[P+288+32+4>>2]=c[K+36+4>>2];c[P+288+32+8>>2]=c[K+36+8>>2];c[P+288+32+12>>2]=c[K+36+12>>2];c[P+288+48>>2]=c[K+52>>2];c[P+288+48+4>>2]=c[K+52+4>>2];c[P+288+48+8>>2]=c[K+52+8>>2];c[P+288+48+12>>2]=c[K+52+12>>2];S=+g[d+196>>2]+ +g[d+84>>2];t=+g[d+200>>2]+ +g[d+88>>2];g[P+272>>2]=+g[d+192>>2]+ +g[d+80>>2];g[P+272+4>>2]=S;g[P+272+8>>2]=t;g[P+272+12>>2]=0.0;t=+g[e+196>>2]+ +g[e+84>>2];S=+g[e+200>>2]+ +g[e+88>>2];g[P+256>>2]=+g[e+192>>2]+ +g[e+80>>2];g[P+256+4>>2]=t;g[P+256+8>>2]=S;g[P+256+12>>2]=0.0;c[P+192>>2]=1065353216;N=P+192+4|0;c[N>>2]=0;c[N+4>>2]=0;c[N+8>>2]=0;c[N+12>>2]=0;c[P+192+20>>2]=1065353216;O=P+192+24|0;c[O>>2]=0;c[O+4>>2]=0;c[O+8>>2]=0;c[O+12>>2]=0;c[P+192+40>>2]=1065353216;L=P+192+44|0;c[L>>2]=0;c[L+4>>2]=0;c[L+8>>2]=0;c[L+12>>2]=0;c[L+16>>2]=0;jg(P+352|0,0.0,0.0,0.0,P+272|0,f,P+192|0);c[P+128>>2]=1065353216;L=P+128+4|0;c[L>>2]=0;c[L+4>>2]=0;c[L+8>>2]=0;c[L+12>>2]=0;c[P+128+20>>2]=1065353216;M=P+128+24|0;c[M>>2]=0;c[M+4>>2]=0;c[M+8>>2]=0;c[M+12>>2]=0;c[P+128+40>>2]=1065353216;K=P+128+44|0;c[K>>2]=0;c[K+4>>2]=0;c[K+8>>2]=0;c[K+12>>2]=0;c[K+16>>2]=0;jg(P+288|0,0.0,0.0,0.0,P+256|0,f,P+128|0);S=+g[b+556>>2];t=+g[b+560>>2];T=+g[b+564>>2];u=+g[b+568>>2];G=S*(2.0/(S*S+t*t+T*T+u*u));B=t*(2.0/(S*S+t*t+T*T+u*u));H=T*(2.0/(S*S+t*t+T*T+u*u));W=+g[b+364>>2];V=+g[b+368>>2];Z=+g[b+372>>2];k=Z*(S*H-u*B)+(V*(S*B+u*H)+W*(1.0-(t*B+T*H)));l=Z*(t*H+u*G)+(W*(S*B-u*H)+V*(1.0-(S*G+T*H)));m=W*(S*H+u*B)+V*(t*H-u*G)+Z*(1.0-(S*G+t*B));i=+g[b+380>>2];F=+g[b+384>>2];C=+g[b+388>>2];n=(S*H-u*B)*C+(F*(S*B+u*H)+i*(1.0-(t*B+T*H)));r=(t*H+u*G)*C+(i*(S*B-u*H)+F*(1.0-(S*G+T*H)));s=i*(S*H+u*B)+F*(t*H-u*G)+C*(1.0-(S*G+t*B));Q=+g[b+396>>2];D=+g[b+400>>2];A=+g[b+404>>2];R=(1.0-(t*B+T*H))*Q+(S*B+u*H)*D+(S*H-u*B)*A;T=(S*B-u*H)*Q+(1.0-(S*G+T*H))*D+(t*H+u*G)*A;B=(S*H+u*B)*Q+(t*H-u*G)*D+(1.0-(S*G+t*B))*A;t=+g[b+300>>2];G=+g[b+316>>2];S=+g[b+332>>2];u=+g[b+304>>2];H=+g[b+320>>2];U=+g[b+336>>2];E=+g[b+308>>2];I=+g[b+324>>2];z=+g[b+340>>2];w=-+g[b+348>>2];aa=-+g[b+352>>2];Y=-+g[b+356>>2];Z=W*0.0+V*0.0+Z*0.0+ +g[b+412>>2]+(m*(E*w+I*aa+z*Y)+(k*(t*w+G*aa+S*Y)+l*(u*w+H*aa+U*Y)));C=i*0.0+F*0.0+C*0.0+ +g[b+416>>2]+(s*(E*w+I*aa+z*Y)+(n*(t*w+G*aa+S*Y)+r*(u*w+H*aa+U*Y)));Y=Q*0.0+D*0.0+A*0.0+ +g[b+420>>2]+(B*(E*w+I*aa+z*Y)+(R*(t*w+G*aa+S*Y)+T*(u*w+H*aa+U*Y)));aa=+g[P+128>>2];w=+g[L>>2];A=+g[P+128+8>>2];D=+g[P+128+16>>2];Q=+g[P+128+20>>2];F=+g[M>>2];i=+g[P+128+32>>2];V=+g[P+128+36>>2];W=+g[P+128+40>>2];X=A*Y+(aa*Z+w*C)+ +g[P+128+48>>2];_=D*Z+C*Q+Y*F+ +g[P+128+52>>2];$=Z*i+C*V+Y*W+ +g[P+128+56>>2];g[P+64>>2]=(k*t+l*u+m*E)*aa+(n*t+r*u+s*E)*w+(R*t+T*u+B*E)*A;g[P+64+4>>2]=(k*G+l*H+m*I)*aa+(n*G+r*H+s*I)*w+(R*G+T*H+B*I)*A;g[P+64+8>>2]=(k*S+l*U+m*z)*aa+(n*S+r*U+s*z)*w+(R*S+T*U+B*z)*A;g[P+64+12>>2]=0.0;g[P+64+16>>2]=(k*t+l*u+m*E)*D+(n*t+r*u+s*E)*Q+(R*t+T*u+B*E)*F;g[P+64+20>>2]=(k*G+l*H+m*I)*D+(n*G+r*H+s*I)*Q+(R*G+T*H+B*I)*F;g[P+64+24>>2]=(k*S+l*U+m*z)*D+(n*S+r*U+s*z)*Q+(R*S+T*U+B*z)*F;g[P+64+28>>2]=0.0;g[P+64+32>>2]=(k*t+l*u+m*E)*i+(n*t+r*u+s*E)*V+(R*t+T*u+B*E)*W;g[P+64+36>>2]=(k*G+l*H+m*I)*i+(n*G+r*H+s*I)*V+(R*G+T*H+B*I)*W;g[P+64+40>>2]=(k*S+l*U+m*z)*i+(n*S+r*U+s*z)*V+(R*S+T*U+B*z)*W;g[P+64+44>>2]=0.0;g[P+64+48>>2]=X;g[P+64+52>>2]=_;g[P+64+56>>2]=$;g[P+64+60>>2]=0.0;$=(R*t+T*u+B*E)*-Y+((k*t+l*u+m*E)*-Z+(n*t+r*u+s*E)*-C);_=(R*G+T*H+B*I)*-Y+((k*G+l*H+m*I)*-Z+(n*G+r*H+s*I)*-C);C=(R*S+T*U+B*z)*-Y+((k*S+l*U+m*z)*-Z+(n*S+r*U+s*z)*-C);Z=+g[P+192>>2];Y=+g[N>>2];X=+g[P+192+8>>2];W=+g[P+192+16>>2];V=+g[P+192+20>>2];i=+g[O>>2];F=+g[P+192+32>>2];Q=+g[P+192+36>>2];D=+g[P+192+40>>2];A=$*Z+_*Y+C*X+ +g[P+192+48>>2];w=$*W+_*V+C*i+ +g[P+192+52>>2];C=$*F+_*Q+C*D+ +g[P+192+56>>2];g[P>>2]=(k*t+l*u+m*E)*Z+(k*G+l*H+m*I)*Y+(k*S+l*U+m*z)*X;g[P+4>>2]=(n*t+r*u+s*E)*Z+(n*G+r*H+s*I)*Y+(n*S+r*U+s*z)*X;g[P+8>>2]=(R*t+T*u+B*E)*Z+(R*G+T*H+B*I)*Y+(R*S+T*U+B*z)*X;g[P+12>>2]=0.0;g[P+16>>2]=(k*t+l*u+m*E)*W+(k*G+l*H+m*I)*V+(k*S+l*U+m*z)*i;g[P+20>>2]=(n*t+r*u+s*E)*W+(n*G+r*H+s*I)*V+(n*S+r*U+s*z)*i;g[P+24>>2]=(R*t+T*u+B*E)*W+(R*G+T*H+B*I)*V+(R*S+T*U+B*z)*i;g[P+28>>2]=0.0;g[P+32>>2]=(k*t+l*u+m*E)*F+(k*G+l*H+m*I)*Q+(k*S+l*U+m*z)*D;g[P+36>>2]=(n*t+r*u+s*E)*F+(n*G+r*H+s*I)*Q+(n*S+r*U+s*z)*D;g[P+40>>2]=(R*t+T*u+B*E)*F+(R*G+T*H+B*I)*Q+(R*S+T*U+B*z)*D;g[P+44>>2]=0.0;g[P+48>>2]=A;g[P+52>>2]=w;g[P+56>>2]=C;g[P+60>>2]=0.0;Se(P+352|0,P+64|0,P+424|0,P+416|0);C=+g[P+416>>2];w=1.0/f*+g[P+424>>2]*C;A=1.0/f*C*+g[P+424+4>>2];C=1.0/f*C*+g[P+424+8>>2];Se(P+288|0,P,P+424|0,P+416|0);D=+g[P+416>>2];w=w-+g[P+272>>2];A=A-+g[P+272+4>>2];C=C-+g[P+272+8>>2];z=1.0/f*+g[P+424>>2]*D-+g[P+256>>2];B=1.0/f*D*+g[P+424+4>>2]-+g[P+256+4>>2];D=1.0/f*D*+g[P+424+8>>2]-+g[P+256+8>>2];if(w*w+A*A+C*C>1.1920928955078125e-07){t=1.0/+x(+(w*w+A*A+C*C));O=c[b+28>>2]|0;n=w*t*(w*t*+g[O+264>>2]+A*t*+g[O+280>>2]+C*t*+g[O+296>>2])+A*t*(w*t*+g[O+268>>2]+A*t*+g[O+284>>2]+C*t*+g[O+300>>2])+C*t*(w*t*+g[O+272>>2]+A*t*+g[O+288>>2]+C*t*+g[O+304>>2]);k=w*t;m=A*t;t=C*t}else{n=0.0;k=0.0;m=0.0;t=0.0}if(z*z+B*B+D*D>1.1920928955078125e-07){s=1.0/+x(+(z*z+B*B+D*D));O=c[b+32>>2]|0;r=z*s*(z*s*+g[O+264>>2]+B*s*+g[O+280>>2]+D*s*+g[O+296>>2])+B*s*(z*s*+g[O+268>>2]+B*s*+g[O+284>>2]+D*s*+g[O+300>>2])+D*s*(z*s*+g[O+272>>2]+B*s*+g[O+288>>2]+D*s*+g[O+304>>2]);i=z*s;l=B*s;s=D*s}else{r=0.0;i=0.0;l=0.0;s=0.0}u=n*k+r*i;k=n*m+r*l;i=n*t+r*s;if(u*u+k*k+i*i>1.1920928955078125e-07){n=1.0/+x(+(u*u+k*k+i*i));h=c[b+28>>2]|0;l=u*n*(u*n*+g[h+264>>2]+k*n*+g[h+280>>2]+i*n*+g[h+296>>2])+k*n*(u*n*+g[h+268>>2]+k*n*+g[h+284>>2]+i*n*+g[h+300>>2])+i*n*(u*n*+g[h+272>>2]+k*n*+g[h+288>>2]+i*n*+g[h+304>>2]);o=c[b+32>>2]|0;n=u*n*(u*n*+g[o+264>>2]+k*n*+g[o+280>>2]+i*n*+g[o+296>>2])+k*n*(u*n*+g[o+268>>2]+k*n*+g[o+284>>2]+i*n*+g[o+300>>2])+i*n*(u*n*+g[o+272>>2]+k*n*+g[o+288>>2]+i*n*+g[o+304>>2]);z=(w*l-z*n)*(1.0/((l+n)*(l+n)));i=(A*l-B*n)*(1.0/((l+n)*(l+n)));n=(C*l-D*n)*(1.0/((l+n)*(l+n)));k=+g[b+572>>2];if(!(k>=0.0))k=z;else{s=(a[b+553>>0]|0)==0?k:k/l;k=+g[b+576>>2];m=+g[b+580>>2];l=+g[b+584>>2];r=+x(+((z+k)*(z+k)+(i+m)*(i+m)+(n+l)*(n+l)));if(r>s){t=m+(s*(i+m)*(1.0/r)-m);u=l+(s*(n+l)*(1.0/r)-l);w=k+(s*(z+k)*(1.0/r)-k);k=s*(z+k)*(1.0/r)-k;n=s*(n+l)*(1.0/r)-l;i=s*(i+m)*(1.0/r)-m}else{t=i+m;u=n+l;w=z+k;k=z}g[b+576>>2]=w;g[b+580>>2]=t;g[b+584>>2]=u}m=+x(+(k*k+i*i+n*n));l=k*(1.0/m);k=i*(1.0/m);i=n*(1.0/m);if(c[d+240>>2]|0){aa=l*+g[h+296>>2]+k*+g[h+300>>2]+i*+g[h+304>>2];$=l*+g[h+280>>2]+k*+g[h+284>>2]+i*+g[h+288>>2];_=l*+g[h+264>>2]+k*+g[h+268>>2]+i*+g[h+272>>2];Y=m*0.0*+g[d+116>>2];Z=m*0.0*+g[d+120>>2];g[d+64>>2]=m*0.0*+g[d+112>>2]+ +g[d+64>>2];g[d+68>>2]=Y+ +g[d+68>>2];g[d+72>>2]=Z+ +g[d+72>>2];$=$*m*+g[d+100>>2];aa=aa*m*+g[d+104>>2];g[d+80>>2]=_*m*+g[d+96>>2]+ +g[d+80>>2];g[d+84>>2]=$+ +g[d+84>>2];g[d+88>>2]=aa+ +g[d+88>>2]}if(c[e+240>>2]|0){aa=l*+g[o+296>>2]+k*+g[o+300>>2]+i*+g[o+304>>2];$=l*+g[o+280>>2]+k*+g[o+284>>2]+i*+g[o+288>>2];_=l*+g[o+264>>2]+k*+g[o+268>>2]+i*+g[o+272>>2];Y=m*-0.0*+g[e+116>>2];Z=m*-0.0*+g[e+120>>2];g[e+64>>2]=m*-0.0*+g[e+112>>2]+ +g[e+64>>2];g[e+68>>2]=Y+ +g[e+68>>2];g[e+72>>2]=Z+ +g[e+72>>2];$=$*+g[e+100>>2]*-m;aa=aa*+g[e+104>>2]*-m;g[e+80>>2]=_*+g[e+96>>2]*-m+ +g[e+80>>2];g[e+84>>2]=$+ +g[e+84>>2];g[e+88>>2]=aa+ +g[e+88>>2]}}h=d+192|0;J=d+80|0;o=d+196|0;K=d+84|0;p=d+200|0;L=d+88|0;q=e+192|0;M=e+80|0;v=e+196|0;N=e+84|0;y=e+200|0;O=e+88|0}while(0);z=+g[h>>2]+ +g[J>>2];w=+g[o>>2]+ +g[K>>2];u=+g[p>>2]+ +g[L>>2];t=+g[q>>2]+ +g[M>>2];s=+g[v>>2]+ +g[N>>2];r=+g[y>>2]+ +g[O>>2];if(a[b+526>>0]|0){k=+g[b+528>>2];i=k*+g[b+504>>2]*+g[b+432>>2]/f;l=+g[b+460>>2];m=+g[b+464>>2];n=+g[b+468>>2];if((t-z)*l+(s-w)*m+(r-u)*n>0.0)i=i+k*((t-z)*l+(s-w)*m+(r-u)*n)*+g[b+436>>2];$=+g[b+516>>2];Z=$+i*+g[b+492>>2];g[P+424>>2]=Z;g[P+416>>2]=0.0;h=c[(Z>0.0?P+424|0:P+416|0)>>2]|0;c[b+516>>2]=h;$=(c[j>>2]=h,+g[j>>2])-$;Z=+g[b+536>>2];_=+g[b+540>>2];i=+g[b+544>>2];k=l*$-Z*(l*$*Z+m*$*_+n*$*i);aa=m*$-_*(l*$*Z+m*$*_+n*$*i);m=n*$-i*(l*$*Z+m*$*_+n*$*i);i=+x(+(m*m+(k*k+aa*aa)));k=k*(1.0/i);l=aa*(1.0/i);m=m*(1.0/i);h=c[b+28>>2]|0;if(c[d+240>>2]|0){aa=k*+g[h+296>>2]+l*+g[h+300>>2]+m*+g[h+304>>2];$=k*+g[h+280>>2]+l*+g[h+284>>2]+m*+g[h+288>>2];_=k*+g[h+264>>2]+l*+g[h+268>>2]+m*+g[h+272>>2];Y=i*0.0*+g[d+116>>2];Z=i*0.0*+g[d+120>>2];g[d+64>>2]=i*0.0*+g[d+112>>2]+ +g[d+64>>2];g[d+68>>2]=Y+ +g[d+68>>2];g[d+72>>2]=Z+ +g[d+72>>2];$=$*i*+g[d+100>>2];aa=aa*i*+g[d+104>>2];g[J>>2]=_*i*+g[d+96>>2]+ +g[J>>2];g[K>>2]=$+ +g[K>>2];g[L>>2]=aa+ +g[L>>2]}h=c[b+32>>2]|0;if(c[e+240>>2]|0){aa=k*+g[h+296>>2]+l*+g[h+300>>2]+m*+g[h+304>>2];$=k*+g[h+280>>2]+l*+g[h+284>>2]+m*+g[h+288>>2];_=k*+g[h+264>>2]+l*+g[h+268>>2]+m*+g[h+272>>2];Y=i*-0.0*+g[e+116>>2];Z=i*-0.0*+g[e+120>>2];g[e+64>>2]=i*-0.0*+g[e+112>>2]+ +g[e+64>>2];g[e+68>>2]=Y+ +g[e+68>>2];g[e+72>>2]=Z+ +g[e+72>>2];$=$*+g[e+100>>2]*-i;aa=aa*+g[e+104>>2]*-i;g[M>>2]=_*+g[e+96>>2]*-i+ +g[M>>2];g[N>>2]=$+ +g[N>>2];g[O>>2]=aa+ +g[O>>2]}}if(!(a[b+525>>0]|0)){sa=P;return}n=+g[b+532>>2];m=n*+g[b+508>>2]*+g[b+432>>2]/f;l=+g[b+476>>2];k=+g[b+480>>2];i=+g[b+484>>2];if((t-z)*l+(s-w)*k+(r-u)*i>0.0)m=m+n*((t-z)*l+(s-w)*k+(r-u)*i)*+g[b+436>>2];aa=+g[b+520>>2];m=aa+m*+g[b+496>>2];g[P+424>>2]=m;g[P+416>>2]=0.0;h=c[(m>0.0?P+424|0:P+416|0)>>2]|0;c[b+520>>2]=h;m=(c[j>>2]=h,+g[j>>2])-aa;h=c[b+28>>2]|0;if(c[d+240>>2]|0){aa=l*+g[h+296>>2]+k*+g[h+300>>2]+i*+g[h+304>>2];$=l*+g[h+280>>2]+k*+g[h+284>>2]+i*+g[h+288>>2];i=l*+g[h+264>>2]+k*+g[h+268>>2]+i*+g[h+272>>2];l=m*0.0*+g[d+116>>2];k=m*0.0*+g[d+120>>2];g[d+64>>2]=m*0.0*+g[d+112>>2]+ +g[d+64>>2];g[d+68>>2]=l+ +g[d+68>>2];g[d+72>>2]=k+ +g[d+72>>2];k=$*m*+g[d+100>>2];l=aa*m*+g[d+104>>2];g[J>>2]=i*m*+g[d+96>>2]+ +g[J>>2];g[K>>2]=k+ +g[K>>2];g[L>>2]=l+ +g[L>>2];l=+g[b+476>>2];k=+g[b+480>>2];i=+g[b+484>>2]}h=c[b+32>>2]|0;if(!(c[e+240>>2]|0)){sa=P;return}aa=l*+g[h+296>>2]+k*+g[h+300>>2]+i*+g[h+304>>2];$=l*+g[h+280>>2]+k*+g[h+284>>2]+i*+g[h+288>>2];_=l*+g[h+264>>2]+k*+g[h+268>>2]+i*+g[h+272>>2];Y=m*-0.0*+g[e+116>>2];Z=m*-0.0*+g[e+120>>2];g[e+64>>2]=m*-0.0*+g[e+112>>2]+ +g[e+64>>2];g[e+68>>2]=Y+ +g[e+68>>2];g[e+72>>2]=Z+ +g[e+72>>2];$=$*+g[e+100>>2]*-m;aa=aa*+g[e+104>>2]*-m;g[M>>2]=_*+g[e+96>>2]*-m+ +g[M>>2];g[N>>2]=$+ +g[N>>2];g[O>>2]=aa+ +g[O>>2];sa=P;return}function xb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;v=sa;sa=sa+16|0;do if(a>>>0<245){m=a>>>0<11?16:a+11&-8;e=3?m>>>3:m;n=c[7201]|0;f=e?n>>>e:n;if(f&3|0){a=28844+((f&1^1)+e<<1<<2)|0;b=c[a+8>>2]|0;d=c[b+8>>2]|0;if((d|0)==(a|0))c[7201]=n&~(1<<(f&1^1)+e);else{c[d+12>>2]=a;c[a+8>>2]=d}c[b+4>>2]=(f&1^1)+e<<3|3;c[b+((f&1^1)+e<<3)+4>>2]=c[b+((f&1^1)+e<<3)+4>>2]|1;u=b+8|0;sa=v;return u|0}l=c[7203]|0;if(m>>>0>l>>>0){if(f|0){f=(f<>>12:f)&16;f=t?f>>>t:f;s=(5?f>>>5:f)&8;f=s?f>>>s:f;u=(2?f>>>2:f)&4;f=u?f>>>u:f;a=(1?f>>>1:f)&2;f=a?f>>>a:f;g=(1?f>>>1:f)&1;f=(s|t|u|a|g)+(g?f>>>g:f)|0;g=c[28844+(f<<1<<2)+8>>2]|0;a=c[g+8>>2]|0;if((a|0)==(28844+(f<<1<<2)|0)){c[7201]=n&~(1<>2]=28844+(f<<1<<2);c[28844+(f<<1<<2)+8>>2]=a;a=n}c[g+4>>2]=m|3;c[g+m+4>>2]=(f<<3)-m|1;c[g+(f<<3)>>2]=(f<<3)-m;if(l|0){e=c[7206]|0;d=3?l>>>3:l;if(!(a&1<>2]|0;b=28844+(d<<1<<2)+8|0}c[b>>2]=e;c[a+12>>2]=e;c[e+8>>2]=a;c[e+12>>2]=28844+(d<<1<<2)}c[7203]=(f<<3)-m;c[7206]=g+m;u=g+8|0;sa=v;return u|0}h=c[7202]|0;if(h){f=(12?((h&0-h)+-1|0)>>>12:(h&0-h)+-1|0)&16;k=f?((h&0-h)+-1|0)>>>f:(h&0-h)+-1|0;e=(5?k>>>5:k)&8;k=e?k>>>e:k;i=(2?k>>>2:k)&4;k=i?k>>>i:k;j=(1?k>>>1:k)&2;k=j?k>>>j:k;b=(1?k>>>1:k)&1;k=c[29108+((e|f|i|j|b)+(b?k>>>b:k)<<2)>>2]|0;b=k;j=k;k=(c[k+4>>2]&-8)-m|0;while(1){a=c[b+16>>2]|0;if(!a){a=c[b+20>>2]|0;if(!a)break}i=(c[a+4>>2]&-8)-m|0;f=i>>>0>>0;b=a;j=f?a:j;k=f?i:k}i=j+m|0;if(i>>>0>j>>>0){f=c[j+24>>2]|0;a=c[j+12>>2]|0;do if((a|0)==(j|0)){b=j+20|0;a=c[b>>2]|0;if(!a){b=j+16|0;a=c[b>>2]|0;if(!a){b=0;break}}while(1){e=a+20|0;d=c[e>>2]|0;if(!d){e=a+16|0;d=c[e>>2]|0;if(!d)break;else{a=d;b=e}}else{a=d;b=e}}c[b>>2]=0;b=a}else{b=c[j+8>>2]|0;c[b+12>>2]=a;c[a+8>>2]=b;b=a}while(0);do if(f|0){a=c[j+28>>2]|0;if((j|0)==(c[29108+(a<<2)>>2]|0)){c[29108+(a<<2)>>2]=b;if(!b){c[7202]=h&~(1<>2]|0)==(j|0)?f+16|0:f+20|0)>>2]=b;if(!b)break}c[b+24>>2]=f;a=c[j+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b}a=c[j+20>>2]|0;if(a|0){c[b+20>>2]=a;c[a+24>>2]=b}}while(0);if(k>>>0<16){u=k+m|0;c[j+4>>2]=u|3;u=j+u+4|0;c[u>>2]=c[u>>2]|1}else{c[j+4>>2]=m|3;c[i+4>>2]=k|1;c[i+k>>2]=k;if(l|0){e=c[7206]|0;d=3?l>>>3:l;if(!(1<>2]|0;b=28844+(d<<1<<2)+8|0}c[b>>2]=e;c[a+12>>2]=e;c[e+8>>2]=a;c[e+12>>2]=28844+(d<<1<<2)}c[7203]=k;c[7206]=i}u=j+8|0;sa=v;return u|0}}}}else if(a>>>0<=4294967231){m=a+11&-8;e=c[7202]|0;if(e){a=8?(a+11|0)>>>8:a+11|0;if(a)if(m>>>0>16777215)j=31;else{n=(16?(a+1048320|0)>>>16:a+1048320|0)&8;r=(16?((a<>>16:(a<>>16:(a<>>15:a<>>(j+7|0):m)&1|j<<1}else j=0;a=c[29108+(j<<2)>>2]|0;a:do if(!a){d=0;a=0;b=0-m|0;r=61}else{h=0;b=0-m|0;i=m<<((j|0)==31?0:25-(1?j>>>1:j)|0);d=0;while(1){f=(c[a+4>>2]&-8)-m|0;if(f>>>0>>0)if(!f){f=a;b=0;d=a;r=65;break a}else{h=a;b=f}r=c[a+20>>2]|0;a=c[a+16+((31?i>>>31:i)<<2)>>2]|0;d=(r|0)==0|(r|0)==(a|0)?d:r;if(!a){a=h;r=61;break}else i=i<<1}}while(0);if((r|0)==61){if((d|0)==0&(a|0)==0){a=2<>>12:d)&16;d=i?d>>>i:d;h=(5?d>>>5:d)&8;d=h?d>>>h:d;j=(2?d>>>2:d)&4;d=j?d>>>j:d;l=(1?d>>>1:d)&2;d=l?d>>>l:d;n=(1?d>>>1:d)&1;a=0;d=c[29108+((h|i|j|l|n)+(n?d>>>n:d)<<2)>>2]|0}if(!d){i=a;h=b}else{f=a;r=65}}if((r|0)==65)while(1){n=(c[d+4>>2]&-8)-m|0;a=n>>>0>>0;b=a?n:b;f=a?d:f;a=c[d+16>>2]|0;if(!a)a=c[d+20>>2]|0;if(!a){i=f;h=b;break}else d=a}if(((i|0)!=0?h>>>0<((c[7203]|0)-m|0)>>>0:0)?(k=i+m|0,k>>>0>i>>>0):0){g=c[i+24>>2]|0;a=c[i+12>>2]|0;do if((a|0)==(i|0)){b=i+20|0;a=c[b>>2]|0;if(!a){b=i+16|0;a=c[b>>2]|0;if(!a){a=0;break}}while(1){f=a+20|0;d=c[f>>2]|0;if(!d){f=a+16|0;d=c[f>>2]|0;if(!d)break;else{a=d;b=f}}else{a=d;b=f}}c[b>>2]=0}else{u=c[i+8>>2]|0;c[u+12>>2]=a;c[a+8>>2]=u}while(0);do if(g){b=c[i+28>>2]|0;if((i|0)==(c[29108+(b<<2)>>2]|0)){c[29108+(b<<2)>>2]=a;if(!a){c[7202]=e&~(1<>2]|0)==(i|0)?g+16|0:g+20|0)>>2]=a;if(!a)break}c[a+24>>2]=g;b=c[i+16>>2]|0;if(b|0){c[a+16>>2]=b;c[b+24>>2]=a}b=c[i+20>>2]|0;if(b){c[a+20>>2]=b;c[b+24>>2]=a}}while(0);b:do if(h>>>0<16){u=h+m|0;c[i+4>>2]=u|3;u=i+u+4|0;c[u>>2]=c[u>>2]|1}else{c[i+4>>2]=m|3;c[k+4>>2]=h|1;c[k+h>>2]=h;d=3?h>>>3:h;if(h>>>0<256){a=c[7201]|0;if(!(a&1<>2]|0;b=28844+(d<<1<<2)+8|0}c[b>>2]=k;c[a+12>>2]=k;c[k+8>>2]=a;c[k+12>>2]=28844+(d<<1<<2);break}a=8?h>>>8:h;if(a)if(h>>>0>16777215)d=31;else{t=(16?(a+1048320|0)>>>16:a+1048320|0)&8;u=(16?((a<>>16:(a<>>16:(a<>>15:a<>>(d+7|0):h)&1|d<<1}else d=0;a=29108+(d<<2)|0;c[k+28>>2]=d;c[k+16+4>>2]=0;c[k+16>>2]=0;b=1<>2]=k;c[k+24>>2]=a;c[k+12>>2]=k;c[k+8>>2]=k;break}a=c[a>>2]|0;c:do if((c[a+4>>2]&-8|0)!=(h|0)){e=h<<((d|0)==31?0:25-(1?d>>>1:d)|0);while(1){d=a+16+((31?e>>>31:e)<<2)|0;b=c[d>>2]|0;if(!b)break;if((c[b+4>>2]&-8|0)==(h|0)){a=b;break c}else{e=e<<1;a=b}}c[d>>2]=k;c[k+24>>2]=a;c[k+12>>2]=k;c[k+8>>2]=k;break b}while(0);t=a+8|0;u=c[t>>2]|0;c[u+12>>2]=k;c[t>>2]=k;c[k+8>>2]=u;c[k+12>>2]=a;c[k+24>>2]=0}while(0);u=i+8|0;sa=v;return u|0}}}else m=-1;while(0);d=c[7203]|0;if(d>>>0>=m>>>0){a=d-m|0;b=c[7206]|0;if(a>>>0>15){u=b+m|0;c[7206]=u;c[7203]=a;c[u+4>>2]=a|1;c[b+d>>2]=a;c[b+4>>2]=m|3}else{c[7203]=0;c[7206]=0;c[b+4>>2]=d|3;c[b+d+4>>2]=c[b+d+4>>2]|1}u=b+8|0;sa=v;return u|0}f=c[7204]|0;if(f>>>0>m>>>0){s=f-m|0;c[7204]=s;u=c[7207]|0;t=u+m|0;c[7207]=t;c[t+4>>2]=s|1;c[u+4>>2]=m|3;u=u+8|0;sa=v;return u|0}if(!(c[7319]|0)){c[7321]=4096;c[7320]=4096;c[7322]=-1;c[7323]=-1;c[7324]=0;c[7312]=0;c[7319]=v&-16^1431655768;a=4096}else a=c[7321]|0;h=m+48|0;i=m+47|0;k=a+i|0;j=0-a|0;if((k&j)>>>0<=m>>>0){u=0;sa=v;return u|0}a=c[7311]|0;if(a|0?(n=c[7309]|0,(n+(k&j)|0)>>>0<=n>>>0?1:(n+(k&j)|0)>>>0>a>>>0):0){u=0;sa=v;return u|0}d:do if(!(c[7312]&4)){d=c[7207]|0;e:do if(d){b=29252;while(1){a=c[b>>2]|0;if(a>>>0<=d>>>0?(o=b+4|0,(a+(c[o>>2]|0)|0)>>>0>d>>>0):0)break;a=c[b+8>>2]|0;if(!a){r=128;break e}else b=a}if((k-f&j)>>>0<2147483647){a=io(k-f&j|0)|0;if((a|0)==((c[b>>2]|0)+(c[o>>2]|0)|0))if((a|0)==(-1|0))a=k-f&j;else{h=k-f&j;g=a;r=145;break d}else{e=a;d=k-f&j;r=136}}else a=0}else r=128;while(0);do if((r|0)==128){b=io(0)|0;if((b|0)!=(-1|0)?(q=c[7320]|0,q=((q+-1&b|0)==0?0:(q+-1+b&0-q)-b|0)+(k&j)|0,p=c[7309]|0,q>>>0>m>>>0&q>>>0<2147483647):0){o=c[7311]|0;if(o|0?(q+p|0)>>>0<=p>>>0|(q+p|0)>>>0>o>>>0:0){a=0;break}a=io(q|0)|0;if((a|0)==(b|0)){h=q;g=b;r=145;break d}else{e=a;d=q;r=136}}else a=0}while(0);do if((r|0)==136){b=0-d|0;if(!(h>>>0>d>>>0&(d>>>0<2147483647&(e|0)!=(-1|0))))if((e|0)==(-1|0)){a=0;break}else{h=d;g=e;r=145;break d}a=c[7321]|0;a=i-d+a&0-a;if(a>>>0>=2147483647){h=d;g=e;r=145;break d}if((io(a|0)|0)==(-1|0)){io(b|0)|0;a=0;break}else{h=a+d|0;g=e;r=145;break d}}while(0);c[7312]=c[7312]|4;r=143}else{a=0;r=143}while(0);if(((r|0)==143?(k&j)>>>0<2147483647:0)?(g=io(k&j|0)|0,s=io(0)|0,t=(s-g|0)>>>0>(m+40|0)>>>0,!((g|0)==(-1|0)|t^1|g>>>0>>0&((g|0)!=(-1|0)&(s|0)!=(-1|0))^1)):0){h=t?s-g|0:a;r=145}if((r|0)==145){a=(c[7309]|0)+h|0;c[7309]=a;if(a>>>0>(c[7310]|0)>>>0)c[7310]=a;j=c[7207]|0;f:do if(j){a=29252;while(1){b=c[a>>2]|0;d=a+4|0;e=c[d>>2]|0;if((g|0)==(b+e|0)){r=154;break}f=c[a+8>>2]|0;if(!f)break;else a=f}if(((r|0)==154?(c[a+12>>2]&8|0)==0:0)?g>>>0>j>>>0&b>>>0<=j>>>0:0){c[d>>2]=e+h;u=(c[7204]|0)+h|0;t=(j+8&7|0)==0?0:0-(j+8)&7;c[7207]=j+t;c[7204]=u-t;c[j+t+4>>2]=u-t|1;c[j+u+4>>2]=40;c[7208]=c[7323];break}if(g>>>0<(c[7205]|0)>>>0)c[7205]=g;d=g+h|0;a=29252;while(1){if((c[a>>2]|0)==(d|0)){r=162;break}b=c[a+8>>2]|0;if(!b)break;else a=b}if((r|0)==162?(c[a+12>>2]&8|0)==0:0){c[a>>2]=g;l=a+4|0;c[l>>2]=(c[l>>2]|0)+h;l=g+8|0;l=g+((l&7|0)==0?0:0-l&7)|0;a=d+((d+8&7|0)==0?0:0-(d+8)&7)|0;k=l+m|0;i=a-l-m|0;c[l+4>>2]=m|3;g:do if((j|0)==(a|0)){u=(c[7204]|0)+i|0;c[7204]=u;c[7207]=k;c[k+4>>2]=u|1}else{if((c[7206]|0)==(a|0)){u=(c[7203]|0)+i|0;c[7203]=u;c[7206]=k;c[k+4>>2]=u|1;c[k+u>>2]=u;break}h=c[a+4>>2]|0;if((h&3|0)==1){b=3?h>>>3:h;h:do if(h>>>0<256){d=c[a+8>>2]|0;e=c[a+12>>2]|0;if((e|0)==(d|0)){c[7201]=c[7201]&~(1<>2]=e;c[e+8>>2]=d;break}}else{g=c[a+24>>2]|0;b=c[a+12>>2]|0;do if((b|0)==(a|0)){b=c[a+16+4>>2]|0;if(!b){b=c[a+16>>2]|0;if(!b){b=0;break}else d=a+16|0}else d=a+16+4|0;while(1){f=b+20|0;e=c[f>>2]|0;if(!e){f=b+16|0;e=c[f>>2]|0;if(!e)break;else{b=e;d=f}}else{b=e;d=f}}c[d>>2]=0}else{u=c[a+8>>2]|0;c[u+12>>2]=b;c[b+8>>2]=u}while(0);if(!g)break;d=c[a+28>>2]|0;do if((c[29108+(d<<2)>>2]|0)!=(a|0)){c[((c[g+16>>2]|0)==(a|0)?g+16|0:g+20|0)>>2]=b;if(!b)break h}else{c[29108+(d<<2)>>2]=b;if(b|0)break;c[7202]=c[7202]&~(1<>2]=g;d=c[a+16>>2]|0;if(d|0){c[b+16>>2]=d;c[d+24>>2]=b}d=c[a+16+4>>2]|0;if(!d)break;c[b+20>>2]=d;c[d+24>>2]=b}while(0);a=a+(h&-8)|0;f=(h&-8)+i|0}else f=i;d=a+4|0;c[d>>2]=c[d>>2]&-2;c[k+4>>2]=f|1;c[k+f>>2]=f;d=3?f>>>3:f;if(f>>>0<256){a=c[7201]|0;if(!(a&1<>2]|0;b=28844+(d<<1<<2)+8|0}c[b>>2]=k;c[a+12>>2]=k;c[k+8>>2]=a;c[k+12>>2]=28844+(d<<1<<2);break}a=8?f>>>8:f;do if(!a)e=0;else{if(f>>>0>16777215){e=31;break}t=(16?(a+1048320|0)>>>16:a+1048320|0)&8;u=(16?((a<>>16:(a<>>16:(a<>>15:a<>>(e+7|0):f)&1|e<<1}while(0);a=29108+(e<<2)|0;c[k+28>>2]=e;c[k+16+4>>2]=0;c[k+16>>2]=0;b=c[7202]|0;d=1<>2]=k;c[k+24>>2]=a;c[k+12>>2]=k;c[k+8>>2]=k;break}a=c[a>>2]|0;i:do if((c[a+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(1?e>>>1:e)|0);while(1){d=a+16+((31?e>>>31:e)<<2)|0;b=c[d>>2]|0;if(!b)break;if((c[b+4>>2]&-8|0)==(f|0)){a=b;break i}else{e=e<<1;a=b}}c[d>>2]=k;c[k+24>>2]=a;c[k+12>>2]=k;c[k+8>>2]=k;break g}while(0);t=a+8|0;u=c[t>>2]|0;c[u+12>>2]=k;c[t>>2]=k;c[k+8>>2]=u;c[k+12>>2]=a;c[k+24>>2]=0}while(0);u=l+8|0;sa=v;return u|0}a=29252;while(1){b=c[a>>2]|0;if(b>>>0<=j>>>0?(u=b+(c[a+4>>2]|0)|0,u>>>0>j>>>0):0)break;a=c[a+8>>2]|0}f=u+-47+((u+-47+8&7|0)==0?0:0-(u+-47+8)&7)|0;f=f>>>0<(j+16|0)>>>0?j:f;a=h+-40|0;s=g+8|0;s=(s&7|0)==0?0:0-s&7;t=g+s|0;c[7207]=t;c[7204]=a-s;c[t+4>>2]=a-s|1;c[g+a+4>>2]=40;c[7208]=c[7323];c[f+4>>2]=27;c[f+8>>2]=c[7313];c[f+8+4>>2]=c[7314];c[f+8+8>>2]=c[7315];c[f+8+12>>2]=c[7316];c[7313]=g;c[7314]=h;c[7316]=0;c[7315]=f+8;a=f+24|0;do{t=a;a=a+4|0;c[a>>2]=7}while((t+8|0)>>>0>>0);if((f|0)!=(j|0)){c[f+4>>2]=c[f+4>>2]&-2;c[j+4>>2]=f-j|1;c[f>>2]=f-j;d=3?(f-j|0)>>>3:f-j|0;if((f-j|0)>>>0<256){a=c[7201]|0;if(!(a&1<>2]|0;b=28844+(d<<1<<2)+8|0}c[b>>2]=j;c[a+12>>2]=j;c[j+8>>2]=a;c[j+12>>2]=28844+(d<<1<<2);break}a=8?(f-j|0)>>>8:f-j|0;if(a)if((f-j|0)>>>0>16777215)e=31;else{t=(16?(a+1048320|0)>>>16:a+1048320|0)&8;u=(16?((a<>>16:(a<>>16:(a<>>15:a<>>(e+7|0):f-j|0)&1|e<<1}else e=0;a=29108+(e<<2)|0;c[j+28>>2]=e;c[j+20>>2]=0;c[j+16>>2]=0;b=c[7202]|0;d=1<>2]=j;c[j+24>>2]=a;c[j+12>>2]=j;c[j+8>>2]=j;break}a=c[a>>2]|0;j:do if((c[a+4>>2]&-8|0)!=(f-j|0)){e=f-j<<((e|0)==31?0:25-(1?e>>>1:e)|0);while(1){d=a+16+((31?e>>>31:e)<<2)|0;b=c[d>>2]|0;if(!b)break;if((c[b+4>>2]&-8|0)==(f-j|0)){a=b;break j}else{e=e<<1;a=b}}c[d>>2]=j;c[j+24>>2]=a;c[j+12>>2]=j;c[j+8>>2]=j;break f}while(0);t=a+8|0;u=c[t>>2]|0;c[u+12>>2]=j;c[t>>2]=j;c[j+8>>2]=u;c[j+12>>2]=a;c[j+24>>2]=0}}else{u=c[7205]|0;if((u|0)==0|g>>>0>>0)c[7205]=g;c[7313]=g;c[7314]=h;c[7316]=0;c[7210]=c[7319];c[7209]=-1;c[7214]=28844;c[7213]=28844;c[7216]=28852;c[7215]=28852;c[7218]=28860;c[7217]=28860;c[7220]=28868;c[7219]=28868;c[7222]=28876;c[7221]=28876;c[7224]=28884;c[7223]=28884;c[7226]=28892;c[7225]=28892;c[7228]=28900;c[7227]=28900;c[7230]=28908;c[7229]=28908;c[7232]=28916;c[7231]=28916;c[7234]=28924;c[7233]=28924;c[7236]=28932;c[7235]=28932;c[7238]=28940;c[7237]=28940;c[7240]=28948;c[7239]=28948;c[7242]=28956;c[7241]=28956;c[7244]=28964;c[7243]=28964;c[7246]=28972;c[7245]=28972;c[7248]=28980;c[7247]=28980;c[7250]=28988;c[7249]=28988;c[7252]=28996;c[7251]=28996;c[7254]=29004;c[7253]=29004;c[7256]=29012;c[7255]=29012;c[7258]=29020;c[7257]=29020;c[7260]=29028;c[7259]=29028;c[7262]=29036;c[7261]=29036;c[7264]=29044;c[7263]=29044;c[7266]=29052;c[7265]=29052;c[7268]=29060;c[7267]=29060;c[7270]=29068;c[7269]=29068;c[7272]=29076;c[7271]=29076;c[7274]=29084;c[7273]=29084;c[7276]=29092;c[7275]=29092;u=h+-40|0;s=g+8|0;s=(s&7|0)==0?0:0-s&7;t=g+s|0;c[7207]=t;c[7204]=u-s;c[t+4>>2]=u-s|1;c[g+u+4>>2]=40;c[7208]=c[7323]}while(0);a=c[7204]|0;if(a>>>0>m>>>0){s=a-m|0;c[7204]=s;u=c[7207]|0;t=u+m|0;c[7207]=t;c[t+4>>2]=s|1;c[u+4>>2]=m|3;u=u+8|0;sa=v;return u|0}}c[7184]=12;u=0;sa=v;return u|0}function yb(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0,P=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0;T=c[e>>2]|0;da=c[f>>2]|0;if(T|0)g=c[T+12>>2]|0;else g=b;h=c[g+88>>2]|0;j=c[g+92>>2]|0;l=c[g+96>>2]|0;if(!da)g=d;else g=c[da+12>>2]|0;s=c[g+88>>2]|0;q=c[g+92>>2]|0;k=c[g+96>>2]|0;X=c[b+88>>2]|0;ba=(c[d+88>>2]|0)-X|0;u=c[b+92>>2]|0;ca=(c[d+92>>2]|0)-u|0;i=c[b+96>>2]|0;U=(c[d+96>>2]|0)-i|0;W=c[(T|0?T:da)+12>>2]|0;Y=(c[W+88>>2]|0)-X|0;S=(c[W+92>>2]|0)-u|0;W=(c[W+96>>2]|0)-i|0;V=(J(S,U)|0)-(J(W,ca)|0)|0;W=(J(W,ba)|0)-(J(Y,U)|0)|0;S=(J(Y,ca)|0)-(J(S,ba)|0)|0;X=Vr(V|0,((V|0)<0)<<31>>31|0,X|0,((X|0)<0)<<31>>31|0)|0;Y=Q()|0;u=Vr(W|0,((W|0)<0)<<31>>31|0,u|0,((u|0)<0)<<31>>31|0)|0;t=Q()|0;i=Vr(S|0,((S|0)<0)<<31>>31|0,i|0,((i|0)<0)<<31>>31|0)|0;i=xv(X|0,Y|0,i|0,Q()|0)|0;t=xv(i|0,Q()|0,u|0,t|0)|0;u=Q()|0;i=Vr(S|0,((S|0)<0)<<31>>31|0,ca|0,((ca|0)<0)<<31>>31|0)|0;Y=Q()|0;X=Vr(W|0,((W|0)<0)<<31>>31|0,U|0,((U|0)<0)<<31>>31|0)|0;X=lv(i|0,Y|0,X|0,Q()|0)|0;Y=Q()|0;i=Vr(V|0,((V|0)<0)<<31>>31|0,U|0,((U|0)<0)<<31>>31|0)|0;_=Q()|0;Z=Vr(S|0,((S|0)<0)<<31>>31|0,ba|0,((ba|0)<0)<<31>>31|0)|0;Z=lv(i|0,_|0,Z|0,Q()|0)|0;_=Q()|0;i=Vr(W|0,((W|0)<0)<<31>>31|0,ba|0,((ba|0)<0)<<31>>31|0)|0;aa=Q()|0;$=Vr(V|0,((V|0)<0)<<31>>31|0,ca|0,((ca|0)<0)<<31>>31|0)|0;$=lv(i|0,aa|0,$|0,Q()|0)|0;aa=Q()|0;i=Vr(X|0,Y|0,h|0,((h|0)<0)<<31>>31|0)|0;R=Q()|0;m=Vr(Z|0,_|0,j|0,((j|0)<0)<<31>>31|0)|0;R=xv(m|0,Q()|0,i|0,R|0)|0;i=Q()|0;m=Vr($|0,aa|0,l|0,((l|0)<0)<<31>>31|0)|0;m=xv(R|0,i|0,m|0,Q()|0)|0;i=Q()|0;if((T|0)!=0?(c[T+12>>2]|0)!=0:0){g=h;b=j;d=l;n=T;o=i;while(1){n=c[(c[n+8>>2]|0)+4>>2]|0;l=n+12|0;j=c[l>>2]|0;h=c[j+88>>2]|0;P=Vr(h|0,((h|0)<0)<<31>>31|0,V|0,((V|0)<0)<<31>>31|0)|0;O=Q()|0;i=c[j+92>>2]|0;R=Vr(i|0,((i|0)<0)<<31>>31|0,W|0,((W|0)<0)<<31>>31|0)|0;O=xv(R|0,Q()|0,P|0,O|0)|0;P=Q()|0;j=c[j+96>>2]|0;R=Vr(j|0,((j|0)<0)<<31>>31|0,S|0,((S|0)<0)<<31>>31|0)|0;R=xv(O|0,P|0,R|0,Q()|0)|0;P=Q()|0;if((P|0)<(u|0)|(P|0)==(u|0)&R>>>0>>0){j=m;i=o;break}if((c[n+20>>2]|0)==(c[a+100>>2]|0)){j=m;i=o;break}P=Vr(X|0,Y|0,h|0,((h|0)<0)<<31>>31|0)|0;R=Q()|0;i=Vr(Z|0,_|0,i|0,((i|0)<0)<<31>>31|0)|0;R=xv(i|0,Q()|0,P|0,R|0)|0;i=Q()|0;j=Vr($|0,aa|0,j|0,((j|0)<0)<<31>>31|0)|0;j=xv(R|0,i|0,j|0,Q()|0)|0;i=Q()|0;if(!((i|0)>(o|0)|(i|0)==(o|0)&j>>>0>m>>>0)){j=m;i=o;break}c[e>>2]=n;R=c[l>>2]|0;g=c[R+88>>2]|0;b=c[R+92>>2]|0;d=c[R+96>>2]|0;if(!R)break;else{o=i;m=j}}h=g;l=d;n=c[f>>2]|0}else{b=j;n=da;j=m}g=Vr(X|0,Y|0,s|0,((s|0)<0)<<31>>31|0)|0;R=Q()|0;d=Vr(Z|0,_|0,q|0,((q|0)<0)<<31>>31|0)|0;R=xv(d|0,Q()|0,g|0,R|0)|0;g=Q()|0;d=Vr($|0,aa|0,k|0,((k|0)<0)<<31>>31|0)|0;d=xv(R|0,g|0,d|0,Q()|0)|0;g=Q()|0;a:do if(n)if(!(c[n+12>>2]|0))p=n;else{p=n;while(1){r=c[c[p+8>>2]>>2]|0;o=c[r+12>>2]|0;m=c[o+88>>2]|0;P=Vr(m|0,((m|0)<0)<<31>>31|0,V|0,((V|0)<0)<<31>>31|0)|0;O=Q()|0;n=c[o+92>>2]|0;R=Vr(n|0,((n|0)<0)<<31>>31|0,W|0,((W|0)<0)<<31>>31|0)|0;O=xv(R|0,Q()|0,P|0,O|0)|0;P=Q()|0;o=c[o+96>>2]|0;R=Vr(o|0,((o|0)<0)<<31>>31|0,S|0,((S|0)<0)<<31>>31|0)|0;R=xv(O|0,P|0,R|0,Q()|0)|0;P=Q()|0;if((P|0)<(u|0)|(P|0)==(u|0)&R>>>0>>0)break a;if((c[r+20>>2]|0)==(c[a+100>>2]|0))break a;m=Vr(X|0,Y|0,m|0,((m|0)<0)<<31>>31|0)|0;R=Q()|0;n=Vr(Z|0,_|0,n|0,((n|0)<0)<<31>>31|0)|0;R=xv(n|0,Q()|0,m|0,R|0)|0;n=Q()|0;m=Vr($|0,aa|0,o|0,((o|0)<0)<<31>>31|0)|0;m=xv(R|0,n|0,m|0,Q()|0)|0;n=Q()|0;if(!((n|0)>(g|0)|(n|0)==(g|0)&m>>>0>d>>>0))break a;c[f>>2]=r;R=c[r+12>>2]|0;g=c[R+88>>2]|0;d=c[R+92>>2]|0;k=c[R+96>>2]|0;if(!R){s=g;q=d;p=r;d=m;g=n;break}else{s=g;q=d;p=r;g=n;d=m}}}else p=0;while(0);i=lv(d|0,g|0,j|0,i|0)|0;d=Q()|0;if((d|0)>0|(d|0)==0&i>>>0>0){P=lv(0,0,S|0,((S|0)<0)<<31>>31|0)|0;R=Q()|0;K=s;g=h;L=q;j=b;M=k;m=l;o=i;n=d;while(1){O=g;I=c[e>>2]|0;b:while(1){N=(J(L-j|0,ca)|0)+(J(K-O|0,ba)|0)+(J(M-m|0,U)|0)|0;if(!I)break;if(!(c[I+12>>2]|0))break;E=c[(c[I>>2]|0)+8>>2]|0;if((c[E+20>>2]|0)<=(c[a+100>>2]|0))break;H=c[E+12>>2]|0;F=c[H+88>>2]|0;D=F-O|0;G=c[H+92>>2]|0;C=G-j|0;H=c[H+96>>2]|0;g=H-m|0;t=Vr(X|0,Y|0,D|0,((D|0)<0)<<31>>31|0)|0;B=Q()|0;r=Vr(Z|0,_|0,C|0,((C|0)<0)<<31>>31|0)|0;B=xv(r|0,Q()|0,t|0,B|0)|0;t=Q()|0;r=Vr($|0,aa|0,g|0,((g|0)<0)<<31>>31|0)|0;r=xv(B|0,t|0,r|0,Q()|0)|0;t=Q()|0;g=(J(C,ca)|0)+(J(D,ba)|0)+(J(g,U)|0)|0;do if((r|0)==0&(t|0)==0){if((g|0)>=0)break b}else{if((t|0)>=0)break b;if((g|0)>0){D=-1;v=g;u=((g|0)<0)<<31>>31}else{v=lv(0,0,g|0,((g|0)<0)<<31>>31|0)|0;u=Q()|0;D=(g|0)!=0&1;v=g|0?v:0;u=g|0?u:0}z=lv(0,0,r|0,t|0)|0;A=Q()|0;if((N|0)>0){g=1;r=-1;B=N;C=((N|0)<0)<<31>>31}else{B=lv(0,0,N|0,((N|0)<0)<<31>>31|0)|0;C=Q()|0;g=((N|0)!=0)<<31>>31;r=(N|0)!=0&1;B=N|0?B:0;C=N|0?C:0}if((n|0)>0|(n|0)==0&o>>>0>0){r=o;t=n}else{y=(o|0)!=0|(n|0)!=0;x=lv(0,0,o|0,n|0)|0;t=Q()|0;g=y?r:g;r=y?x:0;t=y?t:0}if((D|0)==(g|0)){if(!D)break;g=Vr(r|0,0,v|0,0)|0;w=Q()|0;ha=Vr(t|0,0,v|0,0)|0;ga=Q()|0;x=Vr(r|0,0,u|0,0)|0;y=Q()|0;fa=Vr(t|0,0,u|0,0)|0;v=Q()|0;x=xv(ha|0,0,x|0,0)|0;r=Q()|0;v=xv(ga|0,0,fa|0,v|0)|0;y=xv(v|0,Q()|0,y|0,0)|0;r=xv(y|0,Q()|0,r|0,0)|0;y=Q()|0;v=xv(0,x|0,g|0,w|0)|0;w=Q()|0;x=xv(r|0,y|0,(w>>>0>>0|(w|0)==(x|0)&v>>>0<0)&1|0,0)|0;y=Q()|0;r=Vr(B|0,0,z|0,0)|0;g=Q()|0;fa=Vr(C|0,0,z|0,0)|0;z=Q()|0;t=Vr(B|0,0,A|0,0)|0;u=Q()|0;A=Vr(C|0,0,A|0,0)|0;B=Q()|0;t=xv(fa|0,0,t|0,0)|0;C=Q()|0;B=xv(z|0,0,A|0,B|0)|0;u=xv(B|0,Q()|0,u|0,0)|0;C=xv(u|0,Q()|0,C|0,0)|0;u=Q()|0;g=xv(0,t|0,r|0,g|0)|0;r=Q()|0;t=xv(C|0,u|0,(r>>>0>>0|(r|0)==(t|0)&g>>>0<0)&1|0,0)|0;u=Q()|0;if(y>>>0>>0|(y|0)==(u|0)&x>>>0>>0)g=-1;else g=y>>>0>u>>>0|(y|0)==(u|0)&x>>>0>t>>>0?1:w>>>0>>0|(w|0)==(r|0)&v>>>0>>0?-1:(w>>>0>r>>>0|(w|0)==(r|0)&v>>>0>g>>>0)&1;g=J(g,D)|0}else g=D-g|0;if((g|0)<=-1)break b}while(0);n=K-F|0;O=L-G|0;o=M-H|0;n=Vr(X|0,Y|0,n|0,((n|0)<0)<<31>>31|0)|0;ha=Q()|0;O=Vr(Z|0,_|0,O|0,((O|0)<0)<<31>>31|0)|0;ha=xv(O|0,Q()|0,n|0,ha|0)|0;n=Q()|0;o=Vr($|0,aa|0,o|0,((o|0)<0)<<31>>31|0)|0;o=xv(ha|0,n|0,o|0,Q()|0)|0;n=Q()|0;ha=(I|0)==(T|0)?0:E;c[e>>2]=ha;O=F;j=G;m=H;I=ha}g=c[f>>2]|0;if(!g){g=110;break}if(!(c[g+12>>2]|0)){g=110;break}E=c[c[g+8>>2]>>2]|0;if((c[E+20>>2]|0)<=(c[a+100>>2]|0)){g=110;break}u=c[E+12>>2]|0;w=c[u+88>>2]|0;t=w-K|0;v=c[u+92>>2]|0;r=v-L|0;u=c[u+96>>2]|0;g=u-M|0;ha=Vr(t|0,((t|0)<0)<<31>>31|0,V|0,((V|0)<0)<<31>>31|0)|0;fa=Q()|0;ga=Vr(r|0,((r|0)<0)<<31>>31|0,W|0,((W|0)<0)<<31>>31|0)|0;fa=xv(ga|0,Q()|0,ha|0,fa|0)|0;ha=Q()|0;ga=Vr(P|0,R|0,g|0,((g|0)<0)<<31>>31|0)|0;if(!((fa|0)==(ga|0)&(ha|0)==(Q()|0))){g=110;break}y=Vr(X|0,Y|0,t|0,((t|0)<0)<<31>>31|0)|0;D=Q()|0;x=Vr(Z|0,_|0,r|0,((r|0)<0)<<31>>31|0)|0;D=xv(x|0,Q()|0,y|0,D|0)|0;y=Q()|0;x=Vr($|0,aa|0,g|0,((g|0)<0)<<31>>31|0)|0;x=xv(D|0,y|0,x|0,Q()|0)|0;y=Q()|0;g=(J(r,ca)|0)+(J(t,ba)|0)+(J(g,U)|0)|0;D=w-O|0;ga=v-j|0;C=u-m|0;D=Vr(X|0,Y|0,D|0,((D|0)<0)<<31>>31|0)|0;ha=Q()|0;ga=Vr(Z|0,_|0,ga|0,((ga|0)<0)<<31>>31|0)|0;ha=xv(ga|0,Q()|0,D|0,ha|0)|0;D=Q()|0;C=Vr($|0,aa|0,C|0,((C|0)<0)<<31>>31|0)|0;C=xv(ha|0,D|0,C|0,Q()|0)|0;D=Q()|0;if(!((D|0)>0|(D|0)==0&C>>>0>0)){g=110;break}if((x|0)==0&(y|0)==0){if((g|0)>=0){g=110;break}}else{if((y|0)>=0){g=110;break}if((g|0)>0){B=-1;u=g;t=((g|0)<0)<<31>>31}else{u=lv(0,0,g|0,((g|0)<0)<<31>>31|0)|0;t=Q()|0;B=(g|0)!=0&1;u=g|0?u:0;t=g|0?t:0}y=lv(0,0,x|0,y|0)|0;z=Q()|0;if((N|0)>0){g=1;r=-1;A=N;x=((N|0)<0)<<31>>31}else{A=lv(0,0,N|0,((N|0)<0)<<31>>31|0)|0;x=Q()|0;g=((N|0)!=0)<<31>>31;r=(N|0)!=0&1;A=N|0?A:0;x=N|0?x:0}if(!((n|0)>0|(n|0)==0&o>>>0>0)){ha=(o|0)!=0|(n|0)!=0;o=lv(0,0,o|0,n|0)|0;n=Q()|0;g=ha?r:g;o=ha?o:0;n=ha?n:0}if((B|0)==(g|0)){if(!B){g=110;break}ha=Vr(o|0,0,u|0,0)|0;g=Q()|0;r=Vr(n|0,0,u|0,0)|0;N=Q()|0;v=Vr(o|0,0,t|0,0)|0;w=Q()|0;u=Vr(n|0,0,t|0,0)|0;t=Q()|0;v=xv(r|0,0,v|0,0)|0;n=Q()|0;t=xv(N|0,0,u|0,t|0)|0;w=xv(t|0,Q()|0,w|0,0)|0;n=xv(w|0,Q()|0,n|0,0)|0;w=Q()|0;t=xv(0,v|0,ha|0,g|0)|0;u=Q()|0;v=xv(n|0,w|0,(u>>>0>>0|(u|0)==(v|0)&t>>>0<0)&1|0,0)|0;w=Q()|0;n=Vr(A|0,0,y|0,0)|0;g=Q()|0;ha=Vr(x|0,0,y|0,0)|0;N=Q()|0;o=Vr(A|0,0,z|0,0)|0;r=Q()|0;fa=Vr(x|0,0,z|0,0)|0;ga=Q()|0;o=xv(ha|0,0,o|0,0)|0;ha=Q()|0;ga=xv(N|0,0,fa|0,ga|0)|0;r=xv(ga|0,Q()|0,r|0,0)|0;ha=xv(r|0,Q()|0,ha|0,0)|0;r=Q()|0;g=xv(0,o|0,n|0,g|0)|0;n=Q()|0;o=xv(ha|0,r|0,(n>>>0>>0|(n|0)==(o|0)&g>>>0<0)&1|0,0)|0;r=Q()|0;if(w>>>0>>0|(w|0)==(r|0)&v>>>0>>0)g=-1;else g=w>>>0>r>>>0|(w|0)==(r|0)&v>>>0>o>>>0?1:u>>>0>>0|(u|0)==(n|0)&t>>>0>>0?-1:(u>>>0>n>>>0|(u|0)==(n|0)&t>>>0>g>>>0)&1;g=J(g,B)|0}else g=B-g|0;if((g|0)<=0){g=110;break}}c[f>>2]=E;M=c[E+12>>2]|0;K=c[M+88>>2]|0;g=O;L=c[M+92>>2]|0;M=c[M+96>>2]|0;o=C;n=D}if((g|0)==110)return}if((d|0)>=0)return;E=lv(0,0,S|0,((S|0)<0)<<31>>31|0)|0;F=Q()|0;j=p;g=l;c:while(1){C=g;B=j;d:while(1){D=(J(q-b|0,ca)|0)+(J(s-h|0,ba)|0)+(J(k-C|0,U)|0)|0;do if((B|0?c[B+12>>2]|0:0)?(ea=c[(c[B+4>>2]|0)+8>>2]|0,(c[ea+20>>2]|0)>(c[a+100>>2]|0)):0){A=c[ea+12>>2]|0;y=c[A+88>>2]|0;ha=y-s|0;z=c[A+92>>2]|0;ga=z-q|0;A=c[A+96>>2]|0;g=A-k|0;l=Vr(X|0,Y|0,ha|0,((ha|0)<0)<<31>>31|0)|0;fa=Q()|0;j=Vr(Z|0,_|0,ga|0,((ga|0)<0)<<31>>31|0)|0;fa=xv(j|0,Q()|0,l|0,fa|0)|0;l=Q()|0;j=Vr($|0,aa|0,g|0,((g|0)<0)<<31>>31|0)|0;j=xv(fa|0,l|0,j|0,Q()|0)|0;l=Q()|0;g=(J(ga,ca)|0)+(J(ha,ba)|0)+(J(g,U)|0)|0;if((j|0)==0&(l|0)==0)if((g|0)>0)break d;else break;if((l|0)<0){if((g|0)>0){x=-1;n=g;m=((g|0)<0)<<31>>31}else{n=lv(0,0,g|0,((g|0)<0)<<31>>31|0)|0;m=Q()|0;x=(g|0)!=0&1;n=g|0?n:0;m=g|0?m:0}t=lv(0,0,j|0,l|0)|0;u=Q()|0;if((D|0)>0){g=1;j=-1;v=D;w=((D|0)<0)<<31>>31}else{v=lv(0,0,D|0,((D|0)<0)<<31>>31|0)|0;w=Q()|0;g=((D|0)!=0)<<31>>31;j=(D|0)!=0&1;v=D|0?v:0;w=D|0?w:0}if((d|0)>0|(d|0)==0&i>>>0>0){j=i;l=d}else{ha=(i|0)!=0|(d|0)!=0;ga=lv(0,0,i|0,d|0)|0;l=Q()|0;g=ha?j:g;j=ha?ga:0;l=ha?l:0}if((x|0)==(g|0)){if(!x)break d;g=Vr(j|0,0,n|0,0)|0;o=Q()|0;fa=Vr(l|0,0,n|0,0)|0;T=Q()|0;p=Vr(j|0,0,m|0,0)|0;r=Q()|0;ha=Vr(l|0,0,m|0,0)|0;n=Q()|0;p=xv(fa|0,0,p|0,0)|0;j=Q()|0;n=xv(T|0,0,ha|0,n|0)|0;r=xv(n|0,Q()|0,r|0,0)|0;j=xv(r|0,Q()|0,j|0,0)|0;r=Q()|0;n=xv(0,p|0,g|0,o|0)|0;o=Q()|0;p=xv(j|0,r|0,(o>>>0

>>0|(o|0)==(p|0)&n>>>0<0)&1|0,0)|0;r=Q()|0;j=Vr(v|0,0,t|0,0)|0;g=Q()|0;ha=Vr(w|0,0,t|0,0)|0;T=Q()|0;l=Vr(v|0,0,u|0,0)|0;m=Q()|0;fa=Vr(w|0,0,u|0,0)|0;ga=Q()|0;l=xv(ha|0,0,l|0,0)|0;ha=Q()|0;ga=xv(T|0,0,fa|0,ga|0)|0;m=xv(ga|0,Q()|0,m|0,0)|0;ha=xv(m|0,Q()|0,ha|0,0)|0;m=Q()|0;g=xv(0,l|0,j|0,g|0)|0;j=Q()|0;l=xv(ha|0,m|0,(j>>>0>>0|(j|0)==(l|0)&g>>>0<0)&1|0,0)|0;m=Q()|0;if(r>>>0>>0|(r|0)==(m|0)&p>>>0>>0)g=-1;else g=r>>>0>m>>>0|(r|0)==(m|0)&p>>>0>l>>>0?1:o>>>0>>0|(o|0)==(j|0)&n>>>0>>0?-1:(o>>>0>j>>>0|(o|0)==(j|0)&n>>>0>g>>>0)&1;g=J(g,x)|0}else g=x-g|0;if((g|0)<1)break d}}while(0);g=c[e>>2]|0;if(!g){g=110;break c}if(!(c[g+12>>2]|0)){g=110;break c}w=c[(c[g+8>>2]|0)+4>>2]|0;if((c[w+20>>2]|0)<=(c[a+100>>2]|0)){g=110;break c}j=c[w+12>>2]|0;m=c[j+88>>2]|0;h=m-h|0;l=c[j+92>>2]|0;b=l-b|0;j=c[j+96>>2]|0;g=j-C|0;ha=Vr(h|0,((h|0)<0)<<31>>31|0,V|0,((V|0)<0)<<31>>31|0)|0;fa=Q()|0;ga=Vr(b|0,((b|0)<0)<<31>>31|0,W|0,((W|0)<0)<<31>>31|0)|0;fa=xv(ga|0,Q()|0,ha|0,fa|0)|0;ha=Q()|0;ga=Vr(E|0,F|0,g|0,((g|0)<0)<<31>>31|0)|0;if(!((fa|0)==(ga|0)&(ha|0)==(Q()|0))){g=110;break c}o=Vr(X|0,Y|0,h|0,((h|0)<0)<<31>>31|0)|0;v=Q()|0;n=Vr(Z|0,_|0,b|0,((b|0)<0)<<31>>31|0)|0;v=xv(n|0,Q()|0,o|0,v|0)|0;o=Q()|0;n=Vr($|0,aa|0,g|0,((g|0)<0)<<31>>31|0)|0;n=xv(v|0,o|0,n|0,Q()|0)|0;o=Q()|0;g=(J(b,ca)|0)+(J(h,ba)|0)+(J(g,U)|0)|0;v=s-m|0;ga=q-l|0;u=k-j|0;v=Vr(X|0,Y|0,v|0,((v|0)<0)<<31>>31|0)|0;ha=Q()|0;ga=Vr(Z|0,_|0,ga|0,((ga|0)<0)<<31>>31|0)|0;ha=xv(ga|0,Q()|0,v|0,ha|0)|0;v=Q()|0;u=Vr($|0,aa|0,u|0,((u|0)<0)<<31>>31|0)|0;u=xv(ha|0,v|0,u|0,Q()|0)|0;v=Q()|0;if((v|0)>=0){g=110;break c}if((n|0)==0&(o|0)==0){if((g|0)<=0){g=110;break c}}else{if((o|0)>=0){g=110;break c}if((g|0)>0){t=-1;j=g;h=((g|0)<0)<<31>>31}else{j=lv(0,0,g|0,((g|0)<0)<<31>>31|0)|0;h=Q()|0;t=(g|0)!=0&1;j=g|0?j:0;h=g|0?h:0}p=lv(0,0,n|0,o|0)|0;r=Q()|0;if((D|0)>0){b=1;n=D;o=((D|0)<0)<<31>>31;g=-1}else{n=lv(0,0,D|0,((D|0)<0)<<31>>31|0)|0;o=Q()|0;b=((D|0)!=0)<<31>>31;n=D|0?n:0;o=D|0?o:0;g=(D|0)!=0&1}if(!((d|0)>0|(d|0)==0&i>>>0>0)){ha=(i|0)!=0|(d|0)!=0;i=lv(0,0,i|0,d|0)|0;d=Q()|0;b=ha?g:b;i=ha?i:0;d=ha?d:0}if((t|0)==(b|0)){if(!t){g=110;break c}m=Vr(i|0,0,j|0,0)|0;l=Q()|0;b=Vr(d|0,0,j|0,0)|0;T=Q()|0;i=Vr(i|0,0,h|0,0)|0;j=Q()|0;ha=Vr(d|0,0,h|0,0)|0;g=Q()|0;i=xv(b|0,0,i|0,0)|0;b=Q()|0;g=xv(T|0,0,ha|0,g|0)|0;j=xv(g|0,Q()|0,j|0,0)|0;b=xv(j|0,Q()|0,b|0,0)|0;j=Q()|0;l=xv(0,i|0,m|0,l|0)|0;m=Q()|0;i=xv(b|0,j|0,(m>>>0>>0|(m|0)==(i|0)&l>>>0<0)&1|0,0)|0;j=Q()|0;b=Vr(n|0,0,p|0,0)|0;g=Q()|0;ha=Vr(o|0,0,p|0,0)|0;T=Q()|0;d=Vr(n|0,0,r|0,0)|0;h=Q()|0;fa=Vr(o|0,0,r|0,0)|0;ga=Q()|0;d=xv(ha|0,0,d|0,0)|0;ha=Q()|0;ga=xv(T|0,0,fa|0,ga|0)|0;h=xv(ga|0,Q()|0,h|0,0)|0;ha=xv(h|0,Q()|0,ha|0,0)|0;h=Q()|0;g=xv(0,d|0,b|0,g|0)|0;b=Q()|0;d=xv(ha|0,h|0,(b>>>0>>0|(b|0)==(d|0)&g>>>0<0)&1|0,0)|0;h=Q()|0;if(j>>>0>>0|(j|0)==(h|0)&i>>>0>>0)g=-1;else g=j>>>0>h>>>0|(j|0)==(h|0)&i>>>0>d>>>0?1:m>>>0>>0|(m|0)==(b|0)&l>>>0>>0?-1:(m>>>0>b>>>0|(m|0)==(b|0)&l>>>0>g>>>0)&1;g=J(g,t)|0}else g=t-b|0;if((g|0)>=0){g=110;break c}}c[e>>2]=w;C=c[w+12>>2]|0;h=c[C+88>>2]|0;b=c[C+92>>2]|0;C=c[C+96>>2]|0;B=c[f>>2]|0;d=v;i=u}d=y-h|0;s=z-b|0;i=A-C|0;d=Vr(X|0,Y|0,d|0,((d|0)<0)<<31>>31|0)|0;j=Q()|0;s=Vr(Z|0,_|0,s|0,((s|0)<0)<<31>>31|0)|0;j=xv(s|0,Q()|0,d|0,j|0)|0;d=Q()|0;i=Vr($|0,aa|0,i|0,((i|0)<0)<<31>>31|0)|0;i=xv(j|0,d|0,i|0,Q()|0)|0;d=Q()|0;j=(B|0)==(da|0)?0:ea;c[f>>2]=j;s=y;q=z;k=A;g=C}if((g|0)==110)return}function zb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,k=0,l=0.0,m=0,n=0.0,o=0.0,p=0,q=0,r=0.0,s=0,t=0.0,u=0,v=0.0,w=0,x=0,y=0.0,z=0.0,A=0.0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;I=sa;sa=sa+176|0;if((e|0)<1){f=c[b+12>>2]|0;if(f|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;f=c[b+32>>2]|0;if(f|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;f=c[b+52>>2]|0;if(f|0){if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+52>>2]=0}a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;sa=I;return}c[I+32>>2]=0;c[I+36>>2]=0;c[I+40>>2]=0;c[I+44>>2]=256;c[I+48>>2]=0;c[I+52>>2]=0;c[I+56>>2]=0;c[I+60>>2]=256;c[I+64>>2]=0;c[I+68>>2]=0;c[I+72>>2]=0;c[I+76>>2]=256;a[I+96>>0]=1;c[I+92>>2]=0;c[I+84>>2]=0;c[I+88>>2]=0;f=0;h=d;i=-246811958;q=1900671690;s=-246811958;u=1900671690;w=-246811958;x=1900671690;while(1){k=c[h>>2]|0;m=c[h+4>>2]|0;p=c[h+8>>2]|0;l=(c[j>>2]=k,+g[j>>2]);q=l<(c[j>>2]=q,+g[j>>2])?k:q;n=(c[j>>2]=m,+g[j>>2]);u=n<(c[j>>2]=u,+g[j>>2])?m:u;o=(c[j>>2]=p,+g[j>>2]);x=o<(c[j>>2]=x,+g[j>>2])?p:x;i=(c[j>>2]=i,+g[j>>2])>2]=s,+g[j>>2])>2]=w,+g[j>>2])>2]=i,+g[j>>2]);t=(c[j>>2]=q,+g[j>>2]);r=(c[j>>2]=s,+g[j>>2]);o=(c[j>>2]=u,+g[j>>2]);n=(c[j>>2]=w,+g[j>>2]);l=(c[j>>2]=x,+g[j>>2]);h=v-t>2]=h;f=v-t>>0)%3|0;c[I+104>>2]=f;q=(h^3)-f|0;c[I+108>>2]=q;y=((q+1|0)%3|0|0)==(h|0)?(v-t)*9.788566967472434e-05:-((v-t)*9.788566967472434e-05);z=((q+1|0)%3|0|0)==(h|0)?(r-o)*9.788566967472434e-05:-((r-o)*9.788566967472434e-05);A=((q+1|0)%3|0|0)==(h|0)?(n-l)*9.788566967472434e-05:-((n-l)*9.788566967472434e-05);g[I>>2]=y;g[I+4>>2]=z;g[I+8>>2]=A;g[I+12>>2]=0.0;y=y!=0.0?1.0/y:y;z=z!=0.0?1.0/z:z;A=A!=0.0?1.0/A:A;g[I+16>>2]=(v+t)*.5;g[I+20>>2]=(r+o)*.5;g[I+24>>2]=(n+l)*.5;g[I+28>>2]=0.0;q=I+144+16|0;a[q>>0]=1;s=I+144+12|0;c[s>>2]=0;c[I+144+4>>2]=0;c[I+144+8>>2]=0;c[7182]=(c[7182]|0)+1;f=xb((e<<4|3)+16|0)|0;if(!f)h=0;else{c[(f+4+15&-16)+-4>>2]=f;h=f+4+15&-16}i=c[I+144+4>>2]|0;k=c[s>>2]|0;if((i|0)<=0){if(k|0)H=25}else{f=0;do{H=h+(f<<4)|0;F=k+(f<<4)|0;c[H>>2]=c[F>>2];c[H+4>>2]=c[F+4>>2];c[H+8>>2]=c[F+8>>2];c[H+12>>2]=c[F+12>>2];f=f+1|0}while((f|0)!=(i|0));H=25}if((H|0)==25){if(a[q>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[s>>2]=0}a[q>>0]=1;c[s>>2]=h;c[I+144+8>>2]=e;c[h>>2]=c[I+128>>2];c[h+4>>2]=c[I+128+4>>2];c[h+8>>2]=c[I+128+8>>2];c[h+12>>2]=c[I+128+12>>2];if((e|0)!=1){f=1;do{F=(c[s>>2]|0)+(f<<4)|0;c[F>>2]=c[I+128>>2];c[F+4>>2]=c[I+128+4>>2];c[F+8>>2]=c[I+128+8>>2];c[F+12>>2]=c[I+128+12>>2];f=f+1|0}while((f|0)!=(e|0))}c[I+144+4>>2]=e;i=I+128+(c[I+108>>2]<<2)|0;k=c[s>>2]|0;m=I+128+(c[I+112>>2]<<2)|0;p=I+128+(c[I+104>>2]<<2)|0;l=+g[I+16>>2];n=+g[I+20>>2];o=+g[I+24>>2];h=0;f=d;while(1){t=z*(+g[f+4>>2]-n);v=A*(+g[f+8>>2]-o);g[I+128>>2]=y*(+g[f>>2]-l);g[I+128+4>>2]=t;g[I+128+8>>2]=v;g[I+128+12>>2]=0.0;c[k+(h<<4)>>2]=~~+g[i>>2];c[k+(h<<4)+4>>2]=~~+g[m>>2];c[k+(h<<4)+8>>2]=~~+g[p>>2];c[k+(h<<4)+12>>2]=h;h=h+1|0;if((h|0)==(e|0))break;else f=f+16|0}if((e|0)>1)pg(I+144|0,0,e+-1|0);c[I+36>>2]=c[I+32>>2];c[I+40>>2]=0;c[I+44>>2]=e;f=c[I+84>>2]|0;if((f|0)<(e|0)){if((c[I+88>>2]|0)<(e|0)){if(!e){h=0;k=f}else{c[7182]=(c[7182]|0)+1;h=xb((e<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}k=c[I+84>>2]|0}if((k|0)>0){i=0;do{c[h+(i<<2)>>2]=c[(c[I+92>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(k|0))}i=c[I+92>>2]|0;if(i|0){if(a[I+96>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[I+92>>2]=0}a[I+96>>0]=1;c[I+92>>2]=h;c[I+88>>2]=e}do{c[(c[I+92>>2]|0)+(f<<2)>>2]=0;f=f+1|0}while((f|0)!=(e|0))}c[I+84>>2]=e;m=0;do{f=c[I+40>>2]|0;if(!f){f=c[I+36>>2]|0;if(!f){c[7182]=(c[7182]|0)+1;f=xb(31)|0;if(!f)h=0;else{c[(f+4+15&-16)+-4>>2]=f;h=f+4+15&-16}f=c[I+44>>2]|0;c[h+4>>2]=f;i=h+8|0;c[i>>2]=0;c[7182]=(c[7182]|0)+1;f=xb((f*112|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}c[h>>2]=f;c[i>>2]=c[I+32>>2];c[I+32>>2]=h}else{c[I+36>>2]=c[f+8>>2];h=f}f=c[h>>2]|0;k=c[h+4>>2]|0;if((k|0)>0?(c[f>>2]=(k|0)!=1?f+112|0:0,(k|0)!=1):0){h=1;i=f+112|0;do{h=h+1|0;F=(h|0)<(k|0);E=i;i=i+112|0;c[E>>2]=F?i:0}while(F)}}c[I+40>>2]=c[f>>2];F=f+104|0;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[F>>2]=-1;c[f+8>>2]=0;D=(c[s>>2]|0)+(m<<4)|0;E=f+88|0;c[E>>2]=c[D>>2];c[E+4>>2]=c[D+4>>2];c[E+8>>2]=c[D+8>>2];c[E+12>>2]=c[D+12>>2];c[F>>2]=-1;c[(c[I+92>>2]|0)+(m<<2)>>2]=f;m=m+1|0}while((m|0)<(e|0));f=c[s>>2]|0;if(f|0){if(a[q>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[s>>2]=0}a[q>>0]=1;c[s>>2]=0;c[I+144+4>>2]=0;c[I+144+8>>2]=0;c[I+52>>2]=c[I+48>>2];c[I+56>>2]=0;c[I+60>>2]=e*6;c[I+116>>2]=0;c[I+120>>2]=0;c[I+100>>2]=-3;c[I+128>>2]=0;c[I+128+4>>2]=0;c[I+128+8>>2]=0;c[I+128+12>>2]=0;ub(I,0,e,I+128|0);c[I+124>>2]=c[I+128>>2];f=c[s>>2]|0;if(f|0){if(a[q>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[s>>2]=0}f=c[b+4>>2]|0;if((f|0)<0){if((c[b+8>>2]|0)<0){h=c[b+12>>2]|0;if(h|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=0;c[b+8>>2]=0}do{F=(c[b+12>>2]|0)+(f<<4)|0;c[F>>2]=c[I+144>>2];c[F+4>>2]=c[I+144+4>>2];c[F+8>>2]=c[I+144+8>>2];c[F+12>>2]=c[I+144+12>>2];f=f+1|0}while((f|0)!=0)}c[b+4>>2]=0;c[I+144>>2]=0;c[I+144+4>>2]=0;c[I+144+8>>2]=0;f=c[b+24>>2]|0;if((f|0)<0){if((c[b+28>>2]|0)<0){h=c[b+32>>2]|0;if(h|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+28>>2]=0}do{F=(c[b+32>>2]|0)+(f*12|0)|0;c[F>>2]=c[I+144>>2];c[F+4>>2]=c[I+144+4>>2];c[F+8>>2]=c[I+144+8>>2];f=f+1|0}while((f|0)!=0)}c[b+24>>2]=0;h=c[b+44>>2]|0;if((h|0)<0){f=c[b+52>>2]|0;if((c[b+48>>2]|0)<0){if(f|0?a[b+56>>0]|0:0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}a[b+56>>0]=1;c[b+52>>2]=0;c[b+48>>2]=0;f=0}mk(f+(h<<2)|0,0,J(h,-4)|0)|0}c[b+44>>2]=0;h=c[I+124>>2]|0;if((c[h+104>>2]|0)<0){c[h+104>>2]=0;c[7182]=(c[7182]|0)+1;f=xb(23)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}c[f>>2]=h;F=0;p=1;q=f;s=1;i=f;w=f;while(1){if((c[h+100>>2]|0)>-1){g[I+144+(c[I+108>>2]<<2)>>2]=+(c[h+88>>2]|0);g[I+144+(c[I+112>>2]<<2)>>2]=+(c[h+92>>2]|0);l=+(c[h+96>>2]|0)}else{l=+tk(h+24|0);E=h+72|0;l=l/+tk(E);g[I+144+(c[I+108>>2]<<2)>>2]=l;l=+tk(h+40|0);l=l/+tk(E);g[I+144+(c[I+112>>2]<<2)>>2]=l;l=+tk(h+56|0);l=l/+tk(E)}g[I+144+(c[I+104>>2]<<2)>>2]=l;l=+g[I+144>>2]*+g[I>>2]+ +g[I+16>>2];n=+g[I+144+4>>2]*+g[I+4>>2]+ +g[I+20>>2];o=+g[I+144+8>>2]*+g[I+8>>2]+ +g[I+24>>2];k=c[b+4>>2]|0;if((k|0)==(c[b+8>>2]|0)?(G=(k|0)==0?1:k<<1,(k|0)<(G|0)):0){if(!G)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((G<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}k=c[b+4>>2]|0}if((k|0)>0){m=0;do{E=f+(m<<4)|0;D=(c[b+12>>2]|0)+(m<<4)|0;c[E>>2]=c[D>>2];c[E+4>>2]=c[D+4>>2];c[E+8>>2]=c[D+8>>2];c[E+12>>2]=c[D+12>>2];m=m+1|0}while((m|0)!=(k|0))}k=c[b+12>>2]|0;if(k|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=f;c[b+8>>2]=G;f=c[b+4>>2]|0}else f=k;E=c[b+12>>2]|0;g[E+(f<<4)>>2]=l;g[E+(f<<4)+4>>2]=n;g[E+(f<<4)+8>>2]=o;g[E+(f<<4)+12>>2]=0.0;c[b+4>>2]=(c[b+4>>2]|0)+1;E=c[h+8>>2]|0;if(!E){k=p;x=q;h=s}else{C=E;D=-1;f=-1;x=p;e=q;h=s;while(1){B=C+20|0;m=c[B>>2]|0;if((m|0)<0){d=c[b+24>>2]|0;c[I+144>>2]=0;c[I+144+4>>2]=0;c[I+144+8>>2]=0;do if((d|0)==(c[b+28>>2]|0)){q=(d|0)==0?1:d<<1;if((d|0)>=(q|0)){k=d;break}if(!q){k=0;p=d}else{c[7182]=(c[7182]|0)+1;k=xb((q*12|3)+16|0)|0;if(!k)k=0;else{c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16}p=c[b+24>>2]|0}if((p|0)>0){m=0;do{u=k+(m*12|0)|0;s=(c[b+32>>2]|0)+(m*12|0)|0;c[u>>2]=c[s>>2];c[u+4>>2]=c[s+4>>2];c[u+8>>2]=c[s+8>>2];m=m+1|0}while((m|0)!=(p|0))}m=c[b+32>>2]|0;if(m|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=k;c[b+28>>2]=q;k=c[b+24>>2]|0}else k=d;while(0);k=(c[b+32>>2]|0)+(k*12|0)|0;c[k>>2]=c[I+144>>2];c[k+4>>2]=c[I+144+4>>2];c[k+8>>2]=c[I+144+8>>2];k=(c[b+24>>2]|0)+1|0;c[b+24>>2]=k;c[I+144>>2]=0;c[I+144+4>>2]=0;c[I+144+8>>2]=0;do if((k|0)==(c[b+28>>2]|0)){q=(k|0)==0?1:k<<1;if((k|0)>=(q|0))break;if(!q)p=0;else{c[7182]=(c[7182]|0)+1;k=xb((q*12|3)+16|0)|0;if(!k)k=0;else{c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16}p=k;k=c[b+24>>2]|0}if((k|0)>0){m=0;do{u=p+(m*12|0)|0;s=(c[b+32>>2]|0)+(m*12|0)|0;c[u>>2]=c[s>>2];c[u+4>>2]=c[s+4>>2];c[u+8>>2]=c[s+8>>2];m=m+1|0}while((m|0)!=(k|0))}k=c[b+32>>2]|0;if(k|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=p;c[b+28>>2]=q;k=c[b+24>>2]|0}while(0);u=(c[b+32>>2]|0)+(k*12|0)|0;c[u>>2]=c[I+144>>2];c[u+4>>2]=c[I+144+4>>2];c[u+8>>2]=c[I+144+8>>2];c[b+24>>2]=(c[b+24>>2]|0)+1;u=c[b+32>>2]|0;c[B>>2]=d;c[(c[C+8>>2]|0)+20>>2]=d+1;c[u+(d*12|0)+4>>2]=1;c[u+((d+1|0)*12|0)+4>>2]=-1;s=c[C+12>>2]|0;k=c[s+104>>2]|0;if((k|0)<0){c[s+104>>2]=h;do if((h|0)==(x|0)){k=(x|0)==0?1:x<<1;if((x|0)>=(k|0)){k=x;m=e;q=w;break}do if(!k)p=0;else{c[7182]=(c[7182]|0)+1;m=xb((k<<2|3)+16|0)|0;if(!m){p=0;break}c[(m+4+15&-16)+-4>>2]=m;p=m+4+15&-16}while(0);if((x|0)>0){m=0;do{c[p+(m<<2)>>2]=c[e+(m<<2)>>2];m=m+1|0}while((m|0)!=(x|0));if(!i){m=p;q=p;i=p;break}}else if((e|0)==0|(i|0)==0){m=p;q=p;i=p;break}c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);m=p;q=p;i=p}else{k=x;m=e;q=w}while(0);c[m+(h<<2)>>2]=s;s=h;h=h+1|0;p=q}else{s=k;k=x;m=e;p=w}c[u+(d*12|0)+8>>2]=s;c[u+((d+1|0)*12|0)+8>>2]=F;q=m;m=c[B>>2]|0}else{k=x;q=e;p=w}if((D|0)>-1)c[(c[b+32>>2]|0)+(m*12|0)>>2]=D-m;else f=m;C=c[C>>2]|0;if((C|0)==(E|0))break;else{D=m;x=k;e=q;w=p}}c[(c[b+32>>2]|0)+(f*12|0)>>2]=m-f;x=q;w=p}f=F+1|0;if((f|0)>=(h|0))break;F=f;p=k;q=x;s=h;h=c[x+(f<<2)>>2]|0}s=0;while(1){u=c[(c[x+(s<<2)>>2]|0)+8>>2]|0;if(u|0){q=u;do{p=q+20|0;f=c[p>>2]|0;if((f|0)>-1){h=c[b+44>>2]|0;do if((h|0)==(c[b+48>>2]|0)){m=(h|0)==0?1:h<<1;if((h|0)>=(m|0))break;if(!m)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((m<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[b+44>>2]|0}k=c[b+52>>2]|0;if((h|0)<=0){if(k)H=186}else{i=0;do{c[f+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0));H=186}if((H|0)==186){H=0;if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[b+52>>2]=0;h=c[b+44>>2]|0}a[b+56>>0]=1;c[b+52>>2]=f;c[b+48>>2]=m;f=c[p>>2]|0}while(0);c[(c[b+52>>2]|0)+(h<<2)>>2]=f;c[b+44>>2]=(c[b+44>>2]|0)+1;f=q;do{c[f+20>>2]=-1;f=c[(c[f+8>>2]|0)+4>>2]|0}while((f|0)!=(q|0))}q=c[q>>2]|0}while((q|0)!=(u|0))}if((s|0)==(F|0))break;else s=s+1|0}if(!((x|0)==0|(w|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[w+-4>>2]|0)}}bi(I);sa=I;return}function Ab(b){b=b|0;var d=0,e=0.0,f=0.0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0;I=sa;sa=sa+64|0;if(!(a[b+356>>0]|0)){b=a[b+312>>0]|0;b=b<<24>>24!=0;sa=I;return b|0}c[b+336>>2]=0;c[b+336+4>>2]=0;c[b+336+8>>2]=0;c[b+336+12>>2]=0;a[b+336+16>>0]=0;o=a[b+332>>0]|0;a[b+332>>0]=o&-16;a[b+356>>0]=0;switch(c[b>>2]|0){case 0:{a[b+312>>0]=0;b=0;b=b<<24>>24!=0;sa=I;return b|0}case 1:{c[b+244>>2]=c[b+84>>2];c[b+244+4>>2]=c[b+84+4>>2];c[b+244+8>>2]=c[b+84+8>>2];c[b+244+12>>2]=c[b+84+12>>2];c[b+260>>2]=c[b+164>>2];c[b+260+4>>2]=c[b+164+4>>2];c[b+260+8>>2]=c[b+164+8>>2];c[b+260+12>>2]=c[b+164+12>>2];E=+g[b+248>>2]-+g[b+264>>2];F=+g[b+252>>2]-+g[b+268>>2];g[b+276>>2]=+g[b+244>>2]-+g[b+260>>2];g[b+280>>2]=E;g[b+284>>2]=F;g[b+288>>2]=0.0;a[b+352>>0]=0;a[b+332>>0]=o&-16;g[b+336>>2]=1.0;g[b+340>>2]=0.0;g[b+344>>2]=0.0;g[b+348>>2]=0.0;a[b+312>>0]=1;b=1;b=b<<24>>24!=0;sa=I;return b|0}case 2:{e=+g[b+4>>2];f=+g[b+8>>2];j=+g[b+12>>2];k=+g[b+20>>2]-e;l=+g[b+24>>2]-f;m=+g[b+28>>2]-j;if((0.0-e)*k+(0.0-f)*l+(0.0-j)*m>0.0)if((0.0-e)*k+(0.0-f)*l+(0.0-j)*m>0]=o&-16|h;e=1.0-f;g[b+336>>2]=e;g[b+340>>2]=f;g[b+344>>2]=0.0;g[b+348>>2]=0.0;A=+g[b+84>>2];C=+g[b+88>>2];E=+g[b+92>>2];A=A+f*(+g[b+100>>2]-A);C=C+f*(+g[b+104>>2]-C);E=E+f*(+g[b+108>>2]-E);g[b+244>>2]=A;g[b+248>>2]=C;g[b+252>>2]=E;g[b+256>>2]=0.0;B=+g[b+164>>2];D=+g[b+168>>2];F=+g[b+172>>2];B=B+f*(+g[b+180>>2]-B);D=D+f*(+g[b+184>>2]-D);F=F+f*(+g[b+188>>2]-F);g[b+260>>2]=B;g[b+264>>2]=D;g[b+268>>2]=F;g[b+272>>2]=0.0;g[b+276>>2]=A-B;g[b+280>>2]=C-D;g[b+284>>2]=E-F;g[b+288>>2]=0.0;if(!(h&2)){c[b>>2]=1;d=0}else d=1;if(!(h&1)){q=b+4+(d<<4)|0;G=b+84+(d<<4)|0;H=b+164+(d<<4)|0;c[b>>2]=d;c[b+4>>2]=c[q>>2];c[b+4+4>>2]=c[q+4>>2];c[b+4+8>>2]=c[q+8>>2];c[b+4+12>>2]=c[q+12>>2];c[b+84>>2]=c[G>>2];c[b+84+4>>2]=c[G+4>>2];c[b+84+8>>2]=c[G+8>>2];c[b+84+12>>2]=c[G+12>>2];c[b+164>>2]=c[H>>2];c[b+164+4>>2]=c[H+4>>2];c[b+164+8>>2]=c[H+8>>2];c[b+164+12>>2]=c[H+12>>2]}H=f>=0.0&e>=0.0&1;a[b+312>>0]=H;b=H;b=b<<24>>24!=0;sa=I;return b|0}case 3:{c[I+16>>2]=0;c[I+16+4>>2]=0;c[I+16+8>>2]=0;c[I+16+12>>2]=0;oe(I+16|0,b+4|0,b+20|0,b+36|0,b+316|0);F=+g[b+336>>2];e=+g[b+340>>2];f=+g[b+344>>2];A=+g[b+84>>2]*F+ +g[b+100>>2]*e+ +g[b+116>>2]*f;C=F*+g[b+88>>2]+e*+g[b+104>>2]+f*+g[b+120>>2];E=F*+g[b+92>>2]+e*+g[b+108>>2]+f*+g[b+124>>2];g[b+244>>2]=A;g[b+248>>2]=C;g[b+252>>2]=E;g[b+256>>2]=0.0;B=F*+g[b+164>>2]+e*+g[b+180>>2]+f*+g[b+196>>2];D=F*+g[b+168>>2]+e*+g[b+184>>2]+f*+g[b+200>>2];F=F*+g[b+172>>2]+e*+g[b+188>>2]+f*+g[b+204>>2];g[b+260>>2]=B;g[b+264>>2]=D;g[b+268>>2]=F;g[b+272>>2]=0.0;g[b+276>>2]=A-B;g[b+280>>2]=C-D;g[b+284>>2]=E-F;g[b+288>>2]=0.0;o=c[b>>2]|0;do if((o|0)>3){d=a[b+332>>0]|0;if(!(d&8)){h=b+164+(o+-1<<4)|0;n=b+84+(o+-1<<4)|0;i=b+4+(o+-1<<4)|0;c[b>>2]=o+-1;c[b+52>>2]=c[i>>2];c[b+52+4>>2]=c[i+4>>2];c[b+52+8>>2]=c[i+8>>2];c[b+52+12>>2]=c[i+12>>2];c[b+132>>2]=c[n>>2];c[b+132+4>>2]=c[n+4>>2];c[b+132+8>>2]=c[n+8>>2];c[b+132+12>>2]=c[n+12>>2];c[b+212>>2]=c[h>>2];c[b+212+4>>2]=c[h+4>>2];c[b+212+8>>2]=c[h+8>>2];c[b+212+12>>2]=c[h+12>>2];h=b+332|0;n=d;i=o+-1|0;H=19}else{h=b+332|0;n=d;i=o;H=19}}else{if((o|0)==3){h=b+332|0;n=a[b+332>>0]|0;i=3;H=19;break}if((o|0)<=1){if((o|0)==1){d=1;H=26}}else{d=2;H=22}}while(0);if((H|0)==19){d=i+-1|0;if(!(n&4)){c[b>>2]=d;c[b+36>>2]=c[b+4+(d<<4)>>2];c[b+36+4>>2]=c[b+4+(d<<4)+4>>2];c[b+36+8>>2]=c[b+4+(d<<4)+8>>2];c[b+36+12>>2]=c[b+4+(d<<4)+12>>2];c[b+116>>2]=c[b+84+(d<<4)>>2];c[b+116+4>>2]=c[b+84+(d<<4)+4>>2];c[b+116+8>>2]=c[b+84+(d<<4)+8>>2];c[b+116+12>>2]=c[b+84+(d<<4)+12>>2];c[b+196>>2]=c[b+164+(d<<4)>>2];c[b+196+4>>2]=c[b+164+(d<<4)+4>>2];c[b+196+8>>2]=c[b+164+(d<<4)+8>>2];c[b+196+12>>2]=c[b+164+(d<<4)+12>>2];H=23}else{d=i;H=22}}if((H|0)==22){h=b+332|0;H=23}if((H|0)==23){i=d+-1|0;if(!(a[h>>0]&2)){c[b>>2]=i;c[b+20>>2]=c[b+4+(i<<4)>>2];c[b+20+4>>2]=c[b+4+(i<<4)+4>>2];c[b+20+8>>2]=c[b+4+(i<<4)+8>>2];c[b+20+12>>2]=c[b+4+(i<<4)+12>>2];c[b+100>>2]=c[b+84+(i<<4)>>2];c[b+100+4>>2]=c[b+84+(i<<4)+4>>2];c[b+100+8>>2]=c[b+84+(i<<4)+8>>2];c[b+100+12>>2]=c[b+84+(i<<4)+12>>2];c[b+180>>2]=c[b+164+(i<<4)>>2];c[b+180+4>>2]=c[b+164+(i<<4)+4>>2];c[b+180+8>>2]=c[b+164+(i<<4)+8>>2];c[b+180+12>>2]=c[b+164+(i<<4)+12>>2];n=h;H=27}else H=26}if((H|0)==26){n=b+332|0;i=d;H=27}if((H|0)==27?(p=i+-1|0,(a[n>>0]&1)==0):0){c[b>>2]=p;c[b+4>>2]=c[b+4+(p<<4)>>2];c[b+4+4>>2]=c[b+4+(p<<4)+4>>2];c[b+4+8>>2]=c[b+4+(p<<4)+8>>2];c[b+4+12>>2]=c[b+4+(p<<4)+12>>2];c[b+84>>2]=c[b+84+(p<<4)>>2];c[b+84+4>>2]=c[b+84+(p<<4)+4>>2];c[b+84+8>>2]=c[b+84+(p<<4)+8>>2];c[b+84+12>>2]=c[b+84+(p<<4)+12>>2];c[b+164>>2]=c[b+164+(p<<4)>>2];c[b+164+4>>2]=c[b+164+(p<<4)+4>>2];c[b+164+8>>2]=c[b+164+(p<<4)+8>>2];c[b+164+12>>2]=c[b+164+(p<<4)+12>>2]}if((e>=0.0?!(+g[b+336>>2]>=0.0):1)|!(f>=0.0))d=0;else d=+g[b+348>>2]>=0.0&1;a[b+312>>0]=d;b=d;b=b<<24>>24!=0;sa=I;return b|0}case 4:{c[I>>2]=0;c[I+4>>2]=0;c[I+8>>2]=0;c[I+12>>2]=0;q=I+16+16|0;a[q>>0]=0;c[b+316>>2]=0;c[b+316+4>>2]=0;c[b+316+8>>2]=0;c[b+316+12>>2]=0;a[b+332>>0]=o|15;K=+g[b+20>>2];T=+g[b+4>>2];Q=+g[b+24>>2];J=+g[b+8>>2];M=+g[b+28>>2];U=+g[b+12>>2];P=+g[b+36>>2];R=+g[b+40>>2];N=+g[b+44>>2];L=+g[b+52>>2];S=+g[b+56>>2];O=+g[b+60>>2];V=((Q-J)*(N-U)-(M-U)*(R-J))*(L-T)+((M-U)*(P-T)-(K-T)*(N-U))*(S-J)+((K-T)*(R-J)-(Q-J)*(P-T))*(O-U);i=V*V<9.99999905104687e-09?-1:((0.0-T)*((Q-J)*(N-U)-(M-U)*(R-J))+(0.0-J)*((M-U)*(P-T)-(K-T)*(N-U))+((K-T)*(R-J)-(Q-J)*(P-T))*(0.0-U))*V<0.0&1;V=(M-U)*((P-T)*(S-J)-(R-J)*(L-T))+((K-T)*((R-J)*(O-U)-(N-U)*(S-J))+(Q-J)*((N-U)*(L-T)-(P-T)*(O-U)));n=V*V<9.99999905104687e-09?-1:((0.0-U)*((P-T)*(S-J)-(R-J)*(L-T))+((0.0-T)*((R-J)*(O-U)-(N-U)*(S-J))+(0.0-J)*((N-U)*(L-T)-(P-T)*(O-U))))*V<0.0&1;V=(N-U)*((Q-J)*(L-T)-(K-T)*(S-J))+((P-T)*((M-U)*(S-J)-(Q-J)*(O-U))+(R-J)*((K-T)*(O-U)-(M-U)*(L-T)));o=V*V<9.99999905104687e-09?-1:((0.0-U)*((Q-J)*(L-T)-(K-T)*(S-J))+((0.0-T)*((M-U)*(S-J)-(Q-J)*(O-U))+(0.0-J)*((K-T)*(O-U)-(M-U)*(L-T))))*V<0.0&1;J=(U-M)*((R-Q)*(L-K)-(P-K)*(S-Q))+((T-K)*((N-M)*(S-Q)-(R-Q)*(O-M))+(J-Q)*((P-K)*(O-M)-(N-M)*(L-K)));p=J*J<9.99999905104687e-09?-1:((0.0-M)*((R-Q)*(L-K)-(P-K)*(S-Q))+((0.0-K)*((N-M)*(S-Q)-(R-Q)*(O-M))+(0.0-Q)*((P-K)*(O-M)-(N-M)*(L-K))))*J<0.0&1;do if((n|i|o|p|0)<0){a[b+352>>0]=1;d=b+312|0;H=68}else{if(!(n|i|o|p)){if(a[b+352>>0]|0){d=b+312|0;H=68;break}a[b+312>>0]=1;c[b+276>>2]=0;c[b+276+4>>2]=0;c[b+276+8>>2]=0;c[b+276+12>>2]=0;d=1;break}if((i|0)!=0?(oe(I,b+4|0,b+20|0,b+36|0,I+16|0),e=+g[I+16>>2],f=+g[I+16+4>>2],j=+g[I+16+8>>2],k=e-+g[I>>2],l=f-+g[I+4>>2],m=j-+g[I+8>>2],k*k+l*l+m*m<3402823466385288598117041.0e14):0){W=c[I+16+12>>2]|0;g[b+316>>2]=e;g[b+320>>2]=f;g[b+324>>2]=j;c[b+328>>2]=W;W=a[q>>0]|0;a[b+332>>0]=W&1|a[b+332>>0]&-16|W&2|W&4;W=c[I+16+24>>2]|0;i=c[I+16+28>>2]|0;c[b+336>>2]=c[I+16+20>>2];c[b+340>>2]=W;c[b+344>>2]=i;g[b+348>>2]=0.0;e=k*k+l*l+m*m}else e=3402823466385288598117041.0e14;if((n|0)!=0?(oe(I,b+4|0,b+36|0,b+52|0,I+16|0),r=+g[I+16>>2],s=+g[I+16+4>>2],t=+g[I+16+8>>2],u=r-+g[I>>2],v=s-+g[I+4>>2],w=t-+g[I+8>>2],u*u+v*v+w*w>2]|0;g[b+316>>2]=r;g[b+320>>2]=s;g[b+324>>2]=t;c[b+328>>2]=n;n=a[q>>0]|0;a[b+332>>0]=n&1|a[b+332>>0]&-16|n<<1&4|n<<1&8;n=c[I+16+24>>2]|0;W=c[I+16+28>>2]|0;c[b+336>>2]=c[I+16+20>>2];g[b+340>>2]=0.0;c[b+344>>2]=n;c[b+348>>2]=W;e=u*u+v*v+w*w}if((o|0)!=0?(oe(I,b+4|0,b+52|0,b+20|0,I+16|0),x=+g[I+16>>2],y=+g[I+16+4>>2],z=+g[I+16+8>>2],A=x-+g[I>>2],B=y-+g[I+4>>2],C=z-+g[I+8>>2],A*A+B*B+C*C>2]|0;g[b+316>>2]=x;g[b+320>>2]=y;g[b+324>>2]=z;c[b+328>>2]=o;o=a[q>>0]|0;a[b+332>>0]=o&1|a[b+332>>0]&-16|(1?(o&255)>>>1:o&255)&2|o<<2&8;o=c[I+16+28>>2]|0;W=c[I+16+24>>2]|0;c[b+336>>2]=c[I+16+20>>2];c[b+340>>2]=o;g[b+344>>2]=0.0;c[b+348>>2]=W;e=A*A+B*B+C*C}if(p|0?(oe(I,b+20|0,b+52|0,b+36|0,I+16|0),D=+g[I+16>>2],E=+g[I+16+4>>2],F=+g[I+16+8>>2],T=D-+g[I>>2],U=E-+g[I+4>>2],V=F-+g[I+8>>2],T*T+U*U+V*V>2]|0;g[b+316>>2]=D;g[b+320>>2]=E;g[b+324>>2]=F;c[b+328>>2]=p;p=a[q>>0]|0;a[b+332>>0]=p&4|a[b+332>>0]&-16|p<<1&2|p<<2&8;p=c[I+16+20>>2]|0;q=c[I+16+28>>2]|0;W=c[I+16+24>>2]|0;g[b+336>>2]=0.0;c[b+340>>2]=p;c[b+344>>2]=q;c[b+348>>2]=W}O=+g[b+336>>2];P=+g[b+340>>2];V=+g[b+344>>2];e=+g[b+348>>2];Q=+g[b+84>>2]*O+ +g[b+100>>2]*P+ +g[b+116>>2]*V+ +g[b+132>>2]*e;S=O*+g[b+88>>2]+P*+g[b+104>>2]+V*+g[b+120>>2]+e*+g[b+136>>2];U=O*+g[b+92>>2]+P*+g[b+108>>2]+V*+g[b+124>>2]+e*+g[b+140>>2];g[b+244>>2]=Q;g[b+248>>2]=S;g[b+252>>2]=U;g[b+256>>2]=0.0;R=O*+g[b+164>>2]+P*+g[b+180>>2]+V*+g[b+196>>2]+e*+g[b+212>>2];T=O*+g[b+168>>2]+P*+g[b+184>>2]+V*+g[b+200>>2]+e*+g[b+216>>2];V=O*+g[b+172>>2]+P*+g[b+188>>2]+V*+g[b+204>>2]+e*+g[b+220>>2];g[b+260>>2]=R;g[b+264>>2]=T;g[b+268>>2]=V;g[b+272>>2]=0.0;g[b+276>>2]=Q-R;g[b+280>>2]=S-T;g[b+284>>2]=U-V;g[b+288>>2]=0.0;i=c[b>>2]|0;do if((i|0)>3){d=a[b+332>>0]|0;if(!(d&8)){h=b+164+(i+-1<<4)|0;n=b+84+(i+-1<<4)|0;H=b+4+(i+-1<<4)|0;c[b>>2]=i+-1;c[b+52>>2]=c[H>>2];c[b+52+4>>2]=c[H+4>>2];c[b+52+8>>2]=c[H+8>>2];c[b+52+12>>2]=c[H+12>>2];c[b+132>>2]=c[n>>2];c[b+132+4>>2]=c[n+4>>2];c[b+132+8>>2]=c[n+8>>2];c[b+132+12>>2]=c[n+12>>2];c[b+212>>2]=c[h>>2];c[b+212+4>>2]=c[h+4>>2];c[b+212+8>>2]=c[h+8>>2];c[b+212+12>>2]=c[h+12>>2];h=b+332|0;n=d;i=i+-1|0;H=52}else{h=b+332|0;n=d;H=52}}else{if((i|0)==3){h=b+332|0;n=a[b+332>>0]|0;i=3;H=52;break}if((i|0)<=1){if((i|0)==1){d=1;H=59}}else{d=2;H=55}}while(0);if((H|0)==52){d=i+-1|0;if(!(n&4)){c[b>>2]=d;c[b+36>>2]=c[b+4+(d<<4)>>2];c[b+36+4>>2]=c[b+4+(d<<4)+4>>2];c[b+36+8>>2]=c[b+4+(d<<4)+8>>2];c[b+36+12>>2]=c[b+4+(d<<4)+12>>2];c[b+116>>2]=c[b+84+(d<<4)>>2];c[b+116+4>>2]=c[b+84+(d<<4)+4>>2];c[b+116+8>>2]=c[b+84+(d<<4)+8>>2];c[b+116+12>>2]=c[b+84+(d<<4)+12>>2];c[b+196>>2]=c[b+164+(d<<4)>>2];c[b+196+4>>2]=c[b+164+(d<<4)+4>>2];c[b+196+8>>2]=c[b+164+(d<<4)+8>>2];c[b+196+12>>2]=c[b+164+(d<<4)+12>>2];H=56}else{d=i;H=55}}if((H|0)==55){h=b+332|0;H=56}if((H|0)==56){i=d+-1|0;if(!(a[h>>0]&2)){c[b>>2]=i;c[b+20>>2]=c[b+4+(i<<4)>>2];c[b+20+4>>2]=c[b+4+(i<<4)+4>>2];c[b+20+8>>2]=c[b+4+(i<<4)+8>>2];c[b+20+12>>2]=c[b+4+(i<<4)+12>>2];c[b+100>>2]=c[b+84+(i<<4)>>2];c[b+100+4>>2]=c[b+84+(i<<4)+4>>2];c[b+100+8>>2]=c[b+84+(i<<4)+8>>2];c[b+100+12>>2]=c[b+84+(i<<4)+12>>2];c[b+180>>2]=c[b+164+(i<<4)>>2];c[b+180+4>>2]=c[b+164+(i<<4)+4>>2];c[b+180+8>>2]=c[b+164+(i<<4)+8>>2];c[b+180+12>>2]=c[b+164+(i<<4)+12>>2];d=i;H=60}else H=59}if((H|0)==59){h=b+332|0;H=60}if((H|0)==60?(G=d+-1|0,(a[h>>0]&1)==0):0){c[b>>2]=G;c[b+4>>2]=c[b+4+(G<<4)>>2];c[b+4+4>>2]=c[b+4+(G<<4)+4>>2];c[b+4+8>>2]=c[b+4+(G<<4)+8>>2];c[b+4+12>>2]=c[b+4+(G<<4)+12>>2];c[b+84>>2]=c[b+84+(G<<4)>>2];c[b+84+4>>2]=c[b+84+(G<<4)+4>>2];c[b+84+8>>2]=c[b+84+(G<<4)+8>>2];c[b+84+12>>2]=c[b+84+(G<<4)+12>>2];c[b+164>>2]=c[b+164+(G<<4)>>2];c[b+164+4>>2]=c[b+164+(G<<4)+4>>2];c[b+164+8>>2]=c[b+164+(G<<4)+8>>2];c[b+164+12>>2]=c[b+164+(G<<4)+12>>2]}if((+g[b+336>>2]>=0.0?+g[b+340>>2]>=0.0:0)?+g[b+344>>2]>=0.0:0)d=e>=0.0&1;else d=0;a[b+312>>0]=d}while(0);if((H|0)==68){a[d>>0]=0;d=0}W=d;W=W<<24>>24!=0;sa=I;return W|0}default:{a[b+312>>0]=0;W=0;W=W<<24>>24!=0;sa=I;return W|0}}return 0}function Bb(b,d,e,f,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0.0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0;Z=sa;sa=sa+256|0;c[b+188>>2]=-1;Ki(17177);c[b+184>>2]=0;if((e|0)>0){l=0;do{c[(c[d+(l<<2)>>2]|0)+212>>2]=-1;l=l+1|0}while((l|0)!=(e|0))}l=c[b+12>>2]|0;if((l|0)>(e|0)){n=b+8|0;m=l}else{if((e+1|0)!=0?(c[7182]=(c[7182]|0)+1,m=xb(((e+1|0)*244|3)+16|0)|0,(m|0)!=0):0){c[(m+4+15&-16)+-4>>2]=m;n=m+4+15&-16}else n=0;m=c[b+8>>2]|0;if((m|0)>0){l=0;do{W=n+(l*244|0)|0;X=c[b+16>>2]|0;V=X+(l*244|0)|0;c[W>>2]=c[V>>2];c[W+4>>2]=c[V+4>>2];c[W+8>>2]=c[V+8>>2];c[W+12>>2]=c[V+12>>2];W=X+(l*244|0)+16|0;V=n+(l*244|0)+16|0;c[V>>2]=c[W>>2];c[V+4>>2]=c[W+4>>2];c[V+8>>2]=c[W+8>>2];c[V+12>>2]=c[W+12>>2];V=X+(l*244|0)+32|0;W=n+(l*244|0)+32|0;c[W>>2]=c[V>>2];c[W+4>>2]=c[V+4>>2];c[W+8>>2]=c[V+8>>2];c[W+12>>2]=c[V+12>>2];W=n+(l*244|0)+48|0;V=X+(l*244|0)+48|0;c[W>>2]=c[V>>2];c[W+4>>2]=c[V+4>>2];c[W+8>>2]=c[V+8>>2];c[W+12>>2]=c[V+12>>2];Bh(n+(l*244|0)+64|0,X+(l*244|0)+64|0,180)|0;l=l+1|0}while((l|0)!=(m|0))}l=c[b+16>>2]|0;if(l|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=n;c[b+12>>2]=e+1;n=b+8|0;m=e+1|0}mk(Z|0,0,244)|0;l=c[n>>2]|0;if((l|0)<0){if((m|0)<0){m=c[b+16>>2]|0;if(m|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=0;c[b+12>>2]=0}do{X=c[b+16>>2]|0;W=X+(l*244|0)|0;c[W>>2]=c[Z>>2];c[W+4>>2]=c[Z+4>>2];c[W+8>>2]=c[Z+8>>2];c[W+12>>2]=c[Z+12>>2];W=X+(l*244|0)+16|0;c[W>>2]=c[Z+16>>2];c[W+4>>2]=c[Z+16+4>>2];c[W+8>>2]=c[Z+16+8>>2];c[W+12>>2]=c[Z+16+12>>2];W=X+(l*244|0)+32|0;c[W>>2]=c[Z+32>>2];c[W+4>>2]=c[Z+32+4>>2];c[W+8>>2]=c[Z+32+8>>2];c[W+12>>2]=c[Z+32+12>>2];W=X+(l*244|0)+48|0;c[W>>2]=c[Z+48>>2];c[W+4>>2]=c[Z+48+4>>2];c[W+8>>2]=c[Z+48+8>>2];c[W+12>>2]=c[Z+48+12>>2];Bh(X+(l*244|0)+64|0,Z+64|0,180)|0;l=l+1|0}while((l|0)!=0)}c[n>>2]=0;if((e|0)>0){l=0;do{n=d+(l<<2)|0;m=Xc(b,c[n>>2]|0,+g[k+12>>2])|0;n=c[n>>2]|0;if((!((n|0)==0?1:(c[n+236>>2]&2|0)==0)?+g[n+344>>2]!=0.0:0)?(p=c[b+16>>2]|0,c[n+504>>2]&2|0):0){o=+g[k+76>>2];N=1.0/+g[n+396>>2];P=1.0/+g[n+400>>2];r=1.0/+g[n+404>>2];H=+g[n+4>>2];I=+g[n+8>>2];J=+g[n+12>>2];K=+g[n+20>>2];L=+g[n+24>>2];M=+g[n+28>>2];O=+g[n+36>>2];Q=+g[n+40>>2];u=+g[n+44>>2];v=+g[n+328>>2];y=+g[n+332>>2];t=+g[n+336>>2];z=(N*H*H+P*I*I+r*J*J)*v+(N*H*K+P*I*L+r*J*M)*y+(N*H*O+P*I*Q+r*J*u)*t;A=(N*K*H+P*L*I+r*M*J)*v+(N*K*K+P*L*L+r*M*M)*y+(N*K*O+P*L*Q+r*M*u)*t;u=(N*O*H+P*Q*I+r*u*J)*v+(N*O*K+P*Q*L+r*u*M)*y+(N*O*O+P*Q*Q+r*u*u)*t;r=(v*A-y*z)*(v*A-y*z)+((y*u-t*A)*(y*u-t*A)+(t*z-v*u)*(t*z-v*u));if(r>o*o){o=1.0/+x(+r)*o;s=(y*u-t*A)*o;r=(t*z-v*u)*o;o=(v*A-y*z)*o}else{s=y*u-t*A;r=t*z-v*u;o=v*A-y*z}O=+g[k+12>>2];P=(s*+g[n+268>>2]+r*+g[n+284>>2]+o*+g[n+300>>2])*O;Q=O*(s*+g[n+272>>2]+r*+g[n+288>>2]+o*+g[n+304>>2]);g[p+(m*244|0)+224>>2]=+g[p+(m*244|0)+224>>2]-(s*+g[n+264>>2]+r*+g[n+280>>2]+o*+g[n+296>>2])*O;g[p+(m*244|0)+228>>2]=+g[p+(m*244|0)+228>>2]-P;g[p+(m*244|0)+232>>2]=+g[p+(m*244|0)+232>>2]-Q}l=l+1|0}while((l|0)!=(e|0))}if((j|0)>0){l=0;do{X=c[i+(l<<2)>>2]|0;Pa[c[(c[X>>2]|0)+8>>2]&511](X);g[X+36>>2]=0.0;l=l+1|0}while((l|0)<(j|0))}m=c[b+168>>2]|0;if((m|0)<(j|0)?(c[b+172>>2]|0)<(j|0):0){if(!j)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((j<<3|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+168>>2]|0}if((m|0)>0){n=0;do{V=(c[b+176>>2]|0)+(n<<3)|0;W=c[V+4>>2]|0;X=l+(n<<3)|0;c[X>>2]=c[V>>2];c[X+4>>2]=W;n=n+1|0}while((n|0)!=(m|0))}m=c[b+176>>2]|0;if(m|0){if(a[b+180>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[b+176>>2]=0}a[b+180>>0]=1;c[b+176>>2]=l;c[b+172>>2]=j}c[b+168>>2]=j;if((j|0)>0){l=0;q=0;do{p=c[b+176>>2]|0;e=p+(q<<3)|0;d=i+(q<<2)|0;m=c[d>>2]|0;n=c[m+44>>2]|0;if(n){m=n+64|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(m|0));m=c[d>>2]|0}if(!(a[m+20>>0]|0)){c[e>>2]=0;c[p+(q<<3)+4>>2]=0;m=0}else{Va[c[(c[m>>2]|0)+16>>2]&127](m,e);m=c[e>>2]|0}l=m+l|0;q=q+1|0}while((q|0)<(j|0));d=l}else d=0;m=c[b+48>>2]|0;if((m|0)<(d|0)?(c[b+52>>2]|0)<(d|0):0){if(!d)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((d*152|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+48>>2]|0}if((m|0)>0){n=0;do{Bh(l+(n*152|0)|0,(c[b+56>>2]|0)+(n*152|0)|0,152)|0;n=n+1|0}while((n|0)!=(m|0))}m=c[b+56>>2]|0;if(m|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=l;c[b+52>>2]=d}c[b+48>>2]=d;if((j|0)>0){W=0;X=0;l=c[b+176>>2]|0;while(1){V=l+(X<<3)|0;if(!(c[V>>2]|0))m=0;else{m=c[b+56>>2]|0;d=m+(W*152|0)|0;p=i+(X<<2)|0;e=c[p>>2]|0;q=c[e+28>>2]|0;R=c[e+32>>2]|0;S=Xc(b,q,+g[k+12>>2])|0;T=Xc(b,R,+g[k+12>>2])|0;U=c[b+16>>2]|0;n=c[e+24>>2]|0;n=(n|0)>0?n:c[k+20>>2]|0;if((n|0)>(c[b+184>>2]|0))c[b+184>>2]=n;if((c[V>>2]|0)>0){l=0;do{mk(d+(l*152|0)|0,0,152)|0;g[d+(l*152|0)+120>>2]=-3402823466385288598117041.0e14;g[d+(l*152|0)+124>>2]=3402823466385288598117041.0e14;g[d+(l*152|0)+100>>2]=0.0;g[d+(l*152|0)+96>>2]=0.0;c[d+(l*152|0)+144>>2]=S;c[d+(l*152|0)+148>>2]=T;c[d+(l*152|0)+136>>2]=n;l=l+1|0}while((l|0)<(c[V>>2]|0))}c[U+(S*244|0)+64>>2]=0;c[U+(S*244|0)+64+4>>2]=0;c[U+(S*244|0)+64+8>>2]=0;c[U+(S*244|0)+64+12>>2]=0;c[U+(S*244|0)+64+16>>2]=0;c[U+(S*244|0)+64+20>>2]=0;c[U+(S*244|0)+64+24>>2]=0;c[U+(S*244|0)+64+28>>2]=0;c[U+(S*244|0)+144>>2]=0;c[U+(S*244|0)+144+4>>2]=0;c[U+(S*244|0)+144+8>>2]=0;c[U+(S*244|0)+144+12>>2]=0;c[U+(S*244|0)+144+16>>2]=0;c[U+(S*244|0)+144+20>>2]=0;c[U+(S*244|0)+144+24>>2]=0;c[U+(S*244|0)+144+28>>2]=0;c[U+(T*244|0)+64>>2]=0;c[U+(T*244|0)+64+4>>2]=0;c[U+(T*244|0)+64+8>>2]=0;c[U+(T*244|0)+64+12>>2]=0;c[U+(T*244|0)+64+16>>2]=0;c[U+(T*244|0)+64+20>>2]=0;c[U+(T*244|0)+64+24>>2]=0;c[U+(T*244|0)+64+28>>2]=0;c[U+(T*244|0)+144>>2]=0;c[U+(T*244|0)+144+4>>2]=0;c[U+(T*244|0)+144+8>>2]=0;c[U+(T*244|0)+144+12>>2]=0;c[U+(T*244|0)+144+16>>2]=0;c[U+(T*244|0)+144+20>>2]=0;c[U+(T*244|0)+144+24>>2]=0;c[U+(T*244|0)+144+28>>2]=0;g[Z>>2]=1.0/+g[k+12>>2];c[Z+4>>2]=c[k+32>>2];c[Z+8>>2]=m+(W*152|0)+16;c[Z+12>>2]=d;c[Z+16>>2]=m+(W*152|0)+48;c[Z+20>>2]=m+(W*152|0)+32;c[Z+24>>2]=38;c[Z+28>>2]=m+(W*152|0)+112;n=m+(W*152|0)+116|0;c[n>>2]=c[k+40>>2];c[Z+52>>2]=c[k+4>>2];c[Z+32>>2]=n;c[Z+36>>2]=m+(W*152|0)+120;c[Z+40>>2]=m+(W*152|0)+124;c[Z+48>>2]=c[k+20>>2];n=c[p>>2]|0;Va[c[(c[n>>2]|0)+20>>2]&127](n,Z);if((c[V>>2]|0)>0){m=0;do{l=d+(m*152|0)+124|0;o=+g[(c[p>>2]|0)+16>>2];if(+g[l>>2]>=o)g[l>>2]=o;l=d+(m*152|0)+120|0;if(+g[l>>2]<=-o)g[l>>2]=-o;c[d+(m*152|0)+132>>2]=e;n=d+(m*152|0)|0;l=c[e+28>>2]|0;o=+g[n>>2];r=+g[n+4>>2];s=+g[n+8>>2];u=(o*+g[l+280>>2]+r*+g[l+284>>2]+s*+g[l+288>>2])*+g[l+548>>2];t=(o*+g[l+296>>2]+r*+g[l+300>>2]+s*+g[l+304>>2])*+g[l+552>>2];n=d+(m*152|0)+64|0;g[n>>2]=(+g[l+264>>2]*o+ +g[l+268>>2]*r+ +g[l+272>>2]*s)*+g[l+544>>2];g[n+4>>2]=u;g[n+8>>2]=t;g[n+12>>2]=0.0;n=d+(m*152|0)+32|0;l=c[e+32>>2]|0;t=+g[n>>2];u=+g[n+4>>2];v=+g[n+8>>2];y=(t*+g[l+280>>2]+u*+g[l+284>>2]+v*+g[l+288>>2])*+g[l+548>>2];Q=(t*+g[l+296>>2]+u*+g[l+300>>2]+v*+g[l+304>>2])*+g[l+552>>2];n=d+(m*152|0)+80|0;g[n>>2]=(+g[l+264>>2]*t+ +g[l+268>>2]*u+ +g[l+272>>2]*v)*+g[l+544>>2];g[n+4>>2]=y;g[n+8>>2]=Q;g[n+12>>2]=0.0;n=d+(m*152|0)+16|0;Q=+g[q+344>>2];y=+g[n>>2];z=+g[n+4>>2];A=+g[n+8>>2];n=d+(m*152|0)+48|0;E=+g[R+344>>2];B=+g[n>>2];C=+g[n+4>>2];D=+g[n+8>>2];E=y*Q*y+z*Q*z+A*Q*A+(o*(o*+g[q+264>>2]+r*+g[q+268>>2]+s*+g[q+272>>2])+r*(o*+g[q+280>>2]+r*+g[q+284>>2]+s*+g[q+288>>2])+s*(o*+g[q+296>>2]+r*+g[q+300>>2]+s*+g[q+304>>2]))+(B*E*B+C*E*C+D*E*D)+(t*(t*+g[R+264>>2]+u*+g[R+268>>2]+v*+g[R+272>>2])+u*(t*+g[R+280>>2]+u*+g[R+284>>2]+v*+g[R+288>>2])+v*(t*+g[R+296>>2]+u*+g[R+300>>2]+v*+g[R+304>>2]));n=+w(+E)>1.1920928955078125e-07;E=n?1.0/E:0.0;g[d+(m*152|0)+108>>2]=E;if(!(c[U+(S*244|0)+240>>2]|0)){F=0.0;G=0.0;H=0.0;I=0.0;J=0.0;K=0.0}else{F=+g[U+(S*244|0)+208>>2];G=+g[U+(S*244|0)+212>>2];H=+g[U+(S*244|0)+216>>2];I=+g[U+(S*244|0)+224>>2];J=+g[U+(S*244|0)+228>>2];K=+g[U+(S*244|0)+232>>2]}if(!(c[U+(T*244|0)+240>>2]|0)){L=0.0;M=0.0;N=0.0;O=0.0;P=0.0;Q=0.0}else{L=+g[U+(T*244|0)+208>>2];M=+g[U+(T*244|0)+212>>2];N=+g[U+(T*244|0)+216>>2];O=+g[U+(T*244|0)+224>>2];P=+g[U+(T*244|0)+228>>2];Q=+g[U+(T*244|0)+232>>2]}n=d+(m*152|0)+112|0;g[n>>2]=E*+g[n>>2]+E*(0.0-+g[Z+52>>2]*(y*(F+ +g[q+312>>2])+z*(G+ +g[q+316>>2])+A*(H+ +g[q+320>>2])+(o*(I+ +g[q+328>>2])+r*(J+ +g[q+332>>2])+s*(K+ +g[q+336>>2]))+(B*(L+ +g[R+312>>2])+C*(M+ +g[R+316>>2])+D*(N+ +g[R+320>>2])+(t*(O+ +g[R+328>>2])+u*(P+ +g[R+332>>2])+v*(Q+ +g[R+336>>2])))));g[d+(m*152|0)+100>>2]=0.0;m=m+1|0}while((m|0)<(c[V>>2]|0))}l=c[b+176>>2]|0;m=c[l+(X<<3)>>2]|0}X=X+1|0;if((X|0)>=(j|0))break;else W=m+W|0}}ab[c[(c[b>>2]|0)+28>>2]&127](b,f,h,k);p=c[b+48>>2]|0;e=c[b+28>>2]|0;q=c[b+68>>2]|0;m=c[b+128>>2]|0;if((m|0)<(p|0)?(c[b+132>>2]|0)<(p|0):0){if(!p)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((p<<2|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+128>>2]|0}d=c[b+136>>2]|0;if((m|0)<=0)if(!d)m=b+140|0;else Y=106;else{n=0;do{c[l+(n<<2)>>2]=c[d+(n<<2)>>2];n=n+1|0}while((n|0)!=(m|0));Y=106}if((Y|0)==106){if(a[b+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+136>>2]=0;m=b+140|0}a[m>>0]=1;c[b+136>>2]=l;c[b+132>>2]=p}c[b+128>>2]=p;if(!(c[k+64>>2]&16)){m=c[b+108>>2]|0;if((m|0)<(e|0)?(c[b+112>>2]|0)<(e|0):0){if(!e)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((e<<2|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+108>>2]|0}d=c[b+116>>2]|0;if((m|0)<=0)if(!d)m=b+120|0;else Y=138;else{n=0;do{c[l+(n<<2)>>2]=c[d+(n<<2)>>2];n=n+1|0}while((n|0)!=(m|0));Y=138}if((Y|0)==138){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+116>>2]=0;m=b+120|0}a[m>>0]=1;c[b+116>>2]=l;c[b+112>>2]=e}c[b+108>>2]=e}else{m=c[b+108>>2]|0;if((m|0)<(e<<1|0)?(c[b+112>>2]|0)<(e<<1|0):0){if(!e)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((e<<3|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+108>>2]|0}d=c[b+116>>2]|0;if((m|0)<=0)if(!d)m=b+120|0;else Y=122;else{n=0;do{c[l+(n<<2)>>2]=c[d+(n<<2)>>2];n=n+1|0}while((n|0)!=(m|0));Y=122}if((Y|0)==122){if(a[b+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+116>>2]=0;m=b+120|0}a[m>>0]=1;c[b+116>>2]=l;c[b+112>>2]=e<<1}c[b+108>>2]=e<<1}m=c[b+148>>2]|0;if((m|0)<(q|0)?(c[b+152>>2]|0)<(q|0):0){if(!q)l=0;else{c[7182]=(c[7182]|0)+1;l=xb((q<<2|3)+16|0)|0;if(!l)l=0;else{c[(l+4+15&-16)+-4>>2]=l;l=l+4+15&-16}m=c[b+148>>2]|0}d=c[b+156>>2]|0;if((m|0)<=0)if(!d)m=b+160|0;else Y=154;else{n=0;do{c[l+(n<<2)>>2]=c[d+(n<<2)>>2];n=n+1|0}while((n|0)!=(m|0));Y=154}if((Y|0)==154){if(a[b+160>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+156>>2]=0;m=b+160|0}a[m>>0]=1;c[b+156>>2]=l;c[b+152>>2]=q}c[b+148>>2]=q;if((p|0)>0){m=c[b+136>>2]|0;l=0;do{c[m+(l<<2)>>2]=l;l=l+1|0}while((l|0)!=(p|0))}if((e|0)>0){m=c[b+116>>2]|0;l=0;do{c[m+(l<<2)>>2]=l;l=l+1|0}while((l|0)!=(e|0))}if((q|0)>0){m=c[b+156>>2]|0;l=0;do{c[m+(l<<2)>>2]=l;l=l+1|0}while((l|0)!=(q|0))}l=c[3084]|0;b=(c[l+16>>2]|0)+-1|0;c[l+16>>2]=b;if(b|0){sa=Z;return 0.0}do if(c[l+4>>2]|0){la(Z|0,0)|0;b=c[7181]|0;g[l+8>>2]=+g[l+8>>2]+ +(((c[Z+4>>2]|0)-(c[b+4>>2]|0)+(((c[Z>>2]|0)-(c[b>>2]|0)|0)*1e6|0)-(c[l+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[l+16>>2]|0)){l=c[3084]|0;break}else{sa=Z;return 0.0}}while(0);c[3084]=c[l+20>>2];sa=Z;return 0.0}function Cb(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0.0,B=0.0,D=0.0,E=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0.0,ma=0,na=0.0,oa=0.0,pa=0.0,qa=0.0,ra=0.0;ma=sa;sa=sa+80|0;g[b+504>>2]=0.0;g[b+500>>2]=0.0;a[b+525>>0]=0;a[b+526>>0]=0;if(a[b+552>>0]|0?(a[b+527>>0]|0)==0:0){ra=+g[b+556>>2];pa=+g[b+560>>2];la=+g[b+564>>2];oa=+g[b+568>>2];aa=ra*(2.0/(ra*ra+pa*pa+la*la+oa*oa));qa=pa*(2.0/(ra*ra+pa*pa+la*la+oa*oa));na=la*(2.0/(ra*ra+pa*pa+la*la+oa*oa));ba=+g[b+300>>2];T=+g[d>>2];ca=+g[b+316>>2];U=+g[d+4>>2];da=+g[b+332>>2];V=+g[d+8>>2];fa=+g[b+304>>2];ha=+g[b+320>>2];ja=+g[b+336>>2];Z=+g[b+308>>2];_=+g[b+324>>2];$=+g[b+340>>2];W=+g[d+16>>2];X=+g[d+20>>2];Y=+g[d+24>>2];ga=+g[d+32>>2];ia=+g[d+36>>2];ka=+g[d+40>>2];r=+g[b+348>>2];q=+g[b+352>>2];p=+g[b+356>>2];v=+g[b+364>>2];l=+g[e>>2];y=+g[b+380>>2];m=+g[e+4>>2];B=+g[b+396>>2];k=+g[e+8>>2];D=+g[b+368>>2];E=+g[b+384>>2];G=+g[b+400>>2];s=+g[b+372>>2];t=+g[b+388>>2];u=+g[b+404>>2];n=+g[e+16>>2];o=+g[e+20>>2];j=+g[e+24>>2];H=+g[e+32>>2];J=+g[e+36>>2];L=+g[e+40>>2];I=+g[b+412>>2];K=+g[b+416>>2];i=+g[b+420>>2];N=(1.0-(pa*qa+la*na))*(v*l+y*m+B*k)+(ra*qa+oa*na)*(l*D+m*E+k*G)+(ra*na-oa*qa)*(l*s+m*t+k*u);O=(ra*qa-oa*na)*(v*l+y*m+B*k)+(1.0-(ra*aa+la*na))*(l*D+m*E+k*G)+(pa*na+oa*aa)*(l*s+m*t+k*u);M=(ra*na+oa*qa)*(v*l+y*m+B*k)+(pa*na-oa*aa)*(l*D+m*E+k*G)+(1.0-(ra*aa+pa*qa))*(l*s+m*t+k*u);R=(ra*na-oa*qa)*(s*n+t*o+u*j)+((1.0-(pa*qa+la*na))*(v*n+y*o+B*j)+(ra*qa+oa*na)*(D*n+E*o+G*j));S=(pa*na+oa*aa)*(s*n+t*o+u*j)+((ra*qa-oa*na)*(v*n+y*o+B*j)+(1.0-(ra*aa+la*na))*(D*n+E*o+G*j));P=(1.0-(ra*aa+pa*qa))*(s*n+t*o+u*j)+((ra*na+oa*qa)*(v*n+y*o+B*j)+(pa*na-oa*aa)*(D*n+E*o+G*j));ea=(ra*na-oa*qa)*(s*H+t*J+u*L)+((1.0-(pa*qa+la*na))*(v*H+y*J+B*L)+(ra*qa+oa*na)*(D*H+E*J+G*L));la=(pa*na+oa*aa)*(s*H+t*J+u*L)+((ra*qa-oa*na)*(v*H+y*J+B*L)+(1.0-(ra*aa+la*na))*(D*H+E*J+G*L));aa=(1.0-(ra*aa+pa*qa))*(s*H+t*J+u*L)+((ra*na+oa*qa)*(v*H+y*J+B*L)+(pa*na-oa*aa)*(D*H+E*J+G*L));oa=-(+g[d+48>>2]+(T*r+U*q+V*p));na=-(W*r+X*q+Y*p+ +g[d+52>>2]);p=-(ga*r+ia*q+ka*p+ +g[d+56>>2]);q=(ba*T+ca*U+da*V)*oa+(ba*W+ca*X+da*Y)*na+(ba*ga+ca*ia+da*ka)*p;r=(T*fa+U*ha+V*ja)*oa+(fa*W+ha*X+ja*Y)*na+(fa*ga+ha*ia+ja*ka)*p;p=(T*Z+U*_+V*$)*oa+(Z*W+_*X+$*Y)*na+(Z*ga+_*ia+$*ka)*p;k=p*M+(q*N+r*O)+((v*l+y*m+B*k)*0.0+(l*D+m*E+k*G)*0.0+(l*s+m*t+k*u)*0.0+(+g[e+48>>2]+(l*I+m*K+k*i)));j=p*P+(q*R+r*S)+((s*n+t*o+u*j)*0.0+((v*n+y*o+B*j)*0.0+(D*n+E*o+G*j)*0.0)+(n*I+o*K+j*i+ +g[e+52>>2]));i=p*aa+(q*ea+r*la)+((s*H+t*J+u*L)*0.0+((v*H+y*J+B*L)*0.0+(D*H+E*J+G*L)*0.0)+(H*I+J*K+L*i+ +g[e+56>>2]));g[ma+16>>2]=(T*Z+U*_+V*$)*M+((ba*T+ca*U+da*V)*N+(T*fa+U*ha+V*ja)*O);g[ma+16+4>>2]=(Z*W+_*X+$*Y)*M+((ba*W+ca*X+da*Y)*N+(fa*W+ha*X+ja*Y)*O);g[ma+16+8>>2]=(Z*ga+_*ia+$*ka)*M+((ba*ga+ca*ia+da*ka)*N+(fa*ga+ha*ia+ja*ka)*O);g[ma+16+12>>2]=0.0;g[ma+16+16>>2]=(T*Z+U*_+V*$)*P+((ba*T+ca*U+da*V)*R+(T*fa+U*ha+V*ja)*S);g[ma+16+20>>2]=(Z*W+_*X+$*Y)*P+((ba*W+ca*X+da*Y)*R+(fa*W+ha*X+ja*Y)*S);g[ma+16+24>>2]=(Z*ga+_*ia+$*ka)*P+((ba*ga+ca*ia+da*ka)*R+(fa*ga+ha*ia+ja*ka)*S);g[ma+16+28>>2]=0.0;g[ma+16+32>>2]=(T*Z+U*_+V*$)*aa+((ba*T+ca*U+da*V)*ea+(T*fa+U*ha+V*ja)*la);g[ma+16+36>>2]=(Z*W+_*X+$*Y)*aa+((ba*W+ca*X+da*Y)*ea+(fa*W+ha*X+ja*Y)*la);g[ma+16+40>>2]=(Z*ga+_*ia+$*ka)*aa+((ba*ga+ca*ia+da*ka)*ea+(fa*ga+ha*ia+ja*ka)*la);g[ma+16+44>>2]=0.0;g[ma+16+48>>2]=k;g[ma+16+52>>2]=j;g[ma+16+56>>2]=i;g[ma+16+60>>2]=0.0;Og(ma+16|0,ma);i=+g[ma>>2];j=+g[ma+4>>2];k=+g[ma+8>>2];if(!(+w(+(i*i+j*j+k*k))<1.1920928955078125e-07)?(g[b+472>>2]=0.0,ra=1.0/+x(+(i*i+j*j+k*k)),g[b+460>>2]=ra*i,g[b+464>>2]=ra*j,g[b+468>>2]=ra*k,ra=+g[ma+12>>2],ra=ra<-1.0?-1.0:ra,ra=+C(+(ra>1.0?1.0:ra))*2.0,g[b+504>>2]=ra,!(+w(+ra)<1.1920928955078125e-07)):0)a[b+526>>0]=1;sa=ma;return}Og(d,ma+16|0);Og(b+300|0,ma);V=+g[ma+16+12>>2];W=+g[ma>>2];X=+g[ma+16>>2];Y=+g[ma+12>>2];Z=+g[ma+16+4>>2];_=+g[ma+8>>2];$=+g[ma+16+8>>2];aa=+g[ma+4>>2];Og(e,ma+16|0);Og(b+364|0,ma);ba=+g[ma+16+12>>2];ca=+g[ma>>2];da=+g[ma+16>>2];ea=+g[ma+12>>2];fa=+g[ma+16+4>>2];ga=+g[ma+8>>2];ha=+g[ma+16+8>>2];ia=+g[ma+4>>2];ja=-(ba*ca+da*ea+fa*ga-ha*ia);ka=-(ca*ha+(ea*fa+ba*ia)-da*ga);la=-(ba*ga+ea*ha+da*ia-ca*fa);o=(V*Y-W*X-Z*aa-_*$)*ja+(V*W+X*Y+Z*_-$*aa)*(ba*ea-ca*da-fa*ia-ga*ha)+(V*_+Y*$+X*aa-W*Z)*ka-(W*$+(Y*Z+V*aa)-X*_)*la;p=(V*W+X*Y+Z*_-$*aa)*la+((W*$+(Y*Z+V*aa)-X*_)*(ba*ea-ca*da-fa*ia-ga*ha)+(V*Y-W*X-Z*aa-_*$)*ka)-(V*_+Y*$+X*aa-W*Z)*ja;q=(W*$+(Y*Z+V*aa)-X*_)*ja+((V*_+Y*$+X*aa-W*Z)*(ba*ea-ca*da-fa*ia-ga*ha)+(V*Y-W*X-Z*aa-_*$)*la)-(V*W+X*Y+Z*_-$*aa)*ka;r=(V*Y-W*X-Z*aa-_*$)*(ba*ea-ca*da-fa*ia-ga*ha)-(V*W+X*Y+Z*_-$*aa)*ja-(W*$+(Y*Z+V*aa)-X*_)*ka-(V*_+Y*$+X*aa-W*Z)*la;i=-o-p*0.0-q*0.0;j=(q+r*0.0-o*0.0)*-q+(r*(r+p*0.0-q*0.0)+i*-o)-(r*0.0+o*0.0-p)*-p;k=(r*0.0+o*0.0-p)*-o+(r*(q+r*0.0-o*0.0)+i*-p)-(r+p*0.0-q*0.0)*-q;i=(r+p*0.0-q*0.0)*-p+(r*(r*0.0+o*0.0-p)+i*-q)-(q+r*0.0-o*0.0)*-o;l=1.0/+x(+(i*i+(j*j+k*k)));if(i*l*0.0+(k*l*0.0+j*l)<-.9999998807907104){n=1.0;m=-0.0;i=0.0;j=0.0}else{ra=+x(+((i*l*0.0+(k*l*0.0+j*l)+1.0)*2.0));n=(j*l*0.0-i*l)*(1.0/ra);m=(i*l*0.0-k*l*0.0)*(1.0/ra);i=(k*l-j*l*0.0)*(1.0/ra);j=ra*.5}k=1.0/+x(+(m*m+n*n+i*i+j*j));l=m*k;t=n*k;s=i*k;k=j*k;T=1.0/+x(+((r*k-o*-l-p*-t-q*-s)*(r*k-o*-l-p*-t-q*-s)+((p*-l+(q*k+r*-s)-o*-t)*(p*-l+(q*k+r*-s)-o*-t)+((q*-t+(o*k+r*-l)-p*-s)*(q*-t+(o*k+r*-l)-p*-s)+(o*-s+(r*-t+p*k)-q*-l)*(o*-s+(r*-t+p*k)-q*-l)))));U=(q*-t+(o*k+r*-l)-p*-s)*T;j=(o*-s+(r*-t+p*k)-q*-l)*T;i=(p*-l+(q*k+r*-s)-o*-t)*T;T=(r*k-o*-l-p*-t-q*-s)*T;S=+g[b+444>>2];R=+g[b+456>>2];if(S>=R?(u=+g[b+448>>2],u>=R):0){q=k<-1.0?-1.0:k;q=+C(+(q>1.0?1.0:q))*2.0;if(q>1.1920928955078125e-07){n=1.0/+x(+(s*s+(l*l+t*t)));if(+w(+(t*n))>1.1920928955078125e-07){m=l*n;l=s*n;k=t*n;o=+x(+((s*n*s*n/(t*n*t*n)+1.0)/(s*n*s*n/(t*n*t*n)/(S*S)+1.0/(u*u))))}else{m=l*n;l=s*n;k=t*n;o=S}}else{m=0.0;l=0.0;k=0.0;o=0.0}n=+g[b+428>>2];p=o*n;if(q>p){a[b+526>>0]=1;if(q>2]=n;g[b+504>>2]=q-p;if(+w(+k)>1.1920928955078125e-07){ra=+w(+(k*u/S*(-l/k)));l=l<-0.0?ra:-ra;ra=1.0/+x(+(m*m+k*k+l*l));m=m*ra;l=-(l*ra);k=k*ra}qa=-m;pa=-k;na=-l;S=(ba*ea-ca*da-fa*ia-ga*ha)*qa+(ca*ha+(ea*fa+ba*ia)-da*ga)*na-(ba*ga+ea*ha+da*ia-ca*fa)*pa;ra=(ba*ga+ea*ha+da*ia-ca*fa)*qa+(ba*ea-ca*da-fa*ia-ga*ha)*pa-(ba*ca+da*ea+fa*ga-ha*ia)*na;oa=(ba*ca+da*ea+fa*ga-ha*ia)*pa+(ba*ea-ca*da-fa*ia-ga*ha)*na-(ca*ha+(ea*fa+ba*ia)-da*ga)*qa;na=-((ba*ca+da*ea+fa*ga-ha*ia)*qa)-(ca*ha+(ea*fa+ba*ia)-da*ga)*pa-(ba*ga+ea*ha+da*ia-ca*fa)*na;pa=ra*la+(na*ja+(ba*ea-ca*da-fa*ia-ga*ha)*S)-oa*ka;qa=oa*ja+((ba*ea-ca*da-fa*ia-ga*ha)*ra+na*ka)-S*la;ra=S*ka+(na*la+(ba*ea-ca*da-fa*ia-ga*ha)*oa)-ra*ja;g[b+460>>2]=pa;g[b+464>>2]=qa;g[b+468>>2]=ra;g[b+472>>2]=0.0;c[b+536>>2]=0;c[b+536+4>>2]=0;c[b+536+8>>2]=0;c[b+536+12>>2]=0;g[b+492>>2]=1.0/(pa*(+g[f>>2]*pa+ +g[f+16>>2]*qa+ +g[f+32>>2]*ra)+qa*(pa*+g[f+4>>2]+qa*+g[f+20>>2]+ra*+g[f+36>>2])+ra*(pa*+g[f+8>>2]+qa*+g[f+24>>2]+ra*+g[f+40>>2])+(pa*(pa*+g[h>>2]+qa*+g[h+16>>2]+ra*+g[h+32>>2])+qa*(pa*+g[h+4>>2]+qa*+g[h+20>>2]+ra*+g[h+36>>2])+ra*(pa*+g[h+8>>2]+qa*+g[h+24>>2]+ra*+g[h+40>>2])))}}else Q=20;a:do if((Q|0)==20){E=+g[b+300>>2];G=+g[b+316>>2];H=+g[b+332>>2];I=+g[d>>2];J=+g[d+4>>2];K=+g[d+8>>2];L=+g[d+16>>2];M=+g[d+20>>2];N=+g[d+24>>2];O=+g[d+32>>2];P=+g[d+36>>2];q=+g[d+40>>2];r=+g[b+304>>2];s=+g[b+320>>2];t=+g[b+336>>2];u=+g[b+308>>2];v=+g[b+324>>2];y=+g[b+340>>2];n=+g[b+364>>2];k=+g[b+380>>2];p=+g[b+396>>2];B=n*+g[e>>2]+k*+g[e+4>>2]+p*+g[e+8>>2];D=n*+g[e+16>>2]+k*+g[e+20>>2]+p*+g[e+24>>2];p=n*+g[e+32>>2]+k*+g[e+36>>2]+p*+g[e+40>>2];k=(E*I+G*J+H*K)*B+(E*L+G*M+H*N)*D+(E*O+G*P+H*q)*p;n=(I*r+J*s+K*t)*B+(L*r+M*s+N*t)*D+(O*r+P*s+q*t)*p;m=(I*u+J*v+K*y)*B+(L*u+M*v+N*y)*D+(O*u+P*v+q*y)*p;do if(S>2];if(o>0]=1;g[b+460>>2]=-((E*O+G*P+H*q)*D-(E*L+G*M+H*N)*p);g[b+464>>2]=-((E*I+G*J+H*K)*p-(E*O+G*P+H*q)*B);g[b+468>>2]=-((E*L+G*M+H*N)*B-(E*I+G*J+H*K)*D);g[b+472>>2]=0.0;break a}if(!(+w(+k)<1.1920928955078125e-07&+w(+m)<1.1920928955078125e-07)?(a[b+526>>0]=1,o>=R):0){l=+F(+m,+k);if(l>o){m=+A(+o);l=0.0;k=+z(+o);break}if(l<-o){m=-+A(+o);l=0.0;k=+z(+o)}else l=0.0}else l=n}else if(!(+w(+k)<1.1920928955078125e-07&+w(+n)<1.1920928955078125e-07)?(a[b+526>>0]=1,S>=R):0){l=+F(+n,+k);if(l>S){m=0.0;l=+A(+S);k=+z(+S);break}if(l<-S){m=0.0;l=-+A(+S);k=+z(+S)}else{m=0.0;l=n}}else l=n;while(0);pa=(I*u+J*v+K*y)*m+((I*r+J*s+K*t)*l+(E*I+G*J+H*K)*k);oa=(L*u+M*v+N*y)*m+((L*r+M*s+N*t)*l+(E*L+G*M+H*N)*k);na=(O*u+P*v+q*y)*m+((O*r+P*s+q*t)*l+(E*O+G*P+H*q)*k);qa=1.0/+x(+(na*na+(pa*pa+oa*oa)));g[b+472>>2]=0.0;ra=+x(+((D*na*qa-p*oa*qa)*(D*na*qa-p*oa*qa)+(p*pa*qa-B*na*qa)*(p*pa*qa-B*na*qa)+(B*oa*qa-D*pa*qa)*(B*oa*qa-D*pa*qa)));g[b+504>>2]=ra;g[b+460>>2]=-((D*na*qa-p*oa*qa)*(1.0/ra));g[b+464>>2]=-((p*pa*qa-B*na*qa)*(1.0/ra));g[b+468>>2]=-((B*oa*qa-D*pa*qa)*(1.0/ra))}while(0);o=+g[b+452>>2];if(!(o>=0.0)){g[b+512>>2]=0.0;sa=ma;return}l=T<-1.0?-1.0:T;l=+C(+(l>1.0?1.0:l))*2.0;if(l>3.1415927410125732){n=-T<-1.0?-1.0:-T;k=-U;j=-j;i=-i;n=+C(+(n>1.0?1.0:n))*2.0}else{k=U;n=l}g[b+512>>2]=n;if(n>1.1920928955078125e-07){ra=1.0/+x(+(k*k+j*j+i*i));k=k*ra;m=i*ra;j=j*ra}else m=i;i=+g[b+428>>2];if(n>o*i){a[b+525>>0]=1;l=n-o*i;if(n>2]=i;g[b+508>>2]=l;qa=-k;pa=-j;na=-m;U=(ba*ea-ca*da-fa*ia-ga*ha)*qa+(ca*ha+(ea*fa+ba*ia)-da*ga)*na-(ba*ga+ea*ha+da*ia-ca*fa)*pa;ra=(ba*ga+ea*ha+da*ia-ca*fa)*qa+(ba*ea-ca*da-fa*ia-ga*ha)*pa-(ba*ca+da*ea+fa*ga-ha*ia)*na;oa=(ba*ca+da*ea+fa*ga-ha*ia)*pa+(ba*ea-ca*da-fa*ia-ga*ha)*na-(ca*ha+(ea*fa+ba*ia)-da*ga)*qa;na=-((ba*ca+da*ea+fa*ga-ha*ia)*qa)-(ca*ha+(ea*fa+ba*ia)-da*ga)*pa-(ba*ga+ea*ha+da*ia-ca*fa)*na;pa=ra*la+(na*ja+(ba*ea-ca*da-fa*ia-ga*ha)*U)-oa*ka;qa=oa*ja+((ba*ea-ca*da-fa*ia-ga*ha)*ra+na*ka)-U*la;ra=U*ka+(na*la+(ba*ea-ca*da-fa*ia-ga*ha)*oa)-ra*ja;g[b+476>>2]=pa;g[b+480>>2]=qa;g[b+484>>2]=ra;g[b+488>>2]=0.0;g[b+496>>2]=1.0/(pa*(+g[f>>2]*pa+ +g[f+16>>2]*qa+ +g[f+32>>2]*ra)+qa*(pa*+g[f+4>>2]+qa*+g[f+20>>2]+ra*+g[f+36>>2])+ra*(pa*+g[f+8>>2]+qa*+g[f+24>>2]+ra*+g[f+40>>2])+(pa*(pa*+g[h>>2]+qa*+g[h+16>>2]+ra*+g[h+32>>2])+qa*(pa*+g[h+4>>2]+qa*+g[h+20>>2]+ra*+g[h+36>>2])+ra*(pa*+g[h+8>>2]+qa*+g[h+24>>2]+ra*+g[h+40>>2])))}if(!(a[b+526>>0]|0)){sa=ma;return}la=-k;ra=-j;na=-m;ka=(V*Y-W*X-Z*aa-_*$)*la+(W*$+(Y*Z+V*aa)-X*_)*na-(V*_+Y*$+X*aa-W*Z)*ra;qa=(V*_+Y*$+X*aa-W*Z)*la+(V*Y-W*X-Z*aa-_*$)*ra-(V*W+X*Y+Z*_-$*aa)*na;pa=(V*W+X*Y+Z*_-$*aa)*ra+(V*Y-W*X-Z*aa-_*$)*na-(W*$+(Y*Z+V*aa)-X*_)*la;na=-((V*W+X*Y+Z*_-$*aa)*la)-(W*$+(Y*Z+V*aa)-X*_)*ra-(V*_+Y*$+X*aa-W*Z)*na;ra=-(V*W+X*Y+Z*_-$*aa);la=-(W*$+(Y*Z+V*aa)-X*_);oa=-(V*_+Y*$+X*aa-W*Z);g[b+536>>2]=qa*oa+(na*ra+(V*Y-W*X-Z*aa-_*$)*ka)-pa*la;g[b+540>>2]=pa*ra+((V*Y-W*X-Z*aa-_*$)*qa+na*la)-ka*oa;g[b+544>>2]=ka*la+(na*oa+(V*Y-W*X-Z*aa-_*$)*pa)-qa*ra;g[b+548>>2]=0.0;sa=ma;return}function Db(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0.0,j=0.0,k=0,l=0.0,m=0,n=0.0,o=0,p=0.0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0,ma=0,na=0;ma=c[b+28>>2]|0;na=c[b+32>>2]|0;la=c[d+24>>2]|0;if(!(a[b+739>>0]|0)){j=+g[b+552>>2];R=+g[ma+4>>2];l=+g[b+568>>2];S=+g[ma+8>>2];n=+g[b+584>>2];T=+g[ma+12>>2];p=+g[b+556>>2];s=+g[b+572>>2];t=+g[b+588>>2];U=+g[b+560>>2];V=+g[b+576>>2];W=+g[b+592>>2];X=+g[ma+20>>2];Y=+g[ma+24>>2];Z=+g[ma+28>>2];_=+g[ma+36>>2];$=+g[ma+40>>2];aa=+g[ma+44>>2];u=+g[b+600>>2];v=+g[b+604>>2];w=+g[b+608>>2];y=+g[ma+52>>2];z=+g[ma+56>>2];A=+g[ma+60>>2];B=+g[na+4>>2];C=+g[na+8>>2];D=+g[na+12>>2];E=+g[b+624>>2];F=+g[b+640>>2];G=+g[b+656>>2];H=+g[na+20>>2];I=+g[na+24>>2];J=+g[na+28>>2];K=+g[na+36>>2];L=+g[na+40>>2];M=+g[na+44>>2];ja=+g[b+664>>2];ka=+g[b+668>>2];P=+g[b+672>>2];N=+g[na+52>>2]+(B*ja+C*ka+D*P);O=H*ja+I*ka+J*P+ +g[na+56>>2];P=K*ja+L*ka+M*P+ +g[na+60>>2];k=(a[b+736>>0]|0)==0;if(k){h=c[d+8>>2]|0;g[h>>2]=1.0;g[h+(la+1<<2)>>2]=1.0;g[h+((la<<1)+2<<2)>>2]=1.0;h=c[d+16>>2]|0;g[h>>2]=-1.0;g[h+(la+1<<2)>>2]=-1.0;g[h+((la<<1)+2<<2)>>2]=-1.0;h=la<<1;e=+g[ma+52>>2];f=+g[ma+56>>2];i=+g[ma+60>>2]}else{h=la<<1;e=y;f=z;i=A}e=y+(R*u+S*v+T*w)-e;ka=X*u+Y*v+Z*w+z-f;ja=_*u+$*v+aa*w+A-i;m=c[d+12>>2]|0;o=m+(h<<2)|0;c[m>>2]=0;g[m+4>>2]=ja;g[m+8>>2]=-ka;g[m+12>>2]=0.0;g[m+(la<<2)>>2]=-ja;c[m+(la<<2)+4>>2]=0;g[m+(la<<2)+8>>2]=e;g[m+(la<<2)+12>>2]=0.0;g[o>>2]=ka;g[o+4>>2]=-e;c[o+8>>2]=0;g[o+12>>2]=0.0;e=N-+g[na+52>>2];ka=O-+g[na+56>>2];ja=P-+g[na+60>>2];o=c[d+20>>2]|0;Q=o+(h<<2)|0;c[o>>2]=0;g[o+4>>2]=-ja;g[o+8>>2]=ka;g[o+12>>2]=0.0;g[o+(la<<2)>>2]=ja;c[o+(la<<2)+4>>2]=0;g[o+(la<<2)+8>>2]=-e;g[o+(la<<2)+12>>2]=0.0;g[Q>>2]=-ka;g[Q+4>>2]=e;c[Q+8>>2]=0;g[Q+12>>2]=0.0;e=+g[d>>2]*+g[d+4>>2];Q=c[d+28>>2]|0;if(k){g[Q>>2]=e*(N-(y+(R*u+S*v+T*w)));g[Q+(la<<2)>>2]=e*(O-(X*u+Y*v+Z*w+z));g[Q+(la<<1<<2)>>2]=e*(P-(_*u+$*v+aa*w+A))}g[m+(la*3<<2)>>2]=j*R+l*S+n*T;g[m+((la*3|0)+1<<2)>>2]=j*X+l*Y+n*Z;g[m+((la*3|0)+2<<2)>>2]=j*_+l*$+n*aa;g[m+(la<<2<<2)>>2]=R*p+S*s+T*t;g[m+((la<<2|1)<<2)>>2]=p*X+s*Y+t*Z;g[m+((la<<2|2)<<2)>>2]=p*_+s*$+t*aa;g[o+(la*3<<2)>>2]=-(j*R+l*S+n*T);g[o+((la*3|0)+1<<2)>>2]=-(j*X+l*Y+n*Z);g[o+((la*3|0)+2<<2)>>2]=-(j*_+l*$+n*aa);g[o+(la<<2<<2)>>2]=-(R*p+S*s+T*t);g[o+((la<<2|1)<<2)>>2]=-(p*X+s*Y+t*Z);g[o+((la<<2|2)<<2)>>2]=-(p*_+s*$+t*aa);ja=(U*X+V*Y+W*Z)*(E*K+F*L+G*M)-(U*_+V*$+W*aa)*(E*H+F*I+G*J);ka=(U*_+V*$+W*aa)*(B*E+C*F+D*G)-(R*U+S*V+T*W)*(E*K+F*L+G*M);ia=(R*U+S*V+T*W)*(E*H+F*I+G*J)-(U*X+V*Y+W*Z)*(B*E+C*F+D*G);g[Q+(la*3<<2)>>2]=((j*_+l*$+n*aa)*ia+((j*R+l*S+n*T)*ja+(j*X+l*Y+n*Z)*ka))*e;g[Q+(la<<2<<2)>>2]=((p*_+s*$+t*aa)*ia+((R*p+S*s+T*t)*ja+(p*X+s*Y+t*Z)*ka))*e;if(!(a[b+716>>0]|0)){p=0.0;r=0}else{ka=+g[b+708>>2]*+g[b+732>>2];p=ka;r=ka>0.0?1:2}h=a[b+737>>0]|0;q=(r|0)!=0;if(!(r|h&255))return;g[m+(la*5<<2)>>2]=R*U+S*V+T*W;g[m+((la*5|0)+1<<2)>>2]=U*X+V*Y+W*Z;g[m+((la*5|0)+2<<2)>>2]=U*_+V*$+W*aa;g[o+(la*5<<2)>>2]=-(R*U+S*V+T*W);g[o+((la*5|0)+1<<2)>>2]=-(U*X+V*Y+W*Z);g[o+((la*5|0)+2<<2)>>2]=-(U*_+V*$+W*aa);e=+g[b+688>>2];f=+g[b+692>>2];if(!((e-f)%6.2831854820251465<-3.1415927410125732))if((e-f)%6.2831854820251465>3.1415927410125732)n=(e-f)%6.2831854820251465+-6.2831854820251465;else n=(e-f)%6.2831854820251465;else n=(e-f)%6.2831854820251465+6.2831854820251465;if(!((e+f)%6.2831854820251465<-3.1415927410125732))if((e+f)%6.2831854820251465>3.1415927410125732)j=(e+f)%6.2831854820251465+-6.2831854820251465;else j=(e+f)%6.2831854820251465;else j=(e+f)%6.2831854820251465+6.2831854820251465;m=n==j;o=Q+(la*5<<2)|0;g[o>>2]=0.0;k=c[b+748>>2]|0;l=+g[((k&2|0)==0?d+4|0:b+760|0)>>2];if(!(h<<24>>24==0|q&m)){if(k&4|0)c[(c[d+32>>2]|0)+(la*5<<2)>>2]=c[b+752>>2];f=+g[b+728>>2];i=+g[b+680>>2];e=n>j?1.0:0.0;do if(!(n>=j)){e=i/(l*+g[d>>2]);if(e<0.0)if(f>=n&n-e>f){e=(n-f)/e;break}else{e=f0.0)if(f<=j&j-ej?0.0:1.0;break}else e=0.0}while(0);g[o>>2]=e*i*+g[b+732>>2]+ +g[o>>2];g[(c[d+36>>2]|0)+(la*5<<2)>>2]=-+g[b+684>>2];c[(c[d+40>>2]|0)+(la*5<<2)>>2]=c[b+684>>2]}if(!q)return;g[o>>2]=+g[o>>2]+p*l*+g[d>>2];if(k&1|0)c[(c[d+32>>2]|0)+(la*5<<2)>>2]=c[b+756>>2];do if(!m){h=(c[d+36>>2]|0)+(la*5<<2)|0;if((r|0)==1){g[h>>2]=0.0;e=3402823466385288598117041.0e14;break}else{g[h>>2]=-3402823466385288598117041.0e14;e=0.0;break}}else{g[(c[d+36>>2]|0)+(la*5<<2)>>2]=-3402823466385288598117041.0e14;e=3402823466385288598117041.0e14}while(0);g[(c[d+40>>2]|0)+(la*5<<2)>>2]=e;f=+g[b+704>>2];do if(f>0.0){e=(R*U+S*V+T*W)*+g[ma+328>>2]+(U*X+V*Y+W*Z)*+g[ma+332>>2]+(U*_+V*$+W*aa)*+g[ma+336>>2]-((R*U+S*V+T*W)*+g[na+328>>2]+(U*X+V*Y+W*Z)*+g[na+332>>2]+(U*_+V*$+W*aa)*+g[na+336>>2]);if((r|0)==1){if(!(e<0.0))break;if(!(+g[o>>2]<-(f*e)))break;g[o>>2]=-(f*e);break}else{if(!(e>0.0))break;if(!(+g[o>>2]>-(f*e)))break;g[o>>2]=-(f*e);break}}while(0);g[o>>2]=+g[b+700>>2]*+g[o>>2];return}S=+g[ma+4>>2];T=+g[ma+8>>2];U=+g[ma+12>>2];p=+g[b+556>>2];t=+g[b+572>>2];u=+g[b+588>>2];V=+g[b+560>>2];W=+g[b+576>>2];X=+g[b+592>>2];Y=+g[ma+20>>2];Z=+g[ma+24>>2];_=+g[ma+28>>2];$=+g[ma+36>>2];aa=+g[ma+40>>2];ba=+g[ma+44>>2];y=+g[b+600>>2];A=+g[b+604>>2];z=+g[b+608>>2];f=+g[ma+52>>2];s=+g[ma+56>>2];l=+g[ma+60>>2];ca=+g[na+4>>2];da=+g[na+8>>2];ea=+g[na+12>>2];fa=+g[b+624>>2];ga=+g[b+640>>2];K=+g[b+656>>2];L=+g[na+20>>2];M=+g[na+24>>2];N=+g[na+28>>2];O=+g[na+36>>2];P=+g[na+40>>2];R=+g[na+44>>2];D=+g[b+664>>2];C=+g[b+668>>2];i=+g[b+672>>2];e=+g[na+52>>2];n=+g[na+56>>2];j=+g[na+60>>2];F=e+(ca*D+da*C+ea*i)-(f+(S*y+T*A+U*z));G=L*D+M*C+N*i+n-(Y*y+Z*A+_*z+s);H=O*D+P*C+R*i+j-($*y+aa*A+ba*z+l);v=+g[(c[b+28>>2]|0)+344>>2];w=+g[(c[b+32>>2]|0)+344>>2];E=v+w>0.0?w/(v+w):.5;ha=(S*V+T*W+U*X)*E+(ca*fa+da*ga+ea*K)*(1.0-E);ia=(V*Y+W*Z+X*_)*E+(fa*L+ga*M+K*N)*(1.0-E);ja=(V*$+W*aa+X*ba)*E+(fa*O+ga*P+K*R)*(1.0-E);ka=1.0/+x(+(ja*ja+(ha*ha+ia*ia)));B=(O*D+P*C+R*i+j-j)*ja*ka+((e+(ca*D+da*C+ea*i)-e)*ha*ka+(L*D+M*C+N*i+n-n)*ia*ka);e=e+(ca*D+da*C+ea*i)-e-ha*ka*B;n=L*D+M*C+N*i+n-n-ia*ka*B;j=O*D+P*C+R*i+j-j-ja*ka*B;i=($*y+aa*A+ba*z+l-l)*ja*ka+((f+(S*y+T*A+U*z)-f)*ha*ka+(Y*y+Z*A+_*z+s-s)*ia*ka);f=f+(S*y+T*A+U*z)-f-ha*ka*i;s=Y*y+Z*A+_*z+s-s-ia*ka*i;l=$*y+aa*A+ba*z+l-l-ja*ka*i;z=f+E*(ha*ka*i-ha*ka*B);A=s+E*(ia*ka*i-ia*ka*B);y=l+E*(ja*ka*i-ja*ka*B);C=e-(1.0-E)*(ha*ka*i-ha*ka*B);D=n-(1.0-E)*(ia*ka*i-ia*ka*B);B=j-(1.0-E)*(ja*ka*i-ja*ka*B);i=(E*j+(1.0-E)*l)*(E*j+(1.0-E)*l)+((E*e+(1.0-E)*f)*(E*e+(1.0-E)*f)+(E*n+(1.0-E)*s)*(E*n+(1.0-E)*s));if(i>1.1920928955078125e-07){p=1.0/+x(+i);J=(E*e+(1.0-E)*f)*p;I=(E*j+(1.0-E)*l)*p;p=(E*n+(1.0-E)*s)*p}else{J=S*p+T*t+U*u;I=p*$+t*aa+u*ba;p=p*Y+t*Z+u*_}s=ia*ka*I-ja*ka*p;t=ja*ka*J-ha*ka*I;u=ha*ka*p-ia*ka*J;Q=c[d+12>>2]|0;g[Q>>2]=A*I-y*p;g[Q+4>>2]=y*J-z*I;g[Q+8>>2]=z*p-A*J;Q=c[d+20>>2]|0;g[Q>>2]=-(D*I-B*p);g[Q+4>>2]=-(B*J-C*I);g[Q+8>>2]=-(C*p-D*J);if(v<1.1920928955078125e-07|w<1.1920928955078125e-07?(a[b+716>>0]|0)!=0:0){e=E*(A*u-y*t);f=E*(y*s-z*u);i=E*(z*t-A*s);j=(1.0-E)*(D*u-B*t);l=(1.0-E)*(B*s-C*u);n=(1.0-E)*(C*t-D*s)}else{e=A*u-y*t;f=y*s-z*u;i=z*t-A*s;j=D*u-B*t;l=B*s-C*u;n=C*t-D*s}Q=(c[d+12>>2]|0)+(la<<2)|0;g[Q>>2]=e;g[Q+4>>2]=f;g[Q+8>>2]=i;Q=c[d+20>>2]|0;g[Q+(la<<2)>>2]=-j;g[Q+(la+1<<2)>>2]=-l;g[Q+(la+2<<2)>>2]=-n;if(v<1.1920928955078125e-07|w<1.1920928955078125e-07){n=E*(A*ja*ka-y*ia*ka);l=E*(y*ha*ka-z*ja*ka);f=E*(z*ia*ka-A*ha*ka);j=(1.0-E)*(D*ja*ka-B*ia*ka);i=(1.0-E)*(B*ha*ka-C*ja*ka);e=(1.0-E)*(C*ia*ka-D*ha*ka)}else{n=A*ja*ka-y*ia*ka;l=y*ha*ka-z*ja*ka;f=z*ia*ka-A*ha*ka;j=D*ja*ka-B*ia*ka;i=B*ha*ka-C*ja*ka;e=C*ia*ka-D*ha*ka}m=(c[d+12>>2]|0)+(la<<1<<2)|0;g[m>>2]=n;g[m+4>>2]=l;g[m+8>>2]=f;m=c[d+20>>2]|0;g[m+(la<<1<<2)>>2]=-j;g[m+((la<<1|1)<<2)>>2]=-i;g[m+((la<<1)+2<<2)>>2]=-e;e=+g[d>>2]*+g[d+4>>2];if(!(a[b+736>>0]|0)){o=c[d+8>>2]|0;g[o>>2]=J;g[o+4>>2]=p;g[o+8>>2]=I;o=(c[d+8>>2]|0)+(la<<2)|0;g[o>>2]=s;g[o+4>>2]=t;g[o+8>>2]=u;o=(c[d+8>>2]|0)+(la<<1<<2)|0;g[o>>2]=ha*ka;g[o+4>>2]=ia*ka;g[o+8>>2]=ja*ka;o=c[d+16>>2]|0;f=-J;g[o>>2]=f;g[o+4>>2]=-p;g[o+8>>2]=-I;g[o+(la<<2)>>2]=-s;g[o+(la+1<<2)>>2]=-t;g[o+(la+2<<2)>>2]=-u;g[o+(la<<1<<2)>>2]=-(ha*ka);g[o+((la<<1|1)<<2)>>2]=-(ia*ka);g[o+((la<<1)+2<<2)>>2]=-(ja*ka);o=c[d+28>>2]|0;g[o>>2]=e*(F*J+G*p+H*I);g[o+(la<<2)>>2]=e*(F*s+G*t+H*u);g[o+(la<<1<<2)>>2]=e*(F*ha*ka+G*ia*ka+H*ja*ka);e=f;f=-s;i=-t;j=-u;m=c[d+20>>2]|0}else{e=-J;f=-s;i=-t;j=-u;o=c[d+28>>2]|0}k=c[d+12>>2]|0;g[k+(la*3<<2)>>2]=J;g[k+((la*3|0)+1<<2)>>2]=p;g[k+((la*3|0)+2<<2)>>2]=I;g[k+(la<<2<<2)>>2]=s;g[k+((la<<2|1)<<2)>>2]=t;g[k+((la<<2|2)<<2)>>2]=u;g[m+(la*3<<2)>>2]=e;g[m+((la*3|0)+1<<2)>>2]=-p;g[m+((la*3|0)+2<<2)>>2]=-I;g[m+(la<<2<<2)>>2]=f;g[m+((la<<2|1)<<2)>>2]=i;g[m+((la<<2|2)<<2)>>2]=j;G=+g[d>>2]*+g[d+4>>2];H=(V*Y+W*Z+X*_)*(fa*O+ga*P+K*R)-(V*$+W*aa+X*ba)*(fa*L+ga*M+K*N);ba=(V*$+W*aa+X*ba)*(ca*fa+da*ga+ea*K)-(S*V+T*W+U*X)*(fa*O+ga*P+K*R);ga=(S*V+T*W+U*X)*(fa*L+ga*M+K*N)-(V*Y+W*Z+X*_)*(ca*fa+da*ga+ea*K);g[o+(la*3<<2)>>2]=G*(H*J+ba*p+ga*I);g[o+(la<<2<<2)>>2]=G*(H*s+ba*t+ga*u);if(!(a[b+716>>0]|0)){p=0.0;r=0}else{ga=+g[b+708>>2]*+g[b+732>>2];p=ga;r=ga>0.0?1:2}h=a[b+737>>0]|0;q=(r|0)!=0;if(!(r|h&255))return;g[k+(la*5<<2)>>2]=ha*ka;g[k+((la*5|0)+1<<2)>>2]=ia*ka;g[k+((la*5|0)+2<<2)>>2]=ja*ka;g[m+(la*5<<2)>>2]=-(ha*ka);g[m+((la*5|0)+1<<2)>>2]=-(ia*ka);g[m+((la*5|0)+2<<2)>>2]=-(ja*ka);e=+g[b+688>>2];f=+g[b+692>>2];if(!((e-f)%6.2831854820251465<-3.1415927410125732))if((e-f)%6.2831854820251465>3.1415927410125732)n=(e-f)%6.2831854820251465+-6.2831854820251465;else n=(e-f)%6.2831854820251465;else n=(e-f)%6.2831854820251465+6.2831854820251465;if(!((e+f)%6.2831854820251465<-3.1415927410125732))if((e+f)%6.2831854820251465>3.1415927410125732)j=(e+f)%6.2831854820251465+-6.2831854820251465;else j=(e+f)%6.2831854820251465;else j=(e+f)%6.2831854820251465+6.2831854820251465;m=n==j;o=o+(la*5<<2)|0;g[o>>2]=0.0;k=c[b+748>>2]|0;l=+g[((k&2|0)==0?d+4|0:b+760|0)>>2];if(!(h<<24>>24==0|q&m)){if(k&4|0)c[(c[d+32>>2]|0)+(la*5<<2)>>2]=c[b+752>>2];f=+g[b+728>>2];i=+g[b+680>>2];e=n>j?1.0:0.0;do if(!(n>=j)){e=i/(l*+g[d>>2]);if(e<0.0)if(f>=n&n-e>f){e=(n-f)/e;break}else{e=f0.0)if(f<=j&j-ej?0.0:1.0;break}else e=0.0}while(0);g[o>>2]=e*i*+g[b+732>>2]+ +g[o>>2];g[(c[d+36>>2]|0)+(la*5<<2)>>2]=-+g[b+684>>2];c[(c[d+40>>2]|0)+(la*5<<2)>>2]=c[b+684>>2]}if(!q)return;g[o>>2]=+g[o>>2]+p*l*+g[d>>2];if(k&1|0)c[(c[d+32>>2]|0)+(la*5<<2)>>2]=c[b+756>>2];do if(!m){h=(c[d+36>>2]|0)+(la*5<<2)|0;if((r|0)==1){g[h>>2]=0.0;e=3402823466385288598117041.0e14;break}else{g[h>>2]=-3402823466385288598117041.0e14;e=0.0;break}}else{g[(c[d+36>>2]|0)+(la*5<<2)>>2]=-3402823466385288598117041.0e14;e=3402823466385288598117041.0e14}while(0);g[(c[d+40>>2]|0)+(la*5<<2)>>2]=e;f=+g[b+704>>2];do if(f>0.0){e=+g[ma+328>>2]*ha*ka+ +g[ma+332>>2]*ia*ka+ +g[ma+336>>2]*ja*ka-(+g[na+328>>2]*ha*ka+ +g[na+332>>2]*ia*ka+ +g[na+336>>2]*ja*ka);if((r|0)==1){if(!(e<0.0))break;if(!(+g[o>>2]<-(f*e)))break;g[o>>2]=-(f*e);break}else{if(!(e>0.0))break;if(!(+g[o>>2]>-(f*e)))break;g[o>>2]=-(f*e);break}}while(0);g[o>>2]=+g[b+700>>2]*+g[o>>2];return}function Eb(d,e,f,h,i,j){d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=+j;var k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0,E=0,F=0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0;F=sa;sa=sa+896|0;E=c[h+4>>2]|0;D=c[h+12>>2]|0;k=c[E+4>>2]|0;if((k|0)<20){c[F+712>>2]=6448;c[F+712+168>>2]=0;g[F+712+172>>2]=j;c[F+712+164>>2]=c[i+4>>2];g[F+352+308>>2]=9.999999747378752e-05;a[F+352+332>>0]=0;c[F+288>>2]=12028;c[F+64>>2]=12096;c[F+64+4>>2]=F+352;c[F+64+8>>2]=F+288;c[F+64+12>>2]=d;c[F+64+16>>2]=E;c[F+64+20>>2]=0;if((bd(F+64|0,e,f,D,D,F+712|0)|0?(u=F+712+132|0,p=+g[u>>2],q=+g[F+712+136>>2],r=+g[F+712+140>>2],p*p+q*q+r*r>9.999999747378752e-05):0)?(s=+g[F+712+164>>2],s<+g[i+4>>2]):0){j=1.0/+x(+(p*p+q*q+r*r));g[u>>2]=p*j;g[F+712+136>>2]=q*j;g[F+712+140>>2]=r*j;c[F+16>>2]=c[h+8>>2];c[F+16+4>>2]=0;c[F+16+8>>2]=c[u>>2];c[F+16+8+4>>2]=c[u+4>>2];c[F+16+8+8>>2]=c[u+8>>2];c[F+16+8+12>>2]=c[u+12>>2];c[F+16+24>>2]=c[F+712+148>>2];c[F+16+24+4>>2]=c[F+712+148+4>>2];c[F+16+24+8>>2]=c[F+712+148+8>>2];c[F+16+24+12>>2]=c[F+712+148+12>>2];g[F+16+40>>2]=s;+ya[c[(c[i>>2]|0)+12>>2]&15](i,F+16|0,1)}sa=F;return}if((k+-21|0)>>>0>=9){if((k|0)!=31){sa=F;return}Ki(19525);if((c[E+16>>2]|0)>0){k=0;do{t=c[E+24>>2]|0;l=+g[t+(k*80|0)>>2];o=+g[t+(k*80|0)+4>>2];r=+g[t+(k*80|0)+8>>2];m=+g[t+(k*80|0)+16>>2];p=+g[t+(k*80|0)+20>>2];v=+g[t+(k*80|0)+24>>2];n=+g[t+(k*80|0)+32>>2];q=+g[t+(k*80|0)+36>>2];y=+g[t+(k*80|0)+40>>2];N=+g[t+(k*80|0)+48>>2];M=+g[t+(k*80|0)+52>>2];C=+g[t+(k*80|0)+56>>2];t=c[t+(k*80|0)+64>>2]|0;L=+g[D>>2];K=+g[D+4>>2];J=+g[D+8>>2];I=+g[D+16>>2];H=+g[D+20>>2];G=+g[D+24>>2];s=+g[D+32>>2];w=+g[D+36>>2];z=+g[D+40>>2];A=N*L+M*K+C*J+ +g[D+48>>2];B=N*I+M*H+C*G+ +g[D+52>>2];C=N*s+M*w+C*z+ +g[D+56>>2];g[F+712>>2]=l*L+m*K+n*J;g[F+712+4>>2]=o*L+p*K+q*J;g[F+712+8>>2]=r*L+v*K+y*J;g[F+712+12>>2]=0.0;g[F+712+16>>2]=l*I+m*H+n*G;g[F+712+20>>2]=o*I+p*H+q*G;g[F+712+24>>2]=r*I+v*H+y*G;g[F+712+28>>2]=0.0;g[F+712+32>>2]=l*s+m*w+n*z;g[F+712+36>>2]=o*s+p*w+q*z;g[F+712+40>>2]=r*s+v*w+y*z;g[F+712+44>>2]=0.0;g[F+712+48>>2]=A;g[F+712+52>>2]=B;g[F+712+56>>2]=C;g[F+712+60>>2]=0.0;b[F+352+8>>1]=1;b[F+352+10>>1]=-1;c[F+352>>2]=8720;c[F+352+12>>2]=i;c[F+352+16>>2]=k;c[F+352+4>>2]=c[i+4>>2];u=c[h+8>>2]|0;c[F+288>>2]=h;c[F+288+4>>2]=t;c[F+288+8>>2]=u;c[F+288+12>>2]=F+712;c[F+288+16>>2]=-1;c[F+288+20>>2]=k;Eb(d,e,f,F+288|0,F+352|0,j);k=k+1|0}while((k|0)<(c[E+16>>2]|0))}k=c[3084]|0;E=(c[k+16>>2]|0)+-1|0;c[k+16>>2]=E;if(E|0){sa=F;return}do if(c[k+4>>2]|0){la(F+712|0,0)|0;E=c[7181]|0;g[k+8>>2]=+g[k+8>>2]+ +(((c[F+712+4>>2]|0)-(c[E+4>>2]|0)+(((c[F+712>>2]|0)-(c[E>>2]|0)|0)*1e6|0)-(c[k+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[k+16>>2]|0)){k=c[3084]|0;break}else{sa=F;return}}while(0);c[3084]=c[k+20>>2];sa=F;return}switch(k|0){case 21:{o=+g[D>>2];p=+g[D+16>>2];q=+g[D+32>>2];r=+g[D+4>>2];s=+g[D+20>>2];v=+g[D+36>>2];w=+g[D+8>>2];y=+g[D+24>>2];z=+g[D+40>>2];A=-+g[D+48>>2];B=-+g[D+52>>2];C=-+g[D+56>>2];n=+g[e+48>>2];m=+g[e+52>>2];l=+g[e+56>>2];g[F+352>>2]=o*A+p*B+q*C+(o*n+p*m+q*l);g[F+352+4>>2]=r*A+s*B+v*C+(r*n+s*m+v*l);g[F+352+8>>2]=w*A+y*B+z*C+(w*n+y*m+z*l);g[F+352+12>>2]=0.0;l=+g[f+48>>2];m=+g[f+52>>2];n=+g[f+56>>2];O=+g[f>>2];G=+g[f+16>>2];H=+g[f+32>>2];I=+g[f+4>>2];J=+g[f+20>>2];K=+g[f+36>>2];L=+g[f+8>>2];M=+g[f+24>>2];N=+g[f+40>>2];g[F+288>>2]=o*O+p*G+q*H;g[F+288+4>>2]=o*I+p*J+q*K;g[F+288+8>>2]=o*L+p*M+q*N;g[F+288+12>>2]=0.0;g[F+288+16>>2]=r*O+s*G+v*H;g[F+288+20>>2]=r*I+s*J+v*K;g[F+288+24>>2]=r*L+s*M+v*N;g[F+288+28>>2]=0.0;g[F+288+32>>2]=w*O+y*G+z*H;g[F+288+36>>2]=w*I+y*J+z*K;g[F+288+40>>2]=w*L+y*M+z*N;k=F+288+44|0;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;k=c[h+8>>2]|0;N=+va[c[(c[E>>2]|0)+48>>2]&15](E);c[F+64>>2]=11956;c[F+64+4>>2]=d;c[F+64+8>>2]=c[e>>2];c[F+64+8+4>>2]=c[e+4>>2];c[F+64+8+8>>2]=c[e+8>>2];c[F+64+8+12>>2]=c[e+12>>2];c[F+64+24>>2]=c[e+16>>2];c[F+64+24+4>>2]=c[e+16+4>>2];c[F+64+24+8>>2]=c[e+16+8>>2];c[F+64+24+12>>2]=c[e+16+12>>2];c[F+64+40>>2]=c[e+32>>2];c[F+64+40+4>>2]=c[e+32+4>>2];c[F+64+40+8>>2]=c[e+32+8>>2];c[F+64+40+12>>2]=c[e+32+12>>2];c[F+64+56>>2]=c[e+48>>2];c[F+64+56+4>>2]=c[e+48+4>>2];c[F+64+56+8>>2]=c[e+48+8>>2];c[F+64+56+12>>2]=c[e+48+12>>2];c[F+64+72>>2]=c[f>>2];c[F+64+72+4>>2]=c[f+4>>2];c[F+64+72+8>>2]=c[f+8>>2];c[F+64+72+12>>2]=c[f+12>>2];c[F+64+88>>2]=c[f+16>>2];c[F+64+88+4>>2]=c[f+16+4>>2];c[F+64+88+8>>2]=c[f+16+8>>2];c[F+64+88+12>>2]=c[f+16+12>>2];c[F+64+104>>2]=c[f+32>>2];c[F+64+104+4>>2]=c[f+32+4>>2];c[F+64+104+8>>2]=c[f+32+8>>2];c[F+64+104+12>>2]=c[f+32+12>>2];c[F+64+120>>2]=c[f+48>>2];c[F+64+120+4>>2]=c[f+48+4>>2];c[F+64+120+8>>2]=c[f+48+8>>2];c[F+64+120+12>>2]=c[f+48+12>>2];c[F+64+136>>2]=c[D>>2];c[F+64+136+4>>2]=c[D+4>>2];c[F+64+136+8>>2]=c[D+8>>2];c[F+64+136+12>>2]=c[D+12>>2];c[F+64+152>>2]=c[D+16>>2];c[F+64+152+4>>2]=c[D+16+4>>2];c[F+64+152+8>>2]=c[D+16+8>>2];c[F+64+152+12>>2]=c[D+16+12>>2];c[F+64+168>>2]=c[D+32>>2];c[F+64+168+4>>2]=c[D+32+4>>2];c[F+64+168+8>>2]=c[D+32+8>>2];c[F+64+168+12>>2]=c[D+32+12>>2];c[F+64+184>>2]=c[D+48>>2];c[F+64+184+4>>2]=c[D+48+4>>2];c[F+64+184+8>>2]=c[D+48+8>>2];c[F+64+184+12>>2]=c[D+48+12>>2];g[F+64+204>>2]=N;c[F+64>>2]=8672;c[F+64+212>>2]=i;c[F+64+216>>2]=k;c[F+64+220>>2]=E;c[F+64+200>>2]=c[i+4>>2];g[F+64+208>>2]=j;ab[c[(c[d>>2]|0)+8>>2]&127](d,F+288|0,F+16|0,F);k=c[E+48>>2]|0;c[F+712>>2]=9712;c[F+712+4>>2]=k;c[F+712+8>>2]=F+64;k=c[E+52>>2]|0;if(!(a[k+60>>0]|0))Xd(k,F+712|0,F+352|0,o*A+p*B+q*C+(o*l+p*m+q*n),r*A+s*B+v*C+(r*l+s*m+v*n),w*A+y*B+z*C+(w*l+y*m+z*n),F+16|0,F);else Dd(k,F+712|0,F+352|0,o*A+p*B+q*C+(o*l+p*m+q*n),r*A+s*B+v*C+(r*l+s*m+v*n),w*A+y*B+z*C+(w*l+y*m+z*n),F+16|0,F,c[k+56>>2]|0);sa=F;return}case 28:{c[F+712>>2]=6448;c[F+712+168>>2]=0;g[F+712+172>>2]=j;c[F+712+164>>2]=c[i+4>>2];c[F+352>>2]=12096;c[F+352+4>>2]=0;c[F+352+8>>2]=0;c[F+352+12>>2]=d;c[F+352+16>>2]=0;c[F+352+20>>2]=E;if((bd(F+352|0,e,f,D,D,F+712|0)|0?(t=F+712+132|0,l=+g[t>>2],m=+g[F+712+136>>2],n=+g[F+712+140>>2],l*l+m*m+n*n>9.999999747378752e-05):0)?(o=+g[F+712+164>>2],o<+g[i+4>>2]):0){O=1.0/+x(+(l*l+m*m+n*n));g[t>>2]=l*O;g[F+712+136>>2]=m*O;g[F+712+140>>2]=n*O;c[F+288>>2]=c[h+8>>2];c[F+288+4>>2]=0;c[F+288+8>>2]=c[t>>2];c[F+288+8+4>>2]=c[t+4>>2];c[F+288+8+8>>2]=c[t+8>>2];c[F+288+8+12>>2]=c[t+12>>2];c[F+288+24>>2]=c[F+712+148>>2];c[F+288+24+4>>2]=c[F+712+148+4>>2];c[F+288+24+8>>2]=c[F+712+148+8>>2];c[F+288+24+12>>2]=c[F+712+148+12>>2];g[F+288+40>>2]=o;+ya[c[(c[i>>2]|0)+12>>2]&15](i,F+288|0,1)}sa=F;return}default:{o=+g[D>>2];p=+g[D+16>>2];q=+g[D+32>>2];w=+g[D+4>>2];y=+g[D+20>>2];z=+g[D+36>>2];J=+g[D+8>>2];L=+g[D+24>>2];N=+g[D+40>>2];H=-+g[D+48>>2];G=-+g[D+52>>2];C=-+g[D+56>>2];A=+g[e+48>>2];B=+g[e+52>>2];l=+g[e+56>>2];n=o*H+p*G+q*C+(o*A+p*B+q*l);m=w*H+y*G+z*C+(w*A+y*B+z*l);l=J*H+L*G+N*C+(J*A+L*B+N*l);B=+g[f+48>>2];A=+g[f+52>>2];v=+g[f+56>>2];r=o*H+p*G+q*C+(o*B+p*A+q*v);s=w*H+y*G+z*C+(w*B+y*A+z*v);v=J*H+L*G+N*C+(J*B+L*A+N*v);A=+g[f>>2];B=+g[f+16>>2];C=+g[f+32>>2];G=+g[f+4>>2];H=+g[f+20>>2];I=+g[f+36>>2];K=+g[f+8>>2];M=+g[f+24>>2];O=+g[f+40>>2];g[F+712>>2]=o*A+p*B+q*C;g[F+712+4>>2]=o*G+p*H+q*I;g[F+712+8>>2]=o*K+p*M+q*O;g[F+712+12>>2]=0.0;g[F+712+16>>2]=w*A+y*B+z*C;g[F+712+20>>2]=w*G+y*H+z*I;g[F+712+24>>2]=w*K+y*M+z*O;g[F+712+28>>2]=0.0;g[F+712+32>>2]=J*A+L*B+N*C;g[F+712+36>>2]=J*G+L*H+N*I;g[F+712+40>>2]=J*K+L*M+N*O;u=F+712+44|0;c[u>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;h=c[h+8>>2]|0;O=+va[c[(c[E>>2]|0)+48>>2]&15](E);c[F+352>>2]=11956;c[F+352+4>>2]=d;c[F+352+8>>2]=c[e>>2];c[F+352+8+4>>2]=c[e+4>>2];c[F+352+8+8>>2]=c[e+8>>2];c[F+352+8+12>>2]=c[e+12>>2];c[F+352+24>>2]=c[e+16>>2];c[F+352+24+4>>2]=c[e+16+4>>2];c[F+352+24+8>>2]=c[e+16+8>>2];c[F+352+24+12>>2]=c[e+16+12>>2];c[F+352+40>>2]=c[e+32>>2];c[F+352+40+4>>2]=c[e+32+4>>2];c[F+352+40+8>>2]=c[e+32+8>>2];c[F+352+40+12>>2]=c[e+32+12>>2];c[F+352+56>>2]=c[e+48>>2];c[F+352+56+4>>2]=c[e+48+4>>2];c[F+352+56+8>>2]=c[e+48+8>>2];c[F+352+56+12>>2]=c[e+48+12>>2];c[F+352+72>>2]=c[f>>2];c[F+352+72+4>>2]=c[f+4>>2];c[F+352+72+8>>2]=c[f+8>>2];c[F+352+72+12>>2]=c[f+12>>2];c[F+352+88>>2]=c[f+16>>2];c[F+352+88+4>>2]=c[f+16+4>>2];c[F+352+88+8>>2]=c[f+16+8>>2];c[F+352+88+12>>2]=c[f+16+12>>2];c[F+352+104>>2]=c[f+32>>2];c[F+352+104+4>>2]=c[f+32+4>>2];c[F+352+104+8>>2]=c[f+32+8>>2];c[F+352+104+12>>2]=c[f+32+12>>2];c[F+352+120>>2]=c[f+48>>2];c[F+352+120+4>>2]=c[f+48+4>>2];c[F+352+120+8>>2]=c[f+48+8>>2];c[F+352+120+12>>2]=c[f+48+12>>2];c[F+352+136>>2]=c[D>>2];c[F+352+136+4>>2]=c[D+4>>2];c[F+352+136+8>>2]=c[D+8>>2];c[F+352+136+12>>2]=c[D+12>>2];c[F+352+152>>2]=c[D+16>>2];c[F+352+152+4>>2]=c[D+16+4>>2];c[F+352+152+8>>2]=c[D+16+8>>2];c[F+352+152+12>>2]=c[D+16+12>>2];c[F+352+168>>2]=c[D+32>>2];c[F+352+168+4>>2]=c[D+32+4>>2];c[F+352+168+8>>2]=c[D+32+8>>2];c[F+352+168+12>>2]=c[D+32+12>>2];c[F+352+184>>2]=c[D+48>>2];c[F+352+184+4>>2]=c[D+48+4>>2];c[F+352+184+8>>2]=c[D+48+8>>2];c[F+352+184+12>>2]=c[D+48+12>>2];g[F+352+204>>2]=O;c[F+352>>2]=8696;c[F+352+212>>2]=i;c[F+352+216>>2]=h;c[F+352+220>>2]=E;c[F+352+200>>2]=c[i+4>>2];g[F+352+208>>2]=j;ab[c[(c[d>>2]|0)+8>>2]&127](d,F+712|0,F+288|0,F+64|0);g[F+16>>2]=n;g[F+16+4>>2]=m;g[F+16+8>>2]=l;g[F+16+12>>2]=0.0;if(r>2]=r;o=r}else o=n;if(s>2]=s;p=s}else p=m;if(v>2]=v;q=v}else q=l;g[F>>2]=n;g[F+4>>2]=m;g[F+8>>2]=l;g[F+12>>2]=0.0;if(n>2]=r;n=r}if(m>2]=s;m=s}if(l>2]=v;l=v}g[F+16>>2]=+g[F+288>>2]+o;g[F+16+4>>2]=+g[F+288+4>>2]+p;g[F+16+8>>2]=+g[F+288+8>>2]+q;g[F>>2]=+g[F+64>>2]+n;g[F+4>>2]=+g[F+64+4>>2]+m;g[F+8>>2]=+g[F+64+8>>2]+l;ab[c[(c[E>>2]|0)+64>>2]&127](E,F+352|0,F+16|0,F);sa=F;return}}}function Fb(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0.0,u=0,v=0.0,y=0,z=0,A=0.0,B=0.0,C=0.0,D=0,E=0,F=0,G=0,H=0,I=0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0,Q=0,R=0,S=0.0,T=0.0,U=0.0,V=0,W=0.0,X=0.0,Y=0.0,Z=0,_=0,$=0,aa=0,ba=0,ca=0.0,da=0,ea=0;da=c[b+28>>2]|0;ea=c[b+32>>2]|0;W=+g[da+344>>2];X=+g[ea+344>>2];_=c[d+24>>2]|0;ca=(a[b+180>>0]|0)==0?-1.0:1.0;S=+g[b+936>>2]-+g[b+872>>2];T=+g[b+940>>2]-+g[b+876>>2];U=+g[b+944>>2]-+g[b+880>>2];Y=W+X>0.0?X/(W+X):.5;D=c[b+824>>2]|0;E=c[b+840>>2]|0;F=c[b+856>>2]|0;G=c[b+888>>2]|0;H=c[b+904>>2]|0;I=c[b+920>>2]|0;V=(a[b+49>>0]|0)==0;if(V){q=c[b+828>>2]|0;i=c[b+844>>2]|0;y=c[b+860>>2]|0;z=c[b+832>>2]|0;h=c[b+848>>2]|0;R=c[b+864>>2]|0;n=(c[j>>2]=q,+g[j>>2]);f=(c[j>>2]=i,+g[j>>2]);p=(c[j>>2]=y,+g[j>>2]);r=(c[j>>2]=z,+g[j>>2]);s=(c[j>>2]=h,+g[j>>2]);$=D;u=R;aa=E;ba=F;o=(c[j>>2]=R,+g[j>>2])}else{e=Y*(c[j>>2]=D,+g[j>>2]);l=Y*(c[j>>2]=E,+g[j>>2]);k=Y*(c[j>>2]=F,+g[j>>2]);f=(1.0-Y)*(c[j>>2]=G,+g[j>>2]);m=(1.0-Y)*(c[j>>2]=H,+g[j>>2]);k=k+(1.0-Y)*(c[j>>2]=I,+g[j>>2]);n=1.0/+x(+((e+f)*(e+f)+(l+m)*(l+m)+k*k));h=(g[j>>2]=(e+f)*n,c[j>>2]|0);i=(g[j>>2]=(l+m)*n,c[j>>2]|0);q=(g[j>>2]=k*n,c[j>>2]|0);if(+w(+(k*n))>.7071067690849304){O=1.0/+x(+(k*n*k*n+(l+m)*n*(l+m)*n));s=-((e+f)*n*(l+m)*n*O);o=(e+f)*n*-(k*n*O);r=(k*n*k*n+(l+m)*n*(l+m)*n)*O;p=(l+m)*n*O;f=-(k*n*O);e=0.0}else{o=(e+f)*n*(e+f)*n+(l+m)*n*(l+m)*n;O=1.0/+x(+o);s=k*n*-((l+m)*n*O);o=o*O;r=-(k*n*(e+f)*n*O);p=0.0;f=(e+f)*n*O;e=-((l+m)*n*O)}R=(g[j>>2]=e,c[j>>2]|0);Q=(g[j>>2]=f,c[j>>2]|0);y=(g[j>>2]=p,c[j>>2]|0);z=(g[j>>2]=r,c[j>>2]|0);P=(g[j>>2]=s,c[j>>2]|0);$=h;u=(g[j>>2]=o,c[j>>2]|0);aa=i;ba=q;h=P;i=Q;q=R;n=e}R=c[d+12>>2]|0;c[R>>2]=q;c[R+4>>2]=i;c[R+8>>2]=y;c[R+(_<<2)>>2]=z;c[R+(_+1<<2)>>2]=h;c[R+(_+2<<2)>>2]=u;k=-n;P=c[d+20>>2]|0;g[P>>2]=k;g[P+4>>2]=-f;g[P+8>>2]=-p;g[P+(_<<2)>>2]=-r;g[P+(_+1<<2)>>2]=-s;g[P+(_+2<<2)>>2]=-o;Q=c[b+300>>2]|0;e=+g[b+280>>2];if(!(Q&128))e=e*+g[d+4>>2];B=e*+g[d>>2];N=(c[j>>2]=E,+g[j>>2]);K=(c[j>>2]=I,+g[j>>2]);C=(c[j>>2]=F,+g[j>>2]);M=(c[j>>2]=H,+g[j>>2]);O=(c[j>>2]=G,+g[j>>2]);L=(c[j>>2]=D,+g[j>>2]);u=c[d+28>>2]|0;g[u>>2]=B*((N*K-C*M)*n+(C*O-L*K)*f+(L*M-N*O)*p);g[u+(_<<2)>>2]=B*((N*K-C*M)*r+(C*O-L*K)*s+(L*M-N*O)*o);if(Q&64|0){I=c[d+32>>2]|0;c[I>>2]=c[b+292>>2];c[I+(_<<2)>>2]=c[b+292>>2]}A=+g[da+52>>2];t=+g[da+56>>2];v=+g[da+60>>2];m=+g[ea+52>>2];e=+g[ea+56>>2];l=+g[ea+60>>2];if(V){N=(e-t)*p-(l-v)*f;O=(l-v)*n-(m-A)*p;M=(m-A)*f-(e-t)*n;g[R+(_<<1<<2)>>2]=Y*N;g[R+((_<<1|1)<<2)>>2]=Y*O;g[R+((_<<1)+2<<2)>>2]=Y*M;g[P+(_<<1<<2)>>2]=(1.0-Y)*N;g[P+((_<<1|1)<<2)>>2]=(1.0-Y)*O;g[P+((_<<1)+2<<2)>>2]=(1.0-Y)*M;M=(e-t)*o-(l-v)*s;O=(l-v)*r-(m-A)*o;N=(m-A)*s-(e-t)*r;g[R+(_*3<<2)>>2]=Y*M;g[R+((_*3|0)+1<<2)>>2]=Y*O;g[R+((_*3|0)+2<<2)>>2]=Y*N;g[P+(_*3<<2)>>2]=(1.0-Y)*M;g[P+((_*3|0)+1<<2)>>2]=(1.0-Y)*O;g[P+((_*3|0)+2<<2)>>2]=(1.0-Y)*N;i=c[d+8>>2]|0;g[i+(_<<1<<2)>>2]=n;g[i+((_<<1|1)<<2)>>2]=f;g[i+((_<<1)+2<<2)>>2]=p;g[i+(_*3<<2)>>2]=r;g[i+((_*3|0)+1<<2)>>2]=s;g[i+((_*3|0)+2<<2)>>2]=o;q=c[d+16>>2]|0;g[q+(_<<1<<2)>>2]=k;g[q+((_<<1|1)<<2)>>2]=-f;g[q+((_<<1)+2<<2)>>2]=-p;g[q+(_*3<<2)>>2]=-r;g[q+((_*3|0)+1<<2)>>2]=-s;h=q+((_*3|0)+2<<2)|0;N=n;O=0.0;M=0.0;L=0.0;K=0.0;C=0.0;B=0.0;n=e-t;l=l-v;k=m-A}else{r=+g[b+936>>2]-m;s=+g[b+940>>2]-e;M=+g[b+944>>2]-l;n=(c[j>>2]=$,+g[j>>2]);o=(c[j>>2]=aa,+g[j>>2]);m=(c[j>>2]=ba,+g[j>>2]);N=+g[b+872>>2]-A;O=+g[b+876>>2]-t;e=+g[b+880>>2]-v;C=+g[b+1080>>2]-+g[b+1032>>2];B=(N*n+O*o+e*m)*n+C*n-(r*n+s*o+M*m)*n;K=(N*n+O*o+e*m)*o+C*o-(r*n+s*o+M*m)*o;C=(N*n+O*o+e*m)*m+C*m-(r*n+s*o+M*m)*m;L=N-(N*n+O*o+e*m)*n+Y*B;t=O-(N*n+O*o+e*m)*o+Y*K;v=e-(N*n+O*o+e*m)*m+Y*C;B=r-(r*n+s*o+M*m)*n-(1.0-Y)*B;K=s-(r*n+s*o+M*m)*o-(1.0-Y)*K;C=M-(r*n+s*o+M*m)*m-(1.0-Y)*C;k=Y*(r-(r*n+s*o+M*m)*n)+(1.0-Y)*(N-(N*n+O*o+e*m)*n);f=Y*(s-(r*n+s*o+M*m)*o)+(1.0-Y)*(O-(N*n+O*o+e*m)*o);e=Y*(M-(r*n+s*o+M*m)*m)+(1.0-Y)*(e-(N*n+O*o+e*m)*m);if(e*e+(k*k+f*f)>1.1920928955078125e-07){O=1.0/+x(+(e*e+(k*k+f*f)));i=(g[j>>2]=f*O,c[j>>2]|0);q=(g[j>>2]=e*O,c[j>>2]|0);l=e*O;e=f*O;p=k*O;h=(g[j>>2]=k*O,c[j>>2]|0)}else{h=c[b+828>>2]|0;i=c[b+844>>2]|0;q=c[b+860>>2]|0;l=(c[j>>2]=q,+g[j>>2]);e=(c[j>>2]=i,+g[j>>2]);p=(c[j>>2]=h,+g[j>>2])}r=l*o-e*m;s=p*m-l*n;o=e*n-p*o;g[R+(_<<1<<2)>>2]=t*l-v*e;g[R+(_<<1<<2)+4>>2]=v*p-L*l;g[R+(_<<1<<2)+8>>2]=L*e-t*p;g[P+(_<<1<<2)>>2]=-(K*l-C*e);g[P+((_<<1|1)<<2)>>2]=-(C*p-B*l);g[P+((_<<1)+2<<2)>>2]=-(B*e-K*p);if(W<1.1920928955078125e-07|X<1.1920928955078125e-07?(a[b+297>>0]|0)!=0:0){e=Y*(t*o-v*s);f=Y*(L*s-t*r);k=Y*(v*r-L*o);l=(1.0-Y)*(K*o-C*s);m=(1.0-Y)*(C*r-B*o);n=(1.0-Y)*(B*s-K*r)}else{e=t*o-v*s;f=L*s-t*r;k=v*r-L*o;l=K*o-C*s;m=C*r-B*o;n=B*s-K*r}g[R+(_*3<<2)>>2]=e;g[R+(_*3<<2)+4>>2]=k;g[R+(_*3<<2)+8>>2]=f;g[P+(_*3<<2)>>2]=-l;g[P+((_*3|0)+1<<2)>>2]=-m;g[P+((_*3|0)+2<<2)>>2]=-n;H=c[d+8>>2]|0;c[H+(_<<1<<2)>>2]=h;c[H+((_<<1|1)<<2)>>2]=i;c[H+((_<<1)+2<<2)>>2]=q;g[H+(_*3<<2)>>2]=r;g[H+((_*3|0)+1<<2)>>2]=s;g[H+((_*3|0)+2<<2)>>2]=o;I=c[d+16>>2]|0;g[I+(_<<1<<2)>>2]=-p;f=(c[j>>2]=i,+g[j>>2]);g[I+((_<<1|1)<<2)>>2]=-f;O=(c[j>>2]=q,+g[j>>2]);g[I+((_<<1)+2<<2)>>2]=-O;g[I+(_*3<<2)>>2]=-r;g[I+((_*3|0)+1<<2)>>2]=-s;h=I+((_*3|0)+2<<2)|0;N=p;p=O;i=H;q=I;O=t;M=v;n=0.0;l=0.0;k=0.0}g[h>>2]=-o;e=+g[b+264>>2];if(!(Q&32))e=e*+g[d+4>>2];A=e*+g[d>>2];g[u+(_<<1<<2)>>2]=A*(S*N+T*f+U*p);g[u+(_*3<<2)>>2]=A*(S*r+T*s+U*o);if(Q&16|0){I=c[d+32>>2]|0;c[I+(_<<1<<2)>>2]=c[b+276>>2];c[I+(_*3<<2)>>2]=c[b+276>>2]}if(!(a[b+296>>0]|0)){o=0.0;z=0}else{U=ca*+g[b+1032>>2];o=U;z=U>0.0?2:1}h=a[b+1096>>0]|0;y=(z|0)!=0;if(z|h&255){c[i+(_<<2<<2)>>2]=$;c[i+((_<<2|1)<<2)>>2]=aa;c[i+((_<<2|2)<<2)>>2]=ba;p=(c[j>>2]=$,+g[j>>2]);g[q+(_<<2<<2)>>2]=-p;r=(c[j>>2]=aa,+g[j>>2]);g[q+((_<<2|1)<<2)>>2]=-r;s=(c[j>>2]=ba,+g[j>>2]);g[q+((_<<2|2)<<2)>>2]=-s;if(!V){if(!(W<1.1920928955078125e-07|X<1.1920928955078125e-07)){g[R+(_<<2<<2)>>2]=O*s-M*r;g[R+((_<<2|1)<<2)>>2]=M*p-L*s;g[R+((_<<2|2)<<2)>>2]=L*r-O*p;g[P+(_<<2<<2)>>2]=-(K*s-C*r);g[P+((_<<2|1)<<2)>>2]=-(C*p-B*s);e=-(B*r-K*p);Z=31}}else{W=n*s-l*r;X=l*p-k*s;e=k*r-n*p;g[R+(_<<2<<2)>>2]=Y*W;g[R+((_<<2|1)<<2)>>2]=Y*X;g[R+((_<<2|2)<<2)>>2]=Y*e;g[P+(_<<2<<2)>>2]=(1.0-Y)*W;g[P+((_<<2|1)<<2)>>2]=(1.0-Y)*X;e=(1.0-Y)*e;Z=31}if((Z|0)==31)g[P+((_<<2|2)<<2)>>2]=e;q=+g[b+184>>2]==+g[b+188>>2];g[u+(_<<2<<2)>>2]=0.0;i=(c[d+36>>2]|0)+(_<<2<<2)|0;g[i>>2]=0.0;u=(c[d+40>>2]|0)+(_<<2<<2)|0;g[u>>2]=0.0;n=+g[((Q&512|0)==0?d+4|0:b+232|0)>>2];if(!(h<<24>>24==0|y&q)){if(Q&1|0)c[(c[d+32>>2]|0)+(_<<2<<2)>>2]=c[b+212>>2];m=+g[b+1100>>2];e=+g[b+1080>>2];f=+g[b+184>>2];k=+g[b+188>>2];l=n*+g[d>>2];do if(!(f>k))if(!(f==k)){if(m/l<0.0)if(e>=f?f-m/l>e:0){e=(f-e)/(m/l);break}else{e=e0.0)if(e<=k?k-m/lk?0.0:1.0;break}else e=0.0}else e=0.0;else e=1.0;while(0);Z=(c[d+28>>2]|0)+(_<<2<<2)|0;g[Z>>2]=+g[Z>>2]-ca*e*m;g[i>>2]=+g[i>>2]-+g[b+1104>>2]*+g[d>>2];g[u>>2]=+g[b+1104>>2]*+g[d>>2]+ +g[u>>2]}if(y){h=(c[d+28>>2]|0)+(_<<2<<2)|0;g[h>>2]=+g[h>>2]+o*n*+g[d>>2];if(c[b+300>>2]&256|0)c[(c[d+32>>2]|0)+(_<<2<<2)>>2]=c[b+244>>2];do if(!q)if((z|0)==1){g[i>>2]=-3402823466385288598117041.0e14;e=0.0;break}else{g[i>>2]=0.0;e=3402823466385288598117041.0e14;break}else{g[i>>2]=-3402823466385288598117041.0e14;e=3402823466385288598117041.0e14}while(0);g[u>>2]=e;Y=1.0-+g[b+240>>2];f=+w(+Y);do if(!(Y!=Y|0.0!=0.0|Y==0.0)){e=ca*(+g[da+312>>2]*p+ +g[da+316>>2]*r+ +g[da+320>>2]*s-(+g[ea+312>>2]*p+ +g[ea+316>>2]*r+ +g[ea+320>>2]*s));if((z|0)==1){if(!(e<0.0))break;if(!(+g[h>>2]<-(f*e)))break;g[h>>2]=-(f*e);break}else{if(!(e>0.0))break;if(!(+g[h>>2]>-(f*e)))break;g[h>>2]=-(f*e);break}}while(0);g[h>>2]=+g[b+232>>2]*+g[h>>2];h=5}else h=5}else h=4;if(!(a[b+297>>0]|0)){s=0.0;y=0}else{ca=+g[b+1088>>2];s=ca;y=ca>0.0?1:2}i=a[b+1112>>0]|0;q=(y|0)!=0;if(!(y|i&255))return;u=J(c[d+24>>2]|0,h)|0;h=c[d+12>>2]|0;c[h+(u<<2)>>2]=$;c[h+(u+1<<2)>>2]=aa;c[h+(u+2<<2)>>2]=ba;v=(c[j>>2]=$,+g[j>>2]);h=c[d+20>>2]|0;g[h+(u<<2)>>2]=-v;t=(c[j>>2]=aa,+g[j>>2]);g[h+(u+1<<2)>>2]=-t;r=(c[j>>2]=ba,+g[j>>2]);g[h+(u+2<<2)>>2]=-r;n=+g[b+192>>2];o=+g[b+196>>2];h=c[b+300>>2]|0;p=+g[((h&2048|0)==0?d+4|0:b+248|0)>>2];if(!(i<<24>>24==0|q&n==o)){if(!(h&4)){k=o;l=n}else{c[(c[d+32>>2]|0)+(u<<2)>>2]=c[b+228>>2];k=+g[b+196>>2];l=+g[b+192>>2]}e=+g[b+1084>>2];m=+g[b+1116>>2];f=p*+g[d>>2];do if(!(l>k))if(!(l==k)){if(m/f<0.0)if(e>=l?l-m/f>e:0){e=(l-e)/(m/f);break}else{e=e0.0)if(e<=k?k-m/fk?0.0:1.0;break}else e=0.0}else e=0.0;else e=1.0;while(0);g[(c[d+28>>2]|0)+(u<<2)>>2]=e*m;g[(c[d+36>>2]|0)+(u<<2)>>2]=-(+g[b+1120>>2]*+g[d>>2]);g[(c[d+40>>2]|0)+(u<<2)>>2]=+g[b+1120>>2]*+g[d>>2]}if(!q)return;i=(c[d+28>>2]|0)+(u<<2)|0;g[i>>2]=+g[i>>2]+s*p*+g[d>>2];if(h&1024|0)c[(c[d+32>>2]|0)+(u<<2)>>2]=c[b+260>>2];do if(!(n==o)){h=(c[d+36>>2]|0)+(u<<2)|0;if((y|0)==1){g[h>>2]=0.0;e=3402823466385288598117041.0e14;break}else{g[h>>2]=-3402823466385288598117041.0e14;e=0.0;break}}else{g[(c[d+36>>2]|0)+(u<<2)>>2]=-3402823466385288598117041.0e14;e=3402823466385288598117041.0e14}while(0);g[(c[d+40>>2]|0)+(u<<2)>>2]=e;ca=1.0-+g[b+256>>2];f=+w(+ca);do if(!(ca!=ca|0.0!=0.0|ca==0.0)){ea=c[b+28>>2]|0;d=c[b+32>>2]|0;e=+g[ea+328>>2]*v+ +g[ea+332>>2]*t+ +g[ea+336>>2]*r-(+g[d+328>>2]*v+ +g[d+332>>2]*t+ +g[d+336>>2]*r);if((y|0)==1){if(!(e<0.0))break;if(!(+g[i>>2]<-(f*e)))break;g[i>>2]=-(f*e);break}else{if(!(e>0.0))break;if(!(+g[i>>2]>-(f*e)))break;g[i>>2]=-(f*e);break}}while(0);g[i>>2]=+g[b+248>>2]*+g[i>>2];return}function Gb(d,e,f){d=d|0;e=e|0;f=+f;var h=0,i=0.0,j=0.0,k=0.0,l=0,m=0.0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0;s=sa;sa=sa+528|0;if((a[d+171>>0]|0)==0?+g[d+172>>2]<=0.0:0){sa=s;return}a[d+168>>0]=(Fa[c[(c[d>>2]|0)+48>>2]&127](d)|0)&1;i=+g[d+16>>2]-+g[d+44>>2]*f;g[d+16>>2]=i;if(i>0.0?(j=+g[d+28>>2],i>j):0){g[d+16>>2]=j;i=j}if(i<0.0?(q=+w(+i),k=+w(+(+g[d+24>>2])),q>k):0){g[d+16>>2]=-k;i=-k}g[d+20>>2]=i*f;o=c[d+8>>2]|0;c[s>>2]=c[o+4>>2];c[s+4>>2]=c[o+4+4>>2];c[s+8>>2]=c[o+4+8>>2];c[s+12>>2]=c[o+4+12>>2];c[s+16>>2]=c[o+20>>2];c[s+16+4>>2]=c[o+20+4>>2];c[s+16+8>>2]=c[o+20+8>>2];c[s+16+12>>2]=c[o+20+12>>2];c[s+32>>2]=c[o+36>>2];c[s+32+4>>2]=c[o+36+4>>2];c[s+32+8>>2]=c[o+36+8>>2];c[s+32+12>>2]=c[o+36+12>>2];c[s+48>>2]=c[o+52>>2];c[s+48+4>>2]=c[o+52+4>>2];c[s+48+8>>2]=c[o+52+8>>2];c[s+48+12>>2]=c[o+52+12>>2];if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}o=c[d+176>>2]|0;k=+g[d+20>>2];k=+g[d+52>>2]+(k>0.0?k:0.0);p=+g[24416+(o<<4)+4>>2]*k+ +g[d+96>>2];q=k*+g[24416+(o<<4)+8>>2]+ +g[d+100>>2];g[d+112>>2]=+g[d+92>>2]+ +g[24416+(o<<4)>>2]*k;g[d+116>>2]=p;g[d+120>>2]=q;g[d+124>>2]=0.0;c[s+456>>2]=1065353216;c[s+456+4>>2]=0;c[s+456+4+4>>2]=0;c[s+456+4+8>>2]=0;c[s+456+4+12>>2]=0;c[s+456+20>>2]=1065353216;c[s+456+24>>2]=0;c[s+456+24+4>>2]=0;c[s+456+24+8>>2]=0;c[s+456+24+12>>2]=0;c[s+456+40>>2]=1065353216;o=s+456+44|0;c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;c[o+12>>2]=0;c[o+16>>2]=0;c[s+392>>2]=1065353216;c[s+392+4>>2]=0;c[s+392+4+4>>2]=0;c[s+392+4+8>>2]=0;c[s+392+4+12>>2]=0;c[s+392+20>>2]=1065353216;c[s+392+24>>2]=0;c[s+392+24+4>>2]=0;c[s+392+24+8>>2]=0;c[s+392+24+12>>2]=0;c[s+392+40>>2]=1065353216;o=s+392+44|0;c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;c[o+12>>2]=0;c[o+16>>2]=0;if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}h=c[d+176>>2]|0;o=c[d+12>>2]|0;k=+va[c[(c[o>>2]|0)+48>>2]&15](o);k=k+ +g[d+56>>2];p=k*+g[24416+(h<<4)+4>>2]+ +g[d+96>>2];q=k*+g[24416+(h<<4)+8>>2]+ +g[d+100>>2];g[s+456+48>>2]=+g[24416+(h<<4)>>2]*k+ +g[d+92>>2];g[s+456+52>>2]=p;g[s+456+56>>2]=q;g[s+456+60>>2]=0.0;c[s+392+48>>2]=c[d+112>>2];c[s+392+48+4>>2]=c[d+112+4>>2];c[s+392+48+8>>2]=c[d+112+8>>2];c[s+392+48+12>>2]=c[d+112+12>>2];h=c[d+8>>2]|0;if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}o=c[d+176>>2]|0;k=-+g[24416+(o<<4)>>2];p=-+g[24416+(o<<4)+4>>2];q=-+g[24416+(o<<4)+8>>2];g[s+288+4>>2]=1.0;o=s+288+12|0;c[s+288+76>>2]=0;c[o>>2]=0;c[o+4>>2]=0;c[o+8>>2]=0;c[o+12>>2]=0;c[o+16>>2]=0;c[o+20>>2]=0;c[o+24>>2]=0;c[o+28>>2]=0;c[s+288>>2]=7748;c[s+288+80>>2]=h;g[s+288+84>>2]=k;g[s+288+88>>2]=p;g[s+288+92>>2]=q;g[s+288+96>>2]=0.0;g[s+288+100>>2]=.707099974155426;h=c[d+8>>2]|0;o=c[h+188>>2]|0;b[s+288+8>>1]=b[o+4>>1]|0;b[s+288+10>>1]=b[o+6>>1]|0;if(!(a[d+170>>0]|0))Tc(e,c[d+12>>2]|0,s+456|0,s+392|0,s+288|0,0.0);else yc(h,c[d+12>>2]|0,s+456|0,s+392|0,s+288|0,+g[e+56>>2]);if(+g[s+288+4>>2]<1.0){if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}o=c[d+176>>2]|0;do if(+g[s+288+44>>2]*+g[24416+(o<<4)>>2]+ +g[s+288+48>>2]*+g[24416+(o<<4)+4>>2]+ +g[s+288+52>>2]*+g[24416+(o<<4)+8>>2]>0.0){i=+g[s+288+4>>2];g[d+108>>2]=+g[d+52>>2]*i;if(!(a[d+180>>0]|0)){c[d+92>>2]=c[d+112>>2];c[d+92+4>>2]=c[d+112+4>>2];c[d+92+8>>2]=c[d+112+8>>2];c[d+92+12>>2]=c[d+112+12>>2];break}else{g[d+92>>2]=(1.0-i)*+g[d+92>>2]+i*+g[d+112>>2];g[d+96>>2]=(1.0-i)*+g[d+96>>2]+i*+g[d+116>>2];g[d+100>>2]=(1.0-i)*+g[d+100>>2]+i*+g[d+120>>2];break}}while(0);g[d+16>>2]=0.0;g[d+20>>2]=0.0}else{c[d+108>>2]=c[d+52>>2];c[d+92>>2]=c[d+112>>2];c[d+92+4>>2]=c[d+112+4>>2];c[d+92+8>>2]=c[d+112+8>>2];c[d+92+12>>2]=c[d+112+12>>2]}if(!(a[d+171>>0]|0)){p=+g[d+172>>2];q=p>f?f:p;g[d+172>>2]=p-f;ld(d,e,q*+g[d+60>>2],q*+g[d+64>>2],q*+g[d+68>>2])}else ld(d,e,+g[d+60>>2],+g[d+64>>2],+g[d+68>>2]);c[s+272>>2]=c[d+112>>2];c[s+272+4>>2]=c[d+112+4>>2];c[s+272+8>>2]=c[d+112+8>>2];c[s+272+12>>2]=c[d+112+12>>2];i=+g[d+16>>2];i=(i<0.0?-i:0.0)*f;do if(i>0.0?(m=+g[d+24>>2],i>m):0){if((a[d+168>>0]|0)==0?a[d+169>>0]|0:0)break;i=m}while(0);if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}h=c[d+176>>2]|0;q=i+ +g[d+108>>2];m=+g[24416+(h<<4)>>2]*q;p=q*+g[24416+(h<<4)+4>>2];q=q*+g[24416+(h<<4)+8>>2];g[d+112>>2]=+g[d+112>>2]-m;g[d+116>>2]=+g[d+116>>2]-p;g[d+120>>2]=+g[d+120>>2]-q;h=c[d+8>>2]|0;if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}l=24416+(c[d+176>>2]<<4)|0;n=c[d+40>>2]|0;o=s+168+4|0;g[o>>2]=1.0;t=s+168+12|0;c[s+168+76>>2]=0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;c[t+20>>2]=0;c[t+24>>2]=0;c[t+28>>2]=0;c[s+168>>2]=7748;c[s+168+80>>2]=h;c[s+168+84>>2]=c[l>>2];c[s+168+84+4>>2]=c[l+4>>2];c[s+168+84+8>>2]=c[l+8>>2];c[s+168+84+12>>2]=c[l+12>>2];c[s+168+100>>2]=n;h=c[d+8>>2]|0;n=c[h+188>>2]|0;b[s+168+8>>1]=b[n+4>>1]|0;b[s+168+10>>1]=b[n+6>>1]|0;if((a[26720]|0)==0?mz(26720)|0:0){c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}n=24416+(c[d+176>>2]<<4)|0;t=c[d+40>>2]|0;g[s+64+4>>2]=1.0;l=s+64+12|0;c[s+64+76>>2]=0;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;c[l+16>>2]=0;c[l+20>>2]=0;c[l+24>>2]=0;c[l+28>>2]=0;c[s+64>>2]=7748;c[s+64+80>>2]=h;c[s+64+84>>2]=c[n>>2];c[s+64+84+4>>2]=c[n+4>>2];c[s+64+84+8>>2]=c[n+8>>2];c[s+64+84+12>>2]=c[n+12>>2];c[s+64+100>>2]=t;h=c[(c[d+8>>2]|0)+188>>2]|0;b[s+64+8>>1]=b[h+4>>1]|0;b[s+64+10>>1]=b[h+6>>1]|0;h=0;i=+g[d+112>>2];j=+g[d+116>>2];k=+g[d+120>>2];while(1){c[s+456>>2]=1065353216;c[s+456+4>>2]=0;c[s+456+4+4>>2]=0;c[s+456+4+8>>2]=0;c[s+456+4+12>>2]=0;c[s+456+20>>2]=1065353216;c[s+456+24>>2]=0;c[s+456+24+4>>2]=0;c[s+456+24+8>>2]=0;c[s+456+24+12>>2]=0;c[s+456+40>>2]=1065353216;c[s+456+44>>2]=0;c[s+392>>2]=1065353216;c[s+392+4>>2]=0;c[s+392+4+4>>2]=0;c[s+392+4+8>>2]=0;c[s+392+4+12>>2]=0;c[s+392+20>>2]=1065353216;c[s+392+24>>2]=0;c[s+392+24+4>>2]=0;c[s+392+24+8>>2]=0;c[s+392+24+12>>2]=0;c[s+392+40>>2]=1065353216;c[s+392+44>>2]=0;c[s+288>>2]=1065353216;c[s+288+4>>2]=0;c[s+288+4+4>>2]=0;c[s+288+4+8>>2]=0;c[s+288+4+12>>2]=0;c[s+288+20>>2]=1065353216;c[s+288+24>>2]=0;c[s+288+24+4>>2]=0;c[s+288+24+8>>2]=0;c[s+288+24+12>>2]=0;c[s+288+40>>2]=1065353216;c[s+288+44>>2]=0;c[s+456+48>>2]=c[d+92>>2];c[s+456+48+4>>2]=c[d+92+4>>2];c[s+456+48+8>>2]=c[d+92+8>>2];c[s+456+48+12>>2]=c[d+92+12>>2];c[s+392+48>>2]=c[d+112>>2];c[s+392+48+4>>2]=c[d+112+4>>2];c[s+392+48+8>>2]=c[d+112+8>>2];c[s+392+48+12>>2]=c[d+112+12>>2];g[s+288+48>>2]=i-m;g[s+288+52>>2]=j-p;g[s+288+56>>2]=k-q;g[s+288+60>>2]=0.0;if(!(a[d+170>>0]|0)){Tc(e,c[d+12>>2]|0,s+456|0,s+392|0,s+168|0,+g[e+56>>2]);if(!(+g[o>>2]<1.0))Tc(e,c[d+12>>2]|0,s+456|0,s+288|0,s+64|0,+g[e+56>>2])}else{yc(c[d+8>>2]|0,c[d+12>>2]|0,s+456|0,s+392|0,s+168|0,+g[e+56>>2]);if(!(+g[o>>2]<1.0))yc(c[d+8>>2]|0,c[d+12>>2]|0,s+456|0,s+288|0,s+64|0,+g[e+56>>2])}j=+g[d+16>>2];j=(j<0.0?-j:0.0)*f;n=(a[d+182>>0]|0)==0;if(!n?+g[o>>2]<1.0:0)l=1;else l=+g[s+64+4>>2]<1.0;if(!(j>0.0))break;i=+g[d+52>>2];if(h|(!(j>0]|0)==0?a[d+169>>0]|0:0){h=0;break}c[d+112>>2]=c[s+272>>2];c[d+112+4>>2]=c[s+272+4>>2];c[d+112+8>>2]=c[s+272+8>>2];c[d+112+12>>2]=c[s+272+12>>2];do if(!(a[26720]|0)){if(!(mz(26720)|0))break;c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}while(0);h=c[d+176>>2]|0;i=i+ +g[d+108>>2];j=i*+g[24416+(h<<4)+4>>2];k=i*+g[24416+(h<<4)+8>>2];i=+g[d+112>>2]-+g[24416+(h<<4)>>2]*i;g[d+112>>2]=i;j=+g[d+116>>2]-j;g[d+116>>2]=j;k=+g[d+120>>2]-k;g[d+120>>2]=k;h=1}k=+g[o>>2];if(h|k<1.0){i=+g[d+96>>2];j=(i-+g[s+168+64>>2])*.5;do if(!n)if(!(a[d+181>>0]|0)){g[d+92>>2]=(1.0-j)*+g[d+92>>2]+j*+g[d+112>>2];g[d+96>>2]=i*(1.0-j)+j*+g[d+116>>2];g[d+100>>2]=(1.0-j)*+g[d+100>>2]+j*+g[d+120>>2];h=d+181|0;break}else{g[d+92>>2]=(1.0-k)*+g[d+92>>2]+k*+g[d+112>>2];g[d+96>>2]=i*(1.0-k)+k*+g[d+116>>2];g[d+100>>2]=(1.0-k)*+g[d+100>>2]+k*+g[d+120>>2];h=d+181|0;break}else{g[d+92>>2]=(1.0-k)*+g[d+92>>2]+k*+g[d+112>>2];g[d+96>>2]=i*(1.0-k)+k*+g[d+116>>2];g[d+100>>2]=(1.0-k)*+g[d+100>>2]+k*+g[d+120>>2];h=d+181|0}while(0);a[h>>0]=0;g[d+16>>2]=0.0;g[d+20>>2]=0.0;a[d+169>>0]=0}else{a[d+181>>0]=1;do if(!n?(r=+g[d+24>>2],j>r):0){if((a[d+168>>0]|0)==0?a[d+169>>0]|0:0)break;g[d+112>>2]=m+ +g[d+112>>2];g[d+116>>2]=p+ +g[d+116>>2];g[d+120>>2]=q+ +g[d+120>>2];do if(!(a[26720]|0)){if(!(mz(26720)|0))break;c[6104]=1065353216;c[6105]=0;c[6106]=0;c[6107]=0;c[6108]=0;c[6109]=1065353216;c[6110]=0;c[6111]=0;c[6112]=0;c[6113]=0;c[6114]=1065353216;g[6115]=0.0}while(0);t=c[d+176>>2]|0;q=r+ +g[d+108>>2];f=q*+g[24416+(t<<4)+4>>2];r=q*+g[24416+(t<<4)+8>>2];g[d+112>>2]=+g[d+112>>2]-+g[24416+(t<<4)>>2]*q;g[d+116>>2]=+g[d+116>>2]-f;g[d+120>>2]=+g[d+120>>2]-r}while(0);c[d+92>>2]=c[d+112>>2];c[d+92+4>>2]=c[d+112+4>>2];c[d+92+8>>2]=c[d+112+8>>2];c[d+92+12>>2]=c[d+112+12>>2]}c[s+48>>2]=c[d+92>>2];c[s+48+4>>2]=c[d+92+4>>2];c[s+48+8>>2]=c[d+92+8>>2];c[s+48+12>>2]=c[d+92+12>>2];t=c[d+8>>2]|0;c[t+260>>2]=(c[t+260>>2]|0)+1;c[t+4>>2]=c[s>>2];c[t+4+4>>2]=c[s+4>>2];c[t+4+8>>2]=c[s+8>>2];c[t+4+12>>2]=c[s+12>>2];c[t+20>>2]=c[s+16>>2];c[t+20+4>>2]=c[s+16+4>>2];c[t+20+8>>2]=c[s+16+8>>2];c[t+20+12>>2]=c[s+16+12>>2];c[t+36>>2]=c[s+32>>2];c[t+36+4>>2]=c[s+32+4>>2];c[t+36+8>>2]=c[s+32+8>>2];c[t+36+12>>2]=c[s+32+12>>2];c[t+52>>2]=c[s+48>>2];c[t+52+4>>2]=c[s+48+4>>2];c[t+52+8>>2]=c[s+48+8>>2];c[t+52+12>>2]=c[s+48+12>>2];sa=s;return}function Hb(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0.0,z=0;z=sa;sa=sa+112|0;c[b+164>>2]=1065353216;c[b+168>>2]=1065353216;c[b+172>>2]=1065353216;g[b+176>>2]=0.0;c[b+180>>2]=0;g[b+184>>2]=999999984306749440.0;c[b+188>>2]=0;c[b+188+4>>2]=0;c[b+188+8>>2]=0;c[b+188+12>>2]=0;c[b+204>>2]=1;c[b+208>>2]=-1;c[b+212>>2]=-1;c[b+216>>2]=1;g[b+220>>2]=0.0;g[b+224>>2]=.5;g[b+228>>2]=0.0;g[b+232>>2]=0.0;c[b+236>>2]=1;c[b+240>>2]=0;g[b+244>>2]=1.0;c[b+248>>2]=0;c[b+248+4>>2]=0;c[b+248+8>>2]=0;c[b+248+12>>2]=0;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+48+4>>2]=0;c[b+48+8>>2]=0;c[b+48+12>>2]=0;c[b+48+16>>2]=0;c[b>>2]=5940;a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;c[b+272>>2]=0;c[b+284>>2]=0;a[b+408>>0]=1;c[b+404>>2]=0;c[b+396>>2]=0;c[b+400>>2]=0;a[b+428>>0]=1;c[b+424>>2]=0;c[b+416>>2]=0;c[b+420>>2]=0;a[b+448>>0]=1;c[b+444>>2]=0;c[b+436>>2]=0;c[b+440>>2]=0;a[b+496>>0]=1;c[b+492>>2]=0;c[b+484>>2]=0;c[b+488>>2]=0;a[b+516>>0]=1;c[b+512>>2]=0;c[b+504>>2]=0;c[b+508>>2]=0;c[b+684>>2]=d;a[b+704>>0]=1;c[b+700>>2]=0;c[b+692>>2]=0;c[b+696>>2]=0;a[b+724>>0]=1;c[b+720>>2]=0;c[b+712>>2]=0;c[b+716>>2]=0;a[b+744>>0]=1;c[b+740>>2]=0;c[b+732>>2]=0;c[b+736>>2]=0;a[b+764>>0]=1;c[b+760>>2]=0;c[b+752>>2]=0;c[b+756>>2]=0;a[b+784>>0]=1;c[b+780>>2]=0;c[b+772>>2]=0;c[b+776>>2]=0;a[b+804>>0]=1;c[b+800>>2]=0;c[b+792>>2]=0;c[b+796>>2]=0;a[b+824>>0]=1;c[b+820>>2]=0;c[b+812>>2]=0;c[b+816>>2]=0;a[b+844>>0]=1;c[b+840>>2]=0;c[b+832>>2]=0;c[b+836>>2]=0;a[b+864>>0]=1;c[b+860>>2]=0;c[b+852>>2]=0;c[b+856>>2]=0;a[b+884>>0]=1;c[b+880>>2]=0;c[b+872>>2]=0;c[b+876>>2]=0;a[b+964>>0]=1;c[b+960>>2]=0;c[b+952>>2]=0;c[b+956>>2]=0;a[b+984>>0]=1;c[b+980>>2]=0;c[b+972>>2]=0;c[b+976>>2]=0;c[b+928>>2]=0;c[b+932>>2]=0;c[b+936>>2]=-1;c[b+940>>2]=0;c[b+944>>2]=0;a[b+1024>>0]=1;c[b+1020>>2]=0;c[b+1012>>2]=0;c[b+1016>>2]=0;a[b+1044>>0]=1;c[b+1040>>2]=0;c[b+1032>>2]=0;c[b+1036>>2]=0;c[b+988>>2]=0;c[b+992>>2]=0;c[b+996>>2]=-1;c[b+1e3>>2]=0;c[b+1004>>2]=0;a[b+1084>>0]=1;c[b+1080>>2]=0;c[b+1072>>2]=0;c[b+1076>>2]=0;a[b+1104>>0]=1;c[b+1100>>2]=0;c[b+1092>>2]=0;c[b+1096>>2]=0;c[b+1048>>2]=0;c[b+1052>>2]=0;c[b+1056>>2]=-1;c[b+1060>>2]=0;c[b+1064>>2]=0;a[b+1124>>0]=1;c[b+1120>>2]=0;c[b+1112>>2]=0;c[b+1116>>2]=0;a[b+1144>>0]=1;c[b+1140>>2]=0;c[b+1132>>2]=0;c[b+1136>>2]=0;a[b+1248>>0]=1;c[b+1244>>2]=0;c[b+1236>>2]=0;c[b+1240>>2]=0;c[b+236>>2]=8;c[b+288>>2]=0;g[b+292>>2]=1.0;c[b+296>>2]=0;c[b+296+4>>2]=0;c[b+296+8>>2]=0;c[b+296+12>>2]=0;c[b+296+16>>2]=0;g[b+316>>2]=.20000000298023224;g[b+320>>2]=0.0;g[b+324>>2]=1.0;g[b+328>>2]=.10000000149011612;g[b+332>>2]=1.0;g[b+336>>2]=.699999988079071;g[b+340>>2]=.10000000149011612;g[b+344>>2]=1.0;g[b+348>>2]=.5;g[b+352>>2]=.5;g[b+356>>2]=.5;g[b+360>>2]=.5;g[b+364>>2]=1.0;g[b+368>>2]=1.0;c[b+372>>2]=0;c[b+376>>2]=1;c[b+380>>2]=0;c[b+384>>2]=4;c[b+388>>2]=1;a[b+472>>0]=0;a[b+473>>0]=0;g[b+476>>2]=0.0;c[b+520>>2]=0;c[b+520+4>>2]=0;c[b+520+8>>2]=0;c[b+520+12>>2]=0;c[b+536>>2]=1065353216;c[b+540>>2]=0;c[b+540+4>>2]=0;c[b+540+8>>2]=0;c[b+540+12>>2]=0;c[b+556>>2]=1065353216;c[b+560>>2]=0;c[b+560+4>>2]=0;c[b+560+8>>2]=0;c[b+560+12>>2]=0;c[b+576>>2]=1065353216;g[b+580>>2]=0.0;c[b+584>>2]=1065353216;c[b+588>>2]=0;c[b+588+4>>2]=0;c[b+588+8>>2]=0;c[b+588+12>>2]=0;c[b+604>>2]=1065353216;c[b+608>>2]=0;c[b+608+4>>2]=0;c[b+608+8>>2]=0;c[b+608+12>>2]=0;c[b+624>>2]=1065353216;g[b+628>>2]=0.0;c[b+680>>2]=0;g[b+888>>2]=0.0;a[b+924>>0]=1;c[b+892>>2]=0;c[b+892+4>>2]=0;c[b+892+8>>2]=0;c[b+892+12>>2]=0;c[b+892+16>>2]=0;c[b+892+20>>2]=0;c[b+892+24>>2]=0;c[b+892+28>>2]=0;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+48+4>>2]=0;c[b+48+8>>2]=0;c[b+48+12>>2]=0;c[b+48+16>>2]=0;d=c[b+404>>2]|0;if(d|0){if(a[b+408>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+404>>2]=0}a[b+408>>0]=1;c[b+404>>2]=0;c[b+396>>2]=0;c[b+400>>2]=0;d=c[b+424>>2]|0;if(d|0){if(a[b+428>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+424>>2]=0}a[b+428>>0]=1;c[b+424>>2]=0;c[b+416>>2]=0;c[b+420>>2]=0;d=c[b+444>>2]|0;do if(d){if(!(a[b+448>>0]|0)){c[b+444>>2]=0;a[b+448>>0]=1;c[b+444>>2]=0;c[b+436>>2]=0;c[b+440>>2]=0;j=1;u=17;break}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);d=c[b+416>>2]|0;j=c[b+420>>2]|0;c[b+444>>2]=0;a[b+448>>0]=1;c[b+444>>2]=0;c[b+436>>2]=0;c[b+440>>2]=0;if((d|0)==(j|0))if(j)if((j|0)<(j<<1|0))if(!(j<<1)){d=0;i=j;l=j<<1;u=20}else{j=j<<1;u=17}else{i=j;d=j}else{j=1;u=17}else{i=d;d=j}}else{a[b+448>>0]=1;c[b+444>>2]=0;c[b+436>>2]=0;c[b+440>>2]=0;j=1;u=17}while(0);if((u|0)==17){c[7182]=(c[7182]|0)+1;d=xb((j<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}i=c[b+416>>2]|0;l=j;u=20}if((u|0)==20){k=c[b+424>>2]|0;if((i|0)<=0){if(k)u=24}else{j=0;do{c[d+(j<<2)>>2]=c[k+(j<<2)>>2];j=j+1|0}while((j|0)!=(i|0));u=24}if((u|0)==24){if(a[b+428>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);i=c[b+416>>2]|0}c[b+424>>2]=0}a[b+428>>0]=1;c[b+424>>2]=d;c[b+420>>2]=l;d=l}j=c[b+424>>2]|0;c[j+(i<<2)>>2]=1;i=i+1|0;c[b+416>>2]=i;if((i|0)==(d|0)){l=(d|0)==0?1:d<<1;if((d|0)<(l|0)){if(!l)k=0;else{c[7182]=(c[7182]|0)+1;d=xb((l<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}k=d;d=c[b+416>>2]|0;j=c[b+424>>2]|0}if((d|0)<=0){if(j)u=38}else{i=0;do{c[k+(i<<2)>>2]=c[j+(i<<2)>>2];i=i+1|0}while((i|0)!=(d|0));u=38}if((u|0)==38){if(a[b+428>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);d=c[b+416>>2]|0}c[b+424>>2]=0}a[b+428>>0]=1;c[b+424>>2]=k;c[b+420>>2]=l;j=k;i=d;d=l}else i=d}c[j+(i<<2)>>2]=2;i=i+1|0;c[b+416>>2]=i;if((i|0)==(d|0)){l=(d|0)==0?1:d<<1;if((d|0)<(l|0)){if(!l)k=0;else{c[7182]=(c[7182]|0)+1;d=xb((l<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}k=d;d=c[b+416>>2]|0;j=c[b+424>>2]|0}if((d|0)<=0){if(j)u=52}else{i=0;do{c[k+(i<<2)>>2]=c[j+(i<<2)>>2];i=i+1|0}while((i|0)!=(d|0));u=52}if((u|0)==52){if(a[b+428>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);d=c[b+416>>2]|0}c[b+424>>2]=0}a[b+428>>0]=1;c[b+424>>2]=k;c[b+420>>2]=l;i=d;d=l}else{k=j;i=d}}else k=j;c[k+(i<<2)>>2]=3;i=i+1|0;c[b+416>>2]=i;if((i|0)==(d|0)){l=(d|0)==0?1:d<<1;if((d|0)<(l|0)){if(!l)j=0;else{c[7182]=(c[7182]|0)+1;d=xb((l<<2|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}j=d;d=c[b+416>>2]|0;k=c[b+424>>2]|0}if((d|0)<=0){if(k)u=66}else{i=0;do{c[j+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(d|0));u=66}if((u|0)==66){if(a[b+428>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);d=c[b+416>>2]|0}c[b+424>>2]=0}a[b+428>>0]=1;c[b+424>>2]=j;c[b+420>>2]=l}else j=k}else{j=k;d=i}c[j+(d<<2)>>2]=0;c[b+416>>2]=d+1;c[7182]=(c[7182]|0)+1;d=xb(39)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}c[d+8>>2]=0;c[d>>2]=6048;c[d+4>>2]=32;c[d+16>>2]=b;c[b+192>>2]=d;g[d+12>>2]=.25;c[b+1148>>2]=1065353216;c[b+1152>>2]=0;c[b+1152+4>>2]=0;c[b+1152+8>>2]=0;c[b+1152+12>>2]=0;c[b+1168>>2]=1065353216;c[b+1172>>2]=0;c[b+1172+4>>2]=0;c[b+1172+8>>2]=0;c[b+1172+12>>2]=0;c[b+1188>>2]=1065353216;v=b+1192|0;w=v+36|0;do{c[v>>2]=0;v=v+4|0}while((v|0)<(w|0));g[b+1228>>2]=1.0;x=xg(b)|0;g[x+4>>2]=1.0;g[x+8>>2]=1.0;g[x+12>>2]=1.0;c[x+16>>2]=1;v=c[b+192>>2]|0;y=+va[c[(c[v>>2]|0)+48>>2]&15](v);v=z;w=v+100|0;do{c[v>>2]=0;v=v+4|0}while((v|0)<(w|0));l=c[b+712>>2]|0;if((l|0)<(e|0)){if((c[b+716>>2]|0)<(e|0)){if(!e){d=0;j=l}else{c[7182]=(c[7182]|0)+1;d=xb((e*104|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}j=c[b+712>>2]|0}if((j|0)>0){i=0;do{v=d+(i*104|0)|0;k=(c[b+720>>2]|0)+(i*104|0)|0;w=v+104|0;do{c[v>>2]=c[k>>2];v=v+4|0;k=k+4|0}while((v|0)<(w|0));i=i+1|0}while((i|0)!=(j|0))}i=c[b+720>>2]|0;if(i|0){if(a[b+724>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+720>>2]=0}a[b+724>>0]=1;c[b+720>>2]=d;c[b+716>>2]=e}d=l;do{v=c[b+720>>2]|0;c[v+(d*104|0)>>2]=0;v=v+(d*104|0)+4|0;k=z;w=v+100|0;do{c[v>>2]=c[k>>2];v=v+4|0;k=k+4|0}while((v|0)<(w|0));d=d+1|0}while((d|0)!=(e|0))}c[b+712>>2]=e;if((e|0)>0){d=f;i=h;k=0;while(1){u=c[b+720>>2]|0;f=u+(k*104|0)|0;v=f;w=v+104|0;do{c[v>>2]=0;v=v+4|0}while((v|0)<(w|0));if(!d){l=0;m=0.0;n=0.0;o=0.0;p=0.0}else{l=d+16|0;m=+g[d+12>>2];n=+g[d>>2];o=+g[d+4>>2];p=+g[d+8>>2]}w=u+(k*104|0)+8|0;g[w>>2]=n;g[u+(k*104|0)+12>>2]=o;g[u+(k*104|0)+16>>2]=p;g[u+(k*104|0)+20>>2]=m;h=u+(k*104|0)+24|0;c[h>>2]=c[w>>2];c[h+4>>2]=c[w+4>>2];c[h+8>>2]=c[w+8>>2];c[h+12>>2]=c[w+12>>2];if(!i){j=0;m=1.0}else{j=i+4|0;m=+g[i>>2]}g[u+(k*104|0)+88>>2]=m>0.0?1.0/m:0.0;r=n-y;s=o-y;t=p-y;q=y+n;n=y+o;m=y+p;d=c[b+932>>2]|0;if(!d){c[7182]=(c[7182]|0)+1;d=xb(63)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}v=d;w=v+44|0;do{c[v>>2]=0;v=v+4|0}while((v|0)<(w|0))}else c[b+932>>2]=0;c[d+32>>2]=0;c[d+36>>2]=f;c[d+40>>2]=0;g[d>>2]=r;g[d+4>>2]=s;g[d+8>>2]=t;g[d+12>>2]=0.0;g[d+16>>2]=q;g[d+20>>2]=n;g[d+24>>2]=m;g[d+28>>2]=0.0;ue(b+928|0,c[b+928>>2]|0,d);c[b+940>>2]=(c[b+940>>2]|0)+1;c[u+(k*104|0)+96>>2]=d;c[u+(k*104|0)+4>>2]=x;k=k+1|0;if((k|0)==(e|0))break;else{d=l;i=j}}}d=c[b+928>>2]|0;if(!d){c[b+892>>2]=0;c[b+892+4>>2]=0;c[b+892+8>>2]=0;c[b+892+12>>2]=0;c[b+892+16>>2]=0;c[b+892+20>>2]=0;c[b+892+24>>2]=0;c[b+892+28>>2]=0;sa=z;return}e=c[b+192>>2]|0;s=+va[c[(c[e>>2]|0)+48>>2]&15](e);y=+g[d+4>>2]-s;t=+g[d+8>>2]-s;g[b+892>>2]=+g[d>>2]-s;g[b+896>>2]=y;g[b+900>>2]=t;g[b+904>>2]=0.0;t=s+ +g[d+20>>2];y=s+ +g[d+24>>2];g[b+908>>2]=s+ +g[d+16>>2];g[b+912>>2]=t;g[b+916>>2]=y;g[b+920>>2]=0.0;d=c[b+188>>2]|0;if(!d){sa=z;return}e=c[b+684>>2]|0;h=c[e+32>>2]|0;eb[c[(c[h>>2]|0)+16>>2]&31](h,d,b+892|0,b+908|0,c[e+36>>2]|0);sa=z;return}function Ib(d,f,h){d=d|0;f=f|0;h=h|0;var i=0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0.0,t=0.0,u=0,v=0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0,H=0,I=0,J=0,K=0.0,L=0.0,M=0.0;J=sa;sa=sa+96|0;G=c[d+56>>2]|0;if((h-f|0)==1){if(!(a[d+60>>0]|0)){p=(c[d+96>>2]|0)+(G<<6)|0;q=(c[d+76>>2]|0)+(f<<6)|0;r=p+64|0;do{c[p>>2]=c[q>>2];p=p+4|0;q=q+4|0}while((p|0)<(r|0))}else{H=(c[d+116>>2]|0)+(f<<4)|0;I=(c[d+136>>2]|0)+(G<<4)|0;c[I>>2]=c[H>>2];c[I+4>>2]=c[H+4>>2];c[I+8>>2]=c[H+8>>2];c[I+12>>2]=c[H+12>>2]}c[d+56>>2]=(c[d+56>>2]|0)+1;sa=J;return}if((h|0)>(f|0)){m=(a[d+60>>0]|0)==0;if(m){j=c[d+76>>2]|0;i=f;k=0.0;l=0.0;n=0.0;do{k=k+(+g[j+(i<<6)+16>>2]+ +g[j+(i<<6)>>2])*.5;l=l+(+g[j+(i<<6)+20>>2]+ +g[j+(i<<6)+4>>2])*.5;n=n+(+g[j+(i<<6)+24>>2]+ +g[j+(i<<6)+8>>2])*.5;i=i+1|0}while((i|0)!=(h|0))}else{j=c[d+116>>2]|0;o=+g[d+36>>2];s=+g[d+40>>2];t=+g[d+44>>2];w=+g[d+4>>2];x=+g[d+8>>2];y=+g[d+12>>2];i=f;k=0.0;l=0.0;n=0.0;do{k=k+(+(e[j+(i<<4)+6>>1]|0)/o+w+(+(e[j+(i<<4)>>1]|0)/o+w))*.5;l=l+(+(e[j+(i<<4)+8>>1]|0)/s+x+(+(e[j+(i<<4)+2>>1]|0)/s+x))*.5;n=n+(+(e[j+(i<<4)+10>>1]|0)/t+y+(+(e[j+(i<<4)+4>>1]|0)/t+y))*.5;i=i+1|0}while((i|0)!=(h|0))}B=1.0/+(h-f|0);D=B*k;C=B*l;B=B*n;if(m){j=c[d+76>>2]|0;i=f;k=0.0;n=0.0;o=0.0;do{w=(+g[j+(i<<6)+16>>2]+ +g[j+(i<<6)>>2])*.5-D;x=(+g[j+(i<<6)+20>>2]+ +g[j+(i<<6)+4>>2])*.5-C;y=(+g[j+(i<<6)+24>>2]+ +g[j+(i<<6)+8>>2])*.5-B;k=k+w*w;n=n+x*x;o=o+y*y;i=i+1|0}while((i|0)!=(h|0));l=+(h-f|0)}else{j=c[d+116>>2]|0;l=+g[d+36>>2];s=+g[d+40>>2];t=+g[d+44>>2];w=+g[d+4>>2];x=+g[d+8>>2];y=+g[d+12>>2];i=f;k=0.0;n=0.0;o=0.0;do{M=(+(e[j+(i<<4)+6>>1]|0)/l+w+(+(e[j+(i<<4)>>1]|0)/l+w))*.5-D;L=(+(e[j+(i<<4)+8>>1]|0)/s+x+(+(e[j+(i<<4)+2>>1]|0)/s+x))*.5-C;K=(+(e[j+(i<<4)+10>>1]|0)/t+y+(+(e[j+(i<<4)+4>>1]|0)/t+y))*.5-B;k=k+M*M;n=n+L*L;o=o+K*K;i=i+1|0}while((i|0)!=(h|0));l=+(h-f|0)}}else{o=0.0;n=0.0;k=0.0;l=+(h-f|0)}M=1.0/(l+-1.0);L=M*k;K=M*n;M=M*o;v=L>2]=0;c[J+16+4>>2]=0;c[J+16+8>>2]=0;c[J+16+12>>2]=0;if((h|0)>(f|0)){if(!(a[d+60>>0]|0)){j=c[d+76>>2]|0;i=f;n=0.0;l=0.0;k=0.0;do{n=(+g[j+(i<<6)+16>>2]+ +g[j+(i<<6)>>2])*.5+n;l=(+g[j+(i<<6)+20>>2]+ +g[j+(i<<6)+4>>2])*.5+l;k=(+g[j+(i<<6)+24>>2]+ +g[j+(i<<6)+8>>2])*.5+k;i=i+1|0}while((i|0)!=(h|0))}else{j=c[d+116>>2]|0;o=+g[d+36>>2];s=+g[d+40>>2];t=+g[d+44>>2];w=+g[d+4>>2];x=+g[d+8>>2];y=+g[d+12>>2];i=f;n=0.0;l=0.0;k=0.0;do{n=(+(e[j+(i<<4)+6>>1]|0)/o+w+(+(e[j+(i<<4)>>1]|0)/o+w))*.5+n;l=(+(e[j+(i<<4)+8>>1]|0)/s+x+(+(e[j+(i<<4)+2>>1]|0)/s+x))*.5+l;k=(+(e[j+(i<<4)+10>>1]|0)/t+y+(+(e[j+(i<<4)+4>>1]|0)/t+y))*.5+k;i=i+1|0}while((i|0)!=(h|0))}g[J+16>>2]=n;g[J+16+4>>2]=l;g[J+16+8>>2]=k;i=J+16|0}else{i=J+16|0;n=0.0;l=0.0;k=0.0}g[i>>2]=1.0/+(h-f|0)*n;g[J+16+4>>2]=1.0/+(h-f|0)*l;g[J+16+8>>2]=1.0/+(h-f|0)*k;w=+g[J+16+(v<<2)>>2];if((h|0)>(f|0)){i=f;u=f;do{j=(a[d+60>>0]|0)==0;if(j){F=c[d+76>>2]|0;k=+g[F+(u<<6)>>2];l=+g[F+(u<<6)+16>>2];n=+g[F+(u<<6)+4>>2];o=+g[F+(u<<6)+20>>2];s=+g[F+(u<<6)+8>>2];t=+g[F+(u<<6)+24>>2]}else{F=c[d+116>>2]|0;n=+g[d+36>>2];s=+g[d+40>>2];M=+g[d+44>>2];l=+g[d+4>>2];o=+g[d+8>>2];t=+g[d+12>>2];k=+(e[F+(u<<4)>>1]|0)/n+l;l=+(e[F+(u<<4)+6>>1]|0)/n+l;n=+(e[F+(u<<4)+2>>1]|0)/s+o;o=+(e[F+(u<<4)+8>>1]|0)/s+o;s=+(e[F+(u<<4)+4>>1]|0)/M+t;t=+(e[F+(u<<4)+10>>1]|0)/M+t}g[J>>2]=(l+k)*.5;g[J+4>>2]=(o+n)*.5;g[J+8>>2]=(t+s)*.5;g[J+12>>2]=0.0;if(+g[J+(v<<2)>>2]>w){if(j){j=c[d+76>>2]|0;m=j+(u<<6)|0;p=J+32|0;q=m;r=p+64|0;do{c[p>>2]=c[q>>2];p=p+4|0;q=q+4|0}while((p|0)<(r|0));p=m;q=j+(i<<6)|0;r=p+64|0;do{c[p>>2]=c[q>>2];p=p+4|0;q=q+4|0}while((p|0)<(r|0));p=(c[d+76>>2]|0)+(i<<6)|0;q=J+32|0;r=p+64|0;do{c[p>>2]=c[q>>2];p=p+4|0;q=q+4|0}while((p|0)<(r|0))}else{E=c[d+116>>2]|0;F=E+(u<<4)|0;c[J+32>>2]=c[F>>2];c[J+32+4>>2]=c[F+4>>2];c[J+32+8>>2]=c[F+8>>2];c[J+32+12>>2]=c[F+12>>2];E=E+(i<<4)|0;c[F>>2]=c[E>>2];c[F+4>>2]=c[E+4>>2];c[F+8>>2]=c[E+8>>2];c[F+12>>2]=c[E+12>>2];F=(c[d+116>>2]|0)+(i<<4)|0;c[F>>2]=c[J+32>>2];c[F+4>>2]=c[J+32+4>>2];c[F+8>>2]=c[J+32+8>>2];c[F+12>>2]=c[J+32+12>>2]}i=i+1|0}u=u+1|0}while((u|0)!=(h|0))}else i=f;if(!((i|0)>(((h-f|0)/3|0)+f|0)?(i|0)<(h+-1-((h-f|0)/3|0)|0):0))i=(1?h-f>>1:h-f|0)+f|0;F=c[d+56>>2]|0;if(!(a[d+60>>0]|0)){E=(c[d+96>>2]|0)+(F<<6)|0;c[E>>2]=c[d+20>>2];c[E+4>>2]=c[d+20+4>>2];c[E+8>>2]=c[d+20+8>>2];c[E+12>>2]=c[d+20+12>>2]}else{E=c[d+136>>2]|0;L=(+g[d+24>>2]-+g[d+8>>2])*+g[d+40>>2];M=(+g[d+28>>2]-+g[d+12>>2])*+g[d+44>>2];b[E+(F<<4)>>1]=~~((+g[d+20>>2]-+g[d+4>>2])*+g[d+36>>2])&65535&-2;b[E+(F<<4)+2>>1]=~~L&65535&-2;b[E+(F<<4)+4>>1]=~~M&65535&-2}j=c[d+56>>2]|0;if(!(a[d+60>>0]|0)){E=(c[d+96>>2]|0)+(j<<6)+16|0;c[E>>2]=c[d+4>>2];c[E+4>>2]=c[d+4+4>>2];c[E+8>>2]=c[d+4+8>>2];c[E+12>>2]=c[d+4+12>>2]}else{E=c[d+136>>2]|0;K=+g[d+4>>2];L=+g[d+8>>2];M=+g[d+12>>2];L=(L-L)*+g[d+40>>2];M=(M-M)*+g[d+44>>2];b[E+(j<<4)+6>>1]=~~((K-K)*+g[d+36>>2]+1.0)&65535|1;b[E+(j<<4)+8>>1]=~~(L+1.0)&65535|1;b[E+(j<<4)+10>>1]=~~(M+1.0)&65535|1}E=c[d+56>>2]|0;if((h|0)>(f|0)){A=a[d+60>>0]|0;z=f;do{if(!(A<<24>>24)){j=c[d+76>>2]|0;l=+g[j+(z<<6)>>2];t=+g[j+(z<<6)+4>>2];x=+g[j+(z<<6)+8>>2];o=+g[j+(z<<6)+12>>2];k=+g[j+(z<<6)+16>>2];w=+g[j+(z<<6)+20>>2];n=+g[j+(z<<6)+24>>2];s=+g[j+(z<<6)+28>>2];j=c[d+96>>2]|0;if(l<+g[j+(E<<6)>>2])g[j+(E<<6)>>2]=l;if(t<+g[j+(E<<6)+4>>2])g[j+(E<<6)+4>>2]=t;if(x<+g[j+(E<<6)+8>>2])g[j+(E<<6)+8>>2]=x;if(o<+g[j+(E<<6)+12>>2])g[j+(E<<6)+12>>2]=o;if(+g[j+(E<<6)+16>>2]>2]=k;if(+g[j+(E<<6)+20>>2]>2]=w;if(+g[j+(E<<6)+24>>2]>2]=n;if(+g[j+(E<<6)+28>>2]>2]=s}else{u=c[d+116>>2]|0;s=+g[d+36>>2];y=+g[d+40>>2];K=+g[d+44>>2];t=+g[d+4>>2];B=+g[d+8>>2];L=+g[d+12>>2];w=+g[d+4>>2];C=+g[d+8>>2];M=+g[d+12>>2];o=+g[d+36>>2];x=+g[d+40>>2];D=+g[d+44>>2];j=~~((+(e[u+(z<<4)>>1]|0)/s+t-w)*o)&65535&-2;m=~~((+(e[u+(z<<4)+2>>1]|0)/y+B-C)*x)&65535&-2;p=~~((+(e[u+(z<<4)+4>>1]|0)/K+L-M)*D)&65535&-2;q=~~(o*(+(e[u+(z<<4)+6>>1]|0)/s+t-w)+1.0)&65535|1;r=~~(x*(+(e[u+(z<<4)+8>>1]|0)/y+B-C)+1.0)&65535|1;u=~~(D*(+(e[u+(z<<4)+10>>1]|0)/K+L-M)+1.0)&65535|1;v=c[d+136>>2]|0;if((e[v+(E<<4)>>1]|0)>(j&65535))b[v+(E<<4)>>1]=j;if((e[v+(E<<4)+6>>1]|0)<(q&65535))b[v+(E<<4)+6>>1]=q;if((e[v+(E<<4)+2>>1]|0)>(m&65535))b[v+(E<<4)+2>>1]=m;if((e[v+(E<<4)+8>>1]|0)<(r&65535))b[v+(E<<4)+8>>1]=r;if((e[v+(E<<4)+4>>1]|0)>(p&65535))b[v+(E<<4)+4>>1]=p;if((e[v+(E<<4)+10>>1]|0)<(u&65535))b[v+(E<<4)+10>>1]=u}z=z+1|0}while((z|0)!=(h|0))}c[d+56>>2]=E+1;Ib(d,f,i);z=c[d+56>>2]|0;Ib(d,i,h);v=(c[d+56>>2]|0)-G|0;i=a[d+60>>0]|0;if(i<<24>>24!=0&(v|0)>128){r=c[d+136>>2]|0;q=c[r+(E+1<<4)+12>>2]|0;q=(q|0)>-1?1:0-q|0;u=c[r+(z<<4)+12>>2]|0;u=(u|0)>-1?1:0-u|0;if((q|0)<129){p=c[d+152>>2]|0;if((p|0)==(c[d+156>>2]|0)?(H=(p|0)==0?1:p<<1,(p|0)<(H|0)):0){if(!H){i=0;m=p}else{c[7182]=(c[7182]|0)+1;i=xb(H<<5|19)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}m=c[d+152>>2]|0}if((m|0)>0){j=0;do{G=i+(j<<5)|0;h=(c[d+160>>2]|0)+(j<<5)|0;c[G>>2]=c[h>>2];c[G+4>>2]=c[h+4>>2];c[G+8>>2]=c[h+8>>2];c[G+12>>2]=c[h+12>>2];c[G+16>>2]=c[h+16>>2];c[G+20>>2]=c[h+20>>2];c[G+24>>2]=c[h+24>>2];c[G+28>>2]=c[h+28>>2];j=j+1|0}while((j|0)!=(m|0))}j=c[d+160>>2]|0;if(j|0){if(a[d+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[d+160>>2]=0}a[d+164>>0]=1;c[d+160>>2]=i;c[d+156>>2]=H;i=c[d+152>>2]|0}else i=p;c[d+152>>2]=i+1;H=(c[d+160>>2]|0)+(p<<5)|0;c[H>>2]=c[J+32>>2];c[H+4>>2]=c[J+32+4>>2];c[H+8>>2]=c[J+32+8>>2];c[H+12>>2]=c[J+32+12>>2];c[H+16>>2]=c[J+32+16>>2];c[H+20>>2]=c[J+32+20>>2];c[H+24>>2]=c[J+32+24>>2];c[H+28>>2]=c[J+32+28>>2];H=c[d+160>>2]|0;b[H+(p<<5)>>1]=b[r+(E+1<<4)>>1]|0;b[H+(p<<5)+2>>1]=b[r+(E+1<<4)+2>>1]|0;b[H+(p<<5)+4>>1]=b[r+(E+1<<4)+4>>1]|0;b[H+(p<<5)+6>>1]=b[r+(E+1<<4)+6>>1]|0;b[H+(p<<5)+8>>1]=b[r+(E+1<<4)+8>>1]|0;b[H+(p<<5)+10>>1]=b[r+(E+1<<4)+10>>1]|0;c[H+(p<<5)+12>>2]=E+1;c[H+(p<<5)+16>>2]=q}if((u|0)<129){p=c[d+152>>2]|0;if((p|0)==(c[d+156>>2]|0)?(I=(p|0)==0?1:p<<1,(p|0)<(I|0)):0){if(!I){i=0;m=p}else{c[7182]=(c[7182]|0)+1;i=xb(I<<5|19)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}m=c[d+152>>2]|0}if((m|0)>0){j=0;do{H=i+(j<<5)|0;G=(c[d+160>>2]|0)+(j<<5)|0;c[H>>2]=c[G>>2];c[H+4>>2]=c[G+4>>2];c[H+8>>2]=c[G+8>>2];c[H+12>>2]=c[G+12>>2];c[H+16>>2]=c[G+16>>2];c[H+20>>2]=c[G+20>>2];c[H+24>>2]=c[G+24>>2];c[H+28>>2]=c[G+28>>2];j=j+1|0}while((j|0)!=(m|0))}j=c[d+160>>2]|0;if(j|0){if(a[d+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[d+160>>2]=0}a[d+164>>0]=1;c[d+160>>2]=i;c[d+156>>2]=I;i=c[d+152>>2]|0}else i=p;c[d+152>>2]=i+1;i=(c[d+160>>2]|0)+(p<<5)|0;c[i>>2]=c[J+32>>2];c[i+4>>2]=c[J+32+4>>2];c[i+8>>2]=c[J+32+8>>2];c[i+12>>2]=c[J+32+12>>2];c[i+16>>2]=c[J+32+16>>2];c[i+20>>2]=c[J+32+20>>2];c[i+24>>2]=c[J+32+24>>2];c[i+28>>2]=c[J+32+28>>2];i=c[d+160>>2]|0;b[i+(p<<5)>>1]=b[r+(z<<4)>>1]|0;b[i+(p<<5)+2>>1]=b[r+(z<<4)+2>>1]|0;b[i+(p<<5)+4>>1]=b[r+(z<<4)+4>>1]|0;b[i+(p<<5)+6>>1]=b[r+(z<<4)+6>>1]|0;b[i+(p<<5)+8>>1]=b[r+(z<<4)+8>>1]|0;b[i+(p<<5)+10>>1]=b[r+(z<<4)+10>>1]|0;c[i+(p<<5)+12>>2]=z;c[i+(p<<5)+16>>2]=u;i=d+152|0}else i=d+152|0;c[d+168>>2]=c[i>>2];i=a[d+60>>0]|0}if(!(i<<24>>24)){c[(c[d+96>>2]|0)+(F<<6)+32>>2]=v;sa=J;return}else{c[(c[d+136>>2]|0)+(F<<4)+12>>2]=0-v;sa=J;return}}function Jb(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0.0,ma=0.0,na=0.0,oa=0.0,pa=0.0,qa=0.0,ra=0.0;ga=sa;sa=sa+176|0;da=c[d+4>>2]|0;ea=c[e+4>>2]|0;if((c[da+68>>2]|0)==(c[b+40>>2]|0)?(c[ea+68>>2]|0)==(c[b+44>>2]|0):0)ca=b+8|0;else{i=c[b+8>>2]|0;k=c[i+8>>2]|0;if((k|0)>0){j=0;do{l=c[(c[i+16>>2]|0)+(j*12|0)+8>>2]|0;if(l|0){Pa[c[c[l>>2]>>2]&511](l);ca=c[b+4>>2]|0;Va[c[(c[ca>>2]|0)+60>>2]&127](ca,l)}j=j+1|0}while((j|0)!=(k|0));i=c[b+8>>2]|0}gh(i);ca=b+8|0}a[ga+128+16>>0]=1;o=ga+128+12|0;c[o>>2]=0;c[ga+128+4>>2]=0;c[ga+128+8>>2]=0;n=c[ca>>2]|0;i=c[n+8>>2]|0;if((i|0)>0){m=0;do{j=c[(c[n+16>>2]|0)+(m*12|0)+8>>2]|0;if(j){Va[c[(c[j>>2]|0)+16>>2]&127](j,ga+128|0);i=c[ga+128+4>>2]|0;if((i|0)>0){l=0;do{k=c[(c[o>>2]|0)+(l<<2)>>2]|0;if(c[k+748>>2]|0){c[h+4>>2]=k;i=c[k+740>>2]|0;j=c[(c[h+8>>2]|0)+8>>2]|0;if((i|0)==(j|0))re(k,i+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);else re(k,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,j+4|0);c[h+4>>2]=0;i=c[ga+128+4>>2]|0}l=l+1|0}while((l|0)<(i|0))}if((i|0)<0){if((c[ga+128+8>>2]|0)<0){j=c[o>>2]|0;if(j|0){if(a[ga+128+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[o>>2]=0}a[ga+128+16>>0]=1;c[o>>2]=0;c[ga+128+8>>2]=0}do{c[(c[o>>2]|0)+(i<<2)>>2]=0;i=i+1|0}while((i|0)!=0)}c[ga+128+4>>2]=0;i=c[n+8>>2]|0}m=m+1|0}while((m|0)<(i|0));i=c[o>>2]|0;if(i|0){if(a[ga+128+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[o>>2]=0}}j=c[da+64>>2]|0;k=c[ea+64>>2]|0;s=c[b+4>>2]|0;t=c[ca>>2]|0;u=c[b+32>>2]|0;c[ga+128>>2]=9064;c[ga+128+4>>2]=0;c[ga+128+8>>2]=d;c[ga+128+12>>2]=e;c[ga+128+16>>2]=s;c[ga+128+20>>2]=f;c[ga+128+24>>2]=h;c[ga+128+28>>2]=t;c[ga+128+32>>2]=u;u=c[d+12>>2]|0;F=+g[u>>2];G=+g[u+16>>2];H=+g[u+32>>2];I=+g[u+4>>2];J=+g[u+20>>2];K=+g[u+36>>2];L=+g[u+8>>2];M=+g[u+24>>2];N=+g[u+40>>2];O=-+g[u+48>>2];P=-+g[u+52>>2];Q=-+g[u+56>>2];u=c[e+12>>2]|0;R=+g[u>>2];S=+g[u+16>>2];T=+g[u+32>>2];U=+g[u+4>>2];V=+g[u+20>>2];W=+g[u+36>>2];X=+g[u+8>>2];Y=+g[u+24>>2];Z=+g[u+40>>2];_=+g[u+48>>2];$=+g[u+52>>2];aa=+g[u+56>>2];j=c[j>>2]|0;k=c[k>>2]|0;if((j|0)!=0&(k|0)!=0){c[7182]=(c[7182]|0)+1;i=xb(1043)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}c[i>>2]=j;c[i+4>>2]=k;v=+w(+(F*R+G*S+H*T));x=+w(+(F*U+G*V+H*W));y=+w(+(F*X+G*Y+H*Z));z=+w(+(I*R+J*S+K*T));A=+w(+(I*U+J*V+K*W));B=+w(+(I*X+J*Y+K*Z));C=+w(+(L*R+M*S+N*T));D=+w(+(L*U+M*V+N*W));E=+w(+(L*X+M*Y+N*Z));p=1;n=124;o=128;r=i;m=128;f=i;l=i;k=i;while(1){u=p+-1|0;s=c[r+(u<<3)>>2]|0;t=c[r+(u<<3)+4>>2]|0;ra=+g[t+16>>2];qa=+g[t>>2];pa=+g[t+20>>2];oa=+g[t+4>>2];na=+g[t+24>>2];ha=+g[t+8>>2];ma=F*O+G*P+H*Q+(F*_+G*$+H*aa)+((F*R+G*S+H*T)*(ra+qa)*.5+(F*U+G*V+H*W)*(pa+oa)*.5+(F*X+G*Y+H*Z)*(na+ha)*.5);ka=I*O+J*P+K*Q+(I*_+J*$+K*aa)+((I*R+J*S+K*T)*(ra+qa)*.5+(I*U+J*V+K*W)*(pa+oa)*.5+(I*X+J*Y+K*Z)*(na+ha)*.5);ia=L*O+M*P+N*Q+(L*_+M*$+N*aa)+((L*R+M*S+N*T)*(ra+qa)*.5+(L*U+M*V+N*W)*(pa+oa)*.5+(L*X+M*Y+N*Z)*(na+ha)*.5);la=v*((ra-qa)*.5+0.0)+x*((pa-oa)*.5+0.0)+y*((na-ha)*.5+0.0);ja=z*((ra-qa)*.5+0.0)+A*((pa-oa)*.5+0.0)+B*((na-ha)*.5+0.0);ha=C*((ra-qa)*.5+0.0)+D*((pa-oa)*.5+0.0)+E*((na-ha)*.5+0.0);do if(((((+g[s>>2]<=la+ma?+g[s+16>>2]>=ma-la:0)?+g[s+4>>2]<=ja+ka:0)?+g[s+20>>2]>=ka-ja:0)?+g[s+8>>2]<=ha+ia:0)?+g[s+24>>2]>=ia-ha:0){if((u|0)>(n|0)){q=m<<1;do if((m|0)<(q|0)&(o|0)<(q|0)){do if(!m){k=0;i=0;ba=55}else{c[7182]=(c[7182]|0)+1;i=xb((m<<4|3)+16|0)|0;if(!i)j=0;else{c[(i+4+15&-16)+-4>>2]=i;j=i+4+15&-16}if((m|0)<=0){k=j;i=j;ba=55;break}i=0;do{n=r+(i<<3)|0;o=c[n+4>>2]|0;h=j+(i<<3)|0;c[h>>2]=c[n>>2];c[h+4>>2]=o;i=i+1|0}while((i|0)!=(m|0));k=j;i=j}while(0);if((ba|0)==55){ba=0;if(!r){m=q;l=k;n=k;j=k;break}}if(!f){m=q;l=k;n=k;j=k}else{c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);m=q;l=k;n=k;j=k}}else{m=o;i=r;n=k;j=f}while(0);h=q+-4|0;o=m;m=q;f=j}else{h=n;i=r;n=k}j=(c[t+40>>2]|0)!=0;if(!(c[s+40>>2]|0))if(j){k=c[t+36>>2]|0;c[i+(u<<3)>>2]=s;c[i+(u<<3)+4>>2]=k;k=c[t+40>>2]|0;c[i+(p<<3)>>2]=s;c[i+(p<<3)+4>>2]=k;p=p+1|0;k=n;j=f;break}else{Za[c[(c[ga+128>>2]|0)+8>>2]&127](ga+128|0,s,t);p=u;k=n;j=f;break}else{k=c[s+36>>2]|0;if(j){j=c[t+36>>2]|0;c[i+(u<<3)>>2]=k;c[i+(u<<3)+4>>2]=j;u=c[t+36>>2]|0;j=p+1|0;c[i+(p<<3)>>2]=c[s+40>>2];c[i+(p<<3)+4>>2]=u;u=c[t+40>>2]|0;k=p+2|0;c[i+(j<<3)>>2]=c[s+36>>2];c[i+(j<<3)+4>>2]=u;j=c[t+40>>2]|0;c[i+(k<<3)>>2]=c[s+40>>2];c[i+(k<<3)+4>>2]=j;p=p+3|0;k=n;j=f;break}else{c[i+(u<<3)>>2]=k;c[i+(u<<3)+4>>2]=t;c[i+(p<<3)>>2]=c[s+40>>2];c[i+(p<<3)+4>>2]=t;p=p+1|0;k=n;j=f;break}}}else{p=u;h=n;i=r;j=f}while(0);if(!p)break;else{n=h;r=i;f=j}}if(!((i|0)==0|(l|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}}o=c[ca>>2]|0;if((c[o+8>>2]|0)>0){n=0;do{i=c[o+16>>2]|0;j=c[i+(n*12|0)+8>>2]|0;do if(j|0){ba=c[i+(n*12|0)>>2]|0;u=c[da+24>>2]|0;t=c[u+(ba*80|0)+64>>2]|0;s=c[d+12>>2]|0;ra=+g[s>>2];S=+g[s+4>>2];R=+g[s+8>>2];oa=+g[s+16>>2];ma=+g[s+20>>2];ka=+g[s+24>>2];na=+g[s+32>>2];ja=+g[s+36>>2];X=+g[s+40>>2];ia=+g[u+(ba*80|0)>>2];ha=+g[u+(ba*80|0)+16>>2];aa=+g[u+(ba*80|0)+32>>2];$=+g[u+(ba*80|0)+4>>2];_=+g[u+(ba*80|0)+20>>2];Z=+g[u+(ba*80|0)+36>>2];la=+g[u+(ba*80|0)+8>>2];Y=+g[u+(ba*80|0)+24>>2];W=+g[u+(ba*80|0)+40>>2];qa=+g[u+(ba*80|0)+48>>2];pa=+g[u+(ba*80|0)+52>>2];T=+g[u+(ba*80|0)+56>>2];V=+g[s+48>>2]+(ra*qa+S*pa+R*T);U=+g[s+52>>2]+(oa*qa+ma*pa+ka*T);T=+g[s+56>>2]+(na*qa+ja*pa+X*T);g[ga>>2]=ra*ia+S*ha+R*aa;g[ga+4>>2]=ra*$+S*_+R*Z;g[ga+8>>2]=ra*la+S*Y+R*W;g[ga+12>>2]=0.0;g[ga+16>>2]=oa*ia+ma*ha+ka*aa;g[ga+20>>2]=oa*$+ma*_+ka*Z;g[ga+24>>2]=oa*la+ma*Y+ka*W;g[ga+28>>2]=0.0;g[ga+32>>2]=na*ia+ja*ha+X*aa;g[ga+36>>2]=na*$+ja*_+X*Z;g[ga+40>>2]=na*la+ja*Y+X*W;g[ga+44>>2]=0.0;g[ga+48>>2]=V;g[ga+52>>2]=U;g[ga+56>>2]=T;g[ga+60>>2]=0.0;ab[c[(c[t>>2]|0)+8>>2]&127](t,ga,ga+112|0,ga+96|0);t=c[(c[o+16>>2]|0)+(n*12|0)+4>>2]|0;s=c[ea+24>>2]|0;ba=c[s+(t*80|0)+64>>2]|0;u=c[e+12>>2]|0;T=+g[u>>2];U=+g[u+4>>2];V=+g[u+8>>2];W=+g[u+16>>2];X=+g[u+20>>2];Y=+g[u+24>>2];ja=+g[u+32>>2];la=+g[u+36>>2];na=+g[u+40>>2];Z=+g[s+(t*80|0)>>2];_=+g[s+(t*80|0)+16>>2];$=+g[s+(t*80|0)+32>>2];aa=+g[s+(t*80|0)+4>>2];ha=+g[s+(t*80|0)+20>>2];ia=+g[s+(t*80|0)+36>>2];ka=+g[s+(t*80|0)+8>>2];ma=+g[s+(t*80|0)+24>>2];oa=+g[s+(t*80|0)+40>>2];R=+g[s+(t*80|0)+48>>2];S=+g[s+(t*80|0)+52>>2];ra=+g[s+(t*80|0)+56>>2];pa=+g[u+48>>2]+(T*R+U*S+V*ra);qa=+g[u+52>>2]+(W*R+X*S+Y*ra);ra=+g[u+56>>2]+(ja*R+la*S+na*ra);g[ga>>2]=T*Z+U*_+V*$;g[ga+4>>2]=T*aa+U*ha+V*ia;g[ga+8>>2]=T*ka+U*ma+V*oa;g[ga+12>>2]=0.0;g[ga+16>>2]=W*Z+X*_+Y*$;g[ga+20>>2]=W*aa+X*ha+Y*ia;g[ga+24>>2]=W*ka+X*ma+Y*oa;g[ga+28>>2]=0.0;g[ga+32>>2]=ja*Z+la*_+na*$;g[ga+36>>2]=ja*aa+la*ha+na*ia;g[ga+40>>2]=ja*ka+la*ma+na*oa;g[ga+44>>2]=0.0;g[ga+48>>2]=pa;g[ga+52>>2]=qa;g[ga+56>>2]=ra;g[ga+60>>2]=0.0;ab[c[(c[ba>>2]|0)+8>>2]&127](ba,ga,ga+80|0,ga+64|0);if(!(+g[ga+112>>2]>+g[ga+64>>2])?!(+g[ga+96>>2]<+g[ga+80>>2]):0)i=1;else i=0;if(!(!(+g[ga+112+8>>2]>+g[ga+64+8>>2])?!(+g[ga+96+8>>2]<+g[ga+80+8>>2]):0))i=0;if(!(+g[ga+112+4>>2]>+g[ga+64+4>>2])?!(+g[ga+96+4>>2]<+g[ga+80+4>>2]|i^1):0)break;Pa[c[c[j>>2]>>2]&511](j);m=c[b+4>>2]|0;Va[c[(c[m>>2]|0)+60>>2]&127](m,j);m=c[o+16>>2]|0;l=c[m+(n*12|0)>>2]|0;m=c[m+(n*12|0)+4>>2]|0;j=c[b+16>>2]|0;if((j|0)==(c[b+20>>2]|0)?(fa=(j|0)==0?1:j<<1,(j|0)<(fa|0)):0){if(!fa)i=0;else{c[7182]=(c[7182]|0)+1;i=xb((fa*12|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}j=c[b+16>>2]|0}if((j|0)>0){k=0;do{ba=i+(k*12|0)|0;u=(c[b+24>>2]|0)+(k*12|0)|0;c[ba>>2]=c[u>>2];c[ba+4>>2]=c[u+4>>2];c[ba+8>>2]=c[u+8>>2];k=k+1|0}while((k|0)!=(j|0))}j=c[b+24>>2]|0;if(j|0){if(a[b+28>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[b+24>>2]=0}a[b+28>>0]=1;c[b+24>>2]=i;c[b+20>>2]=fa;i=c[b+16>>2]|0}else i=j;ba=c[b+24>>2]|0;c[ba+(i*12|0)>>2]=l;c[ba+(i*12|0)+4>>2]=m;c[ba+(i*12|0)+8>>2]=0;c[b+16>>2]=(c[b+16>>2]|0)+1}while(0);n=n+1|0}while((n|0)<(c[o+8>>2]|0));j=b+24|0;k=b+16|0}else{j=b+24|0;k=b+16|0}if((c[k>>2]|0)>0){i=0;do{e=c[ca>>2]|0;fa=c[j>>2]|0;Ja[c[(c[e>>2]|0)+8>>2]&63](e,c[fa+(i*12|0)>>2]|0,c[fa+(i*12|0)+4>>2]|0)|0;i=i+1|0}while((i|0)<(c[k>>2]|0))}i=c[j>>2]|0;if(!i){a[b+28>>0]=1;c[j>>2]=0;c[k>>2]=0;b=b+20|0;c[b>>2]=0;sa=ga;return}if(a[b+28>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[j>>2]=0;a[b+28>>0]=1;c[j>>2]=0;c[k>>2]=0;b=b+20|0;c[b>>2]=0;sa=ga;return}function Kb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0,M=0;r=sa;sa=sa+208|0;f=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Wa[c[(c[f>>2]|0)+56>>2]&7](f,b,1.0);f=c[d+4>>2]|0;switch(f|0){case 31:{f=c[d+16>>2]|0;if((f|0)<=0){sa=r;return}do{q=f;f=f+-1|0;p=c[d+24>>2]|0;C=+g[p+(f*80|0)>>2];z=+g[p+(f*80|0)+4>>2];w=+g[p+(f*80|0)+8>>2];B=+g[p+(f*80|0)+16>>2];y=+g[p+(f*80|0)+20>>2];u=+g[p+(f*80|0)+24>>2];A=+g[p+(f*80|0)+32>>2];x=+g[p+(f*80|0)+36>>2];s=+g[p+(f*80|0)+40>>2];K=+g[p+(f*80|0)+48>>2];J=+g[p+(f*80|0)+52>>2];k=+g[p+(f*80|0)+56>>2];p=c[p+(f*80|0)+64>>2]|0;o=c[(c[a>>2]|0)+28>>2]|0;I=+g[b>>2];H=+g[b+4>>2];G=+g[b+8>>2];F=+g[b+16>>2];E=+g[b+20>>2];D=+g[b+24>>2];v=+g[b+32>>2];t=+g[b+36>>2];h=+g[b+40>>2];i=K*I+J*H+k*G+ +g[b+48>>2];j=K*F+J*E+k*D+ +g[b+52>>2];k=K*v+J*t+k*h+ +g[b+56>>2];g[r+144>>2]=C*I+B*H+A*G;g[r+144+4>>2]=z*I+y*H+x*G;g[r+144+8>>2]=w*I+u*H+s*G;g[r+144+12>>2]=0.0;g[r+144+16>>2]=C*F+B*E+A*D;g[r+144+20>>2]=z*F+y*E+x*D;g[r+144+24>>2]=w*F+u*E+s*D;g[r+144+28>>2]=0.0;g[r+144+32>>2]=C*v+B*t+A*h;g[r+144+36>>2]=z*v+y*t+x*h;g[r+144+40>>2]=w*v+u*t+s*h;g[r+144+44>>2]=0.0;g[r+144+48>>2]=i;g[r+144+52>>2]=j;g[r+144+56>>2]=k;g[r+144+60>>2]=0.0;ab[o&127](a,r+144|0,p,e)}while((q|0)>1);sa=r;return}case 0:{c[r+144>>2]=c[d+28>>2];c[r+144+4>>2]=c[d+28+4>>2];c[r+144+8>>2]=c[d+28+8>>2];c[r+144+12>>2]=c[d+28+12>>2];I=+va[c[(c[d>>2]|0)+48>>2]&15](d);J=+va[c[(c[d>>2]|0)+48>>2]&15](d);K=+va[c[(c[d>>2]|0)+48>>2]&15](d);I=I+ +g[r+144>>2];g[r+144>>2]=I;J=J+ +g[r+144+4>>2];g[r+144+4>>2]=J;K=K+ +g[r+144+8>>2];g[r+144+8>>2]=K;d=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;a=c[(c[d>>2]|0)+72>>2]|0;g[r+112>>2]=-I;g[r+112+4>>2]=-J;g[r+112+8>>2]=-K;g[r+112+12>>2]=0.0;eb[a&31](d,r+112|0,r+144|0,b,e);sa=r;return}case 8:{K=+va[c[(c[d>>2]|0)+48>>2]&15](d);d=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Ua[c[(c[d>>2]|0)+16>>2]&1](d,K,b,e);sa=r;return}case 9:{f=c[d+92>>2]|0;if((f|0)<=0){sa=r;return}do{q=f;f=f+-1|0;p=c[d+100>>2]|0;w=+g[p+(f<<4)>>2];x=+g[p+(f<<4)+4>>2];J=+g[p+(f<<4)+8>>2];p=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;o=c[(c[p>>2]|0)+16>>2]|0;K=+g[(c[d+120>>2]|0)+(f<<2)>>2];z=+g[b>>2];A=+g[b+4>>2];y=+g[b+8>>2];C=+g[b+16>>2];D=+g[b+20>>2];B=+g[b+24>>2];F=+g[b+32>>2];G=+g[b+36>>2];E=+g[b+40>>2];H=w*z+x*A+J*y+ +g[b+48>>2];I=w*C+x*D+J*B+ +g[b+52>>2];J=w*F+x*G+J*E+ +g[b+56>>2];g[r+144>>2]=z+A*0.0+y*0.0;g[r+144+4>>2]=z*0.0+A+y*0.0;g[r+144+8>>2]=y+(z*0.0+A*0.0);g[r+144+12>>2]=0.0;g[r+144+16>>2]=C+D*0.0+B*0.0;g[r+144+20>>2]=C*0.0+D+B*0.0;g[r+144+24>>2]=B+(C*0.0+D*0.0);g[r+144+28>>2]=0.0;g[r+144+32>>2]=F+G*0.0+E*0.0;g[r+144+36>>2]=F*0.0+G+E*0.0;g[r+144+40>>2]=E+(F*0.0+G*0.0);g[r+144+44>>2]=0.0;g[r+144+48>>2]=H;g[r+144+52>>2]=I;g[r+144+56>>2]=J;g[r+144+60>>2]=0.0;Ua[o&1](p,K,r+144|0,e)}while((q|0)>1);sa=r;return}case 10:{q=c[d+52>>2]|0;J=+g[d+28+(((q+2|0)%3|0)<<2)>>2];K=+g[d+28+(q<<2)>>2];d=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Sa[c[(c[d>>2]|0)+76>>2]&3](d,J,K,q,b,e);sa=r;return}case 11:{J=+g[d+56>>2];K=+g[d+60>>2];d=c[d+68>>2]|0;a=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Sa[c[(c[a>>2]|0)+84>>2]&3](a,J,K,d,b,e);sa=r;return}case 13:{q=c[d+52>>2]|0;J=+va[c[(c[d>>2]|0)+92>>2]&15](d);c[r+128>>2]=c[d+28>>2];c[r+128+4>>2]=c[d+28+4>>2];c[r+128+8>>2]=c[d+28+8>>2];c[r+128+12>>2]=c[d+28+12>>2];H=+va[c[(c[d>>2]|0)+48>>2]&15](d);I=+va[c[(c[d>>2]|0)+48>>2]&15](d);K=+va[c[(c[d>>2]|0)+48>>2]&15](d);g[r+128>>2]=H+ +g[r+128>>2];g[r+128+4>>2]=I+ +g[r+128+4>>2];g[r+128+8>>2]=K+ +g[r+128+8>>2];K=+g[r+128+(q<<2)>>2];d=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Sa[c[(c[d>>2]|0)+80>>2]&3](d,J,K,q,b,e);sa=r;return}case 28:{K=+g[d+64>>2];a=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;Ya[c[(c[a>>2]|0)+88>>2]&1](a,d+48|0,K,b,e);sa=r;return}default:{a:do if((f|0)<7){q=c[d+52>>2]|0;if(!q){if((Fa[c[(c[d>>2]|0)+100>>2]&127](d)|0)<=0)break;f=0;while(1){ab[c[(c[d>>2]|0)+104>>2]&127](d,f,r+144|0,r+112|0);K=+g[r+144>>2];x=+g[b>>2];I=+g[r+144+4>>2];y=+g[b+4>>2];G=+g[r+144+8>>2];z=+g[b+8>>2];B=+g[b+16>>2];C=+g[b+20>>2];D=+g[b+24>>2];F=+g[b+32>>2];H=+g[b+36>>2];J=+g[b+40>>2];w=+g[b+48>>2];A=+g[b+52>>2];E=+g[b+56>>2];g[r+16>>2]=K*x+I*y+G*z+w;g[r+16+4>>2]=K*B+I*C+G*D+A;g[r+16+8>>2]=K*F+I*H+G*J+E;g[r+16+12>>2]=0.0;G=+g[r+112>>2];I=+g[r+112+4>>2];K=+g[r+112+8>>2];g[r>>2]=w+(x*G+y*I+z*K);g[r+4>>2]=A+(B*G+C*I+D*K);g[r+8>>2]=E+(F*G+H*I+J*K);g[r+12>>2]=0.0;q=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;ab[c[(c[q>>2]|0)+8>>2]&127](q,r+16|0,r,e);f=f+1|0;if((f|0)>=(Fa[c[(c[d>>2]|0)+100>>2]&127](d)|0))break a}}if((c[q+28>>2]|0)>0){p=0;do{f=c[q+36>>2]|0;o=c[f+(p*36|0)+4>>2]|0;b:do if((o|0)>0){l=c[f+(p*36|0)+12>>2]|0;f=0;m=c[l+(o+-1<<2)>>2]|0;h=0.0;i=0.0;k=0.0;while(1){n=c[l+(f<<2)>>2]|0;l=c[q+16>>2]|0;h=h+ +g[l+(n<<4)>>2];i=i+ +g[l+(n<<4)+4>>2];k=k+ +g[l+(n<<4)+8>>2];l=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;L=c[(c[l>>2]|0)+8>>2]|0;M=c[q+16>>2]|0;K=+g[M+(m<<4)>>2];x=+g[b>>2];I=+g[M+(m<<4)+4>>2];y=+g[b+4>>2];G=+g[M+(m<<4)+8>>2];z=+g[b+8>>2];B=+g[b+16>>2];C=+g[b+20>>2];D=+g[b+24>>2];F=+g[b+32>>2];H=+g[b+36>>2];J=+g[b+40>>2];w=+g[b+48>>2];A=+g[b+52>>2];E=+g[b+56>>2];g[r+144>>2]=K*x+I*y+G*z+w;g[r+144+4>>2]=K*B+I*C+G*D+A;g[r+144+8>>2]=K*F+I*H+G*J+E;g[r+144+12>>2]=0.0;G=+g[M+(n<<4)>>2];I=+g[M+(n<<4)+4>>2];K=+g[M+(n<<4)+8>>2];g[r+112>>2]=w+(x*G+y*I+z*K);g[r+112+4>>2]=A+(B*G+C*I+D*K);g[r+112+8>>2]=E+(F*G+H*I+J*K);g[r+112+12>>2]=0.0;ab[L&127](l,r+144|0,r+112|0,e);f=f+1|0;l=c[q+36>>2]|0;if((f|0)>=(c[l+(p*36|0)+4>>2]|0))break b;m=n;l=c[l+(p*36|0)+12>>2]|0}}else{h=0.0;i=0.0;k=0.0}while(0);j=1.0/+(o|0)*h;i=1.0/+(o|0)*i;h=1.0/+(o|0)*k;M=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;if((Fa[c[(c[M>>2]|0)+48>>2]&127](M)|0)&16384|0){c[r+144>>2]=1065353216;c[r+144+4>>2]=1065353216;c[r+144+8>>2]=0;g[r+144+12>>2]=0.0;M=c[q+36>>2]|0;E=+g[M+(p*36|0)+20>>2];G=+g[M+(p*36|0)+24>>2];I=+g[M+(p*36|0)+28>>2];M=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;L=c[(c[M>>2]|0)+8>>2]|0;w=+g[b>>2];x=+g[b+4>>2];y=+g[b+8>>2];A=+g[b+16>>2];B=+g[b+20>>2];C=+g[b+24>>2];F=+g[b+32>>2];H=+g[b+36>>2];J=+g[b+40>>2];z=+g[b+48>>2];D=+g[b+52>>2];K=+g[b+56>>2];g[r+112>>2]=j*w+i*x+h*y+z;g[r+112+4>>2]=j*A+i*B+h*C+D;g[r+112+8>>2]=j*F+i*H+h*J+K;g[r+112+12>>2]=0.0;g[r+16>>2]=(j+E)*w+(i+G)*x+(h+I)*y+z;g[r+16+4>>2]=(j+E)*A+(i+G)*B+(h+I)*C+D;g[r+16+8>>2]=(j+E)*F+(i+G)*H+(h+I)*J+K;g[r+16+12>>2]=0.0;ab[L&127](M,r+112|0,r+16|0,r+144|0)}p=p+1|0}while((p|0)<(c[q+28>>2]|0))}}while(0);f=c[d+4>>2]|0;if((f+-21|0)>>>0<9){c[r+144>>2]=1566444395;c[r+144+4>>2]=1566444395;c[r+144+8>>2]=1566444395;g[r+144+12>>2]=0.0;c[r+112>>2]=-581039253;c[r+112+4>>2]=-581039253;c[r+112+8>>2]=-581039253;g[r+112+12>>2]=0.0;f=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;c[r+16>>2]=8628;c[r+16+4>>2]=8652;c[r+16+8>>2]=f;c[r+16+12>>2]=c[e>>2];c[r+16+12+4>>2]=c[e+4>>2];c[r+16+12+8>>2]=c[e+8>>2];c[r+16+12+12>>2]=c[e+12>>2];c[r+16+28>>2]=c[b>>2];c[r+16+28+4>>2]=c[b+4>>2];c[r+16+28+8>>2]=c[b+8>>2];c[r+16+28+12>>2]=c[b+12>>2];c[r+16+44>>2]=c[b+16>>2];c[r+16+44+4>>2]=c[b+16+4>>2];c[r+16+44+8>>2]=c[b+16+8>>2];c[r+16+44+12>>2]=c[b+16+12>>2];c[r+16+60>>2]=c[b+32>>2];c[r+16+60+4>>2]=c[b+32+4>>2];c[r+16+60+8>>2]=c[b+32+8>>2];c[r+16+60+12>>2]=c[b+32+12>>2];c[r+16+76>>2]=c[b+48>>2];c[r+16+76+4>>2]=c[b+48+4>>2];c[r+16+76+8>>2]=c[b+48+8>>2];c[r+16+76+12>>2]=c[b+48+12>>2];ab[c[(c[d>>2]|0)+64>>2]&127](d,r+16|0,r+112|0,r+144|0);f=c[d+4>>2]|0}if((f|0)!=3){sa=r;return}c[r+144>>2]=1566444395;c[r+144+4>>2]=1566444395;c[r+144+8>>2]=1566444395;g[r+144+12>>2]=0.0;c[r+112>>2]=-581039253;c[r+112+4>>2]=-581039253;c[r+112+8>>2]=-581039253;g[r+112+12>>2]=0.0;M=Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0;c[r+16>>2]=8628;c[r+16+4>>2]=8652;c[r+16+8>>2]=M;c[r+16+12>>2]=c[e>>2];c[r+16+12+4>>2]=c[e+4>>2];c[r+16+12+8>>2]=c[e+8>>2];c[r+16+12+12>>2]=c[e+12>>2];c[r+16+28>>2]=c[b>>2];c[r+16+28+4>>2]=c[b+4>>2];c[r+16+28+8>>2]=c[b+8>>2];c[r+16+28+12>>2]=c[b+12>>2];c[r+16+44>>2]=c[b+16>>2];c[r+16+44+4>>2]=c[b+16+4>>2];c[r+16+44+8>>2]=c[b+16+8>>2];c[r+16+44+12>>2]=c[b+16+12>>2];c[r+16+60>>2]=c[b+32>>2];c[r+16+60+4>>2]=c[b+32+4>>2];c[r+16+60+8>>2]=c[b+32+8>>2];c[r+16+60+12>>2]=c[b+32+12>>2];c[r+16+76>>2]=c[b+48>>2];c[r+16+76+4>>2]=c[b+48+4>>2];c[r+16+76+8>>2]=c[b+48+8>>2];c[r+16+76+12>>2]=c[b+48+12>>2];M=c[d+92>>2]|0;ab[c[(c[M>>2]|0)+8>>2]&127](M,r+16+4|0,r+112|0,r+144|0);sa=r;return}}}function Lb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0;t=sa;sa=sa+48|0;z=1.0/+g[b+108>>2];A=1.0/+g[b+112>>2];B=1.0/+g[b+116>>2];u=+g[b+48>>2];v=z*+g[e>>2]+u;o=+g[b+52>>2];i=A*+g[e+4>>2]+o;q=+g[b+56>>2];p=B*+g[e+8>>2]+q;u=z*+g[f>>2]+u;o=A*+g[f+4>>2]+o;q=B*+g[f+8>>2]+q;B=+g[b+16>>2];v=v>2];i=i>2];p=p>2];v=y>2];i=x>2];p=w>2]|0)+-1|0;f=(c[b+68>>2]|0)+-1|0;switch(c[b+104>>2]|0){case 0:{f=(e|0)<(f|0)?e:f;e=(h|0)>0?h:0;l=(k|0)<(l|0)?k:l;n=(n|0)>0?n:0;break}case 1:{f=(e|0)<(f|0)?e:f;e=(h|0)>0?h:0;l=(j|0)<(l|0)?j:l;n=(m|0)>0?m:0;break}case 2:{f=(k|0)<(f|0)?k:f;e=(n|0)>0?n:0;l=(j|0)<(l|0)?j:l;n=(m|0)>0?m:0;break}default:{e=0;n=0}}if((e|0)>=(f|0)){sa=t;return}r=(n|0)<(l|0);do if(r){k=(e&1|0)==0;q=+(e|0);m=e+1|0;h=n;while(1){do if(!(a[b+100>>0]|0)){if(a[b+101>>0]|0?(h+e&1|0)==0:0){s=16;break}if(!(k&(a[b+102>>0]|0)!=0)){i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,h,e);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(h|0)-+g[b+80>>2]*.5;p=q-+g[b+84>>2]*.5;g[t>>2]=i;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;break}case 1:{B=+(h|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=q-+g[b+84>>2]*.5;g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}case 2:{B=+(h|0)-+g[b+80>>2]*.5;o=q-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}default:{i=+g[t>>2];o=+g[t+4>>2];p=+g[t+8>>2]}}g[t>>2]=i*+g[b+108>>2];g[t+4>>2]=o*+g[b+112>>2];g[t+8>>2]=p*+g[b+116>>2];i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,h,m);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(h|0)-+g[b+80>>2]*.5;p=+(m|0)-+g[b+84>>2]*.5;g[t+16>>2]=i;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;break}case 1:{B=+(h|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=+(m|0)-+g[b+84>>2]*.5;g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}case 2:{B=+(h|0)-+g[b+80>>2]*.5;o=+(m|0)-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}default:{i=+g[t+16>>2];o=+g[t+20>>2];p=+g[t+24>>2]}}g[t+16>>2]=i*+g[b+108>>2];g[t+20>>2]=o*+g[b+112>>2];g[t+24>>2]=p*+g[b+116>>2];j=h+1|0;i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,e);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=q-+g[b+84>>2]*.5;g[t+32>>2]=i;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=q-+g[b+84>>2]*.5;g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=q-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}default:{i=+g[t+32>>2];o=+g[t+36>>2];p=+g[t+40>>2]}}g[t+32>>2]=i*+g[b+108>>2];g[t+36>>2]=o*+g[b+112>>2];g[t+40>>2]=p*+g[b+116>>2];ab[c[(c[d>>2]|0)+8>>2]&127](d,t,h,e);i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,e);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=q-+g[b+84>>2]*.5;g[t>>2]=i;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=q-+g[b+84>>2]*.5;g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=q-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}default:{i=+g[t>>2];o=+g[t+4>>2];p=+g[t+8>>2]}}g[t>>2]=i*+g[b+108>>2];g[t+4>>2]=o*+g[b+112>>2];g[t+8>>2]=p*+g[b+116>>2];i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,m);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=i;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=+(m|0)-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}default:{i=+g[t+32>>2];o=+g[t+36>>2];p=+g[t+40>>2]}}g[t+32>>2]=i*+g[b+108>>2];g[t+36>>2]=o*+g[b+112>>2];g[t+40>>2]=p*+g[b+116>>2];ab[c[(c[d>>2]|0)+8>>2]&127](d,t,h,e);h=j}else s=16}else s=16;while(0);if((s|0)==16){s=0;i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,h,e);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(h|0)-+g[b+80>>2]*.5;p=q-+g[b+84>>2]*.5;g[t>>2]=i;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;break}case 1:{B=+(h|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=q-+g[b+84>>2]*.5;g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}case 2:{B=+(h|0)-+g[b+80>>2]*.5;o=q-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t>>2]=B;g[t+4>>2]=o;g[t+8>>2]=p;g[t+12>>2]=0.0;i=B;break}default:{i=+g[t>>2];o=+g[t+4>>2];p=+g[t+8>>2]}}g[t>>2]=i*+g[b+108>>2];g[t+4>>2]=o*+g[b+112>>2];g[t+8>>2]=p*+g[b+116>>2];j=h+1|0;i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,e);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=q-+g[b+84>>2]*.5;g[t+16>>2]=i;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=q-+g[b+84>>2]*.5;g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=q-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}default:{i=+g[t+16>>2];o=+g[t+20>>2];p=+g[t+24>>2]}}g[t+16>>2]=i*+g[b+108>>2];g[t+20>>2]=o*+g[b+112>>2];g[t+24>>2]=p*+g[b+116>>2];i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,m);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=i;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=+(m|0)-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}default:{i=+g[t+32>>2];o=+g[t+36>>2];p=+g[t+40>>2]}}g[t+32>>2]=i*+g[b+108>>2];g[t+36>>2]=o*+g[b+112>>2];g[t+40>>2]=p*+g[b+116>>2];ab[c[(c[d>>2]|0)+8>>2]&127](d,t,h,e);i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,j,m);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(j|0)-+g[b+80>>2]*.5;p=+(m|0)-+g[b+84>>2]*.5;g[t+16>>2]=i;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;break}case 1:{B=+(j|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=+(m|0)-+g[b+84>>2]*.5;g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}case 2:{B=+(j|0)-+g[b+80>>2]*.5;o=+(m|0)-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+16>>2]=B;g[t+20>>2]=o;g[t+24>>2]=p;g[t+28>>2]=0.0;i=B;break}default:{i=+g[t+16>>2];o=+g[t+20>>2];p=+g[t+24>>2]}}g[t+16>>2]=i*+g[b+108>>2];g[t+20>>2]=o*+g[b+112>>2];g[t+24>>2]=p*+g[b+116>>2];i=+ya[c[(c[b>>2]|0)+68>>2]&15](b,h,m);switch(c[b+104>>2]|0){case 0:{i=i-+g[b+48>>2];o=+(h|0)-+g[b+80>>2]*.5;p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=i;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;break}case 1:{B=+(h|0)-+g[b+80>>2]*.5;o=i-+g[b+52>>2];p=+(m|0)-+g[b+84>>2]*.5;g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}case 2:{B=+(h|0)-+g[b+80>>2]*.5;o=+(m|0)-+g[b+84>>2]*.5;p=i-+g[b+56>>2];g[t+32>>2]=B;g[t+36>>2]=o;g[t+40>>2]=p;g[t+44>>2]=0.0;i=B;break}default:{i=+g[t+32>>2];o=+g[t+36>>2];p=+g[t+40>>2]}}g[t+32>>2]=i*+g[b+108>>2];g[t+36>>2]=o*+g[b+112>>2];g[t+40>>2]=p*+g[b+116>>2];ab[c[(c[d>>2]|0)+8>>2]&127](d,t,h,e);h=j}if((h|0)==(l|0)){e=m;break}}}else e=e+1|0;while((e|0)!=(f|0));sa=t;return}function Mb(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0,m=0.0,n=0.0,o=0,p=0,q=0.0,r=0.0,s=0,t=0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0,B=0,C=0.0,D=0.0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0;P=sa;sa=sa+192|0;O=c[d+36>>2]|0;n=+g[(+g[O+88>>2]>0.0?b+16|0:b+20|0)>>2];if(a[O+100>>0]&1){sa=P;return}L=c[b+8>>2]|0;t=c[L+4>>2]|0;M=c[L+12>>2]|0;J=c[(c[b+4>>2]|0)+684>>2]|0;C=+g[O+8>>2]-+g[M+48>>2];q=+g[O+12>>2]-+g[M+52>>2];D=+g[O+16>>2]-+g[M+56>>2];z=1.0/+g[J+76>>2];y=(C*+g[M>>2]+q*+g[M+16>>2]+D*+g[M+32>>2])*z/3.0;G=y<0.0?~~(1.0-y):0;K=~~((y+ +(G|0)-+(~~(y+ +(G|0))|0))*3.0);r=(y+ +(G|0)-+(~~(y+ +(G|0))|0))*3.0-+(K|0);G=~~(y+ +(G|0))-G|0;y=z*(C*+g[M+4>>2]+q*+g[M+20>>2]+D*+g[M+36>>2])/3.0;E=y<0.0?~~(1.0-y):0;H=~~((y+ +(E|0)-+(~~(y+ +(E|0))|0))*3.0);m=(y+ +(E|0)-+(~~(y+ +(E|0))|0))*3.0-+(H|0);E=~~(y+ +(E|0))-E|0;D=z*(C*+g[M+8>>2]+q*+g[M+24>>2]+D*+g[M+40>>2])/3.0;F=D<0.0?~~(1.0-D):0;I=~~((D+ +(F|0)-+(~~(D+ +(F|0))|0))*3.0);q=(D+ +(F|0)-+(~~(D+ +(F|0))|0))*3.0-+(I|0);F=~~(D+ +(F|0))-F|0;o=(16?G>>>16:G)<<11^(G&65535)+16^(G&65535)+16<<16;o=o+(E&65535)+(11?o>>>11:o)|0;o=o^(16?E>>>16:E)<<11^o<<16;o=o+(F&65535)+(11?o>>>11:o)|0;o=o^(16?F>>>16:F)<<11^o<<16;o=o+(t&65535)+(11?o>>>11:o)|0;o=o^(16?t>>>16:t)<<11^o<<16;o=(11?o>>>11:o)+o|0;o=(5?(o<<3^o)>>>5:o<<3^o)+(o<<3^o)|0;o=(17?(o<<4^o)>>>17:o<<4^o)+(o<<4^o)|0;o=(6?(o<<25^o)>>>6:o<<25^o)+(o<<25^o)|0;p=c[J+60>>2]|0;s=c[J+68>>2]|0;d=c[s+(((o>>>0)%(p>>>0)|0)<<2)>>2]|0;c[J+96>>2]=(c[J+96>>2]|0)+1;e=(c[J+92>>2]|0)+1|0;c[J+92>>2]=e;a:do if(!d)l=10;else while(1){if(((((c[d+272>>2]|0)==(o|0)?(c[d+256>>2]|0)==(G|0):0)?(c[d+260>>2]|0)==(E|0):0)?(c[d+264>>2]|0)==(F|0):0)?(c[d+276>>2]|0)==(t|0):0)break a;d=c[d+280>>2]|0;e=e+1|0;c[J+92>>2]=e;if(!d){l=10;break}}while(0);b:do if((l|0)==10){B=c[J+84>>2]|0;c[J+84>>2]=B+1;if((B|0)>=(c[J+88>>2]|0)){c[6832]=(c[6832]|0)+1;c:do if((p|0)>0){d=0;e=s;while(1){B=e+(d<<2)|0;e=c[B>>2]|0;c[B>>2]=0;if(e|0)do{B=e;e=c[e+280>>2]|0;GI(B)}while((e|0)!=0);d=d+1|0;if((d|0)==(p|0))break c;e=c[J+68>>2]|0}}while(0);g[J+76>>2]=.25;c[J+80>>2]=0;c[J+84>>2]=0;c[J+92>>2]=1;c[J+96>>2]=1}d=Nr(284)|0;mk(d|0,0,284)|0;c[d+280>>2]=c[s+(((o>>>0)%(p>>>0)|0)<<2)>>2];c[s+(((o>>>0)%(p>>>0)|0)<<2)>>2]=d;c[d+276>>2]=t;c[d+272>>2]=o;c[d+256>>2]=G;c[d+260>>2]=E;c[d+264>>2]=F;j=+g[J+76>>2];t=P+120+4|0;A=P+120+24|0;B=P+120+44|0;e=0;f=j;while(1){i=j*+(F|0)*3.0+f*+(e|0);l=0;while(1){h=j*+(E|0)*3.0+f*+(l|0);g[P+48>>2]=+(G|0)*3.0*j+f*0.0;g[P+48+4>>2]=h;g[P+48+8>>2]=i;g[P+48+12>>2]=0.0;o=c[d+276>>2]|0;c[P+120>>2]=1065353216;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[P+120+20>>2]=1065353216;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;c[P+120+40>>2]=1065353216;c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;c[B+12>>2]=0;c[B+16>>2]=0;s=c[o+4>>2]|0;if((s|0)<20){f=+lc(P+48|0,o,P+120|0,P+64|0);o=c[d+276>>2]|0;p=o+4|0;s=c[o+4>>2]|0}else{f=0.0;p=o+4|0}g[d+(l<<4)+(e<<2)>>2]=f;g[P+48>>2]=+(G|0)*3.0*j+ +g[J+76>>2];g[P+48+4>>2]=h;g[P+48+8>>2]=i;g[P+48+12>>2]=0.0;c[P+120>>2]=1065353216;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[P+120+20>>2]=1065353216;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;c[P+120+40>>2]=1065353216;c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;c[B+12>>2]=0;c[B+16>>2]=0;if((s|0)<20){f=+lc(P+48|0,o,P+120|0,P+64|0);o=c[d+276>>2]|0;p=o+4|0}else f=0.0;g[d+64+(l<<4)+(e<<2)>>2]=f;g[P+48>>2]=+(G|0)*3.0*j+ +g[J+76>>2]*2.0;g[P+48+4>>2]=h;g[P+48+8>>2]=i;g[P+48+12>>2]=0.0;c[P+120>>2]=1065353216;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[P+120+20>>2]=1065353216;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;c[P+120+40>>2]=1065353216;c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;c[B+12>>2]=0;c[B+16>>2]=0;if((c[p>>2]|0)<20){f=+lc(P+48|0,o,P+120|0,P+64|0);o=c[d+276>>2]|0;p=o+4|0}else f=0.0;g[d+128+(l<<4)+(e<<2)>>2]=f;g[P+48>>2]=+(G|0)*3.0*j+ +g[J+76>>2]*3.0;g[P+48+4>>2]=h;g[P+48+8>>2]=i;g[P+48+12>>2]=0.0;c[P+120>>2]=1065353216;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[P+120+20>>2]=1065353216;c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;c[P+120+40>>2]=1065353216;c[B>>2]=0;c[B+4>>2]=0;c[B+8>>2]=0;c[B+12>>2]=0;c[B+16>>2]=0;if((c[p>>2]|0)<20)f=+lc(P+48|0,o,P+120|0,P+64|0);else f=0.0;g[d+192+(l<<4)+(e<<2)>>2]=f;l=l+1|0;if((l|0)==4)break;f=+g[J+76>>2]}e=e+1|0;if((e|0)==4)break b;f=+g[J+76>>2]}}while(0);c[d+268>>2]=c[J+80>>2];f=+g[d+(K<<6)+(H<<4)+(I<<2)>>2];w=+g[d+(K+1<<6)+(H<<4)+(I<<2)>>2];u=+g[d+(K+1<<6)+(H+1<<4)+(I<<2)>>2];v=+g[d+(K<<6)+(H+1<<4)+(I<<2)>>2];D=+g[d+(K<<6)+(H<<4)+(I+1<<2)>>2];C=+g[d+(K+1<<6)+(H<<4)+(I+1<<2)>>2];y=+g[d+(K+1<<6)+(H+1<<4)+(I+1<<2)>>2];z=+g[d+(K<<6)+(H+1<<4)+(I+1<<2)>>2];h=w-f+m*(u-v-(w-f))+q*(C-D+m*(y-z-(C-D))-(w-f+m*(u-v-(w-f))));i=v-f+r*(u-w-(v-f))+q*(z-D+r*(y-C-(z-D))-(v-f+r*(u-w-(v-f))));j=D-f+r*(C-w-(D-f))+m*(z-v+r*(y-u-(z-v))-(D-f+r*(C-w-(D-f))));k=1.0/+x(+(j*j+(h*h+i*i)));f=f+r*(w-f)+m*(v+r*(u-v)-(f+r*(w-f)));f=f+q*(D+r*(C-D)+m*(z+r*(y-z)-(D+r*(C-D)))-f)-n;if(!(f<0.0)){sa=P;return}s=c[L+8>>2]|0;C=+g[M>>2]*h*k+ +g[M+4>>2]*i*k+ +g[M+8>>2]*j*k;D=h*k*+g[M+16>>2]+i*k*+g[M+20>>2]+j*k*+g[M+24>>2];z=h*k*+g[M+32>>2]+i*k*+g[M+36>>2]+j*k*+g[M+40>>2];y=-(C*(+g[O+8>>2]-f*C)+D*(+g[O+12>>2]-f*D)+z*(+g[O+16>>2]-f*z));r=+g[O+88>>2];d=c[b+12>>2]|0;if(!d)q=0.0;else q=+g[d+344>>2];if(!(r+q>0.0)){sa=P;return}if(!d)l=(c[(c[b+8>>2]|0)+8>>2]|0)+4|0;else l=d+4|0;if((a[26688]|0)==0?mz(26688)|0:0){d=27332;e=d+48|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0))}e=c[b+12>>2]|0;k=+g[O+8>>2];v=k-+g[l+48>>2];m=+g[O+12>>2];w=m-+g[l+52>>2];n=+g[O+16>>2];u=n-+g[l+56>>2];if(!e){M=c[b+4>>2]|0;f=0.0;h=0.0;i=0.0;d=M;j=+g[M+452>>2]}else{i=+g[e+332>>2];h=+g[e+336>>2];Q=+g[e+328>>2];d=c[b+4>>2]|0;j=+g[d+452>>2];f=(u*i-w*h+ +g[e+312>>2])*j;h=(+g[e+316>>2]+(v*h-u*Q))*j;i=(w*Q-v*i+ +g[e+320>>2])*j}k=k-+g[O+24>>2]-f;m=m-+g[O+28>>2]-h;Q=n-+g[O+32>>2]-i;h=+g[d+316>>2]*+g[(c[(c[b+8>>2]|0)+8>>2]|0)+224>>2];_e(P+120|0,j,r,q,(e|0)==0?27332:e+264|0,v,w,u);c[P+32>>2]=c[P+120>>2];c[P+32+4>>2]=c[P+120+4>>2];c[P+32+8>>2]=c[P+120+8>>2];c[P+32+12>>2]=c[P+120+12>>2];c[P+16>>2]=c[P+120+16>>2];c[P+16+4>>2]=c[P+120+16+4>>2];c[P+16+8>>2]=c[P+120+16+8>>2];c[P+16+12>>2]=c[P+120+16+12>>2];c[P>>2]=c[P+120+32>>2];c[P+4>>2]=c[P+120+32+4>>2];c[P+8>>2]=c[P+120+32+8>>2];c[P+12>>2]=c[P+120+32+12>>2];p=c[b+4>>2]|0;f=r*+g[p+452>>2];h=(Q-z*(k*C+m*D+Q*z))*(Q-z*(k*C+m*D+Q*z))+((k-C*(k*C+m*D+Q*z))*(k-C*(k*C+m*D+Q*z))+(m-D*(k*C+m*D+Q*z))*(m-D*(k*C+m*D+Q*z)))>2]|0)+8>>2]|0)+204>>2]&3|0)==0?p+324|0:p+328|0)>>2]|0;d=c[p+812>>2]|0;if((d|0)==(c[p+816>>2]|0)?(N=(d|0)==0?1:d<<1,(d|0)<(N|0)):0){if(!N)l=0;else{c[7182]=(c[7182]|0)+1;d=xb((N*104|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}l=d;d=c[p+812>>2]|0}if((d|0)>0){e=0;do{M=l+(e*104|0)|0;L=c[p+820>>2]|0;K=L+(e*104|0)|0;c[M>>2]=c[K>>2];c[M+4>>2]=c[K+4>>2];c[M+8>>2]=c[K+8>>2];c[M+12>>2]=c[K+12>>2];c[M+16>>2]=c[K+16>>2];c[M+20>>2]=c[K+20>>2];c[M+24>>2]=c[K+24>>2];M=l+(e*104|0)+28|0;K=L+(e*104|0)+28|0;c[M>>2]=c[K>>2];c[M+4>>2]=c[K+4>>2];c[M+8>>2]=c[K+8>>2];c[M+12>>2]=c[K+12>>2];M=L+(e*104|0)+44|0;K=l+(e*104|0)+44|0;c[K>>2]=c[M>>2];c[K+4>>2]=c[M+4>>2];c[K+8>>2]=c[M+8>>2];c[K+12>>2]=c[M+12>>2];K=L+(e*104|0)+60|0;M=l+(e*104|0)+60|0;c[M>>2]=c[K>>2];c[M+4>>2]=c[K+4>>2];c[M+8>>2]=c[K+8>>2];c[M+12>>2]=c[K+12>>2];M=l+(e*104|0)+76|0;L=L+(e*104|0)+76|0;c[M>>2]=c[L>>2];c[M+4>>2]=c[L+4>>2];c[M+8>>2]=c[L+8>>2];c[M+12>>2]=c[L+12>>2];c[M+16>>2]=c[L+16>>2];c[M+20>>2]=c[L+20>>2];c[M+24>>2]=c[L+24>>2];e=e+1|0}while((e|0)!=(d|0))}d=c[p+820>>2]|0;if(d|0){if(a[p+824>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[p+820>>2]=0}a[p+824>>0]=1;c[p+820>>2]=l;c[p+816>>2]=N;d=c[p+812>>2]|0}N=c[p+820>>2]|0;c[N+(d*104|0)>>2]=s;g[N+(d*104|0)+4>>2]=C;g[N+(d*104|0)+8>>2]=D;g[N+(d*104|0)+12>>2]=z;g[N+(d*104|0)+16>>2]=0.0;g[N+(d*104|0)+20>>2]=y;c[N+(d*104|0)+24>>2]=O;O=N+(d*104|0)+28|0;c[O>>2]=c[P+32>>2];c[O+4>>2]=c[P+32+4>>2];c[O+8>>2]=c[P+32+8>>2];c[O+12>>2]=c[P+32+12>>2];O=N+(d*104|0)+44|0;c[O>>2]=c[P+16>>2];c[O+4>>2]=c[P+16+4>>2];c[O+8>>2]=c[P+16+8>>2];c[O+12>>2]=c[P+16+12>>2];O=N+(d*104|0)+60|0;c[O>>2]=c[P>>2];c[O+4>>2]=c[P+4>>2];c[O+8>>2]=c[P+8>>2];c[O+12>>2]=c[P+12>>2];O=N+(d*104|0)+76|0;g[O>>2]=v;g[N+(d*104|0)+80>>2]=w;g[N+(d*104|0)+84>>2]=u;g[N+(d*104|0)+88>>2]=0.0;g[O+16>>2]=f;g[O+20>>2]=h;c[O+24>>2]=o;c[p+812>>2]=(c[p+812>>2]|0)+1;d=c[b+12>>2]|0;if(!d){sa=P;return}if(c[d+204>>2]&3|0){sa=P;return}if((c[d+216>>2]&-2|0)!=4)c[d+216>>2]=1;g[d+220>>2]=0.0;sa=P;return}function Nb(b,d){b=b|0;d=+d;var e=0,f=0.0,h=0,i=0,j=0,k=0.0,l=0.0,m=0,n=0,o=0,p=0.0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,y=0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0;q=sa;sa=sa+96|0;n=c[b+136>>2]|0;if(!n){sa=q;return}e=c[b+8>>2]|0;if((e|0)<(n|0)){if((c[b+12>>2]|0)<(n|0)){c[7182]=(c[7182]|0)+1;h=xb((n<<4|3)+16|0)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}i=c[b+8>>2]|0;if((i|0)>0){h=0;do{m=j+(h<<4)|0;r=(c[b+16>>2]|0)+(h<<4)|0;c[m>>2]=c[r>>2];c[m+4>>2]=c[r+4>>2];c[m+8>>2]=c[r+8>>2];c[m+12>>2]=c[r+12>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[b+16>>2]|0;if(h|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=j;c[b+12>>2]=n;h=b+16|0}else h=b+16|0;do{r=(c[h>>2]|0)+(e<<4)|0;c[r>>2]=c[q+48>>2];c[r+4>>2]=c[q+48+4>>2];c[r+8>>2]=c[q+48+8>>2];c[r+12>>2]=c[q+48+12>>2];e=e+1|0}while((e|0)!=(n|0))}c[b+8>>2]=n;e=c[b+28>>2]|0;if((e|0)<(n|0)){if((c[b+32>>2]|0)<(n|0)){c[7182]=(c[7182]|0)+1;h=xb((n<<4|3)+16|0)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}i=c[b+28>>2]|0;if((i|0)>0){h=0;do{r=j+(h<<4)|0;m=(c[b+36>>2]|0)+(h<<4)|0;c[r>>2]=c[m>>2];c[r+4>>2]=c[m+4>>2];c[r+8>>2]=c[m+8>>2];c[r+12>>2]=c[m+12>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[b+36>>2]|0;if(h|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=j;c[b+32>>2]=n;h=b+36|0}else h=b+36|0;do{r=(c[h>>2]|0)+(e<<4)|0;c[r>>2]=c[q+48>>2];c[r+4>>2]=c[q+48+4>>2];c[r+8>>2]=c[q+48+8>>2];c[r+12>>2]=c[q+48+12>>2];e=e+1|0}while((e|0)!=(n|0))}c[b+28>>2]=n;m=c[b+48>>2]|0;if((m|0)<(n|0)){do if((c[b+52>>2]|0)<(n|0)){c[7182]=(c[7182]|0)+1;e=xb((n<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}i=c[b+48>>2]|0;j=c[b+56>>2]|0;if((i|0)<=0){if(!j){a[b+60>>0]=1;c[b+56>>2]=e;c[b+52>>2]=n;h=n<<2;break}}else{h=0;do{c[e+(h<<2)>>2]=c[j+(h<<2)>>2];h=h+1|0}while((h|0)!=(i|0))}if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}a[b+60>>0]=1;c[b+56>>2]=e;c[b+52>>2]=n;h=n<<2}else{h=n<<2;e=c[b+56>>2]|0}while(0);mk(e+(m<<2)|0,0,h-(m<<2)|0)|0}c[b+48>>2]=n;m=c[b+68>>2]|0;if((m|0)<(n|0)){do if((c[b+72>>2]|0)<(n|0)){c[7182]=(c[7182]|0)+1;e=xb((n<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}i=c[b+68>>2]|0;j=c[b+76>>2]|0;if((i|0)<=0){if(!j){a[b+80>>0]=1;c[b+76>>2]=e;c[b+72>>2]=n;h=n<<2;break}}else{h=0;do{c[e+(h<<2)>>2]=c[j+(h<<2)>>2];h=h+1|0}while((h|0)!=(i|0))}if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}a[b+80>>0]=1;c[b+76>>2]=e;c[b+72>>2]=n;h=n<<2}else{h=n<<2;e=c[b+76>>2]|0}while(0);mk(e+(m<<2)|0,0,h-(m<<2)|0)|0}c[b+68>>2]=n;e=c[b+136>>2]|0;if((e|0)<=0){sa=q;return}i=c[b+76>>2]|0;j=c[b+56>>2]|0;h=0;do{g[i+(h<<2)>>2]=0.0;g[j+(h<<2)>>2]=0.0;h=h+1|0}while((h|0)!=(e|0));j=0;do{h=c[b+144>>2]|0;i=c[h+(j*284|0)+88>>2]|0;if(i){w=h+(j*284|0)+92|0;c[q+48>>2]=c[w>>2];c[q+48+4>>2]=c[w+4>>2];c[q+48+8>>2]=c[w+8>>2];c[q+48+12>>2]=c[w+12>>2];w=h+(j*284|0)+108|0;c[q+48+16>>2]=c[w>>2];c[q+48+16+4>>2]=c[w+4>>2];c[q+48+16+8>>2]=c[w+8>>2];c[q+48+16+12>>2]=c[w+12>>2];w=h+(j*284|0)+124|0;c[q+48+32>>2]=c[w>>2];c[q+48+32+4>>2]=c[w+4>>2];c[q+48+32+8>>2]=c[w+8>>2];c[q+48+32+12>>2]=c[w+12>>2];w=c[b+120>>2]|0;e=c[q+48+16+(w<<2)>>2]|0;y=c[q+48+32+(w<<2)>>2]|0;m=c[b+36>>2]|0;c[m+(j<<4)>>2]=c[q+48+(w<<2)>>2];c[m+(j<<4)+4>>2]=e;c[m+(j<<4)+8>>2]=y;g[m+(j<<4)+12>>2]=0.0;m=c[b+36>>2]|0;y=m+(j<<4)|0;z=+g[y>>2];e=h+(j*284|0)|0;f=+g[e>>2];w=m+(j<<4)+4|0;v=+g[w>>2];r=h+(j*284|0)+4|0;k=+g[r>>2];m=m+(j<<4)+8|0;s=+g[m>>2];n=h+(j*284|0)+8|0;u=+g[n>>2];l=z-f*(z*f+v*k+s*u);t=v-k*(z*f+v*k+s*u);u=s-u*(z*f+v*k+s*u);s=1.0/+x(+(u*u+(l*l+t*t)));g[y>>2]=l*s;g[w>>2]=t*s;g[m>>2]=u*s;k=+g[r>>2];v=+g[n>>2];f=+g[e>>2];e=c[b+16>>2]|0;g[e+(j<<4)>>2]=k*u*s-v*t*s;g[e+(j<<4)+4>>2]=v*l*s-u*s*f;g[e+(j<<4)+8>>2]=t*s*f-k*l*s;g[e+(j<<4)+12>>2]=0.0;e=c[b+16>>2]|0;n=e+(j<<4)|0;s=+g[n>>2];r=e+(j<<4)+4|0;l=+g[r>>2];e=e+(j<<4)+8|0;k=+g[e>>2];f=1.0/+x(+(s*s+l*l+k*k));g[n>>2]=s*f;g[r>>2]=l*f;g[e>>2]=k*f;e=c[b+116>>2]|0;r=c[b+36>>2]|0;f=+g[r+(j<<4)>>2];k=+g[r+(j<<4)+4>>2];l=+g[r+(j<<4)+8>>2];if(f*f+k*k+l*l>1.100000023841858)f=0.0;else{C=+g[h+(j*284|0)+16>>2];G=C-+g[e+52>>2];E=+g[h+(j*284|0)+20>>2];I=E-+g[e+56>>2];J=+g[h+(j*284|0)+24>>2];L=J-+g[e+60>>2];C=C-+g[i+52>>2];E=E-+g[i+56>>2];J=J-+g[i+60>>2];F=+g[e+332>>2];M=+g[e+336>>2];H=+g[e+328>>2];B=+g[i+332>>2];K=+g[i+336>>2];D=+g[i+328>>2];A=(l*I-k*L)*+g[e+4>>2]+(f*L-l*G)*+g[e+20>>2]+(k*G-f*I)*+g[e+36>>2];s=(l*I-k*L)*+g[e+8>>2]+(f*L-l*G)*+g[e+24>>2]+(k*G-f*I)*+g[e+40>>2];t=(l*I-k*L)*+g[e+12>>2]+(f*L-l*G)*+g[e+28>>2]+(k*G-f*I)*+g[e+44>>2];u=(E*-l-J*-k)*+g[i+4>>2]+(J*-f-C*-l)*+g[i+20>>2]+(C*-k-E*-f)*+g[i+36>>2];v=(E*-l-J*-k)*+g[i+8>>2]+(J*-f-C*-l)*+g[i+24>>2]+(C*-k-E*-f)*+g[i+40>>2];z=(E*-l-J*-k)*+g[i+12>>2]+(J*-f-C*-l)*+g[i+28>>2]+(C*-k-E*-f)*+g[i+44>>2];f=(f*(L*F-I*M+ +g[e+312>>2]-(J*B-E*K+ +g[i+312>>2]))+k*(+g[e+316>>2]+(G*M-L*H)-(+g[i+316>>2]+(C*K-J*D)))+l*(I*H-G*F+ +g[e+320>>2]-(E*D-C*B+ +g[i+320>>2])))*-.20000000298023224*(1.0/(+g[i+344>>2]+(+g[e+344>>2]+(A*A*+g[e+396>>2]+s*s*+g[e+400>>2]+t*t*+g[e+404>>2]))+(u*u*+g[i+396>>2]+v*v*+g[i+400>>2]+z*z*+g[i+404>>2])))}g[(c[b+76>>2]|0)+(j<<2)>>2]=f;e=c[b+136>>2]|0}j=j+1|0}while((j|0)<(e|0));if((e|0)<=0){sa=q;return}h=0;m=0;i=c[b+144>>2]|0;while(1){e=c[i+(m*284|0)+88>>2]|0;if(e){f=+g[i+(m*284|0)+252>>2];if(f!=0.0){f=f*d;e=i}else{M=+g[i+(m*284|0)+256>>2];M=M==0.0?0.0:M;y=c[b+116>>2]|0;w=c[b+16>>2]|0;G=+g[i+(m*284|0)+16>>2];E=+g[i+(m*284|0)+20>>2];A=+g[i+(m*284|0)+24>>2];v=+g[w+(m<<4)>>2];D=+g[w+(m<<4)+4>>2];f=+g[w+(m<<4)+8>>2];O=G-+g[y+52>>2];P=E-+g[y+56>>2];k=A-+g[y+60>>2];l=+g[y+264>>2]*(P*f-k*D)+ +g[y+280>>2]*(k*v-O*f)+(O*D-P*v)*+g[y+296>>2];Q=(P*f-k*D)*+g[y+268>>2]+(k*v-O*f)*+g[y+284>>2]+(O*D-P*v)*+g[y+300>>2];N=(P*f-k*D)*+g[y+272>>2]+(k*v-O*f)*+g[y+288>>2]+(O*D-P*v)*+g[y+304>>2];K=G-+g[e+52>>2];I=E-+g[e+56>>2];C=A-+g[e+60>>2];u=(D*K-v*I)*+g[e+296>>2]+(+g[e+264>>2]*(f*I-D*C)+ +g[e+280>>2]*(v*C-f*K));s=(f*I-D*C)*+g[e+268>>2]+(v*C-f*K)*+g[e+284>>2]+(D*K-v*I)*+g[e+300>>2];t=(f*I-D*C)*+g[e+272>>2]+(v*C-f*K)*+g[e+288>>2]+(D*K-v*I)*+g[e+304>>2];G=G-+g[y+52>>2];E=E-+g[y+56>>2];A=A-+g[y+60>>2];H=+g[y+332>>2];z=+g[y+336>>2];F=+g[y+328>>2];L=+g[e+332>>2];B=+g[e+336>>2];J=+g[e+328>>2];f=-(1.0/(+g[y+344>>2]+(f*(P*l-O*Q)+(v*(k*Q-P*N)+D*(O*N-k*l)))+(+g[e+344>>2]+(f*(I*u-K*s)+(v*(C*s-I*t)+D*(K*t-C*u)))))*((A*H-E*z+ +g[y+312>>2]-(C*L-I*B+ +g[e+312>>2]))*v+(+g[y+316>>2]+(G*z-A*F)-(+g[e+316>>2]+(K*B-C*J)))*D+(E*F-G*H+ +g[y+320>>2]-(I*J-K*L+ +g[e+320>>2]))*f));f=M>2]|0}y=(c[b+56>>2]|0)+(m<<2)|0;g[y>>2]=0.0;j=e+(m*284|0)+280|0;g[j>>2]=1.0;l=+g[i+(m*284|0)+276>>2]*d*+g[i+(m*284|0)+228>>2];g[y>>2]=f;f=f*.5;k=+g[(c[b+76>>2]|0)+(m<<2)>>2];if(f*f+k*k>l*l){Q=l/+x(+(f*f+k*k));g[j>>2]=Q*+g[j>>2];h=1}}else{g[(c[b+56>>2]|0)+(m<<2)>>2]=0.0;g[i+(m*284|0)+280>>2]=1.0;e=i}m=m+1|0;j=c[b+136>>2]|0;if((m|0)>=(j|0))break;else i=e}if(h&(j|0)>0){h=c[b+76>>2]|0;e=0;do{i=h+(e<<2)|0;if(+g[i>>2]!=0.0?(o=(c[b+144>>2]|0)+(e*284|0)+280|0,p=+g[o>>2],p<1.0):0){y=(c[b+56>>2]|0)+(e<<2)|0;g[y>>2]=p*+g[y>>2];g[i>>2]=+g[o>>2]*+g[i>>2]}e=e+1|0}while((e|0)!=(j|0))}if((j|0)<=0){sa=q;return}h=0;do{i=c[b+144>>2]|0;e=c[b+116>>2]|0;j=i+(h*284|0)+16|0;k=+g[j>>2]-+g[e+52>>2];m=i+(h*284|0)+20|0;l=+g[m>>2]-+g[e+56>>2];n=i+(h*284|0)+24|0;d=+g[n>>2]-+g[e+60>>2];g[q+48>>2]=k;g[q+48+4>>2]=l;g[q+48+8>>2]=d;g[q+48+12>>2]=0.0;f=+g[(c[b+56>>2]|0)+(h<<2)>>2];if(f!=0.0){y=c[b+16>>2]|0;P=f*+g[y+(h<<4)+4>>2];Q=f*+g[y+(h<<4)+8>>2];g[q+32>>2]=f*+g[y+(h<<4)>>2];g[q+32+4>>2]=P;g[q+32+8>>2]=Q;g[q+32+12>>2]=0.0;Bk(e,q+32|0,q+48|0)}f=+g[(c[b+76>>2]|0)+(h<<2)>>2];if(f!=0.0){y=c[(c[b+144>>2]|0)+(h*284|0)+88>>2]|0;P=+g[m>>2]-+g[y+56>>2];O=+g[n>>2]-+g[y+60>>2];g[q+32>>2]=+g[j>>2]-+g[y+52>>2];g[q+32+4>>2]=P;g[q+32+8>>2]=O;g[q+32+12>>2]=0.0;w=c[b+36>>2]|0;O=+g[w+(h<<4)>>2]*f;P=f*+g[w+(h<<4)+4>>2];Q=f*+g[w+(h<<4)+8>>2];g[q+16>>2]=O;g[q+16+4>>2]=P;g[q+16+8>>2]=Q;g[q+16+12>>2]=0.0;w=c[b+116>>2]|0;r=c[b+124>>2]|0;K=+g[w+4+(r<<2)>>2];L=+g[w+20+(r<<2)>>2];M=+g[w+36+(r<<2)>>2];N=(K*k+L*l+M*d)*(1.0-+g[i+(h*284|0)+244>>2]);g[q+48>>2]=k-K*N;g[q+48+4>>2]=l-L*N;g[q+48+8>>2]=d-M*N;Bk(w,q+16|0,q+48|0);g[q>>2]=-O;g[q+4>>2]=-P;g[q+8>>2]=-Q;g[q+12>>2]=0.0;Bk(y,q,q+32|0)}h=h+1|0}while((h|0)<(c[b+136>>2]|0));sa=q;return}function Ob(b,e,f,h,i,j,k){b=b|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0.0,m=0.0,n=0.0,o=0,p=0,q=0.0,r=0.0,s=0,t=0,u=0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0;u=sa;sa=sa+9824|0;o=j;p=o+36|0;do{c[o>>2]=0;o=o+4|0}while((o|0)<(p|0));c[u+9680>>2]=b;c[u+9680+4>>2]=f;F=+g[h>>2];L=+g[e>>2];E=+g[h+16>>2];K=+g[e+16>>2];D=+g[h+32>>2];J=+g[e+32>>2];I=+g[e+4>>2];H=+g[e+20>>2];G=+g[e+36>>2];z=+g[e+8>>2];w=+g[e+24>>2];l=+g[e+40>>2];C=+g[h+4>>2];B=+g[h+20>>2];A=+g[h+36>>2];y=+g[h+8>>2];v=+g[h+24>>2];m=+g[h+40>>2];g[u+9680+8>>2]=F*L+E*K+D*J;g[u+9680+12>>2]=F*I+E*H+D*G;g[u+9680+16>>2]=F*z+E*w+D*l;g[u+9680+20>>2]=0.0;g[u+9680+24>>2]=L*C+K*B+J*A;g[u+9680+28>>2]=I*C+H*B+G*A;g[u+9680+32>>2]=z*C+w*B+l*A;g[u+9680+36>>2]=0.0;g[u+9680+40>>2]=L*y+K*v+J*m;g[u+9680+44>>2]=I*y+H*v+G*m;g[u+9680+48>>2]=z*y+w*v+l*m;g[u+9680+52>>2]=0.0;N=+g[h+48>>2]-+g[e+48>>2];M=+g[h+52>>2]-+g[e+52>>2];q=+g[h+56>>2]-+g[e+56>>2];n=N*+g[e>>2]+M*+g[e+16>>2]+q*+g[e+32>>2];r=N*+g[e+4>>2]+M*+g[e+20>>2]+q*+g[e+36>>2];q=N*+g[e+8>>2]+M*+g[e+24>>2]+q*+g[e+40>>2];g[u+9680+56>>2]=F*L+E*K+D*J;g[u+9680+60>>2]=L*C+K*B+J*A;g[u+9680+64>>2]=L*y+K*v+J*m;g[u+9680+68>>2]=0.0;g[u+9680+72>>2]=F*I+E*H+D*G;g[u+9680+76>>2]=I*C+H*B+G*A;g[u+9680+80>>2]=I*y+H*v+G*m;g[u+9680+84>>2]=0.0;g[u+9680+88>>2]=F*z+E*w+D*l;g[u+9680+92>>2]=z*C+w*B+l*A;g[u+9680+96>>2]=z*y+w*v+l*m;g[u+9680+100>>2]=0.0;g[u+9680+104>>2]=n;g[u+9680+108>>2]=r;g[u+9680+112>>2]=q;g[u+9680+116>>2]=0.0;c[u+9680+120>>2]=k?82:81;c[u+9680+124>>2]=0;c[u+9296+364>>2]=0;c[u+9296+128>>2]=0;c[u+9296+128+4>>2]=0;c[u+9296+128+8>>2]=0;c[u+9296+128+12>>2]=0;c[u+9296+376>>2]=2;c[u+9296+368>>2]=0;g[u+9296+144>>2]=0.0;q=-+g[i+4>>2];r=-+g[i+8>>2];g[u+9808>>2]=-+g[i>>2];g[u+9808+4>>2]=q;g[u+9808+8>>2]=r;g[u+9808+12>>2]=0.0;switch(Rb(u+9296|0,u+9680|0,u+9808|0)|0){case 1:{c[u+9280>>2]=0;c[u+9280+4>>2]=0;c[u+9280+8>>2]=0;c[u+9280+12>>2]=0;c[u>>2]=9;c[u+9276>>2]=0;c[u+40>>2]=0;c[u+40+4>>2]=0;c[u+40+8>>2]=0;c[u+40+12>>2]=0;c[u+40+16>>2]=0;b=0;do{f=128-b+-1|0;c[u+2108+(f*56|0)+44>>2]=0;h=c[u+9288>>2]|0;c[u+2108+(f*56|0)+48>>2]=h;if(h|0)c[h+44>>2]=u+2108+(f*56|0);c[u+9288>>2]=u+2108+(f*56|0);b=b+1|0}while((b|0)!=128);c[u+9292>>2]=128;n=+g[i>>2];q=+g[i+4>>2];m=+g[i+8>>2];s=c[u+9296+372>>2]|0;do if((c[s+32>>2]|0)>>>0>1?dc(u+9296|0)|0:0){b=c[u+9280>>2]|0;if(b|0){o=c[u+9284>>2]|0;p=c[u+9292>>2]|0;do{f=b+44|0;k=b+48|0;h=c[k>>2]|0;if(h|0)c[h+44>>2]=c[f>>2];f=c[f>>2]|0;if(f|0)c[f+48>>2]=c[k>>2];if((c[u+9280>>2]|0)==(b|0))c[u+9280>>2]=c[k>>2];o=o+-1|0;c[b+44>>2]=0;c[k>>2]=c[u+9288>>2];f=c[u+9288>>2]|0;if(f|0)c[f+44>>2]=b;c[u+9288>>2]=b;p=p+1|0;b=c[u+9280>>2]|0}while((b|0)!=0);c[u+9284>>2]=o;c[u+9292>>2]=p}c[u>>2]=0;c[u+9276>>2]=0;b=c[s>>2]|0;f=c[s+12>>2]|0;N=+g[f+16>>2];F=+g[b+16>>2]-N;H=+g[f+20>>2];I=+g[b+20>>2]-H;K=+g[f+24>>2];L=+g[b+24>>2]-K;f=c[s+4>>2]|0;J=+g[f+16>>2]-N;M=+g[f+20>>2]-H;G=+g[f+24>>2]-K;h=c[s+8>>2]|0;N=+g[h+16>>2]-N;H=+g[h+20>>2]-H;K=+g[h+24>>2]-K;if(F*M*K+(I*G*N+L*J*H-F*G*H-I*J*K)-L*M*N<0.0){c[s>>2]=f;c[s+4>>2]=b;k=c[s+16>>2]|0;c[s+16>>2]=c[s+20>>2];c[s+20>>2]=k;k=f}else{k=b;b=f}k=de(u,k,b,h,1)|0;o=de(u,c[s+4>>2]|0,c[s>>2]|0,c[s+12>>2]|0,1)|0;p=de(u,c[s+8>>2]|0,c[s+4>>2]|0,c[s+12>>2]|0,1)|0;i=de(u,c[s>>2]|0,c[s+8>>2]|0,c[s+12>>2]|0,1)|0;if((c[u+9284>>2]|0)==4){f=c[u+9280>>2]|0;l=+g[f+16>>2];b=c[f+48>>2]|0;if(!b)b=f;else{m=l*l;while(1){l=+g[b+16>>2];h=l*l>2]|0;if(!b)break;else m=h?l*l:m}b=f;l=+g[f+16>>2]}n=+g[b>>2];r=+g[b+4>>2];q=+g[b+8>>2];m=+g[b+12>>2];O=c[b+20>>2]|0;f=c[b+24>>2]|0;h=c[b+28>>2]|0;a[k+52>>0]=0;c[k+32>>2]=o;a[o+52>>0]=0;c[o+32>>2]=k;a[k+53>>0]=0;c[k+36>>2]=p;a[p+52>>0]=1;c[p+32>>2]=k;a[k+54>>0]=0;c[k+40>>2]=i;a[i+52>>0]=2;c[i+32>>2]=k;a[o+53>>0]=2;c[o+36>>2]=i;a[i+54>>0]=1;c[i+40>>2]=o;a[o+54>>0]=1;c[o+40>>2]=p;a[p+53>>0]=2;c[p+36>>2]=o;a[p+54>>0]=1;c[p+40>>2]=i;a[i+53>>0]=2;c[i+36>>2]=p;c[u>>2]=0;i=b;s=0;o=O;p=f;k=h;while(1){f=c[u+9276>>2]|0;if(f>>>0>=64){t=45;break}c[u+9808>>2]=0;c[u+9808+4>>2]=0;c[u+9808+8>>2]=0;c[u+9276>>2]=f+1;s=s+1|0;a[i+55>>0]=s;h=i+4|0;O=i+8|0;Wg(u+9296|0,+g[i>>2],+g[h>>2],+g[O>>2],u+60+(f<<5)|0);if(!(+g[i>>2]*+g[u+60+(f<<5)+16>>2]+ +g[h>>2]*+g[u+60+(f<<5)+20>>2]+ +g[O>>2]*+g[u+60+(f<<5)+24>>2]-+g[i+16>>2]>9.999999747378752e-05)){b=7;t=44;break}b=0;do{h=Fg(u,s,u+60+(f<<5)|0,c[i+32+(b<<2)>>2]|0,d[i+52+b>>0]|0,u+9808|0)|0;b=b+1|0}while(h&b>>>0<3);if(!(h&(c[u+9808+8>>2]|0)>>>0>2)){b=4;t=44;break}h=c[u+9808>>2]|0;b=c[u+9808+4>>2]|0;a[h+53>>0]=2;c[h+36>>2]=b;a[b+54>>0]=1;c[b+40>>2]=h;b=i+44|0;h=i+48|0;f=c[h>>2]|0;if(f|0)c[f+44>>2]=c[b>>2];b=c[b>>2]|0;if(b|0)c[b+48>>2]=c[h>>2];if((c[u+9280>>2]|0)==(i|0))c[u+9280>>2]=c[h>>2];c[u+9284>>2]=(c[u+9284>>2]|0)+-1;c[i+44>>2]=0;c[h>>2]=c[u+9288>>2];b=c[u+9288>>2]|0;if(b|0)c[b+44>>2]=i;c[u+9288>>2]=i;c[u+9292>>2]=(c[u+9292>>2]|0)+1;f=c[u+9280>>2]|0;l=+g[f+16>>2];b=c[f+48>>2]|0;if(b){m=l*l;h=f;while(1){l=+g[b+16>>2];f=l*l>2]|0;if(!b)break;else m=f?l*l:m}f=h;l=+g[h+16>>2]}n=+g[f>>2];r=+g[f+4>>2];q=+g[f+8>>2];m=+g[f+12>>2];b=c[f+20>>2]|0;h=c[f+24>>2]|0;k=c[f+28>>2]|0;if(s>>>0>=255){f=k;break}else{i=f;o=b;p=h}}if((t|0)==44){c[u>>2]=b;b=o;h=p;f=k}else if((t|0)==45){c[u>>2]=6;b=o;h=p;f=k}J=n*l;H=r*l;N=q*l;g[u+40>>2]=n;g[u+44>>2]=r;g[u+48>>2]=q;g[u+52>>2]=m;g[u+56>>2]=l;c[u+36>>2]=3;c[u+4>>2]=b;c[u+8>>2]=h;c[u+12>>2]=f;O=h;K=+g[O+16>>2]-J;F=+g[O+20>>2]-H;I=+g[O+24>>2]-N;s=f;E=+g[s+16>>2]-J;G=+g[s+20>>2]-H;L=+g[s+24>>2]-N;L=+x(+((K*G-F*E)*(K*G-F*E)+((F*L-I*G)*(F*L-I*G)+(I*E-K*L)*(I*E-K*L))));g[u+20>>2]=L;K=+g[s+16>>2]-J;E=+g[s+20>>2]-H;I=+g[s+24>>2]-N;s=b;G=+g[s+16>>2]-J;F=+g[s+20>>2]-H;M=+g[s+24>>2]-N;M=+x(+((K*F-E*G)*(K*F-E*G)+((E*M-I*F)*(E*M-I*F)+(I*G-K*M)*(I*G-K*M))));g[u+24>>2]=M;K=+g[s+16>>2]-J;G=+g[s+20>>2]-H;I=+g[s+24>>2]-N;J=+g[O+16>>2]-J;H=+g[O+20>>2]-H;N=+g[O+24>>2]-N;N=+x(+((K*H-G*J)*(K*H-G*J)+((G*N-I*H)*(G*N-I*H)+(I*J-K*N)*(I*J-K*N))));g[u+20>>2]=L/(L+M+N);g[u+24>>2]=M/(L+M+N);g[u+28>>2]=N/(L+M+N);if((c[u>>2]|0)!=9)if(!(c[u+36>>2]|0)){n=0.0;m=0.0;l=0.0;break}else{k=u+36|0;t=54;break}c[j>>2]=3;O=0;sa=u;return O|0}else t=48}else t=48;while(0);if((t|0)==48){c[u>>2]=8;g[u+40>>2]=n;g[u+44>>2]=q;g[u+48>>2]=m;g[u+52>>2]=0.0;l=+x(+(n*n+q*q+m*m));if(l>0.0){g[u+40>>2]=1.0/l*n;g[u+44>>2]=1.0/l*q;g[u+48>>2]=1.0/l*m}else{c[u+40>>2]=1065353216;c[u+44>>2]=0;c[u+48>>2]=0}g[u+52>>2]=0.0;g[u+56>>2]=0.0;c[u+36>>2]=1;c[u+4>>2]=c[s>>2];g[u+20>>2]=1.0;k=u+36|0;t=54}if((t|0)==54){h=0;l=0.0;m=0.0;n=0.0;do{b=c[u+9680+120>>2]|0;O=c[u+9680+124>>2]|0;f=(c[u+9680>>2]|0)+(1?O>>1:O)|0;if(O&1)b=c[(c[f>>2]|0)+b>>2]|0;Za[b&127](u+9808|0,f,c[u+4+(h<<2)>>2]|0);N=+g[u+20+(h<<2)>>2];l=l+ +g[u+9808>>2]*N;m=m+N*+g[u+9808+4>>2];n=n+N*+g[u+9808+8>>2];h=h+1|0}while(h>>>0<(c[k>>2]|0)>>>0)}c[j>>2]=1;N=l*+g[e+16>>2]+m*+g[e+20>>2]+n*+g[e+24>>2]+ +g[e+52>>2];K=l*+g[e+32>>2]+m*+g[e+36>>2]+n*+g[e+40>>2]+ +g[e+56>>2];g[j+4>>2]=l*+g[e>>2]+m*+g[e+4>>2]+n*+g[e+8>>2]+ +g[e+48>>2];g[j+8>>2]=N;g[j+12>>2]=K;g[j+16>>2]=0.0;K=+g[u+40>>2];N=+g[u+56>>2];L=+g[u+44>>2];M=+g[u+48>>2];F=l-K*N;G=m-N*L;H=n-N*M;I=F*+g[e+16>>2]+G*+g[e+20>>2]+H*+g[e+24>>2]+ +g[e+52>>2];J=F*+g[e+32>>2]+G*+g[e+36>>2]+H*+g[e+40>>2]+ +g[e+56>>2];g[j+20>>2]=F*+g[e>>2]+G*+g[e+4>>2]+H*+g[e+8>>2]+ +g[e+48>>2];g[j+24>>2]=I;g[j+28>>2]=J;g[j+32>>2]=0.0;g[j+36>>2]=-K;g[j+40>>2]=-L;g[j+44>>2]=-M;g[j+48>>2]=0.0;g[j+52>>2]=-N;O=1;sa=u;return O|0}case 2:{c[j>>2]=2;O=0;sa=u;return O|0}default:{O=0;sa=u;return O|0}}return 0}function Pb(b){b=b|0;var d=0.0,e=0,f=0,h=0.0,i=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0;t=sa;sa=sa+176|0;if(!(a[b+738>>0]|0)){sa=t;return}g[b+36>>2]=0.0;g[b+744>>2]=0.0;if(!(a[b+736>>0]|0)){e=c[b+28>>2]|0;i=+g[b+600>>2];k=+g[b+604>>2];p=+g[b+608>>2];r=i*+g[e+20>>2]+k*+g[e+24>>2]+p*+g[e+28>>2]+ +g[e+56>>2];f=c[b+32>>2]|0;l=+g[b+664>>2];m=+g[b+668>>2];q=+g[b+672>>2];s=l*+g[f+20>>2]+m*+g[f+24>>2]+q*+g[f+28>>2]+ +g[f+56>>2];n=l*+g[f+36>>2]+m*+g[f+40>>2]+q*+g[f+44>>2]+ +g[f+60>>2];o=i*+g[e+4>>2]+k*+g[e+8>>2]+p*+g[e+12>>2]+ +g[e+52>>2];p=i*+g[e+36>>2]+k*+g[e+40>>2]+p*+g[e+44>>2]+ +g[e+60>>2];q=l*+g[f+4>>2]+m*+g[f+8>>2]+q*+g[f+12>>2]+ +g[f+52>>2];if((q-o)*(q-o)+(s-r)*(s-r)+(n-p)*(n-p)>1.1920928955078125e-07){h=1.0/+x(+((q-o)*(q-o)+(s-r)*(s-r)+(n-p)*(n-p)));g[t>>2]=(q-o)*h;g[t+4>>2]=(s-r)*h;g[t+8>>2]=(n-p)*h;c[t+12>>2]=0;i=(n-p)*h;d=(s-r)*h;h=(q-o)*h}else{c[t>>2]=1065353216;c[t+4>>2]=0;c[t+8>>2]=0;g[t+12>>2]=0.0;i=0.0;d=0.0;h=1.0}if(+w(+i)>.7071067690849304){v=i*i+d*d;u=1.0/+x(+v);i=-(i*u);k=d*u;m=-(h*k);l=h*i;d=v*u;h=k;k=0.0}else{u=h*h+d*d;l=1.0/+x(+u);k=-(d*l);v=h*l;m=i*k;l=u*l;d=-(i*v);h=0.0;i=v}g[t+16>>2]=k;g[t+20>>2]=i;g[t+24>>2]=h;g[t+32>>2]=d;g[t+36>>2]=m;g[t+40>>2]=l;e=c[b+28>>2]|0;c[t+128>>2]=c[e+4>>2];c[t+128+4>>2]=c[e+20>>2];c[t+128+8>>2]=c[e+36>>2];g[t+128+12>>2]=0.0;c[t+128+16>>2]=c[e+8>>2];c[t+128+20>>2]=c[e+24>>2];c[t+128+24>>2]=c[e+40>>2];g[t+128+28>>2]=0.0;c[t+128+32>>2]=c[e+12>>2];c[t+128+36>>2]=c[e+28>>2];c[t+128+40>>2]=c[e+44>>2];g[t+128+44>>2]=0.0;f=c[b+32>>2]|0;c[t+80>>2]=c[f+4>>2];c[t+80+4>>2]=c[f+20>>2];c[t+80+8>>2]=c[f+36>>2];g[t+80+12>>2]=0.0;c[t+80+16>>2]=c[f+8>>2];c[t+80+20>>2]=c[f+24>>2];c[t+80+24>>2]=c[f+40>>2];g[t+80+28>>2]=0.0;c[t+80+32>>2]=c[f+12>>2];c[t+80+36>>2]=c[f+28>>2];c[t+80+40>>2]=c[f+44>>2];g[t+80+44>>2]=0.0;v=r-+g[e+56>>2];u=p-+g[e+60>>2];g[t+64>>2]=o-+g[e+52>>2];g[t+64+4>>2]=v;g[t+64+8>>2]=u;g[t+64+12>>2]=0.0;u=s-+g[f+56>>2];v=n-+g[f+60>>2];g[t+48>>2]=q-+g[f+52>>2];g[t+48+4>>2]=u;g[t+48+8>>2]=v;g[t+48+12>>2]=0.0;fg(b+48|0,t+128|0,t+80|0,t+64|0,t+48|0,t,e+396|0,+g[e+344>>2],f+396|0,+g[f+344>>2]);f=c[b+28>>2]|0;c[t+128>>2]=c[f+4>>2];c[t+128+4>>2]=c[f+20>>2];c[t+128+8>>2]=c[f+36>>2];g[t+128+12>>2]=0.0;c[t+128+16>>2]=c[f+8>>2];c[t+128+20>>2]=c[f+24>>2];c[t+128+24>>2]=c[f+40>>2];g[t+128+28>>2]=0.0;c[t+128+32>>2]=c[f+12>>2];c[t+128+36>>2]=c[f+28>>2];c[t+128+40>>2]=c[f+44>>2];g[t+128+44>>2]=0.0;e=c[b+32>>2]|0;c[t+80>>2]=c[e+4>>2];c[t+80+4>>2]=c[e+20>>2];c[t+80+8>>2]=c[e+36>>2];g[t+80+12>>2]=0.0;c[t+80+16>>2]=c[e+8>>2];c[t+80+20>>2]=c[e+24>>2];c[t+80+24>>2]=c[e+40>>2];g[t+80+28>>2]=0.0;c[t+80+32>>2]=c[e+12>>2];c[t+80+36>>2]=c[e+28>>2];c[t+80+40>>2]=c[e+44>>2];g[t+80+44>>2]=0.0;v=r-+g[f+56>>2];u=p-+g[f+60>>2];g[t+64>>2]=o-+g[f+52>>2];g[t+64+4>>2]=v;g[t+64+8>>2]=u;g[t+64+12>>2]=0.0;u=s-+g[e+56>>2];v=n-+g[e+60>>2];g[t+48>>2]=q-+g[e+52>>2];g[t+48+4>>2]=u;g[t+48+8>>2]=v;g[t+48+12>>2]=0.0;fg(b+132|0,t+128|0,t+80|0,t+64|0,t+48|0,t+16|0,f+396|0,+g[f+344>>2],e+396|0,+g[e+344>>2]);e=c[b+28>>2]|0;c[t+128>>2]=c[e+4>>2];c[t+128+4>>2]=c[e+20>>2];c[t+128+8>>2]=c[e+36>>2];g[t+128+12>>2]=0.0;c[t+128+16>>2]=c[e+8>>2];c[t+128+20>>2]=c[e+24>>2];c[t+128+24>>2]=c[e+40>>2];g[t+128+28>>2]=0.0;c[t+128+32>>2]=c[e+12>>2];c[t+128+36>>2]=c[e+28>>2];c[t+128+40>>2]=c[e+44>>2];g[t+128+44>>2]=0.0;f=c[b+32>>2]|0;c[t+80>>2]=c[f+4>>2];c[t+80+4>>2]=c[f+20>>2];c[t+80+8>>2]=c[f+36>>2];g[t+80+12>>2]=0.0;c[t+80+16>>2]=c[f+8>>2];c[t+80+20>>2]=c[f+24>>2];c[t+80+24>>2]=c[f+40>>2];g[t+80+28>>2]=0.0;c[t+80+32>>2]=c[f+12>>2];c[t+80+36>>2]=c[f+28>>2];c[t+80+40>>2]=c[f+44>>2];g[t+80+44>>2]=0.0;v=r-+g[e+56>>2];u=p-+g[e+60>>2];g[t+64>>2]=o-+g[e+52>>2];g[t+64+4>>2]=v;g[t+64+8>>2]=u;g[t+64+12>>2]=0.0;u=s-+g[f+56>>2];v=n-+g[f+60>>2];g[t+48>>2]=q-+g[f+52>>2];g[t+48+4>>2]=u;g[t+48+8>>2]=v;g[t+48+12>>2]=0.0;fg(b+216|0,t+128|0,t+80|0,t+64|0,t+48|0,t+32|0,e+396|0,+g[e+344>>2],f+396|0,+g[f+344>>2])}e=c[b+560>>2]|0;f=c[b+576>>2]|0;p=+g[b+592>>2];if(+w(+p)>.7071067690849304){v=(c[j>>2]=f,+g[j>>2]);o=1.0/+x(+(p*p+v*v));n=(c[j>>2]=e,+g[j>>2]);d=n;h=v;i=n*-(p*o);k=(p*p+v*v)*o;l=0.0;m=o*v;n=-(o*v*n);o=-(p*o)}else{o=(c[j>>2]=e,+g[j>>2]);n=(c[j>>2]=f,+g[j>>2]);v=1.0/+x(+(o*o+n*n));d=o;h=n;i=(o*o+n*n)*v;k=-(p*v*o);l=-(v*n);m=0.0;n=p*-(v*n);o=v*o}e=c[b+28>>2]|0;Q=+g[e+4>>2];K=+g[e+8>>2];D=+g[e+12>>2];H=l*Q+o*K+m*D;P=+g[e+20>>2];B=+g[e+24>>2];I=+g[e+28>>2];z=l*P+o*B+m*I;O=+g[e+36>>2];q=+g[e+40>>2];F=+g[e+44>>2];M=l*O+o*q+m*F;E=k*Q+n*K+i*D;G=k*P+n*B+i*I;J=k*O+n*q+i*F;r=Q*d+K*h+p*D;u=P*d+B*h+p*I;h=O*d+q*h+p*F;f=c[b+32>>2]|0;A=+g[f+4>>2];y=+g[f+20>>2];i=+g[f+36>>2];n=+g[f+8>>2];o=+g[f+24>>2];s=+g[f+40>>2];l=+g[f+12>>2];p=+g[f+28>>2];L=+g[f+44>>2];c[b+300>>2]=0;c[b+300+4>>2]=0;c[b+300+8>>2]=0;c[b+300+12>>2]=0;g[b+316>>2]=H*Q+z*P+M*O;g[b+320>>2]=H*K+z*B+M*q;g[b+324>>2]=H*D+z*I+M*F;g[b+328>>2]=0.0;g[b+332>>2]=A*-H+y*-z+i*-M;g[b+336>>2]=n*-H+o*-z+s*-M;g[b+340>>2]=l*-H+p*-z+L*-M;g[b+344>>2]=0.0;k=(H*Q+z*P+M*O)*+g[e+396>>2];d=(H*K+z*B+M*q)*+g[e+400>>2];C=(H*D+z*I+M*F)*+g[e+404>>2];g[b+348>>2]=k;g[b+352>>2]=d;g[b+356>>2]=C;g[b+360>>2]=0.0;m=(A*-H+y*-z+i*-M)*+g[f+396>>2];v=(n*-H+o*-z+s*-M)*+g[f+400>>2];N=(l*-H+p*-z+L*-M)*+g[f+404>>2];g[b+364>>2]=m;g[b+368>>2]=v;g[b+372>>2]=N;g[b+376>>2]=0.0;g[b+380>>2]=(H*Q+z*P+M*O)*k+(H*K+z*B+M*q)*d+(H*D+z*I+M*F)*C+((A*-H+y*-z+i*-M)*m+(n*-H+o*-z+s*-M)*v+(l*-H+p*-z+L*-M)*N);N=+g[e+4>>2];M=+g[e+20>>2];L=+g[e+36>>2];p=+g[e+8>>2];l=+g[e+24>>2];z=+g[e+40>>2];H=+g[e+12>>2];v=+g[e+28>>2];s=+g[e+44>>2];o=+g[f+4>>2];n=+g[f+20>>2];m=+g[f+36>>2];i=+g[f+8>>2];y=+g[f+24>>2];A=+g[f+40>>2];C=+g[f+12>>2];F=+g[f+28>>2];I=+g[f+44>>2];c[b+384>>2]=0;c[b+384+4>>2]=0;c[b+384+8>>2]=0;c[b+384+12>>2]=0;g[b+400>>2]=E*N+G*M+J*L;g[b+404>>2]=E*p+G*l+J*z;g[b+408>>2]=E*H+G*v+J*s;g[b+412>>2]=0.0;g[b+416>>2]=o*-E+n*-G+m*-J;g[b+420>>2]=i*-E+y*-G+A*-J;g[b+424>>2]=C*-E+F*-G+I*-J;g[b+428>>2]=0.0;d=(E*N+G*M+J*L)*+g[e+396>>2];D=(E*p+G*l+J*z)*+g[e+400>>2];q=(E*H+G*v+J*s)*+g[e+404>>2];g[b+432>>2]=d;g[b+436>>2]=D;g[b+440>>2]=q;g[b+444>>2]=0.0;k=(o*-E+n*-G+m*-J)*+g[f+396>>2];B=(i*-E+y*-G+A*-J)*+g[f+400>>2];K=(C*-E+F*-G+I*-J)*+g[f+404>>2];g[b+448>>2]=k;g[b+452>>2]=B;g[b+456>>2]=K;g[b+460>>2]=0.0;g[b+464>>2]=(E*N+G*M+J*L)*d+(E*p+G*l+J*z)*D+(E*H+G*v+J*s)*q+((o*-E+n*-G+m*-J)*k+(i*-E+y*-G+A*-J)*B+(C*-E+F*-G+I*-J)*K);K=+g[e+4>>2];J=+g[e+20>>2];I=+g[e+36>>2];G=+g[e+8>>2];F=+g[e+24>>2];E=+g[e+40>>2];C=+g[e+12>>2];B=+g[e+28>>2];A=+g[e+44>>2];y=+g[f+4>>2];i=+g[f+20>>2];k=+g[f+36>>2];m=+g[f+8>>2];n=+g[f+24>>2];o=+g[f+40>>2];q=+g[f+12>>2];s=+g[f+28>>2];v=+g[f+44>>2];c[b+468>>2]=0;c[b+468+4>>2]=0;c[b+468+8>>2]=0;c[b+468+12>>2]=0;g[b+484>>2]=r*K+u*J+h*I;g[b+488>>2]=r*G+u*F+h*E;g[b+492>>2]=r*C+u*B+h*A;g[b+496>>2]=0.0;g[b+500>>2]=y*-r+i*-u+k*-h;g[b+504>>2]=m*-r+n*-u+o*-h;g[b+508>>2]=q*-r+s*-u+v*-h;g[b+512>>2]=0.0;H=(r*K+u*J+h*I)*+g[e+396>>2];D=(r*G+u*F+h*E)*+g[e+400>>2];z=(r*C+u*B+h*A)*+g[e+404>>2];g[b+516>>2]=H;g[b+520>>2]=D;g[b+524>>2]=z;g[b+528>>2]=0.0;l=(y*-r+i*-u+k*-h)*+g[f+396>>2];p=(m*-r+n*-u+o*-h)*+g[f+400>>2];d=(q*-r+s*-u+v*-h)*+g[f+404>>2];g[b+532>>2]=l;g[b+536>>2]=p;g[b+540>>2]=d;g[b+544>>2]=0.0;g[b+548>>2]=(r*K+u*J+h*I)*H+(r*G+u*F+h*E)*D+(r*C+u*B+h*A)*z+((y*-r+i*-u+k*-h)*l+(m*-r+n*-u+o*-h)*p+(q*-r+s*-u+v*-h)*d);g[b+724>>2]=0.0;d=+ui(b,e+4|0,f+4|0);g[b+728>>2]=d;g[b+708>>2]=0.0;g[b+712>>2]=0.0;a[b+716>>0]=0;h=+g[b+692>>2];do if(h>=0.0){d=(d-+g[b+688>>2])%6.2831854820251465;if(!(d<-3.1415927410125732)){if(d>3.1415927410125732)d=d+-6.2831854820251465}else d=d+6.2831854820251465;if(d<-h){a[b+716>>0]=1;g[b+708>>2]=-(h+d);g[b+712>>2]=1.0;break}if(d>h){a[b+716>>0]=1;g[b+708>>2]=h-d;g[b+712>>2]=-1.0}}while(0);e=c[b+28>>2]|0;M=+g[b+560>>2];N=+g[b+576>>2];Q=+g[b+592>>2];O=M*+g[e+4>>2]+N*+g[e+8>>2]+Q*+g[e+12>>2];P=M*+g[e+20>>2]+N*+g[e+24>>2]+Q*+g[e+28>>2];Q=M*+g[e+36>>2]+N*+g[e+40>>2]+Q*+g[e+44>>2];f=c[b+32>>2]|0;g[b+720>>2]=1.0/(O*(O*+g[e+264>>2]+P*+g[e+280>>2]+Q*+g[e+296>>2])+P*(O*+g[e+268>>2]+P*+g[e+284>>2]+Q*+g[e+300>>2])+Q*(O*+g[e+272>>2]+P*+g[e+288>>2]+Q*+g[e+304>>2])+(O*(O*+g[f+264>>2]+P*+g[f+280>>2]+Q*+g[f+296>>2])+P*(O*+g[f+268>>2]+P*+g[f+284>>2]+Q*+g[f+300>>2])+Q*(O*+g[f+272>>2]+P*+g[f+288>>2]+Q*+g[f+304>>2])));sa=t;return}function Qb(b,d){b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;t=sa;sa=sa+16|0;Ki(16393);j=c[b+212>>2]|0;i=c[b+180>>2]|0;if((i|0)<(j|0)){if((c[b+184>>2]|0)<(j|0)){if(!j){e=0;h=i}else{c[7182]=(c[7182]|0)+1;e=xb((j<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+180>>2]|0}if((h|0)>0){f=0;do{c[e+(f<<2)>>2]=c[(c[b+188>>2]|0)+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0))}f=c[b+188>>2]|0;if(f|0){if(a[b+192>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+188>>2]=0}a[b+192>>0]=1;c[b+188>>2]=e;c[b+184>>2]=j;f=b+188|0}else f=b+188|0;e=i;do{c[(c[f>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=(j|0))}else f=b+188|0;c[b+180>>2]=j;e=0;while(1){if((e|0)>=(Fa[c[(c[b>>2]|0)+104>>2]&127](b)|0))break;c[(c[f>>2]|0)+(e<<2)>>2]=c[(c[b+220>>2]|0)+(e<<2)>>2];e=e+1|0}e=c[b+180>>2]|0;if((e|0)>1)hg(b+176|0,0,e+-1|0);if(!(Fa[c[(c[b>>2]|0)+104>>2]&127](b)|0))e=0;else e=c[f>>2]|0;h=c[b+196>>2]|0;r=c[b+180>>2]|0;s=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;c[h+4>>2]=d;c[h+12>>2]=e;c[h+16>>2]=r;c[h+20>>2]=s;e=c[h+32>>2]|0;if((e|0)<0){if((c[h+36>>2]|0)<0){f=c[h+40>>2]|0;if(f|0){if(a[h+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[h+40>>2]=0}a[h+44>>0]=1;c[h+40>>2]=0;c[h+36>>2]=0}do{c[(c[h+40>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[h+32>>2]=0;e=c[h+52>>2]|0;if((e|0)<0){if((c[h+56>>2]|0)<0){f=c[h+60>>2]|0;if(f|0){if(a[h+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[h+60>>2]=0}a[h+64>>0]=1;c[h+60>>2]=0;c[h+56>>2]=0}do{c[(c[h+60>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[h+52>>2]=0;e=c[h+72>>2]|0;if((e|0)<0){if((c[h+76>>2]|0)<0){f=c[h+80>>2]|0;if(f|0){if(a[h+84>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[h+80>>2]=0}a[h+84>>0]=1;c[h+80>>2]=0;c[h+76>>2]=0}do{c[(c[h+80>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[h+72>>2]=0;s=c[b+200>>2]|0;e=c[(c[s>>2]|0)+8>>2]|0;p=c[b+8>>2]|0;r=c[b+24>>2]|0;r=Fa[c[(c[r>>2]|0)+36>>2]&127](r)|0;Za[e&127](s,p,r);r=c[b+204>>2]|0;p=c[b+24>>2]|0;s=c[b+196>>2]|0;Ki(18225);e=c[r+28>>2]|0;if((e|0)<0){if((c[r+32>>2]|0)<0){f=c[r+36>>2]|0;if(f|0){if(a[r+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[r+36>>2]=0}a[r+40>>0]=1;c[r+36>>2]=0;c[r+32>>2]=0}do{c[(c[r+36>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[r+28>>2]=0;j=c[r+8>>2]|0;if((j|0)>0){k=c[r+16>>2]|0;i=0;do{l=k+(i<<3)|0;e=c[l>>2]|0;if((e|0)!=(i|0)){c[l>>2]=c[k+(e<<3)>>2];e=c[k+(e<<3)>>2]|0;f=c[k+(e<<3)>>2]|0;if((e|0)!=(f|0)){h=k+(e<<3)|0;do{e=k+(f<<3)|0;c[h>>2]=c[e>>2];e=c[e>>2]|0;h=k+(e<<3)|0;f=c[h>>2]|0}while((e|0)!=(f|0))}}else e=i;c[l>>2]=e;i=i+1|0}while((i|0)!=(j|0));if((j|0)>1){Qi(r+4|0,0,j+-1|0);m=c[r+8>>2]|0}else m=j;if((m|0)>0){n=c[r+16>>2]|0;k=0;while(1){o=c[n+(k<<3)>>2]|0;e=k+1|0;a:do if((e|0)<(m|0)){f=k;h=e;while(1){if((c[n+(h<<3)>>2]|0)!=(o|0)){e=h;break a}e=h+1|0;if((e|0)<(m|0)){f=h;h=e}else{f=h;break}}}else f=k;while(0);b:do if((k|0)<=(f|0)){l=c[b+16>>2]|0;h=1;j=k;while(1){i=c[l+(c[n+(j<<3)+4>>2]<<2)>>2]|0;if((c[i+208>>2]|0)==(o|0)){i=c[i+216>>2]|0;h=(i|0)!=4&(h&(i|0)!=1)}if((j|0)<(f|0))j=j+1|0;else break}if(h){h=k;while(1){i=c[l+(c[n+(h<<3)+4>>2]<<2)>>2]|0;do if((c[i+208>>2]|0)==(o|0)){if((c[i+216>>2]&-2|0)==4)break;c[i+216>>2]=2}while(0);if((h|0)>=(f|0))break b;h=h+1|0}}else{h=k;while(1){i=c[l+(c[n+(h<<3)+4>>2]<<2)>>2]|0;do if((c[i+208>>2]|0)==(o|0)){if((c[i+216>>2]|0)!=2)break;c[i+216>>2]=3;g[i+220>>2]=0.0}while(0);if((h|0)>=(f|0))break b;h=h+1|0}}}while(0);if((e|0)<(m|0))k=e;else break}}}k=Fa[c[(c[p>>2]|0)+36>>2]&127](p)|0;if((k|0)>0){j=0;do{l=Ha[c[(c[p>>2]|0)+40>>2]&31](p,j)|0;h=c[l+740>>2]|0;i=c[l+744>>2]|0;if((h|0)!=0?(c[h+216>>2]|0)!=2:0){e=c[h+204>>2]|0;if(!(e&2))f=111;else f=106}else f=101;if(((f|0)==101?(f=0,i|0):0)?(c[i+216>>2]|0)!=2:0){e=c[h+204>>2]|0;if((e&2|0)!=0?(c[h+216>>2]|0)!=2:0)f=106;else f=111}if((f|0)==106)if((e&4|0)==0?(c[i+204>>2]&3|0)==0:0){if((c[i+216>>2]&-2|0)!=4)c[i+216>>2]=1;g[i+220>>2]=0.0;f=111}else f=111;if((f|0)==111){o=c[i+204>>2]|0;if(o&2|0?((o&4|e&3|0)==0?(c[i+216>>2]|0)!=2:0):0){if((c[h+216>>2]&-2|0)!=4)c[h+216>>2]=1;g[h+220>>2]=0.0}if(a[r+64>>0]|0?Ja[c[(c[p>>2]|0)+28>>2]&63](p,h,i)|0:0){f=c[r+28>>2]|0;if((f|0)==(c[r+32>>2]|0)?(q=(f|0)==0?1:f<<1,(f|0)<(q|0)):0){if(!q)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((q<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[r+28>>2]|0}if((f|0)>0){h=0;do{c[e+(h<<2)>>2]=c[(c[r+36>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0))}h=c[r+36>>2]|0;if(h){if(a[r+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);f=c[r+28>>2]|0}c[r+36>>2]=0}a[r+40>>0]=1;c[r+36>>2]=e;c[r+32>>2]=q;e=f}else e=f;c[(c[r+36>>2]|0)+(e<<2)>>2]=l;c[r+28>>2]=e+1}}j=j+1|0}while((j|0)<(k|0))}e=c[3084]|0;q=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=q;do if(!q){if(c[e+4>>2]|0){la(t|0,0)|0;q=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[t+4>>2]|0)-(c[q+4>>2]|0)+(((c[t>>2]|0)-(c[q>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(c[e+16>>2]|0)break;e=c[3084]|0}c[3084]=c[e+20>>2]}while(0);q=c[r+8>>2]|0;Ki(18253);if(a[r+64>>0]|0){p=c[r+28>>2]|0;if((p|0)>1)cg(r+24|0,0,p+-1|0);if((q|0)>0){e=0;j=1;o=0;while(1){f=c[r+16>>2]|0;n=c[f+(e<<3)>>2]|0;c:do if((e|0)<(q|0)){m=1;k=c[r+48>>2]|0;h=c[r+52>>2]|0;while(1){l=c[(c[b+16>>2]|0)+(c[f+(e<<3)+4>>2]<<2)>>2]|0;do if((k|0)==(h|0)){k=(h|0)==0?1:h<<1;if((h|0)>=(k|0)){f=h;break}if(!k)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((k<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[r+48>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[r+56>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[r+56>>2]|0;if(i){if(a[r+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[r+48>>2]|0}c[r+56>>2]=0}a[r+60>>0]=1;c[r+56>>2]=f;c[r+52>>2]=k;f=h;h=k}else f=k;while(0);c[(c[r+56>>2]|0)+(f<<2)>>2]=l;k=f+1|0;c[r+48>>2]=k;i=c[l+216>>2]|0;i=m&((i|0)==5|(i|0)==2);e=e+1|0;if((e|0)>=(q|0)){m=e;break c}f=c[r+16>>2]|0;if((c[f+(e<<3)>>2]|0)!=(n|0)){m=e;break}else m=i}}else{m=e;i=1}while(0);if((o|0)<(p|0)){k=c[r+36>>2]|0;l=k+(o<<2)|0;f=c[l>>2]|0;e=c[(c[f+740>>2]|0)+208>>2]|0;if((e|0)<=-1)e=c[(c[f+744>>2]|0)+208>>2]|0;if((e|0)==(n|0)){e=o+1|0;d:do if((e|0)<(p|0))do{h=c[k+(e<<2)>>2]|0;f=c[(c[h+740>>2]|0)+208>>2]|0;if((f|0)<=-1)f=c[(c[h+744>>2]|0)+208>>2]|0;if((n|0)!=(f|0))break d;e=e+1|0}while((e|0)<(p|0));while(0);f=l;h=e-o|0;j=e}else{f=0;h=0}}else{f=0;h=0}if(!i)gb[c[(c[s>>2]|0)+8>>2]&7](s,c[r+56>>2]|0,c[r+48>>2]|0,f,h,n);o=(h|0)==0?o:j;e=c[r+48>>2]|0;if((e|0)<0){if((c[r+52>>2]|0)<0){f=c[r+56>>2]|0;if(f|0){if(a[r+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[r+56>>2]=0}a[r+60>>0]=1;c[r+56>>2]=0;c[r+52>>2]=0}do{c[(c[r+56>>2]|0)+(e<<2)>>2]=0;e=e+1|0}while((e|0)!=0)}c[r+48>>2]=0;if((m|0)>=(q|0))break;else e=m}}}else{q=Fa[c[(c[p>>2]|0)+44>>2]&127](p)|0;r=Fa[c[(c[p>>2]|0)+36>>2]&127](p)|0;gb[c[(c[s>>2]|0)+8>>2]&7](s,c[b+16>>2]|0,c[b+8>>2]|0,q,r,-1)}e=c[3084]|0;s=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=s;do if(!s){if(c[e+4>>2]|0){la(t|0,0)|0;s=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[t+4>>2]|0)-(c[s+4>>2]|0)+(((c[t>>2]|0)-(c[s>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(c[e+16>>2]|0)break;e=c[3084]|0}c[3084]=c[e+20>>2]}while(0);wg(c[b+196>>2]|0);e=c[b+200>>2]|0;Za[c[(c[e>>2]|0)+16>>2]&127](e,d,c[b+72>>2]|0);e=c[3084]|0;d=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=d;if(d|0){sa=t;return}do if(c[e+4>>2]|0){la(t|0,0)|0;d=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[t+4>>2]|0)-(c[d+4>>2]|0)+(((c[t>>2]|0)-(c[d>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[e+16>>2]|0)){e=c[3084]|0;break}else{sa=t;return}}while(0);c[3084]=c[e+20>>2];sa=t;return} -function Rb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0.0,G=0.0,H=0.0,I=0,J=0,K=0;J=sa;sa=sa+112|0;c[a+348>>2]=a+220;c[a+352>>2]=a+252;c[a+356>>2]=a+284;c[a+360>>2]=a+316;c[a+364>>2]=4;c[a+368>>2]=0;c[a+376>>2]=0;E=c[b+4>>2]|0;c[a>>2]=c[b>>2];c[a+4>>2]=E;c[a+8>>2]=c[b+8>>2];c[a+8+4>>2]=c[b+8+4>>2];c[a+8+8>>2]=c[b+8+8>>2];c[a+8+12>>2]=c[b+8+12>>2];c[a+24>>2]=c[b+24>>2];c[a+24+4>>2]=c[b+24+4>>2];c[a+24+8>>2]=c[b+24+8>>2];c[a+24+12>>2]=c[b+24+12>>2];c[a+40>>2]=c[b+40>>2];c[a+40+4>>2]=c[b+40+4>>2];c[a+40+8>>2]=c[b+40+8>>2];c[a+40+12>>2]=c[b+40+12>>2];c[a+56>>2]=c[b+56>>2];c[a+56+4>>2]=c[b+56+4>>2];c[a+56+8>>2]=c[b+56+8>>2];c[a+56+12>>2]=c[b+56+12>>2];c[a+72>>2]=c[b+72>>2];c[a+72+4>>2]=c[b+72+4>>2];c[a+72+8>>2]=c[b+72+8>>2];c[a+72+12>>2]=c[b+72+12>>2];c[a+88>>2]=c[b+88>>2];c[a+88+4>>2]=c[b+88+4>>2];c[a+88+8>>2]=c[b+88+8>>2];c[a+88+12>>2]=c[b+88+12>>2];c[a+104>>2]=c[b+104>>2];c[a+104+4>>2]=c[b+104+4>>2];c[a+104+8>>2]=c[b+104+8>>2];c[a+104+12>>2]=c[b+104+12>>2];E=c[b+124>>2]|0;c[a+120>>2]=c[b+120>>2];c[a+124>>2]=E;g[a+144>>2]=0.0;c[a+180>>2]=0;c[a+128>>2]=c[d>>2];c[a+128+4>>2]=c[d+4>>2];c[a+128+8>>2]=c[d+8>>2];c[a+128+12>>2]=c[d+12>>2];e=+g[a+128>>2];f=+g[a+132>>2];h=+g[a+136>>2];if(e*e+f*f+h*h>0.0){g[a+164>>2]=0.0;c[a+364>>2]=3;c[a+148>>2]=a+316;c[a+180>>2]=1;Wg(a,-e,-f,-h,a+316|0);b=a+148|0;d=a+164|0}else{g[a+164>>2]=0.0;c[a+364>>2]=3;c[a+148>>2]=a+316;c[a+180>>2]=1;Wg(a,1.0,0.0,0.0,a+316|0);b=a+148|0;d=a+164|0}g[d>>2]=1.0;E=(c[b>>2]|0)+16|0;c[a+128>>2]=c[E>>2];c[a+128+4>>2]=c[E+4>>2];c[a+128+8>>2]=c[E+8>>2];c[a+128+12>>2]=c[E+12>>2];c[J+16+48>>2]=c[E>>2];c[J+16+48+4>>2]=c[E+4>>2];c[J+16+48+8>>2]=c[E+8>>2];c[J+16+48+12>>2]=c[E+12>>2];c[J+16+32>>2]=c[E>>2];c[J+16+32+4>>2]=c[E+4>>2];c[J+16+32+8>>2]=c[E+8>>2];c[J+16+32+12>>2]=c[E+12>>2];c[J+16+16>>2]=c[E>>2];c[J+16+16+4>>2]=c[E+4>>2];c[J+16+16+8>>2]=c[E+8>>2];c[J+16+16+12>>2]=c[E+12>>2];c[J+16>>2]=c[E>>2];c[J+16+4>>2]=c[E+4>>2];c[J+16+8>>2]=c[E+8>>2];c[J+16+12>>2]=c[E+12>>2];E=0;F=0.0;e=e*e+f*f+h*h;D=0;C=c[a+368>>2]|0;f=+g[a+128>>2];k=+g[a+132>>2];h=+g[a+136>>2];a:while(1){b=1-C|0;o=a+148+(C*36|0)|0;l=+x(+(f*f+k*k+h*h));if(l<9.999999747378752e-05){I=6;break}q=a+148+(C*36|0)+32|0;i=c[q>>2]|0;g[a+148+(C*36|0)+16+(i<<2)>>2]=0.0;d=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=d;d=c[a+348+(d<<2)>>2]|0;c[a+148+(C*36|0)+(i<<2)>>2]=d;c[q>>2]=i+1;Wg(a,-f,-k,-h,d);d=c[q>>2]|0;i=c[a+148+(C*36|0)+(d+-1<<2)>>2]|0;f=+g[i+16>>2];h=+g[i+20>>2];k=+g[i+24>>2];z=f-+g[J+16>>2];A=h-+g[J+16+4>>2];B=k-+g[J+16+8>>2];if(z*z+A*A+B*B<9.999999747378752e-05){I=9;break}z=f-+g[J+16+16>>2];A=h-+g[J+16+20>>2];B=k-+g[J+16+24>>2];if(z*z+A*A+B*B<9.999999747378752e-05){I=9;break}z=f-+g[J+16+32>>2];A=h-+g[J+16+36>>2];B=k-+g[J+16+40>>2];if(z*z+A*A+B*B<9.999999747378752e-05){I=9;break}z=f-+g[J+16+48>>2];A=h-+g[J+16+52>>2];B=k-+g[J+16+56>>2];if(z*z+A*A+B*B<9.999999747378752e-05){I=9;break}D=D+1&3;p=J+16+(D<<4)|0;c[p>>2]=c[i+16>>2];c[p+4>>2]=c[i+16+4>>2];c[p+8>>2]=c[i+16+8>>2];c[p+12>>2]=c[i+16+12>>2];B=(+g[a+128>>2]*f+ +g[a+132>>2]*h+ +g[a+136>>2]*k)/l;F=B>F?B:F;if(l-F-l*9.999999747378752e-05<=0.0){I=10;break}c[J+80>>2]=0;b:do switch(d|0){case 2:{p=c[o>>2]|0;o=c[a+148+(C*36|0)+4>>2]|0;e=+g[o+16>>2];f=+g[p+16>>2];h=+g[o+20>>2];k=+g[p+20>>2];l=+g[o+24>>2];m=+g[p+24>>2];if(!((e-f)*(e-f)+(h-k)*(h-k)+(l-m)*(l-m)>0.0)){I=46;break a}n=-(f*(e-f)+k*(h-k)+m*(l-m))/((e-f)*(e-f)+(h-k)*(h-k)+(l-m)*(l-m));if(n>=1.0){g[J>>2]=0.0;g[J+4>>2]=1.0;c[J+80>>2]=2;e=e*e+h*h+l*l;break b}if(!(n<=0.0)){g[J+4>>2]=n;g[J>>2]=1.0-n;c[J+80>>2]=3;e=(m+(l-m)*n)*(m+(l-m)*n)+((f+(e-f)*n)*(f+(e-f)*n)+(k+(h-k)*n)*(k+(h-k)*n));break b}else{g[J>>2]=1.0;g[J+4>>2]=0.0;c[J+80>>2]=1;e=f*f+k*k+m*m;break b}}case 3:{e=+od((c[o>>2]|0)+16|0,(c[a+148+(C*36|0)+4>>2]|0)+16|0,(c[a+148+(C*36|0)+8>>2]|0)+16|0,J,J+80|0);break}case 4:{d=c[o>>2]|0;i=c[a+148+(C*36|0)+4>>2]|0;o=c[a+148+(C*36|0)+8>>2]|0;p=c[a+148+(C*36|0)+12>>2]|0;r=+g[d+16>>2];s=+g[p+16>>2];t=+g[d+20>>2];u=+g[p+20>>2];v=+g[d+24>>2];w=+g[p+24>>2];f=+g[i+16>>2];h=+g[i+20>>2];k=+g[i+24>>2];y=+g[o+16>>2];z=+g[o+20>>2];A=+g[o+24>>2];B=(r-s)*(h-u)*(A-w)+((t-u)*(k-w)*(y-s)+(v-w)*(f-s)*(z-u)-(r-s)*(k-w)*(z-u)-(t-u)*(f-s)*(A-w))-(v-w)*(h-u)*(y-s);if(!(B==B&0.0==0.0&B!=0.0&B*(v*((t-h)*(f-y)-(r-f)*(h-z))+(r*((v-k)*(h-z)-(t-h)*(k-A))+t*((r-f)*(k-A)-(v-k)*(f-y))))<=0.0)){I=46;break a}c[J+88>>2]=0;c[J+88+4>>2]=0;c[J+88+8>>2]=0;c[J+84>>2]=0;if(B*(((t-u)*(k-w)-(v-w)*(h-u))*s+u*((v-w)*(f-s)-(r-s)*(k-w))+((r-s)*(h-u)-(t-u)*(f-s))*w)>0.0){e=+od(d+16|0,i+16|0,p+16|0,J+88|0,J+84|0);K=c[J+84>>2]|0;c[J+80>>2]=K&2|K<<1&8|K&1;c[J>>2]=c[J+88>>2];c[J+4>>2]=c[J+88+4>>2];g[J+8>>2]=0.0;c[J+12>>2]=c[J+88+8>>2];l=+g[p+16>>2];m=+g[p+20>>2];n=+g[p+24>>2]}else{e=-1.0;l=s;m=u;n=w}if(B*(((h-u)*(A-w)-(k-w)*(z-u))*l+m*((k-w)*(y-s)-(A-w)*(f-s))+((z-u)*(f-s)-(h-u)*(y-s))*n)>0.0?(G=+od(i+16|0,o+16|0,p+16|0,J+88|0,J+84|0),e<0.0|G>2]=c[J+84>>2]<<1&14;c[J+4>>2]=c[J+88>>2];c[J+8>>2]=c[J+88+4>>2];g[J>>2]=0.0;c[J+12>>2]=c[J+88+8>>2];e=G}if(B*(((z-u)*(v-w)-(A-w)*(t-u))*+g[p+16>>2]+ +g[p+20>>2]*((A-w)*(r-s)-(v-w)*(y-s))+((t-u)*(y-s)-(z-u)*(r-s))*+g[p+24>>2])>0.0?(H=+od(o+16|0,d+16|0,p+16|0,J+88|0,J+84|0),e<0.0|H>2]|0;c[J+80>>2]=(1?K>>>1:K)&1|K<<1&8|K<<2&4;c[J+8>>2]=c[J+88>>2];c[J>>2]=c[J+88+4>>2];g[J+4>>2]=0.0;c[J+12>>2]=c[J+88+8>>2];e=H}if(e<0.0){c[J+80>>2]=15;r=+g[o+20>>2];A=+g[i+24>>2];z=+g[p+16>>2];m=+g[o+24>>2];y=+g[i+16>>2];s=+g[p+20>>2];n=+g[o+16>>2];w=+g[p+24>>2];u=+g[i+20>>2];g[J>>2]=(r*A*z+m*y*s-s*A*n-r*y*w+w*n*u-z*m*u)/B;e=+g[d+20>>2];t=+g[d+24>>2];v=+g[d+16>>2];g[J+4>>2]=(e*m*z+t*n*s-s*m*v-e*n*w+w*v*r-z*t*r)/B;g[J+8>>2]=(u*t*z+A*v*s-s*t*y-u*v*w+w*y*e-z*A*e)/B;g[J+12>>2]=1.0-((r*A*z+m*y*s-s*A*n-r*y*w+w*n*u-z*m*u)/B+(e*m*z+t*n*s-s*m*v-e*n*w+w*v*r-z*t*r)/B+(u*t*z+A*v*s-s*t*y-u*v*w+w*y*e-z*A*e)/B);e=0.0}break}default:{}}while(0);if(!(e>=0.0)){I=46;break}c[a+148+(b*36|0)+32>>2]=0;c[a+128>>2]=0;c[a+128+4>>2]=0;c[a+128+8>>2]=0;c[a+128+12>>2]=0;c[a+368>>2]=b;p=c[q>>2]|0;q=c[J+80>>2]|0;if(p){d=a+148+(C*36|0)|0;i=c[d>>2]|0;if(!(q&1)){K=c[a+364>>2]|0;c[a+364>>2]=K+1;c[a+348+(K<<2)>>2]=i;h=0.0;k=0.0;f=0.0}else{K=c[a+148+(b*36|0)+32>>2]|0;c[a+148+(b*36|0)+(K<<2)>>2]=i;o=c[J>>2]|0;c[a+148+(b*36|0)+32>>2]=K+1;c[a+148+(b*36|0)+16+(K<<2)>>2]=o;K=c[d>>2]|0;f=(c[j>>2]=o,+g[j>>2]);k=+g[K+20>>2]*f;h=+g[K+24>>2]*f;f=+g[K+16>>2]*f+ +g[a+128>>2];g[a+128>>2]=f;k=k+ +g[a+132>>2];g[a+132>>2]=k;h=h+ +g[a+136>>2];g[a+136>>2]=h}if((p|0)!=1){o=1;do{d=a+148+(C*36|0)+(o<<2)|0;i=c[d>>2]|0;if(!(q&1<>2]|0;c[a+364>>2]=K+1;c[a+348+(K<<2)>>2]=i}else{K=c[a+148+(b*36|0)+32>>2]|0;c[a+148+(b*36|0)+(K<<2)>>2]=i;i=c[J+(o<<2)>>2]|0;c[a+148+(b*36|0)+32>>2]=K+1;c[a+148+(b*36|0)+16+(K<<2)>>2]=i;K=c[d>>2]|0;f=(c[j>>2]=i,+g[j>>2]);k=+g[K+20>>2]*f;h=+g[K+24>>2]*f;f=+g[K+16>>2]*f+ +g[a+128>>2];g[a+128>>2]=f;k=k+ +g[a+132>>2];g[a+132>>2]=k;h=h+ +g[a+136>>2];g[a+136>>2]=h}o=o+1|0}while((o|0)!=(p|0))}}else{h=0.0;k=0.0;f=0.0}if((q|0)==15)c[a+376>>2]=1;E=E+1|0;if(E>>>0>=128){I=45;break}d=c[a+376>>2]|0;if(d|0)break;else C=b}if((I|0)==6){c[a+376>>2]=1;b=C;I=48}else if((I|0)==9){b=c[a+368>>2]|0;E=(c[a+148+(b*36|0)+32>>2]|0)+-1|0;c[a+148+(b*36|0)+32>>2]=E;E=c[a+148+(b*36|0)+(E<<2)>>2]|0;K=c[a+364>>2]|0;c[a+364>>2]=K+1;c[a+348+(K<<2)>>2]=E;I=48}else if((I|0)==10){b=c[a+368>>2]|0;E=(c[a+148+(b*36|0)+32>>2]|0)+-1|0;c[a+148+(b*36|0)+32>>2]=E;E=c[a+148+(b*36|0)+(E<<2)>>2]|0;K=c[a+364>>2]|0;c[a+364>>2]=K+1;c[a+348+(K<<2)>>2]=E;I=48}else if((I|0)==45){c[a+376>>2]=2;c[a+372>>2]=a+148+(b*36|0);K=2;sa=J;return K|0}else if((I|0)==46){b=c[a+368>>2]|0;E=(c[a+148+(b*36|0)+32>>2]|0)+-1|0;c[a+148+(b*36|0)+32>>2]=E;E=c[a+148+(b*36|0)+(E<<2)>>2]|0;K=c[a+364>>2]|0;c[a+364>>2]=K+1;c[a+348+(K<<2)>>2]=E;I=48}if((I|0)==48)d=c[a+376>>2]|0;c[a+372>>2]=a+148+(b*36|0);switch(d|0){case 0:{F=+g[a+128>>2];G=+g[a+132>>2];H=+g[a+136>>2];g[a+144>>2]=+x(+(F*F+G*G+H*H));K=0;sa=J;return K|0}case 1:{g[a+144>>2]=0.0;K=1;sa=J;return K|0}default:{K=d;sa=J;return K|0}}return 0}function Sb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0,G=0,H=0;q=sa;sa=sa+144|0;l=c[b+48>>2]|0;j=c[b+52>>2]|0;if((j|0?(k=c[j+20>>2]|0,k|0):0)?(Fa[c[(c[k>>2]|0)+48>>2]&127](k)|0)&1|0:0){c[q>>2]=1065353216;c[q+4>>2]=1065353216;c[q+8>>2]=0;g[q+12>>2]=0.0;k=c[b+8>>2]|0;p=c[(c[b+52>>2]|0)+20>>2]|0;o=c[(c[p>>2]|0)+8>>2]|0;r=+g[d>>2];A=+g[d+4>>2];s=+g[d+8>>2];y=+g[k+20>>2];t=+g[k+24>>2];B=+g[k+28>>2];u=+g[k+36>>2];D=+g[k+40>>2];v=+g[k+44>>2];w=+g[k+52>>2];C=+g[k+56>>2];z=+g[k+60>>2];g[q+120>>2]=r*+g[k+4>>2]+A*+g[k+8>>2]+s*+g[k+12>>2]+w;g[q+120+4>>2]=r*y+A*t+s*B+C;g[q+120+8>>2]=r*u+A*D+s*v+z;g[q+120+12>>2]=0.0;s=+g[d+16>>2];A=+g[d+20>>2];r=+g[d+24>>2];g[q+96>>2]=w+(s*+g[k+4>>2]+A*+g[k+8>>2]+r*+g[k+12>>2]);g[q+96+4>>2]=C+(y*s+t*A+B*r);g[q+96+8>>2]=z+(u*s+D*A+v*r);g[q+96+12>>2]=0.0;ab[o&127](p,q+120|0,q+96|0,q);p=c[(c[b+52>>2]|0)+20>>2]|0;o=c[(c[p>>2]|0)+8>>2]|0;r=+g[d+16>>2];v=+g[d+20>>2];A=+g[d+24>>2];D=+g[k+20>>2];s=+g[k+24>>2];u=+g[k+28>>2];z=+g[k+36>>2];B=+g[k+40>>2];t=+g[k+44>>2];y=+g[k+52>>2];C=+g[k+56>>2];w=+g[k+60>>2];g[q+120>>2]=r*+g[k+4>>2]+v*+g[k+8>>2]+A*+g[k+12>>2]+y;g[q+120+4>>2]=r*D+v*s+A*u+C;g[q+120+8>>2]=r*z+v*B+A*t+w;g[q+120+12>>2]=0.0;A=+g[d+32>>2];v=+g[d+36>>2];r=+g[d+40>>2];g[q+96>>2]=y+(A*+g[k+4>>2]+v*+g[k+8>>2]+r*+g[k+12>>2]);g[q+96+4>>2]=C+(D*A+s*v+u*r);g[q+96+8>>2]=w+(z*A+B*v+t*r);g[q+96+12>>2]=0.0;ab[o&127](p,q+120|0,q+96|0,q);p=c[(c[b+52>>2]|0)+20>>2]|0;o=c[(c[p>>2]|0)+8>>2]|0;r=+g[d+32>>2];t=+g[d+36>>2];v=+g[d+40>>2];B=+g[k+20>>2];A=+g[k+24>>2];z=+g[k+28>>2];w=+g[k+36>>2];u=+g[k+40>>2];s=+g[k+44>>2];D=+g[k+52>>2];C=+g[k+56>>2];y=+g[k+60>>2];g[q+120>>2]=r*+g[k+4>>2]+t*+g[k+8>>2]+v*+g[k+12>>2]+D;g[q+120+4>>2]=r*B+t*A+v*z+C;g[q+120+8>>2]=r*w+t*u+v*s+y;g[q+120+12>>2]=0.0;v=+g[d>>2];t=+g[d+4>>2];r=+g[d+8>>2];g[q+96>>2]=D+(v*+g[k+4>>2]+t*+g[k+8>>2]+r*+g[k+12>>2]);g[q+96+4>>2]=C+(B*v+A*t+z*r);g[q+96+8>>2]=y+(w*v+u*t+s*r);g[q+96+12>>2]=0.0;ab[o&127](p,q+120|0,q+96|0,q)}j=((10?(e<<21|f)+~(f<<15)>>10:(e<<21|f)+~(f<<15)|0)^(e<<21|f)+~(f<<15))*9|0;j=(6?j>>6:j)^j;j=(c[b+108>>2]|0)+-1&((16?j+~(j<<11)>>16:j+~(j<<11)|0)^j+~(j<<11));a:do if(j>>>0<(c[b+64>>2]|0)>>>0?(h=c[(c[b+72>>2]|0)+(j<<2)>>2]|0,(h|0)!=-1):0){j=c[b+132>>2]|0;while(1){if((e<<21|f|0)==(c[j+(h<<2)>>2]|0))break;h=c[(c[b+92>>2]|0)+(h<<2)>>2]|0;if((h|0)==-1)break a}j=c[b+112>>2]|0;if(j+(h<<3)|0){o=c[j+(h<<3)+4>>2]|0;p=c[b+8>>2]|0;c[o+8>>2]=c[(c[p+192>>2]|0)+8>>2];n=c[b+4>>2]|0;m=c[n+192>>2]|0;c[q>>2]=0;c[q+4>>2]=m;c[q+8>>2]=n;c[q+12>>2]=n+4;c[q+16>>2]=-1;c[q+20>>2]=-1;c[q+120>>2]=0;c[q+120+4>>2]=o;c[q+120+8>>2]=p;c[q+120+12>>2]=p+4;c[q+120+16>>2]=e;c[q+120+20>>2]=f;p=Ka[c[(c[l>>2]|0)+8>>2]&31](l,q,q+120|0,0)|0;eb[c[(c[p>>2]|0)+8>>2]&31](p,q,q+120|0,c[b+52>>2]|0,c[b+44>>2]|0);Pa[c[c[p>>2]>>2]&511](p);Va[c[(c[l>>2]|0)+60>>2]&127](l,p);sa=q;return}}while(0);t=+g[d+16>>2];E=+g[d>>2];u=+g[d+20>>2];r=+g[d+4>>2];v=+g[d+24>>2];s=+g[d+8>>2];w=+g[d+32>>2];z=+g[d+36>>2];B=+g[d+40>>2];y=(u-r)*(B-s)-(v-s)*(z-r);A=(v-s)*(w-E)-(t-E)*(B-s);C=(t-E)*(z-r)-(u-r)*(w-E);D=1.0/+x(+(C*C+(y*y+A*A)));g[q>>2]=E+y*D*.05999999865889549;g[q+4>>2]=r+A*D*.05999999865889549;g[q+8>>2]=s+C*D*.05999999865889549;g[q+12>>2]=0.0;g[q+16>>2]=t+y*D*.05999999865889549;g[q+20>>2]=u+A*D*.05999999865889549;g[q+24>>2]=v+C*D*.05999999865889549;g[q+28>>2]=0.0;g[q+32>>2]=w+y*D*.05999999865889549;g[q+36>>2]=z+A*D*.05999999865889549;g[q+40>>2]=B+C*D*.05999999865889549;g[q+44>>2]=0.0;g[q+48>>2]=E-y*D*.05999999865889549;g[q+52>>2]=r-A*D*.05999999865889549;g[q+56>>2]=s-C*D*.05999999865889549;g[q+60>>2]=0.0;g[q+64>>2]=t-y*D*.05999999865889549;g[q+68>>2]=u-A*D*.05999999865889549;g[q+72>>2]=v-C*D*.05999999865889549;g[q+76>>2]=0.0;g[q+80>>2]=w-y*D*.05999999865889549;g[q+84>>2]=z-A*D*.05999999865889549;g[q+88>>2]=B-C*D*.05999999865889549;g[q+92>>2]=0.0;c[7182]=(c[7182]|0)+1;h=xb(131)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}Af(h,q,6,16);p=c[b+8>>2]|0;c[h+8>>2]=c[(c[p+192>>2]|0)+8>>2];o=c[b+4>>2]|0;d=c[o+192>>2]|0;c[q+120>>2]=0;c[q+120+4>>2]=d;c[q+120+8>>2]=o;c[q+120+12>>2]=o+4;c[q+120+16>>2]=-1;c[q+120+20>>2]=-1;c[q+96>>2]=0;c[q+96+4>>2]=h;c[q+96+8>>2]=p;c[q+96+12>>2]=p+4;c[q+96+16>>2]=e;c[q+96+20>>2]=f;p=Ka[c[(c[l>>2]|0)+8>>2]&31](l,q+120|0,q+96|0,0)|0;eb[c[(c[p>>2]|0)+8>>2]&31](p,q+120|0,q+96|0,c[b+52>>2]|0,c[b+44>>2]|0);Pa[c[c[p>>2]>>2]&511](p);Va[c[(c[l>>2]|0)+60>>2]&127](l,p);p=((10?(e<<21|f)+~(f<<15)>>10:(e<<21|f)+~(f<<15)|0)^(e<<21|f)+~(f<<15))*9|0;p=(6?p>>6:p)^p;p=(16?p+~(p<<11)>>16:p+~(p<<11)|0)^p+~(p<<11);l=c[b+108>>2]|0;b:do if((p&l+-1)>>>0<(c[b+64>>2]|0)>>>0?(i=c[(c[b+72>>2]|0)+((p&l+-1)<<2)>>2]|0,(i|0)!=-1):0){j=c[b+132>>2]|0;while(1){if((e<<21|f|0)==(c[j+(i<<2)>>2]|0))break;i=c[(c[b+92>>2]|0)+(i<<2)>>2]|0;if((i|0)==-1){m=20;break b}}b=c[b+112>>2]|0;c[b+(i<<3)>>2]=e<<21|f;c[b+(i<<3)+4>>2]=h}else m=20;while(0);if((m|0)==20){o=c[b+104>>2]|0;if((o|0)==(l|0)){d=(l|0)==0?1:l<<1;if((l|0)<(d|0)){if(!d){i=0;k=l}else{c[7182]=(c[7182]|0)+1;i=xb((d<<3|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}k=c[b+104>>2]|0}if((k|0)>0){j=0;do{H=(c[b+112>>2]|0)+(j<<3)|0;G=c[H+4>>2]|0;F=i+(j<<3)|0;c[F>>2]=c[H>>2];c[F+4>>2]=G;j=j+1|0}while((j|0)!=(k|0))}j=c[b+112>>2]|0;if(j|0){if(a[b+116>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[b+112>>2]=0}a[b+116>>0]=1;c[b+112>>2]=i;c[b+108>>2]=d;i=c[b+104>>2]|0}else i=l}else i=o;H=c[b+112>>2]|0;c[H+(i<<3)>>2]=e<<21|f;c[H+(i<<3)+4>>2]=h;c[b+104>>2]=(c[b+104>>2]|0)+1;h=c[b+124>>2]|0;if((h|0)==(c[b+128>>2]|0)?(n=(h|0)==0?1:h<<1,(h|0)<(n|0)):0){if(!n)k=0;else{c[7182]=(c[7182]|0)+1;h=xb((n<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}k=h;h=c[b+124>>2]|0}j=c[b+132>>2]|0;if((h|0)<=0)if(!j)i=b+136|0;else m=45;else{i=0;do{c[k+(i<<2)>>2]=c[j+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0));m=45}if((m|0)==45){if(a[b+136>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[b+132>>2]=0;i=b+136|0;h=c[b+124>>2]|0}a[i>>0]=1;c[b+132>>2]=k;c[b+128>>2]=n}c[(c[b+132>>2]|0)+(h<<2)>>2]=e<<21|f;c[b+124>>2]=(c[b+124>>2]|0)+1;m=c[b+108>>2]|0;if((l|0)<(m|0)){n=c[b+64>>2]|0;if((n|0)<(m|0)){do if((c[b+68>>2]|0)<(m|0)){if(!m){h=0;j=n}else{c[7182]=(c[7182]|0)+1;h=xb((m<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[b+64>>2]|0}k=c[b+72>>2]|0;if((j|0)<=0){if(!k){a[b+76>>0]=1;c[b+72>>2]=h;c[b+68>>2]=m;l=b+72|0;break}}else{i=0;do{c[h+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(j|0))}if(a[b+76>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}a[b+76>>0]=1;c[b+72>>2]=h;c[b+68>>2]=m;l=b+72|0}else{l=b+72|0;h=c[b+72>>2]|0}while(0);mk(h+(n<<2)|0,0,(m<<2)-(n<<2)|0)|0;c[b+64>>2]=m;d=c[b+84>>2]|0;if((d|0)<(m|0)){do if((c[b+88>>2]|0)<(m|0)){if(!m){h=0;j=d}else{c[7182]=(c[7182]|0)+1;h=xb((m<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[b+84>>2]|0}k=c[b+92>>2]|0;if((j|0)<=0){if(!k){a[b+96>>0]=1;c[b+92>>2]=h;c[b+88>>2]=m;break}}else{i=0;do{c[h+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(j|0))}if(a[b+96>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}a[b+96>>0]=1;c[b+92>>2]=h;c[b+88>>2]=m}else h=c[b+92>>2]|0;while(0);mk(h+(d<<2)|0,0,(m<<2)-(d<<2)|0)|0}c[b+84>>2]=m;if((m|0)>0){mk(c[l>>2]|0,-1,m<<2|0)|0;mk(c[b+92>>2]|0,-1,m<<2|0)|0}if((n|0)>0){k=c[b+132>>2]|0;i=c[l>>2]|0;j=c[b+92>>2]|0;h=0;do{H=c[k+(h<<2)>>2]|0;H=((10?H+~(H<<15)>>10:H+~(H<<15)|0)^H+~(H<<15))*9|0;H=(6?H>>6:H)^H;H=i+((((16?H+~(H<<11)>>16:H+~(H<<11)|0)^H+~(H<<11))&(c[b+108>>2]|0)+-1)<<2)|0;c[j+(h<<2)>>2]=c[H>>2];c[H>>2]=h;h=h+1|0}while((h|0)!=(n|0))}}h=p&(c[b+108>>2]|0)+-1}else h=p&l+-1;H=(c[b+72>>2]|0)+(h<<2)|0;c[(c[b+92>>2]|0)+(o<<2)>>2]=c[H>>2];c[H>>2]=o}sa=q;return}function Tb(b,d,e,f,h,i,j){b=b|0;d=d|0;e=e|0;f=f|0;h=+h;i=+i;j=j|0;var k=0,l=0.0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0,aa=0;W=sa;sa=sa+48|0;a[W+16+16>>0]=1;V=W+16+12|0;c[V>>2]=0;c[W+16+4>>2]=0;c[W+16+8>>2]=0;o=c[f+4>>2]|0;if((o|0)>0){c[7182]=(c[7182]|0)+1;k=xb((o<<4|3)+16|0)|0;if(!k)n=0;else{c[(k+4+15&-16)+-4>>2]=k;n=k+4+15&-16}m=c[W+16+4>>2]|0;if((m|0)>0){k=0;do{U=n+(k<<4)|0;T=(c[V>>2]|0)+(k<<4)|0;c[U>>2]=c[T>>2];c[U+4>>2]=c[T+4>>2];c[U+8>>2]=c[T+8>>2];c[U+12>>2]=c[T+12>>2];k=k+1|0}while((k|0)!=(m|0))}k=c[V>>2]|0;if(k|0){if(a[W+16+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[V>>2]=0}a[W+16+16>>0]=1;c[V>>2]=n;c[W+16+8>>2]=o}m=c[d+28>>2]|0;if((m|0)>0){U=c[d+36>>2]|0;w=+g[e>>2];v=+g[e+4>>2];s=+g[e+8>>2];u=+g[e+16>>2];r=+g[e+20>>2];q=+g[e+24>>2];t=+g[e+32>>2];p=+g[e+36>>2];l=+g[e+40>>2];y=+g[b>>2];z=+g[b+4>>2];A=+g[b+8>>2];T=-1;x=3402823466385288598117041.0e14;k=0;while(1){B=+g[U+(k*36|0)+20>>2];C=+g[U+(k*36|0)+24>>2];D=+g[U+(k*36|0)+28>>2];n=(B*w+C*v+D*s)*y+(B*u+C*r+D*q)*z+(B*t+C*p+D*l)*A=0){K=c[U+(T*36|0)+4>>2]|0;if((K|0)>0){L=U+(T*36|0)+12|0;M=U+(T*36|0)+20|0;N=U+(T*36|0)+24|0;O=U+(T*36|0)+28|0;k=0;J=W+16|0;I=f;while(1){G=c[L>>2]|0;F=c[G+(k<<2)>>2]|0;f=c[d+16>>2]|0;H=k+1|0;G=c[G+(((H|0)==(K|0)?0:H)<<2)>>2]|0;Y=+g[f+(F<<4)>>2];Z=Y-+g[f+(G<<4)>>2];X=+g[f+(F<<4)+4>>2];_=X-+g[f+(G<<4)+4>>2];x=+g[f+(F<<4)+8>>2];A=x-+g[f+(G<<4)+8>>2];y=Z*w+_*v+A*s;z=Z*u+_*r+A*q;A=Z*t+_*p+A*l;_=+g[M>>2];Z=+g[N>>2];D=+g[O>>2];B=w*_+v*Z+s*D;C=u*_+r*Z+q*D;D=t*_+p*Z+l*D;x=(Y*w+X*v+x*s+ +g[e+48>>2])*-(z*D-A*C)+(Y*u+X*r+x*q+ +g[e+52>>2])*-(A*B-y*D)+(Y*t+X*p+x*l+ +g[e+56>>2])*-(y*C-z*B);G=I;f=J;k=c[G+4>>2]|0;if((k|0)>=2){n=c[G+12>>2]|0;p=+g[n+(k+-1<<4)>>2];q=+g[n+(k+-1<<4)+4>>2];r=+g[n+(k+-1<<4)+8>>2];m=0;l=p*-(z*D-A*C)+q*-(A*B-y*D)+r*-(y*C-z*B)-x;while(1){u=+g[n+(m<<4)>>2];v=+g[n+(m<<4)+4>>2];w=+g[n+(m<<4)+8>>2];F=c[n+(m<<4)+12>>2]|0;t=u*-(z*D-A*C)+v*-(A*B-y*D)+w*-(y*C-z*B)-x;do if(l<0.0)if(t<0.0){o=c[f+4>>2]|0;if((o|0)==(c[f+8>>2]|0)?(P=(o|0)==0?1:o<<1,(o|0)<(P|0)):0){if(!P)n=0;else{c[7182]=(c[7182]|0)+1;n=xb((P<<4|3)+16|0)|0;if(!n)n=0;else{c[(n+4+15&-16)+-4>>2]=n;n=n+4+15&-16}o=c[f+4>>2]|0}if((o|0)>0){E=0;do{$=n+(E<<4)|0;aa=(c[f+12>>2]|0)+(E<<4)|0;c[$>>2]=c[aa>>2];c[$+4>>2]=c[aa+4>>2];c[$+8>>2]=c[aa+8>>2];c[$+12>>2]=c[aa+12>>2];E=E+1|0}while((E|0)!=(o|0))}o=c[f+12>>2]|0;if(o|0){if(a[f+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}c[f+12>>2]=0}a[f+16>>0]=1;c[f+12>>2]=n;c[f+8>>2]=P;n=c[f+4>>2]|0}else n=o;E=c[f+12>>2]|0;g[E+(n<<4)>>2]=u;g[E+(n<<4)+4>>2]=v;g[E+(n<<4)+8>>2]=w;c[E+(n<<4)+12>>2]=F;E=83;break}else{l=l/(l-t);s=p+(u-p)*l;p=q+(v-q)*l;l=r+(w-r)*l;o=c[f+4>>2]|0;if((o|0)==(c[f+8>>2]|0)?(Q=(o|0)==0?1:o<<1,(o|0)<(Q|0)):0){if(!Q)n=0;else{c[7182]=(c[7182]|0)+1;n=xb((Q<<4|3)+16|0)|0;if(!n)n=0;else{c[(n+4+15&-16)+-4>>2]=n;n=n+4+15&-16}o=c[f+4>>2]|0}if((o|0)>0){E=0;do{aa=n+(E<<4)|0;$=(c[f+12>>2]|0)+(E<<4)|0;c[aa>>2]=c[$>>2];c[aa+4>>2]=c[$+4>>2];c[aa+8>>2]=c[$+8>>2];c[aa+12>>2]=c[$+12>>2];E=E+1|0}while((E|0)!=(o|0))}o=c[f+12>>2]|0;if(o|0){if(a[f+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}c[f+12>>2]=0}a[f+16>>0]=1;c[f+12>>2]=n;c[f+8>>2]=Q;n=c[f+4>>2]|0}else n=o;E=c[f+12>>2]|0;g[E+(n<<4)>>2]=s;g[E+(n<<4)+4>>2]=p;g[E+(n<<4)+8>>2]=l;g[E+(n<<4)+12>>2]=0.0;E=83;break}else if(t<0.0){l=l/(l-t);s=p+(u-p)*l;p=q+(v-q)*l;l=r+(w-r)*l;o=c[f+4>>2]|0;if((o|0)==(c[f+8>>2]|0)?(R=(o|0)==0?1:o<<1,(o|0)<(R|0)):0){if(!R)n=0;else{c[7182]=(c[7182]|0)+1;n=xb((R<<4|3)+16|0)|0;if(!n)n=0;else{c[(n+4+15&-16)+-4>>2]=n;n=n+4+15&-16}o=c[f+4>>2]|0}if((o|0)>0){E=0;do{aa=n+(E<<4)|0;$=(c[f+12>>2]|0)+(E<<4)|0;c[aa>>2]=c[$>>2];c[aa+4>>2]=c[$+4>>2];c[aa+8>>2]=c[$+8>>2];c[aa+12>>2]=c[$+12>>2];E=E+1|0}while((E|0)!=(o|0))}o=c[f+12>>2]|0;if(o|0){if(a[f+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}c[f+12>>2]=0}a[f+16>>0]=1;c[f+12>>2]=n;c[f+8>>2]=R;n=c[f+4>>2]|0}else n=o;o=c[f+12>>2]|0;g[o+(n<<4)>>2]=s;g[o+(n<<4)+4>>2]=p;g[o+(n<<4)+8>>2]=l;g[o+(n<<4)+12>>2]=0.0;o=(c[f+4>>2]|0)+1|0;c[f+4>>2]=o;if((o|0)==(c[f+8>>2]|0)?(S=(o|0)==0?1:o<<1,(o|0)<(S|0)):0){if(!S)n=0;else{c[7182]=(c[7182]|0)+1;n=xb((S<<4|3)+16|0)|0;if(!n)n=0;else{c[(n+4+15&-16)+-4>>2]=n;n=n+4+15&-16}o=c[f+4>>2]|0}if((o|0)>0){E=0;do{aa=n+(E<<4)|0;$=(c[f+12>>2]|0)+(E<<4)|0;c[aa>>2]=c[$>>2];c[aa+4>>2]=c[$+4>>2];c[aa+8>>2]=c[$+8>>2];c[aa+12>>2]=c[$+12>>2];E=E+1|0}while((E|0)!=(o|0))}o=c[f+12>>2]|0;if(o|0){if(a[f+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}c[f+12>>2]=0}a[f+16>>0]=1;c[f+12>>2]=n;c[f+8>>2]=S;n=c[f+4>>2]|0}else n=o;E=c[f+12>>2]|0;g[E+(n<<4)>>2]=u;g[E+(n<<4)+4>>2]=v;g[E+(n<<4)+8>>2]=w;c[E+(n<<4)+12>>2]=F;E=83}while(0);if((E|0)==83){E=0;c[f+4>>2]=(c[f+4>>2]|0)+1}m=m+1|0;if((m|0)==(k|0))break;l=t;p=u;r=w;q=v;n=c[G+12>>2]|0}k=c[G+4>>2]|0}if((k|0)<0){if((c[G+8>>2]|0)<0){m=c[G+12>>2]|0;if(m|0){if(a[G+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[G+12>>2]=0}a[G+16>>0]=1;c[G+12>>2]=0;c[G+8>>2]=0}do{aa=(c[G+12>>2]|0)+(k<<4)|0;c[aa>>2]=c[W>>2];c[aa+4>>2]=c[W+4>>2];c[aa+8>>2]=c[W+8>>2];c[aa+12>>2]=c[W+12>>2];k=k+1|0}while((k|0)!=0)}c[G+4>>2]=0;if((H|0)>=(K|0))break;aa=I;k=H;w=+g[e>>2];v=+g[e+4>>2];s=+g[e+8>>2];u=+g[e+16>>2];r=+g[e+20>>2];q=+g[e+24>>2];t=+g[e+32>>2];p=+g[e+36>>2];l=+g[e+40>>2];I=J;J=aa}n=M;m=N;k=O;o=e+48|0;E=e+52|0;F=e+56|0;G=f+4|0;w=+g[e>>2];v=+g[e+4>>2];s=+g[e+8>>2];u=+g[e+16>>2];r=+g[e+20>>2];q=+g[e+24>>2];t=+g[e+32>>2];p=+g[e+36>>2];l=+g[e+40>>2]}else{n=U+(T*36|0)+20|0;m=U+(T*36|0)+24|0;k=U+(T*36|0)+28|0;o=e+48|0;E=e+52|0;F=e+56|0;G=f+4|0}Y=+g[n>>2];Z=+g[m>>2];_=+g[k>>2];s=Y*w+Z*v+_*s;r=Y*u+Z*r+_*q;q=Y*t+Z*p+_*l;p=+g[U+(T*36|0)+32>>2]-(s*+g[o>>2]+r*+g[E>>2]+q*+g[F>>2]);k=c[G>>2]|0;if((k|0)>0){o=f+12|0;n=0;do{aa=c[o>>2]|0;m=aa+(n<<4)|0;l=p+(s*+g[m>>2]+r*+g[aa+(n<<4)+4>>2]+q*+g[aa+(n<<4)+8>>2]);l=l<=h?h:l;if(l<=i){c[W>>2]=c[m>>2];c[W+4>>2]=c[m+4>>2];c[W+8>>2]=c[m+8>>2];c[W+12>>2]=c[m+12>>2];_a[c[(c[j>>2]|0)+16>>2]&15](j,b,W,l);k=c[G>>2]|0}n=n+1|0}while((n|0)<(k|0))}}}k=c[V>>2]|0;if(!k){sa=W;return}if(a[W+16+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[V>>2]=0;sa=W;return}function Ub(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0.0,j=0.0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0,P=0.0,Q=0.0,R=0.0,S=0;O=sa;sa=sa+208|0;g[b+56>>2]=0.0;G=O+192+4|0;H=O+192+8|0;c[O+192>>2]=0;c[O+192+4>>2]=0;c[O+192+8>>2]=0;c[O+192+12>>2]=0;c[O+128>>2]=c[d>>2];c[O+128+4>>2]=c[d+4>>2];c[O+128+8>>2]=c[d+8>>2];c[O+128+12>>2]=c[d+12>>2];c[O+128+16>>2]=c[d+16>>2];c[O+128+16+4>>2]=c[d+16+4>>2];c[O+128+16+8>>2]=c[d+16+8>>2];c[O+128+16+12>>2]=c[d+16+12>>2];c[O+128+32>>2]=c[d+32>>2];c[O+128+32+4>>2]=c[d+32+4>>2];c[O+128+32+8>>2]=c[d+32+8>>2];c[O+128+32+12>>2]=c[d+32+12>>2];D=O+128+48|0;c[D>>2]=c[d+48>>2];c[D+4>>2]=c[d+48+4>>2];c[D+8>>2]=c[d+48+8>>2];c[D+12>>2]=c[d+48+12>>2];c[O+64>>2]=c[d+64>>2];c[O+64+4>>2]=c[d+64+4>>2];c[O+64+8>>2]=c[d+64+8>>2];c[O+64+12>>2]=c[d+64+12>>2];c[O+64+16>>2]=c[d+80>>2];c[O+64+16+4>>2]=c[d+80+4>>2];c[O+64+16+8>>2]=c[d+80+8>>2];c[O+64+16+12>>2]=c[d+80+12>>2];c[O+64+32>>2]=c[d+96>>2];c[O+64+32+4>>2]=c[d+96+4>>2];c[O+64+32+8>>2]=c[d+96+8>>2];c[O+64+32+12>>2]=c[d+96+12>>2];E=O+64+48|0;c[E>>2]=c[d+112>>2];c[E+4>>2]=c[d+112+4>>2];c[E+8>>2]=c[d+112+8>>2];c[E+12>>2]=c[d+112+12>>2];I=+g[D>>2];J=+g[E>>2];K=+g[O+128+52>>2];L=+g[O+64+52>>2];M=+g[O+128+56>>2];N=+g[O+64+56>>2];g[D>>2]=I-(I+J)*.5;g[O+128+52>>2]=K-(K+L)*.5;g[O+128+56>>2]=M-(M+N)*.5;g[E>>2]=J-(I+J)*.5;g[O+64+52>>2]=L-(K+L)*.5;g[O+64+56>>2]=N-(M+N)*.5;if(((c[(c[b+28>>2]|0)+4>>2]|0)+-17|0)>>>0<2)D=((c[(c[b+32>>2]|0)+4>>2]|0)+-17|0)>>>0<2;else D=0;u=+g[b+44>>2];t=+g[b+48>>2];c[7167]=(c[7167]|0)+1;E=a[b+52>>0]|0;c[b+64>>2]=0;c[b+4>>2]=0;c[b+8>>2]=1065353216;c[b+12>>2]=0;g[b+16>>2]=0.0;c[b+68>>2]=0;c[b+60>>2]=-1;m=c[b+24>>2]|0;a[m+312>>0]=0;c[m>>2]=0;a[m+356>>0]=1;c[m+292>>2]=1566444395;c[m+296>>2]=1566444395;c[m+300>>2]=1566444395;g[m+304>>2]=0.0;c[m+336>>2]=0;c[m+336+4>>2]=0;c[m+336+8>>2]=0;c[m+336+12>>2]=0;a[m+336+16>>0]=0;a[m+332>>0]=a[m+332>>0]&-16;m=0;l=999999984306749440.0;do{n=+g[b+4>>2];k=+g[b+8>>2];j=+g[b+12>>2];r=+g[d+4>>2]*-n+ +g[d+20>>2]*-k+ +g[d+36>>2]*-j;s=+g[d+8>>2]*-n+ +g[d+24>>2]*-k+ +g[d+40>>2]*-j;g[O+48>>2]=+g[d>>2]*-n+ +g[d+16>>2]*-k+ +g[d+32>>2]*-j;g[O+48+4>>2]=r;g[O+48+8>>2]=s;g[O+48+12>>2]=0.0;s=n*+g[d+68>>2]+k*+g[d+84>>2]+j*+g[d+100>>2];r=n*+g[d+72>>2]+k*+g[d+88>>2]+j*+g[d+104>>2];g[O+32>>2]=n*+g[d+64>>2]+k*+g[d+80>>2]+j*+g[d+96>>2];g[O+32+4>>2]=s;g[O+32+8>>2]=r;g[O+32+12>>2]=0.0;Nc(O+16|0,c[b+28>>2]|0,O+48|0);Nc(O,c[b+32>>2]|0,O+32|0);r=+g[O+16>>2];s=+g[O+16+4>>2];j=+g[O+16+8>>2];k=r*+g[O+128>>2]+s*+g[O+128+4>>2]+j*+g[O+128+8>>2]+ +g[O+128+48>>2];n=r*+g[O+128+16>>2]+s*+g[O+128+20>>2]+j*+g[O+128+24>>2]+ +g[O+128+52>>2];j=r*+g[O+128+32>>2]+s*+g[O+128+36>>2]+j*+g[O+128+40>>2]+ +g[O+128+56>>2];s=+g[O>>2];r=+g[O+4>>2];q=+g[O+8>>2];o=s*+g[O+64>>2]+r*+g[O+64+4>>2]+q*+g[O+64+8>>2]+ +g[O+64+48>>2];p=s*+g[O+64+16>>2]+r*+g[O+64+20>>2]+q*+g[O+64+24>>2]+ +g[O+64+52>>2];q=s*+g[O+64+32>>2]+r*+g[O+64+36>>2]+q*+g[O+64+40>>2]+ +g[O+64+56>>2];r=D?0.0:q;s=D?0.0:j;q=D?0.0:j-q;j=(k-o)*+g[b+4>>2]+(n-p)*+g[b+8>>2]+q*+g[b+12>>2];if(j>0.0?j*j>l*+g[d+128>>2]:0){c[b+68>>2]=10;h=0;m=1}else S=7;do if((S|0)==7){S=0;B=c[b+24>>2]|0;C=c[B>>2]|0;if((C|0)>0){i=+g[B+308>>2];A=0;h=0;do{w=k-o-+g[B+4+(A<<4)>>2];y=n-p-+g[B+4+(A<<4)+4>>2];z=q-+g[B+4+(A<<4)+8>>2];h=h|w*w+y*y+z*z<=i;A=A+1|0}while((A|0)!=(C|0))}else h=0;if((+g[B+304>>2]==0.0?q==+g[B+300>>2]:0)?n-p==+g[B+296>>2]:0){if(k-o==+g[B+292>>2]|h)S=15}else S=14;if((S|0)==14?(S=0,h):0)S=15;if((S|0)==15){S=0;c[b+68>>2]=1;h=0;m=1;break}i=l-j;if(i<=l*9.999999974752427e-07){c[b+68>>2]=!(i<=0.0)?11:2;h=0;m=1;break}g[B+292>>2]=k-o;g[B+296>>2]=n-p;g[B+300>>2]=q;g[B+304>>2]=0.0;a[B+356>>0]=1;g[B+4+(C<<4)>>2]=k-o;g[B+4+(C<<4)+4>>2]=n-p;g[B+4+(C<<4)+8>>2]=q;g[B+4+(C<<4)+12>>2]=0.0;h=c[B>>2]|0;g[B+84+(h<<4)>>2]=k;g[B+84+(h<<4)+4>>2]=n;g[B+84+(h<<4)+8>>2]=s;g[B+84+(h<<4)+12>>2]=0.0;h=c[B>>2]|0;g[B+164+(h<<4)>>2]=o;g[B+164+(h<<4)+4>>2]=p;g[B+164+(h<<4)+8>>2]=r;g[B+164+(h<<4)+12>>2]=0.0;c[B>>2]=(c[B>>2]|0)+1;h=c[b+24>>2]|0;C=Ab(h)|0;i=+g[h+276>>2];j=+g[h+280>>2];k=+g[h+284>>2];h=c[h+288>>2]|0;if(!C){c[b+68>>2]=3;h=0;m=1;break}if(i*i+j*j+k*k<9.999999974752427e-07){g[b+4>>2]=i;g[b+8>>2]=j;g[b+12>>2]=k;c[b+16>>2]=h;c[b+68>>2]=6;h=0;m=1;break}if(l-(i*i+j*j+k*k)<=l*1.1920928955078125e-07){c[b+68>>2]=12;l=i*i+j*j+k*k;h=0;m=1;break}g[b+4>>2]=i;g[b+8>>2]=j;g[b+12>>2]=k;c[b+16>>2]=h;C=c[b+64>>2]|0;c[b+64>>2]=C+1;if((C|0)<=1e3)if((c[c[b+24>>2]>>2]|0)==4){c[b+68>>2]=13;l=i*i+j*j+k*k;h=0}else{l=i*i+j*j+k*k;h=1}else{l=i*i+j*j+k*k;h=0}}while(0)}while(h);s=E<<24>>24==0?t:0.0;r=(E<<24>>24==0?u:0.0)+s;if(m){E=c[b+24>>2]|0;Ab(E)|0;k=+g[E+260>>2];j=+g[E+264>>2];i=+g[E+268>>2];c[O+192>>2]=c[b+4>>2];c[O+192+4>>2]=c[b+4+4>>2];c[O+192+8>>2]=c[b+4+8>>2];c[O+192+12>>2]=c[b+4+12>>2];n=+g[b+4>>2];o=+g[b+8>>2];p=+g[b+12>>2];if(n*n+o*o+p*p<.0001)c[b+68>>2]=5;if(n*n+o*o+p*p>1.4210854715202004e-14){y=1.0/+x(+(n*n+o*o+p*p));g[O+192>>2]=y*+g[O+192>>2];g[G>>2]=y*+g[G>>2];g[H>>2]=y*+g[H>>2];z=s/+x(+l);l=1.0/y-r;m=1;h=1;k=z*n+k;j=z*o+j;i=z*p+i}else{l=0.0;m=0;h=2}c[b+60>>2]=h}else{l=0.0;m=0;k=0.0;j=0.0;i=0.0}if((c[b+72>>2]|0)!=0?(c[b+20>>2]|0)!=0:0)h=r+l<.01&(c[b+68>>2]|0)!=0;else h=0;A=m^1;do if(h|A?(F=c[b+20>>2]|0,(F|0)!=0):0){c[7166]=(c[7166]|0)+1;c[b+4>>2]=0;c[b+4+4>>2]=0;c[b+4+8>>2]=0;c[b+4+12>>2]=0;if(Na[c[(c[F>>2]|0)+8>>2]&3](F,c[b+24>>2]|0,c[b+28>>2]|0,c[b+32>>2]|0,O+128|0,O+64|0,b+4|0,O+48|0,O+32|0,f)|0){o=+g[O+32>>2];p=+g[O+48>>2];q=+g[O+32+4>>2];r=+g[O+48+4>>2];s=+g[O+32+8>>2];t=+g[O+48+8>>2];if(!((o-p)*(o-p)+(q-r)*(q-r)+(s-t)*(s-t)<=1.4210854715202004e-14)){n=(o-p)*(o-p)+(q-r)*(q-r)+(s-t)*(s-t);v=o-p;w=s-t;y=0.0;z=q-r}else{v=+g[b+4>>2];z=+g[b+8>>2];w=+g[b+12>>2];n=v*v+z*z+w*w;y=+g[b+16>>2]}if(n>1.4210854715202004e-14){u=1.0/+x(+n);n=-+x(+((p-o)*(p-o)+(r-q)*(r-q)+(t-s)*(t-s)));if(l>n|A){k=+g[O+32>>2];j=+g[O+32+4>>2];i=+g[O+32+8>>2];g[O+192>>2]=v*u;g[G>>2]=z*u;g[H>>2]=w*u;g[O+192+12>>2]=y;c[b+60>>2]=3;l=n;break}else h=8}else h=9;c[b+60>>2]=h;if(m)break;sa=O;return}else{o=+g[b+4>>2];p=+g[b+8>>2];q=+g[b+12>>2];if(!(o*o+p*p+q*q>0.0)){if(m)break;sa=O;return}y=+g[O+48>>2]-+g[O+32>>2];z=+g[O+48+4>>2]-+g[O+32+4>>2];n=+g[O+48+8>>2]-+g[O+32+8>>2];n=+x(+(y*y+z*z+n*n))-r;if(n>2];j=s*p+ +g[O+32+4>>2];i=s*q+ +g[O+32+8>>2];c[O+192>>2]=c[b+4>>2];c[O+192+4>>2]=c[b+4+4>>2];c[O+192+8>>2]=c[b+4+8>>2];c[O+192+12>>2]=c[b+4+12>>2];w=+g[O+192>>2];y=+g[G>>2];z=+g[H>>2];l=1.0/+x(+(w*w+y*y+z*z));g[O+192>>2]=w*l;g[G>>2]=y*l;g[H>>2]=z*l;c[b+60>>2]=6;l=n;break}c[b+60>>2]=5;if(m)break;sa=O;return}}else S=51;while(0);if((S|0)==51)if(!m){sa=O;return}if(!(l<0.0)?!(l*l<+g[d+128>>2]):0){sa=O;return}if(c[b+76>>2]|0?(S=c[b+28>>2]|0,ab[c[(c[S>>2]|0)+8>>2]&127](S,O+128|0,O+48|0,O+32|0),w=(+g[O+32>>2]+ +g[O+48>>2])*.5,y=(+g[O+32+4>>2]+ +g[O+48+4>>2])*.5,z=(+g[O+32+8>>2]+ +g[O+48+8>>2])*.5,S=c[b+32>>2]|0,ab[c[(c[S>>2]|0)+8>>2]&127](S,O+64|0,O+48|0,O+32|0),P=+g[O+192>>2],Q=+g[G>>2],R=+g[H>>2],(w-(+g[O+48>>2]+ +g[O+32>>2])*.5)*P+(y-(+g[O+48+4>>2]+ +g[O+32+4>>2])*.5)*Q+(z-(+g[O+48+8>>2]+ +g[O+32+8>>2])*.5)*R<0.0):0){g[O+192>>2]=-P;g[G>>2]=-Q;g[H>>2]=-R}c[b+4>>2]=c[O+192>>2];c[b+4+4>>2]=c[O+192+4>>2];c[b+4+8>>2]=c[O+192+8>>2];c[b+4+12>>2]=c[O+192+12>>2];g[b+56>>2]=l;S=c[(c[e>>2]|0)+16>>2]|0;g[O+48>>2]=(I+J)*.5+k;g[O+48+4>>2]=(K+L)*.5+j;g[O+48+8>>2]=(M+N)*.5+i;g[O+48+12>>2]=0.0;_a[S&15](e,O+192|0,O+48|0,l);sa=O;return}function Vb(d,e,f,h){d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0;c[d+168>>2]=c[d+152>>2];c[e>>2]=11920;c[e+52>>2]=282;a[e+60>>0]=0;a[e+80>>0]=1;c[e+76>>2]=0;c[e+68>>2]=0;c[e+72>>2]=0;a[e+100>>0]=1;c[e+96>>2]=0;c[e+88>>2]=0;c[e+92>>2]=0;a[e+120>>0]=1;c[e+116>>2]=0;c[e+108>>2]=0;c[e+112>>2]=0;a[e+140>>0]=1;c[e+136>>2]=0;c[e+128>>2]=0;c[e+132>>2]=0;c[e+144>>2]=0;a[e+164>>0]=1;c[e+160>>2]=0;c[e+152>>2]=0;c[e+156>>2]=0;c[e+168>>2]=0;c[e+4>>2]=-8388609;c[e+8>>2]=-8388609;c[e+12>>2]=-8388609;g[e+16>>2]=0.0;c[e+20>>2]=2139095039;c[e+24>>2]=2139095039;c[e+28>>2]=2139095039;g[e+32>>2]=0.0;f=c[d+56>>2]|0;if(h){c[e+56>>2]=kB(f|0)|0;a[e+4>>0]=a[d+4+3>>0]|0;a[e+5>>0]=a[d+4+2>>0]|0;a[e+6>>0]=a[d+4+1>>0]|0;a[e+7>>0]=a[d+4>>0]|0;a[e+8>>0]=a[d+8+3>>0]|0;a[e+9>>0]=a[d+8+2>>0]|0;a[e+10>>0]=a[d+8+1>>0]|0;a[e+11>>0]=a[d+8>>0]|0;a[e+12>>0]=a[d+12+3>>0]|0;a[e+13>>0]=a[d+12+2>>0]|0;a[e+14>>0]=a[d+12+1>>0]|0;a[e+15>>0]=a[d+12>>0]|0;a[e+16>>0]=a[d+16+3>>0]|0;a[e+17>>0]=a[d+16+2>>0]|0;a[e+18>>0]=a[d+16+1>>0]|0;a[e+19>>0]=a[d+16>>0]|0;a[e+20>>0]=a[d+20+3>>0]|0;a[e+21>>0]=a[d+20+2>>0]|0;a[e+22>>0]=a[d+20+1>>0]|0;a[e+23>>0]=a[d+20>>0]|0;a[e+24>>0]=a[d+24+3>>0]|0;a[e+25>>0]=a[d+24+2>>0]|0;a[e+26>>0]=a[d+24+1>>0]|0;a[e+27>>0]=a[d+24>>0]|0;a[e+28>>0]=a[d+28+3>>0]|0;a[e+29>>0]=a[d+28+2>>0]|0;a[e+30>>0]=a[d+28+1>>0]|0;a[e+31>>0]=a[d+28>>0]|0;a[e+32>>0]=a[d+32+3>>0]|0;a[e+33>>0]=a[d+32+2>>0]|0;a[e+34>>0]=a[d+32+1>>0]|0;a[e+35>>0]=a[d+32>>0]|0;a[e+36>>0]=a[d+36+3>>0]|0;a[e+37>>0]=a[d+36+2>>0]|0;a[e+38>>0]=a[d+36+1>>0]|0;a[e+39>>0]=a[d+36>>0]|0;a[e+40>>0]=a[d+40+3>>0]|0;a[e+41>>0]=a[d+40+2>>0]|0;a[e+42>>0]=a[d+40+1>>0]|0;a[e+43>>0]=a[d+40>>0]|0;a[e+44>>0]=a[d+44+3>>0]|0;a[e+45>>0]=a[d+44+2>>0]|0;a[e+46>>0]=a[d+44+1>>0]|0;a[e+47>>0]=a[d+44>>0]|0;a[e+48>>0]=a[d+48+3>>0]|0;a[e+49>>0]=a[d+48+2>>0]|0;a[e+50>>0]=a[d+48+1>>0]|0;a[e+51>>0]=a[d+48>>0]|0;c[e+144>>2]=kB(c[d+144>>2]|0)|0;f=kB(c[d+168>>2]|0)|0}else{c[e+56>>2]=f;c[e+4>>2]=c[d+4>>2];c[e+4+4>>2]=c[d+4+4>>2];c[e+4+8>>2]=c[d+4+8>>2];c[e+4+12>>2]=c[d+4+12>>2];c[e+20>>2]=c[d+20>>2];c[e+20+4>>2]=c[d+20+4>>2];c[e+20+8>>2]=c[d+20+8>>2];c[e+20+12>>2]=c[d+20+12>>2];c[e+36>>2]=c[d+36>>2];c[e+36+4>>2]=c[d+36+4>>2];c[e+36+8>>2]=c[d+36+8>>2];c[e+36+12>>2]=c[d+36+12>>2];c[e+144>>2]=c[d+144>>2];f=c[d+168>>2]|0}c[e+168>>2]=f;a[e+60>>0]=a[d+60>>0]|0;k=c[d+56>>2]|0;if(!(a[d+60>>0]|0)){f=c[e+96>>2]|0;if(f|0){if(a[e+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[e+96>>2]=0}a[e+100>>0]=0;c[e+96>>2]=e+172;c[e+88>>2]=k;c[e+92>>2]=k;if(h)if((k|0)>0){i=0;j=c[d+96>>2]|0;f=e+172|0;do{l=j+(i<<6)|0;n=f+(i<<6)|0;a[n>>0]=a[l+3>>0]|0;a[n+1>>0]=a[l+2>>0]|0;a[n+2>>0]=a[l+1>>0]|0;a[n+3>>0]=a[l>>0]|0;n=j+(i<<6)+4|0;l=f+(i<<6)+4|0;a[l>>0]=a[n+3>>0]|0;a[l+1>>0]=a[n+2>>0]|0;a[l+2>>0]=a[n+1>>0]|0;a[l+3>>0]=a[n>>0]|0;l=j+(i<<6)+8|0;n=f+(i<<6)+8|0;a[n>>0]=a[l+3>>0]|0;a[n+1>>0]=a[l+2>>0]|0;a[n+2>>0]=a[l+1>>0]|0;a[n+3>>0]=a[l>>0]|0;n=j+(i<<6)+12|0;f=f+(i<<6)+12|0;a[f>>0]=a[n+3>>0]|0;a[f+1>>0]=a[n+2>>0]|0;a[f+2>>0]=a[n+1>>0]|0;a[f+3>>0]=a[n>>0]|0;f=c[d+96>>2]|0;n=f+(i<<6)+16|0;l=c[e+96>>2]|0;m=l+(i<<6)+16|0;a[m>>0]=a[n+3>>0]|0;a[m+1>>0]=a[n+2>>0]|0;a[m+2>>0]=a[n+1>>0]|0;a[m+3>>0]=a[n>>0]|0;m=f+(i<<6)+20|0;n=l+(i<<6)+20|0;a[n>>0]=a[m+3>>0]|0;a[n+1>>0]=a[m+2>>0]|0;a[n+2>>0]=a[m+1>>0]|0;a[n+3>>0]=a[m>>0]|0;n=f+(i<<6)+24|0;m=l+(i<<6)+24|0;a[m>>0]=a[n+3>>0]|0;a[m+1>>0]=a[n+2>>0]|0;a[m+2>>0]=a[n+1>>0]|0;a[m+3>>0]=a[n>>0]|0;f=f+(i<<6)+28|0;l=l+(i<<6)+28|0;a[l>>0]=a[f+3>>0]|0;a[l+1>>0]=a[f+2>>0]|0;a[l+2>>0]=a[f+1>>0]|0;a[l+3>>0]=a[f>>0]|0;j=c[d+96>>2]|0;l=kB(c[j+(i<<6)+32>>2]|0)|0;f=c[e+96>>2]|0;c[f+(i<<6)+32>>2]=l;c[f+(i<<6)+36>>2]=kB(c[j+(i<<6)+36>>2]|0)|0;c[f+(i<<6)+40>>2]=kB(c[j+(i<<6)+40>>2]|0)|0;i=i+1|0}while((i|0)!=(k|0));i=29}else i=28;else if((k|0)>0){i=0;j=c[d+96>>2]|0;f=e+172|0;do{m=j+(i<<6)|0;n=f+(i<<6)|0;c[n>>2]=c[m>>2];c[n+4>>2]=c[m+4>>2];c[n+8>>2]=c[m+8>>2];c[n+12>>2]=c[m+12>>2];n=(c[d+96>>2]|0)+(i<<6)+16|0;f=(c[e+96>>2]|0)+(i<<6)+16|0;c[f>>2]=c[n>>2];c[f+4>>2]=c[n+4>>2];c[f+8>>2]=c[n+8>>2];c[f+12>>2]=c[n+12>>2];j=c[d+96>>2]|0;f=c[e+96>>2]|0;c[f+(i<<6)+32>>2]=c[j+(i<<6)+32>>2];c[f+(i<<6)+36>>2]=c[j+(i<<6)+36>>2];c[f+(i<<6)+40>>2]=c[j+(i<<6)+40>>2];i=i+1|0}while((i|0)!=(k|0));i=29}else i=28;if((i|0)==28){f=k<<6;i=32}else if((i|0)==29)if(f)if((a[e+100>>0]|0)==0|(f|0)==0){f=k<<6;i=32}else{c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);f=k<<6;i=32}else f=k<<6;if((i|0)==32)c[e+96>>2]=0;c[e+88>>2]=0;c[e+88+4>>2]=0;c[e+88+8>>2]=0;a[e+88+12>>0]=0}else{f=c[e+136>>2]|0;if(f|0){if(a[e+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[e+136>>2]=0}a[e+140>>0]=0;c[e+136>>2]=e+172;c[e+128>>2]=k;c[e+132>>2]=k;if(h){if((k|0)>0){i=c[d+136>>2]|0;f=0;do{b[e+172+(f<<4)>>1]=iH(b[i+(f<<4)>>1]|0)|0;b[e+172+(f<<4)+2>>1]=iH(b[i+(f<<4)+2>>1]|0)|0;b[e+172+(f<<4)+4>>1]=iH(b[i+(f<<4)+4>>1]|0)|0;b[e+172+(f<<4)+6>>1]=iH(b[i+(f<<4)+6>>1]|0)|0;b[e+172+(f<<4)+8>>1]=iH(b[i+(f<<4)+8>>1]|0)|0;b[e+172+(f<<4)+10>>1]=iH(b[i+(f<<4)+10>>1]|0)|0;c[e+172+(f<<4)+12>>2]=kB(c[i+(f<<4)+12>>2]|0)|0;f=f+1|0}while((f|0)!=(k|0))}}else if((k|0)>0){i=c[d+136>>2]|0;f=0;do{b[e+172+(f<<4)>>1]=b[i+(f<<4)>>1]|0;b[e+172+(f<<4)+2>>1]=b[i+(f<<4)+2>>1]|0;b[e+172+(f<<4)+4>>1]=b[i+(f<<4)+4>>1]|0;b[e+172+(f<<4)+6>>1]=b[i+(f<<4)+6>>1]|0;b[e+172+(f<<4)+8>>1]=b[i+(f<<4)+8>>1]|0;b[e+172+(f<<4)+10>>1]=b[i+(f<<4)+10>>1]|0;c[e+172+(f<<4)+12>>2]=c[i+(f<<4)+12>>2];f=f+1|0}while((f|0)!=(k|0))}c[e+128>>2]=0;c[e+128+4>>2]=0;c[e+128+8>>2]=0;a[e+128+12>>0]=0;f=k<<4}k=e+172+f|0;f=c[d+168>>2]|0;i=c[e+160>>2]|0;if(i|0){if(a[e+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[e+160>>2]=0}a[e+164>>0]=0;c[e+160>>2]=k;c[e+152>>2]=f;c[e+156>>2]=f;j=c[d+168>>2]|0;if(h){if((j|0)<=0){c[e>>2]=0;c[e+152>>2]=0;c[e+152+4>>2]=0;c[e+152+8>>2]=0;a[e+152+12>>0]=0;return 1}i=c[d+160>>2]|0;f=0;do{b[k+(f<<5)>>1]=iH(b[i+(f<<5)>>1]|0)|0;b[k+(f<<5)+2>>1]=iH(b[i+(f<<5)+2>>1]|0)|0;b[k+(f<<5)+4>>1]=iH(b[i+(f<<5)+4>>1]|0)|0;b[k+(f<<5)+6>>1]=iH(b[i+(f<<5)+6>>1]|0)|0;b[k+(f<<5)+8>>1]=iH(b[i+(f<<5)+8>>1]|0)|0;b[k+(f<<5)+10>>1]=iH(b[i+(f<<5)+10>>1]|0)|0;c[k+(f<<5)+12>>2]=kB(c[i+(f<<5)+12>>2]|0)|0;c[k+(f<<5)+16>>2]=kB(c[i+(f<<5)+16>>2]|0)|0;f=f+1|0}while((f|0)!=(j|0));c[e>>2]=0;c[e+152>>2]=0;c[e+152+4>>2]=0;c[e+152+8>>2]=0;a[e+152+12>>0]=0;return 1}else{if((j|0)<=0){c[e>>2]=0;c[e+152>>2]=0;c[e+152+4>>2]=0;c[e+152+8>>2]=0;a[e+152+12>>0]=0;return 1}i=c[d+160>>2]|0;f=0;do{b[k+(f<<5)>>1]=b[i+(f<<5)>>1]|0;b[k+(f<<5)+2>>1]=b[i+(f<<5)+2>>1]|0;b[k+(f<<5)+4>>1]=b[i+(f<<5)+4>>1]|0;b[k+(f<<5)+6>>1]=b[i+(f<<5)+6>>1]|0;b[k+(f<<5)+8>>1]=b[i+(f<<5)+8>>1]|0;b[k+(f<<5)+10>>1]=b[i+(f<<5)+10>>1]|0;c[k+(f<<5)+12>>2]=c[i+(f<<5)+12>>2];c[k+(f<<5)+16>>2]=c[i+(f<<5)+16>>2];c[k+(f<<5)+20>>2]=0;c[k+(f<<5)+24>>2]=0;c[k+(f<<5)+28>>2]=0;f=f+1|0}while((f|0)<(c[d+168>>2]|0));c[e>>2]=0;c[e+152>>2]=0;c[e+152+4>>2]=0;c[e+152+8>>2]=0;a[e+152+12>>0]=0;return 1}return 0}function Wb(b,d,e,f,h,i,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0.0,B=0,C=0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0;B=sa;sa=sa+4224|0;if(((c[e+4>>2]|0)+-17|0)>>>0<2)z=((c[f+4>>2]|0)+-17|0)>>>0<2;else z=0;b=0;do{be();u=+g[25552+(b<<4)>>2];v=+g[25552+(b<<4)+4>>2];w=+g[25552+(b<<4)+8>>2];y=+g[h+4>>2]*-u+ +g[h+20>>2]*-v+ +g[h+36>>2]*-w;x=+g[h+8>>2]*-u+ +g[h+24>>2]*-v+ +g[h+40>>2]*-w;g[B+992+(b<<4)>>2]=+g[h>>2]*-u+ +g[h+16>>2]*-v+ +g[h+32>>2]*-w;g[B+992+(b<<4)+4>>2]=y;g[B+992+(b<<4)+8>>2]=x;g[B+992+(b<<4)+12>>2]=0.0;x=u*+g[i+4>>2]+v*+g[i+20>>2]+w*+g[i+36>>2];y=u*+g[i+8>>2]+v*+g[i+24>>2]+w*+g[i+40>>2];g[B+(b<<4)>>2]=u*+g[i>>2]+v*+g[i+16>>2]+w*+g[i+32>>2];g[B+(b<<4)+4>>2]=x;g[B+(b<<4)+8>>2]=y;g[B+(b<<4)+12>>2]=0.0;b=b+1|0}while((b|0)!=42);p=Fa[c[(c[e>>2]|0)+84>>2]&127](e)|0;if((p|0)>0){b=0;o=42;while(1){Za[c[(c[e>>2]|0)+88>>2]&127](e,b,B+4144|0);x=+g[B+4144>>2];y=+g[B+4144+4>>2];w=+g[B+4144+8>>2];v=x*+g[h+16>>2]+y*+g[h+20>>2]+w*+g[h+24>>2];u=x*+g[h+32>>2]+y*+g[h+36>>2]+w*+g[h+40>>2];g[B+4144>>2]=+g[h>>2]*x+ +g[h+4>>2]*y+ +g[h+8>>2]*w;g[B+4144+4>>2]=v;g[B+4144+8>>2]=u;g[B+4144+12>>2]=0.0;be();q=25552+(o<<4)|0;c[q>>2]=c[B+4144>>2];c[q+4>>2]=c[B+4144+4>>2];c[q+8>>2]=c[B+4144+8>>2];c[q+12>>2]=c[B+4144+12>>2];u=+g[B+4144>>2];v=+g[B+4144+4>>2];w=+g[B+4144+8>>2];y=+g[h+4>>2]*-u+ +g[h+20>>2]*-v+ +g[h+36>>2]*-w;x=+g[h+8>>2]*-u+ +g[h+24>>2]*-v+ +g[h+40>>2]*-w;g[B+992+(o<<4)>>2]=+g[h>>2]*-u+ +g[h+16>>2]*-v+ +g[h+32>>2]*-w;g[B+992+(o<<4)+4>>2]=y;g[B+992+(o<<4)+8>>2]=x;g[B+992+(o<<4)+12>>2]=0.0;x=u*+g[i+4>>2]+v*+g[i+20>>2]+w*+g[i+36>>2];y=u*+g[i+8>>2]+v*+g[i+24>>2]+w*+g[i+40>>2];g[B+(o<<4)>>2]=u*+g[i>>2]+v*+g[i+16>>2]+w*+g[i+32>>2];g[B+(o<<4)+4>>2]=x;g[B+(o<<4)+8>>2]=y;g[B+(o<<4)+12>>2]=0.0;b=b+1|0;if((b|0)==(p|0))break;else o=o+1|0}o=p+42|0}else o=42;q=Fa[c[(c[f>>2]|0)+84>>2]&127](f)|0;if((q|0)>0){b=0;p=o;while(1){Za[c[(c[f>>2]|0)+88>>2]&127](f,b,B+4144|0);x=+g[B+4144>>2];y=+g[B+4144+4>>2];w=+g[B+4144+8>>2];v=x*+g[i+16>>2]+y*+g[i+20>>2]+w*+g[i+24>>2];u=x*+g[i+32>>2]+y*+g[i+36>>2]+w*+g[i+40>>2];g[B+4144>>2]=+g[i>>2]*x+ +g[i+4>>2]*y+ +g[i+8>>2]*w;g[B+4144+4>>2]=v;g[B+4144+8>>2]=u;g[B+4144+12>>2]=0.0;be();C=25552+(p<<4)|0;c[C>>2]=c[B+4144>>2];c[C+4>>2]=c[B+4144+4>>2];c[C+8>>2]=c[B+4144+8>>2];c[C+12>>2]=c[B+4144+12>>2];u=+g[B+4144>>2];v=+g[B+4144+4>>2];w=+g[B+4144+8>>2];y=+g[h+4>>2]*-u+ +g[h+20>>2]*-v+ +g[h+36>>2]*-w;x=+g[h+8>>2]*-u+ +g[h+24>>2]*-v+ +g[h+40>>2]*-w;g[B+992+(p<<4)>>2]=+g[h>>2]*-u+ +g[h+16>>2]*-v+ +g[h+32>>2]*-w;g[B+992+(p<<4)+4>>2]=y;g[B+992+(p<<4)+8>>2]=x;g[B+992+(p<<4)+12>>2]=0.0;x=u*+g[i+4>>2]+v*+g[i+20>>2]+w*+g[i+36>>2];y=u*+g[i+8>>2]+v*+g[i+24>>2]+w*+g[i+40>>2];g[B+(p<<4)>>2]=u*+g[i>>2]+v*+g[i+16>>2]+w*+g[i+32>>2];g[B+(p<<4)+4>>2]=x;g[B+(p<<4)+8>>2]=y;g[B+(p<<4)+12>>2]=0.0;b=b+1|0;if((b|0)==(q|0))break;else p=p+1|0}o=q+o|0}ab[c[(c[e>>2]|0)+76>>2]&127](e,B+992|0,B+2976|0,o);ab[c[(c[f>>2]|0)+76>>2]&127](f,B,B+1984|0,o);if((o|0)>0){u=999999984306749440.0;b=0;x=0.0;n=0.0;w=0.0;r=0.0;while(1){be();t=+g[25552+(b<<4)>>2];v=+g[25552+(b<<4)+4>>2];s=+g[25552+(b<<4)+12>>2];y=z?0.0:+g[25552+(b<<4)+8>>2];if(t*t+v*v+y*y>.01?(E=+g[B+2976+(b<<4)>>2],D=+g[B+2976+(b<<4)+4>>2],A=+g[B+2976+(b<<4)+8>>2],H=+g[B+1984+(b<<4)>>2],G=+g[B+1984+(b<<4)+4>>2],F=+g[B+1984+(b<<4)+8>>2],A=t*(H*+g[i>>2]+G*+g[i+4>>2]+F*+g[i+8>>2]+ +g[i+48>>2]-(E*+g[h>>2]+D*+g[h+4>>2]+A*+g[h+8>>2]+ +g[h+48>>2]))+v*(H*+g[i+16>>2]+G*+g[i+20>>2]+F*+g[i+24>>2]+ +g[i+52>>2]-(E*+g[h+16>>2]+D*+g[h+20>>2]+A*+g[h+24>>2]+ +g[h+52>>2]))+y*(z?0.0:H*+g[i+32>>2]+G*+g[i+36>>2]+F*+g[i+40>>2]+ +g[i+56>>2]-(E*+g[h+32>>2]+D*+g[h+36>>2]+A*+g[h+40>>2]+ +g[h+56>>2])),A>2]|0){case 4:case 5:case 10:case 11:case 13:case 1:case 0:case 8:break;default:+va[c[(c[e>>2]|0)+48>>2]&15](e)}switch(c[f+4>>2]|0){case 4:case 5:case 10:case 11:case 13:case 1:case 0:case 8:break;default:+va[c[(c[f>>2]|0)+48>>2]&15](f)}if(u<0.0){C=0;sa=B;return C|0}switch(c[e+4>>2]|0){case 8:{n=+g[e+28>>2]*+g[e+12>>2];break}case 0:{n=+g[e+44>>2];break}case 1:{n=+g[e+44>>2];break}case 13:{n=+g[e+44>>2];break}case 11:{n=+g[e+44>>2];break}case 10:{n=+g[e+44>>2];break}case 4:case 5:{n=+g[e+44>>2];break}default:n=+va[c[(c[e>>2]|0)+48>>2]&15](e)}b=c[f+4>>2]|0;switch(b|0){case 8:{r=+g[f+28>>2]*+g[f+12>>2];b=8;break}case 0:{r=+g[f+44>>2];b=0;break}case 1:{r=+g[f+44>>2];b=1;break}case 13:{r=+g[f+44>>2];b=13;break}case 11:{r=+g[f+44>>2];b=11;break}case 10:{r=+g[f+44>>2];b=10;break}case 4:case 5:{r=+g[f+44>>2];break}default:{r=+va[c[(c[f>>2]|0)+48>>2]&15](f);b=c[f+4>>2]|0}}n=u+(n+r+.5);c[B+4144>>2]=12116;c[B+4144+4>>2]=0;c[B+4144+8>>2]=1065353216;c[B+4144+12>>2]=0;g[B+4144+16>>2]=0.0;c[B+4144+20>>2]=0;c[B+4144+24>>2]=d;c[B+4144+28>>2]=e;c[B+4144+32>>2]=f;c[B+4144+36>>2]=c[e+4>>2];c[B+4144+40>>2]=b;g[B+4144+44>>2]=+va[c[(c[e>>2]|0)+48>>2]&15](e);g[B+4144+48>>2]=+va[c[(c[f>>2]|0)+48>>2]&15](f);a[B+4144+52>>0]=0;c[B+4144+60>>2]=-1;c[B+4144+72>>2]=1;c[B+4144+76>>2]=1;F=t*n+ +g[h+48>>2];G=v*n+ +g[h+52>>2];H=w*n+ +g[h+56>>2];c[B+4012>>2]=c[h>>2];c[B+4012+4>>2]=c[h+4>>2];c[B+4012+8>>2]=c[h+8>>2];c[B+4012+12>>2]=c[h+12>>2];c[B+4012+16>>2]=c[h+16>>2];c[B+4012+16+4>>2]=c[h+16+4>>2];c[B+4012+16+8>>2]=c[h+16+8>>2];c[B+4012+16+12>>2]=c[h+16+12>>2];c[B+4012+32>>2]=c[h+32>>2];c[B+4012+32+4>>2]=c[h+32+4>>2];c[B+4012+32+8>>2]=c[h+32+8>>2];c[B+4012+32+12>>2]=c[h+32+12>>2];g[B+4012+48>>2]=F;g[B+4012+52>>2]=G;g[B+4012+56>>2]=H;g[B+4012+60>>2]=0.0;c[B+4012+64>>2]=c[i>>2];c[B+4012+64+4>>2]=c[i+4>>2];c[B+4012+64+8>>2]=c[i+8>>2];c[B+4012+64+12>>2]=c[i+12>>2];c[B+4012+80>>2]=c[i+16>>2];c[B+4012+80+4>>2]=c[i+16+4>>2];c[B+4012+80+8>>2]=c[i+16+8>>2];c[B+4012+80+12>>2]=c[i+16+12>>2];c[B+4012+96>>2]=c[i+32>>2];c[B+4012+96+4>>2]=c[i+32+4>>2];c[B+4012+96+8>>2]=c[i+32+8>>2];c[B+4012+96+12>>2]=c[i+32+12>>2];c[B+4012+112>>2]=c[i+48>>2];c[B+4012+112+4>>2]=c[i+48+4>>2];c[B+4012+112+8>>2]=c[i+48+8>>2];c[B+4012+112+12>>2]=c[i+48+12>>2];g[B+4012+128>>2]=999999984306749440.0;c[B+3968>>2]=12e3;a[B+3968+40>>0]=0;g[B+4144+4>>2]=-t;g[B+4144+8>>2]=-v;g[B+4144+12>>2]=-w;g[B+4144+16>>2]=0.0;Ub(B+4144|0,B+4012|0,B+3968|0,m,0);n=n-+g[B+3968+36>>2];b=a[B+3968+40>>0]|0;if(b<<24>>24){C=B+3968+20|0;G=+g[B+3968+24>>2]-v*n;H=+g[B+3968+28>>2]-w*n;g[k>>2]=+g[C>>2]-t*n;g[k+4>>2]=G;g[k+8>>2]=H;g[k+12>>2]=0.0;c[l>>2]=c[C>>2];c[l+4>>2]=c[C+4>>2];c[l+8>>2]=c[C+8>>2];c[l+12>>2]=c[C+12>>2];g[j>>2]=t;g[j+4>>2]=v;g[j+8>>2]=w;g[j+12>>2]=s}C=b<<24>>24!=0;sa=B;return C|0}function Xb(d,e){d=d|0;e=+e;var f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0,A=0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0;A=sa;sa=sa+464|0;Ki(16202);f=c[d+84>>2]|0;if(f|0)Qa[f&31](d,e);Qa[c[(c[d>>2]|0)+140>>2]&31](d,e);g[d+28>>2]=e;c[d+32>>2]=0;c[d+48>>2]=Fa[c[(c[d>>2]|0)+20>>2]&127](d)|0;Ki(16245);Ki(16270);f=c[d+316>>2]|0;if((c[d+308>>2]|0)>0){h=0;do{r=c[d+24>>2]|0;Va[c[(c[r>>2]|0)+16>>2]&127](r,c[f+(h<<2)>>2]|0);h=h+1|0;f=c[d+316>>2]|0}while((h|0)<(c[d+308>>2]|0))}if(f|0){if(a[d+320>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+316>>2]=0}a[d+320>>0]=1;c[d+316>>2]=0;c[d+308>>2]=0;c[d+312>>2]=0;f=c[3084]|0;r=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=r;do if(!r){if(c[f+4>>2]|0){la(A+368|0,0)|0;r=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[A+368+4>>2]|0)-(c[r+4>>2]|0)+(((c[A+368>>2]|0)-(c[r>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(c[f+16>>2]|0)break;f=c[3084]|0}c[3084]=c[f+20>>2]}while(0);a:do if((c[d+232>>2]|0)>0){r=A+304+48|0;q=A+368+44|0;p=0;while(1){j=c[(c[d+240>>2]|0)+(p<<2)>>2]|0;g[j+244>>2]=1.0;b:do switch(c[j+216>>2]|0){case 2:case 5:break;default:if(((c[j+204>>2]&3|0)==0?(jg(j+4|0,+g[j+312>>2],+g[j+316>>2],+g[j+320>>2],j+328|0,e,A+304|0),s=+g[r>>2],t=s-+g[j+52>>2],u=+g[A+304+52>>2],v=u-+g[j+56>>2],w=+g[A+304+56>>2],x=w-+g[j+60>>2],a[d+44>>0]|0):0)?(n=+g[j+252>>2],n*n!=0.0?n*n>2]|0)+4>>2]|0)<20?(c[6847]=(c[6847]|0)+1,i=c[d+68>>2]|0,i=Fa[c[(c[i>>2]|0)+36>>2]&127](i)|0,o=c[d+24>>2]|0,g[A+368+4>>2]=1.0,c[A+368+12>>2]=c[j+52>>2],c[A+368+12+4>>2]=c[j+52+4>>2],c[A+368+12+8>>2]=c[j+52+8>>2],c[A+368+12+12>>2]=c[j+52+12>>2],c[A+368+28>>2]=c[r>>2],c[A+368+28+4>>2]=c[r+4>>2],c[A+368+28+8>>2]=c[r+8>>2],c[A+368+28+12>>2]=c[r+12>>2],c[A+368+76>>2]=0,c[A+368>>2]=7092,c[A+368+80>>2]=j,c[A+368+88>>2]=i,c[A+368+92>>2]=o,o=c[j+248>>2]|0,c[A+248+8>>2]=0,c[A+248+12>>2]=1065353216,c[A+248+16>>2]=1065353216,c[A+248+20>>2]=1065353216,g[A+248+24>>2]=0.0,c[A+248>>2]=9480,c[A+248+4>>2]=8,c[A+248+28>>2]=o,c[A+248+44>>2]=o,c[A+368+84>>2]=c[d+56>>2],o=c[j+188>>2]|0,b[A+368+8>>1]=b[o+4>>1]|0,b[A+368+10>>1]=b[o+6>>1]|0,c[A+184+48>>2]=c[r>>2],c[A+184+48+4>>2]=c[r+4>>2],c[A+184+48+8>>2]=c[r+8>>2],c[A+184+48+12>>2]=c[r+12>>2],c[A+184>>2]=c[j+4>>2],c[A+184+4>>2]=c[j+4+4>>2],c[A+184+8>>2]=c[j+4+8>>2],c[A+184+12>>2]=c[j+4+12>>2],c[A+184+16>>2]=c[j+20>>2],c[A+184+16+4>>2]=c[j+20+4>>2],c[A+184+16+8>>2]=c[j+20+8>>2],c[A+184+16+12>>2]=c[j+20+12>>2],c[A+184+32>>2]=c[j+36>>2],c[A+184+32+4>>2]=c[j+36+4>>2],c[A+184+32+8>>2]=c[j+36+8>>2],c[A+184+32+12>>2]=c[j+36+12>>2],Tc(d,A+248|0,j+4|0,A+184|0,A+368|0,0.0),y=+g[A+368+4>>2],y<1.0):0){k=y*(s-+g[j+52>>2]);l=y*(u-+g[j+56>>2]);m=y*(w-+g[j+60>>2]);n=-(l*+g[A+368+48>>2])-k*+g[q>>2]-m*+g[A+368+52>>2];o=c[d+24>>2]|0;o=Ja[c[(c[o>>2]|0)+12>>2]&63](o,j,c[A+368+76>>2]|0)|0;h=c[d+308>>2]|0;if((h|0)==(c[d+312>>2]|0)?(z=(h|0)==0?1:h<<1,(h|0)<(z|0)):0){if(!z)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((z<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[d+308>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[d+316>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[d+316>>2]|0;if(i){if(a[d+320>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[d+308>>2]|0}c[d+316>>2]=0}a[d+320>>0]=1;c[d+316>>2]=f;c[d+312>>2]=z;f=h}else f=h;c[(c[d+316>>2]|0)+(f<<2)>>2]=o;c[d+308>>2]=f+1;k=k+ +g[j+52>>2];l=l+ +g[j+56>>2];m=m+ +g[j+60>>2];i=c[A+368+76>>2]|0;M=+g[i+4>>2];L=+g[i+20>>2];K=+g[i+36>>2];J=+g[i+8>>2];I=+g[i+24>>2];H=+g[i+40>>2];G=+g[i+12>>2];E=+g[i+28>>2];C=+g[i+44>>2];F=-+g[i+52>>2];D=-+g[i+56>>2];B=-+g[i+60>>2];c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;g[A+16>>2]=k*M+l*L+m*K+(M*F+L*D+K*B);g[A+20>>2]=k*J+l*I+m*H+(J*F+I*D+H*B);g[A+24>>2]=k*G+l*E+m*C+(G*F+E*D+C*B);g[A+28>>2]=0.0;c[A+64>>2]=c[q>>2];c[A+64+4>>2]=c[q+4>>2];c[A+64+8>>2]=c[q+8>>2];c[A+64+12>>2]=c[q+12>>2];g[A+80>>2]=n;g[A+84>>2]=0.0;g[A+88>>2]=0.0;g[A+92>>2]=0.0;c[A+112>>2]=0;a[A+116>>0]=0;c[A+120>>2]=0;c[A+120+4>>2]=0;c[A+120+8>>2]=0;c[A+120+12>>2]=0;c[A+120+16>>2]=0;c[A+120+20>>2]=0;c[A+120+24>>2]=0;c[A+120+28>>2]=0;i=Ce(o,A)|0;g[o+4+(i*184|0)+92>>2]=0.0;n=+g[j+224>>2]*+g[(c[A+368+76>>2]|0)+224>>2];n=n<-10.0?-10.0:n;g[o+4+(i*184|0)+84>>2]=n>10.0?10.0:n;c[o+4+(i*184|0)+48>>2]=c[j+52>>2];c[o+4+(i*184|0)+48+4>>2]=c[j+52+4>>2];c[o+4+(i*184|0)+48+8>>2]=c[j+52+8>>2];c[o+4+(i*184|0)+48+12>>2]=c[j+52+12>>2];g[o+4+(i*184|0)+32>>2]=k;g[o+4+(i*184|0)+36>>2]=l;g[o+4+(i*184|0)+40>>2]=m;g[o+4+(i*184|0)+44>>2]=0.0}f=c[3084]|0;o=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=o;if(!o){if(c[f+4>>2]|0){la(A+368|0,0)|0;o=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[A+368+4>>2]|0)-(c[o+4>>2]|0)+(((c[A+368>>2]|0)-(c[o>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(c[f+16>>2]|0)break b;f=c[3084]|0}c[3084]=c[f+20>>2]}}}while(0);p=p+1|0;if((p|0)>=(c[d+232>>2]|0))break a}}while(0);f=c[3084]|0;z=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=z;do if(!z){if(c[f+4>>2]|0){la(A+368|0,0)|0;z=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[A+368+4>>2]|0)-(c[z+4>>2]|0)+(((c[A+368>>2]|0)-(c[z>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(c[f+16>>2]|0)break;f=c[3084]|0}c[3084]=c[f+20>>2]}while(0);Pa[c[(c[d>>2]|0)+44>>2]&511](d);Pa[c[(c[d>>2]|0)+148>>2]&511](d);g[d+104>>2]=e;Va[c[(c[d>>2]|0)+152>>2]&127](d,d+92|0);Qa[c[(c[d>>2]|0)+144>>2]&31](d,e);Ki(16231);if((c[d+280>>2]|0)>0){f=0;do{z=c[(c[d+288>>2]|0)+(f<<2)>>2]|0;Wa[c[(c[z>>2]|0)+8>>2]&7](z,d,e);f=f+1|0}while((f|0)<(c[d+280>>2]|0))}f=c[3084]|0;z=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=z;do if(!z){if(c[f+4>>2]|0){la(A+368|0,0)|0;z=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[A+368+4>>2]|0)-(c[z+4>>2]|0)+(((c[A+368>>2]|0)-(c[z>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(c[f+16>>2]|0)break;f=c[3084]|0}c[3084]=c[f+20>>2]}while(0);Qa[c[(c[d>>2]|0)+156>>2]&31](d,e);f=c[d+80>>2]|0;if(f|0)Qa[f&31](d,e);f=c[3084]|0;d=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=d;if(d|0){sa=A;return}do if(c[f+4>>2]|0){la(A+368|0,0)|0;d=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[A+368+4>>2]|0)-(c[d+4>>2]|0)+(((c[A+368>>2]|0)-(c[d>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[f+16>>2]|0)){f=c[3084]|0;break}else{sa=A;return}}while(0);c[3084]=c[f+20>>2];sa=A;return}function Yb(b){b=b|0;var d=0,e=0.0,f=0.0,h=0.0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0,G=0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0;G=sa;sa=sa+192|0;Ki(15341);d=c[b+1112>>2]|0;if((d|0)>0){F=0;do{E=c[(c[b+1120>>2]|0)+(F<<2)>>2]|0;D=c[E+24>>2]|0;if(D){i=G+144+4|0;j=i+44|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(j|0));g[G+144>>2]=9.999999747378752e-05;g[G+144+20>>2]=1.9999999494757503e-04;g[G+144+40>>2]=2.9999998514540493e-04;if((D|0)>0){i=c[E+32>>2]|0;j=c[E+12>>2]|0;d=0;e=0.0;f=0.0;h=0.0;do{C=c[i+(d<<2)>>2]|0;B=+g[j+(d<<2)>>2];e=e+ +g[C+8>>2]*B;f=f+B*+g[C+12>>2];h=h+B*+g[C+16>>2];d=d+1|0}while((d|0)!=(D|0))}else{h=0.0;f=0.0;e=0.0}q=+g[E+128>>2];s=e*q;r=f*q;q=h*q;g[E+228>>2]=s;g[E+232>>2]=r;g[E+236>>2]=q;g[E+240>>2]=0.0;if((D|0)>0){i=c[E+32>>2]|0;j=c[E+52>>2]|0;d=0;e=9.999999747378752e-05;f=0.0;h=0.0;k=0.0;l=1.9999999494757503e-04;m=0.0;n=0.0;o=0.0;p=2.9999998514540493e-04;do{C=c[i+(d<<2)>>2]|0;w=+g[C+8>>2]-s;x=+g[C+12>>2]-r;A=+g[C+16>>2]-q;y=+g[j+(d<<4)>>2];z=+g[j+(d<<4)+4>>2];B=+g[j+(d<<4)+8>>2];e=w*y+e;f=w*z+f;h=w*B+h;k=x*y+k;l=x*z+l;m=x*B+m;n=A*y+n;o=A*z+o;p=A*B+p;d=d+1|0}while((d|0)!=(D|0));g[G+144>>2]=e;g[G+144+4>>2]=f;g[G+144+8>>2]=h;g[G+144+16>>2]=k;g[G+144+20>>2]=l;g[G+144+24>>2]=m;g[G+144+32>>2]=n;g[G+144+36>>2]=o;g[G+144+40>>2]=p}if((a[26680]|0)==0?mz(26680)|0:0){g[6830]=9.999999747378752e-05;c[6831]=16}oc(G+144|0,G+96|0,G+48|0);c[E+108>>2]=c[E+228>>2];c[E+108+4>>2]=c[E+228+4>>2];c[E+108+8>>2]=c[E+228+8>>2];c[E+108+12>>2]=c[E+228+12>>2];c[E+60>>2]=c[G+96>>2];c[E+60+4>>2]=c[G+96+4>>2];c[E+60+8>>2]=c[G+96+8>>2];c[E+60+12>>2]=c[G+96+12>>2];c[E+76>>2]=c[G+96+16>>2];c[E+76+4>>2]=c[G+96+16+4>>2];c[E+76+8>>2]=c[G+96+16+8>>2];c[E+76+12>>2]=c[G+96+16+12>>2];c[E+92>>2]=c[G+96+32>>2];c[E+92+4>>2]=c[G+96+32+4>>2];c[E+92+8>>2]=c[G+96+32+8>>2];c[E+92+12>>2]=c[G+96+32+12>>2];l=+g[E+132>>2];J=+g[E+60>>2];m=+g[E+148>>2];I=+g[E+64>>2];n=+g[E+164>>2];z=+g[E+68>>2];o=+g[E+136>>2];p=+g[E+152>>2];q=+g[E+168>>2];r=+g[E+140>>2];s=+g[E+156>>2];B=+g[E+172>>2];H=+g[E+76>>2];e=+g[E+80>>2];A=+g[E+84>>2];k=+g[E+92>>2];h=+g[E+96>>2];f=+g[E+100>>2];t=(l*J+m*I+n*z)*J+(J*o+I*p+z*q)*I+(J*r+I*s+z*B)*z;u=(l*J+m*I+n*z)*H+(J*o+I*p+z*q)*e+(J*r+I*s+z*B)*A;v=(l*J+m*I+n*z)*k+(J*o+I*p+z*q)*h+(J*r+I*s+z*B)*f;w=(l*H+m*e+n*A)*J+(o*H+p*e+q*A)*I+(r*H+s*e+B*A)*z;x=(l*H+m*e+n*A)*H+(o*H+p*e+q*A)*e+(r*H+s*e+B*A)*A;y=(l*H+m*e+n*A)*k+(o*H+p*e+q*A)*h+(r*H+s*e+B*A)*f;z=J*(l*k+m*h+n*f)+(o*k+p*h+q*f)*I+(r*k+s*h+B*f)*z;A=H*(l*k+m*h+n*f)+(o*k+p*h+q*f)*e+(r*k+s*h+B*f)*A;B=(l*k+m*h+n*f)*k+(o*k+p*h+q*f)*h+(r*k+s*h+B*f)*f;g[E+180>>2]=t;g[E+184>>2]=u;g[E+188>>2]=v;g[E+192>>2]=0.0;g[E+196>>2]=w;g[E+200>>2]=x;g[E+204>>2]=y;g[E+208>>2]=0.0;g[E+212>>2]=z;g[E+216>>2]=A;g[E+220>>2]=B;g[E+224>>2]=0.0;c[E+316>>2]=0;c[E+316+4>>2]=0;c[E+316+8>>2]=0;c[E+316+12>>2]=0;c[E+316+16>>2]=0;c[E+316+20>>2]=0;c[E+316+24>>2]=0;c[E+316+28>>2]=0;if((D|0)>0){i=c[E+32>>2]|0;j=c[E+12>>2]|0;q=+g[E+228>>2];r=+g[E+232>>2];s=+g[E+236>>2];d=0;p=0.0;o=0.0;n=0.0;m=0.0;l=0.0;e=0.0;do{C=c[i+(d<<2)>>2]|0;L=+g[j+(d<<2)>>2];I=+g[C+40>>2]*L;K=L*+g[C+44>>2];L=L*+g[C+48>>2];p=I+p;g[E+316>>2]=p;o=K+o;g[E+320>>2]=o;n=L+n;g[E+324>>2]=n;H=+g[C+8>>2]-q;J=+g[C+12>>2]-r;M=+g[C+16>>2]-s;m=m+(L*J-K*M);g[E+332>>2]=m;l=I*M-L*H+l;g[E+336>>2]=l;e=K*H-I*J+e;g[E+340>>2]=e;d=d+1|0}while((d|0)!=(D|0));C=E+316|0;d=E+332|0}else{C=E+316|0;d=E+332|0;p=0.0;o=0.0;n=0.0;m=0.0;l=0.0;e=0.0}L=+g[E+128>>2];M=1.0-+g[E+356>>2];g[E+316>>2]=p*L*M;g[E+320>>2]=L*o*M;g[E+324>>2]=L*n*M;g[E+328>>2]=0.0;M=1.0-+g[E+360>>2];g[d>>2]=(t*m+u*l+v*e)*M;g[E+336>>2]=(m*w+l*x+e*y)*M;g[E+340>>2]=M*(m*z+l*A+e*B);g[E+344>>2]=0.0;i=E+244|0;j=i+72|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(j|0));e=+g[E+364>>2];a:do if(e>0.0?(c[E+24>>2]|0)>0:0){d=0;while(1){j=c[(c[E+32>>2]|0)+(d<<2)>>2]|0;i=c[E+52>>2]|0;H=+g[i+(d<<4)>>2];I=+g[i+(d<<4)+4>>2];J=+g[i+(d<<4)+8>>2];K=+g[j+8>>2];L=+g[j+12>>2];M=+g[j+16>>2];L=L+e*(H*+g[E+76>>2]+I*+g[E+80>>2]+J*+g[E+84>>2]+ +g[E+112>>2]-L);M=M+e*(H*k+I*h+J*f+ +g[E+116>>2]-M);g[j+8>>2]=K+e*(H*+g[E+60>>2]+I*+g[E+64>>2]+J*+g[E+68>>2]+ +g[E+108>>2]-K);g[j+12>>2]=L;g[j+16>>2]=M;g[j+20>>2]=0.0;d=d+1|0;if((d|0)>=(c[E+24>>2]|0))break a;k=+g[E+92>>2];h=+g[E+96>>2];f=+g[E+100>>2];e=+g[E+364>>2]}}while(0);if(a[E+377>>0]|0){i=c[E+32>>2]|0;j=c[i>>2]|0;e=+g[j+8>>2];p=+g[j+12>>2];q=+g[j+16>>2];f=+g[j+20>>2];if((D|0)>1){d=1;l=e;o=e;m=f;n=q;k=f;h=p;f=p;e=q;do{j=c[i+(d<<2)>>2]|0;J=+g[j+8>>2];o=J>2];f=K>2];n=L>2];k=M>2]=o;g[G+16+4>>2]=f;g[G+16+8>>2]=n;g[G+16+12>>2]=k;g[G+16+16>>2]=l;g[G+16+20>>2]=h;g[G+16+24>>2]=e;g[G+16+28>>2]=m;d=c[E+348>>2]|0;if(!d){d=c[b+1052>>2]|0;if(!d){c[7182]=(c[7182]|0)+1;d=xb(63)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}i=d;j=i+44|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(j|0))}else c[b+1052>>2]=0;c[d+32>>2]=0;c[d+36>>2]=E;c[d+40>>2]=0;c[d>>2]=c[G+16>>2];c[d+4>>2]=c[G+16+4>>2];c[d+8>>2]=c[G+16+8>>2];c[d+12>>2]=c[G+16+12>>2];c[d+16>>2]=c[G+16+16>>2];c[d+20>>2]=c[G+16+20>>2];c[d+24>>2]=c[G+16+24>>2];c[d+28>>2]=c[G+16+28>>2];ue(b+1048|0,c[b+1048>>2]|0,d);c[b+1060>>2]=(c[b+1060>>2]|0)+1;c[E+348>>2]=d}else{K=+g[b+452>>2];L=K*+g[E+320>>2]*3.0;M=K*+g[E+324>>2]*3.0;g[G>>2]=+g[C>>2]*K*3.0;g[G+4>>2]=L;g[G+8>>2]=M;g[G+12>>2]=0.0;Bg(b+1048|0,d,G+16|0,G,+g[b+464>>2])|0}}d=c[b+1112>>2]|0}F=F+1|0}while((F|0)<(d|0))}d=c[3084]|0;b=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=b;if(b|0){sa=G;return}do if(c[d+4>>2]|0){la(G+144|0,0)|0;b=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[G+144+4>>2]|0)-(c[b+4>>2]|0)+(((c[G+144>>2]|0)-(c[b>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=G;return}}while(0);c[3084]=c[d+20>>2];sa=G;return}function Zb(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0,L=0,M=0,N=0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0,aa=0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0.0,ma=0.0,na=0.0;L=sa;sa=sa+64|0;if(!(c[b+12>>2]|0)){sa=L;return}N=(a[b+16>>0]|0)!=0;i=N?e:d;N=N?d:e;f=c[i+4>>2]|0;K=c[N+4>>2]|0;i=c[i+12>>2]|0;_=+g[i>>2];Z=+g[i+16>>2];Y=+g[i+32>>2];X=+g[i+4>>2];W=+g[i+20>>2];m=+g[i+36>>2];j=+g[i+8>>2];p=+g[i+24>>2];y=+g[i+40>>2];R=+g[i+48>>2];Q=+g[i+52>>2];P=+g[i+56>>2];$=c[N+12>>2]|0;V=+g[$>>2];U=+g[$+16>>2];n=+g[$+32>>2];T=+g[$+4>>2];S=+g[$+20>>2];o=+g[$+36>>2];v=+g[$+8>>2];t=+g[$+24>>2];r=+g[$+40>>2];O=-+g[$+48>>2];G=-+g[$+52>>2];H=-+g[$+56>>2];I=+g[i>>2];J=+g[i+16>>2];F=+g[i+32>>2];D=+g[i+4>>2];C=+g[i+20>>2];B=+g[i+36>>2];u=+g[i+8>>2];s=+g[i+24>>2];q=+g[i+40>>2];i=c[(c[f>>2]|0)+64>>2]|0;l=-+g[K+48>>2];k=-+g[K+52>>2];E=-+g[K+56>>2];g[L+48>>2]=(_*V+Z*U+Y*n)*l+(_*T+Z*S+Y*o)*k+(_*v+Z*t+Y*r)*E;g[L+48+4>>2]=(X*V+W*U+m*n)*l+(X*T+W*S+m*o)*k+(X*v+W*t+m*r)*E;g[L+48+8>>2]=(j*V+p*U+y*n)*l+(j*T+p*S+y*o)*k+(j*v+p*t+y*r)*E;g[L+48+12>>2]=0.0;Za[i&127](L,f,L+48|0);E=+g[L>>2];y=+g[L+4>>2];p=+g[L+8>>2];j=+g[K+48>>2];k=+g[K+52>>2];l=+g[K+56>>2];m=l*(R*v+Q*t+P*r+(v*O+t*G+r*H)+((v*I+t*J+r*F)*E+(v*D+t*C+r*B)*y+(v*u+t*s+r*q)*p))+(j*(R*V+Q*U+P*n+(V*O+U*G+n*H)+((V*I+U*J+n*F)*E+(V*D+U*C+n*B)*y+(V*u+U*s+n*q)*p))+k*(R*T+Q*S+P*o+(T*O+S*G+o*H)+((T*I+S*J+o*F)*E+(T*D+S*C+o*B)*y+(T*u+S*s+o*q)*p)))-+g[K+64>>2];n=R*V+Q*U+P*n+(V*O+U*G+n*H)+((V*I+U*J+n*F)*E+(V*D+U*C+n*B)*y+(V*u+U*s+n*q)*p)-j*m;o=R*T+Q*S+P*o+(T*O+S*G+o*H)+((T*I+S*J+o*F)*E+(T*D+S*C+o*B)*y+(T*u+S*s+o*q)*p)-k*m;p=R*v+Q*t+P*r+(v*O+t*G+r*H)+((v*I+t*J+r*F)*E+(v*D+t*C+r*B)*y+(v*u+t*s+r*q)*p)-l*m;N=c[N+12>>2]|0;q=+g[N>>2];r=+g[N+4>>2];s=+g[N+8>>2];t=+g[N+16>>2];u=+g[N+20>>2];v=+g[N+24>>2];y=+g[N+32>>2];B=+g[N+36>>2];C=+g[N+40>>2];D=+g[N+48>>2];E=+g[N+52>>2];F=+g[N+56>>2];N=c[b+12>>2]|0;i=m<+g[N+752>>2];c[h+4>>2]=N;if(i){g[L+48>>2]=q*j+r*k+s*l;g[L+48+4>>2]=j*t+k*u+l*v;g[L+48+8>>2]=j*y+k*B+l*C;g[L+48+12>>2]=0.0;g[L+32>>2]=s*p+(q*n+r*o)+D;g[L+32+4>>2]=n*t+o*u+p*v+E;g[L+32+8>>2]=n*y+o*B+p*C+F;g[L+32+12>>2]=0.0;_a[c[(c[h>>2]|0)+16>>2]&15](h,L+48|0,L+32|0,m)}if((c[f+4>>2]|0)<7?(c[(c[h+4>>2]|0)+748>>2]|0)<(c[b+24>>2]|0):0){j=+g[K+56>>2];if(+w(+j)>.7071067690849304){l=+g[K+52>>2];_=1.0/+x(+(j*j+l*l));k=0.0;l=l*_;j=-(j*_)}else{_=+g[K+48>>2];k=+g[K+52>>2];j=1.0/+x(+(_*_+k*k));k=-(k*j);l=0.0;j=_*j}H=.019999999552965164/+va[c[(c[f>>2]|0)+16>>2]&15](f);H=(H>.39269909262657166?.39269909262657166:H)*.5;G=+A(+H)/+x(+(k*k+j*j+l*l));J=k*G;I=j*G;G=l*G;H=+z(+H);f=c[b+20>>2]|0;if((f|0)>0){i=0;do{t=+g[K+48>>2];_=+g[K+52>>2];D=+g[K+56>>2];B=6.2831854820251465/+(f|0)*+(i|0)*.5;Z=+A(+B)/+x(+(t*t+_*_+D*D));B=+z(+B);C=G*-(_*Z)+(J*B+H*-(t*Z))-I*-(D*Z);v=J*-(D*Z)+(I*B+H*-(_*Z))-G*-(t*Z);ca=I*-(t*Z)+(G*B+H*-(D*Z))-J*-(_*Z);F=H*B-J*-(t*Z)-I*-(_*Z)-G*-(D*Z);ha=D*Z*v+(t*Z*F+B*C)-_*Z*ca;ga=t*Z*ca+(B*v+_*Z*F)-D*Z*C;ka=_*Z*C+(D*Z*F+B*ca)-t*Z*v;ca=B*F-t*Z*C-_*Z*v-D*Z*ca;N=(a[b+16>>0]|0)!=0;aa=N?e:d;N=N?d:e;f=c[aa+4>>2]|0;$=c[N+4>>2]|0;aa=c[aa+12>>2]|0;Z=+g[aa>>2];D=+g[aa+4>>2];v=+g[aa+8>>2];_=+g[aa+16>>2];C=+g[aa+20>>2];t=+g[aa+24>>2];F=+g[aa+32>>2];B=+g[aa+36>>2];r=+g[aa+40>>2];T=+g[aa+48>>2];U=+g[aa+52>>2];V=+g[aa+56>>2];aa=c[N+12>>2]|0;P=+g[aa>>2];Q=+g[aa+16>>2];n=+g[aa+32>>2];R=+g[aa+4>>2];S=+g[aa+20>>2];o=+g[aa+36>>2];u=+g[aa+8>>2];s=+g[aa+24>>2];q=+g[aa+40>>2];W=-+g[aa+48>>2];X=-+g[aa+52>>2];Y=-+g[aa+56>>2];fa=ha*(2.0/(ha*ha+ga*ga+ka*ka+ca*ca));l=ga*(2.0/(ha*ha+ga*ga+ka*ka+ca*ca));ba=ka*(2.0/(ha*ha+ga*ga+ka*ka+ca*ca));ma=v*(ha*ba-ca*l)+(D*(ha*l+ca*ba)+Z*(1.0-(ga*l+ka*ba)));ja=v*(ga*ba+ca*fa)+(Z*(ha*l-ca*ba)+D*(1.0-(ha*fa+ka*ba)));j=Z*(ha*ba+ca*l)+D*(ga*ba-ca*fa)+v*(1.0-(ha*fa+ga*l));la=t*(ha*ba-ca*l)+(C*(ha*l+ca*ba)+_*(1.0-(ga*l+ka*ba)));ia=t*(ga*ba+ca*fa)+(_*(ha*l-ca*ba)+C*(1.0-(ha*fa+ka*ba)));y=_*(ha*ba+ca*l)+C*(ga*ba-ca*fa)+t*(1.0-(ha*fa+ga*l));na=r*(ha*ba-ca*l)+(B*(ha*l+ca*ba)+F*(1.0-(ga*l+ka*ba)));ka=r*(ga*ba+ca*fa)+(F*(ha*l-ca*ba)+B*(1.0-(ha*fa+ka*ba)));l=F*(ha*ba+ca*l)+B*(ga*ba-ca*fa)+r*(1.0-(ha*fa+ga*l));ga=+g[aa>>2];fa=+g[aa+16>>2];ha=+g[aa+32>>2];ca=+g[aa+4>>2];ba=+g[aa+20>>2];da=+g[aa+36>>2];k=+g[aa+8>>2];p=+g[aa+24>>2];m=+g[aa+40>>2];aa=c[(c[f>>2]|0)+64>>2]|0;ea=-+g[$+48>>2];O=-+g[$+52>>2];E=-+g[$+56>>2];g[L+32>>2]=(ha*na+(ga*ma+fa*la))*ea+(da*na+(ca*ma+ba*la))*O+(m*na+(k*ma+p*la))*E;g[L+32+4>>2]=(ha*ka+(ga*ja+fa*ia))*ea+(da*ka+(ca*ja+ba*ia))*O+(m*ka+(k*ja+p*ia))*E;g[L+32+8>>2]=(ha*l+(ga*j+fa*y))*ea+(da*l+(ca*j+ba*y))*O+(m*l+(k*j+p*y))*E;g[L+32+12>>2]=0.0;Za[aa&127](L+48|0,f,L+32|0);E=+g[L+48>>2];y=+g[L+48+4>>2];p=+g[L+48+8>>2];j=+g[$+48>>2];k=+g[$+52>>2];l=+g[$+56>>2];m=l*(T*u+U*s+V*q+(u*W+s*X+q*Y)+((Z*u+_*s+F*q)*E+(D*u+C*s+B*q)*y+(v*u+t*s+r*q)*p))+(j*(T*P+U*Q+V*n+(P*W+Q*X+n*Y)+((Z*P+_*Q+F*n)*E+(D*P+C*Q+B*n)*y+(v*P+t*Q+r*n)*p))+k*(T*R+U*S+V*o+(R*W+S*X+o*Y)+((Z*R+_*S+F*o)*E+(D*R+C*S+B*o)*y+(v*R+t*S+r*o)*p)))-+g[$+64>>2];n=T*P+U*Q+V*n+(P*W+Q*X+n*Y)+((Z*P+_*Q+F*n)*E+(D*P+C*Q+B*n)*y+(v*P+t*Q+r*n)*p)-j*m;o=T*R+U*S+V*o+(R*W+S*X+o*Y)+((Z*R+_*S+F*o)*E+(D*R+C*S+B*o)*y+(v*R+t*S+r*o)*p)-k*m;p=T*u+U*s+V*q+(u*W+s*X+q*Y)+((Z*u+_*s+F*q)*E+(D*u+C*s+B*q)*y+(v*u+t*s+r*q)*p)-l*m;N=c[N+12>>2]|0;q=+g[N>>2];r=+g[N+4>>2];s=+g[N+8>>2];t=+g[N+16>>2];u=+g[N+20>>2];v=+g[N+24>>2];y=+g[N+32>>2];B=+g[N+36>>2];C=+g[N+40>>2];D=+g[N+48>>2];E=+g[N+52>>2];F=+g[N+56>>2];N=c[b+12>>2]|0;$=m<+g[N+752>>2];c[h+4>>2]=N;if($){g[L+32>>2]=q*j+r*k+s*l;g[L+32+4>>2]=j*t+k*u+l*v;g[L+32+8>>2]=j*y+k*B+l*C;g[L+32+12>>2]=0.0;g[L+16>>2]=s*p+(q*n+r*o)+D;g[L+16+4>>2]=n*t+o*u+p*v+E;g[L+16+8>>2]=n*y+o*B+p*C+F;g[L+16+12>>2]=0.0;_a[c[(c[h>>2]|0)+16>>2]&15](h,L+32|0,L+16|0,m)}i=i+1|0;f=c[b+20>>2]|0}while((i|0)<(f|0))}}do if((a[b+8>>0]|0?c[(c[b+12>>2]|0)+748>>2]|0:0)?(M=c[h+4>>2]|0,c[M+748>>2]|0):0){f=c[M+740>>2]|0;i=c[(c[h+8>>2]|0)+8>>2]|0;if((f|0)==(i|0)){re(M,f+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(M,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,i+4|0);break}}while(0);sa=L;return}function _b(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0,A=0.0,B=0.0,C=0.0,D=0.0,E=0,F=0,G=0;G=sa;sa=sa+784|0;c[G+168+8>>2]=0;c[G+168+12>>2]=1065353216;c[G+168+16>>2]=1065353216;c[G+168+20>>2]=1065353216;g[G+168+24>>2]=0.0;c[G+168>>2]=9480;c[G+168+4>>2]=8;g[G+168+28>>2]=0.0;g[G+168+44>>2]=0.0;E=c[e+4>>2]|0;F=c[e+12>>2]|0;z=c[E+4>>2]|0;if((z|0)<20){c[G+600>>2]=6448;c[G+600+168>>2]=0;g[G+600+172>>2]=0.0;c[G+600+164>>2]=c[f+4>>2];g[G+240+308>>2]=9.999999747378752e-05;a[G+240+332>>0]=0;c[G+224>>2]=7772;c[G+224+4>>2]=G+240;c[G+224+8>>2]=G+168;c[G+224+12>>2]=E;c[G+152>>2]=12048;c[G+152+4>>2]=G+240;c[G+152+8>>2]=G+168;c[G+152+12>>2]=E;E=(c[f+16>>2]&8|0)==0?G+224|0:G+152|0;if((La[c[(c[E>>2]|0)+8>>2]&3](E,b,d,F,F,G+600|0)|0?(h=G+600+132|0,i=+g[h>>2],j=+g[G+600+136>>2],k=+g[G+600+140>>2],i*i+j*j+k*k>9.999999747378752e-05):0)?(l=+g[G+600+164>>2],l<+g[f+4>>2]):0){D=1.0/+x(+(i*i+j*j+k*k));g[h>>2]=i*D;g[G+600+136>>2]=j*D;g[G+600+140>>2]=k*D;c[G+120>>2]=c[e+8>>2];c[G+120+4>>2]=0;c[G+120+8>>2]=c[h>>2];c[G+120+8+4>>2]=c[h+4>>2];c[G+120+8+8>>2]=c[h+8>>2];c[G+120+8+12>>2]=c[h+12>>2];g[G+120+24>>2]=l;+ya[c[(c[f>>2]|0)+12>>2]&15](f,G+120|0,1)}sa=G;return}if((z+-21|0)>>>0>=9){if((z|0)!=31){sa=G;return}h=c[E+64>>2]|0;e=c[e+8>>2]|0;c[G+600>>2]=8568;c[G+600+4>>2]=e;c[G+600+8>>2]=E;c[G+600+12>>2]=F;c[G+600+16>>2]=b;c[G+600+20>>2]=d;c[G+600+24>>2]=f;if(!h){b=c[E+16>>2]|0;if((b|0)>0){h=0;do{ef(G+600|0,h);h=h+1|0}while((h|0)<(b|0))}}else{C=+g[F+48>>2];n=+g[b+48>>2]-C;B=+g[F+52>>2];o=+g[b+52>>2]-B;y=+g[F+56>>2];p=+g[b+56>>2]-y;s=+g[F>>2];r=+g[F+16>>2];q=+g[F+32>>2];v=+g[F+4>>2];u=+g[F+20>>2];t=+g[F+36>>2];D=+g[F+8>>2];A=+g[F+24>>2];w=+g[F+40>>2];g[G+240>>2]=n*s+o*r+p*q;g[G+240+4>>2]=n*v+o*u+p*t;g[G+240+8>>2]=n*D+o*A+p*w;g[G+240+12>>2]=0.0;C=+g[d+48>>2]-C;B=+g[d+52>>2]-B;y=+g[d+56>>2]-y;g[G+224>>2]=q*y+(r*B+C*s);g[G+224+4>>2]=t*y+(u*B+C*v);g[G+224+8>>2]=w*y+(A*B+C*D);g[G+224+12>>2]=0.0;Pd(c[h>>2]|0,G+240|0,G+224|0,G+600|0)}sa=G;return}i=+g[F>>2];r=+g[F+16>>2];s=+g[F+32>>2];j=+g[F+4>>2];v=+g[F+20>>2];w=+g[F+36>>2];k=+g[F+8>>2];A=+g[F+24>>2];B=+g[F+40>>2];C=-+g[F+48>>2];D=-+g[F+52>>2];y=-+g[F+56>>2];o=+g[b+48>>2];p=+g[b+52>>2];l=+g[b+56>>2];g[G+152>>2]=i*C+r*D+s*y+(i*o+r*p+s*l);g[G+152+4>>2]=j*C+v*D+w*y+(j*o+v*p+w*l);g[G+152+8>>2]=k*C+A*D+B*y+(k*o+A*p+B*l);g[G+152+12>>2]=0.0;t=+g[d+48>>2];u=+g[d+52>>2];q=+g[d+56>>2];i=i*C+r*D+s*y+(i*t+r*u+s*q);j=j*C+v*D+w*y+(j*t+v*u+w*q);k=k*C+A*D+B*y+(k*t+A*u+B*q);g[G+120>>2]=i;g[G+120+4>>2]=j;g[G+120+8>>2]=k;g[G+120+12>>2]=0.0;switch(z|0){case 21:{h=c[e+8>>2]|0;e=c[f+16>>2]|0;c[G+4>>2]=c[G+152>>2];c[G+4+4>>2]=c[G+152+4>>2];c[G+4+8>>2]=c[G+152+8>>2];c[G+4+12>>2]=c[G+152+12>>2];c[G+20>>2]=c[G+120>>2];c[G+20+4>>2]=c[G+120+4>>2];c[G+20+8>>2]=c[G+120+8>>2];c[G+20+12>>2]=c[G+120+12>>2];c[G+36>>2]=e;g[G+40>>2]=1.0;c[G>>2]=8520;c[G+44>>2]=f;c[G+48>>2]=h;c[G+52>>2]=E;c[G+56>>2]=c[F>>2];c[G+56+4>>2]=c[F+4>>2];c[G+56+8>>2]=c[F+8>>2];c[G+56+12>>2]=c[F+12>>2];c[G+72>>2]=c[F+16>>2];c[G+72+4>>2]=c[F+16+4>>2];c[G+72+8>>2]=c[F+16+8>>2];c[G+72+12>>2]=c[F+16+12>>2];c[G+88>>2]=c[F+32>>2];c[G+88+4>>2]=c[F+32+4>>2];c[G+88+8>>2]=c[F+32+8>>2];c[G+88+12>>2]=c[F+32+12>>2];c[G+104>>2]=c[F+48>>2];c[G+104+4>>2]=c[F+48+4>>2];c[G+104+8>>2]=c[F+48+8>>2];c[G+104+12>>2]=c[F+48+12>>2];c[G+40>>2]=c[f+4>>2];h=c[E+48>>2]|0;c[G+224>>2]=9692;c[G+224+4>>2]=h;c[G+224+8>>2]=G;h=c[E+52>>2]|0;c[G+600>>2]=0;c[G+600+4>>2]=0;c[G+600+8>>2]=0;c[G+600+12>>2]=0;c[G+240>>2]=0;c[G+240+4>>2]=0;c[G+240+8>>2]=0;c[G+240+12>>2]=0;if(!(a[h+60>>0]|0))Xd(h,G+224|0,G+152|0,i,j,k,G+600|0,G+240|0);else Dd(h,G+224|0,G+152|0,i,j,k,G+600|0,G+240|0,c[h+56>>2]|0);break}case 25:{e=c[e+8>>2]|0;z=c[f+16>>2]|0;c[G+600+4>>2]=c[G+152>>2];c[G+600+4+4>>2]=c[G+152+4>>2];c[G+600+4+8>>2]=c[G+152+8>>2];c[G+600+4+12>>2]=c[G+152+12>>2];c[G+600+20>>2]=c[G+120>>2];c[G+600+20+4>>2]=c[G+120+4>>2];c[G+600+20+8>>2]=c[G+120+8>>2];c[G+600+20+12>>2]=c[G+120+12>>2];c[G+600+36>>2]=z;g[G+600+40>>2]=1.0;c[G+600>>2]=8520;c[G+600+44>>2]=f;c[G+600+48>>2]=e;c[G+600+52>>2]=E;c[G+600+56>>2]=c[F>>2];c[G+600+56+4>>2]=c[F+4>>2];c[G+600+56+8>>2]=c[F+8>>2];c[G+600+56+12>>2]=c[F+12>>2];c[G+600+72>>2]=c[F+16>>2];c[G+600+72+4>>2]=c[F+16+4>>2];c[G+600+72+8>>2]=c[F+16+8>>2];c[G+600+72+12>>2]=c[F+16+12>>2];c[G+600+88>>2]=c[F+32>>2];c[G+600+88+4>>2]=c[F+32+4>>2];c[G+600+88+8>>2]=c[F+32+8>>2];c[G+600+88+12>>2]=c[F+32+12>>2];c[G+600+104>>2]=c[F+48>>2];c[G+600+104+4>>2]=c[F+48+4>>2];c[G+600+104+8>>2]=c[F+48+8>>2];c[G+600+104+12>>2]=c[F+48+12>>2];c[G+600+40>>2]=c[f+4>>2];ab[c[(c[E>>2]|0)+144>>2]&127](E,G+600|0,G+152|0,G+120|0);break}default:{k=+g[F>>2];j=+g[F+4>>2];i=+g[F+8>>2];m=s*l+(r*p+o*k)+(s*y+(r*D+k*C));n=w*l+(v*p+o*j)+(w*y+(v*D+j*C));l=B*l+(A*p+o*i)+(B*y+(A*D+i*C));k=s*q+(r*u+t*k)+(s*y+(r*D+k*C));j=w*q+(v*u+t*j)+(w*y+(v*D+j*C));i=B*q+(A*u+t*i)+(B*y+(A*D+i*C));e=c[e+8>>2]|0;z=c[f+16>>2]|0;g[G+600+4>>2]=m;g[G+600+8>>2]=n;g[G+600+12>>2]=l;g[G+600+16>>2]=0.0;g[G+600+20>>2]=k;g[G+600+24>>2]=j;g[G+600+28>>2]=i;g[G+600+32>>2]=0.0;c[G+600+36>>2]=z;g[G+600+40>>2]=1.0;c[G+600>>2]=8544;c[G+600+44>>2]=f;c[G+600+48>>2]=e;c[G+600+52>>2]=E;c[G+600+56>>2]=c[F>>2];c[G+600+56+4>>2]=c[F+4>>2];c[G+600+56+8>>2]=c[F+8>>2];c[G+600+56+12>>2]=c[F+12>>2];c[G+600+72>>2]=c[F+16>>2];c[G+600+72+4>>2]=c[F+16+4>>2];c[G+600+72+8>>2]=c[F+16+8>>2];c[G+600+72+12>>2]=c[F+16+12>>2];c[G+600+88>>2]=c[F+32>>2];c[G+600+88+4>>2]=c[F+32+4>>2];c[G+600+88+8>>2]=c[F+32+8>>2];c[G+600+88+12>>2]=c[F+32+12>>2];c[G+600+104>>2]=c[F+48>>2];c[G+600+104+4>>2]=c[F+48+4>>2];c[G+600+104+8>>2]=c[F+48+8>>2];c[G+600+104+12>>2]=c[F+48+12>>2];c[G+600+40>>2]=c[f+4>>2];g[G+240>>2]=m;g[G+240+4>>2]=n;g[G+240+8>>2]=l;g[G+240+12>>2]=0.0;if(k>2]=k;if(j>2]=j;if(i>2]=i;g[G+224>>2]=m;g[G+224+4>>2]=n;g[G+224+8>>2]=l;g[G+224+12>>2]=0.0;if(m>2]=k;if(n>2]=j;if(l>2]=i;ab[c[(c[E>>2]|0)+64>>2]&127](E,G+600|0,G+240|0,G+224|0)}}sa=G;return}function $b(b,e,f,g,h,i){b=b|0;e=+e;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;z=sa;sa=sa+560|0;c[z+536>>2]=0;y=z+540+12|0;Lv(e)|0;j=Q()|0;if((j|0)<0){Lv(-e)|0;e=-e;x=1;v=23755;j=Q()|0}else{x=(h&2049|0)!=0&1;v=(h&2048|0)==0?((h&1|0)==0?23756:23761):23758}do if(0==0&(j&2146435072|0)==2146435072){j=x+3|0;vm(b,32,f,j,h&-65537);fz(b,v,x);fz(b,e!=e|0.0!=0.0?(i&32|0?23782:23786):i&32|0?23774:23778,3);vm(b,32,f,j,h^8192)}else{n=+FH(e,z+536|0)*2.0;if(n!=0.0)c[z+536>>2]=(c[z+536>>2]|0)+-1;if((i|32|0)==97){p=(i&32|0)==0?v:v+9|0;o=x|2;do if(!(g>>>0>11|(12-g|0)==0)){e=8.0;j=12-g|0;do{j=j+-1|0;e=e*16.0}while((j|0)!=0);if((a[p>>0]|0)==45){e=-(e+(-n-e));break}else{e=n+e-e;break}}else e=n;while(0);k=c[z+536>>2]|0;j=(k|0)<0?0-k|0:k;j=kl(j,((j|0)<0)<<31>>31,y)|0;if((j|0)==(y|0)){a[z+540+11>>0]=48;j=z+540+11|0}a[j+-1>>0]=((31?k>>31:k)&2)+43;m=j+-2|0;a[m>>0]=i+15;j=z;do{x=~~e;k=j+1|0;a[j>>0]=i&32|d[480+x>>0];e=(e-+(x|0))*16.0;if((k-z|0)==1?!((h&8|0)==0&((g|0)<1&e==0.0)):0){a[k>>0]=46;j=j+2|0}else j=k}while(e!=0.0);l=j;if((g|0)!=0?(-2-z+l|0)<(g|0):0){g=g+2+y-m|0;j=y;k=m}else{g=y-z-m+l|0;j=y;k=m}y=g+o|0;vm(b,32,f,y,h);fz(b,p,o);vm(b,48,f,y,h^65536);fz(b,z,l-z|0);j=j-k|0;vm(b,48,g-(l-z+j)|0,0,0);fz(b,m,j);vm(b,32,f,y,h^8192);j=y;break}k=(g|0)<0?6:g;if(n!=0.0){j=(c[z+536>>2]|0)+-28|0;c[z+536>>2]=j;e=n*268435456.0}else{e=n;j=c[z+536>>2]|0}w=(j|0)<0?z+32|0:z+32+288|0;g=w;do{t=~~e>>>0;c[g>>2]=t;g=g+4|0;e=(e-+(t>>>0))*1.0e9}while(e!=0.0);if((j|0)>0){o=w;while(1){m=(j|0)<29?j:29;j=g+-4|0;if(j>>>0>=o>>>0){l=0;do{r=it(c[j>>2]|0,0,m|0)|0;r=xv(r|0,Q()|0,l|0,0)|0;s=Q()|0;l=VA(r|0,s|0,1e9,0)|0;t=Vr(l|0,Q()|0,-1e9,-1)|0;t=xv(r|0,s|0,t|0,Q()|0)|0;Q()|0;c[j>>2]=t;j=j+-4|0}while(j>>>0>=o>>>0);if(l){t=o+-4|0;c[t>>2]=l;l=t}else l=o}else l=o;a:do if(g>>>0>l>>>0){j=g;while(1){g=j+-4|0;if(c[g>>2]|0){g=j;break a}if(g>>>0>l>>>0)j=g;else break}}while(0);j=(c[z+536>>2]|0)-m|0;c[z+536>>2]=j;if((j|0)>0)o=l;else break}}else l=w;if((j|0)<0){do{p=0-j|0;p=(p|0)<9?p:9;if(l>>>0>>0){m=p?1e9>>>p:1e9;o=0;j=l;do{t=c[j>>2]|0;c[j>>2]=(p?t>>>p:t)+o;o=J(t&(1<>>0>>0);j=(c[l>>2]|0)==0?l+4|0:l;if(!o)l=j;else{c[g>>2]=o;g=g+4|0;l=j}}else l=(c[l>>2]|0)==0?l+4|0:l;j=(i|32|0)==102?w:l;t=g-j|0;g=((2?t>>2:t)|0)>(((k+25|0)/9|0)+1|0)?j+(((k+25|0)/9|0)+1<<2)|0:g;j=(c[z+536>>2]|0)+p|0;c[z+536>>2]=j}while((j|0)<0);j=l}else j=l;if(j>>>0>>0){l=w-j|0;l=(2?l>>2:l)*9|0;o=c[j>>2]|0;if(o>>>0>=10){m=10;do{m=m*10|0;l=l+1|0}while(o>>>0>=m>>>0)}}else l=0;m=k-((i|32|0)==102?0:l)+(((k|0)!=0&(i|32|0)==103)<<31>>31)|0;t=g-w|0;if((m|0)<(((2?t>>2:t)*9|0)+-9|0)){p=w+4+(((m+9216|0)/9|0)+-1024<<2)|0;m=m+9216+(J((m+9216|0)/9|0,-9)|0)|0;if((m|0)<8){o=10;while(1){o=o*10|0;if((m|0)<7)m=m+1|0;else break}}else o=10;q=c[p>>2]|0;m=(q>>>0)/(o>>>0)|0;s=J(m,o)|0;r=(p+4|0)==(g|0);if(!(r&(q-s|0)==0)){e=(m&1|0)==0?9007199254740992.0:9007199254740994.0;t=1?o>>>1:o;n=(q-s|0)>>>0>>0?.5:r&(q-s|0)==(t|0)?1.0:1.5;if(x){t=(a[v>>0]|0)==45;n=t?-n:n;e=t?-e:e}c[p>>2]=s;if(e+n!=e){t=s+o|0;c[p>>2]=t;if(t>>>0>999999999){m=p;while(1){l=m+-4|0;c[m>>2]=0;if(l>>>0>>0){j=j+-4|0;c[j>>2]=0}t=(c[l>>2]|0)+1|0;c[l>>2]=t;if(t>>>0>999999999)m=l;else{p=l;break}}}l=w-j|0;l=(2?l>>2:l)*9|0;o=c[j>>2]|0;if(o>>>0<10)m=p;else{m=10;do{m=m*10|0;l=l+1|0}while(o>>>0>=m>>>0);m=p}}else m=p}else m=p;s=m+4|0;g=g>>>0>s>>>0?s:g;s=j}else s=j;p=0-l|0;b:do if(g>>>0>s>>>0)while(1){j=g+-4|0;if(c[j>>2]|0){t=g;r=1;break b}if(j>>>0>s>>>0)g=j;else{t=j;r=0;break}}else{t=g;r=0}while(0);do if((i|32|0)==103){if((l|0)>-5?(k+(((k|0)!=0^1)&1)|0)>(l|0):0){m=i+-1|0;k=k+(((k|0)!=0^1)&1)+-1-l|0}else{m=i+-2|0;k=k+(((k|0)!=0^1)&1)+-1|0}if(!(h&8)){if(r?(u=c[t+-4>>2]|0,(u|0)!=0):0)if(!((u>>>0)%10|0)){j=0;g=10;do{g=g*10|0;j=j+1|0}while(!((u>>>0)%(g>>>0)|0|0))}else j=0;else j=9;g=t-w|0;g=((2?g>>2:g)*9|0)+-9|0;if((m|32|0)==102){i=g-j|0;i=(i|0)>0?i:0;k=(k|0)<(i|0)?k:i;break}else{i=g+l-j|0;i=(i|0)>0?i:0;k=(k|0)<(i|0)?k:i;break}}}else m=i;while(0);q=(k|0)!=0;g=q?1:(3?h>>>3:h)&1;o=(m|32|0)==102;if(o){p=0;j=(l|0)>0?l:0}else{j=(l|0)<0?p:l;j=kl(j,((j|0)<0)<<31>>31,y)|0;if((y-j|0)<2)do{j=j+-1|0;a[j>>0]=48}while((y-j|0)<2);a[j+-1>>0]=((31?l>>31:l)&2)+43;j=j+-2|0;a[j>>0]=m;p=j;j=y-j|0}j=x+1+k+g+j|0;vm(b,32,f,j,h);fz(b,v,x);vm(b,48,f,j,h^65536);if(o){m=s>>>0>w>>>0?w:s;l=m;do{g=kl(c[l>>2]|0,0,z+9|0)|0;if((l|0)==(m|0)){if((g|0)==(z+9|0)){a[z+8>>0]=48;g=z+8|0}}else if(g>>>0>z>>>0){mk(z|0,48,g-z|0)|0;do g=g+-1|0;while(g>>>0>z>>>0)}fz(b,g,z+9-g|0);l=l+4|0}while(l>>>0<=w>>>0);if(!((h&8|0)==0&(q^1)))fz(b,23790,1);if(l>>>0>>0&(k|0)>0)while(1){g=kl(c[l>>2]|0,0,z+9|0)|0;if(g>>>0>z>>>0){mk(z|0,48,g-z|0)|0;do g=g+-1|0;while(g>>>0>z>>>0)}fz(b,g,(k|0)<9?k:9);l=l+4|0;g=k+-9|0;if(!(l>>>0>>0&(k|0)>9)){k=g;break}else k=g}vm(b,48,k+9|0,9,0)}else{o=r?t:s+4|0;if(s>>>0>>0&(k|0)>-1){m=s;do{g=kl(c[m>>2]|0,0,z+9|0)|0;if((g|0)==(z+9|0)){a[z+8>>0]=48;g=z+8|0}do if((m|0)==(s|0)){l=g+1|0;fz(b,g,1);if((h&8|0)==0&(k|0)<1){g=l;break}fz(b,23790,1);g=l}else{if(g>>>0<=z>>>0)break;mk(z|0,48,g+(0-z)|0)|0;do g=g+-1|0;while(g>>>0>z>>>0)}while(0);x=z+9-g|0;fz(b,g,(k|0)>(x|0)?x:k);k=k-x|0;m=m+4|0}while(m>>>0>>0&(k|0)>-1)}vm(b,48,k+18|0,18,0);fz(b,p,y-p|0)}vm(b,32,f,j,h^8192)}while(0);sa=z;return ((j|0)<(f|0)?f:j)|0}function ac(b,d,e,f,h,i,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0.0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0.0;h=c[b+48>>2]|0;q=c[b+28>>2]|0;r=c[b+68>>2]|0;if(c[l+64>>2]&1|0){if((h|0)>0){i=c[b+136>>2]|0;f=0;p=c[b+192>>2]|0;do{m=i+(f<<2)|0;o=c[m>>2]|0;f=f+1|0;p=(J(p,1664525)|0)+1013904223|0;if(f>>>0<65537){e=(16?p>>>16:p)^p;if(f>>>0<257){e=(8?e>>>8:e)^e;if(f>>>0<17){e=(4?e>>>4:e)^e;u=(2?e>>>2:e)^e;e=f>>>0<5?(f>>>0<3?(1?u>>>1:u):0)^u:e}}}else e=p;u=i+(((e>>>0)%(f>>>0)|0)<<2)|0;c[m>>2]=c[u>>2];c[u>>2]=o}while((f|0)!=(h|0));c[b+192>>2]=p}if((c[l+20>>2]|0)>(d|0)){if((q|0)>0){h=c[b+116>>2]|0;f=0;o=c[b+192>>2]|0;do{i=h+(f<<2)|0;m=c[i>>2]|0;f=f+1|0;o=(J(o,1664525)|0)+1013904223|0;if(f>>>0<65537){e=(16?o>>>16:o)^o;if(f>>>0<257){e=(8?e>>>8:e)^e;if(f>>>0<17){e=(4?e>>>4:e)^e;u=(2?e>>>2:e)^e;e=f>>>0<5?(f>>>0<3?(1?u>>>1:u):0)^u:e}}}else e=o;u=h+(((e>>>0)%(f>>>0)|0)<<2)|0;c[i>>2]=c[u>>2];c[u>>2]=m}while((f|0)!=(q|0));c[b+192>>2]=o}if((r|0)>0){h=c[b+156>>2]|0;f=0;o=c[b+192>>2]|0;do{i=h+(f<<2)|0;m=c[i>>2]|0;f=f+1|0;o=(J(o,1664525)|0)+1013904223|0;if(f>>>0<65537){e=(16?o>>>16:o)^o;if(f>>>0<257){e=(8?e>>>8:e)^e;if(f>>>0<17){e=(4?e>>>4:e)^e;u=(2?e>>>2:e)^e;e=f>>>0<5?(f>>>0<3?(1?u>>>1:u):0)^u:e}}}else e=o;u=h+(((e>>>0)%(f>>>0)|0)<<2)|0;c[i>>2]=c[u>>2];c[u>>2]=m}while((f|0)!=(r|0));c[b+192>>2]=o}}}e=c[b+48>>2]|0;if(!(c[l+64>>2]&256)){if((e|0)>0){i=0;do{f=c[(c[b+136>>2]|0)+(i<<2)>>2]|0;h=c[b+56>>2]|0;if((c[h+(f*152|0)+136>>2]|0)>(d|0)){e=c[b+16>>2]|0;Tf(e+((c[h+(f*152|0)+144>>2]|0)*244|0)|0,e+((c[h+(f*152|0)+148>>2]|0)*244|0)|0,h+(f*152|0)|0);e=c[b+48>>2]|0}i=i+1|0}while((i|0)<(e|0))}if((c[l+20>>2]|0)<=(d|0))return 0.0;if((k|0)>0){e=0;do{f=j+(e<<2)|0;h=c[f>>2]|0;if(a[h+20>>0]|0){s=Xc(b,c[h+28>>2]|0,+g[l+12>>2])|0;u=Xc(b,c[(c[f>>2]|0)+32>>2]|0,+g[l+12>>2])|0;t=c[b+16>>2]|0;d=c[f>>2]|0;_a[c[(c[d>>2]|0)+24>>2]&15](d,t+(s*244|0)|0,t+(u*244|0)|0,+g[l+12>>2])}e=e+1|0}while((e|0)!=(k|0))}f=c[b+28>>2]|0;if((f|0)>0){e=0;do{u=c[(c[b+116>>2]|0)+(e<<2)>>2]|0;l=c[b+36>>2]|0;k=c[b+16>>2]|0;Zf(k+((c[l+(u*152|0)+144>>2]|0)*244|0)|0,k+((c[l+(u*152|0)+148>>2]|0)*244|0)|0,l+(u*152|0)|0);e=e+1|0}while((e|0)!=(f|0))}f=c[b+68>>2]|0;if((f|0)>0){e=0;do{h=c[(c[b+156>>2]|0)+(e<<2)>>2]|0;i=c[b+76>>2]|0;n=+g[(c[b+36>>2]|0)+((c[i+(h*152|0)+140>>2]|0)*152|0)+100>>2];if(n>0.0){n=n*+g[i+(h*152|0)+104>>2];g[i+(h*152|0)+120>>2]=-n;g[i+(h*152|0)+124>>2]=n;u=c[b+16>>2]|0;Tf(u+((c[i+(h*152|0)+144>>2]|0)*244|0)|0,u+((c[i+(h*152|0)+148>>2]|0)*244|0)|0,i+(h*152|0)|0)}e=e+1|0}while((e|0)!=(f|0))}f=c[b+88>>2]|0;if((f|0)<=0)return 0.0;e=0;do{h=c[b+96>>2]|0;n=+g[(c[b+36>>2]|0)+((c[h+(e*152|0)+140>>2]|0)*152|0)+100>>2];if(n>0.0){v=+g[h+(e*152|0)+104>>2];n=n*v>v?v:n*v;g[h+(e*152|0)+120>>2]=-n;g[h+(e*152|0)+124>>2]=n;u=c[b+16>>2]|0;Tf(u+((c[h+(e*152|0)+144>>2]|0)*244|0)|0,u+((c[h+(e*152|0)+148>>2]|0)*244|0)|0,h+(e*152|0)|0)}e=e+1|0}while((e|0)!=(f|0));return 0.0}if((e|0)>0){i=0;do{f=c[(c[b+136>>2]|0)+(i<<2)>>2]|0;h=c[b+56>>2]|0;if((c[h+(f*152|0)+136>>2]|0)>(d|0)){e=c[b+16>>2]|0;Tf(e+((c[h+(f*152|0)+144>>2]|0)*244|0)|0,e+((c[h+(f*152|0)+148>>2]|0)*244|0)|0,h+(f*152|0)|0);e=c[b+48>>2]|0}i=i+1|0}while((i|0)<(e|0))}if((c[l+20>>2]|0)<=(d|0))return 0.0;if((k|0)>0){e=0;do{f=j+(e<<2)|0;h=c[f>>2]|0;if(a[h+20>>0]|0){r=Xc(b,c[h+28>>2]|0,+g[l+12>>2])|0;u=Xc(b,c[(c[f>>2]|0)+32>>2]|0,+g[l+12>>2])|0;d=c[b+16>>2]|0;q=c[f>>2]|0;_a[c[(c[q>>2]|0)+24>>2]&15](q,d+(r*244|0)|0,d+(u*244|0)|0,+g[l+12>>2])}e=e+1|0}while((e|0)!=(k|0))}e=c[l+64>>2]|0;o=c[b+28>>2]|0;if(e&512|0){f=((4?e>>>4:e)&1)+1|0;if((o|0)<=0)return 0.0;e=0;do{h=c[(c[b+116>>2]|0)+(e<<2)>>2]|0;i=c[b+36>>2]|0;m=c[b+16>>2]|0;Zf(m+((c[i+(h*152|0)+144>>2]|0)*244|0)|0,m+((c[i+(h*152|0)+148>>2]|0)*244|0)|0,i+(h*152|0)|0);n=+g[i+(h*152|0)+100>>2];h=J(e,f)|0;i=c[(c[b+156>>2]|0)+(h<<2)>>2]|0;m=c[b+76>>2]|0;if(n>0.0){v=n*+g[m+(i*152|0)+104>>2];g[m+(i*152|0)+120>>2]=-v;g[m+(i*152|0)+124>>2]=v;u=c[b+16>>2]|0;Tf(u+((c[m+(i*152|0)+144>>2]|0)*244|0)|0,u+((c[m+(i*152|0)+148>>2]|0)*244|0)|0,m+(i*152|0)|0)}if(c[l+64>>2]&16|0?(s=c[(c[b+156>>2]|0)+(h+1<<2)>>2]|0,t=c[b+76>>2]|0,n>0.0):0){v=n*+g[t+(s*152|0)+104>>2];g[t+(s*152|0)+120>>2]=-v;g[t+(s*152|0)+124>>2]=v;u=c[b+16>>2]|0;Tf(u+((c[t+(s*152|0)+144>>2]|0)*244|0)|0,u+((c[t+(s*152|0)+148>>2]|0)*244|0)|0,t+(s*152|0)|0)}e=e+1|0}while((e|0)!=(o|0));return 0.0}if((o|0)>0){e=0;do{u=c[(c[b+116>>2]|0)+(e<<2)>>2]|0;l=c[b+36>>2]|0;k=c[b+16>>2]|0;Zf(k+((c[l+(u*152|0)+144>>2]|0)*244|0)|0,k+((c[l+(u*152|0)+148>>2]|0)*244|0)|0,l+(u*152|0)|0);e=e+1|0}while((e|0)!=(o|0))}f=c[b+68>>2]|0;if((f|0)>0){e=0;do{h=c[(c[b+156>>2]|0)+(e<<2)>>2]|0;i=c[b+76>>2]|0;n=+g[(c[b+36>>2]|0)+((c[i+(h*152|0)+140>>2]|0)*152|0)+100>>2];if(n>0.0){v=n*+g[i+(h*152|0)+104>>2];g[i+(h*152|0)+120>>2]=-v;g[i+(h*152|0)+124>>2]=v;u=c[b+16>>2]|0;Tf(u+((c[i+(h*152|0)+144>>2]|0)*244|0)|0,u+((c[i+(h*152|0)+148>>2]|0)*244|0)|0,i+(h*152|0)|0)}e=e+1|0}while((e|0)!=(f|0))}f=c[b+88>>2]|0;if((f|0)<=0)return 0.0;e=0;do{h=c[b+96>>2]|0;n=+g[(c[b+36>>2]|0)+((c[h+(e*152|0)+140>>2]|0)*152|0)+100>>2];if(n>0.0){v=+g[h+(e*152|0)+104>>2];v=n*v>v?v:n*v;g[h+(e*152|0)+120>>2]=-v;g[h+(e*152|0)+124>>2]=v;u=c[b+16>>2]|0;Tf(u+((c[h+(e*152|0)+144>>2]|0)*244|0)|0,u+((c[h+(e*152|0)+148>>2]|0)*244|0)|0,h+(e*152|0)|0)}e=e+1|0}while((e|0)!=(f|0));return 0.0}function bc(d,e,f,g,i){d=d|0;e=e|0;f=f|0;g=g|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;w=sa;sa=sa+64|0;c[w+56>>2]=e;v=w+40|0;j=0;e=0;n=0;a:while(1){do{do if((e|0)>-1)if((j|0)>(2147483647-e|0)){c[7184]=75;e=-1;break}else{e=j+e|0;break}while(0);r=c[w+56>>2]|0;j=a[r>>0]|0;if(!(j<<24>>24)){u=93;break a}k=r;b:while(1){switch(j<<24>>24){case 37:{u=10;break b}case 0:{j=k;break b}default:{}}t=k+1|0;c[w+56>>2]=t;j=a[t>>0]|0;k=t}c:do if((u|0)==10){u=0;j=k;do{if((a[k+1>>0]|0)!=37)break c;j=j+1|0;k=k+2|0;c[w+56>>2]=k}while((a[k>>0]|0)==37)}while(0);j=j-r|0;if(d|0)fz(d,r,j)}while((j|0)!=0);k=c[w+56>>2]|0;j=a[k+1>>0]|0;if(!(RH(j)|0)){q=-1;j=1}else{t=(a[k+2>>0]|0)==36;q=t?j+-48|0:-1;n=t?1:n;j=t?3:1}l=k+j|0;c[w+56>>2]=l;j=a[l>>0]|0;if(((j<<24>>24)+-32|0)>>>0>31|(1<<(j<<24>>24)+-32&75913|0)==0)k=0;else{k=0;m=(j<<24>>24)+-32|0;j=l;while(1){k=1<>2]=l;j=a[l>>0]|0;m=(j<<24>>24)+-32|0;if(m>>>0>31|(1<>24==42){m=l+1|0;j=a[m>>0]|0;if((RH(j)|0)!=0?(a[l+2>>0]|0)==36:0){c[i+(j+-48<<2)>>2]=10;j=c[g+((a[m>>0]|0)+-48<<3)>>2]|0;n=1;m=l+3|0}else{if(n|0){e=-1;break}if(d|0){n=(c[f>>2]|0)+(4-1)&~(4-1);j=c[n>>2]|0;c[f>>2]=n+4;n=0}else{j=0;n=0}}c[w+56>>2]=m;s=(j|0)<0;t=s?0-j|0:j;k=s?k|8192:k}else{j=yo(w+56|0)|0;if((j|0)<0){e=-1;break}t=j;m=c[w+56>>2]|0}do if((a[m>>0]|0)==46){j=m+1|0;if((a[j>>0]|0)!=42){c[w+56>>2]=j;o=yo(w+56|0)|0;j=c[w+56>>2]|0;break}l=m+2|0;j=a[l>>0]|0;if(RH(j)|0?(a[m+3>>0]|0)==36:0){c[i+(j+-48<<2)>>2]=10;o=c[g+((a[l>>0]|0)+-48<<3)>>2]|0;j=m+4|0;c[w+56>>2]=j;break}if(n|0){e=-1;break a}if(d|0){s=(c[f>>2]|0)+(4-1)&~(4-1);j=c[s>>2]|0;c[f>>2]=s+4}else j=0;c[w+56>>2]=l;o=j;j=l}else{o=-1;j=m}while(0);p=0;while(1){if(((a[j>>0]|0)+-65|0)>>>0>57){e=-1;break a}l=j+1|0;c[w+56>>2]=l;m=a[(a[j>>0]|0)+-65+(16+(p*58|0))>>0]|0;if(((m&255)+-1|0)>>>0<8){p=m&255;j=l}else break}if(!(m<<24>>24)){e=-1;break}l=(q|0)>-1;do if(m<<24>>24==19)if(l){e=-1;break a}else u=52;else{if(l){c[i+(q<<2)>>2]=m&255;s=g+(q<<3)|0;u=c[s+4>>2]|0;c[w+40>>2]=c[s>>2];c[w+40+4>>2]=u;u=52;break}if(!d){e=0;break a}eg(w+40|0,m&255,f);u=53}while(0);if((u|0)==52){u=0;if(d|0)u=53;else j=0}d:do if((u|0)==53){u=0;j=a[j>>0]|0;j=(p|0)!=0&(j&15|0)==3?j&-33:j;l=k&-65537;s=(k&8192|0)==0?k:l;e:do switch(j|0){case 110:switch((p&255)<<24>>24){case 0:{c[c[w+40>>2]>>2]=e;j=0;break d}case 1:{c[c[w+40>>2]>>2]=e;j=0;break d}case 2:{j=c[w+40>>2]|0;c[j>>2]=e;c[j+4>>2]=((e|0)<0)<<31>>31;j=0;break d}case 3:{b[c[w+40>>2]>>1]=e;j=0;break d}case 4:{a[c[w+40>>2]>>0]=e;j=0;break d}case 6:{c[c[w+40>>2]>>2]=e;j=0;break d}case 7:{j=c[w+40>>2]|0;c[j>>2]=e;c[j+4>>2]=((e|0)<0)<<31>>31;j=0;break d}default:{j=0;break d}}case 112:{j=120;k=o>>>0>8?o:8;l=s|8;u=65;break}case 88:case 120:{k=o;l=s;u=65;break}case 111:{j=c[w+40>>2]|0;k=c[w+40+4>>2]|0;l=tq(j,k,w+40|0)|0;p=l;q=0;m=23738;o=(s&8|0)==0|(o|0)>(v-l|0)?o:v-l+1|0;l=s;u=71;break}case 105:case 100:{j=c[w+40>>2]|0;k=c[w+40+4>>2]|0;if((k|0)<0){j=lv(0,0,j|0,k|0)|0;k=Q()|0;c[w+40>>2]=j;c[w+40+4>>2]=k;l=1;m=23738;u=70;break e}else{l=(s&2049|0)!=0&1;m=(s&2048|0)==0?((s&1|0)==0?23738:23740):23739;u=70;break e}}case 117:{l=0;m=23738;j=c[w+40>>2]|0;k=c[w+40+4>>2]|0;u=70;break}case 99:{a[w+39>>0]=c[w+40>>2];r=w+39|0;q=0;m=23738;p=1;k=l;j=v;break}case 109:{j=QH(c[7184]|0)|0;u=75;break}case 115:{j=c[w+40>>2]|0;j=(j|0)==0?23748:j;u=75;break}case 67:{c[w+48>>2]=c[w+40>>2];c[w+48+4>>2]=0;c[w+40>>2]=w+48;o=-1;l=w+48|0;u=80;break}case 83:if(!o){vm(d,32,t,0,s);j=0;u=90;break e}else{l=c[w+40>>2]|0;u=80;break e}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{j=$b(d,+h[w+40>>3],t,o,s,j)|0;break d}default:{q=0;m=23738;p=o;k=s;j=v}}while(0);f:do if((u|0)==65){r=c[w+40>>2]|0;s=c[w+40+4>>2]|0;p=tp(r,s,w+40|0,j&32)|0;m=(l&8|0)==0|(r|0)==0&(s|0)==0;q=m?0:2;m=m?23738:23738+(4?j>>>4:j)|0;o=k;j=r;k=s;u=71}else if((u|0)==70){p=kl(j,k,w+40|0)|0;q=l;l=s;u=71}else if((u|0)==75){u=0;s=yi(j,o)|0;r=j;q=0;m=23738;p=(s|0)==0?o:s-j|0;k=l;j=(s|0)==0?j+o|0:s}else if((u|0)==80){u=0;m=l;j=0;while(1){k=c[m>>2]|0;if(!k)break;k=nA(w+60|0,k)|0;if((k|0)<0|k>>>0>(o-j|0)>>>0){u=84;break}j=k+j|0;if(o>>>0>j>>>0)m=m+4|0;else break}if((u|0)==84){u=0;if((k|0)<0){e=-1;break a}}vm(d,32,t,j,s);if(!j){j=0;u=90}else{m=0;while(1){k=c[l>>2]|0;if(!k){u=90;break f}k=nA(w+60|0,k)|0;m=k+m|0;if((m|0)>(j|0)){u=90;break f}fz(d,w+60|0,k);if(m>>>0>=j>>>0){u=90;break}else l=l+4|0}}}while(0);if((u|0)==71){u=0;k=(j|0)!=0|(k|0)!=0;j=(o|0)!=0|k;k=v-p+((k^1)&1)|0;r=j?p:w+40|0;p=j?((o|0)>(k|0)?o:k):0;k=(o|0)>-1?l&-65537:l;j=v}else if((u|0)==90){u=0;vm(d,32,t,j,s^8192);j=(t|0)>(j|0)?t:j;break}o=j-r|0;p=(p|0)<(o|0)?o:p;s=p+q|0;j=(t|0)<(s|0)?s:t;vm(d,32,j,s,k);fz(d,m,q);vm(d,48,j,s,k^65536);vm(d,48,p,o,0);fz(d,r,o);vm(d,32,j,s,k^8192)}while(0)}g:do if((u|0)==93)if(!d)if(!n)e=0;else{e=1;while(1){j=c[i+(e<<2)>>2]|0;if(!j)break;eg(g+(e<<3)|0,j,f);e=e+1|0;if(e>>>0>=10){e=1;break g}}k=0;while(1){j=e+1|0;if(k|0){e=-1;break g}if(j>>>0>=10){e=1;break g}e=j;k=c[i+(j<<2)>>2]|0}}while(0);sa=w;return e|0}function cc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0,r=0,s=0.0;o=sa;sa=sa+80|0;i=c[b+28>>2]|0;d=c[f+64>>2]|0;if((d&4|0)!=0&(i|0)>0){e=c[b+36>>2]|0;h=c[b+76>>2]|0;if(!(d&16)){d=0;do{k=c[e+(d*152|0)+132>>2]|0;c[k+120>>2]=c[e+(d*152|0)+100>>2];c[k+124>>2]=c[h+((c[e+(d*152|0)+140>>2]|0)*152|0)+100>>2];d=d+1|0}while((d|0)!=(i|0))}else{d=0;do{k=c[e+(d*152|0)+132>>2]|0;c[k+120>>2]=c[e+(d*152|0)+100>>2];j=c[e+(d*152|0)+140>>2]|0;c[k+124>>2]=c[h+(j*152|0)+100>>2];c[k+128>>2]=c[h+((j+1|0)*152|0)+100>>2];d=d+1|0}while((d|0)!=(i|0))}}h=c[b+48>>2]|0;if((h|0)>0){d=0;do{i=c[b+56>>2]|0;j=c[i+(d*152|0)+132>>2]|0;k=c[j+44>>2]|0;e=i+(d*152|0)+100|0;if(k|0){n=+g[e>>2];r=c[j+28>>2]|0;m=1.0/+g[f+12>>2];l=n*+g[i+(d*152|0)+20>>2]*+g[r+352>>2]*m;p=n*+g[i+(d*152|0)+24>>2]*+g[r+356>>2]*m;g[k>>2]=+g[k>>2]+ +g[i+(d*152|0)+16>>2]*n*+g[r+348>>2]*m;g[k+4>>2]=l+ +g[k+4>>2];g[k+8>>2]=p+ +g[k+8>>2];p=+g[e>>2];q=c[j+32>>2]|0;l=1.0/+g[f+12>>2];m=p*+g[i+(d*152|0)+52>>2]*+g[q+352>>2]*l;n=p*+g[i+(d*152|0)+56>>2]*+g[q+356>>2]*l;g[k+32>>2]=+g[k+32>>2]+ +g[i+(d*152|0)+48>>2]*p*+g[q+348>>2]*l;g[k+36>>2]=m+ +g[k+36>>2];g[k+40>>2]=n+ +g[k+40>>2];n=+g[e>>2];m=1.0/+g[f+12>>2];l=+g[i+(d*152|0)+4>>2]*+g[r+548>>2]*n*m;p=n*+g[i+(d*152|0)+8>>2]*+g[r+552>>2]*m;g[k+16>>2]=+g[k+16>>2]+ +g[i+(d*152|0)>>2]*+g[r+544>>2]*n*m;g[k+20>>2]=l+ +g[k+20>>2];g[k+24>>2]=p+ +g[k+24>>2];p=+g[e>>2];l=1.0/+g[f+12>>2];m=+g[i+(d*152|0)+36>>2]*+g[q+548>>2]*p*l;n=p*+g[i+(d*152|0)+40>>2]*+g[q+552>>2]*l;g[k+48>>2]=+g[k+48>>2]+ +g[i+(d*152|0)+32>>2]*+g[q+544>>2]*p*l;g[k+52>>2]=m+ +g[k+52>>2];g[k+56>>2]=n+ +g[k+56>>2]}p=+g[e>>2];g[j+36>>2]=p;p=+w(+p);if(p>=+g[j+16>>2])a[j+20>>0]=0;d=d+1|0}while((d|0)!=(h|0))}d=c[b+8>>2]|0;if((d|0)>0){j=0;e=c[b+16>>2]|0;do{h=e+(j*244|0)|0;i=c[e+(j*244|0)+240>>2]|0;if(i){if(!(c[f+44>>2]|0)){h=e+(j*244|0)+176|0;m=+g[e+(j*244|0)+64>>2]+ +g[h>>2];g[h>>2]=m;h=e+(j*244|0)+180|0;n=+g[e+(j*244|0)+68>>2]+ +g[h>>2];g[h>>2]=n;h=e+(j*244|0)+184|0;l=+g[e+(j*244|0)+72>>2]+ +g[h>>2];g[h>>2]=l;h=e+(j*244|0)+192|0;g[h>>2]=+g[e+(j*244|0)+80>>2]+ +g[h>>2];h=e+(j*244|0)+196|0;g[h>>2]=+g[e+(j*244|0)+84>>2]+ +g[h>>2];h=e+(j*244|0)+200|0;g[h>>2]=+g[e+(j*244|0)+88>>2]+ +g[h>>2];h=e;d=i}else{l=+g[f+12>>2];m=+g[f+52>>2];d=e+(j*244|0)+176|0;g[d>>2]=+g[e+(j*244|0)+64>>2]+ +g[d>>2];d=e+(j*244|0)+180|0;g[d>>2]=+g[e+(j*244|0)+68>>2]+ +g[d>>2];d=e+(j*244|0)+184|0;g[d>>2]=+g[e+(j*244|0)+72>>2]+ +g[d>>2];d=e+(j*244|0)+192|0;g[d>>2]=+g[e+(j*244|0)+80>>2]+ +g[d>>2];d=e+(j*244|0)+196|0;g[d>>2]=+g[e+(j*244|0)+84>>2]+ +g[d>>2];d=e+(j*244|0)+200|0;g[d>>2]=+g[e+(j*244|0)+88>>2]+ +g[d>>2];n=+g[e+(j*244|0)+144>>2];d=e+(j*244|0)+148|0;if(((((!(n!=0.0)?!(+g[d>>2]!=0.0):0)?!(+g[e+(j*244|0)+152>>2]!=0.0):0)?!(+g[e+(j*244|0)+160>>2]!=0.0):0)?!(+g[e+(j*244|0)+164>>2]!=0.0):0)?!(+g[e+(j*244|0)+168>>2]!=0.0):0)d=i;else{s=+g[e+(j*244|0)+164>>2]*m;p=+g[e+(j*244|0)+168>>2]*m;g[o>>2]=+g[e+(j*244|0)+160>>2]*m;g[o+4>>2]=s;g[o+8>>2]=p;g[o+12>>2]=0.0;jg(h,n,+g[d>>2],+g[e+(j*244|0)+152>>2],o,l,o+16|0);c[h>>2]=c[o+16>>2];c[h+4>>2]=c[o+16+4>>2];c[h+8>>2]=c[o+16+8>>2];c[h+12>>2]=c[o+16+12>>2];d=e+(j*244|0)+16|0;c[d>>2]=c[o+16+16>>2];c[d+4>>2]=c[o+16+16+4>>2];c[d+8>>2]=c[o+16+16+8>>2];c[d+12>>2]=c[o+16+16+12>>2];d=e+(j*244|0)+32|0;c[d>>2]=c[o+16+32>>2];c[d+4>>2]=c[o+16+32+4>>2];c[d+8>>2]=c[o+16+32+8>>2];c[d+12>>2]=c[o+16+32+12>>2];d=e+(j*244|0)+48|0;c[d>>2]=c[o+16+48>>2];c[d+4>>2]=c[o+16+48+4>>2];c[d+8>>2]=c[o+16+48+8>>2];c[d+12>>2]=c[o+16+48+12>>2];d=c[b+16>>2]|0;e=d;d=c[d+(j*244|0)+240>>2]|0}h=e;m=+g[e+(j*244|0)+176>>2];n=+g[e+(j*244|0)+180>>2];l=+g[e+(j*244|0)+184>>2]}s=m+ +g[h+(j*244|0)+208>>2];p=n+ +g[h+(j*244|0)+212>>2];n=l+ +g[h+(j*244|0)+216>>2];q=d+260|0;c[q>>2]=(c[q>>2]|0)+1;g[d+312>>2]=s;g[d+316>>2]=p;g[d+320>>2]=n;g[d+324>>2]=0.0;q=c[b+16>>2]|0;r=c[q+(j*244|0)+240>>2]|0;n=+g[q+(j*244|0)+192>>2]+ +g[q+(j*244|0)+224>>2];p=+g[q+(j*244|0)+196>>2]+ +g[q+(j*244|0)+228>>2];s=+g[q+(j*244|0)+200>>2]+ +g[q+(j*244|0)+232>>2];c[r+260>>2]=(c[r+260>>2]|0)+1;g[r+328>>2]=n;g[r+332>>2]=p;g[r+336>>2]=s;g[r+340>>2]=0.0;if(c[f+44>>2]|0){q=c[b+16>>2]|0;r=c[q+(j*244|0)+240>>2]|0;k=q+(j*244|0)|0;c[r+260>>2]=(c[r+260>>2]|0)+1;c[r+4>>2]=c[k>>2];c[r+4+4>>2]=c[k+4>>2];c[r+4+8>>2]=c[k+8>>2];c[r+4+12>>2]=c[k+12>>2];k=q+(j*244|0)+16|0;c[r+20>>2]=c[k>>2];c[r+20+4>>2]=c[k+4>>2];c[r+20+8>>2]=c[k+8>>2];c[r+20+12>>2]=c[k+12>>2];k=q+(j*244|0)+32|0;c[r+36>>2]=c[k>>2];c[r+36+4>>2]=c[k+4>>2];c[r+36+8>>2]=c[k+8>>2];c[r+36+12>>2]=c[k+12>>2];q=q+(j*244|0)+48|0;c[r+52>>2]=c[q>>2];c[r+52+4>>2]=c[q+4>>2];c[r+52+8>>2]=c[q+8>>2];c[r+52+12>>2]=c[q+12>>2]}e=c[b+16>>2]|0;c[(c[e+(j*244|0)+240>>2]|0)+212>>2]=-1;d=c[b+8>>2]|0}j=j+1|0}while((j|0)<(d|0))}if((c[b+28>>2]|0)<0?(c[b+32>>2]|0)<0:0){d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+32>>2]=0}c[b+28>>2]=0;if((c[b+48>>2]|0)<0?(c[b+52>>2]|0)<0:0){d=c[b+56>>2]|0;if(d|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=0;c[b+52>>2]=0}c[b+48>>2]=0;if((c[b+68>>2]|0)<0?(c[b+72>>2]|0)<0:0){d=c[b+76>>2]|0;if(d|0){if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+76>>2]=0}a[b+80>>0]=1;c[b+76>>2]=0;c[b+72>>2]=0}c[b+68>>2]=0;if((c[b+88>>2]|0)<0?(c[b+92>>2]|0)<0:0){d=c[b+96>>2]|0;if(d|0){if(a[b+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+96>>2]=0}a[b+100>>0]=1;c[b+96>>2]=0;c[b+92>>2]=0}c[b+88>>2]=0;if((c[b+8>>2]|0)>=0){c[b+8>>2]=0;sa=o;return 0.0}if((c[b+12>>2]|0)>=0){c[b+8>>2]=0;sa=o;return 0.0}d=c[b+16>>2]|0;if(d|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=0;c[b+12>>2]=0;c[b+8>>2]=0;sa=o;return 0.0}function dc(a){a=a|0;var b=0.0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0;j=c[a+372>>2]|0;a:do switch(c[j+32>>2]|0){case 1:{g[j+20>>2]=0.0;k=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=k;k=c[a+348+(k<<2)>>2]|0;c[j+4>>2]=k;c[j+32>>2]=2;Wg(a,1.0,0.0,0.0,k);if(dc(a)|0){k=1;return k|0}j=c[a+372>>2]|0;k=(c[j+32>>2]|0)+-1|0;c[j+32>>2]=k;k=c[j+(k<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=k;j=c[a+372>>2]|0;l=c[j+32>>2]|0;g[j+16+(l<<2)>>2]=0.0;c[j+(l<<2)>>2]=k;c[j+32>>2]=l+1;Wg(a,-1.0,-0.0,-0.0,k);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,0.0,1.0,0.0,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-0.0,-1.0,-0.0,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,0.0,0.0,1.0,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-0.0,-0.0,-1.0,l);if(dc(a)|0){l=1;return l|0}else{l=c[a+372>>2]|0;k=(c[l+32>>2]|0)+-1|0;c[l+32>>2]=k;k=c[l+(k<<2)>>2]|0;l=c[a+364>>2]|0;c[a+364>>2]=l+1;c[a+348+(l<<2)>>2]=k;break a}}case 2:{k=c[j+4>>2]|0;l=c[j>>2]|0;d=+g[k+16>>2]-+g[l+16>>2];e=+g[k+20>>2]-+g[l+20>>2];f=+g[k+24>>2]-+g[l+24>>2];b=e*0.0-f*0.0;do if((d*0.0-e)*(d*0.0-e)+(b*b+(f-d*0.0)*(f-d*0.0))>0.0){g[j+24>>2]=0.0;l=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=l;l=c[a+348+(l<<2)>>2]|0;c[j+8>>2]=l;c[j+32>>2]=3;Wg(a,b,f-d*0.0,d*0.0-e,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-b,-(f-d*0.0),-(d*0.0-e),l);if(dc(a)|0){l=1;return l|0}else{l=c[a+372>>2]|0;k=(c[l+32>>2]|0)+-1|0;c[l+32>>2]=k;k=c[l+(k<<2)>>2]|0;l=c[a+364>>2]|0;c[a+364>>2]=l+1;c[a+348+(l<<2)>>2]=k;break}}while(0);b=f*0.0-d*0.0;do if((d-e*0.0)*(d-e*0.0)+((e*0.0-f)*(e*0.0-f)+b*b)>0.0){k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;l=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=l;l=c[a+348+(l<<2)>>2]|0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,e*0.0-f,b,d-e*0.0,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-(e*0.0-f),-b,-(d-e*0.0),l);if(dc(a)|0){l=1;return l|0}else{l=c[a+372>>2]|0;k=(c[l+32>>2]|0)+-1|0;c[l+32>>2]=k;k=c[l+(k<<2)>>2]|0;l=c[a+364>>2]|0;c[a+364>>2]=l+1;c[a+348+(l<<2)>>2]=k;break}}while(0);b=d*0.0-e*0.0;if(b*b+((e-f*0.0)*(e-f*0.0)+(f*0.0-d)*(f*0.0-d))>0.0){k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;l=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=l;l=c[a+348+(l<<2)>>2]|0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,e-f*0.0,f*0.0-d,b,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-(e-f*0.0),-(f*0.0-d),-b,l);if(dc(a)|0){l=1;return l|0}else{l=c[a+372>>2]|0;k=(c[l+32>>2]|0)+-1|0;c[l+32>>2]=k;k=c[l+(k<<2)>>2]|0;l=c[a+364>>2]|0;c[a+364>>2]=l+1;c[a+348+(l<<2)>>2]=k;break a}}break}case 3:{l=c[j+4>>2]|0;k=c[j>>2]|0;f=+g[k+16>>2];b=+g[l+16>>2]-f;h=+g[k+20>>2];d=+g[l+20>>2]-h;i=+g[k+24>>2];e=+g[l+24>>2]-i;l=c[j+8>>2]|0;f=+g[l+16>>2]-f;h=+g[l+20>>2]-h;i=+g[l+24>>2]-i;if((b*h-d*f)*(b*h-d*f)+((d*i-e*h)*(d*i-e*h)+(e*f-b*i)*(e*f-b*i))>0.0){g[j+28>>2]=0.0;l=(c[a+364>>2]|0)+-1|0;c[a+364>>2]=l;l=c[a+348+(l<<2)>>2]|0;c[j+12>>2]=l;c[j+32>>2]=4;Wg(a,d*i-e*h,e*f-b*i,b*h-d*f,l);if(dc(a)|0){l=1;return l|0}k=c[a+372>>2]|0;l=(c[k+32>>2]|0)+-1|0;c[k+32>>2]=l;l=c[k+(l<<2)>>2]|0;c[a+348+(c[a+364>>2]<<2)>>2]=l;k=c[a+372>>2]|0;j=c[k+32>>2]|0;g[k+16+(j<<2)>>2]=0.0;c[k+(j<<2)>>2]=l;c[k+32>>2]=j+1;Wg(a,-(d*i-e*h),-(e*f-b*i),-(b*h-d*f),l);if(dc(a)|0){l=1;return l|0}else{l=c[a+372>>2]|0;k=(c[l+32>>2]|0)+-1|0;c[l+32>>2]=k;k=c[l+(k<<2)>>2]|0;l=c[a+364>>2]|0;c[a+364>>2]=l+1;c[a+348+(l<<2)>>2]=k;break a}}break}case 4:{l=c[j>>2]|0;k=c[j+12>>2]|0;i=+g[k+16>>2];o=+g[l+16>>2]-i;m=+g[k+20>>2];b=+g[l+20>>2]-m;e=+g[k+24>>2];f=+g[l+24>>2]-e;l=c[j+4>>2]|0;d=+g[l+16>>2]-i;h=+g[l+20>>2]-m;n=+g[l+24>>2]-e;l=c[j+8>>2]|0;i=+g[l+16>>2]-i;m=+g[l+20>>2]-m;e=+g[l+24>>2]-e;if(!((0.0!=0.0?1:o*h*e+(b*n*i+f*d*m-o*n*m-b*d*e)-f*h*i!=o*h*e+(b*n*i+f*d*m-o*n*m-b*d*e)-f*h*i)|o*h*e+(b*n*i+f*d*m-o*n*m-b*d*e)-f*h*i==0.0)){l=1;return l|0}break}default:{}}while(0);l=0;return l|0}function ec(a,b){a=a|0;b=+b;var d=0,e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0;n=sa;sa=sa+48|0;d=c[a+24>>2]|0;if((d|0)<=0){sa=n;return}m=0;a:while(1){l=c[(c[a+32>>2]|0)+(m<<2)>>2]|0;switch(c[l+216>>2]|0){case 2:case 5:break;default:{ad(l,0);e=c[l+732>>2]|0;if((e|0)>0){d=0;do{k=c[l+740>>2]|0;i=c[k+(d*52|0)+12>>2]|0;j=c[k+(d*52|0)+8>>2]|0;x=+g[i+24>>2]-+g[j+24>>2];w=+g[i+28>>2]-+g[j+28>>2];b=+g[i+32>>2]-+g[j+32>>2];g[k+(d*52|0)+36>>2]=x;g[k+(d*52|0)+40>>2]=w;g[k+(d*52|0)+44>>2]=b;g[k+(d*52|0)+48>>2]=0.0;g[k+(d*52|0)+32>>2]=1.0/(+g[k+(d*52|0)+24>>2]*(x*x+w*w+b*b));d=d+1|0}while((d|0)!=(e|0))}f=c[l+792>>2]|0;if((f|0)>0){d=0;b=+g[l+452>>2];do{k=c[l+800>>2]|0;e=k+(d*96|0)+20|0;i=c[e>>2]|0;A=+g[k+(d*96|0)+4>>2];z=+g[k+(d*96|0)+8>>2];x=+g[k+(d*96|0)+12>>2];y=+g[i+4>>2]*A+ +g[i+8>>2]*z+ +g[i+12>>2]*x;w=A*+g[i+20>>2]+z*+g[i+24>>2]+x*+g[i+28>>2];x=A*+g[i+36>>2]+z*+g[i+40>>2]+x*+g[i+44>>2];j=k+(d*96|0)|0;_e(n,b,+g[(c[j>>2]|0)+88>>2],+g[i+344>>2],i+264|0,y,w,x);i=k+(d*96|0)+28|0;c[i>>2]=c[n>>2];c[i+4>>2]=c[n+4>>2];c[i+8>>2]=c[n+8>>2];c[i+12>>2]=c[n+12>>2];i=k+(d*96|0)+44|0;c[i>>2]=c[n+16>>2];c[i+4>>2]=c[n+16+4>>2];c[i+8>>2]=c[n+16+8>>2];c[i+12>>2]=c[n+16+12>>2];i=k+(d*96|0)+60|0;c[i>>2]=c[n+32>>2];c[i+4>>2]=c[n+32+4>>2];c[i+8>>2]=c[n+32+8>>2];c[i+12>>2]=c[n+32+12>>2];g[k+(d*96|0)+76>>2]=y;g[k+(d*96|0)+80>>2]=w;g[k+(d*96|0)+84>>2]=x;g[k+(d*96|0)+88>>2]=0.0;b=+g[l+452>>2];g[k+(d*96|0)+92>>2]=b*+g[(c[j>>2]|0)+88>>2];e=c[e>>2]|0;if(!(c[e+204>>2]&3)){if((c[e+216>>2]&-2|0)!=4)c[e+216>>2]=1;g[e+220>>2]=0.0}d=d+1|0}while((d|0)!=(f|0))}d=c[l+372>>2]|0;if((d|0)>0){f=0;e=c[l+396>>2]|0;do{if((e|0)>0){d=0;do{Qa[((c[(c[l+404>>2]|0)+(d<<2)>>2]|0)==0?23:0)&31](l,1.0);d=d+1|0;e=c[l+396>>2]|0}while((d|0)<(e|0));d=c[l+372>>2]|0}f=f+1|0}while((f|0)<(d|0));e=c[l+712>>2]|0;if((e|0)>0){d=0;do{k=c[l+720>>2]|0;y=+g[l+452>>2];z=y*+g[k+(d*104|0)+44>>2]+ +g[k+(d*104|0)+28>>2];A=y*+g[k+(d*104|0)+48>>2]+ +g[k+(d*104|0)+32>>2];g[k+(d*104|0)+8>>2]=+g[k+(d*104|0)+40>>2]*y+ +g[k+(d*104|0)+24>>2];g[k+(d*104|0)+12>>2]=z;g[k+(d*104|0)+16>>2]=A;g[k+(d*104|0)+20>>2]=0.0;d=d+1|0}while((d|0)!=(e|0))}}d=c[l+376>>2]|0;if((d|0)>0){h=0;e=c[l+416>>2]|0;do{b=+(h|0)/+(d|0);if((e|0)>0){f=0;do{switch(c[(c[l+424>>2]|0)+(f<<2)>>2]|0){case 1:{d=2;break}case 0:{d=3;break}case 2:{d=4;break}case 3:{d=5;break}default:{v=37;break a}}Ra[d&7](l,1.0,b);f=f+1|0;e=c[l+416>>2]|0}while((f|0)<(e|0));d=c[l+376>>2]|0}h=h+1|0}while((h|0)<(d|0));b=+g[l+456>>2]*(1.0-+g[l+296>>2]);e=c[l+712>>2]|0;if((e|0)>0){d=0;do{k=c[l+720>>2]|0;z=b*(+g[k+(d*104|0)+12>>2]-+g[k+(d*104|0)+28>>2]);A=b*(+g[k+(d*104|0)+16>>2]-+g[k+(d*104|0)+32>>2]);g[k+(d*104|0)+40>>2]=b*(+g[k+(d*104|0)+8>>2]-+g[k+(d*104|0)+24>>2]);g[k+(d*104|0)+44>>2]=z;g[k+(d*104|0)+48>>2]=A;k=k+(d*104|0)+52|0;d=d+1|0;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0}while((d|0)!=(e|0))}}d=c[l+380>>2]|0;if((d|0)>0){b=+g[l+292>>2]*+g[l+456>>2];e=c[l+712>>2]|0;if((e|0)>0){d=0;do{k=c[l+720>>2]|0;j=k+(d*104|0)+8|0;k=k+(d*104|0)+24|0;c[k>>2]=c[j>>2];c[k+4>>2]=c[j+4>>2];c[k+8>>2]=c[j+8>>2];c[k+12>>2]=c[j+12>>2];d=d+1|0}while((d|0)!=(e|0));d=c[l+380>>2]|0;if((d|0)>0)v=45}else v=45;if((v|0)==45){v=0;h=0;e=c[l+436>>2]|0;do{if((e|0)>0){f=0;do{switch(c[(c[l+444>>2]|0)+(f<<2)>>2]|0){case 1:{d=2;break}case 0:{d=3;break}case 2:{d=4;break}case 3:{d=5;break}default:{v=56;break a}}Ra[d&7](l,1.0,0.0);f=f+1|0;e=c[l+436>>2]|0}while((f|0)<(e|0));d=c[l+380>>2]|0}h=h+1|0}while((h|0)<(d|0))}e=c[l+712>>2]|0;if((e|0)>0){f=c[l+720>>2]|0;d=0;do{z=b*(+g[f+(d*104|0)+12>>2]-+g[f+(d*104|0)+28>>2]);A=b*(+g[f+(d*104|0)+16>>2]-+g[f+(d*104|0)+32>>2]);k=f+(d*104|0)+40|0;g[k>>2]=b*(+g[f+(d*104|0)+8>>2]-+g[f+(d*104|0)+24>>2])+ +g[k>>2];k=f+(d*104|0)+44|0;g[k>>2]=z+ +g[k>>2];k=f+(d*104|0)+48|0;g[k>>2]=A+ +g[k>>2];d=d+1|0}while((d|0)!=(e|0))}}f=c[l+1112>>2]|0;if((f|0)>0){h=c[l+1120>>2]|0;e=0;do{i=c[h+(e<<2)>>2]|0;if(+g[i+352>>2]>0.0?(o=c[i+24>>2]|0,(o|0)>0):0){j=c[i+32>>2]|0;d=0;do{k=c[j+(d<<2)>>2]|0;if(+g[k+88>>2]>0.0?(s=+g[k+24>>2]-+g[i+228>>2],u=+g[k+28>>2]-+g[i+232>>2],q=+g[k+32>>2]-+g[i+236>>2],r=+g[i+336>>2],A=+g[i+340>>2],t=+g[i+332>>2],p=+g[i+316>>2]+(r*q-u*A),q=+g[i+320>>2]+(s*A-q*t),r=u*t-s*r+ +g[i+324>>2],s=+g[k+40>>2],t=+g[k+44>>2],u=+g[k+48>>2],p*p+q*q+r*r<=s*s+t*t+u*u):0){A=+g[i+352>>2];g[k+40>>2]=s+(p-s)*A;g[k+44>>2]=t+(q-t)*A;g[k+48>>2]=u+(r-u)*A}d=d+1|0}while((d|0)!=(o|0))}e=e+1|0}while((e|0)!=(f|0))}ad(l,1);d=c[a+24>>2]|0}}m=m+1|0;if((m|0)>=(d|0)){v=3;break}}if((v|0)==3){sa=n;return}}function fc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,y=0,z=0.0,A=0.0,B=0.0;if((d|0)<=1){y=0;return y|0}w=c[b+712>>2]|0;y=J(w,w)|0;y=CI(y>>>0>1073741823?-1:y<<2)|0;if((w|0)>0){h=0;do{i=J(h,w)|0;j=y+(h+i<<2)|0;f=0;do{k=y+((J(f,w)|0)+h<<2)|0;if((f|0)==(h|0)){c[k>>2]=0;c[j>>2]=0}else{c[k>>2]=2147483647;c[y+(f+i<<2)>>2]=2147483647}f=f+1|0}while((f|0)!=(w|0));h=h+1|0}while((h|0)!=(w|0))}h=c[b+732>>2]|0;if((h|0)>0){i=c[b+740>>2]|0;j=c[b+720>>2]|0;f=0;do{p=((c[i+(f*52|0)+8>>2]|0)-j|0)/104|0;t=((c[i+(f*52|0)+12>>2]|0)-j|0)/104|0;c[y+((J(t,w)|0)+p<<2)>>2]=1;c[y+((J(p,w)|0)+t<<2)>>2]=1;f=f+1|0}while((f|0)!=(h|0))}do if((d|0)!=2)if((w|0)>0){f=0;do{k=J(f,w)|0;h=0;do{i=h;h=h+1|0;if((h|0)<(w|0)){n=J(i,w)|0;l=y+(n+f<<2)|0;j=h;do{m=(c[l>>2]|0)+(c[y+(j+k<<2)>>2]|0)|0;o=y+(j+n<<2)|0;if((c[o>>2]|0)>>>0>m>>>0){c[y+((J(j,w)|0)+i<<2)>>2]=m;c[o>>2]=m}j=j+1|0}while((j|0)!=(w|0))}}while((h|0)!=(w|0));f=f+1|0}while((f|0)!=(w|0));q=97}else f=0;else{if((w|0)<0)ma();if((w|0)>0){c[7182]=(c[7182]|0)+1;f=xb((w*20|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=0;do{a[f+(h*20|0)+16>>0]=1;c[f+(h*20|0)+12>>2]=0;t=f+(h*20|0)+4|0;c[t>>2]=0;c[f+(h*20|0)+8>>2]=0;c[t>>2]=0;h=h+1|0}while((h|0)!=(w|0));t=f}else t=0;if((c[b+732>>2]|0)>0){n=0;do{m=c[b+740>>2]|0;p=c[b+720>>2]|0;o=((c[m+(n*52|0)+8>>2]|0)-p|0)/104|0;p=((c[m+(n*52|0)+12>>2]|0)-p|0)/104|0;m=t+(o*20|0)+4|0;f=c[m>>2]|0;a:do if((f|0)>0){i=c[t+(o*20|0)+12>>2]|0;h=0;while(1){if((c[i+(h<<2)>>2]|0)==(p|0))break;h=h+1|0;if((h|0)>=(f|0)){q=28;break a}}if((h|0)==(f|0))q=28}else q=28;while(0);if((q|0)==28){q=0;l=t+(o*20|0)+8|0;if((f|0)==(c[l>>2]|0)?(s=(f|0)==0?1:f<<1,(f|0)<(s|0)):0){if(!s)k=0;else{c[7182]=(c[7182]|0)+1;f=xb((s<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}k=f;f=c[m>>2]|0}j=t+(o*20|0)+12|0;i=c[j>>2]|0;if((f|0)<=0)if(!i)h=t+(o*20|0)+16|0;else q=39;else{h=0;do{c[k+(h<<2)>>2]=c[i+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0));q=39}if((q|0)==39){q=0;f=t+(o*20|0)+16|0;if(a[f>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[j>>2]=0;h=f;f=c[m>>2]|0}a[h>>0]=1;c[j>>2]=k;c[l>>2]=s}c[(c[t+(o*20|0)+12>>2]|0)+(f<<2)>>2]=p;c[m>>2]=(c[m>>2]|0)+1}m=t+(p*20|0)+4|0;f=c[m>>2]|0;b:do if((f|0)>0){i=c[t+(p*20|0)+12>>2]|0;h=0;while(1){if((c[i+(h<<2)>>2]|0)==(o|0))break;h=h+1|0;if((h|0)>=(f|0)){q=49;break b}}if((h|0)==(f|0))q=49}else q=49;while(0);if((q|0)==49){q=0;l=t+(p*20|0)+8|0;if((f|0)==(c[l>>2]|0)?(r=(f|0)==0?1:f<<1,(f|0)<(r|0)):0){if(!r)k=0;else{c[7182]=(c[7182]|0)+1;f=xb((r<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}k=f;f=c[m>>2]|0}j=t+(p*20|0)+12|0;i=c[j>>2]|0;if((f|0)<=0)if(!i)h=t+(p*20|0)+16|0;else q=60;else{h=0;do{c[k+(h<<2)>>2]=c[i+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0));q=60}if((q|0)==60){q=0;f=t+(p*20|0)+16|0;if(a[f>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[j>>2]=0;h=f;f=c[m>>2]|0}a[h>>0]=1;c[j>>2]=k;c[l>>2]=r}c[(c[t+(p*20|0)+12>>2]|0)+(f<<2)>>2]=o;c[m>>2]=(c[m>>2]|0)+1}n=n+1|0}while((n|0)<(c[b+732>>2]|0))}if((w|0)<=0){if(!t){f=0;break}}else{o=0;do{q=t+(o*20|0)+4|0;f=c[q>>2]|0;if((f|0)>0){r=J(o,w)|0;p=c[t+(o*20|0)+12>>2]|0;n=0;do{l=c[p+(n<<2)>>2]|0;m=t+(l*20|0)+4|0;h=c[m>>2]|0;if((h|0)>0){j=c[t+(l*20|0)+12>>2]|0;k=y+((J(l,w)|0)+o<<2)|0;i=0;f=h;do{h=c[j+(i<<2)>>2]|0;if((o|0)!=(h|0)?(v=J(h,w)|0,u=(c[y+(v+l<<2)>>2]|0)+(c[k>>2]|0)|0,v=y+(v+o<<2)|0,(c[v>>2]|0)>>>0>u>>>0):0){c[y+(h+r<<2)>>2]=u;c[v>>2]=u;f=c[m>>2]|0}i=i+1|0}while((i|0)<(f|0));f=c[q>>2]|0}n=n+1|0}while((n|0)<(f|0))}o=o+1|0}while((o|0)!=(w|0));f=0;do{i=t+(f*20|0)+4|0;j=t+(f*20|0)+12|0;k=c[j>>2]|0;h=t+(f*20|0)+16|0;if(k|0){if(a[h>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[j>>2]=0}a[h>>0]=1;c[j>>2]=0;c[i>>2]=0;c[t+(f*20|0)+8>>2]=0;f=f+1|0}while((f|0)!=(w|0))}c[7183]=(c[7183]|0)+1;Hc(c[t+-4>>2]|0);q=97}while(0);if((q|0)==97)if((w|0)>0){f=0;k=0;do{i=k;k=k+1|0;if((k|0)<(w|0)){j=J(i,w)|0;h=k;do{if((c[y+(h+j<<2)>>2]|0)==(d|0)){t=c[b+720>>2]|0;oh(b,e);v=(c[b+732>>2]|0)+-1|0;u=c[b+740>>2]|0;c[u+(v*52|0)+8>>2]=t+(h*104|0);c[u+(v*52|0)+12>>2]=t+(i*104|0);B=+g[t+(h*104|0)+8>>2]-+g[t+(i*104|0)+8>>2];A=+g[t+(h*104|0)+12>>2]-+g[t+(i*104|0)+12>>2];z=+g[t+(h*104|0)+16>>2]-+g[t+(i*104|0)+16>>2];g[u+(v*52|0)+16>>2]=+x(+(B*B+A*A+z*z));a[b+924>>0]=1;v=(c[b+740>>2]|0)+(v*52|0)+20|0;a[v>>0]=a[v>>0]|1;f=f+1|0}h=h+1|0}while((h|0)!=(w|0))}}while((k|0)!=(w|0))}else f=0;DI(y);y=f;return y|0}function gc(d,e){d=d|0;e=+e;var f=0,h=0.0,i=0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0,s=0.0,t=0;r=sa;sa=sa+304|0;Ki(16437);a:do if((c[d+232>>2]|0)>0){m=r+136+48|0;l=0;while(1){n=c[(c[d+240>>2]|0)+(l<<2)>>2]|0;g[n+244>>2]=1.0;b:do switch(c[n+216>>2]|0){case 2:case 5:break;default:if(!(c[n+204>>2]&3)){jg(n+4|0,+g[n+312>>2],+g[n+316>>2],+g[n+320>>2],n+328|0,e,r+136|0);h=+g[m>>2]-+g[n+52>>2];j=+g[r+136+52>>2]-+g[n+56>>2];k=+g[r+136+56>>2]-+g[n+60>>2];if(a[d+44>>0]|0?(s=+g[n+252>>2],s*s!=0.0?s*s>2]|0)+4>>2]|0)<20){c[6847]=(c[6847]|0)+1;f=c[d+68>>2]|0;f=Fa[c[(c[f>>2]|0)+36>>2]&127](f)|0;i=c[d+24>>2]|0;g[r+200+4>>2]=1.0;c[r+200+12>>2]=c[n+52>>2];c[r+200+12+4>>2]=c[n+52+4>>2];c[r+200+12+8>>2]=c[n+52+8>>2];c[r+200+12+12>>2]=c[n+52+12>>2];c[r+200+28>>2]=c[m>>2];c[r+200+28+4>>2]=c[m+4>>2];c[r+200+28+8>>2]=c[m+8>>2];c[r+200+28+12>>2]=c[m+12>>2];c[r+200+76>>2]=0;c[r+200>>2]=7092;c[r+200+80>>2]=n;c[r+200+88>>2]=f;c[r+200+92>>2]=i;i=c[n+248>>2]|0;c[r+80+8>>2]=0;c[r+80+12>>2]=1065353216;c[r+80+16>>2]=1065353216;c[r+80+20>>2]=1065353216;g[r+80+24>>2]=0.0;c[r+80>>2]=9480;c[r+80+4>>2]=8;c[r+80+28>>2]=i;c[r+80+44>>2]=i;c[r+200+84>>2]=c[d+56>>2];i=c[n+188>>2]|0;b[r+200+8>>1]=b[i+4>>1]|0;b[r+200+10>>1]=b[i+6>>1]|0;c[r+16+48>>2]=c[m>>2];c[r+16+48+4>>2]=c[m+4>>2];c[r+16+48+8>>2]=c[m+8>>2];c[r+16+48+12>>2]=c[m+12>>2];c[r+16>>2]=c[n+4>>2];c[r+16+4>>2]=c[n+4+4>>2];c[r+16+8>>2]=c[n+4+8>>2];c[r+16+12>>2]=c[n+4+12>>2];c[r+16+16>>2]=c[n+20>>2];c[r+16+16+4>>2]=c[n+20+4>>2];c[r+16+16+8>>2]=c[n+20+8>>2];c[r+16+16+12>>2]=c[n+20+12>>2];c[r+16+32>>2]=c[n+36>>2];c[r+16+32+4>>2]=c[n+36+4>>2];c[r+16+32+8>>2]=c[n+36+8>>2];c[r+16+32+12>>2]=c[n+36+12>>2];Tc(d,r+80|0,n+4|0,r+16|0,r+200|0,0.0);h=+g[r+200+4>>2];if(h<1.0){g[n+244>>2]=h;jg(n+4|0,+g[n+312>>2],+g[n+316>>2],+g[n+320>>2],n+328|0,h*e,r+136|0);g[n+244>>2]=0.0;$d(n,r+136|0);f=4}else f=0;if(!f)o=12}else o=12;if((o|0)==12){o=0;f=0}i=c[3084]|0;t=(c[i+16>>2]|0)+-1|0;c[i+16>>2]=t;do if(!t){if(c[i+4>>2]|0){la(r+200|0,0)|0;t=c[7181]|0;g[i+8>>2]=+g[i+8>>2]+ +(((c[r+200+4>>2]|0)-(c[t+4>>2]|0)+(((c[r+200>>2]|0)-(c[t>>2]|0)|0)*1e6|0)-(c[i+12>>2]|0)|0)>>>0)/1.0e3;if(c[i+16>>2]|0)break;i=c[3084]|0}c[3084]=c[i+20>>2]}while(0);if(f|0)break b}$d(n,r+136|0)}}while(0);l=l+1|0;if((l|0)>=(c[d+232>>2]|0))break a}}while(0);do if(a[d+275>>0]|0){Ki(16477);if((c[d+308>>2]|0)>0){n=0;do{o=c[(c[d+316>>2]|0)+(n<<2)>>2]|0;i=c[o+740>>2]|0;i=(c[i+236>>2]&2|0)==0?0:i;m=c[o+744>>2]|0;m=(c[m+236>>2]&2|0)==0?0:m;f=c[o+748>>2]|0;if((f|0)>0)if(!i){i=0;do{h=+g[57]*+g[m+228>>2];if(h>0.0?(p=+g[o+4+(i*184|0)+120>>2],p!=0.0):0){k=h*p*+g[o+4+(i*184|0)+64>>2];e=h*p*+g[o+4+(i*184|0)+68>>2];s=h*p*+g[o+4+(i*184|0)+72>>2];h=+g[o+4+(i*184|0)+36>>2]-+g[m+56>>2];j=+g[o+4+(i*184|0)+40>>2]-+g[m+60>>2];g[r+16>>2]=+g[o+4+(i*184|0)+32>>2]-+g[m+52>>2];g[r+16+4>>2]=h;g[r+16+8>>2]=j;g[r+16+12>>2]=0.0;g[r>>2]=k;g[r+4>>2]=e;g[r+8>>2]=s;g[r+12>>2]=0.0;Bk(m,r,r+16|0);f=c[o+748>>2]|0}i=i+1|0}while((i|0)<(f|0))}else{l=0;do{h=+g[i+228>>2]*+g[m+228>>2];if(h>0.0?(q=+g[o+4+(l*184|0)+120>>2],q!=0.0):0){k=h*q*+g[o+4+(l*184|0)+64>>2];e=h*q*+g[o+4+(l*184|0)+68>>2];s=h*q*+g[o+4+(l*184|0)+72>>2];g[r+200>>2]=-k;g[r+200+4>>2]=-e;g[r+200+8>>2]=-s;g[r+200+12>>2]=0.0;j=+g[o+4+(l*184|0)+52>>2]-+g[i+56>>2];h=+g[o+4+(l*184|0)+56>>2]-+g[i+60>>2];g[r+80>>2]=+g[o+4+(l*184|0)+48>>2]-+g[i+52>>2];g[r+80+4>>2]=j;g[r+80+8>>2]=h;g[r+80+12>>2]=0.0;h=+g[o+4+(l*184|0)+36>>2]-+g[m+56>>2];j=+g[o+4+(l*184|0)+40>>2]-+g[m+60>>2];g[r+16>>2]=+g[o+4+(l*184|0)+32>>2]-+g[m+52>>2];g[r+16+4>>2]=h;g[r+16+8>>2]=j;g[r+16+12>>2]=0.0;Bk(i,r+200|0,r+80|0);g[r>>2]=k;g[r+4>>2]=e;g[r+8>>2]=s;g[r+12>>2]=0.0;Bk(m,r,r+16|0);f=c[o+748>>2]|0}l=l+1|0}while((l|0)<(f|0))}n=n+1|0}while((n|0)<(c[d+308>>2]|0))}f=c[3084]|0;t=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=t;if(!t){if(c[f+4>>2]|0){la(r+200|0,0)|0;t=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[r+200+4>>2]|0)-(c[t+4>>2]|0)+(((c[r+200>>2]|0)-(c[t>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(c[f+16>>2]|0)break;f=c[3084]|0}c[3084]=c[f+20>>2]}}while(0);f=c[3084]|0;t=(c[f+16>>2]|0)+-1|0;c[f+16>>2]=t;if(t|0){sa=r;return}do if(c[f+4>>2]|0){la(r+200|0,0)|0;t=c[7181]|0;g[f+8>>2]=+g[f+8>>2]+ +(((c[r+200+4>>2]|0)-(c[t+4>>2]|0)+(((c[r+200>>2]|0)-(c[t>>2]|0)|0)*1e6|0)-(c[f+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[f+16>>2]|0)){f=c[3084]|0;break}else{sa=r;return}}while(0);c[3084]=c[f+20>>2];sa=r;return}function hc(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,k=0,l=0.0,m=0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0,t=0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0,J=0,K=0;I=sa;sa=sa+96|0;e=c[b+216>>2]|0;if(+g[e+4>>2]==0.0){H=0;sa=I;return H|0}H=c[d>>2]|0;if(!(Ha[c[(c[e>>2]|0)+8>>2]&31](e,c[H+188>>2]|0)|0)){H=1;sa=I;return H|0}d=c[H+192>>2]|0;G=c[b+216>>2]|0;if((c[d+4>>2]|0)!=32){c[I+32>>2]=0;c[I+32+4>>2]=d;c[I+32+8>>2]=H;c[I+32+12>>2]=H+4;c[I+32+16>>2]=-1;c[I+32+20>>2]=-1;_b(b+68|0,b+132|0,I+32|0,G);H=1;sa=I;return H|0}if((H|0)==0?1:(c[H+236>>2]|0)!=8){H=1;sa=I;return H|0}d=c[H+752>>2]|0;if(d)if(!(c[H+988>>2]|0)){d=c[H+988+4>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[H+988+4>>2]=0;c[H+988+8>>2]=-1;d=c[H+988+32>>2]|0;if(d|0){if(a[H+988+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[H+988+32>>2]=0}a[H+988+36>>0]=1;c[H+988+32>>2]=0;c[H+988+24>>2]=0;c[H+988+28>>2]=0;c[H+988+16>>2]=0;d=c[H+752>>2]|0;if((d|0)>0){s=0;do{m=c[H+760>>2]|0;q=m+(s*44|0)|0;t=c[m+(s*44|0)+8>>2]|0;C=c[m+(s*44|0)+12>>2]|0;d=c[m+(s*44|0)+16>>2]|0;o=+g[t+8>>2];p=+g[t+12>>2];r=+g[t+16>>2];l=+g[t+20>>2];B=+g[C+8>>2];f=B>2];n=F>2];h=E>2];i=D>2];f=D>2];n=E>2];h=F>2];i=B>2]|0;if(!d){c[7182]=(c[7182]|0)+1;d=xb(63)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}e=d;k=e+44|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(k|0))}else c[H+988+4>>2]=0;c[d+32>>2]=0;c[d+36>>2]=q;c[d+40>>2]=0;g[d>>2]=f;g[d+4>>2]=n;g[d+8>>2]=h;g[d+12>>2]=i;g[d+16>>2]=o;g[d+20>>2]=p;g[d+24>>2]=r;g[d+28>>2]=l;ue(H+988|0,c[H+988>>2]|0,d);c[H+988+12>>2]=(c[H+988+12>>2]|0)+1;c[m+(s*44|0)+40>>2]=d;s=s+1|0;d=c[H+752>>2]|0}while((s|0)<(d|0));e=H+988|0}else e=H+988|0}else e=H+988|0;else{e=H+988|0;d=0}D=+g[b+180>>2]-+g[b+116>>2];E=+g[b+184>>2]-+g[b+120>>2];F=+g[b+188>>2]-+g[b+124>>2];e=c[e>>2]|0;if(!e)if((d|0)>0){t=c[H+760>>2]|0;s=0;e=0;q=-1;k=1065353216;m=0;h=1.0;f=1.0;do{K=c[t+(s*44|0)+8>>2]|0;J=c[t+(s*44|0)+12>>2]|0;C=c[t+(s*44|0)+16>>2]|0;i=+Yg(b+116|0,D,E,F,+g[K+8>>2],+g[K+12>>2],+g[K+16>>2],+g[J+8>>2],+g[J+12>>2],+g[J+16>>2],+g[C+8>>2],+g[C+12>>2],+g[C+16>>2],h);if(i>0.0){e=e+1|0;q=s;k=(g[j>>2]=i,c[j>>2]|0);m=3;f=i;h=i}s=s+1|0}while((s|0)!=(d|0));d=q}else{e=0;d=-1;k=1065353216;m=0;f=1.0}else{c[I+32>>2]=5980;c[I+32+4>>2]=c[b+116>>2];c[I+32+4+4>>2]=c[b+116+4>>2];c[I+32+4+8>>2]=c[b+116+8>>2];c[I+32+4+12>>2]=c[b+116+12>>2];g[I+32+36>>2]=D;g[I+32+40>>2]=E;g[I+32+44>>2]=F;g[I+32+48>>2]=0.0;c[I+32+20>>2]=c[b+180>>2];c[I+32+20+4>>2]=c[b+180+4>>2];c[I+32+20+8>>2]=c[b+180+8>>2];c[I+32+20+12>>2]=c[b+180+12>>2];c[I+32+52>>2]=1065353216;c[I+32+56>>2]=0;c[I+32+60>>2]=0;Pd(e,b+116|0,b+180|0,I+32|0);d=c[I+32+56>>2]|0;if(!d){e=0;d=-1;k=1065353216;m=0;f=1.0}else{K=c[I+32+52>>2]|0;e=1;d=(d-(c[H+760>>2]|0)|0)/44|0;k=K;m=3;f=(c[j>>2]=K,+g[j>>2])}}t=c[H+772>>2]|0;if((t|0)>0){C=c[H+780>>2]|0;s=0;do{K=c[C+(s*104|0)+8>>2]|0;w=+g[K+8>>2];z=+g[K+12>>2];B=+g[K+16>>2];K=c[C+(s*104|0)+12>>2]|0;n=+g[K+8>>2];p=+g[K+12>>2];u=+g[K+16>>2];K=c[C+(s*104|0)+16>>2]|0;v=+g[K+8>>2];y=+g[K+12>>2];A=+g[K+16>>2];h=(c[j>>2]=k,+g[j>>2]);i=+Yg(b+116|0,D,E,F,w,z,B,n,p,u,v,y,A,h);if(i>0.0){e=e+1|0;d=s;k=(g[j>>2]=i,c[j>>2]|0);m=4;h=i;f=i}K=c[C+(s*104|0)+20>>2]|0;l=+g[K+8>>2];o=+g[K+12>>2];r=+g[K+16>>2];i=+Yg(b+116|0,D,E,F,w,z,B,n,p,u,l,o,r,h);if(i>0.0){e=e+1|0;d=s;q=(g[j>>2]=i,c[j>>2]|0);m=4;h=i;f=i}else{q=k;h=(c[j>>2]=k,+g[j>>2])}i=+Yg(b+116|0,D,E,F,n,p,u,v,y,A,l,o,r,h);if(i>0.0){e=e+1|0;d=s;k=(g[j>>2]=i,c[j>>2]|0);m=4;h=i;f=i}else{k=q;h=(c[j>>2]=q,+g[j>>2])}h=+Yg(b+116|0,D,E,F,w,z,B,v,y,A,l,o,r,h);if(h>0.0){e=e+1|0;d=s;k=(g[j>>2]=h,c[j>>2]|0);m=4;f=h}s=s+1|0}while((s|0)!=(t|0));k=m;p=f}else{k=m;p=f}if(!e){K=1;sa=I;return K|0}if(!(p<=+g[G+4>>2])){K=1;sa=I;return K|0}c[I+32>>2]=0;c[I+32+4>>2]=d;l=+g[b+180>>2]-+g[b+116>>2];n=+g[b+184>>2]-+g[b+120>>2];o=+g[b+188>>2]-+g[b+124>>2];f=1.0/+x(+(l*l+n*n+o*o));if((k|0)==3){e=c[H+748+12>>2]|0;f=+g[e+(d*44|0)+20>>2];i=+g[e+(d*44|0)+24>>2];h=+g[e+(d*44|0)+28>>2];if(l*f+n*i+o*h>0.0){l=-f;i=-i;h=-h;f=0.0}else{l=f;f=+g[e+(d*44|0)+32>>2]}}else{l=-(l*f);i=-(n*f);h=-(o*f);f=0.0}c[I>>2]=H;c[I+4>>2]=I+32;g[I+8>>2]=l;g[I+12>>2]=i;g[I+16>>2]=h;g[I+20>>2]=f;g[I+24>>2]=p;+ya[c[(c[G>>2]|0)+12>>2]&15](G,I,1);K=1;sa=I;return K|0}function ic(b,d,e){b=b|0;d=d|0;e=+e;var f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0,o=0,p=0.0,q=0,r=0;r=sa;sa=sa+112|0;j=c[b+716>>2]|0;if((j|0)==(c[b+712>>2]|0)){a:do if(j){i=c[b+720>>2]|0;if((j|0)>0){f=0;h=i;while(1){h=c[h+(f*104|0)+96>>2]|0;if(h|0)c[h+36>>2]=f;f=f+1|0;if((f|0)==(j|0)){k=i;break a}h=c[b+720>>2]|0}}else k=i}else k=0;while(0);h=c[b+732>>2]|0;if((h|0)>0){f=0;do{o=(c[b+740>>2]|0)+(f*52|0)+8|0;c[o>>2]=((c[o>>2]|0)-k|0)/104|0;o=(c[b+740>>2]|0)+(f*52|0)+12|0;c[o>>2]=((c[o>>2]|0)-k|0)/104|0;f=f+1|0}while((f|0)!=(h|0))}h=c[b+752>>2]|0;if((h|0)>0){f=0;do{i=(c[b+760>>2]|0)+(f*44|0)+8|0;c[i>>2]=((c[i>>2]|0)-k|0)/104|0;i=(c[b+760>>2]|0)+(f*44|0)+12|0;c[i>>2]=((c[i>>2]|0)-k|0)/104|0;i=(c[b+760>>2]|0)+(f*44|0)+16|0;c[i>>2]=((c[i>>2]|0)-k|0)/104|0;i=c[(c[b+760>>2]|0)+(f*44|0)+40>>2]|0;if(i|0)c[i+36>>2]=f;f=f+1|0}while((f|0)!=(h|0))}h=c[b+792>>2]|0;if((h|0)>0){i=c[b+800>>2]|0;f=0;do{o=i+(f*96|0)|0;c[o>>2]=((c[o>>2]|0)-k|0)/104|0;f=f+1|0}while((f|0)!=(h|0))}j=c[b+692>>2]|0;if((j|0)>0){i=0;f=c[b+700>>2]|0;do{if((c[f+(i*60|0)+24>>2]|0)>0){h=0;do{f=f+(i*60|0)+28+(h<<2)|0;c[f>>2]=((c[f>>2]|0)-k|0)/104|0;h=h+1|0;f=c[b+700>>2]|0}while((h|0)<(c[f+(i*60|0)+24>>2]|0))}i=i+1|0}while((i|0)!=(j|0))}j=c[b+712>>2]|0;if((c[b+716>>2]|0)<(j<<1|1|0)){c[7182]=(c[7182]|0)+1;f=xb(((j<<1|1)*104|3)+16|0)|0;if(!f)i=0;else{c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}h=c[b+712>>2]|0;if((h|0)>0){f=0;do{n=i+(f*104|0)|0;k=(c[b+720>>2]|0)+(f*104|0)|0;o=n+104|0;do{c[n>>2]=c[k>>2];n=n+4|0;k=k+4|0}while((n|0)<(o|0));f=f+1|0}while((f|0)!=(h|0))}f=c[b+720>>2]|0;if(f|0){if(a[b+724>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+720>>2]=0}a[b+724>>0]=1;c[b+720>>2]=i;c[b+716>>2]=j<<1|1;j=c[b+712>>2]|0}b:do if(j){k=c[b+720>>2]|0;if((j|0)>0){f=0;h=k;while(1){i=c[h+(f*104|0)+96>>2]|0;if(i|0)c[i+36>>2]=h+(f*104|0);f=f+1|0;if((f|0)==(j|0))break b;h=c[b+720>>2]|0}}}else k=0;while(0);h=c[b+732>>2]|0;if((h|0)>0){f=0;do{o=(c[b+740>>2]|0)+(f*52|0)+8|0;c[o>>2]=k+((c[o>>2]|0)*104|0);o=(c[b+740>>2]|0)+(f*52|0)+12|0;c[o>>2]=k+((c[o>>2]|0)*104|0);f=f+1|0}while((f|0)!=(h|0))}h=c[b+752>>2]|0;if((h|0)>0){f=0;do{i=(c[b+760>>2]|0)+(f*44|0)+8|0;c[i>>2]=k+((c[i>>2]|0)*104|0);i=(c[b+760>>2]|0)+(f*44|0)+12|0;c[i>>2]=k+((c[i>>2]|0)*104|0);i=(c[b+760>>2]|0)+(f*44|0)+16|0;c[i>>2]=k+((c[i>>2]|0)*104|0);i=c[b+760>>2]|0;j=c[i+(f*44|0)+40>>2]|0;if(j|0)c[j+36>>2]=i+(f*44|0);f=f+1|0}while((f|0)!=(h|0))}i=c[b+792>>2]|0;if((i|0)>0){h=c[b+800>>2]|0;f=0;do{o=h+(f*96|0)|0;c[o>>2]=k+((c[o>>2]|0)*104|0);f=f+1|0}while((f|0)!=(i|0))}j=c[b+692>>2]|0;if((j|0)>0){i=0;f=c[b+700>>2]|0;do{if((c[f+(i*60|0)+24>>2]|0)>0){h=0;do{f=f+(i*60|0)+28+(h<<2)|0;c[f>>2]=k+((c[f>>2]|0)*104|0);h=h+1|0;f=c[b+700>>2]|0}while((h|0)<(c[f+(i*60|0)+24>>2]|0))}i=i+1|0}while((i|0)!=(j|0))}}n=c[b+192>>2]|0;p=+va[c[(c[n>>2]|0)+48>>2]&15](n);n=r;o=n+100|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));f=c[b+712>>2]|0;if((f|0)==(c[b+716>>2]|0)?(q=(f|0)==0?1:f<<1,(f|0)<(q|0)):0){if(!q)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((q*104|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=f;f=c[b+712>>2]|0}if((f|0)>0){h=0;do{n=i+(h*104|0)|0;k=(c[b+720>>2]|0)+(h*104|0)|0;o=n+104|0;do{c[n>>2]=c[k>>2];n=n+4|0;k=k+4|0}while((n|0)<(o|0));h=h+1|0}while((h|0)!=(f|0))}f=c[b+720>>2]|0;if(f|0){if(a[b+724>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+720>>2]=0}a[b+724>>0]=1;c[b+720>>2]=i;c[b+716>>2]=q;f=c[b+712>>2]|0}n=c[b+720>>2]|0;c[n+(f*104|0)>>2]=0;n=n+(f*104|0)+4|0;k=r;o=n+100|0;do{c[n>>2]=c[k>>2];n=n+4|0;k=k+4|0}while((n|0)<(o|0));h=c[b+712>>2]|0;c[b+712>>2]=h+1;i=c[b+720>>2]|0;n=i+(h*104|0)|0;o=n+104|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));c[i+(h*104|0)+8>>2]=c[d>>2];c[i+(h*104|0)+8+4>>2]=c[d+4>>2];c[i+(h*104|0)+8+8>>2]=c[d+8>>2];c[i+(h*104|0)+8+12>>2]=c[d+12>>2];fp(i+(h*104|0)+24|0,d|0,16)|0;g[i+(h*104|0)+88>>2]=e>0.0?1.0/e:0.0;c[i+(h*104|0)+4>>2]=c[c[b+880>>2]>>2];e=+g[i+(h*104|0)+8>>2];l=+g[i+(h*104|0)+12>>2];m=+g[i+(h*104|0)+16>>2];f=c[b+932>>2]|0;if(f|0){c[b+932>>2]=0;d=f;q=d+32|0;c[q>>2]=0;q=d+36|0;c[q>>2]=i+(h*104|0);q=d+40|0;c[q>>2]=0;g[d>>2]=e-p;q=d+4|0;g[q>>2]=l-p;q=d+8|0;g[q>>2]=m-p;q=d+12|0;g[q>>2]=0.0;q=d+16|0;g[q>>2]=p+e;q=d+20|0;g[q>>2]=p+l;q=d+24|0;g[q>>2]=p+m;q=d+28|0;g[q>>2]=0.0;q=c[b+928>>2]|0;ue(b+928|0,q,d);b=b+940|0;q=c[b>>2]|0;q=q+1|0;c[b>>2]=q;b=i+(h*104|0)+96|0;c[b>>2]=d;sa=r;return}c[7182]=(c[7182]|0)+1;f=xb(63)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}n=f;o=n+44|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(o|0));d=f;q=d+32|0;c[q>>2]=0;q=d+36|0;c[q>>2]=i+(h*104|0);q=d+40|0;c[q>>2]=0;g[d>>2]=e-p;q=d+4|0;g[q>>2]=l-p;q=d+8|0;g[q>>2]=m-p;q=d+12|0;g[q>>2]=0.0;q=d+16|0;g[q>>2]=p+e;q=d+20|0;g[q>>2]=p+l;q=d+24|0;g[q>>2]=p+m;q=d+28|0;g[q>>2]=0.0;q=c[b+928>>2]|0;ue(b+928|0,q,d);b=b+940|0;q=c[b>>2]|0;q=q+1|0;c[b>>2]=q;b=i+(h*104|0)+96|0;c[b>>2]=d;sa=r;return}function jc(b,d,e,f,h,i,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0;H=sa;sa=sa+32|0;c[H+12>>2]=i;c[H+12+4>>2]=j;c[H+12+8>>2]=k;c[H>>2]=e;c[H+4>>2]=f;c[H+8>>2]=h;if(!(+g[d+52>>2]<+g[b+12>>2])){l=0;sa=H;return l|0}v=+g[d+36>>2];y=+g[d+40>>2];w=+g[d+44>>2];k=c[d+48>>2]|0;z=1.0/+x(+(v*v+y*y+w*w));h=Jh(H)|0;A=+g[d+4>>2]-+g[h+48>>2];B=+g[d+8>>2]-+g[h+52>>2];C=+g[d+12>>2]-+g[h+56>>2];h=Jh(H+12|0)|0;D=+g[d+20>>2]-+g[h+48>>2];E=+g[d+24>>2]-+g[h+52>>2];F=+g[d+28>>2]-+g[h+56>>2];if(!f)if(!e){m=0.0;n=0.0;q=0.0;r=0.0;o=0.0;p=0.0}else{p=+g[e+336>>2];q=+g[e+340>>2];u=+g[e+332>>2];m=C*p-B*q;n=+g[e+316>>2];q=A*q-C*u;r=+g[e+320>>2];o=+g[e+324>>2];p=B*u-A*p}else{p=+g[f+332>>2];q=+g[f+336>>2];u=+g[f+328>>2];m=C*p-B*q;n=+g[f+312>>2];q=A*q-C*u;r=+g[f+316>>2];o=+g[f+320>>2];p=B*u-A*p}u=n+m;t=r+q;s=o+p;if(!j)if(!i){o=0.0;p=0.0;q=0.0;r=0.0;m=0.0;n=0.0}else{n=+g[i+336>>2];q=+g[i+340>>2];I=+g[i+332>>2];o=F*n-E*q;p=+g[i+316>>2];q=D*q-F*I;r=+g[i+320>>2];m=+g[i+324>>2];n=E*I-D*n}else{n=+g[j+332>>2];q=+g[j+336>>2];I=+g[j+328>>2];o=F*n-E*q;p=+g[j+312>>2];q=D*q-F*I;r=+g[j+316>>2];m=+g[j+320>>2];n=E*I-D*n}p=u-(p+o);t=t-(r+q);s=s-(m+n);u=w*z*s+(y*z*t+v*z*p);I=+g[d+52>>2]-+g[b+12>>2];c[l+4>>2]=c[H>>2];c[l+4+4>>2]=c[H+4>>2];c[l+4+8>>2]=c[H+8>>2];c[l+16>>2]=c[H+12>>2];c[l+16+4>>2]=c[H+12+4>>2];c[l+16+8>>2]=c[H+12+8>>2];d=Jh(H)|0;r=A*+g[d+4>>2]+B*+g[d+20>>2]+C*+g[d+36>>2];q=A*+g[d+8>>2]+B*+g[d+24>>2]+C*+g[d+40>>2];g[l+28>>2]=A*+g[d>>2]+B*+g[d+16>>2]+C*+g[d+32>>2];g[l+32>>2]=r;g[l+36>>2]=q;g[l+40>>2]=0.0;d=Jh(H+12|0)|0;q=D*+g[d+4>>2]+E*+g[d+20>>2]+F*+g[d+36>>2];r=D*+g[d+8>>2]+E*+g[d+24>>2]+F*+g[d+40>>2];g[l+44>>2]=D*+g[d>>2]+E*+g[d+16>>2]+F*+g[d+32>>2];g[l+48>>2]=q;g[l+52>>2]=r;g[l+56>>2]=0.0;g[l+164>>2]=A;g[l+168>>2]=B;g[l+172>>2]=C;g[l+176>>2]=0.0;g[l+180>>2]=D;g[l+184>>2]=E;g[l+188>>2]=F;g[l+192>>2]=0.0;g[l+60>>2]=1.0;g[l+64>>2]=1.0;c[l+156>>2]=0;c[l+160>>2]=0;g[l+68>>2]=1.0;g[l+72>>2]=v*z*I;g[l+76>>2]=y*z*I;g[l+80>>2]=w*z*I;g[l+84>>2]=0.0;g[l+196>>2]=v*z;g[l+200>>2]=y*z;g[l+204>>2]=w*z;c[l+208>>2]=k;a[l+152>>0]=0;I=+g[b+16>>2];g[l+212>>2]=(s-w*z*u)*(s-w*z*u)+((p-v*z*u)*(p-v*z*u)+(t-y*z*u)*(t-y*z*u))>2]|0;if(!k){k=c[H>>2]|0;if(!k)n=0.0;else{k=k+128|0;G=14}}else{k=k+344|0;G=14}if((G|0)==14)n=+g[k>>2];if((a[26656]|0)==0?mz(26656)|0:0){k=27192;h=k+48|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(h|0))}k=c[H+4>>2]|0;if(!k){e=c[H>>2]|0;e=(e|0)==0?27192:e+180|0}else e=k+264|0;k=c[H+12+4>>2]|0;if(!k){k=c[H+12>>2]|0;if(!k)m=0.0;else{k=k+128|0;G=25}}else{k=k+344|0;G=25}if((G|0)==25)m=+g[k>>2];if((a[26656]|0)==0?mz(26656)|0:0){k=27192;h=k+48|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(h|0))}k=c[H+12+4>>2]|0;if(!k){k=c[H+12>>2]|0;k=(k|0)==0?27192:k+180|0}else k=k+264|0;V=+g[l+172>>2];N=+g[l+168>>2];M=+g[l+164>>2];U=+g[e>>2];T=+g[e+16>>2];S=+g[e+32>>2];R=+g[e+4>>2];Q=+g[e+20>>2];P=+g[e+36>>2];O=+g[e+8>>2];L=+g[e+24>>2];K=+g[e+40>>2];B=+g[l+188>>2];u=+g[l+184>>2];v=+g[l+180>>2];J=+g[k>>2];o=+g[k+16>>2];p=+g[k+32>>2];q=+g[k+4>>2];r=+g[k+20>>2];s=+g[k+36>>2];t=+g[k+8>>2];I=+g[k+24>>2];w=+g[k+40>>2];D=n-((U*0.0+T*-V+N*S)*0.0+V*(R*0.0+Q*-V+N*P)+(O*0.0+L*-V+N*K)*-N)+(m-((J*0.0+o*-B+u*p)*0.0+B*(q*0.0+r*-B+u*s)+(t*0.0+I*-B+u*w)*-u));F=0.0-((U*0.0+T*-V+N*S)*-V+(R*0.0+Q*-V+N*P)*0.0+M*(O*0.0+L*-V+N*K))+(0.0-((J*0.0+o*-B+u*p)*-B+(q*0.0+r*-B+u*s)*0.0+v*(t*0.0+I*-B+u*w)));y=0.0-(N*(U*0.0+T*-V+N*S)+(R*0.0+Q*-V+N*P)*-M+(O*0.0+L*-V+N*K)*0.0)+(0.0-(u*(J*0.0+o*-B+u*p)+(q*0.0+r*-B+u*s)*-v+(t*0.0+I*-B+u*w)*0.0));E=0.0-((V*U+T*0.0+S*-M)*0.0+V*(V*R+Q*0.0+P*-M)+(V*O+L*0.0+K*-M)*-N)+(0.0-((B*J+o*0.0+p*-v)*0.0+B*(B*q+r*0.0+s*-v)+(B*t+I*0.0+w*-v)*-u));C=n-((V*U+T*0.0+S*-M)*-V+(V*R+Q*0.0+P*-M)*0.0+M*(V*O+L*0.0+K*-M))+(m-((B*J+o*0.0+p*-v)*-B+(B*q+r*0.0+s*-v)*0.0+v*(B*t+I*0.0+w*-v)));z=0.0-(N*(V*U+T*0.0+S*-M)+(V*R+Q*0.0+P*-M)*-M+(V*O+L*0.0+K*-M)*0.0)+(0.0-(u*(B*J+o*0.0+p*-v)+(B*q+r*0.0+s*-v)*-v+(B*t+I*0.0+w*-v)*0.0));A=0.0-((U*-N+M*T+S*0.0)*0.0+V*(R*-N+M*Q+P*0.0)+(O*-N+M*L+K*0.0)*-N)+(0.0-((J*-u+v*o+p*0.0)*0.0+B*(q*-u+v*r+s*0.0)+(t*-u+v*I+w*0.0)*-u));B=0.0-((U*-N+M*T+S*0.0)*-V+(R*-N+M*Q+P*0.0)*0.0+M*(O*-N+M*L+K*0.0))+(0.0-((J*-u+v*o+p*0.0)*-B+(q*-u+v*r+s*0.0)*0.0+v*(t*-u+v*I+w*0.0)));w=n-(N*(U*-N+M*T+S*0.0)+(R*-N+M*Q+P*0.0)*-M+(O*-N+M*L+K*0.0)*0.0)+(m-(u*(J*-u+v*o+p*0.0)+(q*-u+v*r+s*0.0)*-v+(t*-u+v*I+w*0.0)*0.0));I=1.0/(y*(B*E-C*A)+(D*(C*w-z*B)+F*(z*A-w*E)));g[l+104>>2]=(C*w-z*B)*I;g[l+108>>2]=(B*y-w*F)*I;g[l+112>>2]=(z*F-C*y)*I;g[l+116>>2]=0.0;g[l+120>>2]=(z*A-w*E)*I;g[l+124>>2]=(w*D-A*y)*I;g[l+128>>2]=(E*y-z*D)*I;g[l+132>>2]=0.0;g[l+136>>2]=(B*E-C*A)*I;g[l+140>>2]=(A*F-B*D)*I;g[l+144>>2]=(C*D-E*F)*I;g[l+148>>2]=0.0;l=1;sa=H;return l|0}function kc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0;w=(a[b+180>>0]|0)==0;if(w?(a[b+48>>0]|0)!=0:0){r=+g[b+116>>2];h=+g[e>>2];J=+g[b+132>>2];f=+g[e+4>>2];K=+g[b+148>>2];z=+g[e+8>>2];s=+g[b+120>>2];H=+g[b+136>>2];I=+g[b+152>>2];t=+g[b+124>>2];G=+g[b+140>>2];u=+g[b+156>>2];x=+g[e+16>>2];y=+g[e+20>>2];A=+g[e+24>>2];F=+g[e+32>>2];v=+g[e+36>>2];B=+g[e+40>>2];m=+g[b+164>>2];i=+g[b+168>>2];E=+g[b+172>>2];D=+g[e+48>>2]+(h*m+f*i+z*E);C=x*m+y*i+A*E+ +g[e+52>>2];E=F*m+v*i+B*E+ +g[e+56>>2];g[b+824>>2]=r*h+J*f+K*z;g[b+828>>2]=h*s+f*H+z*I;g[b+832>>2]=h*t+f*G+z*u;g[b+836>>2]=0.0;g[b+840>>2]=r*x+J*y+K*A;g[b+844>>2]=s*x+H*y+I*A;g[b+848>>2]=t*x+G*y+u*A;g[b+852>>2]=0.0;g[b+856>>2]=r*F+J*v+K*B;g[b+860>>2]=s*F+H*v+I*B;g[b+864>>2]=t*F+G*v+u*B;g[b+868>>2]=0.0;g[b+872>>2]=D;g[b+876>>2]=C;g[b+880>>2]=E;g[b+884>>2]=0.0;E=+g[b+52>>2];C=+g[d>>2];D=+g[b+68>>2];B=+g[d+4>>2];u=+g[b+84>>2];v=+g[d+8>>2];G=+g[b+56>>2];F=+g[b+72>>2];t=+g[b+88>>2];I=+g[b+60>>2];H=+g[b+76>>2];s=+g[b+92>>2];K=+g[d+16>>2];J=+g[d+20>>2];r=+g[d+24>>2];A=+g[d+32>>2];y=+g[d+36>>2];x=+g[d+40>>2];z=+g[b+100>>2];f=+g[b+104>>2];h=+g[b+108>>2];k=b+856|0;l=b+840|0;i=K*z+J*f+r*h;m=I*A+H*y+s*x;n=G*A+F*y+t*x;o=E*A+D*y+u*x;p=I*K+H*J+s*r;q=G*K+F*J+t*r;r=E*K+D*J+u*r;s=C*I+B*H+v*s;t=C*G+B*F+v*t;u=E*C+D*B+u*v;v=C*z+B*f+v*h;f=A*z+y*f;h=x*h}else{r=+g[b+52>>2];h=+g[d>>2];y=+g[b+68>>2];f=+g[d+4>>2];x=+g[b+84>>2];I=+g[d+8>>2];s=+g[b+56>>2];A=+g[b+72>>2];z=+g[b+88>>2];t=+g[b+60>>2];B=+g[b+76>>2];u=+g[b+92>>2];K=+g[d+16>>2];J=+g[d+20>>2];H=+g[d+24>>2];C=+g[d+32>>2];v=+g[d+36>>2];G=+g[d+40>>2];m=+g[b+100>>2];i=+g[b+104>>2];D=+g[b+108>>2];E=+g[d+48>>2]+(h*m+f*i+I*D);F=K*m+J*i+H*D+ +g[d+52>>2];D=C*m+v*i+G*D+ +g[d+56>>2];g[b+824>>2]=r*h+y*f+x*I;g[b+828>>2]=h*s+f*A+I*z;g[b+832>>2]=h*t+f*B+I*u;g[b+836>>2]=0.0;g[b+840>>2]=r*K+y*J+x*H;g[b+844>>2]=s*K+A*J+z*H;g[b+848>>2]=t*K+B*J+u*H;g[b+852>>2]=0.0;g[b+856>>2]=r*C+y*v+x*G;g[b+860>>2]=s*C+A*v+z*G;g[b+864>>2]=t*C+B*v+u*G;g[b+868>>2]=0.0;g[b+872>>2]=E;g[b+876>>2]=F;g[b+880>>2]=D;g[b+884>>2]=0.0;D=+g[b+116>>2];F=+g[e>>2];E=+g[b+132>>2];G=+g[e+4>>2];u=+g[b+148>>2];v=+g[e+8>>2];B=+g[b+120>>2];C=+g[b+136>>2];t=+g[b+152>>2];z=+g[b+124>>2];A=+g[b+140>>2];s=+g[b+156>>2];x=+g[e+16>>2];y=+g[e+20>>2];r=+g[e+24>>2];H=+g[e+32>>2];J=+g[e+36>>2];K=+g[e+40>>2];I=+g[b+164>>2];f=+g[b+168>>2];h=+g[b+172>>2];k=b+856|0;l=b+840|0;i=x*I+y*f+r*h;m=z*H+A*J+s*K;n=B*H+C*J+t*K;o=D*H+E*J+u*K;p=z*x+A*y+s*r;q=B*x+C*y+t*r;r=D*x+E*y+u*r;s=F*z+G*A+v*s;t=F*B+G*C+v*t;u=D*F+E*G+u*v;v=F*I+G*f+v*h;d=e;f=H*I+J*f;h=K*h}K=+g[d+48>>2]+v;i=i+ +g[d+52>>2];f=f+h+ +g[d+56>>2];g[b+888>>2]=u;g[b+892>>2]=t;g[b+896>>2]=s;g[b+900>>2]=0.0;g[b+904>>2]=r;g[b+908>>2]=q;g[b+912>>2]=p;g[b+916>>2]=0.0;g[b+920>>2]=o;g[b+924>>2]=n;g[b+928>>2]=m;g[b+932>>2]=0.0;g[b+936>>2]=K;g[b+940>>2]=i;g[b+944>>2]=f;g[b+948>>2]=0.0;c[b+968>>2]=c[b+872>>2];c[b+968+4>>2]=c[b+872+4>>2];c[b+968+8>>2]=c[b+872+8>>2];c[b+968+12>>2]=c[b+872+12>>2];c[b+984>>2]=c[b+936>>2];c[b+984+4>>2]=c[b+936+4>>2];c[b+984+8>>2]=c[b+936+8>>2];c[b+984+12>>2]=c[b+936+12>>2];d=c[b+824>>2]|0;e=c[l>>2]|0;l=c[k>>2]|0;c[b+952>>2]=d;c[b+956>>2]=e;c[b+960>>2]=l;g[b+964>>2]=0.0;f=(c[j>>2]=d,+g[j>>2]);h=(c[j>>2]=e,+g[j>>2]);i=(c[j>>2]=l,+g[j>>2]);if(w?(a[b+48>>0]|0)==0:0){B=+g[b+968>>2];C=+g[b+972>>2];D=+g[b+976>>2];I=D-+g[b+992>>2];G=C-+g[b+988>>2];F=B-+g[b+984>>2];w=b+1016|0;g[w>>2]=F;w=b+1020|0;g[w>>2]=G;w=b+1024|0;g[w>>2]=I;w=b+1028|0;g[w>>2]=0.0;K=F*f;E=G*h;E=K+E;K=I*i;K=E+K;E=K*f;H=K*h;J=K*i;E=B+E;H=C+H;J=D+J;w=b+1e3|0;g[w>>2]=E;w=b+1004|0;g[w>>2]=H;w=b+1008|0;g[w>>2]=J;w=b+1012|0;g[w>>2]=0.0;w=b+1032|0;g[w>>2]=K;w=b+828|0;l=b+844|0;k=b+860|0;K=+g[w>>2];J=+g[l>>2];H=+g[k>>2];K=F*K;J=G*J;J=K+J;H=I*H;H=J+H;k=b+1036|0;g[k>>2]=H;k=b+832|0;l=b+848|0;w=b+864|0;H=+g[k>>2];J=+g[l>>2];K=+g[w>>2];H=F*H;J=G*J;J=H+J;K=I*K;K=J+K;w=b+1040|0;g[w>>2]=K;return}B=+g[b+968>>2];C=+g[b+972>>2];D=+g[b+976>>2];I=+g[b+992>>2]-D;G=+g[b+988>>2]-C;F=+g[b+984>>2]-B;w=b+1016|0;g[w>>2]=F;w=b+1020|0;g[w>>2]=G;w=b+1024|0;g[w>>2]=I;w=b+1028|0;g[w>>2]=0.0;K=F*f;E=G*h;E=K+E;K=I*i;K=E+K;E=K*f;H=K*h;J=K*i;E=B+E;H=C+H;J=D+J;w=b+1e3|0;g[w>>2]=E;w=b+1004|0;g[w>>2]=H;w=b+1008|0;g[w>>2]=J;w=b+1012|0;g[w>>2]=0.0;w=b+1032|0;g[w>>2]=K;w=b+828|0;l=b+844|0;k=b+860|0;K=+g[w>>2];J=+g[l>>2];H=+g[k>>2];K=F*K;J=G*J;J=K+J;H=I*H;H=J+H;k=b+1036|0;g[k>>2]=H;k=b+832|0;l=b+848|0;w=b+864|0;H=+g[k>>2];J=+g[l>>2];K=+g[w>>2];H=F*H;J=G*J;J=H+J;K=I*K;K=J+K;w=b+1040|0;g[w>>2]=K;return}function lc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0,u=0.0,v=0.0,w=0;t=sa;sa=sa+672|0;c[t+448+8>>2]=0;c[t+448+12>>2]=1065353216;c[t+448+16>>2]=1065353216;c[t+448+20>>2]=1065353216;g[t+448+24>>2]=0.0;c[t+448>>2]=9480;c[t+448+4>>2]=8;g[t+448+28>>2]=0.0;g[t+448+44>>2]=0.0;g[t+384>>2]=1.0;c[t+384+4>>2]=0;c[t+384+4+4>>2]=0;c[t+384+4+8>>2]=0;c[t+384+4+12>>2]=0;g[t+384+20>>2]=1.0;c[t+384+24>>2]=0;c[t+384+24+4>>2]=0;c[t+384+24+8>>2]=0;c[t+384+24+12>>2]=0;g[t+384+40>>2]=1.0;g[t+384+44>>2]=0.0;c[t+384+48>>2]=c[a>>2];c[t+384+48+4>>2]=c[a+4>>2];c[t+384+48+8>>2]=c[a+8>>2];c[t+384+48+12>>2]=c[a+12>>2];a=e;k=a+36|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(k|0));c[t+504>>2]=b;c[t+504+4>>2]=t+448;v=+g[d>>2];u=+g[d+16>>2];f=+g[d+32>>2];h=+g[d+4>>2];i=+g[d+20>>2];j=+g[d+36>>2];m=+g[d+8>>2];p=+g[d+24>>2];r=+g[d+40>>2];g[t+504+8>>2]=v+u*0.0+f*0.0;g[t+504+12>>2]=h+i*0.0+j*0.0;g[t+504+16>>2]=m+p*0.0+r*0.0;g[t+504+20>>2]=0.0;g[t+504+24>>2]=v*0.0+u+f*0.0;g[t+504+28>>2]=h*0.0+i+j*0.0;g[t+504+32>>2]=m*0.0+p+r*0.0;g[t+504+36>>2]=0.0;g[t+504+40>>2]=v*0.0+u*0.0+f;g[t+504+44>>2]=h*0.0+i*0.0+j;g[t+504+48>>2]=m*0.0+p*0.0+r;g[t+504+52>>2]=0.0;l=+g[t+384+48>>2]-+g[d+48>>2];n=+g[t+384+52>>2]-+g[d+52>>2];q=+g[t+384+56>>2]-+g[d+56>>2];g[t+504+56>>2]=v+u*0.0+f*0.0;g[t+504+60>>2]=v*0.0+u+f*0.0;g[t+504+64>>2]=v*0.0+u*0.0+f;g[t+504+68>>2]=0.0;g[t+504+72>>2]=h+i*0.0+j*0.0;g[t+504+76>>2]=h*0.0+i+j*0.0;g[t+504+80>>2]=h*0.0+i*0.0+j;g[t+504+84>>2]=0.0;g[t+504+88>>2]=m+p*0.0+r*0.0;g[t+504+92>>2]=m*0.0+p+r*0.0;g[t+504+96>>2]=m*0.0+p*0.0+r;g[t+504+100>>2]=0.0;g[t+504+104>>2]=l*v+n*u+q*f;g[t+504+108>>2]=l*h+n*i+q*j;g[t+504+112>>2]=l*m+n*p+q*r;g[t+504+116>>2]=0.0;c[t+504+120>>2]=81;c[t+504+124>>2]=0;c[t+364>>2]=0;c[t+128>>2]=0;c[t+128+4>>2]=0;c[t+128+8>>2]=0;c[t+128+12>>2]=0;c[t+376>>2]=2;c[t+368>>2]=0;g[t+144>>2]=0.0;c[t+648>>2]=1065353216;c[t+648+4>>2]=1065353216;c[t+648+8>>2]=1065353216;g[t+648+12>>2]=0.0;switch(Rb(t,t+504|0,t+648|0)|0){case 0:{a=c[t+372>>2]|0;if(!(c[a+32>>2]|0)){j=0.0;i=0.0;f=0.0;p=0.0;n=0.0;h=0.0}else{s=0;f=0.0;i=0.0;j=0.0;h=0.0;n=0.0;p=0.0;do{r=+g[a+16+(s<<2)>>2];k=c[t+504+120>>2]|0;w=c[t+504+124>>2]|0;o=(c[t+504>>2]|0)+(1?w>>1:w)|0;if(w&1)k=c[(c[o>>2]|0)+k>>2]|0;Za[k&127](t+648|0,o,c[a+(s<<2)>>2]|0);f=f+r*+g[t+648>>2];i=i+r*+g[t+648+4>>2];j=j+r*+g[t+648+8>>2];a=c[(c[t+372>>2]|0)+(s<<2)>>2]|0;l=-+g[a>>2];m=-+g[a+4>>2];q=-+g[a+8>>2];a=c[t+504+120>>2]|0;w=c[t+504+124>>2]|0;k=(c[t+504+4>>2]|0)+(1?w>>1:w)|0;if(w&1)a=c[(c[k>>2]|0)+a>>2]|0;v=+g[t+504+24>>2]*l+ +g[t+504+28>>2]*m+ +g[t+504+32>>2]*q;u=+g[t+504+40>>2]*l+ +g[t+504+44>>2]*m+ +g[t+504+48>>2]*q;g[t+632>>2]=+g[t+504+8>>2]*l+ +g[t+504+12>>2]*m+ +g[t+504+16>>2]*q;g[t+632+4>>2]=v;g[t+632+8>>2]=u;g[t+632+12>>2]=0.0;Za[a&127](t+648|0,k,t+632|0);q=+g[t+648>>2];u=+g[t+648+4>>2];v=+g[t+648+8>>2];h=h+r*(q*+g[t+504+56>>2]+u*+g[t+504+60>>2]+v*+g[t+504+64>>2]+ +g[t+504+104>>2]);n=n+r*(q*+g[t+504+72>>2]+u*+g[t+504+76>>2]+v*+g[t+504+80>>2]+ +g[t+504+108>>2]);p=p+r*(q*+g[t+504+88>>2]+u*+g[t+504+92>>2]+v*+g[t+504+96>>2]+ +g[t+504+112>>2]);s=s+1|0;a=c[t+372>>2]|0}while(s>>>0<(c[a+32>>2]|0)>>>0)}q=f*+g[d>>2]+i*+g[d+4>>2]+j*+g[d+8>>2]+ +g[d+48>>2];r=f*+g[d+16>>2]+i*+g[d+20>>2]+j*+g[d+24>>2]+ +g[d+52>>2];j=f*+g[d+32>>2]+i*+g[d+36>>2]+j*+g[d+40>>2]+ +g[d+56>>2];g[e+4>>2]=q;g[e+8>>2]=r;g[e+12>>2]=j;g[e+16>>2]=0.0;l=h*+g[d>>2]+n*+g[d+4>>2]+p*+g[d+8>>2]+ +g[d+48>>2];m=h*+g[d+16>>2]+n*+g[d+20>>2]+p*+g[d+24>>2]+ +g[d+52>>2];i=h*+g[d+32>>2]+n*+g[d+36>>2]+p*+g[d+40>>2]+ +g[d+56>>2];g[e+20>>2]=l;g[e+24>>2]=m;g[e+28>>2]=i;g[e+32>>2]=0.0;switch(c[b+4>>2]|0){case 8:{f=+g[b+28>>2]*+g[b+12>>2];break}case 0:{f=+g[b+44>>2];break}case 1:{f=+g[b+44>>2];break}case 13:{f=+g[b+44>>2];break}case 11:{f=+g[b+44>>2];break}case 10:{f=+g[b+44>>2];break}case 4:case 5:{f=+g[b+44>>2];break}default:f=+va[c[(c[b>>2]|0)+48>>2]&15](b)}switch(c[t+448+4>>2]|0){case 8:{h=+g[t+448+28>>2]*+g[t+448+12>>2];break}case 0:{h=+g[t+448+44>>2];break}case 1:{h=+g[t+448+44>>2];break}case 13:{h=+g[t+448+44>>2];break}case 11:{h=+g[t+448+44>>2];break}case 10:{h=+g[t+448+44>>2];break}case 4:case 5:{h=+g[t+448+44>>2];break}default:h=+va[c[(c[t+448>>2]|0)+48>>2]&15](t+448|0)}v=f+h;u=+x(+((l-q)*(l-q)+(m-r)*(m-r)+(i-j)*(i-j)));g[e+36>>2]=(l-q)*(1.0/u);g[e+40>>2]=(m-r)*(1.0/u);g[e+44>>2]=(i-j)*(1.0/u);g[e+48>>2]=0.0;g[e+4>>2]=v*(l-q)*(1.0/u)+ +g[e+4>>2];g[e+8>>2]=v*(m-r)*(1.0/u)+ +g[e+8>>2];g[e+12>>2]=v*(i-j)*(1.0/u)+ +g[e+12>>2];v=u-v;sa=t;return +v}case 1:{if(!(Ob(b,d,t+448|0,t+384|0,t+128|0,e,1)|0)){v=3402823466385288598117041.0e14;sa=t;return +v}f=+g[e+4>>2]-+g[e+20>>2];h=+g[e+8>>2]-+g[e+24>>2];i=+g[e+12>>2]-+g[e+28>>2];j=+x(+(f*f+h*h+i*i));if(j>=1.1920928955078125e-07){g[e+36>>2]=f*(1.0/j);g[e+40>>2]=h*(1.0/j);g[e+44>>2]=i*(1.0/j);g[e+48>>2]=0.0}v=-j;sa=t;return +v}default:{v=3402823466385288598117041.0e14;sa=t;return +v}}return 0.0}function mc(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0;q=sa;sa=sa+224|0;o=(a[b+28>>0]|0)!=0;n=o?e:d;o=o?d:e;p=c[n+4>>2]|0;if((c[p+68>>2]|0)!=(c[b+40>>2]|0)){j=c[b+12>>2]|0;if((j|0)>0){i=0;do{k=c[(c[b+20>>2]|0)+(i<<2)>>2]|0;if(k|0){Pa[c[c[k>>2]>>2]&511](k);l=c[b+4>>2]|0;Va[c[(c[l>>2]|0)+60>>2]&127](l,c[(c[b+20>>2]|0)+(i<<2)>>2]|0)}i=i+1|0}while((i|0)!=(j|0))}ug(b,d,e)}l=c[p+64>>2]|0;k=c[b+4>>2]|0;i=c[b+20>>2]|0;d=c[b+32>>2]|0;c[q+192>>2]=9e3;c[q+192+4>>2]=n;c[q+192+8>>2]=o;c[q+192+12>>2]=k;c[q+192+16>>2]=f;c[q+192+20>>2]=h;c[q+192+24>>2]=i;c[q+192+28>>2]=d;a[q+128+16>>0]=1;f=q+128+12|0;c[f>>2]=0;c[q+128+4>>2]=0;c[q+128+8>>2]=0;d=c[b+12>>2]|0;if((d|0)>0){k=0;while(1){i=c[i+(k<<2)>>2]|0;if(i){Va[c[(c[i>>2]|0)+16>>2]&127](i,q+128|0);i=c[q+128+4>>2]|0;if((i|0)>0){j=0;do{e=c[(c[f>>2]|0)+(j<<2)>>2]|0;if(c[e+748>>2]|0){c[h+4>>2]=e;i=c[e+740>>2]|0;d=c[(c[h+8>>2]|0)+8>>2]|0;if((i|0)==(d|0))re(e,i+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);else re(e,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,d+4|0);c[h+4>>2]=0;i=c[q+128+4>>2]|0}j=j+1|0}while((j|0)<(i|0))}if((i|0)<0){if((c[q+128+8>>2]|0)<0){d=c[f>>2]|0;if(d|0){if(a[q+128+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[f>>2]=0}a[q+128+16>>0]=1;c[f>>2]=0;c[q+128+8>>2]=0}do{c[(c[f>>2]|0)+(i<<2)>>2]=0;i=i+1|0}while((i|0)!=0)}c[q+128+4>>2]=0;d=c[b+12>>2]|0}i=k+1|0;if((i|0)>=(d|0))break;k=i;i=c[b+20>>2]|0}i=c[f>>2]|0;if(i|0){if(a[q+128+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[f>>2]=0}}if(!l){d=c[b+12>>2]|0;if((d|0)>0){i=0;do{ae(q+192|0,c[(c[p+24>>2]|0)+(i*80|0)+64>>2]|0,i);i=i+1|0}while((i|0)<(d|0));m=40}}else{m=c[n+12>>2]|0;F=+g[m>>2];E=+g[m+16>>2];D=+g[m+32>>2];C=+g[m+4>>2];B=+g[m+20>>2];A=+g[m+36>>2];w=+g[m+8>>2];u=+g[m+24>>2];s=+g[m+40>>2];z=-+g[m+48>>2];y=-+g[m+52>>2];x=-+g[m+56>>2];m=c[o+12>>2]|0;O=+g[m>>2];N=+g[m+16>>2];M=+g[m+32>>2];L=+g[m+4>>2];K=+g[m+20>>2];J=+g[m+36>>2];I=+g[m+8>>2];H=+g[m+24>>2];G=+g[m+40>>2];v=+g[m+48>>2];t=+g[m+52>>2];r=+g[m+56>>2];g[q+48>>2]=F*O+E*N+D*M;g[q+48+4>>2]=F*L+E*K+D*J;g[q+48+8>>2]=F*I+E*H+D*G;g[q+48+12>>2]=0.0;g[q+48+16>>2]=C*O+B*N+A*M;g[q+48+20>>2]=C*L+B*K+A*J;g[q+48+24>>2]=C*I+B*H+A*G;g[q+48+28>>2]=0.0;g[q+48+32>>2]=w*O+u*N+s*M;g[q+48+36>>2]=w*L+u*K+s*J;g[q+48+40>>2]=w*I+u*H+s*G;g[q+48+44>>2]=0.0;g[q+48+48>>2]=F*z+E*y+D*x+(F*v+E*t+D*r);g[q+48+52>>2]=C*z+B*y+A*x+(C*v+B*t+A*r);g[q+48+56>>2]=w*z+u*y+s*x+(w*v+u*t+s*r);g[q+48+60>>2]=0.0;m=c[o+4>>2]|0;ab[c[(c[m>>2]|0)+8>>2]&127](m,q+48|0,q+128|0,q+112|0);c[q+16>>2]=c[q+128>>2];c[q+16+4>>2]=c[q+128+4>>2];c[q+16+8>>2]=c[q+128+8>>2];c[q+16+12>>2]=c[q+128+12>>2];c[q+16+16>>2]=c[q+112>>2];c[q+16+16+4>>2]=c[q+112+4>>2];c[q+16+16+8>>2]=c[q+112+8>>2];c[q+16+16+12>>2]=c[q+112+12>>2];le(c[l>>2]|0,q+16|0,q+192|0);m=40}if((m|0)==40)d=c[b+12>>2]|0;if((d|0)<=0){sa=q;return}e=0;do{do if(c[(c[b+20>>2]|0)+(e<<2)>>2]|0){l=c[p+24>>2]|0;m=c[l+(e*80|0)+64>>2]|0;h=c[n+12>>2]|0;u=+g[h>>2];v=+g[h+4>>2];w=+g[h+8>>2];x=+g[h+16>>2];y=+g[h+20>>2];z=+g[h+24>>2];G=+g[h+32>>2];I=+g[h+36>>2];K=+g[h+40>>2];A=+g[l+(e*80|0)>>2];B=+g[l+(e*80|0)+16>>2];C=+g[l+(e*80|0)+32>>2];D=+g[l+(e*80|0)+4>>2];E=+g[l+(e*80|0)+20>>2];F=+g[l+(e*80|0)+36>>2];H=+g[l+(e*80|0)+8>>2];J=+g[l+(e*80|0)+24>>2];L=+g[l+(e*80|0)+40>>2];s=+g[l+(e*80|0)+48>>2];t=+g[l+(e*80|0)+52>>2];O=+g[l+(e*80|0)+56>>2];M=+g[h+48>>2]+(u*s+v*t+w*O);N=+g[h+52>>2]+(x*s+y*t+z*O);O=+g[h+56>>2]+(G*s+I*t+K*O);g[q+128>>2]=u*A+v*B+w*C;g[q+128+4>>2]=u*D+v*E+w*F;g[q+128+8>>2]=u*H+v*J+w*L;g[q+128+12>>2]=0.0;g[q+128+16>>2]=x*A+y*B+z*C;g[q+128+20>>2]=x*D+y*E+z*F;g[q+128+24>>2]=x*H+y*J+z*L;g[q+128+28>>2]=0.0;g[q+128+32>>2]=G*A+I*B+K*C;g[q+128+36>>2]=G*D+I*E+K*F;g[q+128+40>>2]=G*H+I*J+K*L;g[q+128+44>>2]=0.0;g[q+128+48>>2]=M;g[q+128+52>>2]=N;g[q+128+56>>2]=O;g[q+128+60>>2]=0.0;ab[c[(c[m>>2]|0)+8>>2]&127](m,q+128|0,q+112|0,q+48|0);m=c[o+4>>2]|0;ab[c[(c[m>>2]|0)+8>>2]&127](m,c[o+12>>2]|0,q+16|0,q);if(!(+g[q+112>>2]>+g[q>>2])?!(+g[q+48>>2]<+g[q+16>>2]):0)i=1;else i=0;if(!(!(+g[q+112+8>>2]>+g[q+8>>2])?!(+g[q+48+8>>2]<+g[q+16+8>>2]):0))i=0;if(!(+g[q+112+4>>2]>+g[q+4>>2])?!(+g[q+48+4>>2]<+g[q+16+4>>2]|i^1):0)break;m=c[(c[b+20>>2]|0)+(e<<2)>>2]|0;Pa[c[c[m>>2]>>2]&511](m);m=c[b+4>>2]|0;Va[c[(c[m>>2]|0)+60>>2]&127](m,c[(c[b+20>>2]|0)+(e<<2)>>2]|0);c[(c[b+20>>2]|0)+(e<<2)>>2]=0}while(0);e=e+1|0}while((e|0)<(d|0));sa=q;return}function nc(a,b,f,i){a=a|0;b=b|0;f=f|0;i=i|0;var j=0.0,k=0.0,l=0.0,m=0,n=0,o=0.0,p=0.0,q=0,r=0,s=0,t=0;n=sa;sa=sa+80|0;m=Fa[c[(c[a>>2]|0)+28>>2]&127](a)|0;j=+g[a+4>>2];k=+g[a+8>>2];l=+g[a+12>>2];if((m|0)<=0){sa=n;return}i=0;do{kb[c[(c[a>>2]|0)+16>>2]&3](a,n+76|0,n+52|0,n+64|0,n+56|0,n+72|0,n+68|0,n+48|0,n+60|0,i);a:do switch(c[n+64>>2]|0){case 0:{switch(c[n+60>>2]|0){case 2:{if((c[n+48>>2]|0)<=0)break a;f=0;do{r=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;s=c[n+76>>2]|0;q=c[n+56>>2]|0;t=s+(J(q,c[r>>2]|0)|0)|0;p=k*+g[t+4>>2];o=l*+g[t+8>>2];g[n>>2]=j*+g[t>>2];g[n+4>>2]=p;g[n+8>>2]=o;g[n+12>>2]=0.0;t=s+(J(c[r+4>>2]|0,q)|0)|0;o=k*+g[t+4>>2];p=l*+g[t+8>>2];g[n+16>>2]=j*+g[t>>2];g[n+20>>2]=o;g[n+24>>2]=p;g[n+28>>2]=0.0;q=s+(J(c[r+8>>2]|0,q)|0)|0;p=k*+g[q+4>>2];o=l*+g[q+8>>2];g[n+32>>2]=j*+g[q>>2];g[n+36>>2]=p;g[n+40>>2]=o;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}case 3:{if((c[n+48>>2]|0)<=0)break a;f=0;do{t=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;r=c[n+76>>2]|0;s=c[n+56>>2]|0;q=r+(J(s,e[t>>1]|0)|0)|0;o=k*+g[q+4>>2];p=l*+g[q+8>>2];g[n>>2]=j*+g[q>>2];g[n+4>>2]=o;g[n+8>>2]=p;g[n+12>>2]=0.0;q=r+(J(s,e[t+2>>1]|0)|0)|0;p=k*+g[q+4>>2];o=l*+g[q+8>>2];g[n+16>>2]=j*+g[q>>2];g[n+20>>2]=p;g[n+24>>2]=o;g[n+28>>2]=0.0;t=r+(J(s,e[t+4>>1]|0)|0)|0;o=k*+g[t+4>>2];p=l*+g[t+8>>2];g[n+32>>2]=j*+g[t>>2];g[n+36>>2]=o;g[n+40>>2]=p;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}case 5:{if((c[n+48>>2]|0)<=0)break a;f=0;do{t=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;r=c[n+76>>2]|0;s=c[n+56>>2]|0;q=r+(J(s,d[t>>0]|0)|0)|0;o=k*+g[q+4>>2];p=l*+g[q+8>>2];g[n>>2]=j*+g[q>>2];g[n+4>>2]=o;g[n+8>>2]=p;g[n+12>>2]=0.0;q=r+(J(s,d[t+1>>0]|0)|0)|0;p=k*+g[q+4>>2];o=l*+g[q+8>>2];g[n+16>>2]=j*+g[q>>2];g[n+20>>2]=p;g[n+24>>2]=o;g[n+28>>2]=0.0;t=r+(J(s,d[t+2>>0]|0)|0)|0;o=k*+g[t+4>>2];p=l*+g[t+8>>2];g[n+32>>2]=j*+g[t>>2];g[n+36>>2]=o;g[n+40>>2]=p;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}default:break a}break}case 1:{switch(c[n+60>>2]|0){case 2:{if((c[n+48>>2]|0)<=0)break a;f=0;do{s=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;r=c[n+76>>2]|0;t=c[n+56>>2]|0;q=r+(J(t,c[s>>2]|0)|0)|0;o=k*+h[q+8>>3];p=l*+h[q+16>>3];g[n>>2]=j*+h[q>>3];g[n+4>>2]=o;g[n+8>>2]=p;g[n+12>>2]=0.0;q=r+(J(c[s+4>>2]|0,t)|0)|0;p=k*+h[q+8>>3];o=l*+h[q+16>>3];g[n+16>>2]=j*+h[q>>3];g[n+20>>2]=p;g[n+24>>2]=o;g[n+28>>2]=0.0;t=r+(J(c[s+8>>2]|0,t)|0)|0;o=k*+h[t+8>>3];p=l*+h[t+16>>3];g[n+32>>2]=j*+h[t>>3];g[n+36>>2]=o;g[n+40>>2]=p;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}case 3:{if((c[n+48>>2]|0)<=0)break a;f=0;do{t=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;r=c[n+76>>2]|0;s=c[n+56>>2]|0;q=r+(J(s,e[t>>1]|0)|0)|0;o=k*+h[q+8>>3];p=l*+h[q+16>>3];g[n>>2]=j*+h[q>>3];g[n+4>>2]=o;g[n+8>>2]=p;g[n+12>>2]=0.0;q=r+(J(s,e[t+2>>1]|0)|0)|0;p=k*+h[q+8>>3];o=l*+h[q+16>>3];g[n+16>>2]=j*+h[q>>3];g[n+20>>2]=p;g[n+24>>2]=o;g[n+28>>2]=0.0;t=r+(J(s,e[t+4>>1]|0)|0)|0;o=k*+h[t+8>>3];p=l*+h[t+16>>3];g[n+32>>2]=j*+h[t>>3];g[n+36>>2]=o;g[n+40>>2]=p;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}case 5:{if((c[n+48>>2]|0)<=0)break a;f=0;do{t=(c[n+72>>2]|0)+(J(c[n+68>>2]|0,f)|0)|0;r=c[n+76>>2]|0;s=c[n+56>>2]|0;q=r+(J(s,d[t>>0]|0)|0)|0;o=k*+h[q+8>>3];p=l*+h[q+16>>3];g[n>>2]=j*+h[q>>3];g[n+4>>2]=o;g[n+8>>2]=p;g[n+12>>2]=0.0;q=r+(J(s,d[t+1>>0]|0)|0)|0;p=k*+h[q+8>>3];o=l*+h[q+16>>3];g[n+16>>2]=j*+h[q>>3];g[n+20>>2]=p;g[n+24>>2]=o;g[n+28>>2]=0.0;t=r+(J(s,d[t+2>>0]|0)|0)|0;o=k*+h[t+8>>3];p=l*+h[t+16>>3];g[n+32>>2]=j*+h[t>>3];g[n+36>>2]=o;g[n+40>>2]=p;g[n+44>>2]=0.0;ab[c[(c[b>>2]|0)+8>>2]&127](b,n,i,f);f=f+1|0}while((f|0)<(c[n+48>>2]|0));break}default:break a}break}default:{}}while(0);Va[c[(c[a>>2]|0)+24>>2]&127](a,i);i=i+1|0}while((i|0)!=(m|0));sa=n;return}function oc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,x=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0;c[b>>2]=c[a>>2];c[b+4>>2]=c[a+4>>2];c[b+8>>2]=c[a+8>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+16+4>>2]=c[a+16+4>>2];c[b+16+8>>2]=c[a+16+8>>2];c[b+16+12>>2]=c[a+16+12>>2];c[b+32>>2]=c[a+32>>2];c[b+32+4>>2]=c[a+32+4>>2];c[b+32+8>>2]=c[a+32+8>>2];c[b+32+12>>2]=c[a+32+12>>2];q=+g[a+20>>2];m=+g[a+40>>2];r=+g[a+24>>2];n=+g[a+36>>2];o=+g[a+32>>2];s=+g[a+16>>2];t=+g[a>>2];p=+g[a+4>>2];u=+g[a+8>>2];v=1.0/((q*m-r*n)*t+p*(r*o-m*s)+(n*s-q*o)*u);g[d>>2]=(q*m-r*n)*v;g[d+4>>2]=(n*u-m*p)*v;g[d+8>>2]=(r*p-q*u)*v;g[d+12>>2]=0.0;g[d+16>>2]=(r*o-m*s)*v;g[d+20>>2]=(m*t-o*u)*v;g[d+24>>2]=(s*u-r*t)*v;g[d+28>>2]=0.0;g[d+32>>2]=(n*s-q*o)*v;g[d+36>>2]=(o*p-n*t)*v;g[d+40>>2]=(q*t-s*p)*v;g[d+44>>2]=0.0;a:do if(!(c[6831]|0)){e=b+20|0;f=b+36|0;h=b+8|0;i=b+24|0;j=b+40|0;k=b;l=b+4|0}else{e=0;E=(q*t-s*p)*v;F=(q*m-r*n)*v;G=(r*o-m*s)*v;H=(n*s-q*o)*v;I=(n*u-m*p)*v;D=(m*t-o*u)*v;C=(o*p-n*t)*v;B=(r*p-q*u)*v;A=(s*u-r*t)*v;while(1){o=+w(+F);n=+w(+G);N=+w(+H);W=+w(+I);O=+w(+D);M=+w(+C);Q=+w(+B);P=+w(+A);x=+w(+E);R=o+n+N>W+O+M?o+n+N:W+O+M;O=o+W+Q>n+O+P?o+W+Q:n+O+P;n=+g[b>>2];W=+w(+n);o=+g[b+16>>2];T=+w(+o);p=+g[b+32>>2];K=+w(+p);q=+g[b+4>>2];V=+w(+q);r=+g[b+20>>2];S=+w(+r);s=+g[b+36>>2];J=+w(+s);t=+g[b+8>>2];U=+w(+t);u=+g[b+24>>2];L=+w(+u);v=+g[b+40>>2];z=+w(+v);m=W+T+K>V+S+J?W+T+K:V+S+J;m=m>U+L+z?m:U+L+z;L=W+V+U>T+S+L?W+V+U:T+S+L;x=(R>Q+P+x?R:Q+P+x)*(O>N+M+x?O:N+M+x);z=m*(L>K+J+z?L:K+J+z);if(x<1.1920928955078125e-07|z<1.1920928955078125e-07){e=b+20|0;f=b+36|0;h=b+8|0;i=b+24|0;j=b+40|0;k=b;l=b+4|0;break a}W=+y(+(x/z),.25);O=(n*(W+-2.0)+1.0/W*F)*.5;Q=(q*(W+-2.0)+1.0/W*G)*.5;S=(t*(W+-2.0)+1.0/W*H)*.5;P=(o*(W+-2.0)+1.0/W*I)*.5;R=(r*(W+-2.0)+1.0/W*D)*.5;T=(u*(W+-2.0)+1.0/W*C)*.5;U=(p*(W+-2.0)+1.0/W*B)*.5;V=(s*(W+-2.0)+1.0/W*A)*.5;W=(v*(W+-2.0)+1.0/W*E)*.5;g[b>>2]=n+O;g[b+4>>2]=q+Q;g[b+8>>2]=t+S;g[b+12>>2]=0.0;g[b+16>>2]=o+P;g[b+20>>2]=r+R;g[b+24>>2]=u+T;g[b+28>>2]=0.0;g[b+32>>2]=p+U;g[b+36>>2]=s+V;g[b+40>>2]=v+W;g[b+44>>2]=0.0;N=1.0/((t+S)*((o+P)*(s+V)-(r+R)*(p+U))+((n+O)*((r+R)*(v+W)-(u+T)*(s+V))+(q+Q)*((u+T)*(p+U)-(o+P)*(v+W))));F=((r+R)*(v+W)-(u+T)*(s+V))*N;I=((t+S)*(s+V)-(q+Q)*(v+W))*N;B=((q+Q)*(u+T)-(t+S)*(r+R))*N;G=((u+T)*(p+U)-(o+P)*(v+W))*N;D=((n+O)*(v+W)-(t+S)*(p+U))*N;A=((t+S)*(o+P)-(n+O)*(u+T))*N;H=((o+P)*(s+V)-(r+R)*(p+U))*N;C=((q+Q)*(p+U)-(n+O)*(s+V))*N;E=((n+O)*(r+R)-(q+Q)*(o+P))*N;g[d>>2]=F;g[d+4>>2]=I;g[d+8>>2]=B;g[d+12>>2]=0.0;g[d+16>>2]=G;g[d+20>>2]=D;g[d+24>>2]=A;g[d+28>>2]=0.0;g[d+32>>2]=H;g[d+36>>2]=C;g[d+40>>2]=E;g[d+44>>2]=0.0;U=+w(+O)+ +w(+P)+ +w(+U);V=+w(+Q)+ +w(+R)+ +w(+V);W=+w(+S)+ +w(+T)+ +w(+W);V=U>V?U:V;if((V>W?V:W)<=m*+g[6830])break;e=e+1|0;if(e>>>0>=(c[6831]|0)>>>0){e=b+20|0;f=b+36|0;h=b+8|0;i=b+24|0;j=b+40|0;k=b;l=b+4|0;break a}}M=+g[b>>2];O=+g[b+16>>2];Q=+g[b+32>>2];K=+g[b+4>>2];L=+g[b+20>>2];S=+g[b+36>>2];F=+g[b+8>>2];G=+g[b+24>>2];U=+g[b+40>>2];N=+g[a>>2];P=+g[a+16>>2];R=+g[a+32>>2];H=+g[a+4>>2];I=+g[a+20>>2];J=+g[a+36>>2];C=+g[a+8>>2];D=+g[a+24>>2];E=+g[a+40>>2];W=F*C+G*D+U*E+(F*C+G*D+U*E);V=K*C+L*D+S*E+(F*H+G*I+U*J);T=K*H+L*I+S*J+(K*H+L*I+S*J);U=M*C+O*D+Q*E+(F*N+G*P+U*R);S=M*H+O*I+Q*J+(K*N+L*P+S*R);R=M*N+O*P+Q*R+(M*N+O*P+Q*R);V=V*.5;U=U*.5;S=S*.5;R=R*.5;g[d>>2]=R;g[d+4>>2]=S;g[d+8>>2]=U;g[d+12>>2]=0.0;g[d+16>>2]=S;T=T*.5;g[d+20>>2]=T;g[d+24>>2]=V;g[d+28>>2]=0.0;g[d+32>>2]=U;g[d+36>>2]=V;W=W*.5;g[d+40>>2]=W;g[d+44>>2]=0.0;return}while(0);M=+g[k>>2];O=+g[b+16>>2];Q=+g[b+32>>2];K=+g[l>>2];L=+g[e>>2];S=+g[f>>2];F=+g[h>>2];G=+g[i>>2];U=+g[j>>2];N=+g[a>>2];P=+g[a+16>>2];R=+g[a+32>>2];H=+g[a+4>>2];I=+g[a+20>>2];J=+g[a+36>>2];C=+g[a+8>>2];D=+g[a+24>>2];E=+g[a+40>>2];W=F*C+G*D+U*E+(F*C+G*D+U*E);V=K*C+L*D+S*E+(F*H+G*I+U*J);T=K*H+L*I+S*J+(K*H+L*I+S*J);U=M*C+O*D+Q*E+(F*N+G*P+U*R);S=M*H+O*I+Q*J+(K*N+L*P+S*R);R=M*N+O*P+Q*R+(M*N+O*P+Q*R);V=V*.5;U=U*.5;S=S*.5;R=R*.5;g[d>>2]=R;g[d+4>>2]=S;g[d+8>>2]=U;g[d+12>>2]=0.0;g[d+16>>2]=S;T=T*.5;g[d+20>>2]=T;g[d+24>>2]=V;g[d+28>>2]=0.0;g[d+32>>2]=U;g[d+36>>2]=V;W=W*.5;g[d+40>>2]=W;g[d+44>>2]=0.0;return}function pc(d,e,f,h,i){d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0.0,k=0,l=0.0,m=0,n=0,o=0.0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0;x=sa;sa=sa+128|0;a[d+60>>0]=f&1;if(f){s=+g[h>>2]+-1.0;t=+g[h+4>>2]+-1.0;u=+g[h+8>>2]+-1.0;g[d+4>>2]=s;g[d+8>>2]=t;g[d+12>>2]=u;g[d+16>>2]=0.0;q=+g[i>>2]+1.0;l=+g[i+4>>2]+1.0;v=+g[i+8>>2]+1.0;g[d+20>>2]=q;g[d+24>>2]=l;g[d+28>>2]=v;g[d+32>>2]=0.0;g[d+36>>2]=65533.0/(q-s);g[d+40>>2]=65533.0/(l-t);g[d+44>>2]=65533.0/(v-u);g[d+48>>2]=0.0;a[d+60>>0]=1;j=s+ +(~~((s-s)*(65533.0/(q-s)))&65535&-2&65535)/(65533.0/(q-s))+-1.0;o=t+ +(~~((t-t)*(65533.0/(l-t)))&65535&-2&65535)/(65533.0/(l-t))+-1.0;r=u+ +(~~((u-u)*(65533.0/(v-u)))&65535&-2&65535)/(65533.0/(v-u))+-1.0;if(j>2]=j;w=j}else w=s;if(o>2]=o;else o=t;if(r>2]=r;j=v-r}else{j=v-u;r=u}s=w+ +((~~(65533.0/(q-s)*(q-w)+1.0)&65535|1)&65535)/(65533.0/(q-s))+1.0;t=o+ +((~~(65533.0/(l-t)*(l-o)+1.0)&65535|1)&65535)/(65533.0/(l-t))+1.0;u=r+ +((~~(65533.0/(v-u)*j+1.0)&65535|1)&65535)/(65533.0/(v-u))+1.0;if(q>2]=s;q=s}if(l>2]=t;l=t}if(v>2]=u;j=u-r}g[d+36>>2]=65533.0/(q-w);g[d+40>>2]=65533.0/(l-o);g[d+44>>2]=65533.0/j;g[d+48>>2]=0.0;c[x+96>>2]=10928;c[x+96+4>>2]=d+104;c[x+96+8>>2]=d;ab[c[(c[e>>2]|0)+8>>2]&127](e,x+96|0,d+4|0,d+20|0);f=c[d+108>>2]|0;c[x+80>>2]=0;c[x+80+4>>2]=0;c[x+80+8>>2]=0;c[x+80+12>>2]=0;k=c[d+128>>2]|0;if((k|0)<(f<<1|0)){if((c[d+132>>2]|0)<(f<<1|0)){if(!f){h=0;e=k}else{c[7182]=(c[7182]|0)+1;h=xb(f<<5|19)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}e=c[d+128>>2]|0}if((e|0)>0){i=0;do{p=h+(i<<4)|0;n=(c[d+136>>2]|0)+(i<<4)|0;c[p>>2]=c[n>>2];c[p+4>>2]=c[n+4>>2];c[p+8>>2]=c[n+8>>2];c[p+12>>2]=c[n+12>>2];i=i+1|0}while((i|0)!=(e|0))}i=c[d+136>>2]|0;if(i|0){if(a[d+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[d+136>>2]=0}a[d+140>>0]=1;c[d+136>>2]=h;c[d+132>>2]=f<<1;i=d+136|0}else i=d+136|0;h=k;do{p=(c[i>>2]|0)+(h<<4)|0;c[p>>2]=c[x+80>>2];c[p+4>>2]=c[x+80+4>>2];c[p+8>>2]=c[x+80+8>>2];c[p+12>>2]=c[x+80+12>>2];h=h+1|0}while((h|0)!=(f<<1|0))}c[d+128>>2]=f<<1}else{c[x+96>>2]=10948;c[x+96+4>>2]=d+64;c[x+80>>2]=-581039253;c[x+80+4>>2]=-581039253;c[x+80+8>>2]=-581039253;g[x+80+12>>2]=0.0;c[x+64>>2]=1566444395;c[x+64+4>>2]=1566444395;c[x+64+8>>2]=1566444395;g[x+64+12>>2]=0.0;ab[c[(c[e>>2]|0)+8>>2]&127](e,x+96|0,x+80|0,x+64|0);f=c[d+68>>2]|0;k=x;n=k+64|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(n|0));p=c[d+88>>2]|0;if((p|0)<(f<<1|0)){if((c[d+92>>2]|0)<(f<<1|0)){if(!f){h=0;e=p}else{c[7182]=(c[7182]|0)+1;h=xb(f<<7|19)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}e=c[d+88>>2]|0}if((e|0)>0){i=0;do{k=h+(i<<6)|0;m=(c[d+96>>2]|0)+(i<<6)|0;n=k+64|0;do{c[k>>2]=c[m>>2];k=k+4|0;m=m+4|0}while((k|0)<(n|0));i=i+1|0}while((i|0)!=(e|0))}i=c[d+96>>2]|0;if(i|0){if(a[d+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[d+96>>2]=0}a[d+100>>0]=1;c[d+96>>2]=h;c[d+92>>2]=f<<1;i=d+96|0}else i=d+96|0;h=p;do{k=(c[i>>2]|0)+(h<<6)|0;m=x;n=k+64|0;do{c[k>>2]=c[m>>2];k=k+4|0;m=m+4|0}while((k|0)<(n|0));h=h+1|0}while((h|0)!=(f<<1|0))}c[d+88>>2]=f<<1}c[d+56>>2]=0;Ib(d,0,f);if(a[d+60>>0]|0?(c[d+152>>2]|0)==0:0){if(!(c[d+156>>2]|0)){c[7182]=(c[7182]|0)+1;f=xb(51)|0;if(!f)e=0;else{c[(f+4+15&-16)+-4>>2]=f;e=f+4+15&-16}h=c[d+152>>2]|0;if((h|0)>0){f=0;do{p=e+(f<<5)|0;n=(c[d+160>>2]|0)+(f<<5)|0;c[p>>2]=c[n>>2];c[p+4>>2]=c[n+4>>2];c[p+8>>2]=c[n+8>>2];c[p+12>>2]=c[n+12>>2];c[p+16>>2]=c[n+16>>2];c[p+20>>2]=c[n+20>>2];c[p+24>>2]=c[n+24>>2];c[p+28>>2]=c[n+28>>2];f=f+1|0}while((f|0)!=(h|0))}f=c[d+160>>2]|0;if(f|0){if(a[d+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+160>>2]=0}a[d+164>>0]=1;c[d+160>>2]=e;c[d+156>>2]=1;h=d+160|0;i=(c[d+152>>2]|0)+1|0;f=e}else{h=d+160|0;i=1;f=c[d+160>>2]|0}c[d+152>>2]=i;c[f>>2]=c[x+96>>2];c[f+4>>2]=c[x+96+4>>2];c[f+8>>2]=c[x+96+8>>2];c[f+12>>2]=c[x+96+12>>2];c[f+16>>2]=c[x+96+16>>2];c[f+20>>2]=c[x+96+20>>2];c[f+24>>2]=c[x+96+24>>2];c[f+28>>2]=c[x+96+28>>2];p=c[h>>2]|0;n=c[d+136>>2]|0;b[p>>1]=b[n>>1]|0;b[p+2>>1]=b[n+2>>1]|0;b[p+4>>1]=b[n+4>>1]|0;b[p+6>>1]=b[n+6>>1]|0;b[p+8>>1]=b[n+8>>1]|0;b[p+10>>1]=b[n+10>>1]|0;c[p+12>>2]=0;n=c[n+12>>2]|0;c[p+16>>2]=(n|0)>-1?1:0-n|0}c[d+168>>2]=c[d+152>>2];f=c[d+116>>2]|0;if(f|0){if(a[d+120>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+116>>2]=0}a[d+120>>0]=1;c[d+116>>2]=0;c[d+108>>2]=0;c[d+112>>2]=0;f=c[d+76>>2]|0;if(!f){a[d+80>>0]=1;c[d+76>>2]=0;c[d+68>>2]=0;d=d+72|0;c[d>>2]=0;sa=x;return}if(a[d+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+76>>2]=0;a[d+80>>0]=1;c[d+76>>2]=0;c[d+68>>2]=0;d=d+72|0;c[d>>2]=0;sa=x;return}function qc(b,d,e,f,h,i,k,l,m,n,o){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;k=k|0;l=l|0;m=+m;n=+n;o=+o;var p=0,q=0,r=0,s=0.0,t=0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0,N=0,O=0.0,P=0.0,Q=0.0,R=0.0;N=c[b+68>>2]|0;if((N|0)==(c[b+72>>2]|0)?(t=(N|0)==0?1:N<<1,(N|0)<(t|0)):0){if(!t){p=0;r=N}else{c[7182]=(c[7182]|0)+1;p=xb((t*152|3)+16|0)|0;if(!p)p=0;else{c[(p+4+15&-16)+-4>>2]=p;p=p+4+15&-16}r=c[b+68>>2]|0}if((r|0)>0){q=0;do{Bh(p+(q*152|0)|0,(c[b+76>>2]|0)+(q*152|0)|0,152)|0;q=q+1|0}while((q|0)!=(r|0))}q=c[b+76>>2]|0;if(q|0){if(a[b+80>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[q+-4>>2]|0)}c[b+76>>2]=0}a[b+80>>0]=1;c[b+76>>2]=p;c[b+72>>2]=t;p=c[b+68>>2]|0}else p=N;c[b+68>>2]=p+1;M=c[b+76>>2]|0;c[M+(N*152|0)+140>>2]=h;r=c[b+16>>2]|0;p=c[r+(e*244|0)+240>>2]|0;t=c[r+(f*244|0)+240>>2]|0;c[M+(N*152|0)+144>>2]=e;c[M+(N*152|0)+148>>2]=f;q=c[i+84>>2]|0;c[M+(N*152|0)+104>>2]=q;c[M+(N*152|0)+132>>2]=0;g[M+(N*152|0)+100>>2]=0.0;g[M+(N*152|0)+96>>2]=0.0;L=(c[j>>2]=q,+g[j>>2]);if(p|0){c[M+(N*152|0)+16>>2]=c[d>>2];c[M+(N*152|0)+16+4>>2]=c[d+4>>2];c[M+(N*152|0)+16+8>>2]=c[d+8>>2];c[M+(N*152|0)+16+12>>2]=c[d+12>>2];K=+g[k+4>>2];D=+g[M+(N*152|0)+24>>2];H=+g[k+8>>2];I=+g[M+(N*152|0)+20>>2];E=+g[M+(N*152|0)+16>>2];J=+g[k>>2];g[M+(N*152|0)>>2]=K*D-H*I;g[M+(N*152|0)+4>>2]=H*E-D*J;g[M+(N*152|0)+8>>2]=I*J-K*E;g[M+(N*152|0)+12>>2]=0.0;v=((K*D-H*I)*+g[p+264>>2]+(H*E-D*J)*+g[p+268>>2]+(I*J-K*E)*+g[p+272>>2])*+g[p+544>>2];s=((K*D-H*I)*+g[p+280>>2]+(H*E-D*J)*+g[p+284>>2]+(I*J-K*E)*+g[p+288>>2])*+g[p+548>>2];u=((K*D-H*I)*+g[p+296>>2]+(H*E-D*J)*+g[p+300>>2]+(I*J-K*E)*+g[p+304>>2])*+g[p+552>>2];g[M+(N*152|0)+64>>2]=v;g[M+(N*152|0)+68>>2]=s;g[M+(N*152|0)+72>>2]=u;g[M+(N*152|0)+76>>2]=0.0;z=E;A=I;B=D;C=K*D-H*I;D=H*E-D*J;E=I*J-K*E}else{c[M+(N*152|0)+64>>2]=0;c[M+(N*152|0)+64+4>>2]=0;c[M+(N*152|0)+64+8>>2]=0;c[M+(N*152|0)+64+12>>2]=0;c[M+(N*152|0)>>2]=0;c[M+(N*152|0)+4>>2]=0;c[M+(N*152|0)+8>>2]=0;c[M+(N*152|0)+12>>2]=0;c[M+(N*152|0)+16>>2]=0;c[M+(N*152|0)+20>>2]=0;c[M+(N*152|0)+24>>2]=0;c[M+(N*152|0)+28>>2]=0;s=0.0;u=0.0;v=0.0;z=0.0;A=0.0;B=0.0;C=0.0;D=0.0;E=0.0}if(t|0){K=-+g[d>>2];P=-+g[d+4>>2];J=-+g[d+8>>2];g[M+(N*152|0)+48>>2]=K;g[M+(N*152|0)+52>>2]=P;g[M+(N*152|0)+56>>2]=J;g[M+(N*152|0)+60>>2]=0.0;O=+g[l+4>>2];R=+g[l+8>>2];Q=+g[l>>2];g[M+(N*152|0)+32>>2]=O*J-R*P;g[M+(N*152|0)+36>>2]=R*K-Q*J;g[M+(N*152|0)+40>>2]=Q*P-O*K;g[M+(N*152|0)+44>>2]=0.0;w=((O*J-R*P)*+g[t+264>>2]+(R*K-Q*J)*+g[t+268>>2]+(Q*P-O*K)*+g[t+272>>2])*+g[t+544>>2];x=((O*J-R*P)*+g[t+280>>2]+(R*K-Q*J)*+g[t+284>>2]+(Q*P-O*K)*+g[t+288>>2])*+g[t+548>>2];y=((O*J-R*P)*+g[t+296>>2]+(R*K-Q*J)*+g[t+300>>2]+(Q*P-O*K)*+g[t+304>>2])*+g[t+552>>2];g[M+(N*152|0)+80>>2]=w;g[M+(N*152|0)+84>>2]=x;g[M+(N*152|0)+88>>2]=y;g[M+(N*152|0)+92>>2]=0.0;F=K;G=P;H=J;I=O*J-R*P;J=R*K-Q*J;K=Q*P-O*K}else{c[M+(N*152|0)+80>>2]=0;c[M+(N*152|0)+80+4>>2]=0;c[M+(N*152|0)+80+8>>2]=0;c[M+(N*152|0)+80+12>>2]=0;c[M+(N*152|0)+32>>2]=0;c[M+(N*152|0)+32+4>>2]=0;c[M+(N*152|0)+32+8>>2]=0;c[M+(N*152|0)+32+12>>2]=0;c[M+(N*152|0)+32+16>>2]=0;c[M+(N*152|0)+32+20>>2]=0;c[M+(N*152|0)+32+24>>2]=0;c[M+(N*152|0)+32+28>>2]=0;w=0.0;x=0.0;y=0.0;F=0.0;G=0.0;H=0.0;I=0.0;J=0.0;K=0.0}if(p|0){P=+g[k+8>>2];Q=+g[k+4>>2];R=+g[k>>2];u=+g[p+344>>2]+((s*P-u*Q)*+g[d>>2]+(u*R-P*v)*+g[d+4>>2]+(Q*v-s*R)*+g[d+8>>2])}else u=0.0;if(t|0){Q=-w;s=-x;y=-y;O=+g[l+8>>2];P=+g[l+4>>2];R=+g[l>>2];s=+g[t+344>>2]+((O*s-P*y)*+g[d>>2]+(R*y-O*Q)*+g[d+4>>2]+(P*Q-R*s)*+g[d+8>>2])}else s=0.0;x=m/(u+s);g[M+(N*152|0)+108>>2]=x;if(p|0){u=+g[r+(e*244|0)+192>>2];v=+g[r+(e*244|0)+196>>2];w=+g[r+(e*244|0)+200>>2];s=(+g[r+(e*244|0)+176>>2]+ +g[r+(e*244|0)+208>>2])*z+(+g[r+(e*244|0)+180>>2]+ +g[r+(e*244|0)+212>>2])*A+(+g[r+(e*244|0)+184>>2]+ +g[r+(e*244|0)+216>>2])*B}else{u=0.0;v=0.0;w=0.0;s=z*0.0+A*0.0+B*0.0}s=s+(u*C+v*D+w*E);if(t|0){O=+g[r+(f*244|0)+192>>2];P=+g[r+(f*244|0)+196>>2];R=+g[r+(f*244|0)+200>>2];Q=(+g[r+(f*244|0)+176>>2]+ +g[r+(f*244|0)+208>>2])*F+(+g[r+(f*244|0)+180>>2]+ +g[r+(f*244|0)+212>>2])*G+(+g[r+(f*244|0)+184>>2]+ +g[r+(f*244|0)+216>>2])*H;O=O*I;P=P*J;P=O+P;R=R*K;R=P+R;R=Q+R;R=s+R;R=n-R;R=x*R;f=M+(N*152|0)+112|0;g[f>>2]=R;f=M+(N*152|0)+116|0;g[f>>2]=o;R=-L;f=M+(N*152|0)+120|0;g[f>>2]=R;f=M+(N*152|0)+124|0;c[f>>2]=q;return}else{O=0.0;P=0.0;R=0.0;Q=F*0.0+G*0.0+H*0.0;O=O*I;P=P*J;P=O+P;R=R*K;R=P+R;R=Q+R;R=s+R;R=n-R;R=x*R;f=M+(N*152|0)+112|0;g[f>>2]=R;f=M+(N*152|0)+116|0;g[f>>2]=o;R=-L;f=M+(N*152|0)+120|0;g[f>>2]=R;f=M+(N*152|0)+124|0;c[f>>2]=q;return}}function rc(b,d,e,f,h,i){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0,v=0.0,w=0,y=0.0,z=0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0,ba=0.0,ca=0.0,da=0.0,ea=0,fa=0.0;ea=sa;sa=sa+32|0;J=c[b+4>>2]|0;a[J+312>>0]=0;c[J>>2]=0;a[J+356>>0]=1;c[J+292>>2]=1566444395;c[J+296>>2]=1566444395;c[J+300>>2]=1566444395;g[J+304>>2]=0.0;c[J+336>>2]=0;c[J+336+4>>2]=0;c[J+336+8>>2]=0;c[J+336+12>>2]=0;a[J+336+16>>0]=0;a[J+332>>0]=a[J+332>>0]&-16;o=+g[d+48>>2];q=+g[d+52>>2];t=+g[d+56>>2];n=+g[f+48>>2];p=+g[f+52>>2];s=+g[f+56>>2];L=+g[d>>2];X=+g[d+4>>2];Z=+g[d+8>>2];$=+g[d+16>>2];N=+g[d+20>>2];P=+g[d+24>>2];R=+g[d+32>>2];T=+g[d+36>>2];V=+g[d+40>>2];K=+g[f>>2];W=+g[f+4>>2];Y=+g[f+8>>2];_=+g[f+16>>2];M=+g[f+20>>2];O=+g[f+24>>2];Q=+g[f+32>>2];S=+g[f+36>>2];U=+g[f+40>>2];ba=+g[e+48>>2]-o-(+g[h+48>>2]-n);ca=+g[e+52>>2]-q-(+g[h+52>>2]-p);da=+g[e+56>>2]-t-(+g[h+56>>2]-s);J=c[b+8>>2]|0;z=c[(c[J>>2]|0)+64>>2]|0;g[ea>>2]=L*-ba+$*-ca+R*-da;g[ea+4>>2]=X*-ba+N*-ca+T*-da;g[ea+8>>2]=Z*-ba+P*-ca+V*-da;g[ea+12>>2]=0.0;Za[z&127](ea+16|0,J,ea);H=+g[ea+16>>2];I=+g[ea+16+4>>2];G=+g[ea+16+8>>2];l=H*+g[d>>2]+I*+g[d+4>>2]+G*+g[d+8>>2]+ +g[d+48>>2];v=H*+g[d+16>>2]+I*+g[d+20>>2]+G*+g[d+24>>2]+ +g[d+52>>2];G=H*+g[d+32>>2]+I*+g[d+36>>2]+G*+g[d+40>>2]+ +g[d+56>>2];J=c[b+12>>2]|0;z=c[(c[J>>2]|0)+64>>2]|0;I=ba*+g[f+4>>2]+ca*+g[f+20>>2]+da*+g[f+36>>2];H=ba*+g[f+8>>2]+ca*+g[f+24>>2]+da*+g[f+40>>2];g[ea>>2]=ba*+g[f>>2]+ca*+g[f+16>>2]+da*+g[f+32>>2];g[ea+4>>2]=I;g[ea+8>>2]=H;g[ea+12>>2]=0.0;Za[z&127](ea+16|0,J,ea);H=+g[ea+16>>2];I=+g[ea+16+4>>2];m=+g[ea+16+8>>2];l=l-(H*+g[f>>2]+I*+g[f+4>>2]+m*+g[f+8>>2]+ +g[f+48>>2]);v=v-(H*+g[f+16>>2]+I*+g[f+20>>2]+m*+g[f+24>>2]+ +g[f+52>>2]);m=G-(H*+g[f+32>>2]+I*+g[f+36>>2]+m*+g[f+40>>2]+ +g[f+56>>2]);a:do if(l*l+v*v+m*m>9.999999747378752e-05){k=0.0;J=32;I=l;j=0;H=m;r=0;A=n;n=0.0;m=0.0;l=0.0;while(1){if(!J)break a;J=J+-1|0;z=c[b+8>>2]|0;w=c[(c[z>>2]|0)+64>>2]|0;D=-I;fa=-v;y=-H;g[ea>>2]=L*D+$*fa+R*y;g[ea+4>>2]=X*D+N*fa+T*y;g[ea+8>>2]=Z*D+P*fa+V*y;g[ea+12>>2]=0.0;Za[w&127](ea+16|0,z,ea);y=+g[ea+16>>2];fa=+g[ea+16+4>>2];D=+g[ea+16+8>>2];B=o+(L*y+X*fa+Z*D);C=q+($*y+N*fa+P*D);D=t+(R*y+T*fa+V*D);z=c[b+12>>2]|0;w=c[(c[z>>2]|0)+64>>2]|0;g[ea>>2]=K*I+_*v+Q*H;g[ea+4>>2]=W*I+M*v+S*H;g[ea+8>>2]=Y*I+O*v+U*H;g[ea+12>>2]=0.0;Za[w&127](ea+16|0,z,ea);fa=+g[ea+16>>2];y=+g[ea+16+4>>2];G=+g[ea+16+8>>2];E=A+(K*fa+W*y+Y*G);F=p+(_*fa+M*y+O*G);G=s+(Q*fa+S*y+U*G);y=(B-E)*I+(C-F)*v+(D-G)*H;if(k>1.0){j=0;aa=24;break}if(y>0.0){l=ba*I+ca*v+da*H;if(l>=-1.4210854715202004e-14){j=0;aa=24;break}t=k-y/l;k=t;j=r;A=(1.0-t)*+g[f+48>>2]+t*+g[h+48>>2];o=(1.0-t)*+g[d+48>>2]+t*+g[e+48>>2];p=(1.0-t)*+g[f+52>>2]+t*+g[h+52>>2];q=(1.0-t)*+g[d+52>>2]+t*+g[e+52>>2];s=(1.0-t)*+g[f+56>>2]+t*+g[h+56>>2];t=(1.0-t)*+g[d+56>>2]+t*+g[e+56>>2];l=I;m=v;n=H}r=c[b+4>>2]|0;z=c[r>>2]|0;if((z|0)>0){v=+g[r+308>>2];w=0;u=0;do{H=B-E-+g[r+4+(w<<4)>>2];I=C-F-+g[r+4+(w<<4)+4>>2];fa=D-G-+g[r+4+(w<<4)+8>>2];u=u|H*H+I*I+fa*fa<=v;w=w+1|0}while((w|0)!=(z|0))}else u=0;if((+g[r+304>>2]==0.0?D-G==+g[r+300>>2]:0)?C-F==+g[r+296>>2]:0){if(!(B-E==+g[r+292>>2]|u))aa=16}else if(!u)aa=16;if((aa|0)==16){aa=0;g[r+292>>2]=B-E;g[r+296>>2]=C-F;g[r+300>>2]=D-G;g[r+304>>2]=0.0;a[r+356>>0]=1;g[r+4+(z<<4)>>2]=B-E;g[r+4+(z<<4)+4>>2]=C-F;g[r+4+(z<<4)+8>>2]=D-G;g[r+4+(z<<4)+12>>2]=0.0;z=c[r>>2]|0;g[r+84+(z<<4)>>2]=B;g[r+84+(z<<4)+4>>2]=C;g[r+84+(z<<4)+8>>2]=D;g[r+84+(z<<4)+12>>2]=0.0;z=c[r>>2]|0;g[r+164+(z<<4)>>2]=E;g[r+164+(z<<4)+4>>2]=F;g[r+164+(z<<4)+8>>2]=G;g[r+164+(z<<4)+12>>2]=0.0;c[r>>2]=(c[r>>2]|0)+1;r=c[b+4>>2]|0}z=Ab(r)|0;I=+g[r+276>>2];v=+g[r+280>>2];H=+g[r+284>>2];if(!z)break a;if(!(I*I+v*v+H*H>9.999999747378752e-05))break a;else r=c[r+288>>2]|0}if((aa|0)==24){sa=ea;return j|0}}else{k=0.0;n=0.0;m=0.0;l=0.0;j=0}while(0);g[i+164>>2]=k;k=l*l+m*m+n*n;if(!(k>=1.4210854715202004e-14)){c[i+132>>2]=0;c[i+132+4>>2]=0;c[i+132+8>>2]=0;c[i+132+12>>2]=0;k=0.0;l=0.0;m=0.0}else{fa=1.0/+x(+k);k=l*fa;l=m*fa;m=n*fa;g[i+132>>2]=k;g[i+136>>2]=l;g[i+140>>2]=m;c[i+144>>2]=j}if(ba*k+ca*l+da*m>=-+g[i+172>>2]){i=0;sa=ea;return i|0}b=c[b+4>>2]|0;Ab(b)|0;fp(i+148|0,b+260|0,16)|0;i=1;sa=ea;return i|0}function sc(b,d,e,f,h,i,j,k,l,m,n){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0,y=0,z=0,A=0,B=0,C=0.0,D=0,E=0;if((j|0)<2|(k|0)<2){m=0;return m|0}w=J(k,j)|0;c[7182]=(c[7182]|0)+1;b=xb(w>>>0>268435455?18:(w<<4|3)+16|0)|0;if(!b)y=0;else{c[(b+4+15&-16)+-4>>2]=b;y=b+4+15&-16}z=CI(w>>>0>1073741823?-1:w<<2)|0;b=0;do{C=+(b|0)/+(k+-1|0);q=+g[e>>2];q=q+C*(+g[h>>2]-q);r=+g[e+4>>2];r=r+C*(+g[h+4>>2]-r);s=+g[e+8>>2];s=s+C*(+g[h+8>>2]-s);t=+g[f>>2];u=+g[f+4>>2];v=+g[f+8>>2];t=t+C*(+g[i>>2]-t)-q;u=u+C*(+g[i+4>>2]-u)-r;v=v+C*(+g[i+8>>2]-v)-s;p=J(b,j)|0;o=0;do{C=+(o|0)/+(j+-1|0);B=o+p|0;g[y+(B<<4)>>2]=q+t*C;g[y+(B<<4)+4>>2]=r+u*C;g[y+(B<<4)+8>>2]=s+v*C;g[y+(B<<4)+12>>2]=0.0;g[z+(B<<2)>>2]=1.0;o=o+1|0}while((o|0)!=(j|0));b=b+1|0}while((b|0)!=(k|0));c[7182]=(c[7182]|0)+1;b=xb(1271)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}Hb(b,d,w,y,z);if(l&1|0){g[(c[b+720>>2]|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&2|0){g[(c[b+720>>2]|0)+((j+-1|0)*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&4|0){B=J(k+-1|0,j)|0;g[(c[b+720>>2]|0)+(B*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&8|0){B=j+-1+(J(k+-1|0,j)|0)|0;g[(c[b+720>>2]|0)+(B*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&16|0){g[(c[b+720>>2]|0)+(((j+-1|0)/2|0)*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&32|0){B=J((k+-1|0)/2|0,j)|0;g[(c[b+720>>2]|0)+(B*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&64|0){B=j+-1+(J((k+-1|0)/2|0,j)|0)|0;g[(c[b+720>>2]|0)+(B*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&128|0){B=(J(k+-1|0,j)|0)+((j+-1|0)/2|0)|0;g[(c[b+720>>2]|0)+(B*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(!(l&256)){A=b+720|0;B=b+924|0}else{B=(J((k+-1|0)/2|0,j)|0)+((j+-1|0)/2|0)|0;A=b+720|0;g[(c[A>>2]|0)+(B*104|0)+88>>2]=0.0;B=b+924|0;a[B>>0]=1}c[7183]=(c[7183]|0)+1;Hc(c[y+-4>>2]|0);DI(z);z=b+732|0;l=b+740|0;o=0;d=0;do{p=d;d=d+1|0;a:do if((j|0)>0){y=J(p,j)|0;w=J(d,j)|0;r=1.0/+(k+-1|0)*+(k+-1-p|0);q=1.0/+(k+-1|0)*+(k+-2-p|0);if((d|0)>=(k|0)){p=0;while(1){e=p;p=p+1|0;if((p|0)<(j|0)){h=p+y|0;f=c[A>>2]|0;oh(b,0);w=(c[z>>2]|0)+-1|0;i=c[l>>2]|0;c[i+(w*52|0)+8>>2]=f+((e+y|0)*104|0);c[i+(w*52|0)+12>>2]=f+(h*104|0);u=+g[f+((e+y|0)*104|0)+8>>2]-+g[f+(h*104|0)+8>>2];v=+g[f+((e+y|0)*104|0)+12>>2]-+g[f+(h*104|0)+12>>2];C=+g[f+((e+y|0)*104|0)+16>>2]-+g[f+(h*104|0)+16>>2];g[i+(w*52|0)+16>>2]=+x(+(u*u+v*v+C*C));a[B>>0]=1}if((p|0)==(j|0))break a}}i=0;do{p=i;i=i+1|0;e=i+y|0;f=i+w|0;h=c[A>>2]|0;if((i|0)<(j|0)){oh(b,0);E=(c[z>>2]|0)+-1|0;D=c[l>>2]|0;c[D+(E*52|0)+8>>2]=h+((p+y|0)*104|0);c[D+(E*52|0)+12>>2]=h+(e*104|0);C=+g[h+((p+y|0)*104|0)+8>>2]-+g[h+(e*104|0)+8>>2];v=+g[h+((p+y|0)*104|0)+12>>2]-+g[h+(e*104|0)+12>>2];u=+g[h+((p+y|0)*104|0)+16>>2]-+g[h+(e*104|0)+16>>2];g[D+(E*52|0)+16>>2]=+x(+(C*C+v*v+u*u));a[B>>0]=1;E=c[A>>2]|0;oh(b,0);h=(c[z>>2]|0)+-1|0;D=c[l>>2]|0;c[D+(h*52|0)+8>>2]=E+((p+y|0)*104|0);c[D+(h*52|0)+12>>2]=E+((p+w|0)*104|0);u=+g[E+((p+y|0)*104|0)+8>>2]-+g[E+((p+w|0)*104|0)+8>>2];v=+g[E+((p+y|0)*104|0)+12>>2]-+g[E+((p+w|0)*104|0)+12>>2];C=+g[E+((p+y|0)*104|0)+16>>2]-+g[E+((p+w|0)*104|0)+16>>2];g[D+(h*52|0)+16>>2]=+x(+(u*u+v*v+C*C));a[B>>0]=1;mf(b,p+y|0,p+w|0,f,0);if(!n)mf(b,f,e,p+y|0,0);else{C=1.0/+(j+-1|0)*+(p|0);g[n+(o<<2)>>2]=C;g[n+(o+1<<2)>>2]=r;g[n+(o+2<<2)>>2]=C;g[n+(o+3<<2)>>2]=q;v=1.0/+(j+-1|0)*+(i|0);g[n+(o+4<<2)>>2]=v;g[n+(o+5<<2)>>2]=q;mf(b,f,e,p+y|0,0);g[n+(o+6<<2)>>2]=v;g[n+(o+7<<2)>>2]=q;g[n+(o+8<<2)>>2]=v;g[n+(o+9<<2)>>2]=r;g[n+(o+10<<2)>>2]=C;g[n+(o+11<<2)>>2]=r}if(m){h=c[A>>2]|0;oh(b,0);E=(c[z>>2]|0)+-1|0;D=c[l>>2]|0;c[D+(E*52|0)+8>>2]=h+((p+y|0)*104|0);c[D+(E*52|0)+12>>2]=h+(f*104|0);u=+g[h+((p+y|0)*104|0)+8>>2]-+g[h+(f*104|0)+8>>2];v=+g[h+((p+y|0)*104|0)+12>>2]-+g[h+(f*104|0)+12>>2];C=+g[h+((p+y|0)*104|0)+16>>2]-+g[h+(f*104|0)+16>>2];g[D+(E*52|0)+16>>2]=+x(+(u*u+v*v+C*C));a[B>>0]=1}o=o+12|0}else{oh(b,0);E=(c[z>>2]|0)+-1|0;D=c[l>>2]|0;c[D+(E*52|0)+8>>2]=h+((p+y|0)*104|0);c[D+(E*52|0)+12>>2]=h+((p+w|0)*104|0);u=+g[h+((p+y|0)*104|0)+8>>2]-+g[h+((p+w|0)*104|0)+8>>2];v=+g[h+((p+y|0)*104|0)+12>>2]-+g[h+((p+w|0)*104|0)+12>>2];C=+g[h+((p+y|0)*104|0)+16>>2]-+g[h+((p+w|0)*104|0)+16>>2];g[D+(E*52|0)+16>>2]=+x(+(u*u+v*v+C*C));a[B>>0]=1}}while((i|0)!=(j|0))}while(0)}while((d|0)!=(k|0));return b|0}function tc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,E=0.0,G=0.0,H=0.0,I=0.0,J=0.0;B=+g[b+48>>2];i=+g[d>>2];C=+g[b+64>>2];j=+g[d+4>>2];J=+g[b+80>>2];p=+g[d+8>>2];s=+g[b+52>>2];r=+g[b+68>>2];q=+g[b+84>>2];w=+g[b+56>>2];I=+g[b+72>>2];y=+g[b+88>>2];v=+g[d+16>>2];u=+g[d+20>>2];t=+g[d+24>>2];H=+g[d+32>>2];E=+g[d+36>>2];G=+g[d+40>>2];k=+g[b+96>>2];h=+g[b+100>>2];A=+g[b+104>>2];z=+g[d+48>>2]+(i*k+j*h+p*A);f=v*k+u*h+t*A+ +g[d+52>>2];A=H*k+E*h+G*A+ +g[d+56>>2];g[b+1064>>2]=B*i+C*j+J*p;g[b+1068>>2]=i*s+j*r+p*q;g[b+1072>>2]=i*w+j*I+p*y;g[b+1076>>2]=0.0;g[b+1080>>2]=B*v+C*u+J*t;g[b+1084>>2]=s*v+r*u+q*t;g[b+1088>>2]=w*v+I*u+y*t;g[b+1092>>2]=0.0;g[b+1096>>2]=B*H+C*E+J*G;g[b+1100>>2]=s*H+r*E+q*G;g[b+1104>>2]=w*H+I*E+y*G;g[b+1108>>2]=0.0;g[b+1112>>2]=z;g[b+1116>>2]=f;g[b+1120>>2]=A;g[b+1124>>2]=0.0;A=+g[b+112>>2];f=+g[e>>2];z=+g[b+128>>2];G=+g[e+4>>2];y=+g[b+144>>2];E=+g[e+8>>2];I=+g[b+116>>2];H=+g[b+132>>2];w=+g[b+148>>2];q=+g[b+120>>2];r=+g[b+136>>2];s=+g[b+152>>2];J=+g[e+16>>2];C=+g[e+20>>2];B=+g[e+24>>2];t=+g[e+32>>2];u=+g[e+36>>2];v=+g[e+40>>2];p=+g[b+160>>2];j=+g[b+164>>2];i=+g[b+168>>2];h=+g[e+48>>2]+(f*p+G*j+E*i);k=J*p+C*j+B*i+ +g[e+52>>2];i=t*p+u*j+v*i+ +g[e+56>>2];g[b+1128>>2]=A*f+z*G+y*E;g[b+1132>>2]=f*I+G*H+E*w;g[b+1136>>2]=f*q+G*r+E*s;g[b+1140>>2]=0.0;g[b+1144>>2]=A*J+z*C+y*B;g[b+1148>>2]=I*J+H*C+w*B;g[b+1152>>2]=q*J+r*C+s*B;g[b+1156>>2]=0.0;g[b+1160>>2]=A*t+z*u+y*v;g[b+1164>>2]=I*t+H*u+w*v;g[b+1168>>2]=q*t+r*u+s*v;g[b+1172>>2]=0.0;g[b+1176>>2]=h;g[b+1180>>2]=k;g[b+1184>>2]=i;g[b+1188>>2]=0.0;h=h-+g[b+1112>>2];k=k-+g[b+1116>>2];i=i-+g[b+1120>>2];w=+g[b+1084>>2];H=+g[b+1104>>2];I=+g[b+1088>>2];y=+g[b+1100>>2];z=+g[b+1096>>2];A=+g[b+1080>>2];B=+g[b+1064>>2];C=+g[b+1068>>2];J=+g[b+1072>>2];E=1.0/((w*H-I*y)*B+C*(I*z-H*A)+(y*A-w*z)*J);G=(y*A-w*z)*E;f=i*(I*C-w*J)*E+(h*(w*H-I*y)*E+k*(y*J-H*C)*E);j=i*(A*J-I*B)*E+(h*(I*z-H*A)*E+k*(H*B-z*J)*E);k=i*(w*B-A*C)*E+(h*G+k*(z*C-y*B)*E);g[b+1256>>2]=f;g[b+1260>>2]=j;g[b+1264>>2]=k;g[b+1268>>2]=0.0;g[b+840>>2]=f;h=+g[b+680>>2];i=+g[b+696>>2];do if(!(h>i)){if(h>f){c[b+856>>2]=2;f=f-h;break}if(i>2]=1;f=f-i;break}else{c[b+856>>2]=0;f=0.0;break}}else{c[b+856>>2]=0;f=0.0}while(0);g[b+824>>2]=f;g[b+844>>2]=j;f=+g[b+684>>2];h=+g[b+700>>2];do if(!(f>h)){if(f>j){c[b+860>>2]=2;f=j-f;break}if(h>2]=1;f=j-h;break}else{c[b+860>>2]=0;f=0.0;break}}else{c[b+860>>2]=0;f=0.0}while(0);g[b+828>>2]=f;g[b+848>>2]=k;f=+g[b+688>>2];h=+g[b+704>>2];do if(!(f>h)){if(f>k){c[b+864>>2]=2;f=k-f;break}if(h>2]=1;f=k-h;break}else{c[b+864>>2]=0;f=0.0;break}}else{c[b+864>>2]=0;f=0.0}while(0);g[b+832>>2]=f;n=+g[b+1128>>2];o=+g[b+1144>>2];p=+g[b+1160>>2];h=+g[b+1132>>2];i=+g[b+1148>>2];j=+g[b+1164>>2];k=(w*H-I*y)*E*h+(y*J-H*C)*E*i+(I*C-w*J)*E*j;l=h*(I*z-H*A)*E+(H*B-z*J)*E*i+(A*J-I*B)*E*j;m=p*(w*B-A*C)*E+(n*G+o*(z*C-y*B)*E);f=G*+g[b+1136>>2]+(z*C-y*B)*E*+g[b+1152>>2]+(w*B-A*C)*E*(q*t+r*u+s*v);do if(m<1.0)if(m>-1.0){g[b+1192>>2]=+F(+-(h*G+(z*C-y*B)*E*i+(w*B-A*C)*E*j),+f);f=m<-1.0?-1.0:m;g[b+1196>>2]=+D(+(f>1.0?1.0:f));f=+F(+-(p*(A*J-I*B)*E+(n*(I*z-H*A)*E+o*(H*B-z*J)*E)),+(p*(I*C-w*J)*E+(n*(w*H-I*y)*E+o*(y*J-H*C)*E)));break}else{g[b+1192>>2]=-+F(+k,+l);g[b+1196>>2]=-1.5707963705062866;f=0.0;break}else{g[b+1192>>2]=+F(+k,+l);g[b+1196>>2]=1.5707963705062866;f=0.0}while(0);g[b+1200>>2]=f;g[b+1236>>2]=0.0;y=H*(n*H-p*J)-I*(o*J-n*I);z=J*(o*J-n*I)-H*(p*I-o*H);A=I*(p*I-o*H)-J*(n*H-p*J);g[b+1220>>2]=0.0;C=o*(o*J-n*I)-p*(n*H-p*J);E=p*(p*I-o*H)-n*(o*J-n*I);G=n*(n*H-p*J)-o*(p*I-o*H);g[b+1252>>2]=0.0;B=1.0/+x(+(y*y+z*z+A*A));g[b+1208>>2]=y*B;g[b+1212>>2]=z*B;g[b+1216>>2]=A*B;B=1.0/+x(+((o*J-n*I)*(o*J-n*I)+((n*H-p*J)*(n*H-p*J)+(p*I-o*H)*(p*I-o*H))));g[b+1224>>2]=(p*I-o*H)*B;g[b+1228>>2]=(n*H-p*J)*B;g[b+1232>>2]=(o*J-n*I)*B;J=1.0/+x(+(C*C+E*E+G*G));g[b+1240>>2]=C*J;g[b+1244>>2]=E*J;g[b+1248>>2]=G*J;if(!(a[b+1301>>0]|0))return;I=+g[(c[b+28>>2]|0)+344>>2];J=+g[(c[b+32>>2]|0)+344>>2];a[b+1280>>0]=(I<1.1920928955078125e-07|J<1.1920928955078125e-07)&1;J=I+J>0.0?J/(I+J):.5;g[b+1272>>2]=J;g[b+1276>>2]=1.0-J;return}function uc(b,d){b=b|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=sa;sa=sa+32|0;uf(b+4|0,((J(c[b+152>>2]|0,c[b+16>>2]|0)|0)/100|0)+1|0);if(c[b+164>>2]|0){o=((J(c[b+148>>2]|0,c[b+76>>2]|0)|0)/100|0)+1|0;uf(b+64|0,o);o=(c[b+164>>2]|0)-o|0;c[b+164>>2]=(o|0)>0?o:0}f=((c[b+144>>2]|0)+1|0)%2|0;c[b+144>>2]=f;f=c[b+124+(f<<2)>>2]|0;if(f|0){do{j=f+56|0;l=f;f=c[j>>2]|0;h=c[l+52>>2]|0;if(!h)h=b+124+(c[l+60>>2]<<2)|0;else h=h+56|0;c[h>>2]=f;h=c[j>>2]|0;if(h|0)c[h+52>>2]=c[l+52>>2];c[l+52>>2]=0;c[j>>2]=c[b+132>>2];h=c[b+132>>2]|0;if(h|0)c[h+52>>2]=l;c[b+132>>2]=l;h=c[l+48>>2]|0;sg(b+4|0,h)|0;j=c[b+8>>2]|0;if(j|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[b+8>>2]=h;c[b+16>>2]=(c[b+16>>2]|0)+-1;c[q>>2]=c[l+16>>2];c[q+4>>2]=c[l+16+4>>2];c[q+8>>2]=c[l+16+8>>2];c[q+12>>2]=c[l+16+12>>2];c[q+16>>2]=c[l+32>>2];c[q+16+4>>2]=c[l+32+4>>2];c[q+16+8>>2]=c[l+32+8>>2];c[q+16+12>>2]=c[l+32+12>>2];h=c[b+68>>2]|0;if(!h){c[7182]=(c[7182]|0)+1;h=xb(63)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=h;k=j+44|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0))}else c[b+68>>2]=0;c[h+32>>2]=0;c[h+36>>2]=l;c[h+40>>2]=0;c[h>>2]=c[q>>2];c[h+4>>2]=c[q+4>>2];c[h+8>>2]=c[q+8>>2];c[h+12>>2]=c[q+12>>2];c[h+16>>2]=c[q+16>>2];c[h+20>>2]=c[q+20>>2];c[h+24>>2]=c[q+24>>2];c[h+28>>2]=c[q+28>>2];ue(b+64|0,c[b+64>>2]|0,h);j=(c[b+76>>2]|0)+1|0;c[b+76>>2]=j;c[l+48>>2]=h;c[l+60>>2]=2}while((f|0)!=0);c[b+164>>2]=j;a[b+194>>0]=1}c[q>>2]=11812;c[q+4>>2]=b;if(a[b+193>>0]|0?(zd(b+4|0,c[b+4>>2]|0,c[b+64>>2]|0,q),a[b+193>>0]|0):0){o=c[b+4>>2]|0;zd(b+4|0,o,o,q)}if(a[b+194>>0]|0?(m=c[b+136>>2]|0,m=Fa[c[(c[m>>2]|0)+28>>2]&127](m)|0,e=c[m+4>>2]|0,(e|0)>0):0){f=(J(c[b+156>>2]|0,e)|0)/100|0;o=c[b+160>>2]|0;f=(o|0)>(f|0)?o:f;f=(e|0)<(f|0)?e:f;if((f|0)>0){h=0;do{k=((c[b+184>>2]|0)+h|0)%(e|0)|0;n=c[m+12>>2]|0;j=c[n+(k<<4)>>2]|0;k=c[n+(k<<4)+4>>2]|0;n=c[j+48>>2]|0;o=c[k+48>>2]|0;if(!(((((+g[n>>2]<=+g[o+16>>2]?+g[n+16>>2]>=+g[o>>2]:0)?+g[n+4>>2]<=+g[o+20>>2]:0)?+g[n+20>>2]>=+g[o+4>>2]:0)?+g[n+8>>2]<=+g[o+24>>2]:0)?+g[n+24>>2]>=+g[o+8>>2]:0)){e=c[b+136>>2]|0;Ka[c[(c[e>>2]|0)+12>>2]&31](e,j,k,d)|0;h=h+-1|0;f=f+-1|0;e=c[m+4>>2]|0}h=h+1|0}while((h|0)<(f|0));if((e|0)>0)p=37;else e=0}else p=37;if((p|0)==37)e=((c[b+184>>2]|0)+f|0)%(e|0)|0;c[b+184>>2]=e}c[b+180>>2]=(c[b+180>>2]|0)+1;c[b+160>>2]=1;a[b+194>>0]=0;f=c[b+168>>2]|0;e=c[b+172>>2]|0;if(!f)i=0.0;else i=+(e>>>0)/+(f>>>0);g[b+176>>2]=i;c[b+172>>2]=1?e>>>1:e;c[b+168>>2]=1?f>>>1:f;o=c[b+136>>2]|0;if(!(Fa[c[(c[o>>2]|0)+56>>2]&127](o)|0)){sa=q;return}o=c[b+136>>2]|0;o=Fa[c[(c[o>>2]|0)+28>>2]&127](o)|0;e=c[o+4>>2]|0;if((e|0)>1){Ed(o,0,e+-1|0);e=c[o+4>>2]|0}if((e|0)>0){m=0;l=0;n=0;f=0;while(1){j=c[o+12>>2]|0;h=j+(m<<4)|0;r=n;n=c[h>>2]|0;j=j+(m<<4)+4|0;k=c[j>>2]|0;if(!((n|0)==(r|0)&(k|0)==(f|0))){f=c[n+48>>2]|0;r=c[k+48>>2]|0;if(((((+g[f>>2]<=+g[r+16>>2]?+g[f+16>>2]>=+g[r>>2]:0)?+g[f+4>>2]<=+g[r+20>>2]:0)?+g[f+20>>2]>=+g[r+4>>2]:0)?+g[f+8>>2]<=+g[r+24>>2]:0)?+g[f+24>>2]>=+g[r+8>>2]:0){h=l;f=k}else{f=k;p=53}}else p=53;if((p|0)==53){p=0;e=c[b+136>>2]|0;Za[c[(c[e>>2]|0)+32>>2]&127](e,h,d);c[h>>2]=0;c[j>>2]=0;h=l+1|0;e=c[o+4>>2]|0}m=m+1|0;if((m|0)>=(e|0))break;else l=h}if((e|0)>1){Ed(o,0,e+-1|0);e=c[o+4>>2]|0}k=e-h|0;if((h|0)<0){if((c[o+8>>2]|0)<(k|0)){if(!k){f=0;j=e}else{c[7182]=(c[7182]|0)+1;f=xb((k<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=c[o+4>>2]|0}if((j|0)>0){h=0;do{r=c[o+12>>2]|0;c[f+(h<<4)>>2]=c[r+(h<<4)>>2];c[f+(h<<4)+4>>2]=c[r+(h<<4)+4>>2];c[f+(h<<4)+8>>2]=c[r+(h<<4)+8>>2];c[f+(h<<4)+12>>2]=c[r+(h<<4)+12>>2];h=h+1|0}while((h|0)!=(j|0))}h=c[o+12>>2]|0;if(h|0){if(a[o+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[o+12>>2]=0}a[o+16>>0]=1;c[o+12>>2]=f;c[o+8>>2]=k}do{r=(c[o+12>>2]|0)+(e<<4)|0;e=e+1|0;c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0}while((e|0)!=(k|0));e=k}else e=k}c[o+4>>2]=e;sa=q;return}function vc(a,d,f,h,i,j,k,l,m){a=a|0;d=d|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0,G=0;w=+g[a+8>>2];y=+g[a+12>>2];A=+g[a+16>>2];x=+g[a+40>>2];s=(+g[d>>2]-w)*x;z=+g[a+44>>2];u=(+g[d+4>>2]-y)*z;B=+g[a+48>>2];v=(+g[d+8>>2]-A)*B;if(!(s<=0.0)){t=b[a+6>>1]|0;t=b[a+4>>1]&(!(s>=+(t&65535))?~~s&65535:t)}else t=0;if(!(u<=0.0)){r=b[a+6>>1]|0;r=b[a+4>>1]&(!(u>=+(r&65535))?~~u&65535:r)}else r=0;if(!(v<=0.0)){q=b[a+6>>1]|0;q=b[a+4>>1]&(!(v>=+(q&65535))?~~v&65535:q)}else q=0;v=(+g[f>>2]-w)*x;u=(+g[f+4>>2]-y)*z;s=(+g[f+8>>2]-A)*B;if(!(v<=0.0)){p=b[a+6>>1]|0;p=b[a+4>>1]&(!(v>=+(p&65535))?~~v&65535:p)|1}else p=1;if(!(u<=0.0)){o=b[a+6>>1]|0;o=b[a+4>>1]&(!(u>=+(o&65535))?~~u&65535:o)|1}else o=1;if(!(s<=0.0)){n=b[a+6>>1]|0;n=b[a+4>>1]&(!(s>=+(n&65535))?~~s&65535:n)|1}else n=1;D=b[a+64>>1]|0;C=c[a+60>>2]|0;b[a+64>>1]=b[C+((D&65535)<<6)+48>>1]|0;E=(b[a+56>>1]|0)+1<<16>>16;b[a+56>>1]=E;c[C+((D&65535)<<6)+12>>2]=D&65535;c[C+((D&65535)<<6)>>2]=i;b[C+((D&65535)<<6)+4>>1]=j;b[C+((D&65535)<<6)+6>>1]=k;c[C+((D&65535)<<6)+8>>2]=m;m=(E&65535)<<1&65534;b[C+54>>1]=(e[C+54>>1]|0)+2;F=c[a+68>>2]|0;G=e[F+(m+-1<<2)>>1]|e[F+(m+-1<<2)+2>>1]<<16;b[F+((m|1)<<2)>>1]=G;b[F+((m|1)<<2)+2>>1]=G>>>16;F=c[a+68>>2]|0;b[F+(m+-1<<2)>>1]=t;b[F+(m+-1<<2)+2>>1]=D;b[F+(m<<2)>>1]=p;b[F+(m<<2)+2>>1]=D;b[C+((D&65535)<<6)+48>>1]=m+-1;b[C+((D&65535)<<6)+54>>1]=(E&65535)<<1;p=(c[a+60>>2]|0)+56|0;b[p>>1]=(e[p>>1]|0)+2;p=c[a+72>>2]|0;t=e[p+(m+-1<<2)>>1]|e[p+(m+-1<<2)+2>>1]<<16;b[p+((m|1)<<2)>>1]=t;b[p+((m|1)<<2)+2>>1]=t>>>16;p=c[a+72>>2]|0;b[p+(m+-1<<2)>>1]=r;b[p+(m+-1<<2)+2>>1]=D;b[p+(m<<2)>>1]=o;b[p+(m<<2)+2>>1]=D;b[C+((D&65535)<<6)+50>>1]=m+-1;b[C+((D&65535)<<6)+56>>1]=(E&65535)<<1;o=(c[a+60>>2]|0)+58|0;b[o>>1]=(e[o>>1]|0)+2;o=c[a+76>>2]|0;p=e[o+(m+-1<<2)>>1]|e[o+(m+-1<<2)+2>>1]<<16;b[o+((m|1)<<2)>>1]=p;b[o+((m|1)<<2)+2>>1]=p>>>16;o=c[a+76>>2]|0;b[o+(m+-1<<2)>>1]=q;b[o+(m+-1<<2)+2>>1]=D;b[o+(m<<2)>>1]=n;b[o+(m<<2)+2>>1]=D;b[C+((D&65535)<<6)+52>>1]=m+-1;b[C+((D&65535)<<6)+58>>1]=(E&65535)<<1;o=c[a+68>>2]|0;p=e[C+((D&65535)<<6)+48>>1]|0;t=c[a+60>>2]|0;q=b[o+(p<<2)+-4>>1]|0;if((e[o+(p<<2)>>1]|0)<(q&65535)){m=t+((e[o+(p<<2)+2>>1]|0)<<6)+48|0;n=o+(p<<2)+-4|0;r=o+(p<<2)|0;p=q;o=t;while(1){G=e[r+-2>>1]|0;o=(p&1)==0?o+(G<<6)+48|0:o+(G<<6)+54|0;b[o>>1]=(b[o>>1]|0)+1<<16>>16;b[m>>1]=(b[m>>1]|0)+-1<<16>>16;o=e[r>>1]|e[r+2>>1]<<16;p=e[n>>1]|e[n+2>>1]<<16;b[r>>1]=p;b[r+2>>1]=p>>>16;b[n>>1]=o;b[n+2>>1]=o>>>16;o=r+-4|0;n=n+-4|0;p=b[n>>1]|0;if((e[o>>1]|0)>=(p&65535))break;r=o;o=c[a+60>>2]|0}o=c[a+68>>2]|0}n=e[C+((D&65535)<<6)+54>>1]|0;p=o+(n<<2)|0;r=b[p+-4>>1]|0;a:do if((e[p>>1]|0)<(r&65535)){G=c[a+60>>2]|0;t=G+((e[o+(n<<2)+2>>1]|0)<<6)+54|0;n=p+-4|0;q=p;o=r;p=G;while(1){G=e[q+-2>>1]|0;p=(o&1)==0?p+(G<<6)+48|0:p+(G<<6)+54|0;b[p>>1]=(b[p>>1]|0)+1<<16>>16;b[t>>1]=(b[t>>1]|0)+-1<<16>>16;p=e[q>>1]|e[q+2>>1]<<16;o=e[n>>1]|e[n+2>>1]<<16;b[q>>1]=o;b[q+2>>1]=o>>>16;b[n>>1]=p;b[n+2>>1]=p>>>16;p=q+-4|0;n=n+-4|0;o=b[n>>1]|0;if((e[p>>1]|0)>=(o&65535))break a;q=p;p=c[a+60>>2]|0}}while(0);o=c[a+72>>2]|0;p=e[C+((D&65535)<<6)+50>>1]|0;t=c[a+60>>2]|0;q=b[o+(p<<2)+-4>>1]|0;if((e[o+(p<<2)>>1]|0)<(q&65535)){m=t+((e[o+(p<<2)+2>>1]|0)<<6)+50|0;n=o+(p<<2)+-4|0;r=o+(p<<2)|0;p=q;o=t;while(1){G=e[r+-2>>1]|0;o=(p&1)==0?o+(G<<6)+50|0:o+(G<<6)+56|0;b[o>>1]=(b[o>>1]|0)+1<<16>>16;b[m>>1]=(b[m>>1]|0)+-1<<16>>16;o=e[r>>1]|e[r+2>>1]<<16;p=e[n>>1]|e[n+2>>1]<<16;b[r>>1]=p;b[r+2>>1]=p>>>16;b[n>>1]=o;b[n+2>>1]=o>>>16;o=r+-4|0;n=n+-4|0;p=b[n>>1]|0;if((e[o>>1]|0)>=(p&65535))break;r=o;o=c[a+60>>2]|0}o=c[a+72>>2]|0}n=e[C+((D&65535)<<6)+56>>1]|0;p=o+(n<<2)|0;r=b[p+-4>>1]|0;b:do if((e[p>>1]|0)<(r&65535)){G=c[a+60>>2]|0;t=G+((e[o+(n<<2)+2>>1]|0)<<6)+56|0;n=p+-4|0;q=p;o=r;p=G;while(1){G=e[q+-2>>1]|0;p=(o&1)==0?p+(G<<6)+50|0:p+(G<<6)+56|0;b[p>>1]=(b[p>>1]|0)+1<<16>>16;b[t>>1]=(b[t>>1]|0)+-1<<16>>16;p=e[q>>1]|e[q+2>>1]<<16;o=e[n>>1]|e[n+2>>1]<<16;b[q>>1]=o;b[q+2>>1]=o>>>16;b[n>>1]=p;b[n+2>>1]=p>>>16;p=q+-4|0;n=n+-4|0;o=b[n>>1]|0;if((e[p>>1]|0)>=(o&65535))break b;q=p;p=c[a+60>>2]|0}}while(0);Ng(a,2,b[C+((D&65535)<<6)+52>>1]|0);Hg(a,2,b[C+((D&65535)<<6)+58>>1]|0,l);o=c[a+60>>2]|0;n=c[a+108>>2]|0;if(!n){G=o+((D&65535)<<6)|0;return G|0}c[o+((D&65535)<<6)+60>>2]=Ma[c[(c[n>>2]|0)+8>>2]&3](n,d,f,h,i,j,k,l,0)|0;G=o+((D&65535)<<6)|0;return G|0}function wc(b){b=b|0;var d=0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0,s=0,t=0.0,u=0.0,v=0;r=sa;sa=sa+176|0;if(!(a[b+527>>0]|0)){sa=r;return}g[b+36>>2]=0.0;g[b+520>>2]=0.0;g[b+516>>2]=0.0;c[b+576>>2]=0;c[b+576+4>>2]=0;c[b+576+8>>2]=0;c[b+576+12>>2]=0;if(!(a[b+524>>0]|0)){s=c[b+28>>2]|0;h=+g[b+348>>2];i=+g[b+352>>2];n=+g[b+356>>2];p=h*+g[s+20>>2]+i*+g[s+24>>2]+n*+g[s+28>>2]+ +g[s+56>>2];d=c[b+32>>2]|0;j=+g[b+412>>2];k=+g[b+416>>2];o=+g[b+420>>2];q=j*+g[d+20>>2]+k*+g[d+24>>2]+o*+g[d+28>>2]+ +g[d+56>>2];l=j*+g[d+36>>2]+k*+g[d+40>>2]+o*+g[d+44>>2]+ +g[d+60>>2];m=h*+g[s+4>>2]+i*+g[s+8>>2]+n*+g[s+12>>2]+ +g[s+52>>2];n=h*+g[s+36>>2]+i*+g[s+40>>2]+n*+g[s+44>>2]+ +g[s+60>>2];o=j*+g[d+4>>2]+k*+g[d+8>>2]+o*+g[d+12>>2]+ +g[d+52>>2];if((o-m)*(o-m)+(q-p)*(q-p)+(l-n)*(l-n)>1.1920928955078125e-07){f=1.0/+x(+((o-m)*(o-m)+(q-p)*(q-p)+(l-n)*(l-n)));g[r>>2]=(o-m)*f;g[r+4>>2]=(q-p)*f;g[r+8>>2]=(l-n)*f;c[r+12>>2]=0;h=(l-n)*f;e=(q-p)*f;f=(o-m)*f}else{c[r>>2]=1065353216;c[r+4>>2]=0;c[r+8>>2]=0;g[r+12>>2]=0.0;h=0.0;e=0.0;f=1.0}if(+w(+h)>.7071067690849304){u=h*h+e*e;t=1.0/+x(+u);h=-(h*t);i=e*t;k=-(f*i);j=f*h;e=u*t;f=i;i=0.0}else{t=f*f+e*e;j=1.0/+x(+t);i=-(e*j);u=f*j;k=h*i;j=t*j;e=-(h*u);f=0.0;h=u}g[r+16>>2]=i;g[r+20>>2]=h;g[r+24>>2]=f;g[r+32>>2]=e;g[r+36>>2]=k;g[r+40>>2]=j;s=c[b+28>>2]|0;c[r+128>>2]=c[s+4>>2];c[r+128+4>>2]=c[s+20>>2];c[r+128+8>>2]=c[s+36>>2];g[r+128+12>>2]=0.0;c[r+128+16>>2]=c[s+8>>2];c[r+128+20>>2]=c[s+24>>2];c[r+128+24>>2]=c[s+40>>2];g[r+128+28>>2]=0.0;c[r+128+32>>2]=c[s+12>>2];c[r+128+36>>2]=c[s+28>>2];c[r+128+40>>2]=c[s+44>>2];g[r+128+44>>2]=0.0;d=c[b+32>>2]|0;c[r+80>>2]=c[d+4>>2];c[r+80+4>>2]=c[d+20>>2];c[r+80+8>>2]=c[d+36>>2];g[r+80+12>>2]=0.0;c[r+80+16>>2]=c[d+8>>2];c[r+80+20>>2]=c[d+24>>2];c[r+80+24>>2]=c[d+40>>2];g[r+80+28>>2]=0.0;c[r+80+32>>2]=c[d+12>>2];c[r+80+36>>2]=c[d+28>>2];c[r+80+40>>2]=c[d+44>>2];g[r+80+44>>2]=0.0;u=p-+g[s+56>>2];t=n-+g[s+60>>2];g[r+64>>2]=m-+g[s+52>>2];g[r+64+4>>2]=u;g[r+64+8>>2]=t;g[r+64+12>>2]=0.0;t=q-+g[d+56>>2];u=l-+g[d+60>>2];g[r+48>>2]=o-+g[d+52>>2];g[r+48+4>>2]=t;g[r+48+8>>2]=u;g[r+48+12>>2]=0.0;fg(b+48|0,r+128|0,r+80|0,r+64|0,r+48|0,r,s+396|0,+g[s+344>>2],d+396|0,+g[d+344>>2]);d=c[b+28>>2]|0;c[r+128>>2]=c[d+4>>2];c[r+128+4>>2]=c[d+20>>2];c[r+128+8>>2]=c[d+36>>2];g[r+128+12>>2]=0.0;c[r+128+16>>2]=c[d+8>>2];c[r+128+20>>2]=c[d+24>>2];c[r+128+24>>2]=c[d+40>>2];g[r+128+28>>2]=0.0;c[r+128+32>>2]=c[d+12>>2];c[r+128+36>>2]=c[d+28>>2];c[r+128+40>>2]=c[d+44>>2];g[r+128+44>>2]=0.0;s=c[b+32>>2]|0;c[r+80>>2]=c[s+4>>2];c[r+80+4>>2]=c[s+20>>2];c[r+80+8>>2]=c[s+36>>2];g[r+80+12>>2]=0.0;c[r+80+16>>2]=c[s+8>>2];c[r+80+20>>2]=c[s+24>>2];c[r+80+24>>2]=c[s+40>>2];g[r+80+28>>2]=0.0;c[r+80+32>>2]=c[s+12>>2];c[r+80+36>>2]=c[s+28>>2];c[r+80+40>>2]=c[s+44>>2];g[r+80+44>>2]=0.0;u=p-+g[d+56>>2];t=n-+g[d+60>>2];g[r+64>>2]=m-+g[d+52>>2];g[r+64+4>>2]=u;g[r+64+8>>2]=t;g[r+64+12>>2]=0.0;t=q-+g[s+56>>2];u=l-+g[s+60>>2];g[r+48>>2]=o-+g[s+52>>2];g[r+48+4>>2]=t;g[r+48+8>>2]=u;g[r+48+12>>2]=0.0;fg(b+132|0,r+128|0,r+80|0,r+64|0,r+48|0,r+16|0,d+396|0,+g[d+344>>2],s+396|0,+g[s+344>>2]);s=c[b+28>>2]|0;c[r+128>>2]=c[s+4>>2];c[r+128+4>>2]=c[s+20>>2];c[r+128+8>>2]=c[s+36>>2];g[r+128+12>>2]=0.0;c[r+128+16>>2]=c[s+8>>2];c[r+128+20>>2]=c[s+24>>2];c[r+128+24>>2]=c[s+40>>2];g[r+128+28>>2]=0.0;c[r+128+32>>2]=c[s+12>>2];c[r+128+36>>2]=c[s+28>>2];c[r+128+40>>2]=c[s+44>>2];g[r+128+44>>2]=0.0;d=c[b+32>>2]|0;c[r+80>>2]=c[d+4>>2];c[r+80+4>>2]=c[d+20>>2];c[r+80+8>>2]=c[d+36>>2];g[r+80+12>>2]=0.0;c[r+80+16>>2]=c[d+8>>2];c[r+80+20>>2]=c[d+24>>2];c[r+80+24>>2]=c[d+40>>2];g[r+80+28>>2]=0.0;c[r+80+32>>2]=c[d+12>>2];c[r+80+36>>2]=c[d+28>>2];c[r+80+40>>2]=c[d+44>>2];g[r+80+44>>2]=0.0;u=p-+g[s+56>>2];t=n-+g[s+60>>2];g[r+64>>2]=m-+g[s+52>>2];g[r+64+4>>2]=u;g[r+64+8>>2]=t;g[r+64+12>>2]=0.0;t=q-+g[d+56>>2];u=l-+g[d+60>>2];g[r+48>>2]=o-+g[d+52>>2];g[r+48+4>>2]=t;g[r+48+8>>2]=u;g[r+48+12>>2]=0.0;fg(b+216|0,r+128|0,r+80|0,r+64|0,r+48|0,r+32|0,s+396|0,+g[s+344>>2],d+396|0,+g[d+344>>2]);d=b+32|0}else d=b+32|0;v=c[b+28>>2]|0;s=c[d>>2]|0;Cb(b,v+4|0,s+4|0,v+264|0,s+264|0);sa=r;return}function xc(b,d){b=b|0;d=d|0;var e=0.0,f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0.0,w=0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0;m=c[b+28>>2]|0;p=c[b+32>>2]|0;Cb(b,m+4|0,p+4|0,m+264|0,p+264|0);s=c[d+8>>2]|0;g[s>>2]=1.0;j=c[d+24>>2]|0;g[s+(j+1<<2)>>2]=1.0;g[s+((j<<1)+2<<2)>>2]=1.0;l=+g[b+348>>2];v=+g[b+352>>2];o=+g[b+356>>2];t=+g[m+4>>2]*l+ +g[m+8>>2]*v+ +g[m+12>>2]*o;n=l*+g[m+20>>2]+v*+g[m+24>>2]+o*+g[m+28>>2];o=l*+g[m+36>>2]+v*+g[m+40>>2]+o*+g[m+44>>2];s=c[d+12>>2]|0;c[s>>2]=0;g[s+4>>2]=o;g[s+8>>2]=-n;g[s+12>>2]=0.0;g[s+(j<<2)>>2]=-o;c[s+(j<<2)+4>>2]=0;g[s+(j<<2)+8>>2]=t;g[s+(j<<2)+12>>2]=0.0;g[s+(j<<1<<2)>>2]=n;g[s+(j<<1<<2)+4>>2]=-t;c[s+(j<<1<<2)+8>>2]=0;g[s+(j<<1<<2)+12>>2]=0.0;q=c[d+16>>2]|0;g[q>>2]=-1.0;g[q+(j+1<<2)>>2]=-1.0;g[q+((j<<1)+2<<2)>>2]=-1.0;v=+g[b+412>>2];l=+g[b+416>>2];k=+g[b+420>>2];u=+g[p+4>>2]*v+ +g[p+8>>2]*l+ +g[p+12>>2]*k;e=v*+g[p+20>>2]+l*+g[p+24>>2]+k*+g[p+28>>2];k=v*+g[p+36>>2]+l*+g[p+40>>2]+k*+g[p+44>>2];q=c[d+20>>2]|0;c[q>>2]=0;g[q+4>>2]=-k;g[q+8>>2]=e;g[q+12>>2]=0.0;g[q+(j<<2)>>2]=k;c[q+(j<<2)+4>>2]=0;g[q+(j<<2)+8>>2]=-u;g[q+(j<<2)+12>>2]=0.0;g[q+(j<<1<<2)>>2]=-e;g[q+(j<<1<<2)+4>>2]=u;c[q+(j<<1<<2)+8>>2]=0;g[q+(j<<1<<2)+12>>2]=0.0;r=c[b+592>>2]|0;l=+g[((r&2|0)==0?d+4|0:b+600|0)>>2]*+g[d>>2];h=c[d+28>>2]|0;f=c[d+36>>2]|0;i=c[d+40>>2]|0;g[h>>2]=l*(u+ +g[p+52>>2]-t-+g[m+52>>2]);g[f>>2]=-3402823466385288598117041.0e14;g[i>>2]=3402823466385288598117041.0e14;if(!(r&1)){g[h+(j<<2)>>2]=l*(e+ +g[p+56>>2]-n-+g[m+56>>2]);g[f+(j<<2)>>2]=-3402823466385288598117041.0e14;g[i+(j<<2)>>2]=3402823466385288598117041.0e14;g[h+(j<<1<<2)>>2]=l*(k+ +g[p+60>>2]-o-+g[m+60>>2]);g[f+(j<<1<<2)>>2]=-3402823466385288598117041.0e14;g[i+(j<<1<<2)>>2]=3402823466385288598117041.0e14}else{w=c[d+32>>2]|0;c[w>>2]=c[b+596>>2];g[h+(j<<2)>>2]=l*(e+ +g[p+56>>2]-n-+g[m+56>>2]);g[f+(j<<2)>>2]=-3402823466385288598117041.0e14;g[i+(j<<2)>>2]=3402823466385288598117041.0e14;c[w+(j<<2)>>2]=c[b+596>>2];g[h+(j<<1<<2)>>2]=l*(k+ +g[p+60>>2]-o-+g[m+60>>2]);g[f+(j<<1<<2)>>2]=-3402823466385288598117041.0e14;g[i+(j<<1<<2)>>2]=3402823466385288598117041.0e14;c[w+(j<<1<<2)>>2]=c[b+596>>2]}do if(!(a[b+526>>0]|0))j=j*3|0;else{v=+g[b+456>>2];if(+g[b+444>>2]>2]>2];z=+g[m+8>>2];y=+g[m+12>>2];E=+g[b+304>>2];D=+g[b+320>>2];C=+g[b+336>>2];l=+g[b+308>>2];o=+g[b+324>>2];u=+g[b+340>>2];x=+g[m+20>>2];e=+g[m+24>>2];k=+g[m+28>>2];n=+g[m+36>>2];t=+g[m+40>>2];v=+g[m+44>>2];g[s+(j*3<<2)>>2]=A*E+z*D+y*C;g[s+((j*3|0)+1<<2)>>2]=E*x+D*e+C*k;g[s+((j*3|0)+2<<2)>>2]=E*n+D*t+C*v;g[s+(j<<2<<2)>>2]=A*l+z*o+y*u;g[s+((j<<2|1)<<2)>>2]=l*x+o*e+u*k;g[s+((j<<2|2)<<2)>>2]=l*n+o*t+u*v;g[q+(j*3<<2)>>2]=-(A*E+z*D+y*C);g[q+((j*3|0)+1<<2)>>2]=-(E*x+D*e+C*k);g[q+((j*3|0)+2<<2)>>2]=-(E*n+D*t+C*v);g[q+(j<<2<<2)>>2]=-(A*l+z*o+y*u);g[q+((j<<2|1)<<2)>>2]=-(l*x+o*e+u*k);g[q+((j<<2|2)<<2)>>2]=-(l*n+o*t+u*v);B=+g[d>>2]*+g[b+436>>2];h=c[d+28>>2]|0;g[h+(j*3<<2)>>2]=B*((A*E+z*D+y*C)*+g[b+460>>2]+(E*x+D*e+C*k)*+g[b+464>>2]+(E*n+D*t+C*v)*+g[b+468>>2]);g[h+(j<<2<<2)>>2]=B*((A*l+z*o+y*u)*+g[b+460>>2]+(l*x+o*e+u*k)*+g[b+464>>2]+(l*n+o*t+u*v)*+g[b+468>>2]);f=c[d+36>>2]|0;g[f+(j*3<<2)>>2]=-3402823466385288598117041.0e14;i=c[d+40>>2]|0;g[i+(j*3<<2)>>2]=3402823466385288598117041.0e14;g[f+(j<<2<<2)>>2]=-3402823466385288598117041.0e14;g[i+(j<<2<<2)>>2]=3402823466385288598117041.0e14;j=j*5|0;break}E=+g[b+436>>2];C=E*+g[b+460>>2]*E;D=E*E*+g[b+464>>2];E=E*E*+g[b+468>>2];g[s+(j*3<<2)>>2]=C;g[s+((j*3|0)+1<<2)>>2]=D;g[s+((j*3|0)+2<<2)>>2]=E;g[q+(j*3<<2)>>2]=-C;g[q+((j*3|0)+1<<2)>>2]=-D;g[q+((j*3|0)+2<<2)>>2]=-E;g[h+(j*3<<2)>>2]=+g[d>>2]*+g[b+432>>2]*+g[b+504>>2];if(r&4|0)c[(c[d+32>>2]|0)+(j*3<<2)>>2]=c[b+604>>2];g[f+(j*3<<2)>>2]=0.0;g[i+(j*3<<2)>>2]=3402823466385288598117041.0e14;j=j<<2}while(0);if(!(a[b+525>>0]|0))return;E=+g[b+436>>2];C=E*+g[b+476>>2]*E;D=E*E*+g[b+480>>2];E=E*E*+g[b+484>>2];g[s+(j<<2)>>2]=C;p=j+1|0;g[s+(p<<2)>>2]=D;w=j+2|0;g[s+(w<<2)>>2]=E;g[q+(j<<2)>>2]=-C;g[q+(p<<2)>>2]=-D;g[q+(w<<2)>>2]=-E;g[h+(j<<2)>>2]=+g[d>>2]*+g[b+432>>2]*+g[b+508>>2];if(r&4|0)c[(c[d+32>>2]|0)+(j<<2)>>2]=c[b+604>>2];do if(+g[b+452>>2]>0.0){f=f+(j<<2)|0;if(+g[b+508>>2]>0.0){g[f>>2]=0.0;e=3402823466385288598117041.0e14;break}else{g[f>>2]=-3402823466385288598117041.0e14;e=0.0;break}}else{g[f+(j<<2)>>2]=-3402823466385288598117041.0e14;e=3402823466385288598117041.0e14}while(0);g[i+(j<<2)>>2]=e;return}function yc(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;var i=0.0,j=0.0,k=0,l=0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0;A=sa;sa=sa+272|0;c[A+128>>2]=c[d>>2];c[A+128+4>>2]=c[d+4>>2];c[A+128+8>>2]=c[d+8>>2];c[A+128+12>>2]=c[d+12>>2];c[A+128+16>>2]=c[d+16>>2];c[A+128+16+4>>2]=c[d+16+4>>2];c[A+128+16+8>>2]=c[d+16+8>>2];c[A+128+16+12>>2]=c[d+16+12>>2];c[A+128+32>>2]=c[d+32>>2];c[A+128+32+4>>2]=c[d+32+4>>2];c[A+128+32+8>>2]=c[d+32+8>>2];c[A+128+32+12>>2]=c[d+32+12>>2];c[A+128+48>>2]=c[d+48>>2];c[A+128+48+4>>2]=c[d+48+4>>2];c[A+128+48+8>>2]=c[d+48+8>>2];c[A+128+48+12>>2]=c[d+48+12>>2];c[A+64>>2]=c[e>>2];c[A+64+4>>2]=c[e+4>>2];c[A+64+8>>2]=c[e+8>>2];c[A+64+12>>2]=c[e+12>>2];c[A+64+16>>2]=c[e+16>>2];c[A+64+16+4>>2]=c[e+16+4>>2];c[A+64+16+8>>2]=c[e+16+8>>2];c[A+64+16+12>>2]=c[e+16+12>>2];c[A+64+32>>2]=c[e+32>>2];c[A+64+32+4>>2]=c[e+32+4>>2];c[A+64+32+8>>2]=c[e+32+8>>2];c[A+64+32+12>>2]=c[e+32+12>>2];c[A+64+48>>2]=c[e+48>>2];c[A+64+48+4>>2]=c[e+48+4>>2];c[A+64+48+8>>2]=c[e+48+8>>2];c[A+64+48+12>>2]=c[e+48+12>>2];i=+g[A+64+52>>2]-+g[A+128+52>>2];F=+g[A+64+56>>2]-+g[A+128+56>>2];g[A+16>>2]=+g[A+64+48>>2]-+g[A+128+48>>2];g[A+16+4>>2]=i;g[A+16+8>>2]=F;g[A+16+12>>2]=0.0;Se(A+128|0,A+64|0,A+208|0,A+192|0);F=+g[A+192>>2];i=F*+g[A+208+4>>2];C=F*+g[A+208+8>>2];g[A>>2]=+g[A+208>>2]*F;g[A+4>>2]=i;g[A+8>>2]=C;g[A+12>>2]=0.0;c[A+208+48>>2]=0;c[A+208+48+4>>2]=0;c[A+208+48+8>>2]=0;c[A+208+48+12>>2]=0;Og(A+128|0,A+192|0);C=+g[A+192>>2];i=+g[A+192+4>>2];F=+g[A+192+8>>2];D=+g[A+192+12>>2];B=C*(2.0/(C*C+i*i+F*F+D*D));j=i*(2.0/(C*C+i*i+F*F+D*D));E=F*(2.0/(C*C+i*i+F*F+D*D));g[A+208>>2]=1.0-(i*j+F*E);g[A+208+4>>2]=C*j-D*E;g[A+208+8>>2]=C*E+D*j;g[A+208+12>>2]=0.0;g[A+208+16>>2]=C*j+D*E;g[A+208+20>>2]=1.0-(C*B+F*E);g[A+208+24>>2]=i*E-D*B;g[A+208+28>>2]=0.0;g[A+208+32>>2]=C*E-D*j;g[A+208+36>>2]=i*E+D*B;g[A+208+40>>2]=1.0-(C*B+i*j);g[A+208+44>>2]=0.0;zg(b,A+208|0,A+16|0,A,A+48|0,A+32|0);if((c[a+268>>2]|0)<=0){sa=A;return}k=0;do{l=c[(c[a+276>>2]|0)+(k<<2)>>2]|0;if(Ha[c[(c[f>>2]|0)+8>>2]&31](f,c[l+188>>2]|0)|0?(y=c[l+192>>2]|0,ab[c[(c[y>>2]|0)+8>>2]&127](y,l+4|0,A+192|0,A+16|0),m=+g[A+192>>2]+ +g[A+48>>2],n=+g[A+192+4>>2]+ +g[A+48+4>>2],o=+g[A+192+8>>2]+ +g[A+48+8>>2],g[A+192>>2]=m,g[A+192+4>>2]=n,g[A+192+8>>2]=o,g[A+192+12>>2]=0.0,p=+g[A+16>>2]+ +g[A+32>>2],q=+g[A+16+4>>2]+ +g[A+32+4>>2],r=+g[A+16+8>>2]+ +g[A+32+8>>2],g[A+16>>2]=p,g[A+16+4>>2]=q,g[A+16+8>>2]=r,g[A+16+12>>2]=0.0,s=+g[d+48>>2]-(p+m)*.5,t=+g[d+52>>2]-(q+n)*.5,u=+g[d+56>>2]-(r+o)*.5,v=+g[e+48>>2]-(p+m)*.5,w=+g[e+52>>2]-(q+n)*.5,x=+g[e+56>>2]-(r+o)*.5,y=(s>(p-m)*.5?8:0)|s<-((p-m)*.5)|(t<-((q-n)*.5)?2:0)|(t>(q-n)*.5?16:0)|(u<-((r-o)*.5)?4:0)|(u>(r-o)*.5?32:0),z=(v>(p-m)*.5?8:0)|v<-((p-m)*.5)|(w<-((q-n)*.5)?2:0)|(w>(q-n)*.5?16:0)|(x<-((r-o)*.5)?4:0)|(x>(r-o)*.5?32:0),(z&y|0)==0):0){if(s<-((p-m)*.5))if(!((-s-(p-m)*.5)/(v-s)>=0.0)){i=0.0;j=1.0}else{i=(-s-(p-m)*.5)/(v-s);j=1.0}else if(v<-((p-m)*.5)?(-s-(p-m)*.5)/(v-s)<1.0:0){i=0.0;j=(-s-(p-m)*.5)/(v-s)}else{i=0.0;j=1.0}if(t<-((q-n)*.5)){if(i<=(-t-(q-n)*.5)/(w-t))i=(-t-(q-n)*.5)/(w-t)}else if(w<-((q-n)*.5)?(-t-(q-n)*.5)/(w-t)(p-m)*.5){if(i<=((p-m)*.5-s)/(v-s))i=((p-m)*.5-s)/(v-s)}else if(v>(p-m)*.5?((p-m)*.5-s)/(v-s)(q-n)*.5){if(i<=((q-n)*.5-t)/(w-t))i=((q-n)*.5-t)/(w-t)}else if(w>(q-n)*.5?((q-n)*.5-t)/(w-t)>2]|0;c[A+208>>2]=0;c[A+208+4>>2]=G;c[A+208+8>>2]=l;c[A+208+12>>2]=l+4;c[A+208+16>>2]=-1;c[A+208+20>>2]=-1;Eb(b,A+128|0,A+64|0,A+208|0,f,h)}}k=k+1|0}while((k|0)<(c[a+268>>2]|0));sa=A;return}function zc(b,d,e,f,h,i,j,k,l,m){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0,A=0,B=0.0,C=0,D=0;if((j|0)<2|(k|0)<2){m=0;return m|0}p=J(k,j)|0;c[7182]=(c[7182]|0)+1;b=xb(p>>>0>268435455?18:(p<<4|3)+16|0)|0;if(!b)q=0;else{c[(b+4+15&-16)+-4>>2]=b;q=b+4+15&-16}r=CI(p>>>0>1073741823?-1:p<<2)|0;b=0;do{B=+(b|0)/+(k+-1|0);s=+g[e>>2];s=s+B*(+g[h>>2]-s);t=+g[e+4>>2];t=t+B*(+g[h+4>>2]-t);u=+g[e+8>>2];u=u+B*(+g[h+8>>2]-u);v=+g[f>>2];w=+g[f+4>>2];y=+g[f+8>>2];v=v+B*(+g[i>>2]-v)-s;w=w+B*(+g[i+4>>2]-w)-t;y=y+B*(+g[i+8>>2]-y)-u;o=J(b,j)|0;n=0;do{B=+(n|0)/+(j+-1|0);A=n+o|0;g[q+(A<<4)>>2]=s+v*B;g[q+(A<<4)+4>>2]=t+w*B;g[q+(A<<4)+8>>2]=u+y*B;g[q+(A<<4)+12>>2]=0.0;g[r+(A<<2)>>2]=1.0;n=n+1|0}while((n|0)!=(j|0));b=b+1|0}while((b|0)!=(k|0));c[7182]=(c[7182]|0)+1;b=xb(1271)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}Hb(b,d,p,q,r);if(l&1|0){g[(c[b+720>>2]|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&2|0){g[(c[b+720>>2]|0)+((j+-1|0)*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(l&4|0){A=J(k+-1|0,j)|0;g[(c[b+720>>2]|0)+(A*104|0)+88>>2]=0.0;a[b+924>>0]=1}if(!(l&8)){z=b+720|0;A=b+924|0}else{A=j+-1+(J(k+-1|0,j)|0)|0;z=b+720|0;g[(c[z>>2]|0)+(A*104|0)+88>>2]=0.0;A=b+924|0;a[A>>0]=1}c[7183]=(c[7183]|0)+1;Hc(c[q+-4>>2]|0);DI(r);r=b+732|0;l=b+740|0;n=0;do a:do if((j|0)>0){q=J(n,j)|0;d=n+1|0;f=J(d,j)|0;if((d|0)>=(k|0)){n=0;while(1){o=n;n=n+1|0;if((n|0)<(j|0)){h=n+q|0;f=c[z>>2]|0;oh(b,0);p=(c[r>>2]|0)+-1|0;i=c[l>>2]|0;c[i+(p*52|0)+8>>2]=f+((o+q|0)*104|0);c[i+(p*52|0)+12>>2]=f+(h*104|0);w=+g[f+((o+q|0)*104|0)+8>>2]-+g[f+(h*104|0)+8>>2];y=+g[f+((o+q|0)*104|0)+12>>2]-+g[f+(h*104|0)+12>>2];B=+g[f+((o+q|0)*104|0)+16>>2]-+g[f+(h*104|0)+16>>2];g[i+(p*52|0)+16>>2]=+x(+(w*w+y*y+B*B));a[A>>0]=1}if((n|0)==(j|0)){n=d;break a}}}o=0;do{h=o+q|0;e=o;o=o+1|0;do if((o|0)<(j|0)){i=o+q|0;C=c[z>>2]|0;oh(b,0);D=(c[r>>2]|0)+-1|0;p=c[l>>2]|0;c[p+(D*52|0)+8>>2]=C+(h*104|0);c[p+(D*52|0)+12>>2]=C+(i*104|0);B=+g[C+(h*104|0)+8>>2]-+g[C+(i*104|0)+8>>2];y=+g[C+(h*104|0)+12>>2]-+g[C+(i*104|0)+12>>2];w=+g[C+(h*104|0)+16>>2]-+g[C+(i*104|0)+16>>2];g[p+(D*52|0)+16>>2]=+x(+(B*B+y*y+w*w));a[A>>0]=1;D=c[z>>2]|0;oh(b,0);p=(c[r>>2]|0)+-1|0;C=c[l>>2]|0;c[C+(p*52|0)+8>>2]=D+(h*104|0);c[C+(p*52|0)+12>>2]=D+((e+f|0)*104|0);w=+g[D+(h*104|0)+8>>2]-+g[D+((e+f|0)*104|0)+8>>2];y=+g[D+(h*104|0)+12>>2]-+g[D+((e+f|0)*104|0)+12>>2];B=+g[D+(h*104|0)+16>>2]-+g[D+((e+f|0)*104|0)+16>>2];g[C+(p*52|0)+16>>2]=+x(+(w*w+y*y+B*B));a[A>>0]=1;if(!(e+n&1)){mf(b,e+f|0,h,i,0);mf(b,e+f|0,i,o+f|0,0);if(!m)break;p=c[z>>2]|0;oh(b,0);D=(c[r>>2]|0)+-1|0;C=c[l>>2]|0;c[C+(D*52|0)+8>>2]=p+(i*104|0);c[C+(D*52|0)+12>>2]=p+((e+f|0)*104|0);w=+g[p+(i*104|0)+8>>2]-+g[p+((e+f|0)*104|0)+8>>2];y=+g[p+(i*104|0)+12>>2]-+g[p+((e+f|0)*104|0)+12>>2];B=+g[p+(i*104|0)+16>>2]-+g[p+((e+f|0)*104|0)+16>>2];g[C+(D*52|0)+16>>2]=+x(+(w*w+y*y+B*B));a[A>>0]=1;break}else{p=o+f|0;mf(b,h,i,p,0);mf(b,h,p,e+f|0,0);if(!m)break;i=c[z>>2]|0;oh(b,0);D=(c[r>>2]|0)+-1|0;C=c[l>>2]|0;c[C+(D*52|0)+8>>2]=i+(h*104|0);c[C+(D*52|0)+12>>2]=i+(p*104|0);w=+g[i+(h*104|0)+8>>2]-+g[i+(p*104|0)+8>>2];y=+g[i+(h*104|0)+12>>2]-+g[i+(p*104|0)+12>>2];B=+g[i+(h*104|0)+16>>2]-+g[i+(p*104|0)+16>>2];g[C+(D*52|0)+16>>2]=+x(+(w*w+y*y+B*B));a[A>>0]=1;break}}else{p=c[z>>2]|0;oh(b,0);D=(c[r>>2]|0)+-1|0;C=c[l>>2]|0;c[C+(D*52|0)+8>>2]=p+(h*104|0);c[C+(D*52|0)+12>>2]=p+((e+f|0)*104|0);w=+g[p+(h*104|0)+8>>2]-+g[p+((e+f|0)*104|0)+8>>2];y=+g[p+(h*104|0)+12>>2]-+g[p+((e+f|0)*104|0)+12>>2];B=+g[p+(h*104|0)+16>>2]-+g[p+((e+f|0)*104|0)+16>>2];g[C+(D*52|0)+16>>2]=+x(+(w*w+y*y+B*B));a[A>>0]=1}while(0)}while((o|0)!=(j|0));n=d}else n=n+1|0;while(0);while((n|0)!=(k|0));return b|0}function Ac(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=c[a+8>>2]|0;if((d|0)<=0)return;f=0;do{e=c[(c[a+16>>2]|0)+(f<<2)>>2]|0;if((c[e+236>>2]|0)==1){Va[c[(c[e>>2]|0)+24>>2]&127](e,b);d=c[a+8>>2]|0}f=f+1|0}while((f|0)<(d|0));h=d;if((h|0)<=0)return;i=0;o=0;s=0;r=0;g=0;f=0;y=0;x=0;w=0;e=0;q=0;p=0;d=0;l=0;n=0;while(1){z=c[(c[(c[a+16>>2]|0)+(i<<2)>>2]|0)+192>>2]|0;t=((10?~(z<<15)+z>>10:~(z<<15)+z|0)^~(z<<15)+z)*9|0;t=(6?t>>6:t)^t;t=(16?t+~(t<<11)>>16:t+~(t<<11)|0)^t+~(t<<11);j=t&p+-1;a:do if(j>>>0>>0?(A=c[f+(j<<2)>>2]|0,(A|0)!=-1):0){j=A;while(1){if((c[g+(j<<3)>>2]|0)==(z|0))break;j=c[e+(j<<2)>>2]|0;if((j|0)==-1){F=14;break a}}if(d+(j<<2)|0){j=y;m=x;k=w}else F=14}else F=14;while(0);if((F|0)==14){F=0;m=t&p+-1;b:do if(m>>>0>>0?(B=c[f+(m<<2)>>2]|0,(B|0)!=-1):0){h=B;while(1){if((c[g+(h<<3)>>2]|0)==(z|0))break;h=c[e+(h<<2)>>2]|0;if((h|0)==-1){F=20;break b}}c[d+(h<<2)>>2]=z;j=y;m=x;k=w}else F=20;while(0);if((F|0)==20){F=0;do if((q|0)==(p|0)){j=(p|0)==0?1:p<<1;if((p|0)<(j|0)){if((j|0)!=0?(c[7182]=(c[7182]|0)+1,E=xb((j<<2|3)+16|0)|0,(E|0)!=0):0){c[(E+4+15&-16)+-4>>2]=E;k=E+4+15&-16}else k=0;if((p|0)<=0){if(!d){v=j;d=k;h=p;break}}else{h=0;do{c[k+(h<<2)>>2]=c[d+(h<<2)>>2];h=h+1|0}while((h|0)!=(p|0))}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);v=j;d=k;h=p}else{v=p;h=p}}else{v=p;h=q}while(0);c[d+(h<<2)>>2]=z;u=h+1|0;do if((s|0)==(r|0)){j=(s|0)==0?1:s<<1;if((s|0)<(j|0)){if((j|0)!=0?(c[7182]=(c[7182]|0)+1,C=xb((j<<3|3)+16|0)|0,(C|0)!=0):0){c[(C+4+15&-16)+-4>>2]=C;k=C+4+15&-16}else k=0;if((s|0)<=0){if(!g){r=j;g=k;break}}else{h=0;do{H=g+(h<<3)|0;G=c[H+4>>2]|0;r=k+(h<<3)|0;c[r>>2]=c[H>>2];c[r+4>>2]=G;h=h+1|0}while((h|0)!=(s|0))}c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);r=j;g=k}else r=s}while(0);H=g+(s<<3)|0;c[H>>2]=z;c[H+4>>2]=0;s=s+1|0;if((p|0)<(v|0)){if((y|0)<(v|0)){do if((o|0)<(v|0)){if((v|0)!=0?(c[7182]=(c[7182]|0)+1,D=xb((v<<2|3)+16|0)|0,(D|0)!=0):0){c[(D+4+15&-16)+-4>>2]=D;j=D+4+15&-16}else j=0;if((y|0)<=0){if(!f){o=v;f=j;n=j;break}}else{h=0;do{c[j+(h<<2)>>2]=c[f+(h<<2)>>2];h=h+1|0}while((h|0)!=(y|0))}c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);o=v;f=j;n=j}while(0);m=v<<2;mk(f+(y<<2)|0,0,m-(y<<2)|0)|0;if((x|0)<(v|0)){do if((w|0)<(v|0)){do if(!v)j=0;else{c[7182]=(c[7182]|0)+1;h=xb((m|3)+16|0)|0;if(!h){j=0;break}c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}while(0);if((x|0)<=0){if(!e){k=v;e=j;h=j;break}}else{h=0;do{c[j+(h<<2)>>2]=c[e+(h<<2)>>2];h=h+1|0}while((h|0)!=(x|0))}c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);k=v;e=j;h=j}else{k=w;h=l}while(0);mk(e+(x<<2)|0,0,m-(x<<2)|0)|0;l=h}else k=w;if((v|0)>0){mk(n|0,-1,m|0)|0;mk(l|0,-1,m|0)|0}if((y|0)>0){j=v+-1|0;h=0;do{H=c[g+(h<<3)>>2]|0;H=((10?H+~(H<<15)>>10:H+~(H<<15)|0)^H+~(H<<15))*9|0;H=(6?H>>6:H)^H;H=f+((((16?H+~(H<<11)>>16:H+~(H<<11)|0)^H+~(H<<11))&j)<<2)|0;c[e+(h<<2)>>2]=c[H>>2];c[H>>2]=h;h=h+1|0}while((h|0)!=(y|0));j=v;m=v;h=n}else{j=v;m=v;h=n}}else{j=y;m=x;k=w;h=n}p=t&v+-1}else{p=m;j=y;m=x;k=w;h=n}p=f+(p<<2)|0;c[e+(q<<2)>>2]=c[p>>2];c[p>>2]=q;q=u;p=v;n=h}Va[c[(c[z>>2]|0)+60>>2]&127](z,b);h=c[a+8>>2]|0}i=i+1|0;if((i|0)>=(h|0))break;y=j;x=m;w=k}if(g|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}if(!f)return;c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);return}function Bc(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;g=c[a+108>>2]|0;if(g|0)Za[c[(c[g>>2]|0)+12>>2]&127](g,c[d+60>>2]|0,f);o=c[d+12>>2]|0;m=c[a+60>>2]|0;n=c[a+92>>2]|0;if(!(Fa[c[(c[n>>2]|0)+56>>2]&127](n)|0)){n=c[a+92>>2]|0;Za[c[(c[n>>2]|0)+16>>2]&127](n,m+((o&65535)<<6)|0,f)}n=e[a+56>>1]|0;d=c[a+60>>2]|0;b[d+54>>1]=(e[d+54>>1]|0)+65534;b[d+56>>1]=(e[d+56>>1]|0)+65534;b[d+58>>1]=(e[d+58>>1]|0)+65534;l=c[a+68>>2]|0;g=b[a+6>>1]|0;f=e[m+((o&65535)<<6)+54>>1]|0;b[l+(f<<2)>>1]=g;h=b[l+(f<<2)+6>>1]|0;if(!(h<<16>>16))f=l;else{j=d+((e[l+(f<<2)+2>>1]|0)<<6)+54|0;i=l+(f<<2)|0;while(1){f=i;i=i+4|0;d=b[i>>1]|0;if((g&65535)<(d&65535))break;g=c[a+60>>2]|0;k=h&65535;d=(d&1)==0?g+(k<<6)+48|0:g+(k<<6)+54|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[j>>1]=(b[j>>1]|0)+1<<16>>16;d=e[f>>1]|e[f+2>>1]<<16;k=e[i>>1]|e[i+2>>1]<<16;b[f>>1]=k;b[f+2>>1]=k>>>16;b[i>>1]=d;b[i+2>>1]=d>>>16;h=b[f+10>>1]|0;if(!(h<<16>>16))break;else g=d&65535}g=b[a+6>>1]|0;f=c[a+68>>2]|0}d=e[m+((o&65535)<<6)+48>>1]|0;b[l+(d<<2)>>1]=g;i=f+(d<<2)|0;h=b[i+6>>1]|0;if(h<<16>>16){k=(c[a+60>>2]|0)+((e[f+(d<<2)+2>>1]|0)<<6)+48|0;j=i;f=b[i>>1]|0;while(1){g=j;j=j+4|0;d=b[j>>1]|0;if((f&65535)<(d&65535))break;f=c[a+60>>2]|0;i=h&65535;d=(d&1)==0?f+(i<<6)+48|0:f+(i<<6)+54|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[k>>1]=(b[k>>1]|0)+1<<16>>16;d=e[g>>1]|e[g+2>>1]<<16;i=e[j>>1]|e[j+2>>1]<<16;b[g>>1]=i;b[g+2>>1]=i>>>16;b[j>>1]=d;b[j+2>>1]=d>>>16;h=b[g+10>>1]|0;if(!(h<<16>>16))break;else f=d&65535}g=b[a+6>>1]|0}b[l+((n<<1)+-1<<2)+2>>1]=0;b[l+((n<<1)+-1<<2)>>1]=g;l=c[a+72>>2]|0;d=e[m+((o&65535)<<6)+56>>1]|0;b[l+(d<<2)>>1]=g;f=b[l+(d<<2)+6>>1]|0;if(!(f<<16>>16))f=l;else{j=(c[a+60>>2]|0)+((e[l+(d<<2)+2>>1]|0)<<6)+56|0;i=l+(d<<2)|0;while(1){h=i;i=i+4|0;d=b[i>>1]|0;if((g&65535)<(d&65535))break;g=c[a+60>>2]|0;k=f&65535;d=(d&1)==0?g+(k<<6)+50|0:g+(k<<6)+56|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[j>>1]=(b[j>>1]|0)+1<<16>>16;d=e[h>>1]|e[h+2>>1]<<16;k=e[i>>1]|e[i+2>>1]<<16;b[h>>1]=k;b[h+2>>1]=k>>>16;b[i>>1]=d;b[i+2>>1]=d>>>16;f=b[h+10>>1]|0;if(!(f<<16>>16))break;else g=d&65535}g=b[a+6>>1]|0;f=c[a+72>>2]|0}d=e[m+((o&65535)<<6)+50>>1]|0;b[l+(d<<2)>>1]=g;h=f+(d<<2)|0;i=b[h+6>>1]|0;if(i<<16>>16){k=(c[a+60>>2]|0)+((e[f+(d<<2)+2>>1]|0)<<6)+50|0;j=h;f=b[h>>1]|0;h=i;while(1){g=j;j=j+4|0;d=b[j>>1]|0;if((f&65535)<(d&65535))break;f=c[a+60>>2]|0;i=h&65535;d=(d&1)==0?f+(i<<6)+50|0:f+(i<<6)+56|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[k>>1]=(b[k>>1]|0)+1<<16>>16;d=e[g>>1]|e[g+2>>1]<<16;i=e[j>>1]|e[j+2>>1]<<16;b[g>>1]=i;b[g+2>>1]=i>>>16;b[j>>1]=d;b[j+2>>1]=d>>>16;h=b[g+10>>1]|0;if(!(h<<16>>16))break;else f=d&65535}g=b[a+6>>1]|0}b[l+((n<<1)+-1<<2)+2>>1]=0;b[l+((n<<1)+-1<<2)>>1]=g;l=c[a+76>>2]|0;d=e[m+((o&65535)<<6)+58>>1]|0;b[l+(d<<2)>>1]=g;f=b[l+(d<<2)+6>>1]|0;if(!(f<<16>>16))f=l;else{j=(c[a+60>>2]|0)+((e[l+(d<<2)+2>>1]|0)<<6)+58|0;i=l+(d<<2)|0;while(1){h=i;i=i+4|0;d=b[i>>1]|0;if((g&65535)<(d&65535))break;g=c[a+60>>2]|0;k=f&65535;d=(d&1)==0?g+(k<<6)+52|0:g+(k<<6)+58|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[j>>1]=(b[j>>1]|0)+1<<16>>16;d=e[h>>1]|e[h+2>>1]<<16;k=e[i>>1]|e[i+2>>1]<<16;b[h>>1]=k;b[h+2>>1]=k>>>16;b[i>>1]=d;b[i+2>>1]=d>>>16;f=b[h+10>>1]|0;if(!(f<<16>>16))break;else g=d&65535}g=b[a+6>>1]|0;f=c[a+76>>2]|0}d=e[m+((o&65535)<<6)+52>>1]|0;b[l+(d<<2)>>1]=g;h=f+(d<<2)|0;i=b[h+6>>1]|0;if(!(i<<16>>16)){k=g;m=l+((n<<1)+-1<<2)+2|0;b[m>>1]=0;m=l+((n<<1)+-1<<2)|0;b[m>>1]=k;m=c[a+60>>2]|0;n=a+64|0;l=b[n>>1]|0;m=m+((o&65535)<<6)+48|0;b[m>>1]=l;b[n>>1]=o;o=b[a+56>>1]|0;o=o+-1<<16>>16;b[a+56>>1]=o;return}k=(c[a+60>>2]|0)+((e[f+(d<<2)+2>>1]|0)<<6)+52|0;j=h;f=b[h>>1]|0;h=i;while(1){g=j;j=j+4|0;d=b[j>>1]|0;if((f&65535)<(d&65535))break;i=c[a+60>>2]|0;m=h&65535;d=(d&1)==0?i+(m<<6)+52|0:i+(m<<6)+58|0;b[d>>1]=(b[d>>1]|0)+-1<<16>>16;b[k>>1]=(b[k>>1]|0)+1<<16>>16;d=e[g>>1]|e[g+2>>1]<<16;m=e[j>>1]|e[j+2>>1]<<16;b[g>>1]=m;b[g+2>>1]=m>>>16;b[j>>1]=d;b[j+2>>1]=d>>>16;h=b[g+10>>1]|0;if(!(h<<16>>16))break;else f=d&65535}k=b[a+6>>1]|0;m=l+((n<<1)+-1<<2)+2|0;b[m>>1]=0;m=l+((n<<1)+-1<<2)|0;b[m>>1]=k;m=c[a+60>>2]|0;n=a+64|0;l=b[n>>1]|0;m=m+((o&65535)<<6)+48|0;b[m>>1]=l;b[n>>1]=o;o=b[a+56>>1]|0;o=o+-1<<16>>16;b[a+56>>1]=o;return}function Cc(d,e){d=d|0;e=e|0;var f=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=sa;sa=sa+64|0;g[d+20>>2]=+h[e+32>>3];g[d+24>>2]=+h[e+40>>3];g[d+28>>2]=+h[e+48>>3];g[d+32>>2]=+h[e+56>>3];g[d+4>>2]=+h[e>>3];g[d+8>>2]=+h[e+8>>3];g[d+12>>2]=+h[e+16>>3];g[d+16>>2]=+h[e+24>>3];g[d+36>>2]=+h[e+64>>3];g[d+40>>2]=+h[e+72>>3];g[d+44>>2]=+h[e+80>>3];g[d+48>>2]=+h[e+88>>3];c[d+56>>2]=c[e+96>>2];a[d+60>>0]=(c[e+100>>2]|0)!=0&1;o=c[e+104>>2]|0;k=p;m=k+64|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(m|0));n=c[d+88>>2]|0;if((n|0)<(o|0)){if((c[d+92>>2]|0)<(o|0)){if(!o){f=0;j=n}else{c[7182]=(c[7182]|0)+1;f=xb(o<<6|19)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=c[d+88>>2]|0}if((j|0)>0){i=0;do{k=f+(i<<6)|0;l=(c[d+96>>2]|0)+(i<<6)|0;m=k+64|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(m|0));i=i+1|0}while((i|0)!=(j|0))}i=c[d+96>>2]|0;if(i|0){if(a[d+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[d+96>>2]=0}a[d+100>>0]=1;c[d+96>>2]=f;c[d+92>>2]=o;i=d+96|0}else i=d+96|0;f=n;do{k=(c[i>>2]|0)+(f<<6)|0;l=p;m=k+64|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(m|0));f=f+1|0}while((f|0)!=(o|0))}c[d+88>>2]=o;if((o|0)>0){j=c[d+96>>2]|0;f=c[e+112>>2]|0;i=0;while(1){g[j+(i<<6)+16>>2]=+h[f+32>>3];g[j+(i<<6)+20>>2]=+h[f+40>>3];g[j+(i<<6)+24>>2]=+h[f+48>>3];g[j+(i<<6)+28>>2]=+h[f+56>>3];g[j+(i<<6)>>2]=+h[f>>3];g[j+(i<<6)+4>>2]=+h[f+8>>3];g[j+(i<<6)+8>>2]=+h[f+16>>3];g[j+(i<<6)+12>>2]=+h[f+24>>3];c[j+(i<<6)+32>>2]=c[f+64>>2];c[j+(i<<6)+36>>2]=c[f+68>>2];c[j+(i<<6)+40>>2]=c[f+72>>2];i=i+1|0;if((i|0)==(o|0))break;else f=f+80|0}}l=c[e+108>>2]|0;c[p>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;k=c[d+128>>2]|0;if((k|0)<(l|0)){if((c[d+132>>2]|0)<(l|0)){if(!l){f=0;j=k}else{c[7182]=(c[7182]|0)+1;f=xb((l<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=c[d+128>>2]|0}if((j|0)>0){i=0;do{o=f+(i<<4)|0;n=(c[d+136>>2]|0)+(i<<4)|0;c[o>>2]=c[n>>2];c[o+4>>2]=c[n+4>>2];c[o+8>>2]=c[n+8>>2];c[o+12>>2]=c[n+12>>2];i=i+1|0}while((i|0)!=(j|0))}i=c[d+136>>2]|0;if(i|0){if(a[d+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[d+136>>2]=0}a[d+140>>0]=1;c[d+136>>2]=f;c[d+132>>2]=l;i=d+136|0}else i=d+136|0;f=k;do{o=(c[i>>2]|0)+(f<<4)|0;c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];f=f+1|0}while((f|0)!=(l|0))}c[d+128>>2]=l;if((l|0)>0){j=c[d+136>>2]|0;f=0;i=c[e+116>>2]|0;while(1){c[j+(f<<4)+12>>2]=c[i+12>>2];b[j+(f<<4)+6>>1]=b[i+6>>1]|0;b[j+(f<<4)+8>>1]=b[i+8>>1]|0;b[j+(f<<4)+10>>1]=b[i+10>>1]|0;b[j+(f<<4)>>1]=b[i>>1]|0;b[j+(f<<4)+2>>1]=b[i+2>>1]|0;b[j+(f<<4)+4>>1]=b[i+4>>1]|0;f=f+1|0;if((f|0)==(l|0))break;else i=i+16|0}}c[d+144>>2]=c[e+120>>2];l=c[e+124>>2]|0;k=c[d+152>>2]|0;if((k|0)<(l|0)){if((c[d+156>>2]|0)<(l|0)){if(!l){f=0;j=k}else{c[7182]=(c[7182]|0)+1;f=xb(l<<5|19)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}j=c[d+152>>2]|0}if((j|0)>0){i=0;do{o=f+(i<<5)|0;n=(c[d+160>>2]|0)+(i<<5)|0;c[o>>2]=c[n>>2];c[o+4>>2]=c[n+4>>2];c[o+8>>2]=c[n+8>>2];c[o+12>>2]=c[n+12>>2];c[o+16>>2]=c[n+16>>2];c[o+20>>2]=c[n+20>>2];c[o+24>>2]=c[n+24>>2];c[o+28>>2]=c[n+28>>2];i=i+1|0}while((i|0)!=(j|0))}i=c[d+160>>2]|0;if(i|0){if(a[d+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[d+160>>2]=0}a[d+164>>0]=1;c[d+160>>2]=f;c[d+156>>2]=l;i=d+160|0}else i=d+160|0;f=k;do{o=(c[i>>2]|0)+(f<<5)|0;c[o>>2]=c[p>>2];c[o+4>>2]=c[p+4>>2];c[o+8>>2]=c[p+8>>2];c[o+12>>2]=c[p+12>>2];c[o+16>>2]=c[p+16>>2];c[o+20>>2]=c[p+20>>2];c[o+24>>2]=c[p+24>>2];c[o+28>>2]=c[p+28>>2];f=f+1|0}while((f|0)!=(l|0))}c[d+152>>2]=l;if((l|0)<=0){sa=p;return}j=c[d+160>>2]|0;i=0;f=c[e+128>>2]|0;while(1){b[j+(i<<5)+6>>1]=b[f+14>>1]|0;b[j+(i<<5)+8>>1]=b[f+16>>1]|0;b[j+(i<<5)+10>>1]=b[f+18>>1]|0;b[j+(i<<5)>>1]=b[f+8>>1]|0;b[j+(i<<5)+2>>1]=b[f+10>>1]|0;b[j+(i<<5)+4>>1]=b[f+12>>1]|0;c[j+(i<<5)+12>>2]=c[f>>2];c[j+(i<<5)+16>>2]=c[f+4>>2];i=i+1|0;if((i|0)==(l|0))break;else f=f+20|0}sa=p;return}function Dc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,h=0,i=0,j=0,k=0.0,l=0.0,m=0.0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0.0,S=0.0,T=0.0,U=0.0,V=0.0,W=0,X=0,Y=0;Y=c[d+36>>2]|0;W=c[e+36>>2]|0;K=+g[Y+8>>2];M=+g[Y+12>>2];L=+g[Y+16>>2];h=c[W+8>>2]|0;Q=+g[h+8>>2];R=+g[h+12>>2];S=+g[h+16>>2];d=c[W+12>>2]|0;N=+g[d+8>>2];O=+g[d+12>>2];P=+g[d+16>>2];e=c[W+16>>2]|0;T=+g[e+8>>2];U=+g[e+12>>2];V=+g[e+16>>2];s=N-K-(Q-K);A=O-M-(R-M);u=P-L-(S-L);t=A*(V-L-(S-L))-u*(U-M-(R-M));B=u*(T-K-(Q-K))-s*(V-L-(S-L));v=s*(U-M-(R-M))-A*(T-K-(Q-K));do if(v*v+(t*t+B*B)>1.1920928955078125e-07?(D=1.0/+x(+(v*v+(t*t+B*B))),E=(S-L)*v*D+((Q-K)*t*D+(R-M)*B*D),E*E<3402823466385288598117041.0e14):0){f=Q-K-t*D*E;k=R-M-B*D*E;m=S-L-v*D*E;n=N-K-t*D*E;q=O-M-B*D*E;r=P-L-v*D*E;if((v*(q*f-k*n)+(t*(k*r-m*q)+B*(m*n-r*f))>0.0?(w=T-K-t*D*E,y=U-M-B*D*E,z=V-L-v*D*E,v*(y*n-q*w)+(t*(q*z-r*y)+B*(r*w-z*n))>0.0):0)?v*(k*w-y*f)+(t*(y*m-z*k)+B*(z*f-m*w))>0.0:0){p=E*E;n=t*D*E;m=v*D*E;l=B*D*E;break}if(s*s+A*A+u*u>1.1920928955078125e-07?(C=-((Q-K)*s+(R-M)*A+(S-L)*u)/(s*s+A*A+u*u),C=C<0.0?0.0:C>1.0?1.0:C,p=(S-L+u*C)*(S-L+u*C)+((Q-K+s*C)*(Q-K+s*C)+(R-M+A*C)*(R-M+A*C)),p<3402823466385288598117041.0e14):0){n=Q-K+s*C;m=S-L+u*C;k=R-M+A*C}else{p=3402823466385288598117041.0e14;n=0.0;m=0.0;k=0.0}f=(T-K-(N-K))*(T-K-(N-K))+(U-M-(O-M))*(U-M-(O-M))+(V-L-(P-L))*(V-L-(P-L));if(f>1.1920928955078125e-07?(G=-((N-K)*(T-K-(N-K))+(O-M)*(U-M-(O-M))+(P-L)*(V-L-(P-L)))/f,G=G<0.0?0.0:G>1.0?1.0:G,F=N-K+(T-K-(N-K))*G,H=O-M+(U-M-(O-M))*G,G=P-L+(V-L-(P-L))*G,G*G+(F*F+H*H)1.1920928955078125e-07?(J=-((T-K)*(Q-K-(T-K))+(U-M)*(R-M-(U-M))+(V-L)*(S-L-(V-L)))/f,J=J<0.0?0.0:J>1.0?1.0:J,I=T-K+(Q-K-(T-K))*J,l=U-M+(R-M-(U-M))*J,J=V-L+(S-L-(V-L))*J,J*J+(I*I+l*l)>2];J=M-+g[Y+28>>2];u=L-+g[Y+32>>2];u=+g[b+12>>2]+ +x(+(I*I+J*J+u*u))*2.0;if(!(p>2];V=+g[h+88>>2];f=+g[d+88>>2];U=+g[e+88>>2];f=!(V<=0.0)&!(f<=0.0)&!(U<=0.0)?U*t*(1.0/(r+(t+s)))+(V*s*(1.0/(r+(t+s)))+f*r*(1.0/(r+(t+s)))):0.0;if(!(k+f>0.0))return;V=1.0/-+x(+p);q=n*V;p=V*l;n=V*m;o=c[b+4>>2]|0;d=c[b+8>>2]|0;m=+g[o+316>>2];l=+g[d+316>>2];l=m>l?m:l;m=k/(k+f)*+g[o+332>>2];f=f/(k+f)*+g[d+332>>2];d=c[o+832>>2]|0;if((d|0)==(c[o+836>>2]|0)?(X=(d|0)==0?1:d<<1,(d|0)<(X|0)):0){if(!X)j=0;else{c[7182]=(c[7182]|0)+1;d=xb((X*56|3)+16|0)|0;if(!d)d=0;else{c[(d+4+15&-16)+-4>>2]=d;d=d+4+15&-16}j=d;d=c[o+832>>2]|0}if((d|0)>0){e=0;do{h=j+(e*56|0)|0;b=(c[o+840>>2]|0)+(e*56|0)|0;i=h+56|0;do{c[h>>2]=c[b>>2];h=h+4|0;b=b+4|0}while((h|0)<(i|0));e=e+1|0}while((e|0)!=(d|0))}d=c[o+840>>2]|0;if(d|0){if(a[o+844>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[o+840>>2]=0}a[o+844>>0]=1;c[o+840>>2]=j;c[o+836>>2]=X;d=c[o+832>>2]|0}X=c[o+840>>2]|0;c[X+(d*56|0)>>2]=Y;c[X+(d*56|0)+4>>2]=W;g[X+(d*56|0)+8>>2]=s*(1.0/(r+(t+s)));g[X+(d*56|0)+12>>2]=r*(1.0/(r+(t+s)));g[X+(d*56|0)+16>>2]=t*(1.0/(r+(t+s)));g[X+(d*56|0)+20>>2]=0.0;g[X+(d*56|0)+24>>2]=q;g[X+(d*56|0)+28>>2]=p;g[X+(d*56|0)+32>>2]=n;g[X+(d*56|0)+36>>2]=0.0;g[X+(d*56|0)+40>>2]=u;g[X+(d*56|0)+44>>2]=l;g[X+(d*56|0)+48>>2]=m;g[X+(d*56|0)+52>>2]=f;c[o+832>>2]=(c[o+832>>2]|0)+1;return}function Ec(b,d){b=b|0;d=+d;var e=0,f=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=sa;sa=sa+1136|0;h=c[b+44>>2]|0;h=Fa[c[(c[h>>2]|0)+84>>2]&127](h)|0;if((h|0)>0){e=0;f=42;while(1){o=c[b+44>>2]|0;Za[c[(c[o>>2]|0)+88>>2]&127](o,e,q);ce();o=24464+(f<<4)|0;c[o>>2]=c[q>>2];c[o+4>>2]=c[q+4>>2];c[o+8>>2]=c[q+8>>2];c[o+12>>2]=c[q+12>>2];e=e+1|0;if((e|0)==(h|0))break;else f=f+1|0}f=h+42|0}else f=42;e=0;do{o=c[b+44>>2]|0;n=c[(c[o>>2]|0)+64>>2]|0;ce();Za[n&127](q+1104|0,o,24464+(e<<4)|0);o=q+(e<<4)|0;c[o>>2]=c[q+1104>>2];c[o+4>>2]=c[q+1104+4>>2];c[o+8>>2]=c[q+1104+8>>2];c[o+12>>2]=c[q+1104+12>>2];e=e+1|0}while(e>>>0>>0);g[q+1104+16>>2]=1.0000000474974513e-03;c[q+1104+20>>2]=4096;c[q+1104+24>>2]=4096;c[q+1104>>2]=1;c[q+1104+4>>2]=f;c[q+1104+8>>2]=q;c[q+1104+12>>2]=16;a[q+1064+16>>0]=1;c[q+1064+12>>2]=0;c[q+1064+4>>2]=0;c[q+1064+8>>2]=0;a[q+1064+36>>0]=1;c[q+1064+32>>2]=0;c[q+1064+24>>2]=0;c[q+1064+28>>2]=0;a[q+1008+24>>0]=1;o=q+1008+20|0;c[o>>2]=0;c[q+1008+12>>2]=0;c[q+1008+16>>2]=0;m=q+1008+52|0;a[m>>0]=1;n=q+1008+48|0;c[n>>2]=0;c[q+1008+40>>2]=0;c[q+1008+44>>2]=0;a[q+1008>>0]=1;l=q+1008+4|0;c[l>>2]=0;c[q+1008+28>>2]=0;c[q+1008+32>>2]=0;if((ob(q+1064|0,q+1104|0,q+1008|0)|0)!=1){j=c[l>>2]|0;i=c[b+4>>2]|0;if((i|0)<(j|0)){if((c[b+8>>2]|0)<(j|0)){if(!j){e=0;h=i}else{c[7182]=(c[7182]|0)+1;e=xb((j<<4|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+4>>2]|0}if((h|0)>0){f=0;do{k=e+(f<<4)|0;r=(c[b+12>>2]|0)+(f<<4)|0;c[k>>2]=c[r>>2];c[k+4>>2]=c[r+4>>2];c[k+8>>2]=c[r+8>>2];c[k+12>>2]=c[r+12>>2];f=f+1|0}while((f|0)!=(h|0))}f=c[b+12>>2]|0;if(f|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=j;f=b+12|0}else f=b+12|0;e=i;do{r=(c[f>>2]|0)+(e<<4)|0;c[r>>2]=c[q+992>>2];c[r+4>>2]=c[q+992+4>>2];c[r+8>>2]=c[q+992+8>>2];c[r+12>>2]=c[q+992+12>>2];e=e+1|0}while((e|0)!=(j|0));e=c[l>>2]|0}else e=j;c[b+4>>2]=j;if((e|0)>0){f=c[o>>2]|0;e=0;do{k=f+(e<<4)|0;r=(c[b+12>>2]|0)+(e<<4)|0;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];c[r+8>>2]=c[k+8>>2];c[r+12>>2]=c[k+12>>2];e=e+1|0}while((e|0)<(c[l>>2]|0))}k=c[q+1008+32>>2]|0;c[b+40>>2]=k;j=c[b+24>>2]|0;if((k|0)>(j|0)){do if((c[b+28>>2]|0)<(k|0)){if(!k){e=0;h=j}else{c[7182]=(c[7182]|0)+1;e=xb((k<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}h=c[b+24>>2]|0}i=c[b+32>>2]|0;if((h|0)<=0){if(!i){a[b+36>>0]=1;c[b+32>>2]=e;c[b+28>>2]=k;break}}else{f=0;do{c[e+(f<<2)>>2]=c[i+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0))}if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}a[b+36>>0]=1;c[b+32>>2]=e;c[b+28>>2]=k}else e=c[b+32>>2]|0;while(0);mk(e+(j<<2)|0,0,k-j<<2|0)|0;e=c[b+40>>2]|0}else e=k;c[b+24>>2]=k;if((e|0)>0){f=c[n>>2]|0;h=c[b+32>>2]|0;e=0;do{c[h+(e<<2)>>2]=c[f+(e<<2)>>2];e=e+1|0}while((e|0)<(c[b+40>>2]|0))}if(c[q+1008+12>>2]|0){c[l>>2]=0;e=c[o>>2]|0;if(e|0){if(a[q+1008+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[o>>2]=0}a[q+1008+24>>0]=1;c[o>>2]=0;c[q+1008+12>>2]=0;c[q+1008+16>>2]=0}if(!(c[q+1008+40>>2]|0)){f=1;p=60}else{c[q+1008+32>>2]=0;e=c[n>>2]|0;if(e|0){if(a[m>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[n>>2]=0}a[m>>0]=1;c[n>>2]=0;c[q+1008+40>>2]=0;c[q+1008+44>>2]=0;f=1}}else{f=0;p=60}if((p|0)==60){e=c[n>>2]|0;if(e){if(a[m>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[n>>2]=0}}a[m>>0]=1;c[n>>2]=0;c[q+1008+40>>2]=0;c[q+1008+44>>2]=0;e=c[o>>2]|0;if(e|0){if(a[q+1008+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[o>>2]=0}e=c[q+1064+32>>2]|0;if(e|0){if(a[q+1064+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[q+1064+32>>2]=0}a[q+1064+36>>0]=1;c[q+1064+32>>2]=0;c[q+1064+24>>2]=0;c[q+1064+28>>2]=0;e=c[q+1064+12>>2]|0;if(!e){sa=q;return f|0}if(a[q+1064+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[q+1064+12>>2]=0;sa=q;return f|0}function Fc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0;c[b>>2]=5940;d=c[b+192>>2]|0;if(d|0)Pa[c[(c[d>>2]|0)+4>>2]&511](d);a:do if((c[b+1112>>2]|0)>0)do{h=c[c[b+1120>>2]>>2]|0;d=c[h+348>>2]|0;if(d|0){sg(b+1048|0,d)|0;e=c[b+1052>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[b+1052>>2]=d;c[b+1060>>2]=(c[b+1060>>2]|0)+-1}d=c[h+52>>2]|0;if(d|0){if(a[h+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[h+52>>2]=0}a[h+56>>0]=1;c[h+52>>2]=0;c[h+44>>2]=0;c[h+48>>2]=0;d=c[h+32>>2]|0;if(d|0){if(a[h+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[h+32>>2]=0}a[h+36>>0]=1;c[h+32>>2]=0;c[h+24>>2]=0;c[h+28>>2]=0;d=c[h+12>>2]|0;if(d|0){if(a[h+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[h+12>>2]=0}a[h+16>>0]=1;c[h+12>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);d=c[b+1112>>2]|0;if((d|0)<=0)break a;g=c[b+1120>>2]|0;e=0;do{f=g+(e<<2)|0;if((c[f>>2]|0)==(h|0)){i=25;break}e=e+1|0}while((e|0)<(d|0));if((i|0)==25){i=0;if((e|0)<(d|0)){c[f>>2]=c[g+(d+-1<<2)>>2];c[(c[b+1120>>2]|0)+(d+-1<<2)>>2]=h;c[b+1112>>2]=d+-1;d=d+-1|0}}}while((d|0)>0);while(0);d=c[b+872>>2]|0;if((d|0)>0){f=0;do{e=c[(c[b+880>>2]|0)+(f<<2)>>2]|0;if(e){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+872>>2]|0}f=f+1|0}while((f|0)<(d|0))}d=c[b+852>>2]|0;if((d|0)>0){f=0;do{e=c[(c[b+860>>2]|0)+(f<<2)>>2]|0;if(e){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0);d=c[b+852>>2]|0}f=f+1|0}while((f|0)<(d|0))}d=c[b+1244>>2]|0;if(d|0){if(a[b+1248>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+1244>>2]=0}a[b+1248>>0]=1;c[b+1244>>2]=0;c[b+1236>>2]=0;c[b+1240>>2]=0;d=c[b+1140>>2]|0;if(d|0){if(a[b+1144>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+1140>>2]=0}a[b+1144>>0]=1;c[b+1140>>2]=0;c[b+1132>>2]=0;c[b+1136>>2]=0;d=c[b+1120>>2]|0;if(d|0){if(a[b+1124>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+1120>>2]=0}a[b+1124>>0]=1;c[b+1120>>2]=0;c[b+1112>>2]=0;c[b+1116>>2]=0;yh(b+1048|0);yh(b+988|0);yh(b+928|0);d=c[b+880>>2]|0;if(d|0){if(a[b+884>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+880>>2]=0}a[b+884>>0]=1;c[b+880>>2]=0;c[b+872>>2]=0;c[b+876>>2]=0;d=c[b+860>>2]|0;if(d|0){if(a[b+864>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+860>>2]=0}a[b+864>>0]=1;c[b+860>>2]=0;c[b+852>>2]=0;c[b+856>>2]=0;d=c[b+840>>2]|0;if(d|0){if(a[b+844>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+840>>2]=0}a[b+844>>0]=1;c[b+840>>2]=0;c[b+832>>2]=0;c[b+836>>2]=0;d=c[b+820>>2]|0;if(d|0){if(a[b+824>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+820>>2]=0}a[b+824>>0]=1;c[b+820>>2]=0;c[b+812>>2]=0;c[b+816>>2]=0;d=c[b+800>>2]|0;if(d|0){if(a[b+804>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+800>>2]=0}a[b+804>>0]=1;c[b+800>>2]=0;c[b+792>>2]=0;c[b+796>>2]=0;d=c[b+780>>2]|0;if(d|0){if(a[b+784>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+780>>2]=0}a[b+784>>0]=1;c[b+780>>2]=0;c[b+772>>2]=0;c[b+776>>2]=0;d=c[b+760>>2]|0;if(d|0){if(a[b+764>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+760>>2]=0}a[b+764>>0]=1;c[b+760>>2]=0;c[b+752>>2]=0;c[b+756>>2]=0;d=c[b+740>>2]|0;if(d|0){if(a[b+744>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+740>>2]=0}a[b+744>>0]=1;c[b+740>>2]=0;c[b+732>>2]=0;c[b+736>>2]=0;d=c[b+720>>2]|0;if(d|0){if(a[b+724>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+720>>2]=0}a[b+724>>0]=1;c[b+720>>2]=0;c[b+712>>2]=0;c[b+716>>2]=0;d=c[b+700>>2]|0;if(d|0){if(a[b+704>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+700>>2]=0}a[b+704>>0]=1;c[b+700>>2]=0;c[b+692>>2]=0;c[b+696>>2]=0;d=c[b+512>>2]|0;if(d|0){if(a[b+516>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+512>>2]=0}a[b+516>>0]=1;c[b+512>>2]=0;c[b+504>>2]=0;c[b+508>>2]=0;d=c[b+492>>2]|0;if(d|0){if(a[b+496>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+492>>2]=0}a[b+496>>0]=1;c[b+492>>2]=0;c[b+484>>2]=0;c[b+488>>2]=0;wu(b+288|0);d=c[b+276>>2]|0;if(!d){a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;i=b+272|0;c[i>>2]=0;c[b>>2]=7816;return}if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+276>>2]=0;a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;i=b+272|0;c[i>>2]=0;c[b>>2]=7816;return}function Gc(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;n=sa;sa=sa+64|0;c[d+20>>2]=c[e+16>>2];c[d+24>>2]=c[e+20>>2];c[d+28>>2]=c[e+24>>2];c[d+32>>2]=c[e+28>>2];c[d+4>>2]=c[e>>2];c[d+8>>2]=c[e+4>>2];c[d+12>>2]=c[e+8>>2];c[d+16>>2]=c[e+12>>2];c[d+36>>2]=c[e+32>>2];c[d+40>>2]=c[e+36>>2];c[d+44>>2]=c[e+40>>2];c[d+48>>2]=c[e+44>>2];c[d+56>>2]=c[e+48>>2];a[d+60>>0]=(c[e+52>>2]|0)!=0&1;m=c[e+56>>2]|0;i=n;k=i+64|0;do{c[i>>2]=0;i=i+4|0}while((i|0)<(k|0));l=c[d+88>>2]|0;if((l|0)<(m|0)){if((c[d+92>>2]|0)<(m|0)){if(!m){f=0;h=l}else{c[7182]=(c[7182]|0)+1;f=xb(m<<6|19)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[d+88>>2]|0}if((h|0)>0){g=0;do{i=f+(g<<6)|0;j=(c[d+96>>2]|0)+(g<<6)|0;k=i+64|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0}while((i|0)<(k|0));g=g+1|0}while((g|0)!=(h|0))}g=c[d+96>>2]|0;if(g|0){if(a[d+100>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[d+96>>2]=0}a[d+100>>0]=1;c[d+96>>2]=f;c[d+92>>2]=m;g=d+96|0}else g=d+96|0;f=l;do{i=(c[g>>2]|0)+(f<<6)|0;j=n;k=i+64|0;do{c[i>>2]=c[j>>2];i=i+4|0;j=j+4|0}while((i|0)<(k|0));f=f+1|0}while((f|0)!=(m|0))}c[d+88>>2]=m;if((m|0)>0){h=c[d+96>>2]|0;f=c[e+64>>2]|0;g=0;while(1){c[h+(g<<6)+16>>2]=c[f+16>>2];c[h+(g<<6)+20>>2]=c[f+20>>2];c[h+(g<<6)+24>>2]=c[f+24>>2];c[h+(g<<6)+28>>2]=c[f+28>>2];c[h+(g<<6)>>2]=c[f>>2];c[h+(g<<6)+4>>2]=c[f+4>>2];c[h+(g<<6)+8>>2]=c[f+8>>2];c[h+(g<<6)+12>>2]=c[f+12>>2];c[h+(g<<6)+32>>2]=c[f+32>>2];c[h+(g<<6)+36>>2]=c[f+36>>2];c[h+(g<<6)+40>>2]=c[f+40>>2];g=g+1|0;if((g|0)==(m|0))break;else f=f+48|0}}j=c[e+60>>2]|0;c[n>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[n+12>>2]=0;i=c[d+128>>2]|0;if((i|0)<(j|0)){if((c[d+132>>2]|0)<(j|0)){if(!j){f=0;h=i}else{c[7182]=(c[7182]|0)+1;f=xb((j<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[d+128>>2]|0}if((h|0)>0){g=0;do{m=f+(g<<4)|0;l=(c[d+136>>2]|0)+(g<<4)|0;c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];g=g+1|0}while((g|0)!=(h|0))}g=c[d+136>>2]|0;if(g|0){if(a[d+140>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[d+136>>2]=0}a[d+140>>0]=1;c[d+136>>2]=f;c[d+132>>2]=j;g=d+136|0}else g=d+136|0;f=i;do{m=(c[g>>2]|0)+(f<<4)|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];f=f+1|0}while((f|0)!=(j|0))}c[d+128>>2]=j;if((j|0)>0){h=c[d+136>>2]|0;f=0;g=c[e+68>>2]|0;while(1){c[h+(f<<4)+12>>2]=c[g+12>>2];b[h+(f<<4)+6>>1]=b[g+6>>1]|0;b[h+(f<<4)+8>>1]=b[g+8>>1]|0;b[h+(f<<4)+10>>1]=b[g+10>>1]|0;b[h+(f<<4)>>1]=b[g>>1]|0;b[h+(f<<4)+2>>1]=b[g+2>>1]|0;b[h+(f<<4)+4>>1]=b[g+4>>1]|0;f=f+1|0;if((f|0)==(j|0))break;else g=g+16|0}}c[d+144>>2]=c[e+76>>2];j=c[e+80>>2]|0;i=c[d+152>>2]|0;if((i|0)<(j|0)){if((c[d+156>>2]|0)<(j|0)){if(!j){f=0;h=i}else{c[7182]=(c[7182]|0)+1;f=xb(j<<5|19)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[d+152>>2]|0}if((h|0)>0){g=0;do{m=f+(g<<5)|0;l=(c[d+160>>2]|0)+(g<<5)|0;c[m>>2]=c[l>>2];c[m+4>>2]=c[l+4>>2];c[m+8>>2]=c[l+8>>2];c[m+12>>2]=c[l+12>>2];c[m+16>>2]=c[l+16>>2];c[m+20>>2]=c[l+20>>2];c[m+24>>2]=c[l+24>>2];c[m+28>>2]=c[l+28>>2];g=g+1|0}while((g|0)!=(h|0))}g=c[d+160>>2]|0;if(g|0){if(a[d+164>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[d+160>>2]=0}a[d+164>>0]=1;c[d+160>>2]=f;c[d+156>>2]=j;g=d+160|0}else g=d+160|0;f=i;do{m=(c[g>>2]|0)+(f<<5)|0;c[m>>2]=c[n>>2];c[m+4>>2]=c[n+4>>2];c[m+8>>2]=c[n+8>>2];c[m+12>>2]=c[n+12>>2];c[m+16>>2]=c[n+16>>2];c[m+20>>2]=c[n+20>>2];c[m+24>>2]=c[n+24>>2];c[m+28>>2]=c[n+28>>2];f=f+1|0}while((f|0)!=(j|0))}c[d+152>>2]=j;if((j|0)<=0){sa=n;return}h=c[d+160>>2]|0;g=0;f=c[e+72>>2]|0;while(1){b[h+(g<<5)+6>>1]=b[f+14>>1]|0;b[h+(g<<5)+8>>1]=b[f+16>>1]|0;b[h+(g<<5)+10>>1]=b[f+18>>1]|0;b[h+(g<<5)>>1]=b[f+8>>1]|0;b[h+(g<<5)+2>>1]=b[f+10>>1]|0;b[h+(g<<5)+4>>1]=b[f+12>>1]|0;c[h+(g<<5)+12>>2]=c[f>>2];c[h+(g<<5)+16>>2]=c[f+4>>2];g=g+1|0;if((g|0)==(j|0))break;else f=f+20|0}sa=n;return}function Hc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;if(!a)return;b=c[7205]|0;d=c[a+-4>>2]|0;j=a+-8+(d&-8)|0;do if(!(d&1)){e=c[a+-8>>2]|0;if(!(d&3))return;h=a+-8+(0-e)|0;g=e+(d&-8)|0;if(h>>>0>>0)return;if((c[7206]|0)==(h|0)){b=c[j+4>>2]|0;if((b&3|0)!=3){i=h;b=g;break}c[7203]=g;c[j+4>>2]=b&-2;c[h+4>>2]=g|1;c[h+g>>2]=g;return}d=3?e>>>3:e;if(e>>>0<256){b=c[h+8>>2]|0;a=c[h+12>>2]|0;if((a|0)==(b|0)){c[7201]=c[7201]&~(1<>2]=a;c[a+8>>2]=b;i=h;b=g;break}}f=c[h+24>>2]|0;b=c[h+12>>2]|0;do if((b|0)==(h|0)){b=c[h+16+4>>2]|0;if(!b){b=c[h+16>>2]|0;if(!b){b=0;break}else a=h+16|0}else a=h+16+4|0;while(1){e=b+20|0;d=c[e>>2]|0;if(!d){e=b+16|0;d=c[e>>2]|0;if(!d)break;else{b=d;a=e}}else{b=d;a=e}}c[a>>2]=0}else{i=c[h+8>>2]|0;c[i+12>>2]=b;c[b+8>>2]=i}while(0);if(f){a=c[h+28>>2]|0;if((c[29108+(a<<2)>>2]|0)==(h|0)){c[29108+(a<<2)>>2]=b;if(!b){c[7202]=c[7202]&~(1<>2]|0)==(h|0)?f+16|0:f+20|0)>>2]=b;if(!b){i=h;b=g;break}}c[b+24>>2]=f;a=c[h+16>>2]|0;if(a|0){c[b+16>>2]=a;c[a+24>>2]=b}a=c[h+16+4>>2]|0;if(a){c[b+20>>2]=a;c[a+24>>2]=b;i=h;b=g}else{i=h;b=g}}else{i=h;b=g}}else{i=a+-8|0;b=d&-8;h=a+-8|0}while(0);if(h>>>0>=j>>>0)return;a=c[j+4>>2]|0;if(!(a&1))return;if(!(a&2)){if((c[7207]|0)==(j|0)){j=(c[7204]|0)+b|0;c[7204]=j;c[7207]=i;c[i+4>>2]=j|1;if((i|0)!=(c[7206]|0))return;c[7206]=0;c[7203]=0;return}if((c[7206]|0)==(j|0)){j=(c[7203]|0)+b|0;c[7203]=j;c[7206]=h;c[i+4>>2]=j|1;c[h+j>>2]=j;return}f=(a&-8)+b|0;d=3?a>>>3:a;do if(a>>>0<256){a=c[j+8>>2]|0;b=c[j+12>>2]|0;if((b|0)==(a|0)){c[7201]=c[7201]&~(1<>2]=b;c[b+8>>2]=a;break}}else{g=c[j+24>>2]|0;b=c[j+12>>2]|0;do if((b|0)==(j|0)){b=c[j+16+4>>2]|0;if(!b){b=c[j+16>>2]|0;if(!b){a=0;break}else a=j+16|0}else a=j+16+4|0;while(1){e=b+20|0;d=c[e>>2]|0;if(!d){e=b+16|0;d=c[e>>2]|0;if(!d)break;else{b=d;a=e}}else{b=d;a=e}}c[a>>2]=0;a=b}else{a=c[j+8>>2]|0;c[a+12>>2]=b;c[b+8>>2]=a;a=b}while(0);if(g|0){b=c[j+28>>2]|0;if((c[29108+(b<<2)>>2]|0)==(j|0)){c[29108+(b<<2)>>2]=a;if(!a){c[7202]=c[7202]&~(1<>2]|0)==(j|0)?g+16|0:g+20|0)>>2]=a;if(!a)break}c[a+24>>2]=g;b=c[j+16>>2]|0;if(b|0){c[a+16>>2]=b;c[b+24>>2]=a}b=c[j+16+4>>2]|0;if(b|0){c[a+20>>2]=b;c[b+24>>2]=a}}}while(0);c[i+4>>2]=f|1;c[h+f>>2]=f;if((i|0)==(c[7206]|0)){c[7203]=f;return}}else{c[j+4>>2]=a&-2;c[i+4>>2]=b|1;c[h+b>>2]=b;f=b}d=3?f>>>3:f;if(f>>>0<256){b=c[7201]|0;if(!(b&1<>2]|0;a=28844+(d<<1<<2)+8|0}c[a>>2]=i;c[b+12>>2]=i;c[i+8>>2]=b;c[i+12>>2]=28844+(d<<1<<2);return}b=8?f>>>8:f;if(b)if(f>>>0>16777215)e=31;else{h=(16?(b+1048320|0)>>>16:b+1048320|0)&8;j=(16?((b<>>16:(b<>>16:(b<>>15:b<>>(e+7|0):f)&1|e<<1}else e=0;b=29108+(e<<2)|0;c[i+28>>2]=e;c[i+20>>2]=0;c[i+16>>2]=0;a=c[7202]|0;d=1<>2]=i;c[i+24>>2]=b;c[i+12>>2]=i;c[i+8>>2]=i}else{b=c[b>>2]|0;b:do if((c[b+4>>2]&-8|0)!=(f|0)){e=f<<((e|0)==31?0:25-(1?e>>>1:e)|0);while(1){d=b+16+((31?e>>>31:e)<<2)|0;a=c[d>>2]|0;if(!a)break;if((c[a+4>>2]&-8|0)==(f|0)){b=a;break b}else{e=e<<1;b=a}}c[d>>2]=i;c[i+24>>2]=b;c[i+12>>2]=i;c[i+8>>2]=i;break a}while(0);h=b+8|0;j=c[h>>2]|0;c[j+12>>2]=i;c[h>>2]=i;c[i+8>>2]=j;c[i+12>>2]=b;c[i+24>>2]=0}while(0);j=(c[7209]|0)+-1|0;c[7209]=j;if(j|0)return;b=29260;while(1){b=c[b>>2]|0;if(!b)break;else b=b+8|0}c[7209]=-1;return}function Ic(a,b,d,e,f,g,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;j=c[d+8>>2]|0;if(!j){h=0;return h|0}i=0;C=j;do{if((c[C+20>>2]|0)>(c[a+100>>2]|0)){A=c[C+12>>2]|0;w=c[A+88>>2]|0;x=w-(c[d+88>>2]|0)|0;y=c[A+92>>2]|0;z=y-(c[d+92>>2]|0)|0;A=c[A+96>>2]|0;B=A-(c[d+96>>2]|0)|0;k=Vr(c[g>>2]|0,c[g+4>>2]|0,x|0,((x|0)<0)<<31>>31|0)|0;p=Q()|0;j=Vr(c[g+8>>2]|0,c[g+8+4>>2]|0,z|0,((z|0)<0)<<31>>31|0)|0;p=xv(j|0,Q()|0,k|0,p|0)|0;k=Q()|0;j=Vr(c[g+16>>2]|0,c[g+16+4>>2]|0,B|0,((B|0)<0)<<31>>31|0)|0;j=xv(p|0,k|0,j|0,Q()|0)|0;k=Q()|0;p=Vr(c[f>>2]|0,c[f+4>>2]|0,x|0,((x|0)<0)<<31>>31|0)|0;v=Q()|0;o=Vr(c[f+8>>2]|0,c[f+8+4>>2]|0,z|0,((z|0)<0)<<31>>31|0)|0;v=xv(o|0,Q()|0,p|0,v|0)|0;p=Q()|0;o=Vr(c[f+16>>2]|0,c[f+16+4>>2]|0,B|0,((B|0)<0)<<31>>31|0)|0;o=xv(v|0,p|0,o|0,Q()|0)|0;p=Q()|0;if((k|0)>0|(k|0)==0&j>>>0>0){l=1;m=-1;v=j}else{v=lv(0,0,j|0,k|0)|0;u=Q()|0;l=((j|0)!=0|(k|0)!=0)<<31>>31;m=((j|0)!=0|(k|0)!=0)&1;v=(j|0)!=0|(k|0)!=0?v:0;k=(j|0)!=0|(k|0)!=0?u:0}if(!((p|0)>0|(p|0)==0&o>>>0>0)){j=lv(0,0,o|0,p|0)|0;n=Q()|0;j=(o|0)!=0|(p|0)!=0?j:0;n=(o|0)!=0|(p|0)!=0?n:0;if(!((((o|0)!=0|(p|0)!=0?m:l)|0)==0&((j|0)==0&(n|0)==0))){l=(o|0)!=0|(p|0)!=0?m:l;o=j;q=8}}else{n=p;q=8}a:do if((q|0)==8){q=0;if(!i){c[h>>2]=v;c[h+4>>2]=k;c[h+8>>2]=o;c[h+8+4>>2]=n;c[h+16>>2]=l;i=C;break}j=c[h+16>>2]|0;if((l|0)==(j|0)){if(l|0){p=c[h+8>>2]|0;s=c[h+8+4>>2]|0;m=Vr(p|0,0,v|0,0)|0;j=Q()|0;t=Vr(s|0,0,v|0,0)|0;r=Q()|0;p=Vr(p|0,0,k|0,0)|0;q=Q()|0;s=Vr(s|0,0,k|0,0)|0;F=Q()|0;p=xv(t|0,0,p|0,0)|0;t=Q()|0;F=xv(r|0,0,s|0,F|0)|0;q=xv(F|0,Q()|0,q|0,0)|0;t=xv(q|0,Q()|0,t|0,0)|0;q=Q()|0;j=xv(0,p|0,m|0,j|0)|0;m=Q()|0;p=xv(t|0,q|0,(m>>>0

>>0|(m|0)==(p|0)&j>>>0<0)&1|0,0)|0;q=Q()|0;t=c[h>>2]|0;F=c[h+4>>2]|0;s=Vr(t|0,0,o|0,0)|0;r=Q()|0;D=Vr(F|0,0,o|0,0)|0;G=Q()|0;t=Vr(t|0,0,n|0,0)|0;u=Q()|0;F=Vr(F|0,0,n|0,0)|0;E=Q()|0;t=xv(D|0,0,t|0,0)|0;D=Q()|0;E=xv(G|0,0,F|0,E|0)|0;u=xv(E|0,Q()|0,u|0,0)|0;D=xv(u|0,Q()|0,D|0,0)|0;u=Q()|0;r=xv(0,t|0,s|0,r|0)|0;s=Q()|0;t=xv(D|0,u|0,(s>>>0>>0|(s|0)==(t|0)&r>>>0<0)&1|0,0)|0;u=Q()|0;if(!(q>>>0>>0|(q|0)==(u|0)&p>>>0>>0))if(q>>>0>u>>>0|(q|0)==(u|0)&p>>>0>t>>>0)j=1;else j=m>>>0>>0|(m|0)==(s|0)&j>>>0>>0?-1:(m>>>0>s>>>0|(m|0)==(s|0)&j>>>0>r>>>0)&1;else j=-1;j=J(j,l)|0;q=17}}else{j=l-j|0;q=17}do if((q|0)==17){q=0;if((j|0)>=0)if(!j)break;else break a;else{c[h>>2]=v;c[h+4>>2]=k;c[h+8>>2]=o;c[h+8+4>>2]=n;c[h+16>>2]=l;i=C;break a}}while(0);j=(c[i+4>>2]|0)==(C|0);if((c[i>>2]|0)==(C|0))if(j){G=c[e+8>>2]|0;D=J(G,z)|0;u=c[e+4>>2]|0;D=D-(J(u,B)|0)|0;F=c[e>>2]|0;G=(J(F,B)|0)-(J(G,x)|0)|0;F=(J(u,x)|0)-(J(F,z)|0)|0;u=c[i+12>>2]|0;j=c[(c[C+8>>2]|0)+12>>2]|0;B=c[j+88>>2]|0;x=(c[u+88>>2]|0)-B|0;v=c[j+92>>2]|0;z=(c[u+92>>2]|0)-v|0;j=c[j+96>>2]|0;u=(c[u+96>>2]|0)-j|0;E=(J(A-j|0,z)|0)-(J(u,y-v|0)|0)|0;j=(J(u,w-B|0)|0)-(J(A-j|0,x)|0)|0;B=(J(y-v|0,x)|0)-(J(z,w-B|0)|0)|0;D=Vr(E|0,((E|0)<0)<<31>>31|0,D|0,((D|0)<0)<<31>>31|0)|0;E=Q()|0;G=Vr(j|0,((j|0)<0)<<31>>31|0,G|0,((G|0)<0)<<31>>31|0)|0;j=Q()|0;F=Vr(B|0,((B|0)<0)<<31>>31|0,F|0,((F|0)<0)<<31>>31|0)|0;F=xv(D|0,E|0,F|0,Q()|0)|0;j=xv(F|0,Q()|0,G|0,j|0)|0;G=Q()|0;j=(G|0)>0|(G|0)==0&j>>>0>0?2:1}else j=2;else j=j&1;i=(j|0)==2^b?i:C}while(0);j=c[d+8>>2]|0}C=c[C>>2]|0}while((C|0)!=(j|0));return i|0}function Jc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0.0,u=0.0,v=0.0,w=0;q=sa;sa=sa+176|0;c[q+96>>2]=1;c[q+96+4>>2]=e;c[q+96+8>>2]=d;c[q+96+12>>2]=16;g[q+96+16>>2]=1.0000000474974513e-03;a[q+40+24>>0]=1;p=q+40+20|0;c[p>>2]=0;c[q+40+12>>2]=0;c[q+40+16>>2]=0;n=q+40+52|0;a[n>>0]=1;o=q+40+48|0;c[o>>2]=0;c[q+40+40>>2]=0;c[q+40+44>>2]=0;a[q+40>>0]=1;c[q+40+4>>2]=0;c[q+40+28>>2]=0;c[q+40+32>>2]=0;a[q+16>>0]=1;c[q+12>>2]=0;c[q+4>>2]=0;c[q+8>>2]=0;a[q+36>>0]=1;c[q+32>>2]=0;c[q+24>>2]=0;c[q+28>>2]=0;c[q+96+20>>2]=e;ob(q,q+96|0,q+40|0)|0;c[7182]=(c[7182]|0)+1;d=xb(1271)|0;if(!d)m=0;else{c[(d+4+15&-16)+-4>>2]=d;m=d+4+15&-16}Hb(m,b,c[q+40+4>>2]|0,c[p>>2]|0,0);if((c[q+40+28>>2]|0)>0){e=m+720|0;b=m+732|0;h=m+740|0;i=m+924|0;d=0;do{l=d*3|0;r=c[o>>2]|0;j=c[r+(l<<2)>>2]|0;k=c[r+(l+1<<2)>>2]|0;l=c[r+(l+2<<2)>>2]|0;if((j|0)<(k|0)){w=c[e>>2]|0;oh(m,0);r=(c[b>>2]|0)+-1|0;s=c[h>>2]|0;c[s+(r*52|0)+8>>2]=w+(j*104|0);c[s+(r*52|0)+12>>2]=w+(k*104|0);v=+g[w+(j*104|0)+8>>2]-+g[w+(k*104|0)+8>>2];u=+g[w+(j*104|0)+12>>2]-+g[w+(k*104|0)+12>>2];t=+g[w+(j*104|0)+16>>2]-+g[w+(k*104|0)+16>>2];g[s+(r*52|0)+16>>2]=+x(+(v*v+u*u+t*t));a[i>>0]=1}if((k|0)<(l|0)){r=c[e>>2]|0;oh(m,0);w=(c[b>>2]|0)+-1|0;s=c[h>>2]|0;c[s+(w*52|0)+8>>2]=r+(k*104|0);c[s+(w*52|0)+12>>2]=r+(l*104|0);t=+g[r+(k*104|0)+8>>2]-+g[r+(l*104|0)+8>>2];u=+g[r+(k*104|0)+12>>2]-+g[r+(l*104|0)+12>>2];v=+g[r+(k*104|0)+16>>2]-+g[r+(l*104|0)+16>>2];g[s+(w*52|0)+16>>2]=+x(+(t*t+u*u+v*v));a[i>>0]=1}if((l|0)<(j|0)){r=c[e>>2]|0;oh(m,0);w=(c[b>>2]|0)+-1|0;s=c[h>>2]|0;c[s+(w*52|0)+8>>2]=r+(l*104|0);c[s+(w*52|0)+12>>2]=r+(j*104|0);t=+g[r+(l*104|0)+8>>2]-+g[r+(j*104|0)+8>>2];u=+g[r+(l*104|0)+12>>2]-+g[r+(j*104|0)+12>>2];v=+g[r+(l*104|0)+16>>2]-+g[r+(j*104|0)+16>>2];g[s+(w*52|0)+16>>2]=+x(+(t*t+u*u+v*v));a[i>>0]=1}mf(m,j,k,l,0);d=d+1|0}while((d|0)<(c[q+40+28>>2]|0))}if(c[q+40+12>>2]|0){c[q+40+4>>2]=0;d=c[p>>2]|0;if(d|0){if(a[q+40+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[p>>2]=0}a[q+40+24>>0]=1;c[p>>2]=0;c[q+40+12>>2]=0;c[q+40+16>>2]=0}if(c[q+40+40>>2]|0){c[q+40+32>>2]=0;d=c[o>>2]|0;if(d|0){if(a[n>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[o>>2]=0}a[n>>0]=1;c[o>>2]=0;c[q+40+40>>2]=0;c[q+40+44>>2]=0}if(f){b=c[m+732>>2]|0;if((b|0)>0){h=m+740|0;d=243703;e=0;do{i=c[h>>2]|0;j=i+(e*52|0)|0;d=(J(d,1664525)|0)+1013904223|0;k=q+124|0;l=j;f=k+52|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));k=j;l=i+(((d>>>0)%(b>>>0)|0)*52|0)|0;f=k+52|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));k=i+(((d>>>0)%(b>>>0)|0)*52|0)|0;l=q+124|0;f=k+52|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));e=e+1|0}while((e|0)!=(b|0))}else d=243703;i=c[m+752>>2]|0;if((i|0)>0){j=m+760|0;e=0;do{h=c[j>>2]|0;b=h+(e*44|0)|0;d=(J(d,1664525)|0)+1013904223|0;h=h+(((d>>>0)%(i>>>0)|0)*44|0)|0;k=q+124|0;l=b;f=k+44|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));k=b;l=h;f=k+44|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));k=h;l=q+124|0;f=k+44|0;do{c[k>>2]=c[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(f|0));e=e+1|0}while((e|0)!=(i|0))}}d=c[q+32>>2]|0;if(d|0){if(a[q+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[q+32>>2]=0}a[q+36>>0]=1;c[q+32>>2]=0;c[q+24>>2]=0;c[q+28>>2]=0;d=c[q+12>>2]|0;if(d|0){if(a[q+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[q+12>>2]=0}d=c[o>>2]|0;if(d|0){if(a[n>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[o>>2]=0}a[n>>0]=1;c[o>>2]=0;c[q+40+40>>2]=0;c[q+40+44>>2]=0;d=c[p>>2]|0;if(!d){sa=q;return m|0}if(a[q+40+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[p>>2]=0;sa=q;return m|0} -function hi(){var b=0;b=fs(284)|0;c[b+164>>2]=1065353216;c[b+168>>2]=1065353216;c[b+172>>2]=1065353216;g[b+176>>2]=0.0;c[b+180>>2]=0;g[b+184>>2]=999999984306749440.0;c[b+188>>2]=0;c[b+188+4>>2]=0;c[b+188+8>>2]=0;c[b+188+12>>2]=0;c[b+204>>2]=1;c[b+208>>2]=-1;c[b+212>>2]=-1;c[b+216>>2]=1;g[b+220>>2]=0.0;g[b+224>>2]=.5;g[b+228>>2]=0.0;g[b+232>>2]=0.0;c[b+240>>2]=0;g[b+244>>2]=1.0;c[b+248>>2]=0;c[b+248+4>>2]=0;c[b+248+8>>2]=0;c[b+248+12>>2]=0;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+48+4>>2]=0;c[b+48+8>>2]=0;c[b+48+12>>2]=0;c[b+48+16>>2]=0;c[b>>2]=7852;a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;c[b+272>>2]=0;c[b+236>>2]=4;return b|0}function ii(b,d){b=b|0;d=d|0;var e=0,f=0,h=0,i=0.0,j=0.0,k=0,l=0;f=sa;sa=sa+48|0;if((c[b+136>>2]|0)<=0){sa=f;return}e=0;do{l=c[b+144>>2]|0;c[f+32>>2]=(a[l+(e*284|0)+84>>0]|0)==0?1065353216:0;c[f+32+4>>2]=0;c[f+32+8>>2]=1065353216;g[f+32+12>>2]=0.0;k=l+(e*284|0)+140|0;c[f+16>>2]=c[k>>2];c[f+16+4>>2]=c[k+4>>2];c[f+16+8>>2]=c[k+8>>2];c[f+16+12>>2]=c[k+12>>2];k=c[b+120>>2]|0;h=c[(c[d>>2]|0)+8>>2]|0;j=+g[l+(e*284|0)+108+(k<<2)>>2]+ +g[f+16+4>>2];i=+g[l+(e*284|0)+124+(k<<2)>>2]+ +g[f+16+8>>2];g[f>>2]=+g[l+(e*284|0)+92+(k<<2)>>2]+ +g[f+16>>2];g[f+4>>2]=j;g[f+8>>2]=i;g[f+12>>2]=0.0;ab[h&127](d,f+16|0,f,f+32|0);ab[c[(c[d>>2]|0)+8>>2]&127](d,f+16|0,(c[b+144>>2]|0)+(e*284|0)+16|0,f+32|0);e=e+1|0}while((e|0)<(c[b+136>>2]|0));sa=f;return}function ji(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;switch(b|0){case 2:{if((e|0)<1){g[a+232>>2]=d;c[a+300>>2]=c[a+300>>2]|512;return}if((e|0)<3){g[a+264>>2]=d;c[a+300>>2]=c[a+300>>2]|32;return}if((e|0)==3){g[a+248>>2]=d;c[a+300>>2]=c[a+300>>2]|2048;return}if((e|0)>=6)return;g[a+280>>2]=d;c[a+300>>2]=c[a+300>>2]|128;return}case 3:{if((e|0)<1){g[a+212>>2]=d;c[a+300>>2]=c[a+300>>2]|1;return}if((e|0)!=3)return;g[a+228>>2]=d;c[a+300>>2]=c[a+300>>2]|4;return}case 4:{if((e|0)<1){g[a+244>>2]=d;c[a+300>>2]=c[a+300>>2]|256;return}if((e|0)<3){g[a+276>>2]=d;c[a+300>>2]=c[a+300>>2]|16;return}if((e|0)==3){g[a+260>>2]=d;c[a+300>>2]=c[a+300>>2]|1024;return}if((e|0)>=6)return;g[a+292>>2]=d;c[a+300>>2]=c[a+300>>2]|64;return}default:return}}function ki(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0;e=sa;sa=sa+96|0;c[e+32>>2]=1065353216;c[e+32+4>>2]=0;c[e+32+4+4>>2]=0;c[e+32+4+8>>2]=0;c[e+32+4+12>>2]=0;c[e+32+20>>2]=1065353216;c[e+32+24>>2]=0;c[e+32+24+4>>2]=0;c[e+32+24+8>>2]=0;c[e+32+24+12>>2]=0;c[e+32+40>>2]=1065353216;k=e+32+44|0;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;ab[c[(c[a>>2]|0)+8>>2]&127](a,e+32|0,e+16|0,e);i=(+g[e>>2]-+g[e+16>>2])*.5;h=(+g[e+4>>2]-+g[e+16+4>>2])*.5;j=(+g[e+8>>2]-+g[e+16+8>>2])*.5;f=+va[c[(c[a>>2]|0)+48>>2]&15](a);g[d>>2]=b*.0833333283662796*((h+f)*2.0*(h+f)*2.0+(j+f)*2.0*(j+f)*2.0);g[d+4>>2]=b*.0833333283662796*((i+f)*2.0*(i+f)*2.0+(j+f)*2.0*(j+f)*2.0);g[d+8>>2]=b*.0833333283662796*((i+f)*2.0*(i+f)*2.0+(h+f)*2.0*(h+f)*2.0);g[d+12>>2]=0.0;sa=e;return}function li(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0.0,n=0.0,o=0.0;l=c[b+720>>2]|0;a:do if(h?(k=c[b+732>>2]|0,(k|0)>0):0){i=c[b+740>>2]|0;h=0;while(1){j=c[i+(h*52|0)+8>>2]|0;if((j|0)==(l+(d*104|0)|0)?(c[i+(h*52|0)+12>>2]|0)==(l+(e*104|0)|0):0){h=10;break}if((j|0)==(l+(e*104|0)|0)?(c[i+(h*52|0)+12>>2]|0)==(l+(d*104|0)|0):0){h=10;break}h=h+1|0;if((h|0)>=(k|0))break a}if((h|0)==10)return}while(0);oh(b,f);f=(c[b+732>>2]|0)+-1|0;k=c[b+740>>2]|0;c[k+(f*52|0)+8>>2]=l+(d*104|0);c[k+(f*52|0)+12>>2]=l+(e*104|0);o=+g[l+(d*104|0)+8>>2]-+g[l+(e*104|0)+8>>2];n=+g[l+(d*104|0)+12>>2]-+g[l+(e*104|0)+12>>2];m=+g[l+(d*104|0)+16>>2]-+g[l+(e*104|0)+16>>2];g[k+(f*52|0)+16>>2]=+x(+(o*o+n*n+m*m));a[b+924>>0]=1;return}function mi(){var b=0;b=vs()|0;c[b>>2]=1025;c[b+116>>2]=0;a[b+120>>0]=0;c[b+124>>2]=0;c[b+124+4>>2]=0;c[b+124+8>>2]=0;c[b+124+12>>2]=0;c[b+124+16>>2]=0;c[b+124+20>>2]=0;c[b+124+24>>2]=0;c[b+124+28>>2]=0;c[b+300>>2]=0;a[b+304>>0]=0;c[b+308>>2]=0;c[b+308+4>>2]=0;c[b+308+8>>2]=0;c[b+308+12>>2]=0;c[b+308+16>>2]=0;c[b+308+20>>2]=0;c[b+308+24>>2]=0;c[b+308+28>>2]=0;c[b+484>>2]=0;a[b+488>>0]=0;c[b+492>>2]=0;c[b+492+4>>2]=0;c[b+492+8>>2]=0;c[b+492+12>>2]=0;c[b+492+16>>2]=0;c[b+492+20>>2]=0;c[b+492+24>>2]=0;c[b+492+28>>2]=0;c[b+668>>2]=0;a[b+672>>0]=0;c[b+676>>2]=0;c[b+676+4>>2]=0;c[b+676+8>>2]=0;c[b+676+12>>2]=0;c[b+676+16>>2]=0;c[b+676+20>>2]=0;c[b+676+24>>2]=0;c[b+676+28>>2]=0;c[b+740>>2]=0;c[b+744>>2]=0;c[b+748>>2]=0;c[b+768>>2]=0;return b|0}function ni(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c[a>>2]=6612;if((c[a+104>>2]|0)<=0){a=a+60|0;Ai(a);Bi(a);return}k=0;do{j=c[(c[a+4>>2]|0)+684>>2]|0;i=(c[a+112>>2]|0)+(k<<3)+4|0;b=c[i>>2]|0;d=c[j+60>>2]|0;if((d|0)>0){h=0;do{g=(c[j+68>>2]|0)+(h<<2)|0;e=c[g>>2]|0;if(e){f=0;while(1){d=e;e=c[e+280>>2]|0;if((c[d+276>>2]|0)==(b|0)){c[((f|0)==0?g:f+280|0)>>2]=e;GI(d);d=f}if(!e)break;else f=d}d=c[j+60>>2]|0}h=h+1|0}while((h|0)<(d|0));b=c[i>>2]|0}if(b|0)Pa[c[(c[b>>2]|0)+4>>2]&511](b);k=k+1|0}while((k|0)<(c[a+104>>2]|0));a=a+60|0;Ai(a);Bi(a);return}function oi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0;if(!(a[b+84>>0]|0)){c[b+32>>2]=c[b+204>>2];g[b+272>>2]=0.0;o=-+g[b+56>>2];p=-+g[b+60>>2];g[b>>2]=-+g[b+52>>2];g[b+4>>2]=o;g[b+8>>2]=p;g[b+12>>2]=0.0;p=1.0;d=b+268|0;g[d>>2]=p;return}p=+g[b>>2];f=+g[b+4>>2];h=+g[b+8>>2];i=p*+g[b+52>>2]+f*+g[b+56>>2]+h*+g[b+60>>2];j=+g[b+16>>2]-+g[d+52>>2];k=+g[b+20>>2]-+g[d+56>>2];l=+g[b+24>>2]-+g[d+60>>2];m=+g[d+332>>2];n=+g[d+336>>2];o=+g[d+328>>2];if(!(i>=-.10000000149011612)){g[b+272>>2]=-1.0/i*(p*(m*l-k*n+ +g[d+312>>2])+f*(j*n-l*o+ +g[d+316>>2])+h*(k*o-j*m+ +g[d+320>>2]));p=-1.0/i;d=b+268|0;g[d>>2]=p;return}else{g[b+272>>2]=0.0;p=10.0;d=b+268|0;g[d>>2]=p;return}}function pi(b,d){b=b|0;d=d|0;var e=0,f=0;if(a[b+1308>>0]|0){c[d>>2]=0;c[d+4>>2]=0;return}tc(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);c[d>>2]=0;c[d+4>>2]=6;if((c[b+856>>2]|0)==0?(a[b+788>>0]|0)==0:0){e=0;f=6}else{c[d>>2]=1;c[d+4>>2]=5;e=1;f=5}if(!((c[b+860>>2]|0)==0?(a[b+789>>0]|0)==0:0)){e=e+1|0;c[d>>2]=e;f=f+-1|0;c[d+4>>2]=f}if(!((c[b+864>>2]|0)==0?!(a[b+790>>0]|0):0)){c[d>>2]=e+1;c[d+4>>2]=f+-1}if(of(b,0)|0){c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1}if(of(b,1)|0){c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1}if(!(of(b,2)|0))return;c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1;return}function qi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=c[b+212>>2]|0;if((f|0)==(c[b+216>>2]|0)?(i=(f|0)==0?1:f<<1,(f|0)<(i|0)):0){if(!i)h=0;else{c[7182]=(c[7182]|0)+1;f=xb((i<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=f;f=c[b+212>>2]|0}if((f|0)>0){g=0;do{c[h+(g<<2)>>2]=c[(c[b+220>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0))}g=c[b+220>>2]|0;if(g){if(a[b+224>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);f=c[b+212>>2]|0}c[b+220>>2]=0}a[b+224>>0]=1;c[b+220>>2]=h;c[b+216>>2]=i}c[(c[b+220>>2]|0)+(f<<2)>>2]=d;c[b+212>>2]=f+1;if(!e)return;Rh(c[d+28>>2]|0,d);Rh(c[d+32>>2]|0,d);return}function ri(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;e=sa;sa=sa+96|0;j=+g[c>>2];k=+g[c+4>>2];l=+g[c+8>>2];Wp(e+80|0,j,k,l,+Xx(j,k,l,+g[b>>2],+g[b+4>>2],+g[b+8>>2]));l=+g[e+80>>2];k=+g[e+80+4>>2];j=+g[e+80+8>>2];sp(e+64|0,+g[b>>2],+g[b+4>>2],+g[b+8>>2],l,k,j);Co(e+48|0,+g[c>>2],+g[c+4>>2],+g[c+8>>2],+g[b>>2],+g[b+4>>2],+g[b+8>>2]);i=+g[e+48>>2];h=+g[e+48+4>>2];f=+g[e+48+8>>2];m=+zI(d);Wp(e+16|0,+g[e+64>>2],+g[e+64+4>>2],+g[e+64+8>>2],m);qp(e+32|0,l,k,j,+g[e+16>>2],+g[e+16+4>>2],+g[e+16+8>>2]);Wp(e,i,h,f,+yI(d));qp(a,+g[e+32>>2],+g[e+32+4>>2],+g[e+32+8>>2],+g[e>>2],+g[e+4>>2],+g[e+8>>2]);sa=e;return}function si(a,b,d,e,f,h,i,j,k,l){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0;m=sa;sa=sa+16|0;Ki(17206);+Da[c[(c[a>>2]|0)+44>>2]&3](a,b,d,e,f,h,i,j,k);+Da[c[(c[a>>2]|0)+48>>2]&3](a,b,d,e,f,h,i,j,k);+Aa[c[(c[a>>2]|0)+36>>2]&1](a,b,d,j);l=c[3084]|0;k=(c[l+16>>2]|0)+-1|0;c[l+16>>2]=k;if(k|0){sa=m;return 0.0}do if(c[l+4>>2]|0){la(m|0,0)|0;k=c[7181]|0;g[l+8>>2]=+g[l+8>>2]+ +(((c[m+4>>2]|0)-(c[k+4>>2]|0)+(((c[m>>2]|0)-(c[k>>2]|0)|0)*1e6|0)-(c[l+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[l+16>>2]|0)){l=c[3084]|0;break}else{sa=m;return 0.0}}while(0);c[3084]=c[l+20>>2];sa=m;return 0.0}function ti(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0;e=c[a+4>>2]|0;if(e|0)Bk(e,b,d);a=c[a>>2]|0;if(!a)return;m=+g[b>>2];k=+g[a+128>>2];l=+g[b+4>>2];j=+g[b+8>>2];f=+g[d+4>>2];o=+g[d+8>>2];n=+g[d>>2];i=+g[a+180>>2]*(j*f-l*o)+ +g[a+184>>2]*(m*o-j*n)+(l*n-m*f)*+g[a+188>>2];h=(j*f-l*o)*+g[a+196>>2]+(m*o-j*n)*+g[a+200>>2]+(l*n-m*f)*+g[a+204>>2];f=(j*f-l*o)*+g[a+212>>2]+(m*o-j*n)*+g[a+216>>2]+(l*n-m*f)*+g[a+220>>2];g[a+276>>2]=m*k+ +g[a+276>>2];g[a+280>>2]=k*l+ +g[a+280>>2];g[a+284>>2]=k*j+ +g[a+284>>2];g[a+292>>2]=i+ +g[a+292>>2];g[a+296>>2]=h+ +g[a+296>>2];g[a+300>>2]=f+ +g[a+300>>2];c[a+312>>2]=(c[a+312>>2]|0)+1;return}function ui(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0;v=+g[a+552>>2];u=+g[a+568>>2];t=+g[a+584>>2];s=+g[b>>2];r=+g[b+4>>2];q=+g[b+8>>2];o=+g[b+16>>2];n=+g[b+20>>2];m=+g[b+24>>2];k=+g[b+32>>2];i=+g[b+36>>2];f=+g[b+40>>2];j=+g[a+556>>2];h=+g[a+572>>2];e=+g[a+588>>2];x=+g[a+620>>2];w=+g[a+636>>2];d=+g[a+652>>2];p=x*+g[c>>2]+w*+g[c+4>>2]+d*+g[c+8>>2];l=x*+g[c+16>>2]+w*+g[c+20>>2]+d*+g[c+24>>2];d=x*+g[c+32>>2]+w*+g[c+36>>2]+d*+g[c+40>>2];d=+F(+((v*s+u*r+t*q)*p+(v*o+u*n+t*m)*l+(v*k+u*i+t*f)*d),+((s*j+r*h+q*e)*p+(o*j+n*h+m*e)*l+(k*j+i*h+f*e)*d));return +(d*+g[a+732>>2])}function vi(b){b=b|0;var d=0,e=0,f=0,h=0,i=0;i=sa;sa=sa+16|0;Ki(19302);d=c[b+8>>2]|0;if((d|0)>0){f=0;do{e=c[(c[b+16>>2]|0)+(f<<2)>>2]|0;if(!(a[b+76>>0]|0))switch(c[e+216>>2]|0){case 2:case 5:break;default:h=11}else h=11;if((h|0)==11){h=0;Me(b,e);d=c[b+8>>2]|0}f=f+1|0}while((f|0)<(d|0))}d=c[3084]|0;h=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=h;if(h|0){sa=i;return}do if(c[d+4>>2]|0){la(i|0,0)|0;h=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[i+4>>2]|0)-(c[h+4>>2]|0)+(((c[i>>2]|0)-(c[h>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=i;return}}while(0);c[3084]=c[d+20>>2];sa=i;return}function wi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=c[a+8>>2]|0;if((d|0)>0){f=0;do{e=c[(c[a+16>>2]|0)+(f<<2)>>2]|0;if(c[e+236>>2]&2){g=Fa[c[(c[e>>2]|0)+16>>2]&127](e)|0;g=Ja[c[(c[b>>2]|0)+16>>2]&63](b,g,1)|0;d=Ja[c[(c[e>>2]|0)+20>>2]&63](e,c[g+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,g,d,1497645650,e);d=c[a+8>>2]|0}f=f+1|0}while((f|0)<(d|0))}if((c[a+212>>2]|0)<=0)return;d=0;do{g=c[(c[a+220>>2]|0)+(d<<2)>>2]|0;e=Fa[c[(c[g>>2]|0)+36>>2]&127](g)|0;e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,e,1)|0;f=Ja[c[(c[g>>2]|0)+40>>2]&63](g,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,f,1397641027,g);d=d+1|0}while((d|0)<(c[a+212>>2]|0));return}function xi(a){a=a|0;var b=0.0,d=0,e=0,f=0,h=0;e=sa;sa=sa+32|0;c[a+32>>2]=1566444395;c[a+36>>2]=1566444395;c[a+40>>2]=1566444395;g[a+44>>2]=0.0;c[a+48>>2]=-581039253;c[a+52>>2]=-581039253;c[a+56>>2]=-581039253;g[a+60>>2]=0.0;if((c[a+16>>2]|0)<=0){sa=e;return}d=0;do{f=c[a+24>>2]|0;h=c[f+(d*80|0)+64>>2]|0;ab[c[(c[h>>2]|0)+8>>2]&127](h,f+(d*80|0)|0,e+16|0,e);b=+g[e+16>>2];if(+g[a+32>>2]>b)g[a+32>>2]=b;b=+g[e>>2];if(+g[a+48>>2]>2]=b;b=+g[e+16+4>>2];if(+g[a+36>>2]>b)g[a+36>>2]=b;b=+g[e+4>>2];if(+g[a+52>>2]>2]=b;b=+g[e+16+8>>2];if(+g[a+40>>2]>b)g[a+40>>2]=b;b=+g[e+8>>2];if(+g[a+56>>2]>2]=b;d=d+1|0}while((d|0)<(c[a+16>>2]|0));sa=e;return}function yi(b,d){b=b|0;d=d|0;var e=0,f=0;a:do if((d|0)!=0&(b&3|0)!=0){e=d;while(1){if(!(a[b>>0]|0))break a;b=b+1|0;d=e+-1|0;if((d|0)!=0&(b&3|0)!=0)e=d;else{e=b;b=d;d=(d|0)!=0;f=5;break}}}else{e=b;b=d;d=(d|0)!=0;f=5}while(0);b:do if((f|0)==5){do if(d){if(!(a[e>>0]|0))if(!b)break;else{b=e;break b}c:do if(b>>>0>3)while(1){d=c[e>>2]|0;if((d&-2139062144^-2139062144)&d+-16843009|0)break c;e=e+4|0;b=b+-4|0;if(b>>>0<=3){f=11;break}}else f=11;while(0);if((f|0)==11)if(!b)break;while(1){if(!(a[e>>0]|0)){b=e;break b}b=b+-1|0;if(!b)break;else e=e+1|0}}while(0);b=0}while(0);return b|0}function zi(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,i=0;i=sa;sa=sa+64|0;h=c[d>>2]|0;g=d+(c[h+-8>>2]|0)|0;h=c[h+-4>>2]|0;c[i>>2]=e;c[i+4>>2]=d;c[i+8>>2]=5192;d=RC(h,e)|0;e=i+12|0;f=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));b[i+12+40>>1]=0;a[i+12+42>>0]=0;a:do if(d){c[i+48>>2]=1;gb[c[(c[h>>2]|0)+20>>2]&7](h,i,g,g,1,0);d=(c[i+24>>2]|0)==1?g:0}else{eb[c[(c[h>>2]|0)+24>>2]&31](h,i,g,1,0);switch(c[i+36>>2]|0){case 0:{d=((c[i+40>>2]|0)==1?(c[i+28>>2]|0)==1:0)&(c[i+32>>2]|0)==1?c[i+20>>2]|0:0;break a}case 1:break;default:{d=0;break a}}if((c[i+24>>2]|0)!=1?!(((c[i+40>>2]|0)==0?(c[i+28>>2]|0)==1:0)&(c[i+32>>2]|0)==1):0){d=0;break}d=c[i+16>>2]|0}while(0);sa=i;return d|0}function Ai(b){b=b|0;var d=0;d=c[b+12>>2]|0;if(d|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;d=c[b+52>>2]|0;if(d|0){if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+52>>2]=0}a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;d=c[b+72>>2]|0;if(!d){a[b+76>>0]=1;c[b+72>>2]=0;c[b+64>>2]=0;b=b+68|0;c[b>>2]=0;return}if(a[b+76>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+72>>2]=0;a[b+76>>0]=1;c[b+72>>2]=0;c[b+64>>2]=0;b=b+68|0;c[b>>2]=0;return}function Bi(b){b=b|0;var d=0;d=c[b+72>>2]|0;if(d|0){if(a[b+76>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+72>>2]=0}a[b+76>>0]=1;c[b+72>>2]=0;c[b+64>>2]=0;c[b+68>>2]=0;d=c[b+52>>2]|0;if(d|0){if(a[b+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+52>>2]=0}a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;d=c[b+12>>2]|0;if(!d){a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;b=b+8|0;c[b>>2]=0;return}if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+12>>2]=0;a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;b=b+8|0;c[b>>2]=0;return}function Ci(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0;e=sa;sa=sa+96|0;i=+va[c[(c[a>>2]|0)+48>>2]&15](a);c[e+32>>2]=1065353216;c[e+32+4>>2]=0;c[e+32+4+4>>2]=0;c[e+32+4+8>>2]=0;c[e+32+4+12>>2]=0;c[e+32+20>>2]=1065353216;c[e+32+24>>2]=0;c[e+32+24+4>>2]=0;c[e+32+24+8>>2]=0;c[e+32+24+12>>2]=0;c[e+32+40>>2]=1065353216;j=e+32+44|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;ab[c[(c[a>>2]|0)+8>>2]&127](a,e+32|0,e+16|0,e);h=(i+(+g[e>>2]-+g[e+16>>2])*.5)*2.0;f=(i+(+g[e+4>>2]-+g[e+16+4>>2])*.5)*2.0;i=(i+(+g[e+8>>2]-+g[e+16+8>>2])*.5)*2.0;g[d>>2]=b*.0833333283662796*(f*f+i*i);g[d+4>>2]=b*.0833333283662796*(h*h+i*i);g[d+8>>2]=b*.0833333283662796*(h*h+f*f);g[d+12>>2]=0.0;sa=e;return}function Di(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[b+12>>2]|0;if(!e)return;if(!(a[b+8>>0]|0))return;f=c[d+4>>2]|0;if((f|0)==(c[d+8>>2]|0)?(h=(f|0)==0?1:f<<1,(f|0)<(h|0)):0){if(!h)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((h<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[d+4>>2]|0}if((f|0)>0){g=0;do{c[e+(g<<2)>>2]=c[(c[d+12>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0))}g=c[d+12>>2]|0;if(g){if(a[d+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);f=c[d+4>>2]|0}c[d+12>>2]=0}a[d+16>>0]=1;c[d+12>>2]=e;c[d+8>>2]=h;e=c[b+12>>2]|0}c[(c[d+12>>2]|0)+(f<<2)>>2]=e;c[d+4>>2]=f+1;return}function Ei(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;g=c[b+328>>2]|0;if((g|0)==(c[b+332>>2]|0)?(j=(g|0)==0?1:g<<1,(g|0)<(j|0)):0){if(!j)i=0;else{c[7182]=(c[7182]|0)+1;g=xb((j<<2|3)+16|0)|0;if(!g)g=0;else{c[(g+4+15&-16)+-4>>2]=g;g=g+4+15&-16}i=g;g=c[b+328>>2]|0}if((g|0)>0){h=0;do{c[i+(h<<2)>>2]=c[(c[b+336>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(g|0))}h=c[b+336>>2]|0;if(h){if(a[b+340>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);g=c[b+328>>2]|0}c[b+336>>2]=0}a[b+340>>0]=1;c[b+336>>2]=i;c[b+332>>2]=j}c[(c[b+336>>2]|0)+(g<<2)>>2]=d;c[b+328>>2]=g+1;c[d+284>>2]=c[b+452>>2];$f(b,d,e,f);return}function Fi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[b+20>>2]|0;if(!e)return;if(!(a[b+16>>0]|0))return;f=c[d+4>>2]|0;if((f|0)==(c[d+8>>2]|0)?(h=(f|0)==0?1:f<<1,(f|0)<(h|0)):0){if(!h)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((h<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[d+4>>2]|0}if((f|0)>0){g=0;do{c[e+(g<<2)>>2]=c[(c[d+12>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0))}g=c[d+12>>2]|0;if(g){if(a[d+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);f=c[d+4>>2]|0}c[d+12>>2]=0}a[d+16>>0]=1;c[d+12>>2]=e;c[d+8>>2]=h;e=c[b+20>>2]|0}c[(c[d+12>>2]|0)+(f<<2)>>2]=e;c[d+4>>2]=f+1;return}function Gi(a,b){a=a|0;b=+b;var d=0,e=0,f=0,h=0.0,i=0.0,j=0.0,k=0,l=0,m=0,n=0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0;e=c[a+732>>2]|0;if((e|0)<=0)return;d=c[a+740>>2]|0;a=0;do{n=c[d+(a*52|0)+8>>2]|0;f=c[d+(a*52|0)+12>>2]|0;s=+g[n+40>>2];q=+g[n+44>>2];o=+g[n+48>>2];k=d+(a*52|0)+36|0;r=+g[k>>2];m=d+(a*52|0)+40|0;p=+g[m>>2];l=d+(a*52|0)+44|0;h=+g[l>>2];j=-(+g[d+(a*52|0)+32>>2]*((s-+g[f+40>>2])*r+(q-+g[f+44>>2])*p+(o-+g[f+48>>2])*h)*b);i=+g[n+88>>2]*j;g[n+40>>2]=s+r*i;g[n+44>>2]=q+p*i;g[n+48>>2]=o+h*i;j=+g[f+88>>2]*j;i=j*+g[m>>2];h=j*+g[l>>2];g[f+40>>2]=+g[f+40>>2]-+g[k>>2]*j;g[f+44>>2]=+g[f+44>>2]-i;g[f+48>>2]=+g[f+48>>2]-h;a=a+1|0}while((a|0)!=(e|0));return}function Hi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;k=+g[a+24>>2];i=+g[a+28>>2];j=+g[a+32>>2];f=k*+g[b>>2]+i*+g[b+4>>2]+j*+g[b+8>>2];h=+g[a+20>>2];if(f>h){g[a+20>>2]=f;c[a+4>>2]=c[b>>2];c[a+4+4>>2]=c[b+4>>2];c[a+4+8>>2]=c[b+8>>2];c[a+4+12>>2]=c[b+12>>2]}else f=h;h=k*+g[b+16>>2]+i*+g[b+20>>2]+j*+g[b+24>>2];if(h>f){g[a+20>>2]=h;c[a+4>>2]=c[b+16>>2];c[a+4+4>>2]=c[b+16+4>>2];c[a+4+8>>2]=c[b+16+8>>2];c[a+4+12>>2]=c[b+16+12>>2]}else h=f;f=k*+g[b+32>>2]+i*+g[b+36>>2]+j*+g[b+40>>2];if(!(f>h))return;g[a+20>>2]=f;c[a+4>>2]=c[b+32>>2];c[a+4+4>>2]=c[b+32+4>>2];c[a+4+8>>2]=c[b+32+8>>2];c[a+4+12>>2]=c[b+32+12>>2];return}function Ii(b){b=b|0;var d=0;d=Gs()|0;c[d+8>>2]=0;c[d>>2]=9100;a[d+28>>0]=1;c[d+24>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+32>>2]=1566444395;c[d+36>>2]=1566444395;c[d+40>>2]=1566444395;g[d+44>>2]=0.0;c[d+48>>2]=-581039253;c[d+52>>2]=-581039253;c[d+56>>2]=-581039253;g[d+60>>2]=0.0;c[d+64>>2]=0;c[d+68>>2]=1;g[d+72>>2]=0.0;c[d+76>>2]=1065353216;c[d+80>>2]=1065353216;c[d+84>>2]=1065353216;g[d+88>>2]=0.0;c[d+4>>2]=31;if(!b)return d|0;c[7182]=(c[7182]|0)+1;b=xb(79)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=-1;c[b+12>>2]=0;c[b+16>>2]=0;c[d+64>>2]=b;return d|0}function Ji(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;k=+g[a+88>>2];i=+g[a+92>>2];j=+g[a+96>>2];f=k*+g[b>>2]+i*+g[b+4>>2]+j*+g[b+8>>2];h=+g[a+84>>2];if(f>h){g[a+84>>2]=f;c[a+4>>2]=c[b>>2];c[a+4+4>>2]=c[b+4>>2];c[a+4+8>>2]=c[b+8>>2];c[a+4+12>>2]=c[b+12>>2]}else f=h;h=k*+g[b+16>>2]+i*+g[b+20>>2]+j*+g[b+24>>2];if(h>f){g[a+84>>2]=h;c[a+4>>2]=c[b+16>>2];c[a+4+4>>2]=c[b+16+4>>2];c[a+4+8>>2]=c[b+16+8>>2];c[a+4+12>>2]=c[b+16+12>>2]}else h=f;f=k*+g[b+32>>2]+i*+g[b+36>>2]+j*+g[b+40>>2];if(!(f>h))return;g[a+84>>2]=f;c[a+4>>2]=c[b+32>>2];c[a+4+4>>2]=c[b+32+4>>2];c[a+4+8>>2]=c[b+32+8>>2];c[a+4+12>>2]=c[b+32+12>>2];return}function Ki(a){a=a|0;var b=0,d=0,e=0,f=0;f=sa;sa=sa+16|0;d=c[3084]|0;if((c[d>>2]|0)==(a|0))b=d;else{b=c[d+24>>2]|0;a:do if(!b)e=6;else while(1){if((c[b>>2]|0)==(a|0))break a;b=c[b+28>>2]|0;if(!b){e=6;break}}while(0);if((e|0)==6){b=Nr(36)|0;c[b>>2]=a;c[b+4>>2]=0;c[b+4+4>>2]=0;c[b+4+8>>2]=0;c[b+4+12>>2]=0;c[b+20>>2]=d;c[b+24>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;er(b);c[b+28>>2]=c[d+24>>2];c[d+24>>2]=b}c[3084]=b}d=b+4|0;c[d>>2]=(c[d>>2]|0)+1;d=b+16|0;e=c[d>>2]|0;c[d>>2]=e+1;if(e|0){sa=f;return}la(f|0,0)|0;e=c[7181]|0;c[b+12>>2]=(c[f+4>>2]|0)-(c[e+4>>2]|0)+(((c[f>>2]|0)-(c[e>>2]|0)|0)*1e6|0);sa=f;return}function Li(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0;h=+va[c[(c[a>>2]|0)+48>>2]&15](a);l=h+ +g[a+28>>2];j=h+ +g[a+32>>2];h=h+ +g[a+36>>2];u=+w(+(+g[b>>2]));t=+w(+(+g[b+4>>2]));s=+w(+(+g[b+8>>2]));q=+w(+(+g[b+16>>2]));p=+w(+(+g[b+20>>2]));o=+w(+(+g[b+24>>2]));k=+w(+(+g[b+32>>2]));i=+w(+(+g[b+36>>2]));f=+w(+(+g[b+40>>2]));r=+g[b+48>>2];n=+g[b+52>>2];m=+g[b+56>>2];g[d>>2]=r-(l*u+j*t+h*s);g[d+4>>2]=n-(l*q+j*p+h*o);g[d+8>>2]=m-(l*k+j*i+h*f);g[d+12>>2]=0.0;g[e>>2]=l*u+j*t+h*s+r;g[e+4>>2]=l*q+j*p+h*o+n;g[e+8>>2]=m+(l*k+j*i+h*f);g[e+12>>2]=0.0;return}function Mi(b){b=b|0;var d=0;c[b>>2]=11492;if(c[b+108>>2]|0){d=c[b+112>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+112>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+108>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+108>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}}d=c[b+88>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+84>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+80>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+60>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}if(!(a[b+100>>0]|0))return;d=c[b+92>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+92>>2]|0;if(!d)return;c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);return}function Ni(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[b+76>>2]|0;if(!e)return;f=c[d+4>>2]|0;if((f|0)==(c[d+8>>2]|0)?(h=(f|0)==0?1:f<<1,(f|0)<(h|0)):0){if(!h)e=0;else{c[7182]=(c[7182]|0)+1;e=xb((h<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}f=c[d+4>>2]|0}if((f|0)>0){g=0;do{c[e+(g<<2)>>2]=c[(c[d+12>>2]|0)+(g<<2)>>2];g=g+1|0}while((g|0)!=(f|0))}g=c[d+12>>2]|0;if(g){if(a[d+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);f=c[d+4>>2]|0}c[d+12>>2]=0}a[d+16>>0]=1;c[d+12>>2]=e;c[d+8>>2]=h;e=c[b+76>>2]|0}c[(c[d+12>>2]|0)+(f<<2)>>2]=e;c[d+4>>2]=f+1;return}function Oi(b){b=b|0;var d=0,e=0,f=0,h=0.0;e=sa;sa=sa+96|0;a[b+88>>0]=1;if((a[26736]|0)==0?mz(26736)|0:0){c[6364]=1065353216;c[6365]=0;c[6366]=0;c[6367]=0;c[6368]=0;c[6369]=1065353216;c[6370]=0;c[6371]=0;c[6372]=0;c[6373]=0;c[6374]=1065353216;g[6375]=0.0;c[6376]=-1082130432;c[6377]=0;c[6378]=0;c[6379]=0;c[6380]=0;c[6381]=-1082130432;c[6382]=0;c[6383]=0;c[6384]=0;c[6385]=0;c[6386]=-1082130432;g[6387]=0.0}d=e;f=d+96|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(f|0));ab[c[(c[b>>2]|0)+76>>2]&127](b,25456,e,6);h=+g[b+44>>2];g[b+72>>2]=+g[e>>2]+h;g[b+56>>2]=+g[e+48>>2]-h;g[b+76>>2]=+g[e+20>>2]+h;g[b+60>>2]=+g[e+68>>2]-h;g[b+80>>2]=+g[e+40>>2]+h;g[b+64>>2]=+g[e+88>>2]-h;sa=e;return}function Pi(a,b,d){a=a|0;b=+b;d=+d;var e=0,f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0;f=c[a+732>>2]|0;if((f|0)<=0)return;e=c[a+740>>2]|0;a=0;do{d=+g[e+(a*52|0)+24>>2];if(d>0.0?(h=c[e+(a*52|0)+8>>2]|0,i=c[e+(a*52|0)+12>>2]|0,j=+g[h+8>>2],k=+g[i+8>>2]-j,l=+g[h+12>>2],m=+g[i+12>>2]-l,n=+g[h+16>>2],o=+g[i+16>>2]-n,p=+g[e+(a*52|0)+28>>2],p+(k*k+m*m+o*o)>1.1920928955078125e-07):0){d=(p-(k*k+m*m+o*o))/(d*(p+(k*k+m*m+o*o)))*b;q=d*+g[h+88>>2];g[h+8>>2]=j-k*q;g[h+12>>2]=l-m*q;g[h+16>>2]=n-o*q;d=d*+g[i+88>>2];g[i+8>>2]=+g[i+8>>2]+k*d;g[i+12>>2]=m*d+ +g[i+12>>2];g[i+16>>2]=o*d+ +g[i+16>>2]}a=a+1|0}while((a|0)!=(f|0));return}function Qi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;while(1){j=c[a+12>>2]|0;l=c[j+(((b+d|0)/2|0)<<3)>>2]|0;f=d;e=b;while(1){while(1){i=j+(e<<3)|0;k=e+1|0;if((c[i>>2]|0)<(l|0))e=k;else break}while(1){g=j+(f<<3)|0;h=f+-1|0;if((c[g>>2]|0)>(l|0))f=h;else break}if((e|0)<=(f|0)){j=c[i>>2]|0;e=c[i+4>>2]|0;m=c[g+4>>2]|0;c[i>>2]=c[g>>2];c[i+4>>2]=m;f=(c[a+12>>2]|0)+(f<<3)|0;c[f>>2]=j;c[f+4>>2]=e;f=h;e=k}if((e|0)>(f|0))break;j=c[a+12>>2]|0}if((f|0)>(b|0))Qi(a,b,f);if((e|0)<(d|0))b=e;else break}return}function Ri(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0;e=sa;sa=sa+96|0;c[e+32>>2]=1065353216;c[e+32+4>>2]=0;c[e+32+4+4>>2]=0;c[e+32+4+8>>2]=0;c[e+32+4+12>>2]=0;c[e+32+20>>2]=1065353216;c[e+32+24>>2]=0;c[e+32+24+4>>2]=0;c[e+32+24+8>>2]=0;c[e+32+24+12>>2]=0;c[e+32+40>>2]=1065353216;m=e+32+44|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[m+16>>2]=0;ab[c[(c[a>>2]|0)+8>>2]&127](a,e+32|0,e+16|0,e);l=+g[e>>2];k=+g[e+16>>2];j=+g[e+4>>2];i=+g[e+16+4>>2];h=+g[e+8>>2];f=+g[e+16+8>>2];g[d>>2]=+x(+((l-k)*(l-k)+(j-i)*(j-i)+(h-f)*(h-f)))*.5;g[b>>2]=(l+k)*.5;g[b+4>>2]=(j+i)*.5;g[b+8>>2]=(h+f)*.5;g[b+12>>2]=0.0;sa=e;return}function Si(){var b=0,d=0;d=Gs()|0;c[d+8>>2]=0;c[d>>2]=9100;a[d+28>>0]=1;c[d+24>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+32>>2]=1566444395;c[d+36>>2]=1566444395;c[d+40>>2]=1566444395;g[d+44>>2]=0.0;c[d+48>>2]=-581039253;c[d+52>>2]=-581039253;c[d+56>>2]=-581039253;g[d+60>>2]=0.0;c[d+64>>2]=0;c[d+68>>2]=1;g[d+72>>2]=0.0;c[d+76>>2]=1065353216;c[d+80>>2]=1065353216;c[d+84>>2]=1065353216;g[d+88>>2]=0.0;c[d+4>>2]=31;c[7182]=(c[7182]|0)+1;b=xb(79)|0;if(!b)b=0;else{c[(b+4+15&-16)+-4>>2]=b;b=b+4+15&-16}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;a[b+56>>0]=1;c[b+52>>2]=0;c[b+44>>2]=0;c[b+48>>2]=0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=-1;c[b+12>>2]=0;c[b+16>>2]=0;c[d+64>>2]=b;return d|0}function Ti(a,d,f,h){a=a|0;d=d|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0,m=0;i=c[a+108>>2]|0;if(i|0){ab[c[(c[i>>2]|0)+28>>2]&127](i,d,f,h);return}i=b[a+56>>1]|0;if(!(i<<16>>16))return;m=1;k=1;do{j=c[a+68>>2]|0;if(b[j+(k<<2)>>1]&1){l=c[a+60>>2]|0;k=e[j+(k<<2)+2>>1]|0;if(!(+g[d>>2]>+g[l+(k<<6)+32>>2])?!(+g[f>>2]<+g[l+(k<<6)+16>>2]):0)j=1;else j=0;if(!(!(+g[d+8>>2]>+g[l+(k<<6)+40>>2])?!(+g[f+8>>2]<+g[l+(k<<6)+24>>2]):0))j=0;if(!(+g[d+4>>2]>+g[l+(k<<6)+36>>2])?!(+g[f+4>>2]<+g[l+(k<<6)+20>>2]|j^1):0){Ha[c[(c[h>>2]|0)+8>>2]&31](h,l+(k<<6)|0)|0;i=b[a+56>>1]|0}}m=m+1<<16>>16;k=m&65535}while(((i&65535)<<1|1)>>>0>k>>>0);return}function Ui(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0;h=+g[b>>2];i=+g[b+16>>2];j=h>2];if((j+g[a+24>>2])return;k=h>i?b:b+16|0;if(+g[(+g[k>>2]>f?k:b+32|0)>>2]<+g[a+8>>2])return;f=+g[b+8>>2];h=+g[b+24>>2];j=f>2];if((j+g[a+32>>2])return;k=f>h?b+8|0:b+24|0;if(+g[(+g[k>>2]>i?k:b+40|0)>>2]<+g[a+16>>2])return;f=+g[b+4>>2];h=+g[b+20>>2];j=f>2];if((j+g[a+28>>2])return;k=f>h?b+4|0:b+20|0;if(+g[(+g[k>>2]>i?k:b+36|0)>>2]<+g[a+12>>2])return;k=c[a+4>>2]|0;ab[c[(c[k>>2]|0)+8>>2]&127](k,b,d,e);return}function Vi(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0.0,i=0;f=sa;sa=sa+16|0;c[a+4>>2]=c[b+24>>2];e=c[b>>2]|0;c[a+8>>2]=e;if(d){c[a+52>>2]=c[b+8>>2];c[a+52+4>>2]=c[b+8+4>>2];c[a+52+8>>2]=c[b+8+8>>2];c[a+52+12>>2]=c[b+8+12>>2];i=a+68|0;d=a+20|0;e=a+36|0;h=+g[b+24>>2];pp(i,d,e,h);h=+g[b+24>>2];sa=f;return +h}else{d=JI(oI(e)|0)|0;vl(f,d,+g[b+8>>2],+g[b+12>>2],+g[b+16>>2]);c[a+52>>2]=c[f>>2];c[a+52+4>>2]=c[f+4>>2];c[a+52+8>>2]=c[f+8>>2];c[a+52+12>>2]=c[f+12>>2];d=a+68|0;e=a+20|0;i=a+36|0;h=+g[b+24>>2];pp(d,e,i,h);h=+g[b+24>>2];sa=f;return +h}return 0.0}function Wi(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;var h=0,i=0.0,j=0.0,k=0.0;h=sa;sa=sa+16|0;g[b+32>>2]=f;c[b+8>>2]=c[d>>2];c[b+8+4>>2]=c[d+4>>2];c[b+8+8>>2]=c[d+8>>2];c[b+8+12>>2]=c[d+12>>2];i=+g[b+28>>2];k=+g[e+4>>2]-i*+g[d+4>>2];j=+g[e+8>>2]-i*+g[d+8>>2];g[h>>2]=+g[e>>2]-+g[d>>2]*i;g[h+4>>2]=k;g[h+8>>2]=j;g[h+12>>2]=0.0;f=i+ +g[b+24>>2]+f;g[b+32>>2]=f;if(!(f<0.0)){b=b+4|0;b=c[b>>2]|0;e=c[b>>2]|0;e=e+16|0;e=c[e>>2]|0;_a[e&15](b,d,h,f);sa=h;return}a[b+36>>0]=1;b=b+4|0;b=c[b>>2]|0;e=c[b>>2]|0;e=e+16|0;e=c[e>>2]|0;_a[e&15](b,d,h,f);sa=h;return}function Xi(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;c[b>>2]=9036;d=c[b+8>>2]|0;g=c[d+8>>2]|0;if((g|0)>0){e=0;do{f=c[(c[d+16>>2]|0)+(e*12|0)+8>>2]|0;if(f|0){Pa[c[c[f>>2]>>2]&511](f);h=c[b+4>>2]|0;Va[c[(c[h>>2]|0)+60>>2]&127](h,f)}e=e+1|0}while((e|0)!=(g|0));d=c[b+8>>2]|0}gh(d);d=c[b+8>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+8>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+24>>2]|0;if(!d){a[b+28>>0]=1;c[b+24>>2]=0;c[b+16>>2]=0;h=b+20|0;c[h>>2]=0;return}if(a[b+28>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+24>>2]=0;a[b+28>>0]=1;c[b+24>>2]=0;c[b+16>>2]=0;h=b+20|0;c[h>>2]=0;return}function Yi(b,d){b=b|0;d=d|0;c[b+204>>2]=c[d+48>>2];c[b+208>>2]=c[d+52>>2];c[b+212>>2]=c[d+56>>2];c[b+216>>2]=c[d+60>>2];c[b+220>>2]=c[d+64>>2];c[b+224>>2]=c[d+68>>2];c[b+156>>2]=c[d>>2];c[b+156+4>>2]=c[d+4>>2];c[b+156+8>>2]=c[d+8>>2];c[b+156+12>>2]=c[d+12>>2];c[b+172>>2]=c[d+16>>2];c[b+172+4>>2]=c[d+16+4>>2];c[b+172+8>>2]=c[d+16+8>>2];c[b+172+12>>2]=c[d+16+12>>2];c[b+188>>2]=c[d+32>>2];c[b+188+4>>2]=c[d+32+4>>2];c[b+188+8>>2]=c[d+32+8>>2];c[b+188+12>>2]=c[d+32+12>>2];c[b+228>>2]=c[d+72>>2];g[b+232>>2]=0.0;g[b+252>>2]=0.0;g[b+236>>2]=0.0;g[b+240>>2]=0.0;g[b+256>>2]=0.0;g[b+244>>2]=.10000000149011612;a[b+260>>0]=a[d+80>>0]&1;c[b+248>>2]=c[d+76>>2];return}function Zi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;h=sa;sa=sa+224|0;f=h+160|0;g=f+40|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(g|0));c[h+208>>2]=c[e>>2];if((bc(0,d,h+208|0,h+80|0,h+160|0)|0)<0)e=-1;else{g=c[b>>2]|0;if((a[b+74>>0]|0)<1)c[b>>2]=g&-33;if(!(c[b+48>>2]|0)){f=c[b+44>>2]|0;c[b+44>>2]=h;c[b+28>>2]=h;c[b+20>>2]=h;c[b+48>>2]=80;c[b+16>>2]=h+80;e=bc(b,d,h+208|0,h+80|0,h+160|0)|0;if(f){Ja[c[b+36>>2]&63](b,0,0)|0;e=(c[b+20>>2]|0)==0?-1:e;c[b+44>>2]=f;c[b+48>>2]=0;c[b+16>>2]=0;c[b+28>>2]=0;c[b+20>>2]=0}}else e=bc(b,d,h+208|0,h+80|0,h+160|0)|0;d=c[b>>2]|0;c[b>>2]=d|g&32;e=(d&32|0)==0?e:-1}sa=h;return e|0}function _i(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0;f=sa;sa=sa+16|0;c[b+4>>2]=d;c[b>>2]=7356;c[b+8>>2]=-1;c[b+12>>2]=-1;g[b+16>>2]=3402823466385288598117041.0e14;a[b+20>>0]=1;a[b+21>>0]=0;c[b+24>>2]=-1;c[b+28>>2]=e;if((a[26704]|0)==0?mz(26704)|0:0){c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;Cf(27392,0.0,0,0,f)}c[6899]=c[6899]|1;g[6934]=0.0;h=+g[6944]*0.0;i=+g[6945]*0.0;g[6939]=+g[6943]*0.0;g[6940]=h;g[6941]=i;g[6942]=0.0;c[6947]=0;c[6948]=0;c[6949]=0;c[6950]=0;i=+g[6936]*0.0;h=+g[6937]*0.0;g[6988]=+g[6935]*0.0;g[6989]=i;g[6990]=h;g[6991]=0.0;c[b+32>>2]=27392;g[b+36>>2]=0.0;g[b+40>>2]=.30000001192092896;c[b+44>>2]=0;sa=f;return}function $i(a){a=a|0;var b=0;c[a>>2]=5828;b=c[a+92>>2]|0;Pa[c[c[b>>2]>>2]&511](b);b=c[a+92>>2]|0;if(b|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}b=c[a+96>>2]|0;Pa[c[c[b>>2]>>2]&511](b);b=c[a+96>>2]|0;if(b|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}b=c[a+100>>2]|0;Pa[c[c[b>>2]>>2]&511](b);b=c[a+100>>2]|0;if(b|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}b=c[a+104>>2]|0;Pa[c[c[b>>2]>>2]&511](b);b=c[a+104>>2]|0;if(b|0){c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0)}b=c[a+108>>2]|0;Pa[c[c[b>>2]>>2]&511](b);b=c[a+108>>2]|0;if(!b){se(a);return}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);se(a);return}function aj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;if((c[d+60>>2]|0)==2){g=c[d+48>>2]|0;sg(b+64|0,g)|0;f=c[b+68>>2]|0;if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[b+68>>2]=g;c[b+76>>2]=(c[b+76>>2]|0)+-1}else{f=c[d+48>>2]|0;sg(b+4|0,f)|0;g=c[b+8>>2]|0;if(g|0){c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0)}c[b+8>>2]=f;c[b+16>>2]=(c[b+16>>2]|0)+-1}f=c[d+52>>2]|0;if(!f)f=b+124+(c[d+60>>2]<<2)|0;else f=f+56|0;c[f>>2]=c[d+56>>2];f=c[d+56>>2]|0;if(f|0)c[f+52>>2]=c[d+52>>2];g=c[b+136>>2]|0;Za[c[(c[g>>2]|0)+16>>2]&127](g,d,e);c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);a[b+194>>0]=1;return}function bj(a){a=a|0;var b=0.0,c=0.0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0;n=+g[a+4>>2];h=+g[a+396>>2];m=+g[a+8>>2];e=+g[a+400>>2];l=+g[a+12>>2];c=+g[a+404>>2];k=+g[a+20>>2];j=+g[a+24>>2];i=+g[a+28>>2];f=+g[a+36>>2];d=+g[a+40>>2];b=+g[a+44>>2];g[a+264>>2]=n*h*n+m*e*m+l*c*l;g[a+268>>2]=n*h*k+m*e*j+l*c*i;g[a+272>>2]=n*h*f+m*e*d+l*c*b;g[a+276>>2]=0.0;g[a+280>>2]=h*k*n+e*j*m+c*i*l;g[a+284>>2]=h*k*k+e*j*j+c*i*i;g[a+288>>2]=h*k*f+e*j*d+c*i*b;g[a+292>>2]=0.0;g[a+296>>2]=h*f*n+e*d*m+c*b*l;g[a+300>>2]=h*f*k+e*d*j+c*b*i;g[a+304>>2]=h*f*f+e*d*d+c*b*b;g[a+308>>2]=0.0;return}function cj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;c[b>>2]=8440;e=c[b+8>>2]|0;d=c[b+16>>2]|0;if((e|0)>0){h=0;do{f=(c[d+(h<<2)>>2]|0)+188|0;g=c[f>>2]|0;if(g){e=c[b+68>>2]|0;e=Fa[c[(c[e>>2]|0)+36>>2]&127](e)|0;Za[c[(c[e>>2]|0)+40>>2]&127](e,g,c[b+24>>2]|0);e=c[b+68>>2]|0;Za[c[(c[e>>2]|0)+12>>2]&127](e,g,c[b+24>>2]|0);c[f>>2]=0;e=c[b+8>>2]|0;d=c[b+16>>2]|0}h=h+1|0}while((h|0)<(e|0))}if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function dj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0.0,j=0,k=0.0,l=0,m=0.0;j=c[b+52>>2]|0;l=c[j+32>>2]|0;b=c[l>>2]|0;m=+g[d>>2];k=+g[d+4>>2];i=+g[d+8>>2];j=c[j+24>>2]|0;if((j|0)<=1){l=b;l=l+8|0;c[a>>2]=c[l>>2];c[a+4>>2]=c[l+4>>2];c[a+8>>2]=c[l+8>>2];c[a+12>>2]=c[l+12>>2];return}d=0;h=1;e=m*+g[b+8>>2]+k*+g[b+12>>2]+i*+g[b+16>>2];while(1){b=c[l+(h<<2)>>2]|0;f=m*+g[b+8>>2]+k*+g[b+12>>2]+i*+g[b+16>>2];b=f>e;d=b?h:d;h=h+1|0;if((h|0)==(j|0))break;else e=b?f:e}l=c[l+(d<<2)>>2]|0;l=l+8|0;c[a>>2]=c[l>>2];c[a+4>>2]=c[l+4>>2];c[a+8>>2]=c[l+8>>2];c[a+12>>2]=c[l+12>>2];return}function ej(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0,h=0,i=0.0,j=0.0;c[a+248>>2]=c[b>>2];c[a+248+4>>2]=c[b+4>>2];c[a+248+8>>2]=c[b+8>>2];c[a+248+12>>2]=c[b+12>>2];d=c[a+232>>2]|0;if((d|0)<=0)return;h=0;do{f=c[(c[a+240>>2]|0)+(h<<2)>>2]|0;switch(c[f+216>>2]|0){case 2:case 5:break;default:if(!(c[f+504>>2]&1)){e=+g[f+344>>2];if(e!=0.0){j=1.0/e*+g[b+4>>2];i=1.0/e*+g[b+8>>2];g[f+364>>2]=1.0/e*+g[b>>2];g[f+368>>2]=j;g[f+372>>2]=i;g[f+376>>2]=0.0}c[f+380>>2]=c[b>>2];c[f+380+4>>2]=c[b+4>>2];c[f+380+8>>2]=c[b+8>>2];c[f+380+12>>2]=c[b+12>>2];d=c[a+232>>2]|0}}h=h+1|0}while((h|0)<(d|0));return}function fj(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0;if(a[b+738>>0]|0){c[d>>2]=0;c[d+4>>2]=0;return}c[d>>2]=5;c[d+4>>2]=1;e=+ui(b,(c[b+28>>2]|0)+4|0,(c[b+32>>2]|0)+4|0);g[b+728>>2]=e;g[b+708>>2]=0.0;g[b+712>>2]=0.0;a[b+716>>0]=0;f=+g[b+692>>2];do if(f>=0.0){e=(e-+g[b+688>>2])%6.2831854820251465;if(!(e<-3.1415927410125732)){if(e>3.1415927410125732)e=e+-6.2831854820251465}else e=e+6.2831854820251465;if(e<-f){a[b+716>>0]=1;g[b+708>>2]=-(f+e);g[b+712>>2]=1.0;break}if(e>f){a[b+716>>0]=1;g[b+708>>2]=f-e;g[b+712>>2]=-1.0}else h=12}else h=12;while(0);if((h|0)==12?(a[b+737>>0]|0)==0:0)return;c[d>>2]=6;c[d+4>>2]=0;return}function gj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=sa;sa=sa+96|0;g=c[b+192>>2]|0;c[f+64>>2]=0;c[f+64+4>>2]=g;c[f+64+8>>2]=b;c[f+64+12>>2]=b+4;c[f+64+16>>2]=-1;c[f+64+20>>2]=-1;b=c[d+192>>2]|0;c[f+40>>2]=0;c[f+40+4>>2]=b;c[f+40+8>>2]=d;c[f+40+12>>2]=d+4;c[f+40+16>>2]=-1;c[f+40+20>>2]=-1;b=c[a+24>>2]|0;b=Ka[c[(c[b>>2]|0)+8>>2]&31](b,f+64|0,f+40|0,0)|0;if(!b){sa=f;return}c[f+4>>2]=0;c[f+8>>2]=f+64;c[f+12>>2]=f+40;c[f>>2]=8784;c[f+32>>2]=e;eb[c[(c[b>>2]|0)+8>>2]&31](b,f+64|0,f+40|0,a+28|0,f);Pa[c[c[b>>2]>>2]&511](b);g=c[a+24>>2]|0;Va[c[(c[g>>2]|0)+60>>2]&127](g,b);sa=f;return}function hj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;k=c[b+8>>2]|0;if((k|0)<=0)return;j=c[b+16>>2]|0;i=0;b=0;do{h=c[j+(i<<2)>>2]|0;if(!(c[h+204>>2]&3)){g=c[a+16>>2]|0;d=g+(b<<3)|0;e=c[d>>2]|0;if((e|0)!=(b|0)){c[d>>2]=c[g+(e<<3)>>2];d=c[g+(e<<3)>>2]|0;e=c[g+(d<<3)>>2]|0;if((d|0)!=(e|0)){f=g+(d<<3)|0;do{d=g+(e<<3)|0;c[f>>2]=c[d>>2];d=c[d>>2]|0;f=g+(d<<3)|0;e=c[f>>2]|0}while((d|0)!=(e|0))}}else d=b;c[h+208>>2]=d;c[g+(b<<3)+4>>2]=i;c[h+212>>2]=-1;b=b+1|0}else{c[h+208>>2]=-1;c[h+212>>2]=-2}i=i+1|0}while((i|0)!=(k|0));return}function ij(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0,h=0.0,i=0.0,k=0.0;e=c[a+204>>2]|0;if(b==0.0){c[a+204>>2]=e|1;h=0.0}else{c[a+204>>2]=e&-2;h=1.0/b}g[a+344>>2]=h;k=+g[a+384>>2]*b;i=+g[a+388>>2]*b;g[a+364>>2]=+g[a+380>>2]*b;g[a+368>>2]=k;g[a+372>>2]=i;g[a+376>>2]=0.0;b=+g[d>>2];f=b!=0.0?(g[j>>2]=1.0/b,c[j>>2]|0):0;b=+g[d+4>>2];e=b!=0.0?(g[j>>2]=1.0/b,c[j>>2]|0):0;b=+g[d+8>>2];d=b!=0.0?(g[j>>2]=1.0/b,c[j>>2]|0):0;c[a+396>>2]=f;c[a+400>>2]=e;c[a+404>>2]=d;g[a+408>>2]=0.0;i=h*+g[a+352>>2];k=h*+g[a+356>>2];g[a+560>>2]=+g[a+348>>2]*h;g[a+564>>2]=i;g[a+568>>2]=k;g[a+572>>2]=0.0;return}function jj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=c[b+280>>2]|0;if((e|0)==(c[b+284>>2]|0)?(h=(e|0)==0?1:e<<1,(e|0)<(h|0)):0){if(!h)g=0;else{c[7182]=(c[7182]|0)+1;e=xb((h<<2|3)+16|0)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}g=e;e=c[b+280>>2]|0}if((e|0)>0){f=0;do{c[g+(f<<2)>>2]=c[(c[b+288>>2]|0)+(f<<2)>>2];f=f+1|0}while((f|0)!=(e|0))}f=c[b+288>>2]|0;if(f){if(a[b+292>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);e=c[b+280>>2]|0}c[b+288>>2]=0}a[b+292>>0]=1;c[b+288>>2]=g;c[b+284>>2]=h}c[(c[b+288>>2]|0)+(e<<2)>>2]=d;c[b+280>>2]=e+1;return}function kj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0,i=0.0,j=0,k=0.0,l=0;k=+g[b+60>>2]*.5;l=c[b+68>>2]|0;e=+g[d>>2];f=+g[d+4>>2];i=+g[d+8>>2];i=+x(+(e*e+f*f+i*i));h=c[b+64>>2]|0;if(+g[d+(l<<2)>>2]>+g[b+52>>2]*i){g[a+(h<<2)>>2]=0.0;g[a+(l<<2)>>2]=k;k=0.0;l=c[b+72>>2]|0;l=a+(l<<2)|0;g[l>>2]=k;return}i=+g[d+(h<<2)>>2];j=c[b+72>>2]|0;e=+g[d+(j<<2)>>2];f=+x(+(i*i+e*e));if(f>1.1920928955078125e-07){f=+g[b+56>>2]/f;g[a+(h<<2)>>2]=i*f;g[a+(l<<2)>>2]=-k;k=e*f;l=j;l=a+(l<<2)|0;g[l>>2]=k;return}else{g[a+(h<<2)>>2]=0.0;g[a+(l<<2)>>2]=-k;k=0.0;l=j;l=a+(l<<2)|0;g[l>>2]=k;return}}function lj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=c[e+16>>2]|0;if(!f)if(!(_n(e)|0)){g=c[e+16>>2]|0;h=5}else f=0;else{g=f;h=5}a:do if((h|0)==5){f=c[e+20>>2]|0;if((g-f|0)>>>0>>0){f=Ja[c[e+36>>2]&63](e,b,d)|0;break}b:do if((a[e+75>>0]|0)<0|(d|0)==0){i=0;g=b}else{h=d;while(1){g=h+-1|0;if((a[b+g>>0]|0)==10)break;if(!g){i=0;g=b;break b}else h=g}f=Ja[c[e+36>>2]&63](e,b,h)|0;if(f>>>0>>0)break a;i=h;g=b+h|0;d=d-h|0;f=c[e+20>>2]|0}while(0);Bh(f|0,g|0,d|0)|0;c[e+20>>2]=(c[e+20>>2]|0)+d;f=i+d|0}while(0);return f|0}function mj(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0;e=sa;sa=sa+96|0;c[e+32>>2]=1065353216;c[e+32+4>>2]=0;c[e+32+4+4>>2]=0;c[e+32+4+8>>2]=0;c[e+32+4+12>>2]=0;c[e+32+20>>2]=1065353216;c[e+32+24>>2]=0;c[e+32+24+4>>2]=0;c[e+32+24+8>>2]=0;c[e+32+24+12>>2]=0;c[e+32+40>>2]=1065353216;j=e+32+44|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;ab[c[(c[a>>2]|0)+8>>2]&127](a,e+32|0,e+16|0,e);h=(+g[e>>2]-+g[e+16>>2])*.5*2.0;f=(+g[e+4>>2]-+g[e+16+4>>2])*.5*2.0;i=(+g[e+8>>2]-+g[e+16+8>>2])*.5*2.0;g[d>>2]=b/12.0*(f*f+i*i);g[d+4>>2]=b/12.0*(h*h+i*i);g[d+8>>2]=b/12.0*(h*h+f*f);sa=e;return}function nj(b,d){b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;e=rs()|0;_i(e,3,b);c[e>>2]=7304;c[e+300>>2]=c[d>>2];c[e+300+4>>2]=c[d+4>>2];c[e+300+8>>2]=c[d+8>>2];c[e+300+12>>2]=c[d+12>>2];k=+g[d>>2];j=+g[d+4>>2];i=+g[d+8>>2];h=k*+g[b+20>>2]+j*+g[b+24>>2]+i*+g[b+28>>2]+ +g[b+56>>2];f=k*+g[b+36>>2]+j*+g[b+40>>2]+i*+g[b+44>>2]+ +g[b+60>>2];g[e+316>>2]=k*+g[b+4>>2]+j*+g[b+8>>2]+i*+g[b+12>>2]+ +g[b+52>>2];g[e+320>>2]=h;g[e+324>>2]=f;g[e+328>>2]=0.0;c[e+332>>2]=0;a[e+344>>0]=0;g[e+348>>2]=.30000001192092896;g[e+352>>2]=1.0;g[e+356>>2]=0.0;return e|0}function oj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;e=sa;sa=sa+16|0;Za[c[(c[b>>2]|0)+68>>2]&127](e,b,d);c[a>>2]=c[e>>2];c[a+4>>2]=c[e+4>>2];c[a+8>>2]=c[e+8>>2];c[a+12>>2]=c[e+12>>2];if(!(+va[c[(c[b>>2]|0)+48>>2]&15](b)!=0.0)){sa=e;return}i=+g[d>>2];f=+g[d+4>>2];h=+g[d+8>>2];k=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:i;j=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:f;h=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:h;f=1.0/+x(+(h*h+(k*k+j*j)));i=+va[c[(c[b>>2]|0)+48>>2]&15](b);g[a>>2]=+g[a>>2]+i*k*f;g[a+4>>2]=+g[a+4>>2]+i*j*f;g[a+8>>2]=+g[a+8>>2]+i*h*f;sa=e;return}function pj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;a:do switch(b|0){case 2:{if((c|0)<1){d=+g[a+232>>2];break a}if((c|0)<3){d=+g[a+264>>2];break a}if((c|0)==3){d=+g[a+248>>2];break a}if((c|0)<6)d=+g[a+280>>2];else d=3402823466385288598117041.0e14;break}case 3:{if((c|0)<1){d=+g[a+212>>2];break a}if((c|0)==3)d=+g[a+228>>2];else d=3402823466385288598117041.0e14;break}case 4:{if((c|0)<1){d=+g[a+244>>2];break a}if((c|0)<3){d=+g[a+276>>2];break a}if((c|0)==3){d=+g[a+260>>2];break a}if((c|0)<6)d=+g[a+292>>2];else d=3402823466385288598117041.0e14;break}default:d=3402823466385288598117041.0e14}while(0);return +d}function qj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,h=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0,o=0.0,p=0.0;n=c[b+96>>2]|0;if((n|0)<=0){c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;return}o=+g[b+12>>2];p=+g[d>>2]*o;k=+g[b+16>>2];l=+g[d+4>>2]*k;m=+g[b+20>>2];j=+g[d+8>>2]*m;f=c[b+104>>2]|0;d=-1;b=0;e=-3402823466385288598117041.0e14;while(1){h=p*+g[f+(b<<4)>>2]+l*+g[f+(b<<4)+4>>2]+j*+g[f+(b<<4)+8>>2];i=h>e;d=i?b:d;b=b+1|0;if((b|0)==(n|0))break;else e=i?h:e}l=k*+g[f+(d<<4)+4>>2];p=m*+g[f+(d<<4)+8>>2];g[a>>2]=o*+g[f+(d<<4)>>2];g[a+4>>2]=l;g[a+8>>2]=p;g[a+12>>2]=0.0;return}function rj(){var b=0;b=_r()|0;c[b>>2]=7568;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;c[b+72>>2]=0;a[b+100>>0]=1;c[b+96>>2]=0;c[b+88>>2]=0;c[b+92>>2]=0;a[b+120>>0]=1;c[b+116>>2]=0;c[b+108>>2]=0;c[b+112>>2]=0;a[b+140>>0]=1;c[b+136>>2]=0;c[b+128>>2]=0;c[b+132>>2]=0;a[b+160>>0]=1;c[b+156>>2]=0;c[b+148>>2]=0;c[b+152>>2]=0;a[b+180>>0]=1;c[b+176>>2]=0;c[b+168>>2]=0;c[b+172>>2]=0;c[b+192>>2]=0;return b|0}function sj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;c[7161]=(c[7161]|0)+1;f=(c[b+12>>2]|0)>(c[d+12>>2]|0);g=c[(f?d:b)+12>>2]|0;f=c[(f?b:d)+12>>2]|0;b=(f<<16|g)+~((f<<16|g)<<15)|0;b=((10?b>>10:b)^b)*9|0;b=(6?b>>6:b)^b;b=((16?b+~(b<<11)>>16:b+~(b<<11)|0)^b+~(b<<11))&(c[a+12>>2]|0)+-1;if((b|0)>=(c[a+36>>2]|0)){g=0;return g|0}b=c[(c[a+44>>2]|0)+(b<<2)>>2]|0;if((b|0)==-1){g=0;return g|0}e=c[a+16>>2]|0;d=b;while(1){b=e+(d<<4)|0;if((c[(c[b>>2]|0)+12>>2]|0)==(g|0)?(c[(c[e+(d<<4)+4>>2]|0)+12>>2]|0)==(f|0):0){d=7;break}d=c[(c[a+64>>2]|0)+(d<<2)>>2]|0;if((d|0)==-1){b=0;d=7;break}}if((d|0)==7)return b|0;return 0}function tj(a,b,d){a=a|0;b=+b;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;e=+g[a+28>>2];i=+g[a+32>>2];k=+g[a+36>>2];l=+va[c[(c[a>>2]|0)+48>>2]&15](a);j=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+va[c[(c[a>>2]|0)+48>>2]&15](a)+k;switch(c[a+52>>2]|0){case 0:{h=b*.25*(j+i)*(j+i)+b/12.0*(l+e)*(l+e)*4.0;f=h;e=b*.5*(j+i)*(j+i);break}case 2:{f=b*.5*(l+e)*(l+e);h=b*.25*(l+e)*(l+e)+b/12.0*k*k*4.0;e=b*.25*(l+e)*(l+e)+b/12.0*k*k*4.0;break}default:{k=b*.25*(l+e)*(l+e)+b/12.0*(j+i)*(j+i)*4.0;f=k;h=b*.5*(l+e)*(l+e);e=k}}g[d>>2]=e;g[d+4>>2]=h;g[d+8>>2]=f;g[d+12>>2]=0.0;return}function uj(b){b=b|0;var d=0;c[b>>2]=6632;if(a[b+456>>0]|0?(d=c[b+452>>2]|0,Pa[c[c[d>>2]>>2]&511](d),d=c[b+452>>2]|0,d|0):0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}d=c[b+420>>2]|0;if(d|0){if(a[b+424>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+420>>2]=0}a[b+424>>0]=1;c[b+420>>2]=0;c[b+412>>2]=0;c[b+416>>2]=0;d=c[b+336>>2]|0;if(!d){a[b+340>>0]=1;c[b+336>>2]=0;c[b+328>>2]=0;d=b+332|0;c[d>>2]=0;ag(b);return}if(a[b+340>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+336>>2]=0;a[b+340>>0]=1;c[b+336>>2]=0;c[b+328>>2]=0;d=b+332|0;c[d>>2]=0;ag(b);return}function vj(a,b){a=a|0;b=b|0;var d=0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;d=sa;sa=sa+64|0;c[d+48>>2]=0;c[d+48+4>>2]=0;c[d+48+8>>2]=0;c[d+48+12>>2]=0;i=+g[b>>2];f=+g[b+4>>2];l=+g[b+8>>2];j=+g[b+12>>2];h=i*(2.0/(i*i+f*f+l*l+j*j));e=f*(2.0/(i*i+f*f+l*l+j*j));k=l*(2.0/(i*i+f*f+l*l+j*j));g[d>>2]=1.0-(f*e+l*k);g[d+4>>2]=i*e-j*k;g[d+8>>2]=i*k+j*e;g[d+12>>2]=0.0;g[d+16>>2]=i*e+j*k;g[d+20>>2]=1.0-(i*h+l*k);g[d+24>>2]=f*k-j*h;g[d+28>>2]=0.0;g[d+32>>2]=i*k-j*e;g[d+36>>2]=f*k+j*h;g[d+40>>2]=1.0-(i*h+f*e);g[d+44>>2]=0.0;Vc(a,d);sa=d;return}function wj(a,b){a=a|0;b=+b;var d=0,e=0,f=0;e=sa;sa=sa+16|0;Ki(16231);if((c[a+280>>2]|0)>0){d=0;do{f=c[(c[a+288>>2]|0)+(d<<2)>>2]|0;Wa[c[(c[f>>2]|0)+8>>2]&7](f,a,b);d=d+1|0}while((d|0)<(c[a+280>>2]|0))}d=c[3084]|0;f=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=f;if(f|0){sa=e;return}do if(c[d+4>>2]|0){la(e|0,0)|0;f=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[e+4>>2]|0)-(c[f+4>>2]|0)+(((c[e>>2]|0)-(c[f>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=e;return}}while(0);c[3084]=c[d+20>>2];sa=e;return}function xj(b,d,e,f){b=b|0;d=d|0;e=+e;f=f|0;var h=0;h=cs()|0;c[h>>2]=7684;a[h+144>>0]=1;c[h+140>>2]=0;c[h+132>>2]=0;c[h+136>>2]=0;c[h+176>>2]=f;g[h+56>>2]=.019999999552965164;c[h+60>>2]=0;c[h+60+4>>2]=0;c[h+60+8>>2]=0;c[h+60+12>>2]=0;a[h+170>>0]=1;c[h+8>>2]=b;g[h+52>>2]=e;g[h+48>>2]=0.0;c[h+12>>2]=d;a[h+171>>0]=1;g[h+172>>2]=0.0;g[h+16>>2]=0.0;g[h+20>>2]=0.0;g[h+44>>2]=29.399999618530273;g[h+24>>2]=55.0;g[h+28>>2]=10.0;a[h+168>>0]=0;a[h+169>>0]=0;a[h+180>>0]=1;g[h+36>>2]=.7853981852531433;g[h+40>>2]=.7071067690849304;g[h+108>>2]=0.0;a[h+181>>0]=0;a[h+182>>0]=0;return h|0}function yj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0.0,i=0.0,k=0.0,l=0,m=0,n=0;f=sa;sa=sa+48|0;Za[c[(c[a>>2]|0)+124>>2]&127](a,f+32|0,e);n=c[f+32>>2]|0;m=c[f+32+4>>2]|0;l=c[f+32+8>>2]|0;c[b>>2]=n;c[b+4>>2]=m;c[b+8>>2]=l;g[b+12>>2]=0.0;e=c[(c[a>>2]|0)+64>>2]|0;k=-(c[j>>2]=n,+g[j>>2]);i=-(c[j>>2]=m,+g[j>>2]);h=-(c[j>>2]=l,+g[j>>2]);g[f>>2]=k;g[f+4>>2]=i;g[f+8>>2]=h;g[f+12>>2]=0.0;Za[e&127](f+16|0,a,f);c[d>>2]=c[f+16>>2];c[d+4>>2]=c[f+16+4>>2];c[d+8>>2]=c[f+16+8>>2];c[d+12>>2]=c[f+16+12>>2];sa=f;return}function zj(b,d){b=b|0;d=d|0;var e=0,f=0;e=c[b+28>>2]|0;f=c[b+32>>2]|0;if(!(a[b+1301>>0]|0)){yf(b,d,hf(b,d,0,e+4|0,f+4|0,e+312|0,f+312|0,e+328|0,f+328|0)|0,e+4|0,f+4|0,e+312|0,f+312|0,e+328|0,f+328|0)|0;return}else{hf(b,d,yf(b,d,0,e+4|0,f+4|0,e+312|0,f+312|0,e+328|0,f+328|0)|0,e+4|0,f+4|0,e+312|0,f+312|0,e+328|0,f+328|0)|0;return}}function Aj(a,b,d){a=a|0;b=b|0;d=d|0;do if(!((b|0)==8&(d|0)==8)){if((b|0)==8&(d|0)==1){a=a+76|0;break}if((b|0)==1&(d|0)==8){a=a+80|0;break}if(!(d|b)){a=a+72|0;break}if((b|0)<20&(d|0)==28){a=a+88|0;break}if((b|0)==28&(d|0)<20){a=a+84|0;break}if((b|0)<20){if((d|0)<20){a=a+32|0;break}if((d+-21|0)>>>0<9){a=a+36|0;break}}else{if((d|0)<20&(b+-21|0)>>>0<9){a=a+40|0;break}if((b|0)==31)if((d|0)==31){a=a+48|0;break}else{a=a+44|0;break}}if((d|0)==31){a=a+52|0;break}else{a=a+56|0;break}}else a=a+60|0;while(0);return c[a>>2]|0}function Bj(a,b,d,e,f){a=a|0;b=b|0;d=+d;e=e|0;f=f|0;var h=0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;h=sa;sa=sa+48|0;c[h+32>>2]=e;c[h+32+4>>2]=f;m=+g[b>>2];l=+g[b+4>>2];i=+g[b+8>>2];k=+g[a+56>>2]*m+ +g[a+60>>2]*l+ +g[a+64>>2]*i;j=m*+g[a+72>>2]+l*+g[a+76>>2]+i*+g[a+80>>2];i=m*+g[a+88>>2]+l*+g[a+92>>2]+i*+g[a+96>>2];c[h>>2]=c[a+48>>2];c[h+4>>2]=h+32;g[h+8>>2]=k;g[h+12>>2]=j;g[h+16>>2]=i;g[h+20>>2]=0.0;g[h+24>>2]=d;f=c[a+44>>2]|0;d=+ya[c[(c[f>>2]|0)+12>>2]&15](f,h,1);sa=h;return +d}function Cj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=sa;sa=sa+16|0;c[a+4>>2]=c[b+40>>2];e=c[b>>2]|0;c[a+76>>2]=e;if(d){c[a+44>>2]=c[b+8>>2];c[a+44+4>>2]=c[b+8+4>>2];c[a+44+8>>2]=c[b+8+8>>2];c[a+44+12>>2]=c[b+8+12>>2]}else{e=JI(oI(e)|0)|0;vl(f,e,+g[b+8>>2],+g[b+12>>2],+g[b+16>>2]);c[a+44>>2]=c[f>>2];c[a+44+4>>2]=c[f+4>>2];c[a+44+8>>2]=c[f+8>>2];c[a+44+12>>2]=c[f+12>>2]}c[a+60>>2]=c[b+24>>2];c[a+60+4>>2]=c[b+24+4>>2];c[a+60+8>>2]=c[b+24+8>>2];c[a+60+12>>2]=c[b+24+12>>2];sa=f;return +(+g[b+40>>2])}function Dj(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;if(e>>>0<3)switch(b|0){case 2:{g[a+756+(e<<2)>>2]=d;c[a+1304>>2]=c[a+1304>>2]|4<>2]=d;c[a+1304>>2]=c[a+1304>>2]|2<>2]=d;c[a+1304>>2]=c[a+1304>>2]|1<>>0>=3)return;switch(b|0){case 2:{g[a+868+(e+-3<<6)+32>>2]=d;c[a+1304>>2]=c[a+1304>>2]|4<>2]=d;c[a+1304>>2]=c[a+1304>>2]|2<>2]=d;c[a+1304>>2]=c[a+1304>>2]|1<>2]=7684;a[f+144>>0]=1;c[f+140>>2]=0;c[f+132>>2]=0;c[f+136>>2]=0;c[f+176>>2]=1;g[f+56>>2]=.019999999552965164;c[f+60>>2]=0;c[f+60+4>>2]=0;c[f+60+8>>2]=0;c[f+60+12>>2]=0;a[f+170>>0]=1;c[f+8>>2]=b;g[f+52>>2]=e;g[f+48>>2]=0.0;c[f+12>>2]=d;a[f+171>>0]=1;g[f+172>>2]=0.0;g[f+16>>2]=0.0;g[f+20>>2]=0.0;g[f+44>>2]=29.399999618530273;g[f+24>>2]=55.0;g[f+28>>2]=10.0;a[f+168>>0]=0;a[f+169>>0]=0;a[f+180>>0]=1;g[f+36>>2]=.7853981852531433;g[f+40>>2]=.7071067690849304;g[f+108>>2]=0.0;a[f+181>>0]=0;a[f+182>>0]=0;return f|0}function Fj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0;a=JI(a)|0;d=+g[a+8>>2];if(+xI(d)>.7071067690849304){f=+g[a+4>>2];e=1.0/+wI(f*f+d*d);b=JI(b)|0;g[b>>2]=0.0;g[b+4>>2]=-(+g[a+8>>2]*e);g[b+8>>2]=+g[a+4>>2]*e;c=JI(c)|0;g[c>>2]=(f*f+d*d)*e;g[c+4>>2]=-(+g[a>>2]*+g[b+8>>2]);g[c+8>>2]=+g[a>>2]*+g[b+4>>2];return}else{d=+g[a>>2];e=+g[a+4>>2];f=1.0/+wI(d*d+e*e);b=JI(b)|0;g[b>>2]=-(e*f);h=+g[a>>2]*f;g[b+4>>2]=h;g[b+8>>2]=0.0;h=-(+g[a+8>>2]*h);c=JI(c)|0;g[c>>2]=h;g[c+4>>2]=+g[a+8>>2]*+g[b>>2];g[c+8>>2]=(d*d+e*e)*f;return}}function Gj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0;h=rs()|0;c[h+4>>2]=3;c[h+8>>2]=-1;c[h+12>>2]=-1;g[h+16>>2]=3402823466385288598117041.0e14;a[h+20>>0]=1;a[h+21>>0]=0;c[h+24>>2]=-1;c[h+28>>2]=b;c[h+32>>2]=d;g[h+36>>2]=0.0;g[h+40>>2]=.30000001192092896;c[h+44>>2]=0;c[h>>2]=7304;c[h+300>>2]=c[e>>2];c[h+300+4>>2]=c[e+4>>2];c[h+300+8>>2]=c[e+8>>2];c[h+300+12>>2]=c[e+12>>2];c[h+316>>2]=c[f>>2];c[h+316+4>>2]=c[f+4>>2];c[h+316+8>>2]=c[f+8>>2];c[h+316+12>>2]=c[f+12>>2];c[h+332>>2]=0;a[h+344>>0]=0;g[h+348>>2]=.30000001192092896;g[h+352>>2]=1.0;g[h+356>>2]=0.0;return h|0}function Hj(b){b=b|0;var d=0;c[b>>2]=11632;d=c[b+64>>2]|0;if(d|0){if(a[b+68>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+64>>2]=0}a[b+68>>0]=1;c[b+64>>2]=0;c[b+56>>2]=0;c[b+60>>2]=0;d=c[b+44>>2]|0;if(d|0){if(a[b+48>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+44>>2]=0}a[b+48>>0]=1;c[b+44>>2]=0;c[b+36>>2]=0;c[b+40>>2]=0;d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function Ij(b){b=b|0;var d=0;c[b>>2]=7116;d=c[b+80>>2]|0;if(d|0){if(a[b+84>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+80>>2]=0}a[b+84>>0]=1;c[b+80>>2]=0;c[b+72>>2]=0;c[b+76>>2]=0;d=c[b+60>>2]|0;if(d|0){if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+60>>2]=0}a[b+64>>0]=1;c[b+60>>2]=0;c[b+52>>2]=0;c[b+56>>2]=0;d=c[b+40>>2]|0;if(!d){a[b+44>>0]=1;c[b+40>>2]=0;c[b+32>>2]=0;b=b+36|0;c[b>>2]=0;return}if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+40>>2]=0;a[b+44>>0]=1;c[b+40>>2]=0;c[b+32>>2]=0;b=b+36|0;c[b>>2]=0;return}function Jj(b){b=b|0;var d=0;c[b>>2]=8264;d=c[b+56>>2]|0;if(d|0){if(a[b+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+56>>2]=0}a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;d=c[b+36>>2]|0;if(d|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;d=c[b+16>>2]|0;if(!d){d=b+12|0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[d>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;d=b+12|0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[d>>2]=0;return}function Kj(b){b=b|0;var d=0;c[b>>2]=12232;d=c[b+60>>2]|0;if(d|0){if(a[b+64>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+60>>2]=0}a[b+64>>0]=1;c[b+60>>2]=0;c[b+52>>2]=0;c[b+56>>2]=0;d=c[b+40>>2]|0;if(d|0){if(a[b+44>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+40>>2]=0}a[b+44>>0]=1;c[b+40>>2]=0;c[b+32>>2]=0;c[b+36>>2]=0;d=c[b+16>>2]|0;if(!d){a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;b=b+12|0;c[b>>2]=0;return}function Lj(){var a=0,b=0,d=0,e=0;e=sa;sa=sa+48|0;a=Gr()|0;if(a|0?(d=c[a>>2]|0,d|0):0){b=c[d+48>>2]|0;a=c[d+48+4>>2]|0;if(!((b&-256|0)==1126902528&(a|0)==1129074247)){c[e+24>>2]=23928;Hu(23878,e+24|0)}if((b|0)==1126902529&(a|0)==1129074247)a=c[d+44>>2]|0;else a=d+80|0;c[e+36>>2]=a;d=c[d>>2]|0;a=c[d+4>>2]|0;if(Ek(5168,d,e+36|0)|0){d=c[e+36>>2]|0;d=Fa[c[(c[d>>2]|0)+8>>2]&127](d)|0;c[e>>2]=23928;c[e+4>>2]=a;c[e+8>>2]=d;Hu(23792,e)}else{c[e+16>>2]=23928;c[e+16+4>>2]=a;Hu(23837,e+16|0)}}Hu(23916,e+32|0)}function Mj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,156)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=6400;a[b+8>>0]=1;c[b+12>>2]=6612;c[b+60>>2]=d;c[b+64>>2]=0;a[b+88>>0]=1;c[b+84>>2]=0;c[b+76>>2]=0;c[b+80>>2]=0;a[b+108>>0]=1;c[b+104>>2]=0;c[b+96>>2]=0;c[b+100>>2]=0;a[b+128>>0]=1;c[b+124>>2]=0;c[b+116>>2]=0;c[b+120>>2]=0;a[b+148>>0]=1;c[b+144>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;c[b+16>>2]=c[f+8>>2];c[b+20>>2]=c[e+8>>2];Ai(b+72|0);return b|0}function Nj(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,156)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=6400;a[b+8>>0]=0;c[b+12>>2]=6612;c[b+60>>2]=d;c[b+64>>2]=0;a[b+88>>0]=1;c[b+84>>2]=0;c[b+76>>2]=0;c[b+80>>2]=0;a[b+108>>0]=1;c[b+104>>2]=0;c[b+96>>2]=0;c[b+100>>2]=0;a[b+128>>0]=1;c[b+124>>2]=0;c[b+116>>2]=0;c[b+120>>2]=0;a[b+148>>0]=1;c[b+144>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;c[b+16>>2]=c[e+8>>2];c[b+20>>2]=c[f+8>>2];Ai(b+72|0);return b|0}function Oj(a,b,d,e){a=a|0;b=+b;d=d|0;e=e|0;var f=0,h=0;f=sa;sa=sa+64|0;h=IH(d)|0;c[f+48>>2]=c[h>>2];c[f+48+4>>2]=c[h+4>>2];c[f+48+8>>2]=c[h+8>>2];c[f+48+12>>2]=c[h+12>>2];d=JI(d)|0;sr(f+32|0,d,1);sr(f+16|0,d,0);cb[c[(c[a>>2]|0)+64>>2]&1](a,f+48|0,f+32|0,f+16|0,b,-1.5707963705062866,1.5707963705062866,-1.5707963705062866,1.5707963705062866,e,30.0,0);d=c[(c[a>>2]|0)+64>>2]|0;Lq(f,+g[f+16>>2],+g[f+16+4>>2],+g[f+16+8>>2]);cb[d&1](a,f+48|0,f+32|0,f,b,-1.5707963705062866,1.5707963705062866,-1.5707963705062866,1.5707963705062866,e,30.0,0);sa=f;return}function Pj(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;h=h|0;var i=0;i=sa;sa=sa+64|0;c[i+48>>2]=f;c[i+48+4>>2]=h;f=c[a+212>>2]|0;if(!(+g[f+4>>2]>=e)){sa=i;return +e}c[i>>2]=c[a+216>>2];c[i+4>>2]=i+48;c[i+8>>2]=c[b>>2];c[i+8+4>>2]=c[b+4>>2];c[i+8+8>>2]=c[b+8>>2];c[i+8+12>>2]=c[b+12>>2];c[i+24>>2]=c[d>>2];c[i+24+4>>2]=c[d+4>>2];c[i+24+8>>2]=c[d+8>>2];c[i+24+12>>2]=c[d+12>>2];g[i+40>>2]=e;e=+ya[c[(c[f>>2]|0)+12>>2]&15](f,i,0);sa=i;return +e}function Qj(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;h=h|0;var i=0;i=sa;sa=sa+64|0;c[i+48>>2]=f;c[i+48+4>>2]=h;f=c[a+212>>2]|0;if(!(+g[f+4>>2]>=e)){sa=i;return +e}c[i>>2]=c[a+216>>2];c[i+4>>2]=i+48;c[i+8>>2]=c[b>>2];c[i+8+4>>2]=c[b+4>>2];c[i+8+8>>2]=c[b+8>>2];c[i+8+12>>2]=c[b+12>>2];c[i+24>>2]=c[d>>2];c[i+24+4>>2]=c[d+4>>2];c[i+24+8>>2]=c[d+8>>2];c[i+24+12>>2]=c[d+12>>2];g[i+40>>2]=e;e=+ya[c[(c[f>>2]|0)+12>>2]&15](f,i,1);sa=i;return +e}function Rj(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0;c=sa;sa=sa+48|0;d=2.0/+dF(b);f=+g[(JI(b)|0)>>2];e=+g[(oI(b)|0)>>2];i=+g[(nI(b)|0)>>2];h=+g[(mI(b)|0)>>2];g[c+32>>2]=1.0-(e*e*d+i*i*d);g[c+28>>2]=f*e*d-h*i*d;g[c+24>>2]=f*i*d+h*e*d;g[c+20>>2]=f*e*d+h*i*d;g[c+16>>2]=1.0-(f*f*d+i*i*d);g[c+12>>2]=e*i*d-h*f*d;g[c+8>>2]=f*i*d-h*e*d;g[c+4>>2]=e*i*d+h*f*d;g[c>>2]=1.0-(f*f*d+e*e*d);Lo(a,c+32|0,c+28|0,c+24|0,c+20|0,c+16|0,c+12|0,c+8|0,c+4|0,c);sa=c;return}function Sj(b,d){b=b|0;d=d|0;do if(b){if(d>>>0<128){a[b>>0]=d;b=1;break}if(!(c[7195]|0))if((d&-128|0)==57216){a[b>>0]=d;b=1;break}else{c[7184]=84;b=-1;break}if(d>>>0<2048){a[b>>0]=(6?d>>>6:d)|192;a[b+1>>0]=d&63|128;b=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=(12?d>>>12:d)|224;a[b+1>>0]=(6?d>>>6:d)&63|128;a[b+2>>0]=d&63|128;b=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=(18?d>>>18:d)|240;a[b+1>>0]=(12?d>>>12:d)&63|128;a[b+2>>0]=(6?d>>>6:d)&63|128;a[b+3>>0]=d&63|128;b=4;break}else{c[7184]=84;b=-1;break}}else b=1;while(0);return b|0}function Tj(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;e=sa;sa=sa+16|0;Za[c[(c[b>>2]|0)+68>>2]&127](e,b,d);c[a>>2]=c[e>>2];c[a+4>>2]=c[e+4>>2];c[a+8>>2]=c[e+8>>2];c[a+12>>2]=c[e+12>>2];i=+g[d>>2];f=+g[d+4>>2];h=+g[d+8>>2];k=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:i;j=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:f;h=i*i+f*f+h*h<1.4210854715202004e-14?-1.0:h;f=1.0/+x(+(h*h+(k*k+j*j)));i=+va[c[(c[b>>2]|0)+48>>2]&15](b);g[a>>2]=+g[a>>2]+i*k*f;g[a+4>>2]=+g[a+4>>2]+i*j*f;g[a+8>>2]=+g[a+8>>2]+i*h*f;sa=e;return}function Uj(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;d=sa;sa=sa+48|0;e=xG(b,0)|0;g[d+32>>2]=+Fo(c,e);g[d+28>>2]=+bo(c,e);g[d+24>>2]=+ao(c,e);e=xG(b,1)|0;g[d+20>>2]=+Fo(c,e);g[d+16>>2]=+bo(c,e);g[d+12>>2]=+ao(c,e);b=xG(b,2)|0;g[d+8>>2]=+Fo(c,b);g[d+4>>2]=+bo(c,b);g[d>>2]=+ao(c,b);Zp(a,d+32|0,d+28|0,d+24|0,d+20|0,d+16|0,d+12|0,d+8|0,d+4|0,d);sa=d;return}function Vj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=c[b+188>>2]|0;if(d|0){g=c[a+68>>2]|0;g=Fa[c[(c[g>>2]|0)+36>>2]&127](g)|0;Za[c[(c[g>>2]|0)+40>>2]&127](g,d,c[a+24>>2]|0);g=c[a+68>>2]|0;Za[c[(c[g>>2]|0)+12>>2]&127](g,d,c[a+24>>2]|0);c[b+188>>2]=0}f=c[a+8>>2]|0;if((f|0)<=0)return;g=c[a+16>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0)){h=9;break}}if((h|0)==9)return;if((d|0)>=(f|0))return;c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+16>>2]|0)+(f+-1<<2)>>2]=b;c[a+8>>2]=f+-1;return}function Wj(a,b,d,f){a=a|0;b=b|0;d=d|0;f=f|0;var g=0,h=0,i=0;while(1){g=c[a+12>>2]|0;if(!(((e[f>>1]|0)>=(e[a>>1]|0)?(e[d>>1]|0)<=(e[a+6>>1]|0):0)&(e[d+4>>1]|0)<=(e[a+10>>1]|0)&(e[f+4>>1]|0)>=(e[a+4>>1]|0)&(e[d+2>>1]|0)<=(e[a+8>>1]|0)&(e[f+2>>1]|0)>=(e[a+2>>1]|0))){h=6;break}if((g|0)>-1)break;i=a+16|0;Wj(i,b,d,f);g=c[a+28>>2]|0;a=(g|0)>-1?a+32|0:i+(0-g<<4)|0}if((h|0)==6)return;Za[c[(c[b>>2]|0)+8>>2]&127](b,21?g>>>21:g,g&2097151);return}function Xj(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;i=+z(+c);h=+A(+c);c=+g[b+444>>2];if(+w(+i)>1.1920928955078125e-07){j=+g[b+448>>2];e=h*h;f=i*i;c=+x(+((h*h/(i*i)+1.0)/(1.0/(j*j)+h*h/(i*i)/(c*c))))}else{e=h*h;f=i*i}c=c*.5;j=+A(+c)/+x(+(e+(f+0.0)));c=+z(+c);k=c*d+i*j*0.0-h*j*-0.0;f=c*0.0-h*j*d-j*0.0*0.0;e=c*0.0+j*0.0*0.0-i*j*d;d=-(j*0.0*d)-i*j*0.0-h*j*-0.0;g[a>>2]=h*j*f+(c*k+d*-(j*0.0))-e*-(i*j);g[a+4>>2]=e*-(j*0.0)+(c*f+d*-(i*j))-h*j*k;g[a+8>>2]=k*-(i*j)+(h*j*d+c*e)-f*-(j*0.0);g[a+12>>2]=0.0;return}function Yj(b,d){b=b|0;d=d|0;var e=0,f=0,h=0;g[b+16>>2]=0.0;g[b+20>>2]=0.0;a[b+168>>0]=0;a[b+169>>0]=0;g[b+172>>2]=0.0;c[b+60>>2]=0;c[b+60+4>>2]=0;c[b+60+8>>2]=0;c[b+60+12>>2]=0;b=c[(c[b+8>>2]|0)+284>>2]|0;if((c[(Fa[c[(c[b>>2]|0)+28>>2]&127](b)|0)+4>>2]|0)<=0)return;do{f=c[b>>2]|0;h=c[f+12>>2]|0;f=c[c[(Fa[c[f+28>>2]&127](b)|0)+12>>2]>>2]|0;e=c[(c[(Fa[c[(c[b>>2]|0)+28>>2]&127](b)|0)+12>>2]|0)+4>>2]|0;Ka[h&31](b,f,e,c[d+24>>2]|0)|0}while((c[(Fa[c[(c[b>>2]|0)+28>>2]&127](b)|0)+4>>2]|0)>0);return}function Zj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;c[7157]=(c[7157]|0)+-1;Va[c[(c[a>>2]|0)+20>>2]&127](a,b);e=c[b+768>>2]|0;d=(c[a+12>>2]|0)+-1|0;g=c[a+20>>2]|0;f=c[g+(e<<2)>>2]|0;c[g+(e<<2)>>2]=c[g+(d<<2)>>2];c[(c[a+20>>2]|0)+(d<<2)>>2]=f;c[(c[(c[a+20>>2]|0)+(e<<2)>>2]|0)+768>>2]=e;c[a+12>>2]=d;a=c[a+68>>2]|0;if(!b)return;g=c[a+16>>2]|0;if(g>>>0<=b>>>0?(g+(J(c[a>>2]|0,c[a+4>>2]|0)|0)|0)>>>0>b>>>0:0){c[b>>2]=c[a+12>>2];c[a+12>>2]=b;c[a+8>>2]=(c[a+8>>2]|0)+1;return}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function _j(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0.0,k=0.0,l=0.0,m=0.0,n=0.0;if((e|0)<=0)return;f=0;do{n=+g[b+(f<<4)>>2];m=+g[b+(f<<4)+4>>2];j=+g[b+(f<<4)+8>>2];k=n*+g[a+56>>2]+m*+g[a+60>>2]+j*+g[a+64>>2];l=n*+g[a+72>>2]+m*+g[a+76>>2]+j*+g[a+80>>2];j=n*+g[a+88>>2]+m*+g[a+92>>2]+j*+g[a+96>>2];i=a+56+((k>2]=c[i>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i+8>>2];c[h+12>>2]=c[i+12>>2];f=f+1|0}while((f|0)!=(e|0));return}function $j(a,b){a=a|0;b=+b;var d=0,e=0;d=sa;sa=sa+16|0;te(a,b);Ki(15988);a=c[a+452>>2]|0;Qa[c[(c[a>>2]|0)+24>>2]&31](a,b);a=c[3084]|0;e=(c[a+16>>2]|0)+-1|0;c[a+16>>2]=e;if(e|0){sa=d;return}do if(c[a+4>>2]|0){la(d|0,0)|0;e=c[7181]|0;g[a+8>>2]=+g[a+8>>2]+ +(((c[d+4>>2]|0)-(c[e+4>>2]|0)+(((c[d>>2]|0)-(c[e>>2]|0)|0)*1e6|0)-(c[a+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[a+16>>2]|0)){a=c[3084]|0;break}else{sa=d;return}}while(0);c[3084]=c[a+20>>2];sa=d;return}function ak(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;do switch(b|0){case 0:{b=1;f=0;break}case 1:{b=2;f=0;break}case 2:{b=3;f=1;break}case 3:{b=3;f=2;break}case 4:{b=4;f=0;break}case 5:{b=5;f=1;break}case 6:{b=6;f=2;break}case 7:{b=7;f=3;break}case 8:{b=5;f=4;break}case 9:{b=6;f=4;break}case 10:{b=7;f=5;break}case 11:{b=7;f=6;break}default:{b=0;f=0}}while(0);Za[c[(c[a>>2]|0)+108>>2]&127](a,f,d);Za[c[(c[a>>2]|0)+108>>2]&127](a,b,e);return}function bk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;h=+g[a+56>>2];k=+g[a+72>>2]-h;j=+g[a+60>>2];i=+g[a+76>>2]-j;l=+g[a+64>>2];m=+g[a+80>>2]-l;h=+g[a+88>>2]-h;j=+g[a+92>>2]-j;l=+g[a+96>>2]-l;g[d+12>>2]=0.0;f=1.0/+x(+((k*j-i*h)*(k*j-i*h)+((i*l-m*j)*(i*l-m*j)+(m*h-k*l)*(m*h-k*l))));g[d>>2]=(i*l-m*j)*f;g[d+4>>2]=(m*h-k*l)*f;g[d+8>>2]=(k*j-i*h)*f;c[e>>2]=c[a+56>>2];c[e+4>>2]=c[a+56+4>>2];c[e+8>>2]=c[a+56+8>>2];c[e+12>>2]=c[a+56+12>>2];return}function ck(b){b=b|0;var d=0,e=0,f=0;c[b>>2]=8972;e=c[b+12>>2]|0;if((e|0)>0){d=0;do{f=c[(c[b+20>>2]|0)+(d<<2)>>2]|0;if(f|0){Pa[c[c[f>>2]>>2]&511](f);f=c[b+4>>2]|0;Va[c[(c[f>>2]|0)+60>>2]&127](f,c[(c[b+20>>2]|0)+(d<<2)>>2]|0)}d=d+1|0}while((d|0)!=(e|0))}d=c[b+20>>2]|0;if(!d){a[b+24>>0]=1;c[b+20>>2]=0;c[b+12>>2]=0;b=b+16|0;c[b>>2]=0;return}if(a[b+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+20>>2]=0;a[b+24>>0]=1;c[b+20>>2]=0;c[b+12>>2]=0;b=b+16|0;c[b>>2]=0;return}function dk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;i=+g[a+56>>2];k=+g[a+72>>2]-i;j=+g[a+60>>2];f=+g[a+76>>2]-j;d=+g[a+64>>2];h=+g[a+80>>2]-d;i=+g[a+88>>2]-i;j=+g[a+92>>2]-j;d=+g[a+96>>2]-d;g[c+12>>2]=0.0;e=1.0/+x(+((k*j-f*i)*(k*j-f*i)+((f*d-h*j)*(f*d-h*j)+(h*i-k*d)*(h*i-k*d))));g[c>>2]=(f*d-h*j)*e;g[c+4>>2]=(h*i-k*d)*e;g[c+8>>2]=(k*j-f*i)*e;if(!b)return;g[c>>2]=-((f*d-h*j)*e);g[c+4>>2]=-((h*i-k*d)*e);g[c+8>>2]=-((k*j-f*i)*e);return}function ek(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;h=c[a+720>>2]|0;g=c[a+752>>2]|0;if((g|0)<=0){h=0;return h|0}f=c[a+760>>2]|0;a=0;while(1){i=c[f+(a*44|0)+8>>2]|0;if(((i|0)==(h+(e*104|0)|0)|((i|0)==(h+(b*104|0)|0)|(i|0)==(h+(d*104|0)|0))?(i=c[f+(a*44|0)+12>>2]|0,(i|0)==(h+(e*104|0)|0)|((i|0)==(h+(b*104|0)|0)|(i|0)==(h+(d*104|0)|0))):0)?(i=c[f+(a*44|0)+16>>2]|0,(i|0)==(h+(e*104|0)|0)|((i|0)==(h+(b*104|0)|0)|(i|0)==(h+(d*104|0)|0))):0){a=1;f=7;break}a=a+1|0;if((a|0)>=(g|0)){a=0;f=7;break}}if((f|0)==7)return a|0;return 0}function fk(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+48|0;g[c+32>>2]=+Fo(b,a);g[c+28>>2]=+bo(b,a);g[c+24>>2]=+ao(b,a);g[c+20>>2]=+Fo(b,a+16|0);g[c+16>>2]=+bo(b,a+16|0);g[c+12>>2]=+ao(b,a+16|0);g[c+8>>2]=+Fo(b,a+32|0);g[c+4>>2]=+bo(b,a+32|0);g[c>>2]=+ao(b,a+32|0);Lo(a,c+32|0,c+28|0,c+24|0,c+20|0,c+16|0,c+12|0,c+8|0,c+4|0,c);sa=c;return}function gk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0,j=0;i=c[a+96>>2]|0;j=c[a+104>>2]|0;f=+g[j+(((b|0)%(i|0)|0)<<4)+4>>2]*+g[a+16>>2];h=+g[j+(((b|0)%(i|0)|0)<<4)+8>>2]*+g[a+20>>2];g[d>>2]=+g[j+(((b|0)%(i|0)|0)<<4)>>2]*+g[a+12>>2];g[d+4>>2]=f;g[d+8>>2]=h;g[d+12>>2]=0.0;d=c[a+104>>2]|0;h=+g[d+(((b+1|0)%(i|0)|0)<<4)+4>>2]*+g[a+16>>2];f=+g[d+(((b+1|0)%(i|0)|0)<<4)+8>>2]*+g[a+20>>2];g[e>>2]=+g[d+(((b+1|0)%(i|0)|0)<<4)>>2]*+g[a+12>>2];g[e+4>>2]=h;g[e+8>>2]=f;g[e+12>>2]=0.0;return}function hk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0.0,h=0,i=0;e=sa;sa=sa+32|0;d=c[a+184>>2]|0;if(+g[d+4>>2]==0.0){d=0;sa=e;return d|0}b=c[b>>2]|0;if(!(Ha[c[(c[d>>2]|0)+8>>2]&31](d,c[b+188>>2]|0)|0)){d=1;sa=e;return d|0}h=c[a+192>>2]|0;i=c[b+192>>2]|0;d=c[a+184>>2]|0;f=+g[a+188>>2];c[e>>2]=0;c[e+4>>2]=i;c[e+8>>2]=b;c[e+12>>2]=b+4;c[e+16>>2]=-1;c[e+20>>2]=-1;Eb(h,a+36|0,a+100|0,e,d,f);d=1;sa=e;return d|0}function ik(a,b){a=a|0;b=b|0;var d=0;d=sa;sa=sa+16|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];b=c[a+8>>2]|0;c[b+260>>2]=(c[b+260>>2]|0)+1;c[b+4>>2]=1065353216;c[b+8>>2]=0;c[b+8+4>>2]=0;c[b+8+8>>2]=0;c[b+8+12>>2]=0;c[b+24>>2]=1065353216;c[b+28>>2]=0;c[b+28+4>>2]=0;c[b+28+8>>2]=0;c[b+28+12>>2]=0;c[b+44>>2]=1065353216;c[b+48>>2]=0;c[b+52>>2]=c[d>>2];c[b+52+4>>2]=c[d+4>>2];c[b+52+8>>2]=c[d+8>>2];c[b+52+12>>2]=c[d+12>>2];sa=d;return}function jk(a){a=a|0;var b=0,d=0;b=sa;sa=sa+16|0;Ki(19276);d=c[a+68>>2]|0;Va[c[(c[d>>2]|0)+32>>2]&127](d,c[a+24>>2]|0);a=c[3084]|0;d=(c[a+16>>2]|0)+-1|0;c[a+16>>2]=d;if(d|0){sa=b;return}do if(c[a+4>>2]|0){la(b|0,0)|0;d=c[7181]|0;g[a+8>>2]=+g[a+8>>2]+ +(((c[b+4>>2]|0)-(c[d+4>>2]|0)+(((c[b>>2]|0)-(c[d>>2]|0)|0)*1e6|0)-(c[a+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[a+16>>2]|0)){a=c[3084]|0;break}else{sa=b;return}}while(0);c[3084]=c[a+20>>2];sa=b;return}function kk(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0,m=0.0;k=+va[c[(c[a>>2]|0)+48>>2]&15](a);h=+va[c[(c[a>>2]|0)+48>>2]&15](a);d=+va[c[(c[a>>2]|0)+48>>2]&15](a);m=(k+ +g[a+28>>2])/+g[a+12>>2];j=(h+ +g[a+32>>2])/+g[a+16>>2];f=(d+ +g[a+36>>2])/+g[a+20>>2];l=+w(+(+g[b>>2]));i=+w(+(+g[b+4>>2]));e=+w(+(+g[b+8>>2]));g[a+12>>2]=l;g[a+16>>2]=i;g[a+20>>2]=e;g[a+24>>2]=0.0;g[a+28>>2]=m*l-k;g[a+32>>2]=j*i-h;g[a+36>>2]=f*e-d;g[a+40>>2]=0.0;return}function lk(b,d){b=b|0;d=d|0;var e=0,f=0,h=0.0,i=0,j=0;if(a[b+527>>0]|0){c[d>>2]=0;c[d+4>>2]=0;return}c[d>>2]=3;c[d+4>>2]=3;j=c[b+28>>2]|0;i=c[b+32>>2]|0;Cb(b,j+4|0,i+4|0,j+264|0,i+264|0);if((a[b+526>>0]|0?(e=c[d>>2]|0,c[d>>2]=e+1,f=c[d+4>>2]|0,c[d+4>>2]=f+-1,h=+g[b+456>>2],+g[b+444>>2]>2]>2]=e+2;c[d+4>>2]=f+-2}if(!(a[b+525>>0]|0))return;c[d>>2]=(c[d>>2]|0)+1;c[d+4>>2]=(c[d+4>>2]|0)+-1;return}function mk(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0}g=d|d<<8|d<<16|d<<24;while((b|0)<=((f&-4)-64|0)){c[b>>2]=g;c[b+4>>2]=g;c[b+8>>2]=g;c[b+12>>2]=g;c[b+16>>2]=g;c[b+20>>2]=g;c[b+24>>2]=g;c[b+28>>2]=g;c[b+32>>2]=g;c[b+36>>2]=g;c[b+40>>2]=g;c[b+44>>2]=g;c[b+48>>2]=g;c[b+52>>2]=g;c[b+56>>2]=g;c[b+60>>2]=g;b=b+64|0}while((b|0)<(f&-4|0)){c[b>>2]=g;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return f-e|0}function nk(a,b,c,d,e,f,h,i,j,k){a=+a;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;i=+i;j=+j;k=k|0;if(!(((h-d)*b-(i-e)*a)*f+(((i-e)*c-(j-f)*b)*d+((j-f)*a-(h-d)*c)*e)<0.0)){k=0;return k|0}do if(!((h-d)*d+(i-e)*e+(j-f)*f>0.0))if((h-d)*h+(i-e)*i+(j-f)*j<0.0){a=h*h+i*i+j*j;break}else{a=((h*h+i*i+j*j)*(d*d+e*e+f*f)-(h*d+i*e+j*f)*(h*d+i*e+j*f))/((h-d)*(h-d)+(i-e)*(i-e)+(j-f)*(j-f));a=a>0.0?a:0.0;break}else a=d*d+e*e+f*f;while(0);g[k>>2]=+x(+a);k=1;return k|0}function ok(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0,h=0,i=0;b=c[b+36>>2]|0;i=c[b+8>>2]|0;h=c[b+12>>2]|0;f=c[b+16>>2]|0;e=+g[a+52>>2];d=+Yg(a+4|0,+g[a+36>>2],+g[a+40>>2],+g[a+44>>2],+g[i+8>>2],+g[i+12>>2],+g[i+16>>2],+g[h+8>>2],+g[h+12>>2],+g[h+16>>2],+g[f+8>>2],+g[f+12>>2],+g[f+16>>2],e);if(!(d>0.0&d>2]|0;h=h+1|0;c[i>>2]=h;return}g[a+52>>2]=d;c[a+56>>2]=b;i=a+60|0;h=c[i>>2]|0;h=h+1|0;c[i>>2]=h;return}function pk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;a:do if(c>>>0>=3)if((c+-3|0)>>>0<3)switch(b|0){case 2:{d=+g[a+868+(c+-3<<6)+32>>2];break a}case 4:{d=+g[a+868+(c+-3<<6)+36>>2];break a}case 3:{d=+g[a+868+(c+-3<<6)+28>>2];break a}default:{d=0.0;break a}}else d=0.0;else switch(b|0){case 2:{d=+g[a+756+(c<<2)>>2];break a}case 4:{d=+g[a+772+(c<<2)>>2];break a}case 3:{d=+g[a+740+(c<<2)>>2];break a}default:{d=0.0;break a}}while(0);return +d}function qk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;Za[c[(c[b>>2]|0)+68>>2]&127](a,b,d);if(!(+va[c[(c[b>>2]|0)+48>>2]&15](b)!=0.0))return;h=+g[d>>2];e=+g[d+4>>2];f=+g[d+8>>2];j=h*h+e*e+f*f<1.4210854715202004e-14?-1.0:h;i=h*h+e*e+f*f<1.4210854715202004e-14?-1.0:e;f=h*h+e*e+f*f<1.4210854715202004e-14?-1.0:f;e=1.0/+x(+(f*f+(j*j+i*i)));h=+va[c[(c[b>>2]|0)+48>>2]&15](b);g[a>>2]=+g[a>>2]+h*j*e;g[a+4>>2]=+g[a+4>>2]+h*i*e;g[a+8>>2]=+g[a+8>>2]+h*f*e;return}function rk(b,d,e){b=b|0;d=d|0;e=+e;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;a[b+171>>0]=0;c[b+60>>2]=c[d>>2];c[b+60+4>>2]=c[d+4>>2];c[b+60+8>>2]=c[d+8>>2];c[b+60+12>>2]=c[d+12>>2];f=+g[b+60>>2];h=+g[b+64>>2];i=+g[b+68>>2];j=1.0/+x(+(f*f+h*h+i*i));if(+x(+(i*j*i*j+(f*j*f*j+h*j*h*j)))<1.1920928955078125e-07){k=0.0;h=0.0;f=0.0;d=0}else{k=f*j;h=h*j;f=i*j;d=c[b+72>>2]|0}g[b+76>>2]=k;g[b+80>>2]=h;g[b+84>>2]=f;c[b+88>>2]=d;g[b+172>>2]=+g[b+172>>2]+e;return}function sk(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;do if(!(RC(b,c[d+8>>2]|0)|0)){if(RC(b,c[d>>2]|0)|0){if((c[d+16>>2]|0)!=(e|0)?(c[d+20>>2]|0)!=(e|0):0){c[d+32>>2]=f;c[d+20>>2]=e;c[d+40>>2]=(c[d+40>>2]|0)+1;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==2:0)a[d+54>>0]=1;c[d+44>>2]=4;break}if((f|0)==1)c[d+32>>2]=1}}else Er(d,e,f);while(0);return}function tk(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0,h=0,i=0;e=sa;sa=sa+16|0;b=c[a+8>>2]|0;d=c[a+8+4>>2]|0;if((d|0)>-1|(d|0)==-1&b>>>0>4294967295){f=(+(b>>>0)+4294967296.0*+(d>>>0))*18446744073709551616.0+(+((c[a>>2]|0)>>>0)+4294967296.0*+((c[a+4>>2]|0)>>>0));sa=e;return +f}else{i=c[a>>2]|0;h=c[a+4>>2]|0;g=lv(0,0,i|0,h|0)|0;a=Q()|0;b=xv((i|0)==0&(h|0)==0&1|0,0,~b|0,~d|0)|0;d=Q()|0;c[e>>2]=g;c[e+4>>2]=a;c[e+8>>2]=b;c[e+8+4>>2]=d;f=-+tk(e);sa=e;return +f}return 0.0}function uk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;a:do if(!(RC(b,c[d+8>>2]|0)|0)){h=c[b+12>>2]|0;In(b+16|0,d,e,f);if((h|0)>1){g=b+24|0;do{In(g,d,e,f);if(a[d+54>>0]|0)break a;g=g+8|0}while(g>>>0<(b+16+(h<<3)|0)>>>0)}}else sm(d,e,f);while(0);return}function vk(b,d,e,f,h){b=b|0;d=+d;e=e|0;f=f|0;h=h|0;g[b>>2]=d;c[b+4>>2]=e;c[b+72>>2]=f;c[b+76>>2]=c[h>>2];c[b+76+4>>2]=c[h+4>>2];c[b+76+8>>2]=c[h+8>>2];c[b+76+12>>2]=c[h+12>>2];g[b+92>>2]=0.0;g[b+96>>2]=0.0;g[b+100>>2]=.5;g[b+104>>2]=0.0;g[b+108>>2]=0.0;g[b+112>>2]=.800000011920929;g[b+116>>2]=1.0;a[b+120>>0]=0;g[b+124>>2]=.004999999888241291;g[b+128>>2]=.009999999776482582;g[b+132>>2]=.009999999776482582;g[b+136>>2]=.009999999776482582;sq(b+8|0);return}function wk(b,d,e){b=b|0;d=d|0;e=e|0;b=Nr(152)|0;c[b>>2]=7628;a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;a[b+40>>0]=1;c[b+36>>2]=0;c[b+28>>2]=0;c[b+32>>2]=0;a[b+60>>0]=1;c[b+56>>2]=0;c[b+48>>2]=0;c[b+52>>2]=0;a[b+80>>0]=1;c[b+76>>2]=0;c[b+68>>2]=0;c[b+72>>2]=0;c[b+100>>2]=e;g[b+104>>2]=0.0;a[b+148>>0]=1;c[b+144>>2]=0;c[b+136>>2]=0;c[b+140>>2]=0;c[b+116>>2]=d;c[b+120>>2]=0;c[b+124>>2]=2;c[b+128>>2]=1;g[b+112>>2]=0.0;g[b+108>>2]=0.0;return b|0}function xk(b){b=b|0;var d=0,e=0,f=0;e=Nr(5260)|0;c[e>>2]=7940;c[e+4>>2]=2;a[e+24>>0]=1;c[e+20>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+28>>2]=8412;c[e+5256>>2]=b;c[e+60>>2]=80;c[e+64>>2]=Fa[c[(c[b>>2]|0)+12>>2]&127](b)|0;c[e+68>>2]=Fa[c[(c[b>>2]|0)+8>>2]&127](b)|0;b=0;do{d=0;do{f=c[e+5256>>2]|0;c[e+72+(b*144|0)+(d<<2)>>2]=Ja[c[(c[f>>2]|0)+16>>2]&63](f,b,d)|0;d=d+1|0}while(d>>>0<36);b=b+1|0}while(b>>>0<36);return e|0}function yk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+28>>2]=c[a+28>>2];c[b+32>>2]=c[a+32>>2];c[b+36>>2]=c[a+36>>2];c[b+40>>2]=c[a+40>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+20>>2]=c[a+20>>2];c[b+24>>2]=c[a+24>>2];c[b+44>>2]=c[a+44>>2];c[b+52>>2]=c[a+52>>2];return 22186}function zk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+28>>2]=c[a+28>>2];c[b+32>>2]=c[a+32>>2];c[b+36>>2]=c[a+36>>2];c[b+40>>2]=c[a+40>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+20>>2]=c[a+20>>2];c[b+24>>2]=c[a+24>>2];c[b+44>>2]=c[a+44>>2];c[b+52>>2]=c[a+52>>2];return 21730}function Ak(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+28>>2]=c[a+28>>2];c[b+32>>2]=c[a+32>>2];c[b+36>>2]=c[a+36>>2];c[b+40>>2]=c[a+40>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+20>>2]=c[a+20>>2];c[b+24>>2]=c[a+24>>2];c[b+44>>2]=c[a+44>>2];c[b+52>>2]=c[a+68>>2];return 20750}function Bk(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=sa;sa=sa+32|0;if(!(+g[a+344>>2]!=0.0)){sa=d;return}An(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);if(!(JI(a+544|0)|0)){sa=d;return}rp(d,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[a+348>>2],+g[a+352>>2],+g[a+356>>2]);Co(d+16|0,+g[c>>2],+g[c+4>>2],+g[c+8>>2],+g[d>>2],+g[d+4>>2],+g[d+8>>2]);Bn(a,+g[d+16>>2],+g[d+16+4>>2],+g[d+16+8>>2]);sa=d;return}function Ck(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;a[b+53>>0]=1;do if((c[b+4>>2]|0)==(e|0)){a[b+52>>0]=1;e=c[b+16>>2]|0;if(!e){c[b+16>>2]=d;c[b+24>>2]=f;c[b+36>>2]=1;if(!((f|0)==1?(c[b+48>>2]|0)==1:0))break;a[b+54>>0]=1;break}if((e|0)!=(d|0)){c[b+36>>2]=(c[b+36>>2]|0)+1;a[b+54>>0]=1;break}e=c[b+24>>2]|0;if((e|0)==2){c[b+24>>2]=f;e=f}if((e|0)==1?(c[b+48>>2]|0)==1:0)a[b+54>>0]=1}while(0);return}function Dk(a,b,d){a=a|0;b=+b;d=d|0;var e=0,f=0.0,h=0.0,i=0.0,j=0,k=0;e=sa;sa=sa+16|0;j=c[a+52>>2]|0;k=c[a+28+(((j+2|0)%3|0)<<2)>>2]|0;c[e>>2]=k;c[e+4>>2]=k;c[e+8>>2]=k;g[e+12>>2]=0.0;g[e+(j<<2)>>2]=+g[a+28+(j<<2)>>2]+ +g[e+(j<<2)>>2];h=(+g[e>>2]+.03999999910593033)*2.0;f=(+g[e+4>>2]+.03999999910593033)*2.0;i=(+g[e+8>>2]+.03999999910593033)*2.0;g[d>>2]=b*.0833333283662796*(f*f+i*i);g[d+4>>2]=b*.0833333283662796*(h*h+i*i);g[d+8>>2]=b*.0833333283662796*(h*h+f*f);sa=e;return}function Ek(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;g=sa;sa=sa+64|0;if(!(RC(a,b)|0))if((b|0)!=0?(f=zi(b,5176)|0,(f|0)!=0):0){b=g+4|0;e=b+52|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(e|0));c[g>>2]=f;c[g+8>>2]=a;c[g+12>>2]=-1;c[g+48>>2]=1;ab[c[(c[f>>2]|0)+28>>2]&127](f,g,c[d>>2]|0,1);if((c[g+24>>2]|0)==1){c[d>>2]=c[g+16>>2];b=1}else b=0}else b=0;else b=1;sa=g;return b|0}function Fk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0,j=0.0,k=0.0,l=0.0,m=0;if((d|0)<=0)return;m=0;do{e=+g[a+32>>2];h=+g[a+28>>2];i=b+(m<<4)|0;k=+g[b+(m<<4)+4>>2];f=+g[b+(m<<4)+8>>2];l=+x(+(k*k+f*f));if(l!=0.0){j=f*(e/l);f=+g[i>>2]<0.0?-h:h;e=k*(e/l)}else{j=0.0;f=+g[i>>2]<0.0?-h:h}g[c+(m<<4)>>2]=f;g[c+(m<<4)+4>>2]=e;g[c+(m<<4)+8>>2]=j;m=m+1|0}while((m|0)!=(d|0));return}function Gk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;j=c[b>>2]|0;if(!e)e=c[a+188>>2]|0;i=c[a+268>>2]|0;if((i|0)<=0)return;h=c[a+276>>2]|0;f=0;while(1){g=h+(f<<2)|0;if((c[g>>2]|0)==(j|0))break;f=f+1|0;if((f|0)>=(i|0)){k=9;break}}if((k|0)==9)return;if((f|0)>=(i|0))return;c[g>>2]=c[h+(i+-1<<2)>>2];c[a+268>>2]=i+-1;k=c[a+284>>2]|0;Ka[c[(c[k>>2]|0)+12>>2]&31](k,e,b,d)|0;return}function Hk(b,d){b=b|0;d=d|0;var e=0;e=Bs()|0;c[e+8>>2]=0;c[e+12>>2]=1065353216;c[e+16>>2]=1065353216;c[e+20>>2]=1065353216;g[e+24>>2]=0.0;g[e+44>>2]=.03999999910593033;c[e+52>>2]=0;c[e+56>>2]=1065353216;c[e+60>>2]=1065353216;c[e+64>>2]=1065353216;g[e+68>>2]=0.0;c[e+72>>2]=-1082130432;c[e+76>>2]=-1082130432;c[e+80>>2]=-1082130432;g[e+84>>2]=0.0;a[e+88>>0]=0;c[e>>2]=10600;c[e+92>>2]=b;c[e+4>>2]=3;if(!d)return e|0;Oi(e);return e|0}function Ik(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=sa;sa=sa+32|0;d=c[a+216>>2]|0;if(+g[d+4>>2]==0.0){d=0;sa=e;return d|0}b=c[b>>2]|0;if(!(Ha[c[(c[d>>2]|0)+8>>2]&31](d,c[b+188>>2]|0)|0)){d=1;sa=e;return d|0}f=c[b+192>>2]|0;d=c[a+216>>2]|0;c[e>>2]=0;c[e+4>>2]=f;c[e+8>>2]=b;c[e+12>>2]=b+4;c[e+16>>2]=-1;c[e+20>>2]=-1;_b(a+68|0,a+132|0,e,d);d=1;sa=e;return d|0}function Jk(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0;i=ds()|0;Td(i,b,d,e,f,h);c[i>>2]=7244;c[i+4>>2]=9;a[i+1309>>0]=0;a[i+1309+1>>0]=0;a[i+1309+2>>0]=0;a[i+1309+3>>0]=0;a[i+1309+4>>0]=0;a[i+1309+5>>0]=0;b=i+1316|0;d=b+48|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));g[i+1364>>2]=1.0;g[i+1368>>2]=1.0;g[i+1372>>2]=1.0;g[i+1376>>2]=1.0;g[i+1380>>2]=1.0;g[i+1384>>2]=1.0;return i|0}function Kk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+28>>2]=c[a+28>>2];c[b+32>>2]=c[a+32>>2];c[b+36>>2]=c[a+36>>2];c[b+40>>2]=c[a+40>>2];c[b+12>>2]=c[a+12>>2];c[b+16>>2]=c[a+16>>2];c[b+20>>2]=c[a+20>>2];c[b+24>>2]=c[a+24>>2];c[b+44>>2]=c[a+44>>2];return 15391}function Lk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];c[b+12>>2]=c[a+68>>2];c[b+16>>2]=c[a+72>>2];c[b+20>>2]=c[a+76>>2];c[b+24>>2]=c[a+80>>2];c[b+28>>2]=c[a+48>>2];c[b+32>>2]=c[a+52>>2];c[b+36>>2]=c[a+56>>2];c[b+40>>2]=c[a+60>>2];c[b+44>>2]=c[a+64>>2];return 21427}function Mk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0;if((d|0)<=0)return;l=0;do{e=+g[a+28>>2];h=+g[a+36>>2];j=+g[b+(l<<4)>>2];f=+g[b+(l<<4)+4>>2];k=+x(+(j*j+f*f));if(k!=0.0){i=f*(e/k);f=+g[b+(l<<4)+8>>2]<0.0?-h:h;e=j*(e/k)}else{i=0.0;f=+g[b+(l<<4)+8>>2]<0.0?-h:h}g[c+(l<<4)>>2]=e;g[c+(l<<4)+4>>2]=i;g[c+(l<<4)+8>>2]=f;l=l+1|0}while((l|0)!=(d|0));return}function Nk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0;if((d|0)<=0)return;l=0;do{e=+g[a+28>>2];h=+g[a+32>>2];j=+g[b+(l<<4)>>2];f=+g[b+(l<<4)+8>>2];k=+x(+(j*j+f*f));if(k!=0.0){i=f*(e/k);f=+g[b+(l<<4)+4>>2]<0.0?-h:h;e=j*(e/k)}else{i=0.0;f=+g[b+(l<<4)+4>>2]<0.0?-h:h}g[c+(l<<4)>>2]=e;g[c+(l<<4)+4>>2]=f;g[c+(l<<4)+8>>2]=i;l=l+1|0}while((l|0)!=(d|0));return}function Ok(b,d){b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;a[b+171>>0]=1;c[b+60>>2]=c[d>>2];c[b+60+4>>2]=c[d+4>>2];c[b+60+8>>2]=c[d+8>>2];c[b+60+12>>2]=c[d+12>>2];e=+g[b+60>>2];f=+g[b+64>>2];h=+g[b+68>>2];i=1.0/+x(+(e*e+f*f+h*h));if(+x(+(h*i*h*i+(e*i*e*i+f*i*f*i)))<1.1920928955078125e-07){j=0.0;f=0.0;e=0.0;d=0}else{j=e*i;f=f*i;e=h*i;d=c[b+72>>2]|0}g[b+76>>2]=j;g[b+80>>2]=f;g[b+84>>2]=e;c[b+88>>2]=d;return}function Pk(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0,h=0,i=0,j=0;j=c[a+68>>2]|0;i=c[a+64>>2]|0;h=c[a+72>>2]|0;e=+g[a+60>>2]*(+g[b+(j<<2)>>2]/+g[a+12+(j<<2)>>2]);g[a+60>>2]=e;f=+g[a+56>>2]*(+g[b+(i<<2)>>2]/+g[a+12+(i<<2)>>2]+ +g[b+(h<<2)>>2]/+g[a+12+(h<<2)>>2])*.5;g[a+56>>2]=f;g[a+52>>2]=f/+x(+(e*e+f*f));f=+w(+(+g[b>>2]));e=+w(+(+g[b+4>>2]));d=+w(+(+g[b+8>>2]));g[a+12>>2]=f;g[a+16>>2]=e;g[a+20>>2]=d;g[a+24>>2]=0.0;return}function Qk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=sa;sa=sa+48|0;c[f+32>>2]=11848;c[f+32+4>>2]=e;c[f>>2]=c[b>>2];c[f+4>>2]=c[b+4>>2];c[f+8>>2]=c[b+8>>2];c[f+12>>2]=c[b+12>>2];c[f+16>>2]=c[d>>2];c[f+16+4>>2]=c[d+4>>2];c[f+16+8>>2]=c[d+8>>2];c[f+16+12>>2]=c[d+12>>2];le(c[a+4>>2]|0,f,f+32|0);le(c[a+64>>2]|0,f,f+32|0);sa=f;return}function Rk(b,d){b=b|0;d=+d;var e=0,f=0,h=0.0;d=1.0/+g[(c[b+116>>2]|0)+344>>2];if((c[b+136>>2]|0)<=0)return;e=0;do{f=c[b+144>>2]|0;if(!(a[f+(e*284|0)+84>>0]|0))h=0.0;else{h=+g[f+(e*284|0)+272>>2];h=d*(+g[f+(e*284|0)+216>>2]*(+g[f+(e*284|0)+204>>2]-+g[f+(e*284|0)+32>>2])*+g[f+(e*284|0)+268>>2]-h*+g[(h<0.0?f+(e*284|0)+220|0:f+(e*284|0)+224|0)>>2]);h=h<0.0?0.0:h}g[f+(e*284|0)+276>>2]=h;e=e+1|0}while((e|0)<(c[b+136>>2]|0));return}function Sk(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0,f=0.0,h=0.0,i=0.0;e=sa;sa=sa+48|0;f=+zI(b);h=+zI(c);i=+zI(d);b=+yI(b);c=+yI(c);d=+yI(d);g[e+32>>2]=h*i;g[e+28>>2]=c*b*i-f*d;g[e+24>>2]=c*f*i+b*d;g[e+20>>2]=h*d;g[e+16>>2]=c*b*d+f*i;g[e+12>>2]=c*f*d-b*i;g[e+8>>2]=-c;g[e+4>>2]=h*b;g[e>>2]=h*f;Lo(a,e+32|0,e+28|0,e+24|0,e+20|0,e+16|0,e+12|0,e+8|0,e+4|0,e);sa=e;return}function Tk(a,d,f,g,h,i){a=a|0;d=d|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;j=c[a+108>>2]|0;if(j|0){gb[c[(c[j>>2]|0)+24>>2]&7](j,d,f,g,h,i);return}d=b[a+56>>1]|0;if(!(d<<16>>16))return;h=1;i=1;do{f=c[a+68>>2]|0;if(b[f+(i<<2)>>1]&1){Ha[c[(c[g>>2]|0)+8>>2]&31](g,(c[a+60>>2]|0)+((e[f+(i<<2)+2>>1]|0)<<6)|0)|0;d=b[a+56>>1]|0}h=h+1<<16>>16;i=h&65535}while(((d&65535)<<1|1)>>>0>i>>>0);return}function Uk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,80)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=8316;a[b+8>>0]=1;c[b+12>>2]=8364;c[b+60>>2]=d;c[b+64>>2]=0;c[b+16>>2]=f;c[b+20>>2]=e;f=Ja[c[(c[d>>2]|0)+12>>2]&63](d,c[f+8>>2]|0,c[e+8>>2]|0)|0;c[b+76>>2]=f;e=c[b+60>>2]|0;Va[c[(c[e>>2]|0)+20>>2]&127](e,f);return b|0}function Vk(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,h=0.0,i=0.0;e=+g[a+28>>2];i=+g[a+32>>2];h=+g[a+36>>2];switch(d|0){case 0:{a=0;d=0;f=1065353216;break}case 1:{a=0;d=0;f=-1082130432;break}case 2:{a=0;d=1065353216;f=0;e=i;break}case 3:{a=0;d=-1082130432;f=0;e=i;break}case 4:{a=1065353216;d=0;f=0;e=h;break}case 5:{a=-1082130432;d=0;f=0;e=h;break}default:return}c[b>>2]=f;c[b+4>>2]=d;c[b+8>>2]=a;g[b+12>>2]=-e;return}function Wk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,80)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=8316;a[b+8>>0]=0;c[b+12>>2]=8364;c[b+60>>2]=d;c[b+64>>2]=0;c[b+16>>2]=e;c[b+20>>2]=f;f=Ja[c[(c[d>>2]|0)+12>>2]&63](d,c[e+8>>2]|0,c[f+8>>2]|0)|0;c[b+76>>2]=f;e=c[b+60>>2]|0;Va[c[(c[e>>2]|0)+20>>2]&127](e,f);return b|0}function Xk(b){b=b|0;var d=0;c[b>>2]=7896;d=c[b+284>>2]|0;Pa[c[c[d>>2]>>2]&511](d);d=c[b+284>>2]|0;if(d|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b>>2]=7852;d=c[b+276>>2]|0;if(!d){a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;d=b+272|0;c[d>>2]=0;c[b>>2]=7816;return}if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+276>>2]=0;a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;d=b+272|0;c[d>>2]=0;c[b>>2]=7816;return}function Yk(a){a=a|0;var b=0,d=0,e=0,f=0.0,h=0.0;e=c[a+232>>2]|0;if((e|0)<=0)return;b=c[a+240>>2]|0;a=0;do{d=c[b+(a<<2)>>2]|0;switch(c[d+216>>2]|0){case 2:case 5:break;default:if(!(c[d+204>>2]&3)){h=+g[d+368>>2]*+g[d+352>>2];f=+g[d+372>>2]*+g[d+356>>2];g[d+412>>2]=+g[d+364>>2]*+g[d+348>>2]+ +g[d+412>>2];g[d+416>>2]=h+ +g[d+416>>2];g[d+420>>2]=f+ +g[d+420>>2]}}a=a+1|0}while((a|0)!=(e|0));return}function Zk(a,b){a=a|0;b=b|0;var c=0,d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0,k=0.0,l=0.0;c=sa;sa=sa+16|0;l=+g[a+12>>2];i=+g[(JI(b)|0)>>2];j=+g[a>>2];k=+g[b+12>>2];h=+g[a+4>>2];d=+g[(nI(b)|0)>>2];e=+g[a+8>>2];f=+g[(oI(b)|0)>>2];g[c+12>>2]=l*i+j*k+h*d-e*f;g[c+8>>2]=l*f+h*k+e*i-j*d;g[c+4>>2]=l*d+e*k+j*f-h*i;g[c>>2]=l*k-j*i-h*f-e*d;tr(a,c+12|0,c+8|0,c+4|0,c);sa=c;return a|0}function _k(b){b=b|0;var d=0;d=Bs()|0;c[d+8>>2]=0;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;c[d+52>>2]=0;c[d+56>>2]=1065353216;c[d+60>>2]=1065353216;c[d+64>>2]=1065353216;g[d+68>>2]=0.0;c[d+72>>2]=-1082130432;c[d+76>>2]=-1082130432;c[d+80>>2]=-1082130432;g[d+84>>2]=0.0;a[d+88>>0]=0;c[d>>2]=10600;c[d+92>>2]=b;c[d+4>>2]=3;Oi(d);return d|0}function $k(a,b){a=a|0;b=+b;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0;h=+va[c[(c[a>>2]|0)+48>>2]&15](a);e=+va[c[(c[a>>2]|0)+48>>2]&15](a);i=+va[c[(c[a>>2]|0)+48>>2]&15](a);h=h+ +g[a+28>>2];e=e+ +g[a+32>>2];i=i+ +g[a+36>>2];g[a+44>>2]=b;f=+va[c[(c[a>>2]|0)+48>>2]&15](a);d=+va[c[(c[a>>2]|0)+48>>2]&15](a);b=i-+va[c[(c[a>>2]|0)+48>>2]&15](a);g[a+28>>2]=h-f;g[a+32>>2]=e-d;g[a+36>>2]=b;g[a+40>>2]=0.0;return}function al(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=ds()|0;fd(f,b,d,e);c[f>>2]=7244;c[f+4>>2]=9;a[f+1309>>0]=0;a[f+1309+1>>0]=0;a[f+1309+2>>0]=0;a[f+1309+3>>0]=0;a[f+1309+4>>0]=0;a[f+1309+5>>0]=0;b=f+1316|0;d=b+48|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));g[f+1364>>2]=1.0;g[f+1368>>2]=1.0;g[f+1372>>2]=1.0;g[f+1376>>2]=1.0;g[f+1380>>2]=1.0;g[f+1384>>2]=1.0;return f|0}function bl(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;f=(a[b+16>>0]|0)==0;h=c[(f?d:e)+8>>2]|0;e=f?e:d;f=c[e+8>>2]|0;g=c[h+268>>2]|0;a:do if((g|0)>0){d=c[h+276>>2]|0;b=0;while(1){if((c[d+(b<<2)>>2]|0)==(f|0))break;b=b+1|0;if((b|0)>=(g|0))break a}if((b|0)!=(g|0))return}while(0);d=c[h+284>>2]|0;Za[c[(c[d>>2]|0)+36>>2]&127](d,h,e);return}function cl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,16)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=8384;a[b+8>>0]=0;c[b+12>>2]=0;if(!(Ja[c[(c[d>>2]|0)+24>>2]&63](d,c[e+8>>2]|0,c[f+8>>2]|0)|0))return b|0;d=c[b+4>>2]|0;c[b+12>>2]=Ja[c[(c[d>>2]|0)+12>>2]&63](d,c[e+8>>2]|0,c[f+8>>2]|0)|0;a[b+8>>0]=1;return b|0}function dl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0.0,h=0.0,i=0.0,j=0.0,k=0.0;i=+va[c[(c[a>>2]|0)+48>>2]&15](a);h=+va[c[(c[a>>2]|0)+48>>2]&15](a);f=+va[c[(c[a>>2]|0)+48>>2]&15](a);k=+g[b+52>>2]-h;j=+g[b+56>>2]-f;g[d>>2]=+g[b+48>>2]-i;g[d+4>>2]=k;g[d+8>>2]=j;g[d+12>>2]=0.0;h=h+ +g[b+52>>2];f=f+ +g[b+56>>2];g[e>>2]=i+ +g[b+48>>2];g[e+4>>2]=h;g[e+8>>2]=f;g[e+12>>2]=0.0;return}function el(b,d){b=b|0;d=d|0;var e=0;a[b+148>>0]=0;a:do if(kd(b,d)|0){e=0;while(1){a[b+148>>0]=1;if(e>>>0>3)break a;if(kd(b,d)|0)e=e+1|0;else break}}while(0);d=(c[b+8>>2]|0)+52|0;c[b+92>>2]=c[d>>2];c[b+92+4>>2]=c[d+4>>2];c[b+92+8>>2]=c[d+8>>2];c[b+92+12>>2]=c[d+12>>2];fp(b+112|0,d|0,16)|0;return}function fl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;g=c[a+720>>2]|0;h=c[a+732>>2]|0;if((h|0)<=0){h=0;return h|0}e=c[a+740>>2]|0;a=0;while(1){f=c[e+(a*52|0)+8>>2]|0;if((f|0)==(g+(b*104|0)|0)?(c[e+(a*52|0)+12>>2]|0)==(g+(d*104|0)|0):0){a=1;e=8;break}if((f|0)==(g+(d*104|0)|0)?(c[e+(a*52|0)+12>>2]|0)==(g+(b*104|0)|0):0){a=1;e=8;break}a=a+1|0;if((a|0)>=(h|0)){a=0;e=8;break}}if((e|0)==8)return a|0;return 0}function gl(a){a=a|0;var b=0,d=0,e=0.0,f=0.0;if((c[a+136>>2]|0)<=0)return;b=0;do{d=c[a+144>>2]|0;c[d+(b*284|0)+32>>2]=c[d+(b*284|0)+204>>2];g[d+(b*284|0)+272>>2]=0.0;f=-+g[d+(b*284|0)+56>>2];e=-+g[d+(b*284|0)+60>>2];g[d+(b*284|0)>>2]=-+g[d+(b*284|0)+52>>2];g[d+(b*284|0)+4>>2]=f;g[d+(b*284|0)+8>>2]=e;g[d+(b*284|0)+12>>2]=0.0;g[d+(b*284|0)+268>>2]=1.0;b=b+1|0}while((b|0)<(c[a+136>>2]|0));return}function hl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=c[d>>2]|0;g=Ha[c[(c[g>>2]|0)+56>>2]&31](g,20)|0;h=c[d+4>>2]|0;i=a[b+4>>0]|0;b=c[d>>2]|0;c[g+4>>2]=b;c[g>>2]=8812;a[g+8>>0]=0;c[g+12>>2]=h;a[g+16>>0]=i;if(h|0)return g|0;c[g+12>>2]=Ja[c[(c[b>>2]|0)+12>>2]&63](b,c[e+8>>2]|0,c[f+8>>2]|0)|0;a[g+8>>0]=1;return g|0}function il(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;j=+g[d>>2];i=+g[d+4>>2];e=+g[d+8>>2];f=j*+g[b+56>>2]+i*+g[b+60>>2]+e*+g[b+64>>2];h=j*+g[b+72>>2]+i*+g[b+76>>2]+e*+g[b+80>>2];e=j*+g[b+88>>2]+i*+g[b+92>>2]+e*+g[b+96>>2];d=b+56+((f>2]=c[d>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];return}function jl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,44)|0;c[b+4>>2]=c[d>>2];c[b>>2]=8972;a[b+24>>0]=1;c[b+20>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;a[b+28>>0]=1;c[b+32>>2]=c[d+4>>2];a[b+36>>0]=0;c[b+40>>2]=c[(c[f+4>>2]|0)+68>>2];ug(b,e,f);return b|0}function kl(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){do{e=b;b=VA(b|0,c|0,10,0)|0;f=c;c=Q()|0;g=Vr(b|0,c|0,-10,-1)|0;g=xv(e|0,f|0,g|0,Q()|0)|0;Q()|0;d=d+-1|0;a[d>>0]=g&255|48}while(f>>>0>9|(f|0)==9&e>>>0>4294967295);c=b}else c=b;if(c)do{g=c;c=(c>>>0)/10|0;d=d+-1|0;a[d>>0]=g+(J(c,-10)|0)|48}while(g>>>0>=10);return d|0}function ll(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0,h=0.0,i=0.0,j=0.0,k=0.0;k=+g[a+28>>2];i=+g[a+32>>2];e=+g[a+36>>2];j=+va[c[(c[a>>2]|0)+48>>2]&15](a);h=+va[c[(c[a>>2]|0)+48>>2]&15](a);e=e+ +va[c[(c[a>>2]|0)+48>>2]&15](a);f=(1?b>>>1:b)&1;a=(2?b>>>2:b)&1;g[d>>2]=(k+j)*+(b&1^1|0)-(k+j)*+(b&1|0);g[d+4>>2]=(i+h)*+(f^1|0)-(i+h)*+(f|0);g[d+8>>2]=e*+(a^1|0)-e*+(a|0);g[d+12>>2]=0.0;return}function ml(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,44)|0;c[b+4>>2]=c[d>>2];c[b>>2]=8972;a[b+24>>0]=1;c[b+20>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;a[b+28>>0]=0;c[b+32>>2]=c[d+4>>2];a[b+36>>0]=0;c[b+40>>2]=c[(c[e+4>>2]|0)+68>>2];ug(b,e,f);return b|0}function nl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;f=c[d>>2]|0;f=Ha[c[(c[f>>2]|0)+56>>2]&31](f,36)|0;h=c[d+4>>2]|0;j=c[b+12>>2]|0;i=c[b+8>>2]|0;g=c[b+16>>2]|0;e=c[b+20>>2]|0;c[f+4>>2]=c[d>>2];c[f>>2]=8860;c[f+8>>2]=j;c[f+12>>2]=i;a[f+16>>0]=0;c[f+20>>2]=h;a[f+24>>0]=0;c[f+28>>2]=g;c[f+32>>2]=e;return f|0}function ol(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=sa;sa=sa+48|0;c[f>>2]=9836;c[f+4>>2]=b;c[f+8>>2]=c[d>>2];c[f+8+4>>2]=c[d+4>>2];c[f+8+8>>2]=c[d+8>>2];c[f+8+12>>2]=c[d+12>>2];c[f+24>>2]=c[e>>2];c[f+24+4>>2]=c[e+4>>2];c[f+24+8>>2]=c[e+8>>2];c[f+24+12>>2]=c[e+12>>2];b=c[a+48>>2]|0;ab[c[(c[b>>2]|0)+8>>2]&127](b,f,d,e);sa=f;return}function pl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;do if((c[d+76>>2]|0)>=0?(MI()|0)!=0:0){if((b&255|0)!=(a[d+75>>0]|0)?(f=c[d+20>>2]|0,f>>>0<(c[d+16>>2]|0)>>>0):0){c[d+20>>2]=f+1;a[f>>0]=b;b=b&255;break}b=sl(d,b)|0}else g=3;while(0);do if((g|0)==3){if((b&255|0)!=(a[d+75>>0]|0)?(e=c[d+20>>2]|0,e>>>0<(c[d+16>>2]|0)>>>0):0){c[d+20>>2]=e+1;a[e>>0]=b;b=b&255;break}b=sl(d,b)|0}while(0);return b|0}function ql(a,b,d){a=a|0;b=+b;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;i=+g[a+28>>2];f=+g[a+32>>2];j=+g[a+36>>2];h=+va[c[(c[a>>2]|0)+48>>2]&15](a);e=+va[c[(c[a>>2]|0)+48>>2]&15](a);j=(j+ +va[c[(c[a>>2]|0)+48>>2]&15](a))*2.0;g[d>>2]=b/12.0*((f+e)*2.0*(f+e)*2.0+j*j);g[d+4>>2]=b/12.0*((i+h)*2.0*(i+h)*2.0+j*j);g[d+8>>2]=b/12.0*((i+h)*2.0*(i+h)*2.0+(f+e)*2.0*(f+e)*2.0);g[d+12>>2]=0.0;return}function rl(a,b){a=a|0;b=+b;var d=0,e=0.0,f=0.0,h=0.0,i=0.0;d=zs()|0;c[d+4>>2]=35;c[d+8>>2]=0;g[d+12>>2]=0.0;c[d>>2]=9856;i=+g[a>>2];h=+g[a+4>>2];f=+g[a+8>>2];a=c[a+12>>2]|0;e=1.0/+x(+(i*i+h*h+f*f));g[d+48>>2]=i*e;g[d+52>>2]=h*e;g[d+56>>2]=f*e;c[d+60>>2]=a;g[d+64>>2]=b;c[d+68>>2]=0;c[d+68+4>>2]=0;c[d+68+8>>2]=0;c[d+68+12>>2]=0;c[d+4>>2]=28;return d|0}function sl(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0;i=sa;sa=sa+16|0;a[i>>0]=e;f=c[b+16>>2]|0;if(!f)if(!(_n(b)|0)){g=c[b+16>>2]|0;h=4}else f=-1;else{g=f;h=4}do if((h|0)==4){f=c[b+20>>2]|0;if(f>>>0>>0?(e&255|0)!=(a[b+75>>0]|0):0){c[b+20>>2]=f+1;a[f>>0]=e;f=e&255;break}if((Ja[c[b+36>>2]&63](b,i,1)|0)==1)f=d[i>>0]|0;else f=-1}while(0);sa=i;return f|0}function tl(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=sa;sa=sa+32|0;Ap(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);rp(d,+g[b>>2],+g[b+4>>2],+g[b+8>>2],+g[a+348>>2],+g[a+352>>2],+g[a+356>>2]);Co(d+16|0,+g[c>>2],+g[c+4>>2],+g[c+8>>2],+g[d>>2],+g[d+4>>2],+g[d+8>>2]);Fp(a,+g[d+16>>2],+g[d+16+4>>2],+g[d+16+8>>2]);sa=d;return}function ul(a,b){a=a|0;b=b|0;var d=0;d=sa;sa=sa+64|0;c[d>>2]=1065353216;c[d+4>>2]=0;c[d+4+4>>2]=0;c[d+4+8>>2]=0;c[d+4+12>>2]=0;c[d+20>>2]=1065353216;c[d+24>>2]=0;c[d+24+4>>2]=0;c[d+24+8>>2]=0;c[d+24+12>>2]=0;c[d+40>>2]=1065353216;c[d+44>>2]=0;c[d+48>>2]=c[b>>2];c[d+48+4>>2]=c[b+4>>2];c[d+48+8>>2]=c[b+8>>2];c[d+48+12>>2]=c[b+12>>2];Vc(a,d);sa=d;return}function vl(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=+d;e=+e;var f=0,h=0;f=sa;sa=sa+16|0;h=xG(b,0)|0;g[f+8>>2]=+Xx(+g[h>>2],+g[h+4>>2],+g[h+8>>2],c,d,e);h=xG(b,1)|0;g[f+4>>2]=+Xx(+g[h>>2],+g[h+4>>2],+g[h+8>>2],c,d,e);b=xG(b,2)|0;g[f>>2]=+Xx(+g[b>>2],+g[b+4>>2],+g[b+8>>2],c,d,e);ns(a,f+8|0,f+4|0,f);sa=f;return}function wl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;if((d|0)==0?1:(c[d+236>>2]&2|0)==0){g=1;return g|0}g=c[b+488>>2]|0;if((g|0)<=0){g=1;return g|0}e=c[b+496>>2]|0;b=0;while(1){f=c[e+(b<<2)>>2]|0;if(a[f+20>>0]|0){if((c[f+28>>2]|0)==(d|0)){b=0;e=8;break}if((c[f+32>>2]|0)==(d|0)){b=0;e=8;break}}b=b+1|0;if((b|0)>=(g|0)){b=1;e=8;break}}if((e|0)==8)return b|0;return 0}function xl(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=+d;e=+e;var f=0,h=0,i=0,j=0;f=sa;sa=sa+16|0;j=xG(b,0)|0;i=xG(b,1)|0;h=xG(b,2)|0;im(f,c,d,e,+g[j>>2],+g[j+4>>2],+g[j+8>>2],+g[i>>2],+g[i+4>>2],+g[i+8>>2],+g[h>>2],+g[h+4>>2],+g[h+8>>2]);qp(a,+g[f>>2],+g[f+4>>2],+g[f+8>>2],+g[b+48>>2],+g[b+52>>2],+g[b+56>>2]);sa=f;return}function yl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;i=+g[b+28>>2];j=+g[b+32>>2];e=+g[b+36>>2];h=+va[c[(c[b>>2]|0)+48>>2]&15](b);f=+va[c[(c[b>>2]|0)+48>>2]&15](b);e=e+ +va[c[(c[b>>2]|0)+48>>2]&15](b);f=+g[d+4>>2]>=0.0?j+f:-(j+f);e=+g[d+8>>2]>=0.0?e:-e;g[a>>2]=+g[d>>2]>=0.0?i+h:-(i+h);g[a+4>>2]=f;g[a+8>>2]=e;g[a+12>>2]=0.0;return}function zl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0.0,h=0.0,i=0.0;if((d|0)<=0)return;e=0;do{i=+g[a+28>>2];h=+g[a+32>>2];h=+g[b+(e<<4)+4>>2]>=0.0?h:-h;f=+g[a+36>>2];f=+g[b+(e<<4)+8>>2]>=0.0?f:-f;g[c+(e<<4)>>2]=+g[b+(e<<4)>>2]>=0.0?i:-i;g[c+(e<<4)+4>>2]=h;g[c+(e<<4)+8>>2]=f;g[c+(e<<4)+12>>2]=0.0;e=e+1|0}while((e|0)!=(d|0));return}function Al(a,b,d,e,f,g,h,i,j,k){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;a=c[a+32>>2]|0;c[d>>2]=c[a+(k<<5)+12>>2];c[b>>2]=c[a+(k<<5)+16>>2];c[e>>2]=c[a+(k<<5)+28>>2];c[f>>2]=c[a+(k<<5)+20>>2];c[i>>2]=c[a+(k<<5)>>2];c[g>>2]=c[a+(k<<5)+4>>2];c[h>>2]=c[a+(k<<5)+8>>2];c[j>>2]=c[a+(k<<5)+24>>2];return}function Bl(b){b=b|0;var d=0,e=0;c[b>>2]=9100;d=c[b+64>>2]|0;if(d|0?(yh(d),e=c[b+64>>2]|0,e|0):0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}d=c[b+24>>2]|0;if(!d){a[b+28>>0]=1;c[b+24>>2]=0;c[b+16>>2]=0;b=b+20|0;c[b>>2]=0;return}if(a[b+28>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+24>>2]=0;a[b+28>>0]=1;c[b+24>>2]=0;c[b+16>>2]=0;b=b+20|0;c[b>>2]=0;return}function Cl(b){b=b|0;var d=0,e=0;c[b>>2]=10164;d=c[b+104>>2]|0;if(d|0){if(a[b+108>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+104>>2]=0}a[b+108>>0]=1;c[b+104>>2]=0;c[b+96>>2]=0;c[b+100>>2]=0;c[b>>2]=9932;d=c[b+52>>2]|0;if(d|0?(Pa[c[c[d>>2]>>2]&511](d),e=c[b+52>>2]|0,e|0):0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function Dl(a,b){a=+a;b=+b;var d=0;d=Ts()|0;c[d+8>>2]=0;c[d>>2]=10064;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;g[d+56>>2]=a;g[d+60>>2]=b;c[d+4>>2]=11;g[d+52>>2]=a/+x(+(a*a+b*b));c[d>>2]=9280;c[d+64>>2]=0;c[d+68>>2]=2;c[d+72>>2]=1;g[d+28>>2]=a;g[d+36>>2]=b;g[d+32>>2]=a;return d|0}function El(a,b){a=+a;b=+b;var d=0;d=Ts()|0;c[d+8>>2]=0;c[d>>2]=10064;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;g[d+56>>2]=a;g[d+60>>2]=b;c[d+4>>2]=11;g[d+52>>2]=a/+x(+(a*a+b*b));c[d>>2]=9380;c[d+64>>2]=1;c[d+68>>2]=0;c[d+72>>2]=2;g[d+32>>2]=a;g[d+28>>2]=b;g[d+36>>2]=a;return d|0}function Fl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;switch(b|0){case 0:{a=0;b=0;e=1065353216;break}case 1:{a=0;b=0;e=-1082130432;break}case 2:{a=0;b=1065353216;e=0;break}case 3:{a=0;b=-1082130432;e=0;break}case 4:{a=1065353216;b=0;e=0;break}case 5:{a=-1082130432;b=0;e=0;break}default:return}c[d>>2]=e;c[d+4>>2]=b;c[d+8>>2]=a;g[d+12>>2]=0.0;return}function Gl(a,b){a=+a;b=b|0;var d=0,e=0,f=0;h[j>>3]=a;d=c[j>>2]|0;e=c[j+4>>2]|0;f=xt(d|0,e|0,52)|0;Q()|0;switch(f&2047){case 0:{if(a!=0.0){a=+Gl(a*18446744073709551616.0,b);d=(c[b>>2]|0)+-64|0}else d=0;c[b>>2]=d;break}case 2047:break;default:{c[b>>2]=(f&2047)+-1022;c[j>>2]=d;c[j+4>>2]=e&-2146435073|1071644672;a=+h[j>>3]}}return +a}function Hl(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;c[b+4>>2]=c[d>>2];c[b+4+4>>2]=c[d+4>>2];c[b+4+8>>2]=c[d+8>>2];c[b+4+12>>2]=c[d+12>>2];c[b+20>>2]=c[e>>2];c[b+20+4>>2]=c[e+4>>2];c[b+20+8>>2]=c[e+8>>2];c[b+20+12>>2]=c[e+12>>2];g[b+36>>2]=f;a[b+40>>0]=1;return}function Il(a,e,f){a=a|0;e=e|0;f=f|0;var h=0.0;switch(c[a+96>>2]|0){case 0:{h=+g[(c[a+92>>2]|0)+((J(c[a+64>>2]|0,f)|0)+e<<2)>>2];return +h}case 5:{h=+(d[(c[a+92>>2]|0)+((J(c[a+64>>2]|0,f)|0)+e)>>0]|0)*+g[a+88>>2];return +h}case 3:{h=+(b[(c[a+92>>2]|0)+((J(c[a+64>>2]|0,f)|0)+e<<1)>>1]|0)*+g[a+88>>2];return +h}default:{h=0.0;return +h}}return 0.0}function Jl(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];bm(a+28|0,b+28|0);c[a+76>>2]=c[b+76>>2];c[a+76+4>>2]=c[b+76+4>>2];c[a+76+8>>2]=c[b+76+8>>2];c[a+76+12>>2]=c[b+76+12>>2];c[a+76+16>>2]=c[b+76+16>>2];return}function Kl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((c[a+8>>2]|0)<=0)return;e=0;do{f=c[a+16>>2]|0;g=f+(e<<4)|0;if(Ha[c[(c[b>>2]|0)+8>>2]&31](b,g)|0){Ka[c[(c[a>>2]|0)+12>>2]&31](a,c[g>>2]|0,c[f+(e<<4)+4>>2]|0,d)|0;c[7158]=(c[7158]|0)+-1}else e=e+1|0}while((e|0)<(c[a+8>>2]|0));return}function Ll(a,b){a=a|0;b=b|0;var c=0.0,d=0;d=sa;sa=sa+32|0;c=+g[b+12>>2];if(1.0-c*c<1.1920928955078125e-06){g[d+20>>2]=1.0;g[d+16>>2]=0.0;g[d+12>>2]=0.0;ns(a,d+20|0,d+16|0,d+12|0);sa=d;return}else{c=1.0/+wI(1.0-c*c);g[d+8>>2]=+g[b>>2]*c;g[d+4>>2]=+g[b+4>>2]*c;g[d>>2]=+g[b+8>>2]*c;ns(a,d+8|0,d+4|0,d);sa=d;return}}function Ml(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;d=sa;sa=sa+16|0;c[d>>2]=11884;c[d+4>>2]=e;Fd(a+4|0,c[a+4>>2]|0,b,e+4|0,e+20|0,+g[e+32>>2],f,h,d);Fd(a+64|0,c[a+64>>2]|0,b,e+4|0,e+20|0,+g[e+32>>2],f,h,d);sa=d;return}function Nl(b){b=b|0;var d=0;c[b>>2]=10164;d=c[b+104>>2]|0;if(d|0){if(a[b+108>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+104>>2]=0}a[b+108>>0]=1;c[b+104>>2]=0;c[b+96>>2]=0;c[b+100>>2]=0;c[b>>2]=9932;d=c[b+52>>2]|0;if(!d)return;Pa[c[c[d>>2]>>2]&511](d);d=c[b+52>>2]|0;if(!d)return;c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);return}function Ol(a,b){a=+a;b=+b;var d=0;d=Ts()|0;c[d+8>>2]=0;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;c[d>>2]=9180;g[d+56>>2]=a;g[d+60>>2]=b;c[d+4>>2]=11;c[d+64>>2]=0;c[d+68>>2]=1;c[d+72>>2]=2;g[d+28>>2]=a;g[d+32>>2]=b;g[d+36>>2]=a;g[d+52>>2]=a/+x(+(a*a+b*b));return d|0}function Pl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0;e=sa;sa=sa+16|0;c[e>>2]=-1;c[e+4>>2]=c[a+16>>2];if(!(c[b+4>>2]|0))c[b+4>>2]=e;g=c[a+12>>2]|0;f=+ya[c[(c[g>>2]|0)+12>>2]&15](g,b,d);c[a+4>>2]=c[(c[a+12>>2]|0)+4>>2];sa=e;return +f}function Ql(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=JI(c[a+4>>2]|0)|0;if((e|0)>(b|0)){c[a+4>>2]=b;return}if((e|0)<(b|0))xn(a,b);while(1){if((e|0)>=(b|0))break;f=(c[a+12>>2]|0)+(e*104|0)|0;g=d;h=f+104|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0}while((f|0)<(h|0));e=e+1|0}c[a+4>>2]=b;return}function Rl(a,b){a=a|0;b=b|0;var d=0;d=sa;sa=sa+16|0;c[a+348>>2]=c[b>>2];c[a+348+4>>2]=c[b+4>>2];c[a+348+8>>2]=c[b+8>>2];c[a+348+12>>2]=c[b+12>>2];Wp(d,+g[a+348>>2],+g[a+352>>2],+g[a+356>>2],+g[a+344>>2]);c[a+560>>2]=c[d>>2];c[a+560+4>>2]=c[d+4>>2];c[a+560+8>>2]=c[d+8>>2];c[a+560+12>>2]=c[d+12>>2];sa=d;return}function Sl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=JI(c[a+4>>2]|0)|0;if((e|0)>(b|0)){c[a+4>>2]=b;return}if((e|0)<(b|0))Pn(a,b);while(1){if((e|0)>=(b|0))break;f=JI((c[a+12>>2]|0)+(e<<4)|0)|0;c[f>>2]=c[d>>2];c[f+4>>2]=c[d+4>>2];c[f+8>>2]=c[d+8>>2];c[f+12>>2]=c[d+12>>2];e=e+1|0}c[a+4>>2]=b;return}function Tl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;g=c[a+268>>2]|0;if((g|0)<=0)return;b=c[b>>2]|0;f=c[a+276>>2]|0;d=0;while(1){e=f+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(g|0)){h=7;break}}if((h|0)==7)return;if((d|0)>=(g|0))return;c[e>>2]=c[f+(g+-1<<2)>>2];c[a+268>>2]=g+-1;return}function Ul(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0,f=0.0,h=0.0,i=0.0;e=sa;sa=sa+16|0;f=+zI(b*.5);b=+yI(b*.5);h=+zI(c*.5);c=+yI(c*.5);i=+zI(d*.5);d=+yI(d*.5);g[e+12>>2]=d*h*f-i*c*b;g[e+8>>2]=i*c*f+d*h*b;g[e+4>>2]=i*h*b-d*c*f;g[e>>2]=i*h*f+d*c*b;tr(a,e+12|0,e+8|0,e+4|0,e);sa=e;return}function Vl(a,b,d,e,f,h){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;h=+h;c[a>>2]=b;c[a+4>>2]=d;c[a+8>>2]=c[e>>2];c[a+8+4>>2]=c[e+4>>2];c[a+8+8>>2]=c[e+8>>2];c[a+8+12>>2]=c[e+12>>2];c[a+24>>2]=c[f>>2];c[a+24+4>>2]=c[f+4>>2];c[a+24+8>>2]=c[f+8>>2];c[a+24+12>>2]=c[f+12>>2];g[a+40>>2]=h;return}function Wl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=c[a+280>>2]|0;if((f|0)<=0)return;g=c[a+288>>2]|0;d=0;while(1){e=g+(d<<2)|0;if((c[e>>2]|0)==(b|0))break;d=d+1|0;if((d|0)>=(f|0)){h=7;break}}if((h|0)==7)return;if((d|0)>=(f|0))return;c[e>>2]=c[g+(f+-1<<2)>>2];c[(c[a+288>>2]|0)+(f+-1<<2)>>2]=b;c[a+280>>2]=f+-1;return}function Xl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=JI(c[a+4>>2]|0)|0;if((e|0)>(b|0)){d=b;while(1){if((d|0)>=(e|0))break;RG((c[a+12>>2]|0)+(d*36|0)|0);d=d+1|0}c[a+4>>2]=b;return}if((e|0)<(b|0))Om(a,b);while(1){if((e|0)>=(b|0))break;wq((c[a+12>>2]|0)+(e*36|0)|0,d);e=e+1|0}c[a+4>>2]=b;return}function Yl(){var b=0;b=sa;sa=sa+48|0;if(a[26624]|0){sa=b;return}if(!(mz(26624)|0)){sa=b;return}g[b+32>>2]=1.0;g[b+28>>2]=0.0;g[b+24>>2]=0.0;g[b+20>>2]=0.0;g[b+16>>2]=1.0;g[b+12>>2]=0.0;g[b+8>>2]=0.0;g[b+4>>2]=0.0;g[b>>2]=1.0;Zp(27096,b+32|0,b+28|0,b+24|0,b+20|0,b+16|0,b+12|0,b+8|0,b+4|0,b);sa=b;return}function Zl(a){a=a|0;var b=0;b=sa;sa=sa+32|0;g[a>>2]=1.2000000476837158;g[a+4>>2]=0.0;g[a+8>>2]=0.0;g[a+12>>2]=1.0e3;g[b+20>>2]=0.0;g[b+16>>2]=0.0;g[b+12>>2]=0.0;ns(a+16|0,b+20|0,b+16|0,b+12|0);c[a+32>>2]=0;c[a+36>>2]=0;g[b+8>>2]=0.0;g[b+4>>2]=-10.0;g[b>>2]=0.0;ns(a+40|0,b+8|0,b+4|0,b);SG(a+56|0);sa=b;return}function _l(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=c[a+712>>2]|0;if((e|0)<=0)return;d=c[a+720>>2]|0;a=0;do{if(+g[d+(a*104|0)+88>>2]>0.0){f=d+(a*104|0)+56|0;g[f>>2]=+g[b>>2]+ +g[f>>2];f=d+(a*104|0)+60|0;g[f>>2]=+g[b+4>>2]+ +g[f>>2];f=d+(a*104|0)+64|0;g[f>>2]=+g[b+8>>2]+ +g[f>>2]}a=a+1|0}while((a|0)!=(e|0));return}function $l(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0.0,g=0;e=sa;sa=sa+16|0;c[e>>2]=-1;c[e+4>>2]=c[a+24>>2];if(!(c[b+4>>2]|0))c[b+4>>2]=e;g=c[a+20>>2]|0;f=+ya[c[(c[g>>2]|0)+12>>2]&15](g,b,d);c[a+4>>2]=c[(c[a+20>>2]|0)+4>>2];sa=e;return +f}function am(a,b,c){a=a|0;b=b|0;c=+c;var d=0,e=0.0;d=sa;sa=sa+16|0;e=+lA(+g[b>>2],+g[b+4>>2],+g[b+8>>2]);e=+yI(c*.5)/e;g[d+12>>2]=+g[(JI(b)|0)>>2]*e;g[d+8>>2]=+g[(oI(b)|0)>>2]*e;g[d+4>>2]=+g[(nI(b)|0)>>2]*e;g[d>>2]=+zI(c*.5);tr(a,d+12|0,d+8|0,d+4|0,d);sa=d;return}function bm(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+16+4>>2]=c[b+16+4>>2];c[a+16+8>>2]=c[b+16+8>>2];c[a+16+12>>2]=c[b+16+12>>2];c[a+32>>2]=c[b+32>>2];c[a+32+4>>2]=c[b+32+4>>2];c[a+32+8>>2]=c[b+32+8>>2];c[a+32+12>>2]=c[b+32+12>>2];return}function cm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;a:do switch(b|0){case 2:case 1:{if(c>>>0<3){d=+g[a+600>>2];break a}if((c+-3|0)>>>0<3)d=+g[a+432>>2];else d=0.0;break}case 4:case 3:{if(c>>>0<3){d=+g[a+596>>2];break a}if((c+-3|0)>>>0<3)d=+g[a+604>>2];else d=0.0;break}default:d=0.0}while(0);return +d}function dm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;b=c[d>>2]|0;b=Ha[c[(c[b>>2]|0)+56>>2]&31](b,16)|0;d=c[d>>2]|0;c[b+4>>2]=d;c[b>>2]=12164;a[b+8>>0]=0;c[b+12>>2]=0;c[b+12>>2]=Ja[c[(c[d>>2]|0)+12>>2]&63](d,c[e+8>>2]|0,c[f+8>>2]|0)|0;a[b+8>>0]=1;return b|0}function em(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+56>>2]|0;if(!d)return;e=Fa[c[(c[d>>2]|0)+8>>2]&127](d)|0;e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,e,1)|0;d=c[a+56>>2]|0;d=Ja[c[(c[d>>2]|0)+12>>2]&63](d,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,d,1346456916,c[a+56>>2]|0);return}function fm(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;switch(b|0){case 2:case 1:if(e>>>0<3){g[a+600>>2]=d;c[a+592>>2]=c[a+592>>2]|2;return}else{g[a+432>>2]=d;return}case 4:case 3:if(e>>>0<3){g[a+596>>2]=d;c[a+592>>2]=c[a+592>>2]|1;return}else{g[a+604>>2]=d;c[a+592>>2]=c[a+592>>2]|4;return}default:return}}function gm(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+52>>2]|0;if(!d)return;e=Fa[c[(c[d>>2]|0)+12>>2]&127](d)|0;e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,e,1)|0;d=c[a+52>>2]|0;d=Ja[c[(c[d>>2]|0)+16>>2]&63](d,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,d,1213612625,c[a+52>>2]|0);return}function hm(b,e){b=b|0;e=e|0;var f=0,g=0;f=0;while(1){if((d[496+f>>0]|0)==(b|0)){g=4;break}f=f+1|0;if((f|0)==87){b=87;g=5;break}}if((g|0)==4)if(!f)f=592;else{b=f;g=5}if((g|0)==5){f=592;do{do{g=f;f=f+1|0}while((a[g>>0]|0)!=0);b=b+-1|0}while((b|0)!=0)}return NG(f,c[e+20>>2]|0)|0}function im(a,b,c,d,e,f,h,i,j,k,l,m,n){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;i=+i;j=+j;k=+k;l=+l;m=+m;n=+n;var o=0;o=sa;sa=sa+16|0;g[o+8>>2]=+Xx(b,c,d,e,f,h);g[o+4>>2]=+Xx(b,c,d,i,j,k);g[o>>2]=+Xx(b,c,d,l,m,n);ns(a,o+8|0,o+4|0,o);sa=o;return}function jm(a,b,c){a=a|0;b=b|0;c=+c;var d=0.0,e=0.0,f=0.0,h=0.0;e=+g[a+28>>2];f=+g[a+32>>2];h=+g[a+36>>2];d=+g[b>>2];if(!(d<=e+c)){b=0;return b|0}if(!(d>=-e-c)){b=0;return b|0}d=+g[b+4>>2];if(!(d<=f+c)){b=0;return b|0}if(!(d>=-f-c)){b=0;return b|0}d=+g[b+8>>2];if(!(d<=h+c)){b=0;return b|0}b=d>=-h-c;return b|0}function km(a,b,d){a=a|0;b=b|0;d=d|0;Fv(a);c[a>>2]=5708;c[a+12>>2]=c[b>>2];c[a+12+4>>2]=c[b+4>>2];c[a+12+8>>2]=c[b+8>>2];c[a+12+12>>2]=c[b+12>>2];c[a+28>>2]=c[d>>2];c[a+28+4>>2]=c[d+4>>2];c[a+28+8>>2]=c[d+8>>2];c[a+28+12>>2]=c[d+12>>2];c[a+76>>2]=0;return}function lm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=+f;if(!(+g[b+36>>2]>f))return;a[b+40>>0]=1;c[b+4>>2]=c[d>>2];c[b+4+4>>2]=c[d+4>>2];c[b+4+8>>2]=c[d+8>>2];c[b+4+12>>2]=c[d+12>>2];c[b+20>>2]=c[e>>2];c[b+20+4>>2]=c[e+4>>2];c[b+20+8>>2]=c[e+8>>2];c[b+20+12>>2]=c[e+12>>2];g[b+36>>2]=f;return}function mm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;d=+g[b+28>>2];f=+g[b+36>>2];j=+g[c>>2];e=+g[c+4>>2];i=+x(+(j*j+e*e));if(i!=0.0){h=e*(d/i);e=+g[c+8>>2]<0.0?-f:f;d=j*(d/i)}else{h=0.0;e=+g[c+8>>2]<0.0?-f:f}g[a>>2]=d;g[a+8>>2]=e;g[a+4>>2]=h;return}function nm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;d=+g[b+28>>2];f=+g[b+32>>2];j=+g[c>>2];e=+g[c+8>>2];i=+x(+(j*j+e*e));if(i!=0.0){h=e*(d/i);e=+g[c+4>>2]<0.0?-f:f;d=j*(d/i)}else{h=0.0;e=+g[c+4>>2]<0.0?-f:f}g[a>>2]=d;g[a+4>>2]=e;g[a+8>>2]=h;return}function om(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0,h=0.0,i=0.0,j=0.0;d=+g[b+32>>2];f=+g[b+28>>2];j=+g[c+4>>2];e=+g[c+8>>2];i=+x(+(j*j+e*e));if(i!=0.0){h=e*(d/i);e=+g[c>>2]<0.0?-f:f;d=j*(d/i)}else{h=0.0;e=+g[c>>2]<0.0?-f:f}g[a+4>>2]=d;g[a>>2]=e;g[a+8>>2]=h;return}function pm(a,b){a=a|0;b=+b;var c=0,d=0.0;c=sa;sa=sa+16|0;if(!(+g[a+68>>2]>0.0)){sa=c;return}d=-+g[a+92>>2];b=-+g[a+96>>2];g[c>>2]=-+g[a+88>>2];g[c+4>>2]=d;g[c+8>>2]=b;g[c+12>>2]=0.0;ti(a+4|0,c,a+164|0);ti(a+16|0,a+88|0,a+180|0);sa=c;return}function qm(a){a=a|0;var b=0.0,d=0.0,e=0.0;d=+g[(c[a+28>>2]|0)+344>>2];e=+g[(c[a+32>>2]|0)+344>>2];e=e==0.0?1.0:d/(d+e);d=+g[a+1116>>2]*e+(1.0-e)*+g[a+1180>>2];b=e*+g[a+1120>>2]+(1.0-e)*+g[a+1184>>2];g[a+1284>>2]=+g[a+1112>>2]*e+ +g[a+1176>>2]*(1.0-e);g[a+1288>>2]=d;g[a+1292>>2]=b;g[a+1296>>2]=0.0;return}function rm(a,b){a=a|0;b=b|0;var d=0.0,e=0.0,f=0.0;d=+g[a+344>>2];if(d!=0.0){f=1.0/d*+g[b+4>>2];e=1.0/d*+g[b+8>>2];g[a+364>>2]=1.0/d*+g[b>>2];g[a+368>>2]=f;g[a+372>>2]=e;g[a+376>>2]=0.0}c[a+380>>2]=c[b>>2];c[a+380+4>>2]=c[b+4>>2];c[a+380+8>>2]=c[b+8>>2];c[a+380+12>>2]=c[b+12>>2];return}function sm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=c[b+16>>2]|0;do if(f){if((f|0)!=(d|0)){c[b+36>>2]=(c[b+36>>2]|0)+1;c[b+24>>2]=2;a[b+54>>0]=1;break}if((c[b+24>>2]|0)==2)c[b+24>>2]=e}else{c[b+16>>2]=d;c[b+24>>2]=e;c[b+36>>2]=1}while(0);return}function tm(a,d){a=a|0;d=d|0;var e=0,f=0;e=c[d>>2]|0;f=c[a+80>>2]|0;if((e|0)==(f|0)){f=0;return f|0}if(!((b[a+10>>1]&b[d+4>>1])<<16>>16)){f=0;return f|0}if(!((b[d+6>>1]&b[a+8>>1])<<16>>16)){f=0;return f|0}d=c[a+92>>2]|0;f=Ja[c[(c[d>>2]|0)+28>>2]&63](d,f,e)|0;return f|0}function um(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;f=c[a+8>>2]|0;a=c[f+8>>2]|0;if((a|0)<=0)return;e=0;do{d=c[(c[f+16>>2]|0)+(e*12|0)+8>>2]|0;if(d){Va[c[(c[d>>2]|0)+16>>2]&127](d,b);a=c[f+8>>2]|0}e=e+1|0}while((e|0)<(a|0));return}function vm(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=sa;sa=sa+256|0;if((c|0)>(d|0)&(e&73728|0)==0){mk(f|0,b<<24>>24|0,((c-d|0)>>>0<256?c-d|0:256)|0)|0;if((c-d|0)>>>0>255){b=c-d|0;do{fz(a,f,256);b=b+-256|0}while(b>>>0>255);b=c-d&255}else b=c-d|0;fz(a,f,b)}sa=f;return}function wm(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;switch(e|0){case 5:case -1:break;default:return}switch(b|0){case 2:{g[a+760>>2]=d;c[a+748>>2]=c[a+748>>2]|2;return}case 4:{g[a+756>>2]=d;c[a+748>>2]=c[a+748>>2]|1;return}case 3:{g[a+752>>2]=d;c[a+748>>2]=c[a+748>>2]|4;return}default:return}}function xm(a,b,d){a=a|0;b=b|0;d=d|0;ct(a);c[a>>2]=5536;c[a+20>>2]=c[b>>2];c[a+20+4>>2]=c[b+4>>2];c[a+20+8>>2]=c[b+8>>2];c[a+20+12>>2]=c[b+12>>2];c[a+36>>2]=c[d>>2];c[a+36+4>>2]=c[d+4>>2];c[a+36+8>>2]=c[d+8>>2];c[a+36+12>>2]=c[d+12>>2];return}function ym(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[d>>2]|0;a=Kx(c[b>>2]|0)|0;f=Kx(f)|0;if(a|0)ab[c[(c[a>>2]|0)+32>>2]&127](a,d,e,b);if(!f)return 0;ab[c[(c[f>>2]|0)+32>>2]&127](f,b,e,d);return 0}function zm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=sa;sa=sa+48|0;f=c[b+192>>2]|0;ab[c[(c[f>>2]|0)+8>>2]&127](f,b+4|0,e+32|0,e+16|0);c[e>>2]=8764;c[e+4>>2]=b;c[e+8>>2]=a;c[e+12>>2]=d;d=c[a+68>>2]|0;ab[c[(c[d>>2]|0)+28>>2]&127](d,e+32|0,e+16|0,e);sa=e;return}function Am(a,b,d){a=a|0;b=b|0;d=d|0;a:do switch(c[b+216>>2]|0){case 2:case 5:{switch(c[d+216>>2]|0){case 2:case 5:{a=0;break}default:break a}return a|0}default:{}}while(0);if(c[b+256>>2]|0?!(Ha[c[c[b>>2]>>2]&31](b,d)|0):0){d=0;return d|0}d=1;return d|0}function Bm(a,b,d){a=a|0;b=b|0;d=d|0;ih(a,b,d)|0;c[b+52>>2]=c[a+300>>2];c[b+56>>2]=c[a+304>>2];c[b+60>>2]=c[a+308>>2];c[b+64>>2]=c[a+312>>2];c[b+68>>2]=c[a+316>>2];c[b+72>>2]=c[a+320>>2];c[b+76>>2]=c[a+324>>2];c[b+80>>2]=c[a+328>>2];return 16880}function Cm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=sa;sa=sa+112|0;d=JI(c[b+4>>2]|0)|0;e=f;g=e+104|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(g|0));mG(f);Ql(a,d,f);Nn(b,d,c[a+12>>2]|0);sa=f;return}function Dm(a){a=a|0;c[6726]=c[a>>2];c[6727]=c[a+4>>2];c[6728]=c[a+8>>2];c[6729]=c[a+12>>2];c[6730]=c[a+16>>2];c[6731]=c[a+20>>2];c[6732]=c[a+24>>2];bm(26932,a+28|0);c[6745]=c[a+76>>2];c[6746]=c[a+76+4>>2];c[6747]=c[a+76+8>>2];c[6748]=c[a+76+12>>2];c[6749]=c[a+76+16>>2];return}function Em(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0;e=sa;sa=sa+16|0;c=+dF(a);c=+wI(c*+dF(b));d=+Io(a,b);if(d<0.0){Rn(e,b);d=+AA(+Io(a,e)/c);d=d*2.0;sa=e;return +d}else{d=+AA(d/c);d=d*2.0;sa=e;return +d}return 0.0}function Fm(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;j=JI(b)|0;i=JI(b+16|0)|0;h=JI(b+32|0)|0;g=oI(b)|0;f=oI(b+16|0)|0;e=oI(b+32|0)|0;d=nI(b)|0;c=nI(b+16|0)|0;Zp(a,j,i,h,g,f,e,d,c,nI(b+32|0)|0);return}function Gm(a,b){a=a|0;b=b|0;var d=0;if(c[b+40>>2]|0){Gm(a,c[b+36>>2]|0);Gm(a,c[b+40>>2]|0)}if((c[a>>2]|0)==(b|0))c[a>>2]=0;d=c[a+4>>2]|0;if(!d){c[a+4>>2]=b;return}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);c[a+4>>2]=b;return}function Hm(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0;g=c[a+32>>2]|0;c[g>>2]=(c[g>>2]|0)+1;Of(a,Yc(a,b,f)|0);Of(a,Yc(a,d,f)|0);Of(a,Yc(a,e,f)|0);return}function Im(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(RC(a,c[b+8>>2]|0)|0)Ck(b,d,e,f);else{a=c[a+8>>2]|0;gb[c[(c[a>>2]|0)+20>>2]&7](a,b,d,e,f,g)}return}function Jm(a){a=a|0;var b=0;b=sa;sa=sa+48|0;g[b+32>>2]=1.0;g[b+28>>2]=0.0;g[b+24>>2]=0.0;g[b+20>>2]=0.0;g[b+16>>2]=1.0;g[b+12>>2]=0.0;g[b+8>>2]=0.0;g[b+4>>2]=0.0;g[b>>2]=1.0;Lo(a,b+32|0,b+28|0,b+24|0,b+20|0,b+16|0,b+12|0,b+8|0,b+4|0,b);sa=b;return}function Km(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+4>>2]|0;e=JI(d)|0;if((e|0)==(JI(c[a+8>>2]|0)|0)){qn(a,zB(e)|0);d=c[a+4>>2]|0}Jl((c[a+12>>2]|0)+(d*96|0)|0,b);c[a+4>>2]=(c[a+4>>2]|0)+1;return}function Lm(a,b){a=a|0;b=b|0;var d=0,e=0;c[a+68>>2]=(c[a+68>>2]|0)+1;d=c[a+16>>2]|0;if((d|0)>0)do{e=d;d=d+-1|0;if((c[(c[a+24>>2]|0)+(d*80|0)+64>>2]|0)==(b|0))Cd(a,d)}while((e|0)>1);Pa[c[(c[a>>2]|0)+68>>2]&511](a);return}function Mm(a,b){a=+a;b=+b;var d=0;d=Xs()|0;c[d+8>>2]=0;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;c[d+4>>2]=10;c[d>>2]=10500;c[d+52>>2]=2;g[d+28>>2]=a;g[d+32>>2]=a;g[d+36>>2]=b*.5;g[d+40>>2]=0.0;return d|0}function Nm(a,b){a=+a;b=+b;var d=0;d=Xs()|0;c[d+8>>2]=0;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;c[d+4>>2]=10;c[d>>2]=10400;c[d+52>>2]=0;g[d+28>>2]=b*.5;g[d+32>>2]=a;g[d+36>>2]=a;g[d+40>>2]=0.0;return d|0}function Om(b,d){b=b|0;d=d|0;var e=0;if((JI(c[b+8>>2]|0)|0)>=(d|0))return;e=zu(d)|0;Oq(b,JI(c[b+4>>2]|0)|0,e);bs(b,JI(c[b+4>>2]|0)|0);Os(b);a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=d;return}function Pm(a,b){a=+a;b=+b;var d=0;d=Xs()|0;c[d+8>>2]=0;c[d+12>>2]=1065353216;c[d+16>>2]=1065353216;c[d+20>>2]=1065353216;g[d+24>>2]=0.0;g[d+44>>2]=.03999999910593033;c[d>>2]=10300;c[d+4>>2]=10;c[d+52>>2]=1;g[d+28>>2]=a;g[d+32>>2]=b*.5;g[d+36>>2]=a;g[d+40>>2]=0.0;return d|0}function Qm(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;a:do switch(c|0){case 5:case -1:switch(b|0){case 2:{d=+g[a+760>>2];break a}case 4:{d=+g[a+756>>2];break a}case 3:{d=+g[a+752>>2];break a}default:{d=0.0;break a}}default:d=0.0}while(0);return +d}function Rm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=sa;sa=sa+16|0;c[f>>2]=a;c[f+4>>2]=e;e=c[a+72+((c[(c[b+4>>2]|0)+4>>2]|0)*144|0)+(c[(c[d+4>>2]|0)+4>>2]<<2)>>2]|0;e=Ka[c[(c[e>>2]|0)+8>>2]&31](e,f,b,d)|0;sa=f;return e|0}function Sm(a,b){a=a|0;b=b|0;var d=0;a=c[a+64>>2]|0;if(!b)return;d=c[a+16>>2]|0;if(d>>>0<=b>>>0?(d+(J(c[a>>2]|0,c[a+4>>2]|0)|0)|0)>>>0>b>>>0:0){c[b>>2]=c[a+12>>2];c[a+12>>2]=b;c[a+8>>2]=(c[a+8>>2]|0)+1;return}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function Tm(a){a=a|0;var b=0,d=0;if((c[a+232>>2]|0)<=0)return;b=0;do{d=(c[(c[a+240>>2]|0)+(b<<2)>>2]|0)+412|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+24>>2]=0;c[d+28>>2]=0;b=b+1|0}while((b|0)<(c[a+232>>2]|0));return}function Um(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=JI(c[a+4>>2]|0)|0;if((e|0)>(b|0)){c[a+4>>2]=b;return}if((e|0)<(b|0))qn(a,b);while(1){if((e|0)>=(b|0))break;Jl((c[a+12>>2]|0)+(e*96|0)|0,d);e=e+1|0}c[a+4>>2]=b;return}function Vm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=sa;sa=sa+48|0;d=JI(c[b+4>>2]|0)|0;e=f;g=e+36|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(g|0));SG(f);Xl(a,d,f);RG(f);Oq(b,d,c[a+12>>2]|0);sa=f;return}function Wm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;f=sa;sa=sa+96|0;d=JI(c[b+4>>2]|0)|0;e=f;g=e+96|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(g|0));Um(a,d,f);dq(b,d,c[a+12>>2]|0);sa=f;return}function Xm(a,d){a=a|0;d=d|0;var f=0,g=0;if(b[a+56>>1]|0)return;b[a+64>>1]=1;d=b[a+58>>1]|0;g=c[a+60>>2]|0;if((d&65535)>1){f=1;do{d=f;f=f+1|0;b[g+(d<<6)+48>>1]=f;d=e[a+58>>1]|0}while(f>>>0>>0)}else d=d&65535;b[g+(d+-1<<6)+48>>1]=0;return}function Ym(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[a+12>>2]|0;if((d|0)<=0)return;f=0;do{e=c[(c[a+20>>2]|0)+(f<<2)>>2]|0;if(e){Va[c[(c[e>>2]|0)+16>>2]&127](e,b);d=c[a+12>>2]|0}f=f+1|0}while((f|0)<(d|0));return}function Zm(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=c[a+32>>2]|0;c[f>>2]=(c[f>>2]|0)+1;Of(a,Yc(a,b,0)|0);Of(a,Yc(a,d,0)|0);Of(a,Yc(a,e,0)|0);return}function _m(a,b,d){a=a|0;b=b|0;d=d|0;c[a+52>>2]=c[b>>2];c[a+52+4>>2]=c[b+4>>2];c[a+52+8>>2]=c[b+8>>2];c[a+52+12>>2]=c[b+12>>2];c[a+68>>2]=c[d>>2];c[a+68+4>>2]=c[d+4>>2];c[a+68+8>>2]=c[d+8>>2];c[a+68+12>>2]=c[d+12>>2];c[a+48>>2]=1;return}function $m(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[d>>2]|0;a=Kx(c[b>>2]|0)|0;e=Kx(e)|0;if(a|0)Za[c[(c[a>>2]|0)+28>>2]&127](a,d,b);if(!e)return 0;Za[c[(c[e>>2]|0)+28>>2]&127](e,b,d);return 0}function an(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=a;e=b;f=d+104|0;do{c[d>>2]=c[e>>2];d=d+4|0;e=e+4|0}while((d|0)<(f|0));Iw(a+104|0,b+104|0);Jw(a+124|0,b+124|0);Jw(a+144|0,b+144|0);return}function bn(a,b,c){a=+a;b=b|0;c=c|0;var d=0,e=0;e=sa;sa=sa+32|0;d=Nr(140)|0;g[e+8>>2]=0.0;g[e+4>>2]=0.0;g[e>>2]=0.0;ns(e+16|0,e+8|0,e+4|0,e);vk(d,a,b,c,e+16|0);sa=e;return d|0}function cn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[d>>2]=c[b+16>>2];c[d+4>>2]=c[b+16+4>>2];c[d+8>>2]=c[b+16+8>>2];c[d+12>>2]=c[b+16+12>>2];c[e>>2]=c[b+32>>2];c[e+4>>2]=c[b+32+4>>2];c[e+8>>2]=c[b+32+8>>2];c[e+12>>2]=c[b+32+12>>2];return}function dn(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;i=c[a+4>>2]|0;h=8?i>>8:i;if(i&1)h=c[(c[e>>2]|0)+h>>2]|0;a=c[a>>2]|0;gb[c[(c[a>>2]|0)+20>>2]&7](a,b,d,e+h|0,(i&2|0)==0?2:f,g);return}function en(a,b){a=a|0;b=b|0;var d=0;a=c[a+64>>2]|0;d=c[a+8>>2]|0;if(d|0){b=c[a+12>>2]|0;c[a+12>>2]=c[b>>2];c[a+8>>2]=d+-1;return b|0}c[7182]=(c[7182]|0)+1;a=xb(b+19|0)|0;if(!a){b=0;return b|0}c[(a+4+15&-16)+-4>>2]=a;b=a+4+15&-16;return b|0}function fn(a,b,d){a=a|0;b=b|0;d=d|0;a=c[a+720>>2]|0;if(!(+g[a+(d*104|0)+88>>2]>0.0))return;g[a+(d*104|0)+56>>2]=+g[b>>2]+ +g[a+(d*104|0)+56>>2];g[a+(d*104|0)+60>>2]=+g[b+4>>2]+ +g[a+(d*104|0)+60>>2];g[a+(d*104|0)+64>>2]=+g[b+8>>2]+ +g[a+(d*104|0)+64>>2];return}function gn(a,b,d){a=a|0;b=+b;d=+d;var e=0;e=sa;sa=sa+16|0;g[e+12>>2]=b;g[e+8>>2]=d;g[e+4>>2]=0.0;g[e>>2]=1.0;c[a+444>>2]=c[(b<0.0?e+4|0:b>1.0?e:e+12|0)>>2];g[e+4>>2]=0.0;g[e>>2]=1.0;c[a+448>>2]=c[(d<0.0?e+4|0:d>1.0?e:e+8|0)>>2];sa=e;return}function hn(){var b=0;b=sa;sa=sa+32|0;if(a[26616]|0){sa=b;return}if(!(mz(26616)|0)){sa=b;return}Yl();g[b+8>>2]=0.0;g[b+4>>2]=0.0;g[b>>2]=0.0;ns(b+16|0,b+8|0,b+4|0,b);bq(27032,27096,b+16|0);sa=b;return}function jn(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[(c[b>>2]|0)+16>>2]|0;e=Fa[c[(c[a>>2]|0)+16>>2]&127](a)|0;e=Ja[d&63](b,e,1)|0;d=Ja[c[(c[a>>2]|0)+20>>2]&63](a,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,d,1497645650,a);return}function kn(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;g[a+692>>2]=(c-b)*.5;b=((c-b)*.5+b)%6.2831854820251465;if(!(b<-3.1415927410125732)){if(b>3.1415927410125732)b=b+-6.2831854820251465}else b=b+6.2831854820251465;g[a+688>>2]=b;g[a+696>>2]=d;g[a+700>>2]=e;g[a+704>>2]=f;return}function ln(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+32|0;vl(e,JI(a+4|0)|0,b,c,d);rp(e+16|0,+g[e>>2],+g[e+4>>2],+g[e+8>>2],+g[a+348>>2],+g[a+352>>2],+g[a+356>>2]);Hr(a+412|0,e+16|0)|0;sa=e;return}function mn(a,b,d){a=a|0;b=b|0;d=d|0;c[b>>2]=c[a+52>>2];c[b+4>>2]=c[a+52+4>>2];c[b+8>>2]=c[a+52+8>>2];c[b+12>>2]=c[a+52+12>>2];c[d>>2]=c[a+68>>2];c[d+4>>2]=c[a+68+4>>2];c[d+8>>2]=c[a+68+8>>2];c[d+12>>2]=c[a+68+12>>2];return}function nn(a){a=a|0;var b=0,d=0,e=0;b=c[a+24>>2]|0;if((b|0)<=0)return;e=0;do{d=c[(c[a+32>>2]|0)+(e<<2)>>2]|0;switch(c[d+216>>2]|0){case 2:case 5:break;default:{Nf(d);b=c[a+24>>2]|0}}e=e+1|0}while((e|0)<(b|0));return}function on(a,b){a=a|0;b=b|0;var d=0,e=0;e=Fa[c[(c[a>>2]|0)+16>>2]&127](a)|0;e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,e,1)|0;d=Ja[c[(c[a>>2]|0)+20>>2]&63](a,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,d,1245859651,a);return}function pn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(RC(a,c[b+8>>2]|0)|0)sm(b,d,e);else{a=c[a+8>>2]|0;ab[c[(c[a>>2]|0)+28>>2]&127](a,b,d,e)}return}function qn(b,d){b=b|0;d=d|0;var e=0;if((JI(c[b+8>>2]|0)|0)>=(d|0))return;e=jt(d)|0;dq(b,JI(c[b+4>>2]|0)|0,e);Os(b);a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=d;return}function rn(a,b,c){a=a|0;b=b|0;c=+c;var d=0;d=sa;sa=sa+16|0;g[d+12>>2]=+g[(JI(b)|0)>>2]*c;g[d+8>>2]=+g[(oI(b)|0)>>2]*c;g[d+4>>2]=+g[(nI(b)|0)>>2]*c;g[d>>2]=+g[b+12>>2]*c;rv(a,d+12|0,d+8|0,d+4|0,d);sa=d;return}function sn(a,b,d){a=a|0;b=b|0;d=d|0;c[b>>2]=c[a+8>>2];c[b+4>>2]=c[a+8+4>>2];c[b+8>>2]=c[a+8+8>>2];c[b+12>>2]=c[a+8+12>>2];c[d>>2]=c[a+24>>2];c[d+4>>2]=c[a+24+4>>2];c[d+8>>2]=c[a+24+8>>2];c[d+12>>2]=c[a+24+12>>2];return}function tn(a,b){a=a|0;b=b|0;var d=0,e=0;e=Fa[c[(c[a>>2]|0)+52>>2]&127](a)|0;e=Ja[c[(c[b>>2]|0)+16>>2]&63](b,e,1)|0;d=Ja[c[(c[a>>2]|0)+56>>2]&63](a,c[e+8>>2]|0,b)|0;eb[c[(c[b>>2]|0)+20>>2]&31](b,e,d,1346455635,a);return}function un(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+32|0;vl(e,JI(a+4|0)|0,b,c,d);rp(e+16|0,+g[e>>2],+g[e+4>>2],+g[e+8>>2],+g[a+544>>2],+g[a+548>>2],+g[a+552>>2]);Hr(a+428|0,e+16|0)|0;sa=e;return}function vn(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+80|0;Fm(c+32|0,b);Lq(c,+g[b+48>>2],+g[b+52>>2],+g[b+56>>2]);vl(c+16|0,c+32|0,+g[c>>2],+g[c+4>>2],+g[c+8>>2]);bq(a,c+32|0,c+16|0);sa=c;return}function wn(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;h=c[a+4>>2]|0;g=8?h>>8:h;if(h&1)g=c[(c[d>>2]|0)+g>>2]|0;a=c[a>>2]|0;eb[c[(c[a>>2]|0)+24>>2]&31](a,b,d+g|0,(h&2|0)==0?2:e,f);return}function xn(b,d){b=b|0;d=d|0;var e=0;if((JI(c[b+8>>2]|0)|0)>=(d|0))return;e=nt(d)|0;Nn(b,JI(c[b+4>>2]|0)|0,e);Os(b);a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=d;return}function yn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=0;while(1){if((e|0)>=(b|0))break;f=JI(d+(e<<4)|0)|0;g=(c[a+12>>2]|0)+(e<<4)|0;c[f>>2]=c[g>>2];c[f+4>>2]=c[g+4>>2];c[f+8>>2]=c[g+8>>2];c[f+12>>2]=c[g+12>>2];e=e+1|0}return}function zn(b){b=b|0;var d=0;c[b>>2]=7852;d=c[b+276>>2]|0;if(d|0){if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+276>>2]=0}a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;c[b+272>>2]=0;c[b>>2]=7816;c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function An(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+32|0;rp(e,b,c,d,+g[a+348>>2],+g[a+352>>2],+g[a+356>>2]);Wp(e+16|0,+g[e>>2],+g[e+4>>2],+g[e+8>>2],+g[a+344>>2]);Hr(a+312|0,e+16|0)|0;sa=e;return}function Bn(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+32|0;vl(e,a+264|0,b,c,d);rp(e+16|0,+g[e>>2],+g[e+4>>2],+g[e+8>>2],+g[a+544>>2],+g[a+548>>2],+g[a+552>>2]);Hr(a+328|0,e+16|0)|0;sa=e;return}function Cn(a,b,d){a=a|0;b=b|0;d=d|0;c[a+164>>2]=c[b>>2];c[a+164+4>>2]=c[b+4>>2];c[a+164+8>>2]=c[b+8>>2];c[a+164+12>>2]=c[b+12>>2];b=JI(b)|0;if((!(+g[b>>2]!=1.0)?!(+g[b+4>>2]!=1.0):0)?!(+g[b+8>>2]!=1.0):0)d=0;c[a+180>>2]=d;return}function Dn(b){b=b|0;var d=0;c[b>>2]=6868;d=c[b+496>>2]|0;if(d|0){if(a[b+500>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+496>>2]=0}a[b+500>>0]=1;c[b+496>>2]=0;c[b+488>>2]=0;c[b+492>>2]=0;c[b>>2]=7816;c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function En(a,b,d){a=a|0;b=b|0;d=d|0;c[b>>2]=c[a+892>>2];c[b+4>>2]=c[a+892+4>>2];c[b+8>>2]=c[a+892+8>>2];c[b+12>>2]=c[a+892+12>>2];c[d>>2]=c[a+908>>2];c[d+4>>2]=c[a+908+4>>2];c[d+8>>2]=c[a+908+8>>2];c[d+12>>2]=c[a+908+12>>2];return}function Fn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=JI(c[a+4>>2]|0)|0;if((e|0)>(b|0)){c[a+4>>2]=b;return}if((e|0)<(b|0))co(a,b);while(1){if((e|0)>=(b|0))break;c[(c[a+12>>2]|0)+(e<<2)>>2]=c[d>>2];e=e+1|0}c[a+4>>2]=b;return}function Gn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0;a:do if((c|0)==-1)switch(b|0){case 2:case 1:{d=+g[a+336>>2];break a}case 4:case 3:{d=+g[a+340>>2];break a}default:{d=3402823466385288598117041.0e14;break a}}else d=3402823466385288598117041.0e14;while(0);return +d}function Hn(a,b,c){a=a|0;b=b|0;c=c|0;var d=0.0,e=0.0,f=0.0;f=+g[b+28>>2];e=+g[b+32>>2];e=+g[c+4>>2]>=0.0?e:-e;d=+g[b+36>>2];d=+g[c+8>>2]>=0.0?d:-d;g[a>>2]=+g[c>>2]>=0.0?f:-f;g[a+4>>2]=e;g[a+8>>2]=d;g[a+12>>2]=0.0;return}function In(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=c[a+4>>2]|0;f=8?g>>8:g;if(g&1)f=c[(c[d>>2]|0)+f>>2]|0;a=c[a>>2]|0;ab[c[(c[a>>2]|0)+28>>2]&127](a,b,d+f|0,(g&2|0)==0?2:e);return}function Jn(b){b=b|0;var d=0;c[b>>2]=7684;d=c[b+140>>2]|0;if(d|0){if(a[b+144>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+140>>2]=0}a[b+144>>0]=1;c[b+140>>2]=0;c[b+132>>2]=0;c[b+136>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function Kn(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26600]|0))mz(26600)|0;Do(d,c[b+116>>2]|0,c[b+128>>2]|0);c[6750]=c[d>>2];c[6751]=c[d+4>>2];c[6752]=c[d+8>>2];c[6753]=c[d+12>>2];sa=d;return 27e3}function Ln(b){b=b|0;var d=0;c[b>>2]=12276;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function Mn(a,b){a=a|0;b=b|0;var d=0;d=c[a+4>>2]|0;if((c[b>>2]|0)!=(d|0)?(c[b+4>>2]|0)!=(d|0):0)return 0;d=c[a+8>>2]|0;Za[c[(c[d>>2]|0)+32>>2]&127](d,b,c[a+12>>2]|0);return 0}function Nn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=0;while(1){if((e|0)>=(b|0))break;f=d+(e*104|0)|0;g=(c[a+12>>2]|0)+(e*104|0)|0;h=f+104|0;do{c[f>>2]=c[g>>2];f=f+4|0;g=g+4|0}while((f|0)<(h|0));e=e+1|0}return}function On(a){a=a|0;var b=0.0,d=0.0;if(c[a+204>>2]&3|0)return;d=+g[a+368>>2]*+g[a+352>>2];b=+g[a+372>>2]*+g[a+356>>2];g[a+412>>2]=+g[a+364>>2]*+g[a+348>>2]+ +g[a+412>>2];g[a+416>>2]=d+ +g[a+416>>2];g[a+420>>2]=b+ +g[a+420>>2];return}function Pn(b,d){b=b|0;d=d|0;var e=0;if((JI(c[b+8>>2]|0)|0)>=(d|0))return;e=mu(d)|0;yn(b,JI(c[b+4>>2]|0)|0,e);Os(b);a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=d;return}function Qn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Ha[c[(c[d>>2]|0)+40>>2]&31](d,a)|0;f=Ha[c[(c[d>>2]|0)+28>>2]&31](d,e)|0;c[b>>2]=f;if(f|0)Va[c[(c[d>>2]|0)+48>>2]&127](d,e);c[b+4>>2]=c[a+4>>2];return 21546}function Rn(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+16|0;g[c+12>>2]=-+g[(JI(b)|0)>>2];g[c+8>>2]=-+g[(oI(b)|0)>>2];g[c+4>>2]=-+g[(nI(b)|0)>>2];g[c>>2]=-+g[b+12>>2];rv(a,c+12|0,c+8|0,c+4|0,c);sa=c;return}function Sn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0.0,f=0.0,h=0;h=c[a+104>>2]|0;f=+g[h+(b<<4)+4>>2]*+g[a+16>>2];e=+g[h+(b<<4)+8>>2]*+g[a+20>>2];g[d>>2]=+g[h+(b<<4)>>2]*+g[a+12>>2];g[d+4>>2]=f;g[d+8>>2]=e;g[d+12>>2]=0.0;return}function Tn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=sa;sa=sa+32|0;c[e>>2]=c[a+60>>2];c[e+4>>2]=0;c[e+8>>2]=b;c[e+12>>2]=e+20;c[e+16>>2]=d;if((pC(_(140,e|0)|0)|0)<0){c[e+20>>2]=-1;a=-1}else a=c[e+20>>2]|0;sa=e;return a|0}function Un(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;f=c[d>>2]|0;f=Ha[c[(c[f>>2]|0)+56>>2]&31](f,20)|0;e=a[b+4>>0]|0;c[f+4>>2]=c[d>>2];c[f>>2]=6372;a[f+16>>0]=e;return f|0}function Vn(b,c){b=b|0;c=c|0;var d=0,e=0;d=a[b>>0]|0;e=a[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24)b=e;else{do{b=b+1|0;c=c+1|0;d=a[b>>0]|0;e=a[c>>0]|0}while(!(d<<24>>24==0?1:d<<24>>24!=e<<24>>24));b=e}return (d&255)-(b&255)|0}function Wn(a,b){a=a|0;b=b|0;var c=0.0;c=+g[(JI(b)|0)>>2];g[a>>2]=+g[a>>2]+c;c=+g[(oI(b)|0)>>2];g[a+4>>2]=+g[a+4>>2]+c;c=+g[(nI(b)|0)>>2];g[a+8>>2]=+g[a+8>>2]+c;g[a+12>>2]=+g[a+12>>2]+ +g[b+12>>2];return a|0}function Xn(a,b){a=a|0;b=b|0;var c=0.0;c=+g[(JI(b)|0)>>2];g[a>>2]=+g[a>>2]-c;c=+g[(oI(b)|0)>>2];g[a+4>>2]=+g[a+4>>2]-c;c=+g[(nI(b)|0)>>2];g[a+8>>2]=+g[a+8>>2]-c;g[a+12>>2]=+g[a+12>>2]-+g[b+12>>2];return a|0}function Yn(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26584]|0))mz(26584)|0;Va[c[(c[b>>2]|0)+76>>2]&127](d,b);c[6722]=c[d>>2];c[6723]=c[d+4>>2];c[6724]=c[d+8>>2];c[6725]=c[d+12>>2];sa=d;return 26888}function Zn(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26640]|0))mz(26640)|0;Va[c[(c[b>>2]|0)+76>>2]&127](d,b);c[6790]=c[d>>2];c[6791]=c[d+4>>2];c[6792]=c[d+8>>2];c[6793]=c[d+12>>2];sa=d;return 27160}function _n(b){b=b|0;var d=0;d=a[b+74>>0]|0;a[b+74>>0]=d+255|d;d=c[b>>2]|0;if(!(d&8)){c[b+8>>2]=0;c[b+4>>2]=0;d=c[b+44>>2]|0;c[b+28>>2]=d;c[b+20>>2]=d;c[b+16>>2]=d+(c[b+48>>2]|0);b=0}else{c[b>>2]=d|32;b=-1}return b|0}function $n(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;if((e|0)!=-1)return;switch(b|0){case 2:case 1:{g[a+336>>2]=d;c[a+332>>2]=c[a+332>>2]|1;return}case 4:case 3:{g[a+340>>2]=d;c[a+332>>2]=c[a+332>>2]|2;return}default:return}}function ao(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+g[(nI(a)|0)>>2];c=c*+g[(JI(b)|0)>>2];d=+g[(nI(a+16|0)|0)>>2];d=c+d*+g[(oI(b)|0)>>2];c=+g[(nI(a+32|0)|0)>>2];return +(d+c*+g[(nI(b)|0)>>2])}function bo(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+g[(oI(a)|0)>>2];c=c*+g[(JI(b)|0)>>2];d=+g[(oI(a+16|0)|0)>>2];d=c+d*+g[(oI(b)|0)>>2];c=+g[(oI(a+32|0)|0)>>2];return +(d+c*+g[(nI(b)|0)>>2])}function co(b,d){b=b|0;d=d|0;var e=0;if((JI(c[b+8>>2]|0)|0)>=(d|0))return;e=dv(d)|0;pr(b,JI(c[b+4>>2]|0)|0,e);Os(b);a[b+16>>0]=1;c[b+12>>2]=e;c[b+8>>2]=d;return}function eo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;if((b|0)==(d|0))return;e=c[(c[a+4>>2]|0)+136>>2]|0;Ja[c[(c[e>>2]|0)+8>>2]&63](e,c[b+36>>2]|0,c[d+36>>2]|0)|0;d=(c[a+4>>2]|0)+160|0;c[d>>2]=(c[d>>2]|0)+1;return}function fo(b,d,e){b=b|0;d=d|0;e=+e;var f=0;f=sa;sa=sa+16|0;if(!(a[26608]|0))mz(26608)|0;ri(f,b,d,e);c[6754]=c[f>>2];c[6755]=c[f+4>>2];c[6756]=c[f+8>>2];c[6757]=c[f+12>>2];sa=f;return 27016}function go(b,d,e){b=b|0;d=d|0;e=+e;var f=0;f=sa;sa=sa+16|0;if(!(a[26648]|0))mz(26648)|0;ri(f,b,d,e);c[6794]=c[f>>2];c[6795]=c[f+4>>2];c[6796]=c[f+8>>2];c[6797]=c[f+12>>2];sa=f;return 27176}function ho(a){a=a|0;var b=0.0,d=0,e=0.0,f=0.0;d=sa;sa=sa+32|0;Za[c[(c[a>>2]|0)+12>>2]&127](a,d+8|0,d);f=+g[d+8>>2];e=+g[d+8+4>>2];b=+g[d+8+8>>2];b=+x(+(f*f+e*e+b*b));sa=d;return +(+g[d>>2]+b)}function io(a){a=a|0;var b=0;b=c[i>>2]|0;if((a|0)>0&(b+a|0)<(b|0)|(b+a|0)<0){R()|0;Z(12);return -1}if((b+a|0)>(ia()|0)){if(!(ka(b+a|0)|0)){Z(12);return -1}}else c[i>>2]=b+a;return b|0}function jo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=sa;sa=sa+16|0;c[f>>2]=8012;c[f+4>>2]=d;c[f+8>>2]=a;Za[c[(c[b>>2]|0)+48>>2]&127](b,f,e);sa=f;return}function ko(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=+g;ab[c[(c[a>>2]|0)+8>>2]&127](a,b,d,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,d,e,f);ab[c[(c[a>>2]|0)+8>>2]&127](a,e,b,f);return}function lo(a,b,d){a=a|0;b=b|0;d=d|0;a=c[b+8>>2]|0;if(!((d|0)!=0&(a|0)!=0))return;Pa[c[c[a>>2]>>2]&511](a);Va[c[(c[d>>2]|0)+60>>2]&127](d,c[b+8>>2]|0);c[b+8>>2]=0;return}function mo(b){b=b|0;var d=0;c[b>>2]=7852;d=c[b+276>>2]|0;if(d|0){if(a[b+280>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+276>>2]=0}a[b+280>>0]=1;c[b+276>>2]=0;c[b+268>>2]=0;c[b+272>>2]=0;c[b>>2]=7816;return}function no(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=sa;sa=sa+16|0;c[e>>2]=11708;c[e+4>>2]=b;c[e+8>>2]=a;c[e+12>>2]=d;Za[c[(c[a>>2]|0)+48>>2]&127](a,e,d);sa=e;return}function oo(b){b=b|0;var d=0;c[b>>2]=9580;if(a[b+61>>0]|0?(d=c[b+52>>2]|0,Pa[c[c[d>>2]>>2]&511](d),d=c[b+52>>2]|0,d|0):0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function po(b){b=b|0;var d=0;c[b>>2]=6868;d=c[b+496>>2]|0;if(d|0){if(a[b+500>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+496>>2]=0}a[b+500>>0]=1;c[b+496>>2]=0;c[b+488>>2]=0;c[b+492>>2]=0;c[b>>2]=7816;return}function qo(a,b,c,d){a=+a;b=+b;c=+c;d=+d;var e=0,f=0;f=sa;sa=sa+16|0;g[f+12>>2]=a;g[f+8>>2]=b;g[f+4>>2]=c;g[f>>2]=d;e=Zs()|0;Zt(e,f+12|0,f+8|0,f+4|0,f);sa=f;return e|0}function ro(a,b,c,d){a=+a;b=+b;c=+c;d=+d;var e=0,f=0;f=sa;sa=sa+16|0;g[f+12>>2]=a;g[f+8>>2]=b;g[f+4>>2]=c;g[f>>2]=d;e=Nr(16)|0;rv(e,f+12|0,f+8|0,f+4|0,f);sa=f;return e|0}function so(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if(RC(a,c[b+8>>2]|0)|0)Ck(b,d,e,f);return}function to(a){a=a|0;var b=0.0,d=0,e=0,f=0.0;e=c[a+712>>2]|0;if((e|0)<=0){b=0.0;return +b}d=c[a+720>>2]|0;a=0;b=0.0;do{f=+g[d+(a*104|0)+88>>2];b=b+(f>0.0?1.0/f:0.0);a=a+1|0}while((a|0)!=(e|0));return +b}function uo(a){a=a|0;var b=0;c[a>>2]=8316;c[a+12>>2]=8364;b=c[a+60>>2]|0;Va[c[(c[b>>2]|0)+20>>2]&127](b,c[a+76>>2]|0);b=c[a+60>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,c[a+76>>2]|0);GI(a);return}function vo(b){b=b|0;var d=0;c[b>>2]=7684;d=c[b+140>>2]|0;if(d|0){if(a[b+144>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+140>>2]=0}a[b+144>>0]=1;c[b+140>>2]=0;c[b+132>>2]=0;c[b+136>>2]=0;return}function wo(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26576]|0))mz(26576)|0;Zz(d,b);c[6718]=c[d>>2];c[6719]=c[d+4>>2];c[6720]=c[d+8>>2];c[6721]=c[d+12>>2];sa=d;return 26872}function xo(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26560]|0))mz(26560)|0;Dy(d,b);c[6698]=c[d>>2];c[6699]=c[d+4>>2];c[6700]=c[d+8>>2];c[6701]=c[d+12>>2];sa=d;return 26792}function yo(b){b=b|0;var d=0,e=0,f=0;e=c[b>>2]|0;f=a[e>>0]|0;if(!(RH(f<<24>>24)|0))d=0;else{d=0;do{d=(d*10|0)+-48+(f<<24>>24)|0;e=e+1|0;c[b>>2]=e;f=a[e>>0]|0}while((RH(f<<24>>24)|0)!=0)}return d|0}function zo(a,b,d){a=a|0;b=+b;d=d|0;b=b*.4000000059604645*+va[c[(c[a>>2]|0)+48>>2]&15](a);b=b*+va[c[(c[a>>2]|0)+48>>2]&15](a);g[d>>2]=b;g[d+4>>2]=b;g[d+8>>2]=b;g[d+12>>2]=0.0;return}function Ao(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=c[b>>2]|0;e=Ha[c[(c[e>>2]|0)+56>>2]&31](e,24)|0;c[e+4>>2]=c[b>>2];c[e>>2]=6840;return e|0}function Bo(a,b){a=a|0;b=b|0;var d=0,e=0;d=sa;sa=sa+16|0;Aw(a);e=JI(c[b+4>>2]|0)|0;c[d>>2]=0;Fn(a,e,d);pr(b,e,c[a+12>>2]|0);sa=d;return}function Co(a,b,c,d,e,f,h){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;var i=0;i=sa;sa=sa+16|0;g[i+8>>2]=c*h-d*f;g[i+4>>2]=d*e-b*h;g[i>>2]=b*f-c*e;ns(a,i+8|0,i+4|0,i);sa=i;return}function Do(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;b=JI(b+4|0)|0;e=(JI(xG(b,0)|0)|0)+(c<<2)|0;d=(JI(xG(b,1)|0)|0)+(c<<2)|0;ns(a,e,d,(JI(xG(b,2)|0)|0)+(c<<2)|0);return}function Eo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[d>>2]=-581039253;c[d+4>>2]=-581039253;c[d+8>>2]=-581039253;g[d+12>>2]=0.0;c[e>>2]=1566444395;c[e+4>>2]=1566444395;c[e+8>>2]=1566444395;g[e+12>>2]=0.0;return}function Fo(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+g[(JI(a)|0)>>2];c=c*+g[(JI(b)|0)>>2];d=+g[(JI(a+16|0)|0)>>2];d=c+d*+g[(oI(b)|0)>>2];c=+g[(JI(a+32|0)|0)>>2];return +(d+c*+g[(nI(b)|0)>>2])}function Go(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26544]|0))mz(26544)|0;up(d,b);c[6690]=c[d>>2];c[6691]=c[d+4>>2];c[6692]=c[d+8>>2];c[6693]=c[d+12>>2];sa=d;return 26760}function Ho(b){b=b|0;var d=0;d=sa;sa=sa+16|0;if(!(a[26552]|0))mz(26552)|0;Ll(d,b);c[6694]=c[d>>2];c[6695]=c[d+4>>2];c[6696]=c[d+8>>2];c[6697]=c[d+12>>2];sa=d;return 26776}function Io(a,b){a=a|0;b=b|0;var c=0.0,d=0.0;c=+g[a>>2];c=c*+g[(JI(b)|0)>>2];d=+g[a+4>>2];d=c+d*+g[(oI(b)|0)>>2];c=+g[a+8>>2];c=d+c*+g[(nI(b)|0)>>2];return +(c+ +g[a+12>>2]*+g[b+12>>2])}function Jo(b){b=b|0;var d=0;c[b>>2]=11748;if(a[b+192>>0]|0?(d=c[b+136>>2]|0,Pa[c[c[d>>2]>>2]&511](d),d=c[b+136>>2]|0,d|0):0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}yh(b+64|0);yh(b+4|0);return}function Ko(b){b=b|0;var d=0;c[b>>2]=12276;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}function Lo(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;ns(a,b,c,d);ns(a+16|0,e,f,g);ns(a+32|0,h,i,j);return}function Mo(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=sa;sa=sa+64|0;Uj(d+16|0,b,c);xl(d,b,+g[c+48>>2],+g[c+52>>2],+g[c+56>>2]);bq(a,d+16|0,d);sa=d;return}function No(a){a=a|0;var b=0;c[a>>2]=8316;c[a+12>>2]=8364;b=c[a+60>>2]|0;Va[c[(c[b>>2]|0)+20>>2]&127](b,c[a+76>>2]|0);b=c[a+60>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,c[a+76>>2]|0);return}function Oo(b){b=b|0;var d=0;c[b>>2]=5756;d=c[b+32>>2]|0;if(d|0){if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+32>>2]=0}a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;return}function Po(a){a=a|0;var b=0,d=0;c[a>>2]=9932;b=c[a+52>>2]|0;if(b|0?(Pa[c[c[b>>2]>>2]&511](b),d=c[a+52>>2]|0,d|0):0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Qo(a,b){a=a|0;b=b|0;var d=0;d=(c[a+92>>2]|0)+4|0;c[d>>2]=c[b>>2];c[d+4>>2]=c[b+4>>2];c[d+8>>2]=c[b+8>>2];c[d+12>>2]=c[b+12>>2];Oi(a);return}function Ro(b,d){b=b|0;d=d|0;var e=0;if(a[b+273>>0]|0?(e=c[b+200>>2]|0,e|0):0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}a[b+273>>0]=0;c[b+200>>2]=d;c[(c[b+196>>2]|0)+8>>2]=d;return}function So(b){b=b|0;var d=0;c[b>>2]=7940;d=c[b+20>>2]|0;if(d|0){if(a[b+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+20>>2]=0}a[b+24>>0]=1;c[b+20>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;return}function To(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;e=c[b>>2]|0;e=Ha[c[(c[e>>2]|0)+56>>2]&31](e,8)|0;c[e+4>>2]=c[b>>2];c[e>>2]=12136;return e|0}function Uo(a,b){a=a|0;b=+b;c[a+8>>2]=0;c[a+12>>2]=1065353216;c[a+16>>2]=1065353216;c[a+20>>2]=1065353216;g[a+24>>2]=0.0;g[a+44>>2]=.03999999910593033;c[a>>2]=9480;c[a+4>>2]=8;jG(a+28|0,b);g[a+44>>2]=b;return}function Vo(b){b=b|0;var d=0;d=Ss()|0;c[d+44>>2]=b;a[d+16>>0]=1;c[d+12>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;a[d+36>>0]=1;c[d+32>>2]=0;c[d+24>>2]=0;c[d+28>>2]=0;c[d+40>>2]=0;return d|0}function Wo(b){b=b|0;var d=0;c[b>>2]=11556;d=c[b+16>>2]|0;if(d|0){if(a[b+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[b+16>>2]=0}a[b+20>>0]=1;c[b+16>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;return}function Xo(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;var f=0;f=sa;sa=sa+16|0;g[f+12>>2]=b;g[f+8>>2]=c;g[f+4>>2]=d;g[f>>2]=e;tr(a,f+12|0,f+8|0,f+4|0,f);sa=f;return}function Yo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;f=c[b+8>>2]|0;e=c[f+284>>2]|0;Za[c[(c[e>>2]|0)+40>>2]&127](e,f,c[d+8>>2]|0);return}function Zo(b){b=b|0;var d=0,e=0;c[b>>2]=8812;if(!(a[b+8>>0]|0)){GI(b);return}d=c[b+12>>2]|0;if(!d){GI(b);return}e=c[b+4>>2]|0;Va[c[(c[e>>2]|0)+16>>2]&127](e,d);GI(b);return}function _o(a,b){a=a|0;b=b|0;var d=0,e=0;d=sa;sa=sa+16|0;e=JI(c[b+4>>2]|0)|0;Sl(a,e,d);yn(b,e,c[a+12>>2]|0);sa=d;return}function $o(b){b=b|0;var d=0,e=0;c[b>>2]=12164;if(!(a[b+8>>0]|0)){GI(b);return}d=c[b+12>>2]|0;if(!d){GI(b);return}e=c[b+4>>2]|0;Va[c[(c[e>>2]|0)+16>>2]&127](e,d);GI(b);return}function ap(b){b=b|0;var d=0,e=0;c[b>>2]=8288;if(!(a[b+8>>0]|0)){GI(b);return}d=c[b+12>>2]|0;if(!d){GI(b);return}e=c[b+4>>2]|0;Va[c[(c[e>>2]|0)+16>>2]&127](e,d);GI(b);return}function bp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=sa;sa=sa+16|0;c[e>>2]=11728;c[e+4>>2]=b;Za[c[(c[a>>2]|0)+48>>2]&127](a,e,d);sa=e;return}function cp(b){b=b|0;var d=0;c[b>>2]=9580;if(!(a[b+61>>0]|0))return;d=c[b+52>>2]|0;Pa[c[c[d>>2]>>2]&511](d);b=c[b+52>>2]|0;if(!b)return;c[7183]=(c[7183]|0)+1;Hc(c[b+-4>>2]|0);return}function dp(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=J(b&65535,a&65535)|0;e=(c>>>16)+(J(b&65535,a>>>16)|0)|0;d=J(b>>>16,a&65535)|0;return (P((e>>>16)+(J(b>>>16,a>>>16)|0)+(((e&65535)+d|0)>>>16)|0),e+d<<16|c&65535|0)|0}function ep(b){b=b|0;var d=0,e=0;c[b>>2]=8384;if(!(a[b+8>>0]|0)){GI(b);return}d=c[b+12>>2]|0;if(!d){GI(b);return}e=c[b+4>>2]|0;Va[c[(c[e>>2]|0)+16>>2]&127](e,d);GI(b);return}function fp(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else Bh(b,c,d)|0;return b|0}function gp(){var a=0,b=0;b=sa;sa=sa+32|0;a=Nr(112)|0;et(b);Df(a,b);sa=b;return a|0}function hp(a,b){a=a|0;b=b|0;var d=0,e=0;d=sa;sa=sa+16|0;e=JI(c[b+4>>2]|0)|0;c[d>>2]=0;Fn(a,e,d);pr(b,e,c[a+12>>2]|0);sa=d;return}function ip(b){b=b|0;var d=0,e=0;c[b>>2]=8860;if(!(a[b+16>>0]|0)){GI(b);return}d=c[b+20>>2]|0;if(!d){GI(b);return}e=c[b+4>>2]|0;Va[c[(c[e>>2]|0)+16>>2]&127](e,d);GI(b);return}function jp(a,b){a=a|0;b=b|0;var c=0.0,d=0.0,e=0.0;e=+w(+(+g[b>>2]));d=+w(+(+g[b+4>>2]));c=+w(+(+g[b+8>>2]));g[a+12>>2]=e;g[a+16>>2]=d;g[a+20>>2]=c;g[a+24>>2]=0.0;return}function kp(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;var f=0;f=sa;sa=sa+64|0;sq(f);Fr(f,b);Ua[c[(c[a>>2]|0)+16>>2]&1](a,d,f,e);sa=f;return}function lp(a,b){a=a|0;b=b|0;ef(a,c[b+36>>2]|0);return}function mp(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(RC(a,c[b+8>>2]|0)|0)sm(b,d,e);return}function np(a){a=a|0;var b=0;c[a>>2]=8364;b=c[a+48>>2]|0;Va[c[(c[b>>2]|0)+20>>2]&127](b,c[a+64>>2]|0);b=c[a+48>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,c[a+64>>2]|0);GI(a);return}function op(a,b,c,d,e,f,g,h,i,j,k,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;g=+g;h=+h;i=+i;j=+j;k=k|0;l=+l;m=m|0;cb[a&1](b|0,c|0,d|0,e|0,+f,+g,+h,+i,+j,k|0,+l,m|0)}function pp(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;g[a>>2]=(1.0-d)*+g[b>>2]+ +g[c>>2]*d;g[a+4>>2]=(1.0-d)*+g[b+4>>2]+ +g[c+4>>2]*d;g[a+8>>2]=(1.0-d)*+g[b+8>>2]+ +g[c+8>>2]*d;return}function qp(a,b,c,d,e,f,h){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;var i=0;i=sa;sa=sa+16|0;g[i+8>>2]=b+e;g[i+4>>2]=c+f;g[i>>2]=d+h;ns(a,i+8|0,i+4|0,i);sa=i;return}function rp(a,b,c,d,e,f,h){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;var i=0;i=sa;sa=sa+16|0;g[i+8>>2]=b*e;g[i+4>>2]=c*f;g[i>>2]=d*h;ns(a,i+8|0,i+4|0,i);sa=i;return}function sp(a,b,c,d,e,f,h){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;h=+h;var i=0;i=sa;sa=sa+16|0;g[i+8>>2]=b-e;g[i+4>>2]=c-f;g[i>>2]=d-h;ns(a,i+8|0,i+4|0,i);sa=i;return}function tp(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;if(!((b|0)==0&(c|0)==0))do{e=e+-1|0;a[e>>0]=d[480+(b&15)>>0]|0|f;b=xt(b|0,c|0,4)|0;c=Q()|0}while(!((b|0)==0&(c|0)==0));return e|0}function up(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+16|0;g[c+8>>2]=-+g[b>>2];g[c+4>>2]=-+g[b+4>>2];g[c>>2]=-+g[b+8>>2];rv(a,c+8|0,c+4|0,c,b+12|0);sa=c;return}function vp(a){a=a|0;var b=0;c[a>>2]=9932;b=c[a+52>>2]|0;if(!b)return;Pa[c[c[b>>2]>>2]&511](b);a=c[a+52>>2]|0;if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function wp(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;return +(+ca(6,a|0,b|0,c|0,d|0,e|0,f|0,g|0,h|0))}function xp(a,b){a=a|0;b=b|0;if((b|0)==0?1:(c[b+236>>2]&2|0)==0){Vj(a,b);return}else{Va[c[(c[a>>2]|0)+92>>2]&127](a,b);return}}function yp(a){a=a|0;var b=0;c[a>>2]=8364;b=c[a+48>>2]|0;Va[c[(c[b>>2]|0)+20>>2]&127](b,c[a+64>>2]|0);b=c[a+48>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,c[a+64>>2]|0);return}function zp(){var b=0;b=Nr(40)|0;g[b+12>>2]=1.0;c[b+8>>2]=0;c[b+4>>2]=5;c[b>>2]=5756;a[b+36>>0]=1;c[b+32>>2]=0;c[b+24>>2]=0;c[b+28>>2]=0;a[b+16>>0]=1;return b|0}function Ap(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+16|0;rp(e,b,c,d,+g[a+348>>2],+g[a+352>>2],+g[a+356>>2]);Hr(a+412|0,e)|0;sa=e;return}function Bp(a,b,c){a=+a;b=+b;c=+c;var d=0,e=0;e=sa;sa=sa+16|0;g[e+8>>2]=a;g[e+4>>2]=b;g[e>>2]=c;d=Zs()|0;ns(d,e+8|0,e+4|0,e);sa=e;return d|0}function Cp(a,b){a=a|0;b=b|0;c[a+12>>2]=c[b>>2];c[a+12+4>>2]=c[b+4>>2];c[a+12+8>>2]=c[b+8>>2];c[a+12+12>>2]=c[b+12>>2];Oi(a);return}function Dp(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;return Na[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)|0}function Ep(a,b){a=a|0;b=b|0;a=c[a+12>>2]|0;return Ha[c[(c[a>>2]|0)+8>>2]&31](a,b)|0}function Fp(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+16|0;rp(e,b,c,d,+g[a+544>>2],+g[a+548>>2],+g[a+552>>2]);Hr(a+428|0,e)|0;sa=e;return}function Gp(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;return +Ea[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)}function Hp(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=Cs()|0;Md(h,a,b,c,d,e,f,g);return h|0}function Ip(){var a=0,b=0;a=Gr()|0;if((a|0?(b=c[a>>2]|0,b|0):0)?((c[b+48>>2]&-256|0)==1126902528?(c[b+48+4>>2]|0)==1129074247:0):0)Cx(c[b+12>>2]|0);Cx(RE()|0)}function Jp(a,b,d){a=a|0;b=b|0;d=d|0;Dz(a,b);c[a+48>>2]=c[d>>2];c[a+48+4>>2]=c[d+4>>2];c[a+48+8>>2]=c[d+8>>2];c[a+48+12>>2]=c[d+12>>2];return}function Kp(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+16|0;vl(c,a,+g[b+48>>2],+g[b+52>>2],+g[b+56>>2]);Hr(a+48|0,c)|0;fk(a,b);sa=c;return a|0}function Lp(a,b){a=a|0;b=b|0;c[a+260>>2]=(c[a+260>>2]|0)+1;c[a+328>>2]=c[b>>2];c[a+328+4>>2]=c[b+4>>2];c[a+328+8>>2]=c[b+8>>2];c[a+328+12>>2]=c[b+12>>2];return}function Mp(){var a=0,b=0;b=sa;sa=sa+32|0;a=Nr(92)|0;et(b);ed(a,b);sa=b;return a|0}function Np(a,b,d){a=a|0;b=b|0;d=d|0;c[d>>2]=c[a+56+(b<<4)>>2];c[d+4>>2]=c[a+56+(b<<4)+4>>2];c[d+8>>2]=c[a+56+(b<<4)+8>>2];c[d+12>>2]=c[a+56+(b<<4)+12>>2];return}function Op(a,b){a=a|0;b=b|0;c[a+260>>2]=(c[a+260>>2]|0)+1;c[a+312>>2]=c[b>>2];c[a+312+4>>2]=c[b+4>>2];c[a+312+8>>2]=c[b+8>>2];c[a+312+12>>2]=c[b+12>>2];return}function Pp(b,d){b=b|0;d=d|0;if(!(a[26632]|0))mz(26632)|0;d=xG(b,d)|0;c[6786]=c[d>>2];c[6787]=c[d+4>>2];c[6788]=c[d+8>>2];c[6789]=c[d+12>>2];return 27144}function Qp(a,b){a=a|0;b=b|0;c[a+260>>2]=(c[a+260>>2]|0)+1;c[a+544>>2]=c[b>>2];c[a+544+4>>2]=c[b+4>>2];c[a+544+8>>2]=c[b+8>>2];c[a+544+12>>2]=c[b+12>>2];return}function Rp(a,b,c,d,e,f,g,h,i,j,k,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;g=+g;h=+h;i=+i;j=j|0;k=k|0;l=+l;db[a&1](b|0,c|0,d|0,e|0,+f,+g,+h,+i,j|0,k|0,+l)}function Sp(a){a=a|0;var b=0.0,d=0.0;d=+g[a+32>>2];+va[c[(c[a>>2]|0)+48>>2]&15](a);b=+va[c[(c[a>>2]|0)+48>>2]&15](a);+va[c[(c[a>>2]|0)+48>>2]&15](a);return +(d+b)}function Tp(a){a=a|0;var b=0.0,d=0.0;d=+g[a+28>>2];b=+va[c[(c[a>>2]|0)+48>>2]&15](a);+va[c[(c[a>>2]|0)+48>>2]&15](a);+va[c[(c[a>>2]|0)+48>>2]&15](a);return +(d+b)}function Up(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;kb[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)}function Vp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=sa;sa=sa+16|0;c[e>>2]=c[d>>2];a=Ja[c[(c[a>>2]|0)+16>>2]&63](a,b,e)|0;if(a)c[d>>2]=c[e>>2];sa=e;return a&1|0}function Wp(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;var f=0;f=sa;sa=sa+16|0;g[f+8>>2]=b*e;g[f+4>>2]=c*e;g[f>>2]=d*e;ns(a,f+8|0,f+4|0,f);sa=f;return}function Xp(a,b){a=a|0;b=b|0;g[a>>2]=+g[a>>2]*+g[b>>2];g[a+4>>2]=+g[a+4>>2]*+g[b>>2];g[a+8>>2]=+g[a+8>>2]*+g[b>>2];g[a+12>>2]=+g[a+12>>2]*+g[b>>2];return a|0}function Yp(){var a=0;a=Nr(8)|0;c[7181]=a;la(a|0,0)|0;c[7171]=23733;c[7172]=0;c[7173]=0;c[7174]=0;c[7175]=0;c[7176]=0;c[7177]=0;c[7178]=0;c[7179]=0;er(28684);return}function Zp(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;Lo(a,b,c,d,e,f,g,h,i,j);return}function _p(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=fs(324)|0;jd(d,a,b,c);return d|0}function $p(b){b=b|0;var d=0;c[b>>2]=5756;d=c[b+32>>2]|0;if(!d){GI(b);return}if(!(a[b+36>>0]|0)){GI(b);return}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);GI(b);return}function aq(a,b,d){a=a|0;b=b|0;d=d|0;b=c[b+204>>2]|0;if(b&4|0)return 0;a=c[d+204>>2]|0;if(!(a&4))return (b&3|0)==0|(a&3|0)==0|0;else return 0;return 0}function bq(a,b,d){a=a|0;b=b|0;d=d|0;bm(a,b);c[a+48>>2]=c[d>>2];c[a+48+4>>2]=c[d+4>>2];c[a+48+8>>2]=c[d+8>>2];c[a+48+12>>2]=c[d+12>>2];return}function cq(b){b=b|0;var d=0;c[b>>2]=8812;if(!(a[b+8>>0]|0))return;d=c[b+12>>2]|0;if(!d)return;b=c[b+4>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,d);return}function dq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(b|0))break;Jl(d+(e*96|0)|0,(c[a+12>>2]|0)+(e*96|0)|0);e=e+1|0}return}function eq(b){b=b|0;var d=0;c[b>>2]=12164;if(!(a[b+8>>0]|0))return;d=c[b+12>>2]|0;if(!d)return;b=c[b+4>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,d);return}function fq(b){b=b|0;var d=0;c[b>>2]=7940;d=c[b+20>>2]|0;if(!d){GI(b);return}if(!(a[b+24>>0]|0)){GI(b);return}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);GI(b);return}function gq(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+128|0;vn(c,a+68|0);Mo(c+64|0,c,a+4|0);Dq(b,c+64|0);sa=c;return}function hq(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;g=Cs()|0;Md(g,a,b,c,d,e,f,0);return g|0}function iq(b){b=b|0;var d=0;c[b>>2]=8288;if(!(a[b+8>>0]|0))return;d=c[b+12>>2]|0;if(!d)return;b=c[b+4>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,d);return}function jq(a,b){a=a|0;b=b|0;a=c[a+4>>2]|0;return ((c[b>>2]|0)==(a|0)?1:(c[b+4>>2]|0)==(a|0))|0}function kq(b){b=b|0;var d=0;c[b>>2]=11556;d=c[b+16>>2]|0;if(!d){GI(b);return}if(!(a[b+20>>0]|0)){GI(b);return}c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);GI(b);return}function lq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=ps()|0;Td(f,a,b,c,d,e);return f|0}function mq(a,b){a=a|0;b=b|0;a=c[a+20>>2]|0;return Ha[c[(c[a>>2]|0)+8>>2]&31](a,b)|0}function nq(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+16|0;g[e+8>>2]=b;g[e+4>>2]=c;g[e>>2]=d;ns(a,e+8|0,e+4|0,e);sa=e;return}function oq(b){b=b|0;var d=0;c[b>>2]=8384;if(!(a[b+8>>0]|0))return;d=c[b+12>>2]|0;if(!d)return;b=c[b+4>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,d);return}function pq(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=+j;fb[c[(c[a>>2]|0)+28>>2]&1](a,b,d,e,i,j);return}function qq(a,b,d){a=a|0;b=b|0;d=d|0;qH(a);c[a>>2]=5640;Dq(a+4|0,b);Dq(a+68|0,d);Dq(a+132|0,b);c[a+196>>2]=0;return}function rq(b){b=b|0;var d=0;c[b>>2]=8860;if(!(a[b+16>>0]|0))return;d=c[b+20>>2]|0;if(!d)return;b=c[b+4>>2]|0;Va[c[(c[b>>2]|0)+16>>2]&127](b,d);return}function sq(a){a=a|0;var b=0;b=sa;sa=sa+16|0;Jm(a);g[b+8>>2]=0.0;g[b+4>>2]=0.0;g[b>>2]=0.0;ns(a+48|0,b+8|0,b+4|0,b);sa=b;return}function tq(b,c,d){b=b|0;c=c|0;d=d|0;if(!((b|0)==0&(c|0)==0))do{d=d+-1|0;a[d>>0]=b&7|48;b=xt(b|0,c|0,3)|0;c=Q()|0}while(!((b|0)==0&(c|0)==0));return d|0}function uq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return Ma[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)|0}function vq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;var f=0;f=Nr(44)|0;Vl(f,a,b,c,d,e);return f|0}function wq(a,b){a=a|0;b=b|0;Bo(a,b);c[a+20>>2]=c[b+20>>2];c[a+20+4>>2]=c[b+20+4>>2];c[a+20+8>>2]=c[b+20+8>>2];c[a+20+12>>2]=c[b+20+12>>2];return}function xq(a,b,c){a=a|0;b=b|0;c=+c;switch(b|0){case 3:{g[a+452>>2]=c;return}case 4:{g[a+448>>2]=c;return}case 5:{g[a+444>>2]=c;return}default:return}}function yq(a,b){a=a|0;b=b|0;b=c[b+36>>2]|0;ae(a,c[(c[(c[(c[a+4>>2]|0)+4>>2]|0)+24>>2]|0)+(b*80|0)+64>>2]|0,b);return}function zq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;return +Da[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function Aq(a,b){a=a|0;b=b|0;var c=0;c=0;while(1){if((c|0)==3)break;g[a+868+(c<<6)+4>>2]=+As(+g[(JI(b)|0)+(c<<2)>>2]);c=c+1|0}return}function Bq(a,b,c,d){a=+a;b=b|0;c=c|0;d=d|0;var e=0;e=Nr(140)|0;vk(e,a,b,c,d);return e|0}function Cq(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return +(+Ca[c[(c[a>>2]|0)+12>>2]&1](a,b,d,e,f,g,h,i))}function Dq(a,b){a=a|0;b=b|0;bm(a,b);c[a+48>>2]=c[b+48>>2];c[a+48+4>>2]=c[b+48+4>>2];c[a+48+8>>2]=c[b+48+8>>2];c[a+48+12>>2]=c[b+48+12>>2];return}function Eq(a,b){a=a|0;b=b|0;ns(a,b,b+16|0,b+32|0);ns(a+16|0,b+4|0,b+20|0,b+36|0);ns(a+32|0,b+8|0,b+24|0,b+40|0);return}function Fq(a,b){a=a|0;b=b|0;var c=0;c=0;while(1){if((c|0)==3)break;g[a+868+(c<<6)>>2]=+As(+g[(JI(b)|0)+(c<<2)>>2]);c=c+1|0}return}function Gq(a,b){a=a|0;b=b|0;Pa[c[(c[b>>2]|0)+32>>2]&511](b);Ac(a,b);Pa[c[(c[b>>2]|0)+36>>2]&511](b);return}function Hq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;jb[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function Iq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;Za[c[(c[a>>2]|0)+108>>2]&127](a,b,d);Za[c[(c[a>>2]|0)+108>>2]&127](a,(b+1|0)%3|0,e);return}function Jq(a){a=a|0;var b=0.0,c=0;c=+Io(a,a)<0.0;b=+g[a+12>>2];if(c){b=+AA(b);b=b*2.0;return +b}else{b=+AA(-b);b=b*2.0;return +b}return 0.0}function Kq(){var a=0,b=0;b=Vr(c[6688]|0,c[6689]|0,1284865837,1481765933)|0;b=xv(b|0,Q()|0,1,0)|0;a=Q()|0;c[6688]=b;c[6689]=a;a=xt(b|0,a|0,33)|0;Q()|0;return a|0}function Lq(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;var e=0;e=sa;sa=sa+16|0;g[e+8>>2]=-b;g[e+4>>2]=-c;g[e>>2]=-d;ns(a,e+8|0,e+4|0,e);sa=e;return}function Mq(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=ss()|0;td(f,a,b,c&65535,d,e);return f|0}function Nq(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb((a*104|3)+16|0)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Oq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(b|0))break;wq(d+(e*36|0)|0,(c[a+12>>2]|0)+(e*36|0)|0);e=e+1|0}return}function Pq(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=+j;ib[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,+j)}function Qq(a,b){a=a|0;b=b|0;c[a+12>>2]=c[b>>2];c[a+12+4>>2]=c[b+4>>2];c[a+12+8>>2]=c[b+8>>2];c[a+12+12>>2]=c[b+12>>2];return}function Rq(a,b){a=a|0;b=b|0;c[a+44>>2]=c[b>>2];c[a+44+4>>2]=c[b+4>>2];c[a+44+8>>2]=c[b+8>>2];c[a+44+12>>2]=c[b+12>>2];return}function Sq(a,c){a=a|0;c=c|0;if(!((b[c+4>>1]&b[a+6>>1])<<16>>16)){c=0;return c|0}c=(b[a+4>>1]&b[c+6>>1])<<16>>16!=0;return c|0}function Tq(a,c){a=a|0;c=c|0;if(!((b[c+4>>1]&b[a+10>>1])<<16>>16)){c=0;return c|0}c=(b[a+8>>1]&b[c+6>>1])<<16>>16!=0;return c|0}function Uq(a,b){a=a|0;b=b|0;c[a+696>>2]=c[b>>2];c[a+696+4>>2]=c[b+4>>2];c[a+696+8>>2]=c[b+8>>2];c[a+696+12>>2]=c[b+12>>2];return}function Vq(a,b){a=a|0;b=b|0;c[a+680>>2]=c[b>>2];c[a+680+4>>2]=c[b+4>>2];c[a+680+8>>2]=c[b+8>>2];c[a+680+12>>2]=c[b+12>>2];return}function Wq(a,b){a=a|0;b=b|0;c[a+60>>2]=c[b>>2];c[a+60+4>>2]=c[b+4>>2];c[a+60+8>>2]=c[b+8>>2];c[a+60+12>>2]=c[b+12>>2];return}function Xq(a,b){a=a|0;b=b|0;c[a+28>>2]=c[b>>2];c[a+28+4>>2]=c[b+4>>2];c[a+28+8>>2]=c[b+8>>2];c[a+28+12>>2]=c[b+12>>2];return}function Yq(a,b){a=a|0;b=b|0;c[a+156>>2]=c[b>>2];c[a+156+4>>2]=c[b+4>>2];c[a+156+8>>2]=c[b+8>>2];c[a+156+12>>2]=c[b+12>>2];return}function Zq(b,c,d){b=b|0;c=c|0;d=d|0;a[b+1309+c>>0]=d&1;if((c|0)<3){a[b+788+c>>0]=d&1;return}else{a[b+868+(c+-3<<6)+44>>0]=d&1;return}}function _q(a,c){a=a|0;c=c|0;if(!((b[c+4>>1]&b[a+14>>1])<<16>>16)){c=0;return c|0}c=(b[a+12>>1]&b[c+6>>1])<<16>>16!=0;return c|0}function $q(a,b){a=a|0;b=b|0;c[a+108>>2]=c[b>>2];c[a+108+4>>2]=c[b+4>>2];c[a+108+8>>2]=c[b+8>>2];c[a+108+12>>2]=c[b+12>>2];return}function ar(b){b=b|0;if(a[26672]|0)return 27304;if(!(mz(26672)|0))return 27304;c[6826]=1065353216;c[6827]=1065353216;c[6828]=1065353216;g[6829]=0.0;return 27304}function br(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb(a*96|19)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function cr(a,b){a=a|0;b=b|0;c[a+20>>2]=c[b>>2];c[a+20+4>>2]=c[b+4>>2];c[a+20+8>>2]=c[b+8>>2];c[a+20+12>>2]=c[b+12>>2];return}function dr(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb((a<<4|3)+16|0)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function er(a){a=a|0;var b=0;do{c[a+4>>2]=0;g[a+8>>2]=0.0;b=c[a+24>>2]|0;if(b|0)er(b);a=c[a+28>>2]|0}while((a|0)!=0);return}function fr(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;Tc(a,b,c,d,e,f);return}function gr(b){b=b|0;var c=0;c=sa;sa=sa+64|0;if(!(a[26568]|0))mz(26568)|0;vn(c,b);Dq(26808,c);sa=c;return 26808}function hr(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb((a*36|3)+16|0)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ir(a,b){a=a|0;b=b|0;c[a+172>>2]=c[b>>2];c[a+172+4>>2]=c[b+4>>2];c[a+172+8>>2]=c[b+8>>2];c[a+172+12>>2]=c[b+12>>2];return}function jr(a,b){a=a|0;b=b|0;c[a+32>>2]=c[b>>2];c[a+32+4>>2]=c[b+4>>2];c[a+32+8>>2]=c[b+8>>2];c[a+32+12>>2]=c[b+12>>2];return}function kr(a){a=a|0;g[a>>2]=5.880000114440918;g[a+4>>2]=.8299999833106995;g[a+8>>2]=.8799999952316284;g[a+12>>2]=500.0;g[a+16>>2]=10.5;g[a+20>>2]=6.0e3;return}function lr(a,b){a=a|0;b=b|0;c[a+316>>2]=c[b>>2];c[a+316+4>>2]=c[b+4>>2];c[a+316+8>>2]=c[b+8>>2];c[a+316+12>>2]=c[b+12>>2];return}function mr(a,b){a=a|0;b=b|0;c[a+300>>2]=c[b>>2];c[a+300+4>>2]=c[b+4>>2];c[a+300+8>>2]=c[b+8>>2];c[a+300+12>>2]=c[b+12>>2];return}function nr(a,b){a=a|0;b=b|0;c[a+64>>2]=c[b>>2];c[a+64+4>>2]=c[b+4>>2];c[a+64+8>>2]=c[b+8>>2];c[a+64+12>>2]=c[b+12>>2];return}function or(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=ss()|0;td(e,a,b,c&65535,d,0);return e|0}function pr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=0;while(1){if((e|0)>=(b|0))break;c[d+(e<<2)>>2]=c[(c[a+12>>2]|0)+(e<<2)>>2];e=e+1|0}return}function qr(a,b){a=a|0;b=b|0;c[a+52>>2]=c[b>>2];c[a+52+4>>2]=c[b+4>>2];c[a+52+8>>2]=c[b+8>>2];c[a+52+12>>2]=c[b+12>>2];return}function rr(a,b){a=a|0;b=b|0;c[a+188>>2]=c[b>>2];c[a+188+4>>2]=c[b+4>>2];c[a+188+8>>2]=c[b+8>>2];c[a+188+12>>2]=c[b+12>>2];return}function sr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;e=(JI(b)|0)+(c<<2)|0;d=(JI(b+16|0)|0)+(c<<2)|0;ns(a,e,d,(JI(b+32|0)|0)+(c<<2)|0);return}function tr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[d>>2];c[a+8>>2]=c[e>>2];c[a+12>>2]=c[f>>2];return}function ur(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;return +Ca[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0)}function vr(a,b){a=a|0;b=b|0;c[a+16>>2]=c[b>>2];c[a+16+4>>2]=c[b+4>>2];c[a+16+8>>2]=c[b+8>>2];c[a+16+12>>2]=c[b+12>>2];return}function wr(a,b,d){a=a|0;b=b|0;d=+d;Va[c[(c[a>>2]|0)+32>>2]&127](a,b);Wa[c[(c[a>>2]|0)+36>>2]&7](a,b,d);return}function xr(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb((a<<2|3)+16|0)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function yr(a,b){a=a|0;b=b|0;c[a+68>>2]=c[b>>2];c[a+68+4>>2]=c[b+4>>2];c[a+68+8>>2]=c[b+8>>2];c[a+68+12>>2]=c[b+12>>2];return}function zr(a,b){a=a|0;b=b|0;c[a+36>>2]=c[b>>2];c[a+36+4>>2]=c[b+4>>2];c[a+36+8>>2]=c[b+8>>2];c[a+36+12>>2]=c[b+12>>2];return}function Ar(a,b){a=a|0;b=b|0;c[a>>2]=c[b+248>>2];c[a+4>>2]=c[b+248+4>>2];c[a+8>>2]=c[b+248+8>>2];c[a+12>>2]=c[b+248+12>>2];return}function Br(b,d){b=b|0;d=d|0;if(!(a[26592]|0))mz(26592)|0;Dm(AB(c[b+12>>2]|0,d)|0);return 26904}function Cr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=ps()|0;fd(d,a,b,c);return d|0}function Dr(){var a=0;a=ws()|0;hn();hn();qq(a,27032,27032);return a|0}function Er(a,b,d){a=a|0;b=b|0;d=d|0;if((c[a+4>>2]|0)==(b|0)?(c[a+28>>2]|0)!=1:0)c[a+28>>2]=d;return}function Fr(a,b){a=a|0;b=b|0;c[a+48>>2]=c[b>>2];c[a+48+4>>2]=c[b+4>>2];c[a+48+8>>2]=c[b+8>>2];c[a+48+12>>2]=c[b+12>>2];return}function Gr(){var a=0,b=0;a=sa;sa=sa+16|0;if(!(pa(29300,3)|0)){b=na(c[7326]|0)|0;sa=a;return b|0}else Hu(24067,a);return 0}function Hr(a,b){a=a|0;b=b|0;g[a>>2]=+g[a>>2]+ +g[b>>2];g[a+4>>2]=+g[a+4>>2]+ +g[b+4>>2];g[a+8>>2]=+g[a+8>>2]+ +g[b+8>>2];return a|0}function Ir(a,b){a=a|0;b=b|0;g[a>>2]=+g[a>>2]-+g[b>>2];g[a+4>>2]=+g[a+4>>2]-+g[b+4>>2];g[a+8>>2]=+g[a+8>>2]-+g[b+8>>2];return a|0}function Jr(a,b){a=a|0;b=b|0;var c=0;c=sa;sa=sa+64|0;Mo(c,b,a+68|0);Dq(a+4|0,c);sa=c;return}function Kr(a){a=a|0;var b=0;b=Nr(112)|0;Df(b,a);return b|0}function Lr(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=ss()|0;td(d,a,b,c&65535,0,0);return d|0}function Mr(a,b){a=a|0;b=b|0;c[a+76>>2]=c[b>>2];c[a+76+4>>2]=c[b+4>>2];c[a+76+8>>2]=c[b+8>>2];c[a+76+12>>2]=c[b+12>>2];return}function Nr(a){a=a|0;var b=0;b=(a|0)==0?1:a;while(1){a=xb(b)|0;if(a|0)break;a=HE()|0;if(!a){a=0;break}Oa[a&3]()}return a|0}function Or(a,b){a=a|0;b=b|0;c[a+4>>2]=c[b>>2];c[a+4+4>>2]=c[b+4>>2];c[a+4+8>>2]=c[b+8>>2];c[a+4+12>>2]=c[b+12>>2];return}function Pr(a,b){a=a|0;b=b|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];return}function Qr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=fs(1252)|0;Hb(e,a,b,c,d);return e|0}function Rr(a,b){a=a|0;b=b|0;c[a+40>>2]=c[b>>2];c[a+40+4>>2]=c[b+4>>2];c[a+40+8>>2]=c[b+8>>2];c[a+40+12>>2]=c[b+12>>2];return}function Sr(a,b){a=a|0;b=b|0;c[a+24>>2]=c[b>>2];c[a+24+4>>2]=c[b+4>>2];c[a+24+8>>2]=c[b+8>>2];c[a+24+12>>2]=c[b+12>>2];return}function Tr(a,b){a=a|0;b=b|0;c[a+72>>2]=c[b>>2];c[a+72+4>>2]=c[b+4>>2];c[a+72+8>>2]=c[b+8>>2];c[a+72+12>>2]=c[b+12>>2];return}function Ur(a,b){a=a|0;b=b|0;c[a+56>>2]=c[b>>2];c[a+56+4>>2]=c[b+4>>2];c[a+56+8>>2]=c[b+8>>2];c[a+56+12>>2]=c[b+12>>2];return}function Vr(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=dp(a,c)|0;f=Q()|0;return (P((J(b,c)|0)+(J(d,a)|0)+f|f&0|0),e|0|0)|0}function Wr(a,b){a=a|0;b=b|0;g[a>>2]=+g[a>>2]*+g[b>>2];g[a+4>>2]=+g[a+4>>2]*+g[b>>2];g[a+8>>2]=+g[a+8>>2]*+g[b>>2];return a|0}function Xr(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;g[a+(c[b+52>>2]<<2)>>2]=1.0;return}function Yr(a){a=a|0;var b=0;b=sa;sa=sa+16|0;Hc(a);if(!(qa(c[7326]|0,0)|0)){sa=b;return}else Hu(24166,b)}function Zr(a,b){a=a|0;b=b|0;c[a+8>>2]=c[b>>2];c[a+8+4>>2]=c[b+4>>2];c[a+8+8>>2]=c[b+8>>2];c[a+8+12>>2]=c[b+12>>2];return}function _r(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(215)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function $r(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=Ts()|0;ke(d,a,b,c);return d|0}function as(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Jc(b,c,d,e)|0}function bs(a,b){a=a|0;b=b|0;var d=0;d=0;while(1){if((d|0)>=(b|0))break;RG((c[a+12>>2]|0)+(d*36|0)|0);d=d+1|0}return}function cs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(203)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ds(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(1407)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function es(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=+e;f=f|0;g=g|0;$a[c[(c[a>>2]|0)+32>>2]&1](a,b,d,e,f,g);return}function fs(a){a=a|0;c[7182]=(c[7182]|0)+1;a=xb(a+19|0)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function gs(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;f=f|0;ga(1,a|0,b|0,c|0,+d,e|0,f|0)|0;return}function hs(a){a=a|0;var b=0;b=ws()|0;hn();qq(b,a,27032);return b|0}function is(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(191)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function js(a){a=a|0;bs(a,JI(c[a+4>>2]|0)|0);Os(a);Aw(a);return}function ks(a,b){a=a|0;b=b|0;if(!b?c[a+204>>2]&3|0:0)return;if((c[a+216>>2]&-2|0)!=4)c[a+216>>2]=1;g[a+220>>2]=0.0;return}function ls(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a+-4>>2]|0)+8>>2]&127](a+-4|0,b,d,e);return}function ms(a,b){a=a|0;b=b|0;var c=0.0;c=+dF(a);c=+wI(c*+dF(b));return +(+AA(+Io(a,b)/c))}function ns(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[a>>2]=c[b>>2];c[a+4>>2]=c[d>>2];c[a+8>>2]=c[e>>2];g[a+12>>2]=0.0;return}function os(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(143)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ps(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(1331)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function qs(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;hb[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function rs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(379)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ss(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(135)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ts(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(627)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function us(a,b){a=a|0;b=b|0;var c=0;c=ss()|0;td(c,a,b,16384,0,0);return c|0}function vs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(791)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ws(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(219)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function xs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(1147)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function ys(a,b){a=a|0;b=b|0;var c=0;c=Nr(80)|0;km(c,a,b);return c|0}function zs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(103)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function As(a){a=+a;a=+_H(a);if(a<-3.1415927410125732){a=a+6.2831854820251465;return +a}if(!(a>3.1415927410125732))return +a;a=a+-6.2831854820251465;return +a}function Bs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(115)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Cs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(783)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Ds(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(131)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Es(a,b){a=a|0;b=b|0;c[a+348>>2]=c[b>>2];c[a+348+4>>2]=c[b+4>>2];c[a+348+8>>2]=c[b+8>>2];return}function Fs(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((d|0)<=0)return;mk(c|0,0,d<<4|0)|0;return}function Gs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(111)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Hs(a,b){a=a|0;b=b|0;c[a+480>>2]=b;if(!b)return;Va[c[(c[b>>2]|0)+8>>2]&127](b,a+4|0);return}function Is(a,b){a=a|0;b=b|0;var c=0;c=Ts()|0;ke(c,a,b,1);return c|0}function Js(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=c[a+192>>2]|0;ab[c[(c[e>>2]|0)+8>>2]&127](e,a+4|0,b,d);return}function Ks(a){a=a|0;var b=0;b=Nr(92)|0;ed(b,a);return b|0}function Ls(a,b){a=a|0;b=b|0;c[a>>2]=1065353216;c[a+4>>2]=1065353216;c[a+8>>2]=1065353216;g[a+12>>2]=0.0;return}function Ms(b){b=b|0;if(!(Fa[c[(c[b>>2]|0)+40>>2]&127](b)|0))return;c[b+16>>2]=c[b+28>>2];a[b+169>>0]=1;return}function Ns(a,b){a=a|0;b=b|0;var d=0;d=c[a+8>>2]|0;Za[c[d+60>>2]&127](b,d,c[a+4>>2]|0);return 0}function Os(b){b=b|0;var d=0;d=c[b+12>>2]|0;if(!d)return;if(a[b+16>>0]&1)Sx(d);c[b+12>>2]=0;return}function Ps(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(71)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Qs(a,b){a=a|0;b=b|0;var d=0;d=a+92|0;do{c[a>>2]=c[b>>2];a=a+4|0;b=b+4|0}while((a|0)<(d|0));return}function Rs(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;$f(a,b,c,d);return}function Ss(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(67)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Ts(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(95)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Us(a,b){a=a|0;b=b|0;return +(+Xx(+g[a>>2],+g[a+4>>2],+g[a+8>>2],+g[b>>2],+g[b+4>>2],+g[b+8>>2]))}function Vs(a,b){a=a|0;b=b|0;var c=0;c=Nr(84)|0;xm(c,a,b);return c|0}function Ws(a,b,d){a=a|0;b=b|0;d=d|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;return}function Xs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(75)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function Ys(a){a=a|0;var b=0;b=sa;sa=sa+16|0;c[b>>2]=JI(c[a+60>>2]|0)|0;a=pC(aa(6,b|0)|0)|0;sa=b;return a|0}function Zs(){var a=0;c[7182]=(c[7182]|0)+1;a=xb(35)|0;if(!a){a=0;return a|0}c[(a+4+15&-16)+-4>>2]=a;a=a+4+15&-16;return a|0}function _s(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return La[a&3](b|0,c|0,d|0,e|0,f|0,g|0)|0}function $s(a){a=a|0;var b=0;b=Xs()|0;ci(b,a);c[b>>2]=11256;c[b+52>>2]=2;return b|0}function at(a){a=a|0;var b=0;b=Xs()|0;ci(b,a);c[b>>2]=11152;c[b+52>>2]=0;return b|0}function bt(a){a=a|0;zf(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function ct(a){a=a|0;c[a>>2]=5560;g[a+4>>2]=1.0;c[a+8>>2]=0;b[a+12>>1]=1;b[a+14>>1]=-1;c[a+16>>2]=0;return}function dt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;ab[c[(c[a>>2]|0)+8>>2]&127](a,b,d,e);return}function et(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=4096;c[a+12>>2]=4096;c[a+16>>2]=0;c[a+20>>2]=1;return}function ft(a,b,d){a=a|0;b=b|0;d=d|0;Ld(c[a+116>>2]|0,c[a+144>>2]|0,b,d);return}function gt(a,b){a=a|0;b=+b;var c=0;c=sa;sa=sa+16|0;g[c>>2]=b;a=Xp(a,c)|0;sa=c;return a|0}function ht(a,b){a=a|0;b=b|0;var c=0;c=ws()|0;qq(c,a,b);return c|0}function it(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){P(b<>>32-c|0);return a<>2]|0)+64>>2]&127](a,b,d);return}function lt(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0.0}function mt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+80>>2]&127](a,b,d,e);return}function nt(a){a=a|0;if(!a){a=0;return a|0}a=Nq(a)|0;return a|0}function ot(){var a=0;a=sa;sa=sa+16|0;if(!(oa(29304,268)|0)){sa=a;return}else Hu(24116,a)}function pt(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;g=g|0;return +za[a&3](b|0,c|0,d|0,+e,f|0,g|0)}function qt(a,b){a=a|0;b=+b;var c=0;c=sa;sa=sa+16|0;g[c>>2]=b;a=Wr(a,c)|0;sa=c;return a|0}function rt(a){a=a|0;if(c[a+204>>2]&3|0)return;if((c[a+216>>2]&-2|0)!=4)c[a+216>>2]=1;g[a+220>>2]=0.0;return}function st(a,b){a=a|0;b=b|0;ln(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function tt(){var a=0;a=Nr(8)|0;c[a>>2]=0;c[a+4>>2]=0;Uy(a);return a|0}function ut(a,b){a=a|0;b=b|0;a=c[a+4>>2]|0;Ha[c[(c[a>>2]|0)+8>>2]&31](a,c[b+36>>2]|0)|0;return}function vt(a,b){a=a|0;b=b|0;Eq(a,b);ns(a+48|0,b+48|0,b+52|0,b+56|0);return}function wt(a,b,d){a=a|0;b=b|0;d=d|0;dg(c[a+116>>2]|0,b,d);return}function xt(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){P(b>>>c|0);return a>>>c|(b&(1<>>c-32|0}function yt(a,b){a=a|0;b=b|0;c[a+260>>2]=(c[a+260>>2]|0)+1;c[a+192>>2]=b;c[a+200>>2]=b;return}function zt(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;gb[a&7](b|0,c|0,d|0,e|0,f|0,g|0)}function At(a,b,c,d,e,f,g,h,i,j,k,l){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;g=+g;h=+h;i=+i;j=j|0;k=+k;l=l|0;N(35)}function Bt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+24>>2]&127](a,b,d,e);return}function Ct(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+88>>2]&127](a,b,d,e);return}function Dt(a,b,d){a=a|0;b=b|0;d=d|0;Za[c[(c[b>>2]|0)+68>>2]&127](a,b,d);return}function Et(b,d){b=b|0;d=d|0;b=(a[b+344>>0]|0)==0?3:0;c[d>>2]=b;c[d+4>>2]=b;return}function Ft(a,b){a=a|0;b=+b;var c=0;c=sa;sa=sa+16|0;g[c>>2]=1.0/b;a=Xp(a,c)|0;sa=c;return a|0}function Gt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+36>>2]&127](a,b,d,e);return}function Ht(a,b,d){a=a|0;b=+b;d=d|0;return Ga[c[(c[a>>2]|0)+52>>2]&1](a,b,d,.01666666753590107)|0}function It(a,b,d){a=a|0;b=+b;d=d|0;c[d>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;return}function Jt(a,b){a=a|0;b=b|0;An(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function Kt(a,b,d,e){a=a|0;b=+b;d=d|0;e=+e;return Ga[c[(c[a>>2]|0)+52>>2]&1](a,b,d,e)|0}function Lt(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=1065353216;g[a+12>>2]=0.0;return}function Mt(a,b){a=a|0;b=b|0;c[a>>2]=1065353216;c[a+4>>2]=0;c[a+8>>2]=0;g[a+12>>2]=0.0;return}function Nt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+28>>2]&127](a,b,d,e);return}function Ot(a,b){a=a|0;b=b|0;c[a>>2]=0;c[a+4>>2]=1065353216;c[a+8>>2]=0;g[a+12>>2]=0.0;return}function Pt(a,b){a=a|0;b=b|0;Za[c[(c[a>>2]|0)+8>>2]&127](a,b,c[(c[a+8>>2]|0)+48>>2]|0);return}function Qt(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=+g;fb[a&1](b|0,c|0,d|0,e|0,f|0,+g)}function Rt(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=f|0;g=g|0;$a[a&1](b|0,c|0,d|0,+e,f|0,g|0)}function St(a,b){a=a|0;b=b|0;Bn(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function Tt(b,d,e){b=b|0;d=d|0;e=+e;g[(c[b+720>>2]|0)+(d*104|0)+88>>2]=e>0.0?1.0/e:0.0;a[b+924>>0]=1;return}function Ut(a,b,d){a=a|0;b=b|0;d=+d;Wa[c[(c[a>>2]|0)+20>>2]&7](a,b,d);return}function Vt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+124>>2]&127](a,e,b,d);return}function Wt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;c[a+120>>2]=b;c[a+124>>2]=d;c[a+128>>2]=e;return}function Xt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;Ka[c[(c[a>>2]|0)+8>>2]&31](a,b,d,e)|0;return}function Yt(a,b){a=a|0;b=b|0;Ap(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function Zt(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;ns(a,b,d,e);c[a+12>>2]=c[f>>2];return}function _t(b,c,d,e){b=b|0;c=c|0;d=+d;e=+e;a[b+737>>0]=c&1;g[b+680>>2]=d;g[b+684>>2]=e;return}function $t(a,b){a=a|0;b=b|0;un(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function au(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=+d;e=+e;f=+f;kn(a,b,c,d,e,f);return}function bu(a){a=a|0;uj(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function cu(a){a=a|0;Xk(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function du(a,b,c,d,e,f,g){a=a|0;b=b|0;c=+c;d=+d;e=e|0;f=f|0;g=g|0;Sa[a&3](b|0,+c,+d,e|0,f|0,g|0)}function eu(a,b,d){a=a|0;b=b|0;d=d|0;ab[c[(c[a>>2]|0)+36>>2]&127](a,b,d,-3);return}function fu(a,b){a=a|0;b=b|0;var c=0;c=Ds()|0;Af(c,a,b,16);return c|0}function gu(a,b){a=a|0;b=b|0;if(!b)b=0;else b=di(c[b>>2]|0,c[b+4>>2]|0,a)|0;return ((b|0)==0?a:b)|0}function hu(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 1.0}function iu(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return}function ju(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;N(18);return 0}function ku(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+32>>2]&127](a,b,d,e);return}function lu(a){a=a|0;ag(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function mu(a){a=a|0;if(!a){a=0;return a|0}a=dr(a)|0;return a|0}function nu(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;N(9);return 0.0}function ou(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;li(a,b,c,d,e);return}function pu(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;mf(a,b,c,d,e);return}function qu(a,b,d,e){a=a|0;b=b|0;d=+d;e=e|0;Xa[c[(c[a>>2]|0)+28>>2]&7](a,b,d,e);return}function ru(a,b){a=a|0;b=b|0;ee(a,b);return}function su(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;ab[c[(c[a>>2]|0)+8>>2]&127](a,b,d,e);return}function tu(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;f=+f;g=+g;h=+h;i=i|0;j=j|0;k=+k;N(36)}function uu(a,b){a=a|0;b=b|0;dg(c[a+116>>2]|0,b,1);return}function vu(a,b){a=a|0;b=b|0;c[a+260>>2]=(c[a+260>>2]|0)+1;Dq(a+4|0,b);return}function wu(a){a=a|0;uE(a+144|0);uE(a+124|0);uE(a+104|0);return}function xu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return +Ba[a&15](b|0,c|0,d|0,e|0,f|0)}function yu(a,b){a=a|0;b=b|0;var c=0;c=is()|0;sf(c,a,b);return c|0}function zu(a){a=a|0;if(!a){a=0;return a|0}a=hr(a)|0;return a|0}function Au(a,b){a=a|0;b=b|0;Fp(a,+g[b>>2],+g[b+4>>2],+g[b+8>>2]);return}function Bu(a,b,d){a=a|0;b=b|0;d=d|0;ab[c[(c[a>>2]|0)+36>>2]&127](a,b,d,-1);return}function Cu(a,b){a=a|0;b=+b;var c=0;c=sa;sa=sa+16|0;g[c>>2]=1.0/b;Wr(a,c)|0;sa=c;return}function Du(a,b){a=a|0;b=+b;return Ga[c[(c[a>>2]|0)+52>>2]&1](a,b,1,.01666666753590107)|0}function Eu(a){a=a|0;var b=0;b=Nr(8)|0;wv(b,a);return b|0}function Fu(a,b,d){a=a|0;b=b|0;d=d|0;Za[c[(c[a>>2]|0)+56>>2]&127](a,b,d);return}function Gu(a,b,d){a=a|0;b=b|0;d=+d;Wa[c[(c[a>>2]|0)+36>>2]&7](a,b,d);return}function Hu(a,b){a=a|0;b=b|0;var d=0;d=sa;sa=sa+16|0;c[d>>2]=b;Zi(12344,a,d)|0;pl(10,12344)|0;ba()}function Iu(a){a=a|0;Dh(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Ju(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;N(43)}function Ku(a){a=a|0;Mi(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Lu(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;kn(a,b,c,d,e,1.0);return}function Mu(a){a=a|0;c[a>>2]=10968;if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Nu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;f=f|0;return +xa[a&3](b|0,c|0,+d,e|0,f|0)}function Ou(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;_t(a,b,c,d);return}function Pu(a,b){a=a|0;b=b|0;return c[(BB(c[a+24>>2]|0,b)|0)+64>>2]|0}function Qu(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;eb[a&31](b|0,c|0,d|0,e|0,f|0)}function Ru(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;ha(0,a|0,b|0,c|0,d|0)|0;return}function Su(a){a=a|0;if(!(c[a+12>>2]|0)){a=0;return a|0}a=c[a+20>>2]|0;return a|0}function Tu(a){a=a|0;Bl(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Uu(a,b){a=a|0;b=b|0;var c=0;c=Nr(64)|0;Jp(c,a,b);return c|0}function Vu(){var a=0;a=Nr(24)|0;et(a);return a|0}function Wu(a,b,d){a=a|0;b=b|0;d=+d;Qa[c[(c[a>>2]|0)+16>>2]&31](a,d);return}function Xu(a,b,c){a=a|0;b=b|0;c=c|0;Cn(a,b,c);return}function Yu(a,b){a=a|0;b=b|0;ab[c[(c[a>>2]|0)+36>>2]&127](a,b,2,-3);return}function Zu(a){a=a|0;var b=0;b=Ds()|0;Af(b,a,0,16);return b|0}function _u(a,b,d){a=a|0;b=+b;d=d|0;Ta[c[(c[a>>2]|0)+32>>2]&15](a,b,d);return}function $u(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;return}function av(a){a=a|0;Eh(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function bv(a){a=a|0;Fh(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function cv(a,b,d){a=a|0;b=b|0;d=d|0;return +(+ya[c[(c[a>>2]|0)+32>>2]&15](a,b,d))}function dv(a){a=a|0;if(!a){a=0;return a|0}a=xr(a)|0;return a|0}function ev(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;bb[a&1](b|0,c|0,d|0,e|0,+f)}function fv(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;f=f|0;Ya[a&1](b|0,c|0,+d,e|0,f|0)}function gv(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;N(17);return 0}function hv(a){a=a|0;if(!(+g[a+16>>2]==0.0)){a=0;return a|0}a=+g[a+20>>2]==0.0;return a|0}function iv(a){a=a|0;c[a>>2]=7356;if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function jv(a){a=a|0;c[a>>2]=7816;if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function kv(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;N(8);return 0.0}function lv(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;d=b-d-(c>>>0>a>>>0|0)>>>0;return (P(d|0),a-c>>>0|0)|0}function mv(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+52>>2]&127](a,b);return}function nv(a,b){a=a|0;b=b|0;return Ha[c[(c[a>>2]|0)+92>>2]&31](a,b)|0}function ov(a,b,d){a=a|0;b=b|0;d=+d;Wa[c[(c[a>>2]|0)+8>>2]&7](a,b,d);return}function pv(a,b){a=a|0;b=b|0;Sz(a,b);return}function qv(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Vb(a,b,c,d)|0;return 1}function rv(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;tr(a,b,c,d,e);return}function sv(a,b,d){a=a|0;b=b|0;d=d|0;Za[c[(c[a>>2]|0)+40>>2]&127](a,b,d);return}function tv(a){a=a|0;var b=0;b=is()|0;sf(b,a,1);return b|0}function uv(a,b,d){a=a|0;b=+b;d=d|0;g[(c[a+144>>2]|0)+(d*284|0)+232>>2]=b;return}function vv(a,b,d){a=a|0;b=+b;d=d|0;g[(c[a+144>>2]|0)+(d*284|0)+252>>2]=b;return}function wv(a,b){a=a|0;b=b|0;aH(a);c[a>>2]=7664;c[a+4>>2]=b;return}function xv(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return (P(b+d+(a+c>>>0>>>0>>0|0)>>>0|0),a+c>>>0|0)|0}function yv(a,b){a=a|0;b=b|0;Aq(a,b);return}function zv(a,b){a=a|0;b=b|0;Fq(a,b);return}function Av(a,b){a=a|0;b=b|0;ab[c[(c[a>>2]|0)+36>>2]&127](a,b,1,-1);return}function Bv(a,b,c){a=a|0;b=b|0;c=c|0;ph(b,c);return}function Cv(a,b){a=a|0;b=b|0;Wm(a,b);return}function Dv(a){a=a|0;Fc(a);if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Ev(a){a=a|0;var b=0;b=((c[a+52>>2]|0)+2|0)%3|0;return +(+g[(JI(a+28|0)|0)+(b<<2)>>2])}function Fv(a){a=a|0;c[a>>2]=5732;g[a+4>>2]=1.0;b[a+8>>1]=1;b[a+10>>1]=-1;return}function Gv(a,b){a=a|0;b=b|0;if((c[a+216>>2]&-2|0)==4)return;c[a+216>>2]=b;return}function Hv(a,b){a=a|0;b=b|0;Uq(a,b);return}function Iv(a,b){a=a|0;b=b|0;Vq(a,b);return}function Jv(a,b){a=a|0;b=b|0;Za[c[(c[a>>2]|0)+56>>2]&127](a,b,0);return}function Kv(a,b){a=a|0;b=+b;Dx(a,b);return}function Lv(a){a=+a;var b=0;h[j>>3]=a;b=c[j>>2]|0;P(c[j+4>>2]|0);return b|0}function Mv(a,b){a=a|0;b=b|0;return Ha[c[(c[a>>2]|0)+40>>2]&31](a,b)|0}function Nv(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+60>>2]&127](a,b);return}function Ov(a,b,d){a=a|0;b=b|0;d=+d;Va[c[(c[a>>2]|0)+12>>2]&127](a,b);return}function Pv(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+92>>2]&127](a,b);return}function Qv(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=+d;e=+e;xl(a,b,c,d,e);return}function Rv(a,b){a=a|0;b=b|0;Cm(a,b);return}function Sv(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ka[a&31](b|0,c|0,d|0,e|0)|0}function Tv(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+32>>2]&127](a,b);return}function Uv(a){a=a|0;var b=0;b=Xs()|0;ci(b,a);return b|0}function Vv(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;N(42)}function Wv(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+40>>2]&127](a,b);return}function Xv(a,b){a=a|0;b=b|0;return c[(aF(c[a+276>>2]|0,b)|0)>>2]|0}function Yv(a,b,c){a=a|0;b=b|0;c=c|0;Zd(a,b,c);return}function Zv(a,b,d){a=a|0;b=+b;d=d|0;g[(c[a+144>>2]|0)+(d*284|0)+256>>2]=b;return}function _v(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+84>>2]&127](a,b);return}function $v(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;Ul(a,b,c,d);return}function aw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+28>>2]&127](a,b);return}function bw(a,b){a=a|0;b=+b;c[a+260>>2]=(c[a+260>>2]|0)+1;g[a+232>>2]=b;return}function cw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return +Aa[a&1](b|0,c|0,d|0,e|0)}function dw(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=+i;N(41)}function ew(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+72>>2]&127](a,b);return}function fw(){var a=0;a=Ds()|0;Af(a,0,0,16);return a|0}function gw(a){a=a|0;var b=0;b=Nr(284)|0;Yi(b,a);return b|0}function hw(a){a=a|0;if(!a)return;Pa[c[(c[a>>2]|0)+8>>2]&511](a);return}function iw(a,b){a=a|0;b=+b;g[a+36>>2]=b;g[a+40>>2]=+z(+b);return}function jw(a){a=a|0;if(!a)return;Pa[c[(c[a>>2]|0)+4>>2]&511](a);return}function kw(a,b){a=a|0;b=+b;return +(+va[c[(c[a>>2]|0)+16>>2]&15](a)*b)}function lw(a){a=a|0;Cu(a,+lA(+g[a>>2],+g[a+4>>2],+g[a+8>>2]));return}function mw(a,b){a=a|0;b=b|0;Qw(a+868|0,b);return}function nw(a,b){a=a|0;b=+b;c[a+260>>2]=(c[a+260>>2]|0)+1;g[a+228>>2]=b;return}function ow(a,b){a=a|0;b=b|0;$d(a,b);return}function pw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+8>>2]&127](a,b);return}function qw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+16>>2]&127](a,b);return}function rw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+36>>2]&127](a,b);return}function sw(a,b){a=a|0;b=b|0;b=(b|0)<2?b:2;c[a+176>>2]=(b|0)>0?b:0;return}function tw(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;N(7);return 0.0}function uw(a,b,c){a=a|0;b=b|0;c=c|0;Mh(a,b,c);return}function vw(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ab[a&127](b|0,c|0,d|0,e|0)}function ww(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+12>>2]&127](a,b);return}function xw(a,b,c){a=a|0;b=b|0;c=c|0;Bk(a,b,c);return}function yw(a,b){a=a|0;b=b|0;Me(a,b);return}function zw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+68>>2]&127](a,b);return}function Aw(b){b=b|0;a[b+16>>0]=1;c[b+12>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;return}function Bw(a,b){a=a|0;b=+b;c[a+260>>2]=(c[a+260>>2]|0)+1;g[a+224>>2]=b;return}function Cw(a,b,c){a=a|0;b=b|0;c=c|0;fa(3,a|0,b|0,c|0)|0;return}function Dw(){var a=0;a=is()|0;sf(a,1,1);return a|0}function Ew(a){a=a|0;return JE(c[a+204>>2]|0)|0}function Fw(a,b,c){a=a|0;b=+b;c=+c;zx(a,b,c);return}function Gw(a,b){a=a|0;b=+b;Qa[c[(c[a>>2]|0)+20>>2]&31](a,b);return}function Hw(a,b,c,d){a=a|0;b=+b;c=+c;d=+d;Sk(a,b,c,d);return}function Iw(a,b){a=a|0;b=b|0;hp(a,b);return}function Jw(a,b){a=a|0;b=b|0;hp(a,b);return}function Kw(a,b){a=a|0;b=b|0;c[b>>2]=6;c[b+4>>2]=6;return}function Lw(a,b){a=a|0;b=b|0;Cv(a+788|0,b);return}function Mw(a,b){a=a|0;b=+b;Qa[c[(c[a>>2]|0)+16>>2]&31](a,b);return}function Nw(a,b){a=a|0;b=b|0;return +(+g[(c[a+144>>2]|0)+(b*284|0)+232>>2])}function Ow(){var a=0;a=Nr(196)|0;fh(a,0);return a|0}function Pw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+24>>2]&127](a,b);return}function Qw(a,b){a=a|0;b=b|0;hp(a,b);return}function Rw(a,b,d){a=a|0;b=b|0;d=d|0;c[a+20>>2]=b;c[a+28>>2]=d;return}function Sw(a,b,d){a=a|0;b=b|0;d=d|0;c[a+16>>2]=b;c[a+24>>2]=d;return}function Tw(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return 0}function Uw(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=d|0;e=+e;return Ga[a&1](b|0,+c,d|0,+e)|0}function Vw(a,b,c){a=a|0;b=b|0;c=+c;am(a,b,c);return}function Ww(a,b){a=a|0;b=b|0;return c[(aF(c[a+12>>2]|0,b)|0)>>2]|0}function Xw(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+64>>2]&127](a,b);return}function Yw(a){a=a|0;var b=0;b=((JI(c[a+236>>2]|0)|0)&2|0)==0;return (b?0:a)|0}function Zw(a,b){a=a|0;b=b|0;return MB(c[a+12>>2]|0,b)|0}function _w(a,b,c){a=a|0;b=b|0;c=c|0;tl(a,b,c);return}function $w(a,b,c){a=a|0;b=b|0;c=+c;g[a+1340+(b<<2)>>2]=c;return}function ax(a){a=a|0;if(!a)return;sC(a);GI(a);return}function bx(a,b){a=a|0;b=b|0;Va[c[(c[a>>2]|0)+44>>2]&127](a,b);return}function cx(a,b,c){a=a|0;b=b|0;c=c|0;return nb(a,b,c)|0}function dx(a,b){a=a|0;b=b|0;sw(a,b);return}function ex(a,b,c){a=a|0;b=b|0;c=+c;xq(a,b,c);return}function fx(a){a=a|0;c[a>>2]=6400;ni(a+12|0);GI(a);return}function gx(a,b){a=a|0;b=b|0;Km(a,b);return}function hx(a,b){a=a|0;b=b|0;Rv(a+708|0,b);return}function ix(a){a=a|0;if(!a)return;lG(a);GI(a);return}function jx(a,b,c){a=a|0;b=b|0;c=+c;g[a+1364+(b<<2)>>2]=c;return}function kx(a,b){a=a|0;b=b|0;rx(a+4|0,b);return}function lx(a,b){a=a|0;b=b|0;Cd(a,b);return}function mx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;_a[a&15](b|0,c|0,d|0,+e)}function nx(a){a=+a;var b=0;b=Ps()|0;Uo(b,a);return b|0}function ox(a,b){a=a|0;b=b|0;vu(a,b);return}function px(a,b){a=a|0;b=+b;g[a+132>>2]=b;return}function qx(a,b){a=a|0;b=+b;My(a,b);return}function rx(a,b){a=a|0;b=b|0;_o(a,b);return}function sx(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;Xa[a&7](b|0,c|0,+d,e|0)}function tx(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=d|0;e=e|0;Ua[a&1](b|0,+c,d|0,e|0)}function ux(a,b){a=a|0;b=+b;g[a+128>>2]=b;return}function vx(a,b){a=a|0;b=b|0;lr(a,b);return}function wx(a,b){a=a|0;b=b|0;mr(a,b);return}function xx(a){a=a|0;var b=0;b=JI(a+28|0)|0;return +(+g[b+(c[a+52>>2]<<2)>>2])}function yx(a,b){a=a|0;b=b|0;c[a+24>>2]=b;return}function zx(a,b,c){a=a|0;b=+b;c=+c;g[a+472>>2]=b;g[a+476>>2]=c;return}function Ax(a,b){a=a|0;b=b|0;return dC(a,b)|0}function Bx(a,b){a=a|0;b=b|0;g[a+48>>2]=+(b|0);return}function Cx(a){a=a|0;var b=0;b=sa;sa=sa+16|0;Oa[a&3]();Hu(24219,b)}function Dx(b,c){b=b|0;c=+c;g[b+572>>2]=c;a[b+553>>0]=1;return}function Ex(a,b){a=a|0;b=b|0;return c[(c[a+20>>2]|0)+(b<<2)>>2]|0}function Fx(a){a=a|0;if(!a)return;uE(a);GI(a);return}function Gx(a){a=a|0;return +(+TH(+g[a+16>>2]))}function Hx(a){a=a|0;return Fa[c[(c[a>>2]|0)+40>>2]&127](a)|0}function Ix(a,b){a=a|0;b=b|0;Tx(a+24|0,b);return}function Jx(a){a=a|0;Os(a);Aw(a);return}function Kx(a){a=a|0;var b=0;b=(JI(c[a+236>>2]|0)|0)==4;return (b?a:0)|0}function Lx(a){a=a|0;return +(+lA(+g[a>>2],+g[a+4>>2],+g[a+8>>2]))}function Mx(a,b){a=a|0;b=+b;CB(a,b);return}function Nx(a,b){a=a|0;b=b|0;yB(a,b);return}function Ox(a,b){a=a|0;b=+b;Qa[c[(c[a>>2]|0)+44>>2]&31](a,b);return}function Px(a,b){a=a|0;b=b|0;Lp(a,b);return}function Qx(a,b){a=a|0;b=+b;g[a+136>>2]=b;return}function Rx(a){a=a|0;return RF(+g[a+4>>2])|0}function Sx(a){a=a|0;if(!a)return;c[7183]=(c[7183]|0)+1;Hc(c[a+-4>>2]|0);return}function Tx(a,b){a=a|0;b=b|0;Vm(a,b);return}function Ux(a,b){a=a|0;b=b|0;JC(a,b);return}function Vx(a,b){a=a|0;b=b|0;return (c[a+144>>2]|0)+(b*284|0)+92|0}function Wx(a,b){a=a|0;b=b|0;return Xv(a,b)|0}function Xx(a,b,c,d,e,f){a=+a;b=+b;c=+c;d=+d;e=+e;f=+f;return +(a*d+b*e+c*f)}function Yx(a){a=a|0;c[a>>2]=5512;b[a+4>>1]=1;b[a+6>>1]=-1;return}function Zx(a){a=a|0;var b=0;b=(JI(c[a+236>>2]|0)|0)==8;return (b?a:0)|0}function _x(){var a=0;a=Nr(24)|0;kr(a);return a|0}function $x(a,b){a=a|0;b=b|0;Op(a,b);return}function ay(a,b){a=a|0;b=+b;rC(a,b);return}function by(a,b){a=a|0;b=b|0;return KD(c[a+12>>2]|0,b)|0}function cy(a){a=a|0;g[a>>2]=.30000001192092896;g[a+4>>2]=1.0;g[a+8>>2]=0.0;return}function dy(a,b){a=a|0;b=+b;PB(a,b);return}function ey(a,b){a=a|0;b=b|0;KC(a,b);return}function fy(a){a=a|0;Pa[c[(c[a>>2]|0)+44>>2]&511](a);return}function gy(a,b){a=a|0;b=b|0;Dq(a+4|0,b);return}function hy(a){a=a|0;return oF(c[a+204>>2]|0)|0}function iy(a,b){a=a|0;b=+b;tC(a,b);return}function jy(a,b){a=a|0;b=+b;vz(a,b);return}function ky(a,b){a=a|0;b=+b;uC(a,b);return}function ly(a,b){a=a|0;b=+b;wz(a,b);return}function my(a,b){a=a|0;b=b|0;Hs(a,b);return}function ny(a,b){a=a|0;b=b|0;Qp(a,b);return}function oy(a){a=a|0;return +(+TH(+g[a+112>>2]))}function py(b,c){b=b|0;c=c|0;a[b+32>>0]=c&1;return}function qy(a){a=a|0;return Fa[c[(c[a>>2]|0)+96>>2]&127](a)|0}function ry(a){a=a|0;return iF(c[a+8>>2]|0)|0}function sy(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ja[a&63](b|0,c|0,d|0)|0}function ty(a,b){a=a|0;b=+b;oE(a,b);return}function uy(a,b){a=a|0;b=b|0;return +(+Em(a,b))}function vy(a,b){a=a|0;b=b|0;Mh(a,b,1);return}function wy(a,b){a=a|0;b=b|0;ZB(a,b);return}function xy(a){a=a|0;if(!a)a=0;else a=(zi(a,5248)|0)!=0&1;return a|0}function yy(a,b,c,d,e){a=a|0;b=+b;c=+c;d=+d;e=+e;Wp(a,c,d,e,b);return}function zy(a){a=a|0;$i(a);GI(a);return}function Ay(a,b){a=a|0;b=b|0;Rl(a,b);return}function By(a,b){a=a|0;b=+b;g[a+116>>2]=b;return}function Cy(a){a=a|0;return Fa[c[(c[a>>2]|0)+20>>2]&127](a)|0}function Dy(a,b){a=a|0;b=b|0;MA(a,b,+TD(b));return}function Ey(a){a=a|0;c[a>>2]=6400;ni(a+12|0);return}function Fy(a,b){a=a|0;b=b|0;qC(a,b);return}function Gy(a,b){a=a|0;b=b|0;vt(a,b);return}function Hy(){var a=0;a=Nr(100)|0;Zl(a);return a|0}function Iy(a,b){a=a|0;b=+b;g[a+112>>2]=b;return}function Jy(a,b){a=a|0;b=+b;g[a+124>>2]=b;return}function Ky(a,b){a=a|0;b=b|0;eC(a,b);return}function Ly(a,b){a=a|0;b=b|0;return c[(c[a+220>>2]|0)+(b<<2)>>2]|0}function My(b,c){b=b|0;c=+c;g[b+572>>2]=c;a[b+553>>0]=0;return}function Ny(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return +ya[a&15](b|0,c|0,d|0)}function Oy(a,b){a=a|0;b=b|0;fC(a,b);return}function Py(a,b){a=a|0;b=b|0;return nb(a,b,8192)|0}function Qy(b,c){b=b|0;c=c|0;a[b+120>>0]=c&1;return}function Ry(a){a=a|0;Pa[c[(c[a>>2]|0)+24>>2]&511](a);return}function Sy(){var a=0;a=Nr(12)|0;cy(a);return a|0}function Ty(a){a=a|0;if(!a)return;wu(a);GI(a);return}function Uy(a){a=a|0;Yx(a);c[a>>2]=5488;return}function Vy(a){a=a|0;return TF(a)|0}function Wy(a,b){a=a|0;b=+b;bw(a,b);return}function Xy(a,b){a=a|0;b=b|0;return +(+ze(a,b))}function Yy(a){a=a|0;return +(+TH(+g[a+120>>2]))}function Zy(){var a=0;a=Nr(4)|0;qB(a);return a|0}function _y(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;return}function $y(a){a=a|0;return NF(c[a+204>>2]|0)|0}function az(a,b){a=a|0;b=+b;cD(a,b);return}function bz(a,b){a=a|0;b=b|0;Og(a,b);return}function cz(a){a=a|0;Oi(a);return}function dz(a,b){a=a|0;b=+b;aD(a,b);return}function ez(a){a=a|0;return Fa[c[(c[a>>2]|0)+28>>2]&127](a)|0}function fz(a,b,d){a=a|0;b=b|0;d=d|0;if(!(c[a>>2]&32))lj(b,d,a)|0;return}function gz(a,b){a=a|0;b=b|0;return Pu(a,b)|0}function hz(){var a=0;a=Nr(4)|0;c[a>>2]=0;NE(a);return a|0}function iz(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;return Ia[a&7](b|0,c|0,+d)|0}function jz(a){a=a|0;return +(+g[a+132>>2])}function kz(a){a=a|0;return Mz(c[a+68>>2]|0)|0}function lz(a){a=a|0;return Fa[c[(c[a>>2]|0)+48>>2]&127](a)|0}function mz(b){b=b|0;if((a[b>>0]|0)==1)b=0;else{a[b>>0]=1;b=1}return b|0}function nz(a,b){a=a|0;b=b|0;hp(a,b);return}function oz(b,c){b=b|0;c=c|0;a[b+80>>0]=c&1;return}function pz(a){a=a|0;return +(+g[a+128>>2])}function qz(a,b){a=a|0;b=b|0;return (c[a+144>>2]|0)+(b*284|0)|0}function rz(a,b){a=a|0;b=b|0;AC(a,b);return}function sz(a){a=a|0;c[a+4>>2]=(c[a+4>>2]|0)+-1;return}function tz(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;N(40)}function uz(a){a=a|0;return $C(a)|0}function vz(a,b){a=a|0;b=+b;g[a+196>>2]=+As(b);return}function wz(a,b){a=a|0;b=+b;g[a+192>>2]=+As(b);return}function xz(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Za[a&127](b|0,c|0,d|0)}function yz(a,b){a=a|0;b=b|0;Dq(a+92|0,b);return}function zz(a){a=a|0;Xi(a);GI(a);return}function Az(a,b){a=a|0;b=+b;g[a+268>>2]=b;return}function Bz(a){a=a|0;return +(+TH(+g[a+80>>2]))}function Cz(a,b){a=a|0;b=b|0;c[b+748>>2]=0;return}function Dz(a,b){a=a|0;b=b|0;Rj(a,b);return}function Ez(a,b){a=a|0;b=b|0;return xG(c[a+12>>2]|0,b)|0}function Fz(a){a=a|0;return yG(a)|0}function Gz(a,b){a=a|0;b=+b;nw(a,b);return}function Hz(a,b){a=a|0;b=+b;g[a+96>>2]=b;return}function Iz(a,b,c){a=a|0;b=b|0;c=+c;g[a+20+(b<<2)>>2]=c;return}function Jz(a){a=a|0;return +(+va[c[(c[a>>2]|0)+48>>2]&15](a))}function Kz(a,c){a=a|0;c=c|0;b[a+10>>1]=c;return}function Lz(a,c){a=a|0;c=c|0;b[a+8>>1]=c;return}function Mz(a){a=a|0;return Fa[c[(c[a>>2]|0)+36>>2]&127](a)|0}function Nz(a){a=a|0;var b=0;b=sa;sa=sa+a|0;sa=sa+15&-16;return b|0}function Oz(a,b){a=a|0;b=b|0;Vc(a,b);return}function Pz(a,b){a=a|0;b=b|0;bD(a,b);return}function Qz(a){a=a|0;return +(+g[a+136>>2])}function Rz(b){b=b|0;return (a[b+32>>0]&1)!=0|0}function Sz(b,c){b=b|0;c=c|0;a[b+170>>0]=c&1;return}function Tz(a,b){a=a|0;b=b|0;ea(2,a|0,b|0)|0;return}function Uz(a,b){a=a|0;b=b|0;Fr(a,b);return}function Vz(a,b){a=a|0;b=b|0;an(a+288|0,b);return}function Wz(a,b){a=a|0;b=b|0;return Yw(b)|0}function Xz(a,b){a=a|0;b=+b;g[a+108>>2]=b;return}function Yz(a,c){a=a|0;c=c|0;b[a+12>>1]=c;return}function Zz(a,b){a=a|0;b=b|0;Og(b,a);return}function _z(a,b){a=a|0;b=+b;g[a+272>>2]=b;return}function $z(a){a=a|0;return CG(a)|0}function aA(a){a=a|0;return DG(a)|0}function bA(a){a=a|0;return IG(a)|0}function cA(a){a=a|0;if(!a)return;RG(a);GI(a);return}function dA(a,c){a=a|0;c=c|0;b[a+4>>1]=c;return}function eA(a,c){a=a|0;c=c|0;b[a+14>>1]=c;return}function fA(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;N(16);return 0}function gA(a){a=a|0;sz(a);return}function hA(a,b){a=a|0;b=b|0;Dz(a,b);return}function iA(a,b){a=a|0;b=b|0;return Zx(b)|0}function jA(a,b){a=a|0;b=b|0;c[a+44>>2]=b&1;return}function kA(a,c){a=a|0;c=c|0;b[a+6>>1]=c;return}function lA(a,b,c){a=+a;b=+b;c=+c;return +(+wI(+zA(a,b,c)))}function mA(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;Ta[a&15](b|0,+c,d|0)}function nA(a,b){a=a|0;b=b|0;if(!a)a=0;else a=Sj(a,b)|0;return a|0}function oA(a,b){a=a|0;b=+b;g[a+220>>2]=b;return}function pA(a,b){a=a|0;b=+b;g[a+100>>2]=b;return}function qA(b){b=b|0;return (a[b+120>>0]&1)!=0|0}function rA(b,c){b=b|0;c=c|0;a[b+24>>0]=c&1;return}function sA(a){a=a|0;return ~~+g[a+48>>2]|0}function tA(b,c){b=b|0;c=c|0;a[b+180>>0]=c&1;return}function uA(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;Wa[a&7](b|0,c|0,+d)}function vA(a,b){a=a|0;b=+b;g[a+224>>2]=b;return}function wA(a,b){a=a|0;b=+b;Bw(a,b);return}function xA(a){a=a|0;return bC(c[a+216>>2]|0)|0}function yA(a,b){a=a|0;b=b|0;nz(a,b);return}function zA(a,b,c){a=+a;b=+b;c=+c;return +(+Xx(a,b,c,a,b,c))}function AA(a){a=+a;if(!(a<-1.0)){if(a>1.0)a=1.0}else a=-1.0;return +(+C(+a))}function BA(a){a=a|0;return +(+g[a+116>>2])}function CA(a){a=a|0;return +(+Jq(a))}function DA(b,c){b=b|0;c=c|0;a[b+16>>0]=c&1;return}function EA(a){a=a|0;return SD(a)|0}function FA(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;f=f|0;N(4);return 0.0}function GA(a,b){a=a|0;b=+b;g[a+276>>2]=b;return}function HA(a,b){a=a|0;b=+b;g[a+204>>2]=b;return}function IA(a,b){a=a|0;b=+b;g[a+208>>2]=b;return}function JA(a){a=a|0;return +(+g[a+112>>2])}function KA(a){a=a|0;return +(+g[a+124>>2])}function LA(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return}function MA(a,b,c){a=a|0;b=b|0;c=+c;rn(a,b,1.0/c);return}function NA(a){a=a|0;se(a);GI(a);return}function OA(a,b){a=a|0;b=b|0;var c=0;c=kB(a|0)|0;return ((b|0)==0?a:c)|0}function PA(a,b){a=a|0;b=b|0;ea(4,a|0,b|0)|0;return}function QA(a,b){a=a|0;b=+b;g[a+216>>2]=b;return}function RA(b){b=b|0;return (a[b+80>>0]&1)!=0|0}function SA(a){a=a|0;if(!a)return;Sx(a);return}function TA(a,b){a=a|0;b=b|0;c[a+36>>2]=b;return}function UA(a,b){a=a|0;b=b|0;c[a+32>>2]=b;return}function VA(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ge(a,b,c,d,0)|0}function WA(b,c){b=b|0;c=c|0;a[b+260>>0]=c&1;return}function XA(b,c){b=b|0;c=c|0;a[b+25>>0]=c&1;return}function YA(a,b,c){a=a|0;b=+b;c=c|0;return}function ZA(a,b){a=a|0;b=b|0;c[a+72>>2]=b;return}function _A(a){a=a|0;Ft(a,+TD(a))|0;return}function $A(a,b,c,d){a=a|0;b=b|0;c=+c;d=+d;Ra[a&7](b|0,+c,+d)}function aB(a){a=a|0;return +(+eH(+g[a+12>>2]))}function bB(a,b){a=a|0;b=b|0;c[a+8>>2]=b;return}function cB(a){a=a|0;return ZG(a)|0}function dB(a,b){a=a|0;b=b|0;return +(+ms(a,b))}function eB(a,b){a=a|0;b=b|0;c[a+216>>2]=b;return}function fB(b,c){b=b|0;c=c|0;a[b+26>>0]=c&1;return}function gB(b,c){b=b|0;c=c|0;a[b+84>>0]=c&1;return}function hB(a){a=a|0;Hj(a);GI(a);return}function iB(a){a=a|0;ck(a);GI(a);return}function jB(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;N(39)}function kB(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function lB(a){a=a|0;return fH(a)|0}function mB(a){a=a|0;return sE(a)|0}function nB(a){a=a|0;return (c[a+116>>2]|0)+4|0}function oB(a,b){a=a|0;b=b|0;c[a+4>>2]=b;return}function pB(a,b){a=a|0;b=b|0;bm(a+28|0,b);return}function qB(a){a=a|0;kG(a);c[a>>2]=5584;return}function rB(a,b,c){a=a|0;b=b|0;c=c|0;return Ha[a&31](b|0,c|0)|0}function sB(a,b){a=a|0;b=+b;g[a+244>>2]=b;return}function tB(a,b){a=a|0;b=+b;g[a+240>>2]=b;return}function uB(a){a=a|0;return +(+g[a+104>>2])}function vB(a,b){a=a|0;b=b|0;return Zk(a,b)|0}function wB(a){a=a|0;return lH(a)|0}function xB(a){a=a|0;Ij(a);GI(a);return}function yB(b,c){b=b|0;c=c|0;a[b+524>>0]=c&1;return}function zB(a){a=a|0;return ((a|0)==0?1:a<<1)|0}function AB(a,b){a=a|0;b=b|0;return a+(b*96|0)|0}function BB(a,b){a=a|0;b=b|0;return a+(b*80|0)|0}function CB(a,b){a=a|0;b=+b;g[a+248>>2]=b;return}function DB(a,b){a=a|0;b=+b;g[a+212>>2]=b;return}function EB(a,b){a=a|0;b=+b;g[a+228>>2]=b;return}function FB(a){a=a|0;return +(+g[a+268>>2])}function GB(a){a=a|0;return KE(a)|0}function HB(a){a=a|0;return JI(c[a+84>>2]|0)|0}function IB(a,b){a=a|0;b=b|0;return Xn(a,b)|0}function JB(a,b){a=a|0;b=b|0;return Wn(a,b)|0}function KB(a,b){a=a|0;b=b|0;return +(+Io(a,b))}function LB(a){a=a|0;return +(+xx(a))}function MB(a,b){a=a|0;b=b|0;return a+(b*104|0)|0}function NB(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=+f;N(38)}function OB(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=+d;e=e|0;f=f|0;N(32)}function PB(a,b){a=a|0;b=+b;g[a+252>>2]=b;return}function QB(a){a=a|0;return +(+g[a+96>>2])}function RB(a,b){a=a|0;b=b|0;return +(+g[a+20+(b<<2)>>2])}function SB(a){a=a|0;return vH(a)|0}function TB(a){a=a|0;return (c[a+44>>2]|0)!=0|0}function UB(a){a=a|0;ni(a);GI(a);return}function VB(a,b){a=a|0;b=b|0;return Kp(a,b)|0}function WB(a){a=a|0;return JI(c[a+88>>2]|0)|0}function XB(a){a=a|0;return JI(c[a+748>>2]|0)|0}function YB(b){b=b|0;return (a[b+24>>0]&1)!=0|0}function ZB(b,c){b=b|0;c=c|0;a[b+552>>0]=c&1;return}function _B(a,b,c){a=a|0;b=b|0;c=c|0;return 0}function $B(a){a=a|0;return xF(a)|0}function aC(a){a=a|0;return +(+g[a+108>>2])}function bC(a){a=a|0;a=JI(a)|0;return (a|0)!=2&(a|0)!=5|0}function cC(a){a=a|0;Jj(a);GI(a);return}function dC(a,b){a=a|0;b=b|0;return a+4+(b*184|0)|0}function eC(b,c){b=b|0;c=c|0;a[b+736>>0]=c&1;return}function fC(a,b){a=a|0;b=b|0;c[a+204>>2]=b;return}function gC(a,b,c,d,e,f){a=a|0;b=+b;c=+c;d=d|0;e=e|0;f=f|0;N(23)}function hC(a,b){a=a|0;b=+b;g[a+232>>2]=b;return}function iC(a,b){a=a|0;b=+b;g[a+280>>2]=b;return}function jC(a,b){a=a|0;b=+b;g[a+236>>2]=b;return}function kC(a){a=a|0;return +(+g[a+272>>2])}function lC(a,b){a=a|0;b=+b;return Ft(a,b)|0}function mC(b){b=b|0;return (a[b+16>>0]&1)!=0|0}function nC(a){a=a|0;return b[a+10>>1]|0}function oC(a){a=a|0;return b[a+8>>1]|0}function pC(a){a=a|0;if(a>>>0>4294963200){c[7184]=0-a;a=-1}return a|0}function qC(b,c){b=b|0;c=c|0;a[b+21>>0]=c&1;return}function rC(a,b){a=a|0;b=+b;g[a+684>>2]=b;return}function sC(a){a=a|0;js(a);return}function tC(a,b){a=a|0;b=+b;g[a+188>>2]=b;return}function uC(a,b){a=a|0;b=+b;g[a+184>>2]=b;return}function vC(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;N(6);return 0.0}function wC(a){a=a|0;return +(+g[a+220>>2])}function xC(a){a=a|0;return +(+g[a+100>>2])}function yC(a){a=a|0;return JI(c[a+128>>2]|0)|0}function zC(a){a=a|0;return b[a+12>>1]|0}function AC(b,c){b=b|0;c=c|0;a[b+737>>0]=c&1;return}function BC(a,b){a=a|0;b=+b;g[a+256>>2]=b;return}function CC(a){a=a|0;return +(+g[a+224>>2])}function DC(a,b){a=a|0;b=b|0;return Ir(a,b)|0}function EC(a,b){a=a|0;b=b|0;return Hr(a,b)|0}function FC(a){a=a|0;return xg(a)|0}function GC(a){a=a|0;return JI(c[a+188>>2]|0)|0}function HC(a){a=a|0;return b[a+4>>1]|0}function IC(a){a=a|0;return b[a+14>>1]|0}function JC(a,b){a=a|0;b=b|0;c[a+84>>2]=b;return}function KC(a,b){a=a|0;b=b|0;c[a+88>>2]=b;return}function LC(a,b){a=a|0;b=b|0;c[a+92>>2]=b;return}function MC(a,b){a=a|0;b=b|0;c[a+100>>2]=b;return}function NC(a,b){a=a|0;b=b|0;c[a+96>>2]=b;return}function OC(a){a=a|0;return (c[a+48>>2]|0)==1|0}function PC(a){a=a|0;Kj(a);GI(a);return}function QC(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;return}function RC(a,b){a=a|0;b=b|0;return (a|0)==(b|0)|0}function SC(a,b){a=a|0;b=b|0;if(!k){k=a;l=b}}function TC(b){b=b|0;return (a[b+260>>0]&1)!=0|0}function UC(a){a=a|0;return JI(c[a+116>>2]|0)|0}function VC(a){a=a|0;return JI(c[a+120>>2]|0)|0}function WC(a){a=a|0;return JI(c[a+744>>2]|0)|0}function XC(a){a=a|0;return JI(c[a+740>>2]|0)|0}function YC(b){b=b|0;return (a[b+25>>0]&1)!=0|0}function ZC(a){a=a|0;return b[a+6>>1]|0}function _C(a){a=a|0;return (c[a+92>>2]|0)+4|0}function $C(a){a=a|0;return JI(c[a+268>>2]|0)|0}function aD(a,b){a=a|0;b=+b;g[a+440>>2]=b;return}function bD(a,b){a=a|0;b=b|0;c[a+240>>2]=b;return}function cD(a,b){a=a|0;b=+b;g[a+104>>2]=b;return}function dD(a,b,c){a=a|0;b=b|0;c=c|0;Va[a&127](b|0,c|0)}function eD(a,b,c){a=a|0;b=b|0;c=+c;return +wa[a&1](b|0,+c)}function fD(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=d|0;e=e|0;N(2);return 0.0}function gD(a){a=a|0;return +(+g[a+276>>2])}function hD(a){a=a|0;return +(+g[a+208>>2])}function iD(a){a=a|0;return JI(c[a+192>>2]|0)|0}function jD(a){a=a|0;return JI(c[a+204>>2]|0)|0}function kD(a){a=a|0;return JI(c[a+24>>2]|0)|0}function lD(a){a=a|0;return JI(c[a+68>>2]|0)|0}function mD(a){a=a|0;return +(+Ev(a))}function nD(a,b){a=a|0;b=b|0;c[a+16>>2]=b;return}function oD(a,b){a=a|0;b=+b;g[a+64>>2]=b;return}function pD(a,b){a=a|0;b=+b;g[a+68>>2]=b;return}function qD(a){a=a|0;if(!a)return;GI(a);return}function rD(a){a=a|0;return +(+g[a+216>>2])}function sD(a){a=a|0;return JI(c[a+480>>2]|0)|0}function tD(a){a=a|0;return JI(c[a+124>>2]|0)|0}function uD(a,b){a=a|0;b=+b;pF(a,b);return}function vD(b){b=b|0;return (a[b+26>>0]&1)!=0|0}function wD(b){b=b|0;return (a[b+84>>0]&1)!=0|0}function xD(a,b){a=a|0;b=+b;g[a+80>>2]=b;return}function yD(a,b){a=a|0;b=+b;g[a+76>>2]=b;return}function zD(a){a=a|0;return +(+g[a+28>>2]*+g[a+12>>2])}function AD(a){a=a|0;return +(+g[a+248>>2])}function BD(a){a=a|0;return JI(c[a+240>>2]|0)|0}function CD(a){a=a|0;return xH(a)|0}function DD(a,b){a=a|0;b=+b;g[a+60>>2]=b;return}function ED(a,b){a=a|0;b=+b;g[a+52>>2]=b;return}function FD(a,b){a=a|0;b=+b;g[a+56>>2]=b;return}function GD(a,b){a=a|0;b=b|0;c[a+20>>2]=b;return}function HD(a,b,c){a=a|0;b=b|0;c=+c;return 0}function ID(a){a=a|0;return +(+g[a+204>>2])}function JD(a){a=a|0;sq(a);return}function KD(a,b){a=a|0;b=b|0;return a+(b*36|0)|0}function LD(a,b){a=a|0;b=+b;OF(a,b);return}function MD(a,b){a=a|0;b=+b;PF(a,b);return}function ND(a,b){a=a|0;b=+b;jG(a,b);return}function OD(a){a=a|0;return c[a+36>>2]|0}function PD(a){a=a|0;return c[a+32>>2]|0}function QD(a){a=a|0;return JI(c[a+52>>2]|0)|0}function RD(a){a=a|0;return (c[a+48>>2]|0)+4|0}function SD(a){a=a|0;return JI(c[a+16>>2]|0)|0}function TD(a){a=a|0;return +(+wI(+dF(a)))}function UD(a){a=a|0;return a+44|0}function VD(a){a=a|0;return c[a+68>>2]|0}function WD(a,b,c){a=a|0;b=b|0;c=+c;Qa[a&31](b|0,+c)}function XD(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;N(37)}function YD(a){a=a|0;return +(+g[(nI(a)|0)>>2])}function ZD(a){a=a|0;return +(+g[(oI(a)|0)>>2])}function _D(a){a=a|0;return +(+g[(mI(a)|0)>>2])}function $D(a){a=a|0;return IH(a)|0}function aE(a){a=a|0;_A(a);return}function bE(a){a=a|0;return c[a+8>>2]|0}function cE(a,b){a=a|0;b=+b;g[a+92>>2]=b;return}function dE(a,b){a=a|0;b=+b;g[a+40>>2]=b;return}function eE(a,b){a=a|0;b=+b;g[a+36>>2]=b;return}function fE(a,b){a=a|0;b=+b;g[a+48>>2]=b;return}function gE(a){a=a|0;return a+60|0}function hE(a){a=a|0;return c[a+200>>2]|0}function iE(a){a=a|0;return +(+g[a+244>>2])}function jE(a){a=a|0;return +(+g[a+240>>2])}function kE(a){a=a|0;return +(+dF(a))}function lE(a,b){a=a|0;b=+b;g[a+24>>2]=b;return}function mE(a,b){a=a|0;b=+b;g[a+20>>2]=b;return}function nE(a,b){a=a|0;b=+b;g[a+32>>2]=b;return}function oE(a,b){a=a|0;b=+b;g[a+16>>2]=b;return}function pE(a,b){a=a|0;b=+b;g[a+28>>2]=b;return}function qE(a,b){a=a|0;b=b|0;c[a>>2]=b;return}function rE(a){a=a|0;return c[a+212>>2]|0}function sE(a){a=a|0;return JI(c[a+136>>2]|0)|0}function tE(a){a=a|0;c[a+192>>2]=0;return}function uE(a){a=a|0;Jx(a);return}function vE(a,b,c){a=a|0;b=b|0;c=c|0;return}function wE(a,b){a=a|0;b=+b;g[a+72>>2]=b;return}function xE(a){a=a|0;return +(+g[a+212>>2])}function yE(a){a=a|0;return +(+g[a+228>>2])}function zE(a,b){a=a|0;b=+b;g[a+88>>2]=b;return}function AE(a){a=a|0;return c[a+24>>2]|0}function BE(a){a=a|0;Aw(a);return}function CE(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=+e;N(34)}function DE(a,b,c,d,e){a=a|0;b=b|0;c=+c;d=d|0;e=e|0;N(29)}function EE(a){a=a|0;return +(+g[a+252>>2])}function FE(a){a=a|0;return oI(a)|0}function GE(a){a=a|0;return +(+TD(a))}function HE(){var a=0;a=c[7327]|0;c[7327]=a+0;return a|0}function IE(a,b,c){a=a|0;b=b|0;c=c|0;return 0.0}function JE(a){a=a|0;return (a&3|0)!=0|0}function KE(a){a=a|0;return JI(c[a+12>>2]|0)|0}function LE(a){a=a|0;return c[a+136>>2]|0}function ME(a,b){a=a|0;b=+b;g[a+44>>2]=b;return}function NE(a){a=a|0;tH(a);c[a>>2]=5288;return}function OE(a){a=a|0;return a+156|0}function PE(a){a=a|0;return a+20|0}function QE(a){a=a|0;return da(5,a|0)|0}function RE(){var a=0;a=c[3117]|0;c[3117]=a+0;return a|0}function SE(a){a=a|0;Hh(a);GI(a);return}function TE(a){a=a|0;Jo(a);GI(a);return}function UE(a){a=a|0;cj(a);GI(a);return}function VE(a){a=a|0;return +(+g[a+232>>2])}function WE(a){a=a|0;return +(+g[a+280>>2])}function XE(a){a=a|0;return +(+g[a+236>>2])}function YE(a){a=a|0;return 348}function ZE(a){a=a|0;return c[a+12>>2]|0}function _E(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;N(15);return 0}function $E(a){a=a|0;lw(a);return}function aF(a,b){a=a|0;b=b|0;return a+(b<<2)|0}function bF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;N(5);return 0.0}function cF(a){a=a|0;return JI(c[a+4>>2]|0)|0}function dF(a){a=a|0;return +(+Io(a,a))}function eF(a){a=a|0;return (a?31-(M(a^a-1)|0)|0:32)|0}function fF(a){a=a|0;return +(+g[a+256>>2])}function gF(a){a=a|0;return a+348|0}function hF(a){a=a|0;return +(+g[a>>2])}function iF(a){a=a|0;return (a|0)!=0|0}function jF(a,b){a=a|0;b=b|0;return Fa[a&127](b|0)|0}function kF(a){a=a|0;T(a|0)|0;Ip()}function lF(a){a=a|0;return a+64|0}function mF(a){a=a|0;return +(+g[a+64>>2])}function nF(a){a=a|0;return +(+g[a+68>>2])}function oF(a){a=a|0;return (a&2|0)!=0|0}function pF(a,b){a=a|0;b=+b;g[a+12>>2]=b;return}function qF(a){a=a|0;return a+172|0}function rF(a){a=a|0;return c[a+4>>2]|0}function sF(a){a=a|0;return c[a+84>>2]|0}function tF(a){a=a|0;return c[a+88>>2]|0}function uF(a){a=a|0;return c[a+92>>2]|0}function vF(a){a=a|0;return c[a+100>>2]|0}function wF(a){a=a|0;return 252}function xF(a){a=a|0;return c[a+240>>2]|0}function yF(a,b,c,d){a=a|0;b=+b;c=c|0;d=+d;N(11);return 0}function zF(a){a=a|0;return +(+g[(JI(a)|0)>>2])}function AF(a){a=a|0;return a+52|0}function BF(a){a=a|0;return +(+g[a+80>>2])}function CF(a){a=a|0;return +(+g[a+76>>2])}function DF(a){a=a|0;return 28}function EF(a){a=a|0;return c[a+72>>2]|0}function FF(a,b){a=a|0;b=b|0;return +va[a&15](b|0)}function GF(a){a=a|0;return c[a+16>>2]|0}function HF(a){a=a|0;return +(+g[a+60>>2])}function IF(a){a=a|0;return +(+g[a+52>>2])}function JF(a){a=a|0;return +(+g[a+56>>2])}function KF(a){a=a|0;return a+108|0}function LF(a){a=a|0;return 212}function MF(a){a=a|0;return c[a+96>>2]|0}function NF(a){a=a|0;return (a&1|0)!=0|0}function OF(a,b){a=a|0;b=+b;g[a+8>>2]=b;return}function PF(a,b){a=a|0;b=+b;g[a+4>>2]=b;return}function QF(a){a=a|0;return a+16|0}function RF(a){a=+a;return a<1.0|0}function SF(a,b){a=a|0;b=b|0;return 1}function TF(a){a=a|0;return a+324|0}function UF(a){a=a|0;mH(a);return}function VF(a,b){a=a|0;b=b|0;sa=a;ta=b}function WF(a){a=a|0;return a+188|0}function XF(a){a=a|0;return c[a+20>>2]|0}function YF(a){a=a|0;return 204}function ZF(a,b){a=a|0;b=b|0;return}function _F(a){a=a|0;c[a>>2]=10968;return}function $F(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;N(33)}function aG(a){a=a|0;return a+36|0}function bG(a){a=a|0;return +(+g[a+92>>2])}function cG(a){a=a|0;return +(+g[a+44>>2])}function dG(a){a=a|0;return +(+g[a+40>>2])}function eG(a){a=a|0;return +(+g[a+36>>2])}function fG(a){a=a|0;return +(+g[a+48>>2])}function gG(a){a=a|0;return 220}function hG(a){a=a|0;return 256}function iG(a){a=a|0;return +(+g[a+72>>2])}function jG(a,b){a=a|0;b=+b;g[a>>2]=b;return}function kG(a){a=a|0;c[a>>2]=5612;return}function lG(a){a=a|0;RG(a+56|0);return}function mG(a){a=a|0;UF(a);return}function nG(a){a=a|0;return +(+g[a+24>>2])}function oG(a){a=a|0;return +(+g[a+4>>2])}function pG(a){a=a|0;return +(+g[a+20>>2])}function qG(a){a=a|0;return +(+g[a+32>>2])}function rG(a){a=a|0;return +(+g[a+16>>2])}function sG(a){a=a|0;return +(+g[a+12>>2])}function tG(a){a=a|0;return +(+g[a+28>>2])}function uG(a){a=a|0;return 52}function vG(a){a=a|0;return 68}function wG(a){a=a|0;return 84}function xG(a,b){a=a|0;b=b|0;return a+(b<<4)|0}function yG(a){a=a|0;return a+352|0}function zG(a){a=a|0;return a+868|0}function AG(a){a=a|0;return +(+g[a+88>>2])}function BG(a){a=a|0;return +(+g[a+8>>2])}function CG(a){a=a|0;return a+316|0}function DG(a){a=a|0;return a+300|0}function EG(a,b){a=a|0;b=b|0;Pa[a&511](b|0)}function FG(a,b,c,d){a=a|0;b=b|0;c=c|0;d=+d;N(31)}function GG(a,b,c,d){a=a|0;b=b|0;c=+c;d=d|0;N(28)}function HG(a,b,c,d){a=a|0;b=+b;c=c|0;d=d|0;N(25)}function IG(a){a=a|0;return a+32|0}function JG(a){a=a|0;return 24}function KG(a,b){a=a|0;b=+b;return}function LG(a){a=a|0;return a+788|0}function MG(a){a=a|0;return c[a>>2]|0}function NG(a,b){a=a|0;b=b|0;return gu(a,b)|0}function OG(a){a=a|0;return a+68|0}function PG(a){a=a|0;Sx(a);return}function QG(a){a=a|0;GI(a+-4|0);return}function RG(a){a=a|0;uE(a);return}function SG(a){a=a|0;BE(a);return}function TG(a){a=a|0;Fh(a);return}function UG(a){a=a|0;return JI(a)|0}function VG(a){a=a|0;return a+708|0}function WG(a){a=a|0;return 488}function XG(a,b,c){a=a|0;b=b|0;c=c|0;N(14);return 0}function YG(a){a=a|0;return 32}function ZG(a){a=a|0;return a+328|0}function _G(a){a=a|0;return 60}function $G(a){a=a|0;return 428}function aH(a){a=a|0;c[a>>2]=5688;return}function bH(a,b,c){a=a|0;b=b|0;c=c|0;N(3);return 0.0}function cH(a){a=a|0;return a+288|0}function dH(){return Nr(1)|0}function eH(a){a=+a;return +(+AA(a)*2.0)}function fH(a){a=a|0;return a+312|0}function gH(a){a=a|0;c[a>>2]=7356;return}function hH(a){a=a|0;c[a>>2]=7816;return}function iH(a){a=a|0;return (a&255)<<8|a>>8&255|0}function jH(a,b,c){a=a|0;b=b|0;c=+c;N(13);return 0}function kH(a){a=a|0;return 15417}function lH(a){a=a|0;return a+92|0}function mH(a){a=a|0;c[a>>2]=0;return}function nH(a){a=a|0;return 4}function oH(a){a=a|0;return 22146}function pH(a){a=a|0;return 21862}function qH(a){a=a|0;c[a>>2]=5664;return}function rH(){return Zs()|0}function sH(a){a=a|0;return 15305}function tH(a){a=a|0;c[a>>2]=5388;return}function uH(a){a=a|0;return a+76|0}function vH(a){a=a|0;return a+28|0}function wH(a){a=a|0;return 21008}function xH(a){a=a|0;return a+380|0}function yH(a){a=a|0;return a+40|0}function zH(a){a=a|0;return a+24|0}function AH(a){a=a|0;return a+72|0}function BH(a){a=a|0;return a+56|0}function CH(a,b,c){a=a|0;b=b|0;c=c|0;N(30)}function DH(a){a=a|0;return 21392}function EH(a){a=a|0;return 0}function FH(a,b){a=+a;b=b|0;return +(+Gl(a,b))}function GH(){return Nr(64)|0}function HH(a){a=a|0;return 21450}function IH(a){a=a|0;return a+48|0}function JH(a){a=a|0;return 21648}function KH(a){a=a|0;return 1}function LH(a,b,c){a=a|0;b=b|0;c=+c;N(27)}function MH(a,b,c){a=a|0;b=+b;c=c|0;N(24)}function NH(a){a=a|0;return 22263}function OH(a){a=a|0;return 22234}function PH(a){a=a|0;return 3}function QH(a){a=a|0;return hm(a,28780)|0}function RH(a){a=a|0;return (a+-48|0)>>>0<10|0}function SH(a){a=a|0;return 15684}function TH(a){a=+a;return +a}function UH(a){a=a|0;return 22206}function VH(a){a=a|0;return 20723}function WH(a){a=a|0;return 21806}function XH(a){a=a|0;return 21779}function YH(a){a=a|0;return 21749}function ZH(a){a=a|0;return 8}function _H(a){a=+a;return +(a%6.2831854820251465)}function $H(a,b,c){a=a|0;b=+b;c=+c;N(22)}function aI(a){a=a|0;return 20827}function bI(a,b){a=a|0;b=b|0;N(12);return 0}function cI(a){a=a|0;return 20785}function dI(a){a=a|0;return 20806}function eI(a){a=a|0;return 6}function fI(a){a=a|0;return 12}function gI(){return 4}function hI(a){a=a|0;return 20766}function iI(a){a=a|0;return 2}function jI(a){a=a|0;return 21921}function kI(a,b){a=a|0;b=+b;N(1);return 0.0}function lI(){c[6688]=1805;c[6689]=0;return}function mI(a){a=a|0;return a+12|0}function nI(a){a=a|0;return a+8|0}function oI(a){a=a|0;return a+4|0}function pI(a){a=a|0;Oa[a&3]()}function qI(){return 2}function rI(a){a=a|0;ma()}function sI(){return 5}function tI(){return 3}function uI(){return 0}function vI(){W()}function wI(a){a=+a;return +(+x(+a))}function xI(a){a=+a;return +(+w(+a))}function yI(a){a=+a;return +(+A(+a))}function zI(a){a=+a;return +(+z(+a))}function AI(a,b){a=a|0;b=b|0;N(26)}function BI(a,b){a=a|0;b=+b;N(21)}function CI(a){a=a|0;return Nr(a)|0}function DI(a){a=a|0;GI(a);return}function EI(a){a=a|0;return}function FI(a){a=a|0;sa=a}function GI(a){a=a|0;Hc(a);return}function HI(a){a=a|0;N(10);return 0}function II(a){a=a|0;N(0);return 0.0}function JI(a){a=a|0;return a|0}function KI(){return sa|0}function LI(a){a=a|0;N(20)}function MI(){return 1}function NI(){N(19)} -function lb(d,f){d=d|0;f=f|0;var h=0,i=0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0,y=0,z=0,A=0,B=0,C=0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0.0,J=0.0,K=0.0,L=0.0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0.0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0;ia=sa;sa=sa+192|0;i=c[d+52>>2]|0;if(i|0?(Pa[c[c[i>>2]>>2]&511](i),h=c[d+52>>2]|0,h|0):0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[7182]=(c[7182]|0)+1;h=xb(151)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}c[h>>2]=12260;a[h+20>>0]=1;c[h+16>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;a[h+40>>0]=1;c[h+36>>2]=0;c[h+28>>2]=0;c[h+32>>2]=0;a[h+60>>0]=1;c[h+56>>2]=0;c[h+48>>2]=0;c[h+52>>2]=0;c[d+52>>2]=h;m=0;n=0;ha=0;H=0;h=0;while(1){if((m|0)>=(Fa[c[(c[d>>2]|0)+96>>2]&127](d)|0))break;do if((H|0)==(n|0)){i=(n|0)==0?1:n<<1;if((n|0)<(i|0)){if((i|0)!=0?(c[7182]=(c[7182]|0)+1,o=xb((i<<4|3)+16|0)|0,(o|0)!=0):0){c[(o+4+15&-16)+-4>>2]=o;k=o+4+15&-16}else k=0;if((n|0)<=0){if(!ha){l=k;h=k;k=n;break}}else{h=0;do{ga=k+(h<<4)|0;fa=ha+(h<<4)|0;c[ga>>2]=c[fa>>2];c[ga+4>>2]=c[fa+4>>2];c[ga+8>>2]=c[fa+8>>2];c[ga+12>>2]=c[fa+12>>2];h=h+1|0}while((h|0)!=(n|0))}c[7183]=(c[7183]|0)+1;Hc(c[ha+-4>>2]|0);l=k;h=k;k=n}else{i=n;l=ha;k=n}}else{i=n;l=ha;k=H}while(0);n=l+(H<<4)|0;c[n>>2]=c[ia>>2];c[n+4>>2]=c[ia+4>>2];c[n+8>>2]=c[ia+8>>2];c[n+12>>2]=c[ia+12>>2];Za[c[(c[d>>2]|0)+108>>2]&127](d,m,n);m=m+1|0;n=i;ha=l;H=k+1|0}a[ia+124+16>>0]=1;ga=ia+124+12|0;c[ga>>2]=0;c[ia+124+4>>2]=0;c[ia+124+8>>2]=0;a[ia+124+36>>0]=1;fa=ia+124+32|0;c[fa>>2]=0;c[ia+124+24>>2]=0;c[ia+124+28>>2]=0;a[ia+124+56>>0]=1;ea=ia+124+52|0;c[ea>>2]=0;c[ia+124+44>>2]=0;c[ia+124+48>>2]=0;if(f){if((H|0)>0){G=0;i=0;k=0;l=0;while(1){h=G;G=G+1|0;a:do if((G|0)<(H|0)){B=ha+(h<<4)|0;C=ha+(h<<4)+4|0;A=ha+(h<<4)+8|0;m=G;h=l;while(1){z=m+1|0;b:do if((z|0)<(H|0)){v=ha+(m<<4)|0;y=ha+(m<<4)+4|0;f=ha+(m<<4)+8|0;l=z;while(1){p=+g[B>>2];I=+g[v>>2]-p;q=+g[C>>2];J=+g[y>>2]-q;r=+g[A>>2];E=+g[f>>2]-r;K=+g[ha+(l<<4)>>2]-p;L=+g[ha+(l<<4)+4>>2]-q;F=+g[ha+(l<<4)+8>>2]-r;D=(I*L-J*K)*(I*L-J*K)+((J*F-E*L)*(J*F-E*L)+(E*K-I*F)*(E*K-I*F));c:do if(D>9.999999747378752e-05){u=1.0/+x(+D);s=(J*F-E*L)*u;t=(E*K-I*F)*u;u=(I*L-J*K)*u;d:do if((h|0)>0){m=0;while(1){if(s*+g[k+(m<<4)>>2]+t*+g[k+(m<<4)+4>>2]+u*+g[k+(m<<4)+8>>2]>.9990000128746033)break d;m=m+1|0;if((m|0)>=(h|0)){ca=34;break}}}else ca=34;while(0);e:do if((ca|0)==34){ca=0;m=0;do{if(s*+g[ha+(m<<4)>>2]+t*+g[ha+(m<<4)+4>>2]+u*+g[ha+(m<<4)+8>>2]-(s*p+t*q+u*r)+-.009999999776482582>0.0)break e;m=m+1|0}while((m|0)<(H|0));do if((h|0)==(i|0)){o=(i|0)==0?1:i<<1;if((i|0)<(o|0)){do if(!o)n=0;else{c[7182]=(c[7182]|0)+1;m=xb((o<<4|3)+16|0)|0;if(!m){n=0;break}c[(m+4+15&-16)+-4>>2]=m;n=m+4+15&-16}while(0);if((i|0)<=0){if(!k){m=o;k=n;break}}else{m=0;do{ba=n+(m<<4)|0;aa=k+(m<<4)|0;c[ba>>2]=c[aa>>2];c[ba+4>>2]=c[aa+4>>2];c[ba+8>>2]=c[aa+8>>2];c[ba+12>>2]=c[aa+12>>2];m=m+1|0}while((m|0)!=(i|0))}c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);m=o;k=n}else m=i}else{m=i;i=h}while(0);g[k+(i<<4)>>2]=s;g[k+(i<<4)+4>>2]=t;g[k+(i<<4)+8>>2]=u;g[k+(i<<4)+12>>2]=-(s*p+t*q+u*r);i=m;h=h+1|0}while(0);if(D>9.999999747378752e-05){q=1.0/+x(+D);s=-((J*F-E*L)*q);r=-((E*K-I*F)*q);q=-((I*L-J*K)*q);if((h|0)>0){m=0;do{if(+g[k+(m<<4)>>2]*s+ +g[k+(m<<4)+4>>2]*r+ +g[k+(m<<4)+8>>2]*q>.9990000128746033)break c;m=m+1|0}while((m|0)<(h|0))}p=+g[B>>2]*s+ +g[C>>2]*r+ +g[A>>2]*q;m=0;do{if(+g[ha+(m<<4)>>2]*s+ +g[ha+(m<<4)+4>>2]*r+ +g[ha+(m<<4)+8>>2]*q-p+-.009999999776482582>0.0)break c;m=m+1|0}while((m|0)<(H|0));do if((h|0)==(i|0)){o=(i|0)==0?1:i<<1;if((i|0)>=(o|0)){m=i;break}do if(!o)n=0;else{c[7182]=(c[7182]|0)+1;m=xb((o<<4|3)+16|0)|0;if(!m){n=0;break}c[(m+4+15&-16)+-4>>2]=m;n=m+4+15&-16}while(0);if((i|0)<=0){if(!k){m=o;k=n;break}}else{m=0;do{ba=n+(m<<4)|0;aa=k+(m<<4)|0;c[ba>>2]=c[aa>>2];c[ba+4>>2]=c[aa+4>>2];c[ba+8>>2]=c[aa+8>>2];c[ba+12>>2]=c[aa+12>>2];m=m+1|0}while((m|0)!=(i|0))}c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);m=o;k=n}else{m=i;i=h}while(0);g[k+(i<<4)>>2]=s;g[k+(i<<4)+4>>2]=r;g[k+(i<<4)+8>>2]=q;g[k+(i<<4)+12>>2]=-p;i=m;h=h+1|0}}while(0);l=l+1|0;if((l|0)==(H|0))break b}}while(0);if((z|0)==(H|0))break a;m=z}}else h=l;while(0);if((G|0)==(H|0)){f=h;break}else l=h}if((f|0)>0){h=0;n=0;o=0;while(1){ba=k+(o<<4)|0;c[ia>>2]=c[ba>>2];c[ia+4>>2]=c[ba+4>>2];c[ia+8>>2]=c[ba+8>>2];p=+g[k+(o<<4)+12>>2];p=p-+va[c[(c[d>>2]|0)+48>>2]&15](d);do if((o|0)==(h|0)){m=(h|0)==0?1:h<<1;if((h|0)<(m|0)){if((m|0)!=0?(c[7182]=(c[7182]|0)+1,M=xb((m<<4|3)+16|0)|0,(M|0)!=0):0){c[(M+4+15&-16)+-4>>2]=M;l=M+4+15&-16}else l=0;if((h|0)<=0){if(!n)break}else{i=0;do{ba=l+(i<<4)|0;aa=n+(i<<4)|0;c[ba>>2]=c[aa>>2];c[ba+4>>2]=c[aa+4>>2];c[ba+8>>2]=c[aa+8>>2];c[ba+12>>2]=c[aa+12>>2];i=i+1|0}while((i|0)!=(h|0))}c[7183]=(c[7183]|0)+1;Hc(c[n+-4>>2]|0)}else{m=h;l=n}}else{m=h;l=n;h=o}while(0);ba=l+(h<<4)|0;c[ba>>2]=c[ia>>2];c[ba+4>>2]=c[ia+4>>2];c[ba+8>>2]=c[ia+8>>2];g[l+(h<<4)+12>>2]=p;o=o+1|0;if((o|0)<(f|0)){h=m;n=l}else break}M=0;n=0;m=0;i=0;h=0;do{H=M;M=M+1|0;f:do if((M|0)<(o|0)){f=M;while(1){G=f+1|0;g:do if((G|0)<(o|0)){A=l+(f<<4)+4|0;B=l+(f<<4)+8|0;C=l+(f<<4)|0;z=l+(f<<4)+12|0;f=G;while(1){s=+g[A>>2];p=+g[l+(f<<4)+8>>2];q=+g[B>>2];t=+g[l+(f<<4)+4>>2];u=+g[l+(f<<4)>>2];D=+g[C>>2];r=+g[l+(H<<4)+8>>2];E=+g[l+(H<<4)+4>>2];F=+g[l+(H<<4)>>2];h:do if((((t*D-s*u)*(t*D-s*u)+((s*p-q*t)*(s*p-q*t)+(q*u-p*D)*(q*u-p*D))>9.999999747378752e-05?(u*E-t*F)*(u*E-t*F)+((t*r-p*E)*(t*r-p*E)+(p*F-u*r)*(p*F-u*r))>9.999999747378752e-05:0)?(s*F-D*E)*(s*F-D*E)+((q*E-s*r)*(q*E-s*r)+(D*r-q*F)*(D*r-q*F))>9.999999747378752e-05:0)?(W=r*(t*D-s*u)+(E*(q*u-p*D)+(s*p-q*t)*F),+w(+W)>9.999999974752427e-07):0){K=+g[l+(H<<4)+12>>2];L=+g[z>>2];J=+g[l+(f<<4)+12>>2];I=-1.0/W*((q*E-s*r)*J+((s*p-q*t)*K+(t*r-p*E)*L));q=-1.0/W*((D*r-q*F)*J+((q*u-p*D)*K+(p*F-u*r)*L));p=-1.0/W*((s*F-D*E)*J+((t*D-s*u)*K+(u*E-t*F)*L));v=0;do{if(+g[l+(v<<4)+12>>2]+(I*+g[l+(v<<4)>>2]+q*+g[l+(v<<4)+4>>2]+p*+g[l+(v<<4)+8>>2])+-.009999999776482582>0.0)break h;v=v+1|0}while((v|0)<(o|0));do if((i|0)==(n|0)){y=(n|0)==0?1:n<<1;if((n|0)>=(y|0)){y=n;break}do if(!y)v=0;else{c[7182]=(c[7182]|0)+1;h=xb((y<<4|3)+16|0)|0;if(!h){v=0;break}c[(h+4+15&-16)+-4>>2]=h;v=h+4+15&-16}while(0);if((n|0)<=0){if(!m){m=v;h=v;break}}else{h=0;do{ba=v+(h<<4)|0;aa=m+(h<<4)|0;c[ba>>2]=c[aa>>2];c[ba+4>>2]=c[aa+4>>2];c[ba+8>>2]=c[aa+8>>2];c[ba+12>>2]=c[aa+12>>2];h=h+1|0}while((h|0)!=(n|0))}c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0);m=v;h=v}else{y=n;n=i}while(0);g[m+(n<<4)>>2]=I;g[m+(n<<4)+4>>2]=q;g[m+(n<<4)+8>>2]=p;g[m+(n<<4)+12>>2]=0.0;n=y;i=i+1|0}while(0);f=f+1|0;if((f|0)==(o|0))break g}}while(0);if((G|0)==(o|0))break f;f=G}}while(0)}while((M|0)!=(o|0))}else{m=0;l=0;i=0;h=0}}else{m=0;l=0;k=0;i=0;h=0}zb(ia+124|0,h,i);if(m|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}if(l|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}if(k|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}}else zb(ia+124|0,h,H);G=c[ia+124+44>>2]|0;if((G|0)>0){c[7182]=(c[7182]|0)+1;h=xb((G<<4|3)+16|0)|0;if(!h)i=0;else{c[(h+4+15&-16)+-4>>2]=h;i=h+4+15&-16}h=0;do{ba=i+(h<<4)|0;c[ba>>2]=c[ia>>2];c[ba+4>>2]=c[ia+4>>2];c[ba+8>>2]=c[ia+8>>2];c[ba+12>>2]=c[ia+12>>2];h=h+1|0}while((h|0)!=(G|0));ba=i;$=i}else{ba=0;$=0}a[ia+104+16>>0]=1;aa=ia+104+12|0;c[aa>>2]=0;_=ia+104+4|0;c[_>>2]=0;c[ia+104+8>>2]=0;k=ia;m=k+19|0;do{a[k>>0]=0;k=k+1|0}while((k|0)<(m|0));if((G|0)<0)ma();if(G|0){Om(ia+104|0,G);i=c[aa>>2]|0;h=0;do{a[i+(h*36|0)+16>>0]=1;k=i+(h*36|0)+4|0;c[k>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;k=i+(h*36|0)+20|0;l=ia+3|0;m=k+16|0;do{a[k>>0]=a[l>>0]|0;k=k+1|0;l=l+1|0}while((k|0)<(m|0));h=h+1|0}while((h|0)!=(G|0))}c[_>>2]=G;n=c[ia+124+4>>2]|0;m=c[d+52>>2]|0;l=c[m+8>>2]|0;if((l|0)<(n|0)){if((c[m+12>>2]|0)<(n|0)){if(!n){h=0;k=l}else{c[7182]=(c[7182]|0)+1;h=xb((n<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}k=c[m+8>>2]|0}if((k|0)>0){i=0;do{Z=h+(i<<4)|0;Y=(c[m+16>>2]|0)+(i<<4)|0;c[Z>>2]=c[Y>>2];c[Z+4>>2]=c[Y+4>>2];c[Z+8>>2]=c[Y+8>>2];c[Z+12>>2]=c[Y+12>>2];i=i+1|0}while((i|0)!=(k|0))}i=c[m+16>>2]|0;if(i|0){if(a[m+20>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[m+16>>2]=0}a[m+20>>0]=1;c[m+16>>2]=h;c[m+12>>2]=n;i=m+16|0}else i=m+16|0;h=l;do{Z=(c[i>>2]|0)+(h<<4)|0;c[Z>>2]=c[ia>>2];c[Z+4>>2]=c[ia+4>>2];c[Z+8>>2]=c[ia+8>>2];c[Z+12>>2]=c[ia+12>>2];h=h+1|0}while((h|0)!=(n|0))}c[m+8>>2]=n;if((n|0)>0){h=0;do{Y=(c[ga>>2]|0)+(h<<4)|0;Z=(c[(c[d+52>>2]|0)+16>>2]|0)+(h<<4)|0;c[Z>>2]=c[Y>>2];c[Z+4>>2]=c[Y+4>>2];c[Z+8>>2]=c[Y+8>>2];c[Z+12>>2]=c[Y+12>>2];h=h+1|0}while((h|0)!=(n|0))}if((G|0)>0){C=0;do{A=(c[fa>>2]|0)+((c[(c[ea>>2]|0)+(C<<2)>>2]|0)*12|0)|0;z=A;h=0;do{B=z+4|0;y=c[z+((c[B>>2]|0)*12|0)+8>>2]|0;f=c[aa>>2]|0;v=f+(C*36|0)+4|0;i=c[v>>2]|0;o=f+(C*36|0)+8|0;if((i|0)==(c[o>>2]|0)?(N=(i|0)==0?1:i<<1,(i|0)<(N|0)):0){if(!N)n=0;else{c[7182]=(c[7182]|0)+1;i=xb((N<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}n=i;i=c[v>>2]|0}m=f+(C*36|0)+12|0;l=c[m>>2]|0;if((i|0)<=0)if(!l)k=f+(C*36|0)+16|0;else ca=161;else{k=0;do{c[n+(k<<2)>>2]=c[l+(k<<2)>>2];k=k+1|0}while((k|0)!=(i|0));ca=161}if((ca|0)==161){ca=0;i=f+(C*36|0)+16|0;if(a[i>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}c[m>>2]=0;k=i;i=c[v>>2]|0}a[k>>0]=1;c[m>>2]=n;c[o>>2]=N}c[(c[f+(C*36|0)+12>>2]|0)+(i<<2)>>2]=y;c[v>>2]=(c[v>>2]|0)+1;Y=c[z+8>>2]|0;Z=c[ga>>2]|0;r=+g[Z+(Y<<4)>>2]-+g[Z+(y<<4)>>2];s=+g[Z+(Y<<4)+4>>2]-+g[Z+(y<<4)+4>>2];p=+g[Z+(Y<<4)+8>>2]-+g[Z+(y<<4)+8>>2];q=1.0/+x(+(r*r+s*s+p*p));if((h|0)<2){g[ia+(h<<4)>>2]=r*q;g[ia+(h<<4)+4>>2]=s*q;g[ia+(h<<4)+8>>2]=p*q;g[ia+(h<<4)+12>>2]=0.0;h=h+1|0}Z=z+((c[B>>2]|0)*12|0)|0;z=Z+((c[Z>>2]|0)*12|0)|0}while((z|0)!=(A|0));if((h|0)==2){I=+g[ia+4>>2];J=+g[ia+24>>2];K=+g[ia+8>>2];L=+g[ia+20>>2];F=+g[ia+16>>2];E=+g[ia>>2];Y=ba+(C<<4)+4|0;Z=ba+(C<<4)+8|0;g[ba+(C<<4)+12>>2]=0.0;W=1.0/+x(+((L*E-I*F)*(L*E-I*F)+((I*J-K*L)*(I*J-K*L)+(K*F-J*E)*(K*F-J*E))));g[ba+(C<<4)>>2]=(I*J-K*L)*W;g[Y>>2]=(K*F-J*E)*W;g[Z>>2]=(L*E-I*F)*W;m=c[aa>>2]|0;g[m+(C*36|0)+20>>2]=(I*J-K*L)*W;c[m+(C*36|0)+24>>2]=c[Y>>2];c[m+(C*36|0)+28>>2]=c[Z>>2];g[m+(C*36|0)+32>>2]=1000000015047466219876688.0e6}else{m=ba+(C<<4)|0;c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;m=c[aa>>2]|0}i=c[m+(C*36|0)+4>>2]|0;if((i|0)>0){k=c[(c[d+52>>2]|0)+16>>2]|0;q=+g[ba+(C<<4)>>2];r=+g[ba+(C<<4)+4>>2];s=+g[ba+(C<<4)+8>>2];l=c[m+(C*36|0)+12>>2]|0;Z=c[l>>2]|0;p=+g[k+(Z<<4)>>2]*q+ +g[k+(Z<<4)+4>>2]*r+ +g[k+(Z<<4)+8>>2]*s;p=p<1000000015047466219876688.0e6?p:1000000015047466219876688.0e6;if((i|0)!=1){h=1;do{Z=c[l+(h<<2)>>2]|0;W=+g[k+(Z<<4)>>2]*q+ +g[k+(Z<<4)+4>>2]*r+ +g[k+(Z<<4)+8>>2]*s;p=p>W?W:p;h=h+1|0}while((h|0)<(i|0))}}else p=1000000015047466219876688.0e6;g[m+(C*36|0)+32>>2]=-p;C=C+1|0}while((C|0)!=(G|0))}i:do if((c[_>>2]|0)>0){h=0;m=0;l=0;i=0;n=0;while(1){do if((n|0)==(h|0)){h=(n|0)==0;k=h?1:n<<1;if((n|0)<(k|0)){if((k|0)!=0?(c[7182]=(c[7182]|0)+1,O=xb((k<<2|3)+16|0)|0,(O|0)!=0):0){c[(O+4+15&-16)+-4>>2]=O;l=O+4+15&-16}else l=0;if(h){if(!m){h=1;m=l;Q=l;i=l;break}}else{h=0;do{c[l+(h<<2)>>2]=c[m+(h<<2)>>2];h=h+1|0}while((h|0)!=(n|0))}if(!i){h=k;m=l;Q=l;i=l}else{c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=k;m=l;Q=l;i=l}}else{h=n;Q=l}}else Q=l;while(0);c[m+(n<<2)>>2]=n;n=n+1|0;if((n|0)>=(c[_>>2]|0))break;else l=Q}N=ia+84+12|0;O=ia+84+4|0;P=ia+48+12|0;h=n;while(1){o=h+-1|0;k=c[m+(o<<2)>>2]|0;c[7182]=(c[7182]|0)+1;i=xb(23)|0;if(!i)n=0;else{c[(i+4+15&-16)+-4>>2]=i;n=i+4+15&-16}c[n>>2]=k;l=c[aa>>2]|0;q=+g[l+(k*36|0)+20>>2];r=+g[l+(k*36|0)+24>>2];p=+g[l+(k*36|0)+28>>2];do if((h|0)>1){B=h+-2|0;f=1;i=n;A=1;h=o;o=n;v=n;while(1){z=c[m+(B<<2)>>2]|0;j:do if(q*+g[l+(z*36|0)+20>>2]+r*+g[l+(z*36|0)+24>>2]+p*+g[l+(z*36|0)+28>>2]>.9990000128746033){do if((A|0)==(f|0)){l=(f|0)==0?1:f<<1;if((f|0)>=(l|0)){l=f;y=o;break}do if(!l)n=0;else{c[7182]=(c[7182]|0)+1;k=xb((l<<2|3)+16|0)|0;if(!k){n=0;break}c[(k+4+15&-16)+-4>>2]=k;n=k+4+15&-16}while(0);if((f|0)>0){k=0;do{c[n+(k<<2)>>2]=c[i+(k<<2)>>2];k=k+1|0}while((k|0)!=(f|0));if(!v){i=n;y=n;v=n;break}}else if((i|0)==0|(v|0)==0){i=n;y=n;v=n;break}c[7183]=(c[7183]|0)+1;Hc(c[v+-4>>2]|0);i=n;y=n;v=n}else{l=f;y=o}while(0);c[i+(A<<2)>>2]=z;A=A+1|0;if((h|0)>0){k=0;while(1){n=m+(k<<2)|0;if((c[n>>2]|0)==(z|0))break;k=k+1|0;if((k|0)>=(h|0)){M=y;k=v;break j}}f=h+-1|0;o=m+(f<<2)|0;if((k|0)>=(h|0)){M=y;k=v;break}c[n>>2]=c[o>>2];c[o>>2]=z;h=f;M=y;k=v}else{M=y;k=v}}else{l=f;M=o;k=v}while(0);if((B|0)<=0)break;B=B+-1|0;f=l;o=M;l=c[aa>>2]|0;v=k}if((A|0)<=1)if((A|0)==1){k=M;A=1;ca=344;break}else{k=M;break}a[ia+84+16>>0]=1;c[N>>2]=0;c[O>>2]=0;c[ia+84+8>>2]=0;C=0;k=0;p=0.0;q=0.0;r=0.0;do{z=c[i+(C<<2)>>2]|0;B=c[aa>>2]|0;p=+g[B+(z*36|0)+20>>2]+p;q=+g[B+(z*36|0)+24>>2]+q;r=+g[B+(z*36|0)+28>>2]+r;l=c[B+(z*36|0)+4>>2]|0;if((l|0)>0){y=0;do{v=c[(c[B+(z*36|0)+12>>2]|0)+(y<<2)>>2]|0;Z=(c[(c[d+52>>2]|0)+16>>2]|0)+(v<<4)|0;c[ia>>2]=c[Z>>2];c[ia+4>>2]=c[Z+4>>2];c[ia+8>>2]=c[Z+8>>2];c[ia+12>>2]=c[Z+12>>2];k:do if((k|0)>0){o=c[N>>2]|0;n=0;while(1){if((c[o+(n*24|0)+20>>2]|0)==(v|0))break k;n=n+1|0;if((n|0)>=(k|0)){ca=224;break}}}else ca=224;while(0);if((ca|0)==224){ca=0;c[ia+48>>2]=c[ia>>2];c[ia+48+4>>2]=c[ia+4>>2];c[ia+48+8>>2]=c[ia+8>>2];c[ia+48+12>>2]=c[ia+12>>2];do if((k|0)==(c[ia+84+8>>2]|0)){f=(k|0)==0?1:k<<1;if((k|0)>=(f|0))break;if(!f)o=0;else{c[7182]=(c[7182]|0)+1;k=xb((f*24|3)+16|0)|0;if(!k)k=0;else{c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16}o=k;k=c[O>>2]|0}n=c[N>>2]|0;if((k|0)<=0){if(n)ca=234}else{l=0;do{ca=o+(l*24|0)|0;Z=n+(l*24|0)|0;c[ca>>2]=c[Z>>2];c[ca+4>>2]=c[Z+4>>2];c[ca+8>>2]=c[Z+8>>2];c[ca+12>>2]=c[Z+12>>2];c[ca+16>>2]=c[Z+16>>2];c[ca+20>>2]=c[Z+20>>2];l=l+1|0}while((l|0)!=(k|0));ca=234}if((ca|0)==234){ca=0;if(a[ia+84+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[n+-4>>2]|0);k=c[O>>2]|0}c[N>>2]=0}a[ia+84+16>>0]=1;c[N>>2]=o;c[ia+84+8>>2]=f}while(0);l=c[N>>2]|0;Z=l+(k*24|0)|0;c[Z>>2]=c[ia+48>>2];c[Z+4>>2]=c[ia+48+4>>2];c[Z+8>>2]=c[ia+48+8>>2];c[Z+12>>2]=c[ia+48+12>>2];c[Z+16>>2]=c[ia+48+16>>2];c[l+(k*24|0)+20>>2]=v;k=(c[O>>2]|0)+1|0;c[O>>2]=k;l=c[B+(z*36|0)+4>>2]|0}y=y+1|0}while((y|0)<(l|0))}C=C+1|0}while((C|0)!=(A|0));a[ia+48+16>>0]=1;c[P>>2]=0;c[ia+48+4>>2]=0;c[ia+48+8>>2]=0;Z=c[i>>2]|0;Y=c[aa>>2]|0;c[ia+48+20>>2]=c[Y+(Z*36|0)+20>>2];c[ia+48+24>>2]=c[Y+(Z*36|0)+24>>2];c[ia+48+28>>2]=c[Y+(Z*36|0)+28>>2];c[ia+48+32>>2]=c[Y+(Z*36|0)+32>>2];D=1.0/+x(+(p*p+q*q+r*r));F=p*D;E=q*D;D=r*D;if(+w(+D)>.7071067690849304){u=1.0/+x(+(D*D+E*E));s=0.0;t=E*u;u=-(D*u)}else{u=1.0/+x(+(F*F+E*E));s=-(E*u);t=0.0;u=F*u}o=c[O>>2]|0;do if((o|0)<2)if((o|0)==1){l=0;o=0;y=0;f=1;while(1){z=c[N>>2]|0;do if((l|0)==(o|0)){v=(o|0)==0?1:o<<1;if((o|0)>=(v|0)){v=o;k=y;n=o;break}do if(!v)k=0;else{c[7182]=(c[7182]|0)+1;k=xb((v*24|3)+16|0)|0;if(!k){k=0;o=l;break}c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16;o=l}while(0);if((o|0)<=0){if(y|0)ca=255}else{n=0;do{ca=k+(n*24|0)|0;Z=y+(n*24|0)|0;c[ca>>2]=c[Z>>2];c[ca+4>>2]=c[Z+4>>2];c[ca+8>>2]=c[Z+8>>2];c[ca+12>>2]=c[Z+12>>2];c[ca+16>>2]=c[Z+16>>2];c[ca+20>>2]=c[Z+20>>2];n=n+1|0}while((n|0)!=(o|0));ca=255}if((ca|0)==255){ca=0;c[7183]=(c[7183]|0)+1;Hc(c[y+-4>>2]|0)}n=l;f=c[O>>2]|0}else{v=o;k=y;n=l}while(0);Z=k+(n*24|0)|0;c[Z>>2]=c[z>>2];c[Z+4>>2]=c[z+4>>2];c[Z+8>>2]=c[z+8>>2];c[Z+12>>2]=c[z+12>>2];c[Z+16>>2]=c[z+16>>2];c[Z+20>>2]=c[z+20>>2];l=l+1|0;if((l|0)<(f|0)){o=v;y=k}else{ca=289;break}}}else{k=0;ca=331}else{n=c[N>>2]|0;k=0;do{l=n+(k*24|0)|0;if(s*+g[l>>2]+u*+g[n+(k*24|0)+4>>2]+t*+g[n+(k*24|0)+8>>2]>2]+u*+g[n+4>>2]+t*+g[n+8>>2]){c[ia>>2]=c[n>>2];c[ia+4>>2]=c[n+4>>2];c[ia+8>>2]=c[n+8>>2];c[ia+12>>2]=c[n+12>>2];c[ia+16>>2]=c[n+16>>2];c[ia+20>>2]=c[n+20>>2];c[n>>2]=c[l>>2];c[n+4>>2]=c[l+4>>2];c[n+8>>2]=c[l+8>>2];c[n+12>>2]=c[l+12>>2];c[n+16>>2]=c[l+16>>2];c[n+20>>2]=c[l+20>>2];ca=n+(k*24|0)|0;c[ca>>2]=c[ia>>2];c[ca+4>>2]=c[ia+4>>2];c[ca+8>>2]=c[ia+8>>2];c[ca+12>>2]=c[ia+12>>2];c[ca+16>>2]=c[ia+16>>2];c[ca+20>>2]=c[ia+20>>2]}k=k+1|0}while((k|0)<(o|0));g[n+16>>2]=-1000000015047466219876688.0e6;if((o|0)>1){p=+g[n>>2];q=+g[n+4>>2];r=+g[n+8>>2];k=1;do{K=+g[n+(k*24|0)>>2]-p;L=+g[n+(k*24|0)+4>>2]-q;W=+g[n+(k*24|0)+8>>2]-r;g[n+(k*24|0)+16>>2]=((s*L-u*K)*D+(F*(u*W-t*L)+E*(t*K-s*W)))/+x(+(K*K+L*L+W*W));k=k+1|0}while((k|0)!=(o|0))}c[ia>>2]=c[n>>2];c[ia+4>>2]=c[n+4>>2];c[ia+8>>2]=c[n+8>>2];c[ia+12>>2]=c[n+12>>2];Fe(ia+84|0,ia,1,o+-1|0);l=c[N>>2]|0;c[7182]=(c[7182]|0)+1;k=xb(43)|0;if(!k)n=0;else{c[(k+4+15&-16)+-4>>2]=k;n=k+4+15&-16}o=c[N>>2]|0;c[n>>2]=c[l>>2];c[n+4>>2]=c[l+4>>2];c[n+8>>2]=c[l+8>>2];c[n+12>>2]=c[l+12>>2];c[n+16>>2]=c[l+16>>2];c[n+20>>2]=c[l+20>>2];c[7182]=(c[7182]|0)+1;k=xb(67)|0;if(!k)k=0;else{c[(k+4+15&-16)+-4>>2]=k;k=k+4+15&-16}c[k>>2]=c[n>>2];c[k+4>>2]=c[n+4>>2];c[k+8>>2]=c[n+8>>2];c[k+12>>2]=c[n+12>>2];c[k+16>>2]=c[n+16>>2];c[k+20>>2]=c[n+20>>2];if(n|0){c[7183]=(c[7183]|0)+1;Hc(c[n+-4>>2]|0)}n=k+24|0;c[n>>2]=c[o+24>>2];c[n+4>>2]=c[o+24+4>>2];c[n+8>>2]=c[o+24+8>>2];c[n+12>>2]=c[o+24+12>>2];c[n+16>>2]=c[o+24+16>>2];c[n+20>>2]=c[o+24+20>>2];n=c[O>>2]|0;if((n|0)==2){l=2;ca=289;break}z=2;l=2;y=2;o=2;while(1){l:do if((o|0)>1){ca=c[N>>2]|0;v=ca+(z*24|0)|0;p=+g[v>>2];q=+g[ca+(z*24|0)+4>>2];r=+g[ca+(z*24|0)+8>>2];while(1){ca=o+-2|0;f=o+-1|0;K=+g[k+(ca*24|0)>>2];L=K-+g[k+(f*24|0)>>2];I=+g[k+(ca*24|0)+4>>2];u=I-+g[k+(f*24|0)+4>>2];W=+g[k+(ca*24|0)+8>>2];J=W-+g[k+(f*24|0)+8>>2];if((L*(I-q)-u*(K-p))*D+(F*(u*(W-r)-J*(I-q))+E*(J*(K-p)-L*(W-r)))>0.0)break;if((o|0)>2){l=f;o=f}else{l=f;f=y;o=1;break l}}do if((o|0)==(y|0)){f=y<<1;if((y|0)>=(f|0)){f=y;o=y;break}c[7182]=(c[7182]|0)+1;n=xb((y*48|3)+16|0)|0;if(!n)o=0;else{c[(n+4+15&-16)+-4>>2]=n;o=n+4+15&-16}if((l|0)>0){n=0;do{ca=o+(n*24|0)|0;Z=k+(n*24|0)|0;c[ca>>2]=c[Z>>2];c[ca+4>>2]=c[Z+4>>2];c[ca+8>>2]=c[Z+8>>2];c[ca+12>>2]=c[Z+12>>2];c[ca+16>>2]=c[Z+16>>2];c[ca+20>>2]=c[Z+20>>2];n=n+1|0}while((n|0)!=(l|0))}c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);n=c[O>>2]|0;k=o;o=l}else f=y;while(0);o=k+(o*24|0)|0;c[o>>2]=c[v>>2];c[o+4>>2]=c[v+4>>2];c[o+8>>2]=c[v+8>>2];c[o+12>>2]=c[v+12>>2];c[o+16>>2]=c[v+16>>2];c[o+20>>2]=c[v+20>>2];o=l+1|0;l=o}else f=y;while(0);z=z+1|0;if((z|0)==(n|0))break;else y=f}if((l|0)>0)ca=289;else ca=291}while(0);if((ca|0)==289){ca=0;H=0;o=c[ia+48+4>>2]|0;n=c[ia+48+8>>2]|0;y=a[ia+48+16>>0]|0;while(1){G=k+(H*24|0)+20|0;do if((o|0)==(n|0)){B=(n|0)==0?1:n<<1;if((n|0)>=(B|0)){C=y;o=n;B=n;break}do if(!B)v=0;else{c[7182]=(c[7182]|0)+1;o=xb((B<<2|3)+16|0)|0;if(!o){v=0;break}c[(o+4+15&-16)+-4>>2]=o;v=o+4+15&-16}while(0);f=c[P>>2]|0;if((n|0)<=0){if(f)ca=321}else{o=0;do{c[v+(o<<2)>>2]=c[f+(o<<2)>>2];o=o+1|0}while((o|0)!=(n|0));ca=321}if((ca|0)==321){ca=0;if(y<<24>>24){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[P>>2]=0;n=c[ia+48+4>>2]|0}c[P>>2]=v;c[ia+48+8>>2]=B;C=1;o=n}else{C=y;B=n}while(0);c[(c[P>>2]|0)+(o<<2)>>2]=c[G>>2];o=o+1|0;c[ia+48+4>>2]=o;n=c[O>>2]|0;m:do if((n|0)>0){z=c[N>>2]|0;v=c[G>>2]|0;f=0;while(1){y=z+(f*24|0)+20|0;f=f+1|0;if((c[y>>2]|0)==(v|0))break;if((f|0)>=(n|0))break m}c[y>>2]=-1}while(0);H=H+1|0;if((H|0)>=(l|0))break;else{n=B;y=C}}a[ia+48+16>>0]=C;ca=291}n:do if((ca|0)==291){ca=0;if((n|0)>0){z=c[N>>2]|0;B=c[_>>2]|0;C=c[aa>>2]|0;G=(A|0)>0;if((B|0)<=0){ca=331;break}y=0;while(1){H=c[z+(y*24|0)+20>>2]|0;o:do if((H|0)!=-1){if(!G){o=0;while(1){f=c[C+(o*36|0)+4>>2]|0;if((f|0)>0){v=c[C+(o*36|0)+12>>2]|0;l=0;do{if((c[v+(l<<2)>>2]|0)==(H|0)){l=1;break n}l=l+1|0}while((l|0)<(f|0))}o=o+1|0;if((o|0)>=(B|0))break o}}v=0;do{l=0;while(1){if((c[i+(l<<2)>>2]|0)==(v|0))break;l=l+1|0;if((l|0)>=(A|0)){ca=306;break}}do if((ca|0)==306){ca=0;o=c[C+(v*36|0)+4>>2]|0;if((o|0)<=0)break;f=c[C+(v*36|0)+12>>2]|0;l=0;do{if((c[f+(l<<2)>>2]|0)==(H|0)){l=1;break n}l=l+1|0}while((l|0)<(o|0))}while(0);v=v+1|0}while((v|0)<(B|0))}while(0);y=y+1|0;if((y|0)>=(n|0)){ca=331;break}}}else ca=331}while(0);if((ca|0)==331){ca=0;yg((c[d+52>>2]|0)+24|0,ia+48|0);l=0}if(k|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}k=c[P>>2]|0;if(k|0){if(a[ia+48+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[P>>2]=0}k=c[N>>2]|0;if(k|0){if(a[ia+84+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[N>>2]=0}if(l&(A|0)>0){k=M;ca=344}else k=M}else{k=n;i=n;A=1;h=o;ca=344}while(0);if((ca|0)==344){ca=0;v=0;do{y=c[i+(v<<2)>>2]|0;z=c[aa>>2]|0;a[ia+16>>0]=1;c[ia+12>>2]=0;c[ia+4>>2]=0;c[ia+8>>2]=0;f=c[z+(y*36|0)+4>>2]|0;if((f|0)>0){c[7182]=(c[7182]|0)+1;n=xb((f<<2|3)+16|0)|0;do if(!n){l=0;o=0}else{c[(n+4+15&-16)+-4>>2]=n;l=c[ia+12>>2]|0;if((l|0)==0|(a[ia+16>>0]|0)==0){l=n+4+15&-16;o=n+4+15&-16;break}c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0);l=n+4+15&-16;o=n+4+15&-16}while(0);a[ia+16>>0]=1;c[ia+12>>2]=l;c[ia+8>>2]=f;mk(l|0,0,f<<2|0)|0;c[ia+4>>2]=f;n=c[z+(y*36|0)+12>>2]|0;l=0;do{c[o+(l<<2)>>2]=c[n+(l<<2)>>2];l=l+1|0}while((l|0)!=(f|0));l=c[ia+12>>2]|0}else{c[ia+4>>2]=f;l=0}c[ia+20>>2]=c[z+(y*36|0)+20>>2];c[ia+20+4>>2]=c[z+(y*36|0)+20+4>>2];c[ia+20+8>>2]=c[z+(y*36|0)+20+8>>2];c[ia+20+12>>2]=c[z+(y*36|0)+20+12>>2];yg((c[d+52>>2]|0)+24|0,ia);if(l|0){if(a[ia+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}c[ia+12>>2]=0}v=v+1|0}while((v|0)<(A|0))}if(!((i|0)==0|(k|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}if(!h){Z=Q;Y=m;break i}}}else{Z=0;Y=0}while(0);X=c[d+52>>2]|0;c[X+64>>2]=0;c[X+64+4>>2]=0;c[X+64+8>>2]=0;c[X+64+12>>2]=0;h=c[X+28>>2]|0;if((h|0)>0){V=0;v=0;i=0;k=0;H=0;C=0;o=0;l=0;G=0;f=0;m=0;A=0;z=0;y=0;n=0;while(1){B=c[X+36>>2]|0;U=c[B+(V*36|0)+4>>2]|0;if((U|0)>0){T=V&65535;S=V|-65536;N=0;d=H;O=f;h=B;M=n;while(1){R=N+1|0;P=c[h+(V*36|0)+12>>2]|0;f=c[P+(N<<2)>>2]&65535;N=c[P+(((R|0)==(U|0)?0:R)<<2)>>2]&65535;P=N<<16>>16>f<<16>>16?f:N;Q=N<<16>>16>f<<16>>16?N:f;n=N<<16>>16>f<<16>>16?f:N;f=N<<16>>16>f<<16>>16?N:f;N=O+-1|0;p:do if((((n&65535)<<16)+(f<<16>>16)&N)>>>0>>0?(da=c[k+((((n&65535)<<16)+(f<<16>>16)&N)<<2)>>2]|0,(da|0)!=-1):0){h=da;while(1){if(f<<16>>16==(b[i+(h<<2)>>1]|0)?n<<16>>16==(b[i+(h<<2)+2>>1]|0):0)break;h=c[l+(h<<2)>>2]|0;if((h|0)==-1){H=0;break p}}H=m+(h<<2)|0}else H=0;while(0);h=c[X+16>>2]|0;u=+g[h+(n<<16>>16<<4)>>2]-+g[h+(f<<16>>16<<4)>>2];D=+g[h+(n<<16>>16<<4)+4>>2]-+g[h+(f<<16>>16<<4)+4>>2];s=+g[h+(n<<16>>16<<4)+8>>2]-+g[h+(f<<16>>16<<4)+8>>2];t=1.0/+x(+(u*u+D*D+s*s));h=c[X+48>>2]|0;q:do if((h|0)>0){f=c[X+56>>2]|0;n=0;while(1){p=+g[f+(n<<4)>>2];q=+g[f+(n<<4)+4>>2];r=+g[f+(n<<4)+8>>2];do if(!(+w(+(p-u*t))>1.0e-06)){if(+w(+(q-D*t))>1.0e-06)break;if(!(+w(+(r-s*t))>1.0e-06))break q}while(0);do if(!(+w(+(u*t+p))>1.0e-06)){if(+w(+(D*t+q))>1.0e-06)break;if(!(+w(+(s*t+r))>1.0e-06))break q}while(0);n=n+1|0;if((n|0)>=(h|0)){ca=387;break}}}else ca=387;while(0);if((ca|0)==387){ca=0;do if((h|0)==(c[X+52>>2]|0)){B=(h|0)==0?1:h<<1;if((h|0)>=(B|0))break;if(!B)f=0;else{c[7182]=(c[7182]|0)+1;h=xb((B<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}f=h;h=c[X+48>>2]|0}if((h|0)>0){n=0;do{ja=f+(n<<4)|0;ka=(c[X+56>>2]|0)+(n<<4)|0;c[ja>>2]=c[ka>>2];c[ja+4>>2]=c[ka+4>>2];c[ja+8>>2]=c[ka+8>>2];c[ja+12>>2]=c[ka+12>>2];n=n+1|0}while((n|0)!=(h|0))}h=c[X+56>>2]|0;if(h|0){if(a[X+60>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[X+56>>2]=0}a[X+60>>0]=1;c[X+56>>2]=f;c[X+52>>2]=B;h=c[X+48>>2]|0}while(0);ka=c[X+56>>2]|0;g[ka+(h<<4)>>2]=u*t;g[ka+(h<<4)+4>>2]=D*t;g[ka+(h<<4)+8>>2]=s*t;g[ka+(h<<4)+12>>2]=0.0;c[X+48>>2]=(c[X+48>>2]|0)+1}r:do if(!H){H=((P&65535)<<16)+(Q<<16>>16)&N;s:do if(H>>>0>>0){h=c[k+(H<<2)>>2]|0;if((h|0)==-1)break;while(1){if(Q<<16>>16==(b[i+(h<<2)>>1]|0)?P<<16>>16==(b[i+(h<<2)+2>>1]|0):0)break;h=c[l+(h<<2)>>2]|0;if((h|0)==-1)break s}B=m+(h<<2)|0;b[B>>1]=S;b[B+2>>1]=S>>>16;B=d;f=O;h=A;n=M;break r}while(0);do if((G|0)==(O|0)){f=(G|0)==0?1:G<<1;if((G|0)>=(f|0)){f=G;break}do if(!f)n=0;else{c[7182]=(c[7182]|0)+1;h=xb((f<<2|3)+16|0)|0;if(!h){n=0;break}c[(h+4+15&-16)+-4>>2]=h;n=h+4+15&-16}while(0);if((G|0)<=0){if(!m){m=n;break}}else{h=0;do{ka=n+(h<<2)|0;ja=m+(h<<2)|0;ja=e[ja>>1]|e[ja+2>>1]<<16;b[ka>>1]=ja;b[ka+2>>1]=ja>>>16;h=h+1|0}while((h|0)!=(G|0))}c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0);m=n}else f=O;while(0);N=m+(G<<2)|0;b[N>>1]=S;b[N+2>>1]=S>>>16;N=G+1|0;do if((z|0)==(v|0)){v=(z|0)==0?1:z<<1;if((z|0)>=(v|0)){v=z;break}do if(!v)n=0;else{c[7182]=(c[7182]|0)+1;h=xb((v<<2|3)+16|0)|0;if(!h){n=0;break}c[(h+4+15&-16)+-4>>2]=h;n=h+4+15&-16}while(0);if((z|0)<=0){if(!i){i=n;break}}else{h=0;do{ka=n+(h<<2)|0;ja=i+(h<<2)|0;ja=e[ja>>1]|e[ja+2>>1]<<16;b[ka>>1]=ja;b[ka+2>>1]=ja>>>16;h=h+1|0}while((h|0)!=(z|0))}c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);i=n}while(0);ka=i+(z<<2)|0;b[ka>>1]=(P&65535)<<16|Q&65535;b[ka+2>>1]=((P&65535)<<16|Q&65535)>>>16;z=z+1|0;if((O|0)<(f|0)){do if((d|0)<(f|0)){do if((A|0)<(f|0)){do if(!f)n=0;else{c[7182]=(c[7182]|0)+1;h=xb((f<<2|3)+16|0)|0;if(!h){n=0;break}c[(h+4+15&-16)+-4>>2]=h;n=h+4+15&-16}while(0);if((d|0)<=0){if(!k){k=n;H=f;M=n;break}}else{h=0;do{c[n+(h<<2)>>2]=c[k+(h<<2)>>2];h=h+1|0}while((h|0)!=(d|0))}c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);k=n;H=f;M=n}else H=A;while(0);A=f<<2;mk(k+(d<<2)|0,0,A-(d<<2)|0)|0;if((C|0)<(f|0)){do if((o|0)<(f|0)){do if(!f)n=0;else{c[7182]=(c[7182]|0)+1;h=xb((A|3)+16|0)|0;if(!h){n=0;break}c[(h+4+15&-16)+-4>>2]=h;n=h+4+15&-16}while(0);if((C|0)<=0){if(!l){o=f;l=n;h=n;break}}else{h=0;do{c[n+(h<<2)>>2]=c[l+(h<<2)>>2];h=h+1|0}while((h|0)!=(C|0))}c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0);o=f;l=n;h=n}else h=y;while(0);mk(l+(C<<2)|0,0,A-(C<<2)|0)|0;y=h}if((f|0)>0){mk(M|0,-1,A|0)|0;mk(y|0,-1,A|0)|0}if((d|0)<=0){B=f;C=f;h=H;n=M;break}n=f+-1|0;h=0;do{ka=k+(((e[i+(h<<2)+2>>1]<<16)+(b[i+(h<<2)>>1]|0)&n)<<2)|0;c[l+(h<<2)>>2]=c[ka>>2];c[ka>>2]=h;h=h+1|0}while((h|0)!=(d|0));B=f;C=f;h=H;n=M}else{B=d;h=A;n=M}while(0);H=((P&65535)<<16)+(Q<<16>>16)&f+-1}else{B=d;h=A;n=M}ka=k+(H<<2)|0;c[l+(G<<2)>>2]=c[ka>>2];c[ka>>2]=G;G=N}else{b[H+2>>1]=T;B=d;f=O;h=A;n=M}while(0);if((R|0)>=(U|0))break;N=R;d=B;O=f;A=h;h=c[X+36>>2]|0;M=n}A=h;h=c[X+28>>2]|0}else B=H;V=V+1|0;if((V|0)>=(h|0))break;else H=B}if((h|0)>0){z=c[X+36>>2]|0;A=c[X+16>>2]|0;y=0;p=0.0;do{o=c[z+(y*36|0)+4>>2]|0;f=c[z+(y*36|0)+12>>2]|0;v=c[f>>2]|0;if((o|0)>=3){n=1;q=+g[X+64>>2];r=+g[X+68>>2];s=+g[X+72>>2];do{ja=c[f+(n<<2)>>2]|0;n=n+1|0;ka=c[f+(((n|0)%(o|0)|0)<<2)>>2]|0;t=+g[A+(v<<4)>>2];u=+g[A+(ja<<4)>>2];E=+g[A+(v<<4)+4>>2];F=+g[A+(ja<<4)+4>>2];J=+g[A+(v<<4)+8>>2];K=+g[A+(ja<<4)+8>>2];D=+g[A+(ka<<4)>>2];I=+g[A+(ka<<4)+4>>2];L=+g[A+(ka<<4)+8>>2];W=+x(+(((t-u)*(E-I)-(E-F)*(t-D))*((t-u)*(E-I)-(E-F)*(t-D))+(((E-F)*(J-L)-(J-K)*(E-I))*((E-F)*(J-L)-(J-K)*(E-I))+((J-K)*(t-D)-(t-u)*(J-L))*((J-K)*(t-D)-(t-u)*(J-L)))))*.5;q=q+(t+u+D)*.3333333432674408*W;g[X+64>>2]=q;r=r+(E+F+I)*.3333333432674408*W;g[X+68>>2]=r;s=s+(J+K+L)*.3333333432674408*W;g[X+72>>2]=s;p=p+W}while((n|0)!=(o+-1|0))}y=y+1|0}while((y|0)!=(h|0));n=X+64|0;f=i;o=k;i=1}else ca=365}else{i=0;k=0;l=0;m=0;ca=365}if((ca|0)==365){p=0.0;n=X+64|0;f=i;o=k;i=0}s=1.0/p;t=s*+g[n>>2];g[n>>2]=t;r=s*+g[X+68>>2];g[X+68>>2]=r;s=s*+g[X+72>>2];g[X+72>>2]=s;g[X+96>>2]=3402823466385288598117041.0e14;if(i){k=c[X+36>>2]|0;i=0;q=3402823466385288598117041.0e14;while(1){p=+w(+(+g[k+(i*36|0)+32>>2]+(t*+g[k+(i*36|0)+20>>2]+r*+g[k+(i*36|0)+24>>2]+s*+g[k+(i*36|0)+28>>2])));if(p>2]=p;else p=q;i=i+1|0;if((i|0)==(h|0)){D=p;break}else q=p}}else D=3402823466385288598117041.0e14;i=c[X+8>>2]|0;if((i|0)>0){k=c[X+16>>2]|0;h=0;t=-3402823466385288598117041.0e14;u=-3402823466385288598117041.0e14;s=-3402823466385288598117041.0e14;r=3402823466385288598117041.0e14;q=3402823466385288598117041.0e14;p=3402823466385288598117041.0e14;do{W=+g[k+(h<<4)>>2];p=Ws?W:s;W=+g[k+(h<<4)+4>>2];q=Wu?W:u;W=+g[k+(h<<4)+8>>2];r=Wt?W:t;h=h+1|0}while((h|0)!=(i|0))}else{t=-3402823466385288598117041.0e14;u=-3402823466385288598117041.0e14;s=-3402823466385288598117041.0e14;r=3402823466385288598117041.0e14;q=3402823466385288598117041.0e14;p=3402823466385288598117041.0e14}g[X+100>>2]=p+s;g[X+104>>2]=q+u;g[X+108>>2]=r+t;g[X+112>>2]=0.0;W=s-p;q=u-q;p=t-r;g[X+116>>2]=W;g[X+120>>2]=q;g[X+124>>2]=p;g[X+128>>2]=0.0;r=D/1.7320507764816284;n=W>2]*.5-r)*.0009765625;g[X+88>>2]=r;g[X+84>>2]=r;g[X+80>>2]=r;q=+g[X+116+(n<<2)>>2]*.5;g[X+80+(n<<2)>>2]=q;h=0;while(1){if(qg(X)|0){ca=478;break}q=q-p;g[X+80+(n<<2)>>2]=q;h=h+1|0;if(h>>>0>=1024){ca=477;break}}t:do if((ca|0)==477){g[X+88>>2]=r;g[X+84>>2]=r;g[X+80>>2]=r}else if((ca|0)==478){p=(+g[X+96>>2]-r)*.0009765625;h=0;k=c[X+80+((1<<(1<>2]|0;while(1){i=c[X+80+((1<>2]|0;g[X+80+((1<>2]=p+(c[j>>2]=i,+g[j>>2]);q=p+ +g[X+80+((1<<(1<>2];g[X+80+((1<<(1<>2]=q;h=h+1|0;if(!(qg(X)|0))break;if(h>>>0>=1024)break t;else k=(g[j>>2]=q,c[j>>2]|0)}c[X+80+((1<>2]=i;c[X+80+((1<<(1<>2]=k}while(0);if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}if(m|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}if(l|0){c[7183]=(c[7183]|0)+1;Hc(c[l+-4>>2]|0)}if(o|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}if(!((Y|0)==0|(Z|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[Z+-4>>2]|0)}n=c[_>>2]|0;o=c[aa>>2]|0;if((n|0)<=0){if(o|0)ca=500}else{h=0;do{k=o+(h*36|0)+4|0;l=o+(h*36|0)+12|0;m=c[l>>2]|0;i=o+(h*36|0)+16|0;if(m|0){if(a[i>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[l>>2]=0}a[i>>0]=1;c[l>>2]=0;c[k>>2]=0;c[o+(h*36|0)+8>>2]=0;h=h+1|0}while((h|0)!=(n|0));ca=500}if((ca|0)==500){if(a[ia+104+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[o+-4>>2]|0)}c[aa>>2]=0}if(!((ba|0)==0|($|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[$+-4>>2]|0)}h=c[ea>>2]|0;if(h|0){if(a[ia+124+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[ea>>2]=0}a[ia+124+56>>0]=1;c[ea>>2]=0;c[ia+124+44>>2]=0;c[ia+124+48>>2]=0;h=c[fa>>2]|0;if(h|0){if(a[ia+124+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[fa>>2]=0}a[ia+124+36>>0]=1;c[fa>>2]=0;c[ia+124+24>>2]=0;c[ia+124+28>>2]=0;h=c[ga>>2]|0;if(h|0){if(a[ia+124+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[ga>>2]=0}if(!ha){sa=ia;return 1}c[7183]=(c[7183]|0)+1;Hc(c[ha+-4>>2]|0);sa=ia;return 1}function mb(b,d,e,f,h){b=b|0;d=d|0;e=e|0;f=f|0;h=h|0;var i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,y=0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0.0,J=0,K=0,L=0.0,M=0,N=0.0,O=0.0,P=0.0,Q=0.0,R=0,S=0,T=0,U=0.0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0.0,ka=0.0,la=0,ma=0.0,na=0.0,oa=0.0,pa=0,qa=0.0,ra=0,ta=0,ua=0,wa=0;wa=sa;sa=sa+688|0;i=c[b+20>>2]|0;if(!i){i=c[b+4>>2]|0;i=Ja[c[(c[i>>2]|0)+12>>2]&63](i,c[d+8>>2]|0,c[e+8>>2]|0)|0;c[b+20>>2]=i;a[b+16>>0]=1}c[h+4>>2]=i;ra=c[d+4>>2]|0;ta=c[e+4>>2]|0;j=c[ra+4>>2]|0;k=c[ta+4>>2]|0;if((j|0)==10&(k|0)==10){Q=+g[i+752>>2];pa=c[ra+52>>2]|0;s=+g[ra+28+(pa<<2)>>2];P=+g[ra+28+(((pa+2|0)%3|0)<<2)>>2];ua=c[ta+52>>2]|0;o=+g[ta+28+(ua<<2)>>2];O=+g[ta+28+(((ua+2|0)%3|0)<<2)>>2];b=c[d+12>>2]|0;d=c[e+12>>2]|0;D=+g[b+(pa<<2)>>2];F=+g[b+16+(pa<<2)>>2];E=+g[b+32+(pa<<2)>>2];n=+g[d+(ua<<2)>>2];p=+g[d+16+(ua<<2)>>2];r=+g[d+32+(ua<<2)>>2];I=+g[d+48>>2];L=+g[d+52>>2];N=+g[d+56>>2];v=I-+g[b+48>>2];B=L-+g[b+52>>2];C=N-+g[b+56>>2];l=1.0-(D*n+F*p+E*r)*(D*n+F*p+E*r);if(!(l==0.0)){l=(D*v+F*B+E*C-(D*n+F*p+E*r)*(n*v+p*B+r*C))/l;if(!(l<-s)){if(l>s)l=s}else l=-s}else l=0.0;m=(D*n+F*p+E*r)*l-(n*v+p*B+r*C);if(m<-o){l=(D*n+F*p+E*r)*-o+(D*v+F*B+E*C);if(!(l<-s))if(l>s){m=-o;l=s}else m=-o;else{m=-o;l=-s}}else if(m>o){l=o*(D*n+F*p+E*r)+(D*v+F*B+E*C);if(!(l<-s))if(l>s){m=o;l=s}else m=o;else{m=o;l=-s}}u=n*m;s=p*m;r=r*m;m=u+(v-D*l);o=s+(B-F*l);l=r+(C-E*l);p=+x(+(l*l+(m*m+o*o)));if(!(p-P-O>Q)){do if(l*l+(m*m+o*o)<=1.4210854715202004e-14)if(+w(+E)>.7071067690849304){l=1.0/+x(+(F*F+E*E));g[wa+280>>2]=0.0;g[wa+280+4>>2]=-(E*l);g[wa+280+8>>2]=F*l;n=0.0;m=-(E*l);l=F*l;break}else{m=1.0/+x(+(D*D+F*F));g[wa+280>>2]=-(F*m);g[wa+280+4>>2]=D*m;g[wa+280+8>>2]=0.0;n=-(F*m);m=D*m;l=0.0;break}else{g[wa+280>>2]=m*-(1.0/p);g[wa+280+4>>2]=o*-(1.0/p);g[wa+280+8>>2]=l*-(1.0/p);g[wa+280+12>>2]=0.0;n=m*-(1.0/p);m=o*-(1.0/p);l=l*-(1.0/p)}while(0);g[wa+264>>2]=I+u+O*n;g[wa+264+4>>2]=L+s+O*m;g[wa+264+8>>2]=N+r+O*l;g[wa+264+12>>2]=0.0}if(p-P-O>2]|0)+16>>2]&15](h,wa+280|0,wa+264|0,p-P-O);i=c[h+4>>2]|0;if(!(c[i+748>>2]|0)){sa=wa;return}j=c[i+740>>2]|0;k=c[(c[h+8>>2]|0)+8>>2]|0;if((j|0)==(k|0)){re(i,j+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);sa=wa;return}else{re(i,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,k+4|0);sa=wa;return}}g[wa+128+128>>2]=999999984306749440.0;i=c[b+8>>2]|0;t=c[b+12>>2]|0;c[wa+48>>2]=12116;c[wa+48+4>>2]=0;c[wa+48+8>>2]=1065353216;c[wa+48+12>>2]=0;g[wa+48+16>>2]=0.0;c[wa+48+20>>2]=t;c[wa+48+24>>2]=i;c[wa+48+28>>2]=ra;c[wa+48+32>>2]=ta;c[wa+48+36>>2]=j;c[wa+48+40>>2]=k;g[wa+48+44>>2]=+va[c[(c[ra>>2]|0)+48>>2]&15](ra);g[wa+48+48>>2]=+va[c[(c[ta>>2]|0)+48>>2]&15](ta);a[wa+48+52>>0]=0;c[wa+48+60>>2]=-1;c[wa+48+72>>2]=1;c[wa+48+76>>2]=1;c[wa+48+28>>2]=ra;c[wa+48+32>>2]=ta;oa=+va[c[(c[ra>>2]|0)+48>>2]&15](ra);qa=+va[c[(c[ta>>2]|0)+48>>2]&15](ta);qa=oa+qa+ +g[(c[b+20>>2]|0)+752>>2];g[wa+128+128>>2]=qa*qa;i=c[d+12>>2]|0;c[wa+128>>2]=c[i>>2];c[wa+128+4>>2]=c[i+4>>2];c[wa+128+8>>2]=c[i+8>>2];c[wa+128+12>>2]=c[i+12>>2];k=wa+128+16|0;c[k>>2]=c[i+16>>2];c[k+4>>2]=c[i+16+4>>2];c[k+8>>2]=c[i+16+8>>2];c[k+12>>2]=c[i+16+12>>2];t=wa+128+32|0;c[t>>2]=c[i+32>>2];c[t+4>>2]=c[i+32+4>>2];c[t+8>>2]=c[i+32+8>>2];c[t+12>>2]=c[i+32+12>>2];y=wa+128+48|0;c[y>>2]=c[i+48>>2];c[y+4>>2]=c[i+48+4>>2];c[y+8>>2]=c[i+48+8>>2];c[y+12>>2]=c[i+48+12>>2];i=c[e+12>>2]|0;G=wa+128+64|0;c[G>>2]=c[i>>2];c[G+4>>2]=c[i+4>>2];c[G+8>>2]=c[i+8>>2];c[G+12>>2]=c[i+12>>2];H=wa+128+80|0;c[H>>2]=c[i+16>>2];c[H+4>>2]=c[i+16+4>>2];c[H+8>>2]=c[i+16+8>>2];c[H+12>>2]=c[i+16+12>>2];J=wa+128+96|0;c[J>>2]=c[i+32>>2];c[J+4>>2]=c[i+32+4>>2];c[J+8>>2]=c[i+32+8>>2];c[J+12>>2]=c[i+32+12>>2];K=wa+128+112|0;c[K>>2]=c[i+48>>2];c[K+4>>2]=c[i+48+4>>2];c[K+8>>2]=c[i+48+8>>2];c[K+12>>2]=c[i+48+12>>2];i=c[ra+4>>2]|0;if((i|0)<7?(q=c[ta+4>>2]|0,(q|0)<7):0){c[wa+40>>2]=8888;if(!i){i=q;m=0.0}else{m=+va[c[(c[ra>>2]|0)+48>>2]&15](ra);i=c[ta+4>>2]|0}if(!i)l=0.0;else l=+va[c[(c[ta>>2]|0)+48>>2]&15](ta);c[wa>>2]=8916;c[wa+4>>2]=h;g[wa+24>>2]=m;g[wa+28>>2]=l;a[wa+36>>0]=0;T=c[ra+52>>2]|0;a:do if(T|0){la=c[ta+52>>2]|0;do if(!la){if((c[ta+4>>2]|0)!=1)break a;y=wa+624+16|0;a[y>>0]=1;G=wa+624+12|0;c[G>>2]=0;t=wa+624+4|0;c[t>>2]=0;q=wa+624+8|0;c[q>>2]=0;i=c[e+12>>2]|0;oa=+g[ta+56>>2];qa=+g[ta+56+4>>2];m=+g[ta+56+8>>2];n=oa*+g[i>>2]+qa*+g[i+4>>2]+m*+g[i+8>>2]+ +g[i+48>>2];l=oa*+g[i+16>>2]+qa*+g[i+20>>2]+m*+g[i+24>>2]+ +g[i+52>>2];m=oa*+g[i+32>>2]+qa*+g[i+36>>2]+m*+g[i+40>>2]+ +g[i+56>>2];c[7182]=(c[7182]|0)+1;i=xb(35)|0;if(!i)j=0;else{c[(i+4+15&-16)+-4>>2]=i;j=i+4+15&-16}i=c[G>>2]|0;if(!i)i=0;else{c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);i=c[t>>2]|0;c[G>>2]=0}a[y>>0]=1;c[G>>2]=j;c[q>>2]=1;g[j+(i<<4)>>2]=n;g[j+(i<<4)+4>>2]=l;g[j+(i<<4)+8>>2]=m;g[j+(i<<4)+12>>2]=0.0;i=(c[t>>2]|0)+1|0;c[t>>2]=i;ua=c[e+12>>2]|0;oa=+g[ta+56+16>>2];qa=+g[ta+56+20>>2];n=+g[ta+56+24>>2];l=oa*+g[ua>>2]+qa*+g[ua+4>>2]+n*+g[ua+8>>2]+ +g[ua+48>>2];m=oa*+g[ua+16>>2]+qa*+g[ua+20>>2]+n*+g[ua+24>>2]+ +g[ua+52>>2];n=oa*+g[ua+32>>2]+qa*+g[ua+36>>2]+n*+g[ua+40>>2]+ +g[ua+56>>2];if((i|0)==(c[q>>2]|0)?(M=(i|0)==0?1:i<<1,(i|0)<(M|0)):0){if(!M)k=0;else{c[7182]=(c[7182]|0)+1;i=xb((M<<4|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}k=i;i=c[t>>2]|0}if((i|0)>0){j=0;do{ua=k+(j<<4)|0;pa=(c[G>>2]|0)+(j<<4)|0;c[ua>>2]=c[pa>>2];c[ua+4>>2]=c[pa+4>>2];c[ua+8>>2]=c[pa+8>>2];c[ua+12>>2]=c[pa+12>>2];j=j+1|0}while((j|0)!=(i|0))}i=c[G>>2]|0;if(i|0){if(a[y>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[G>>2]=0}a[y>>0]=1;c[G>>2]=k;c[q>>2]=M;i=c[t>>2]|0}ua=c[G>>2]|0;g[ua+(i<<4)>>2]=l;g[ua+(i<<4)+4>>2]=m;g[ua+(i<<4)+8>>2]=n;g[ua+(i<<4)+12>>2]=0.0;i=(c[t>>2]|0)+1|0;c[t>>2]=i;ua=c[e+12>>2]|0;oa=+g[ta+56+32>>2];qa=+g[ta+56+36>>2];n=+g[ta+56+40>>2];l=oa*+g[ua>>2]+qa*+g[ua+4>>2]+n*+g[ua+8>>2]+ +g[ua+48>>2];m=oa*+g[ua+16>>2]+qa*+g[ua+20>>2]+n*+g[ua+24>>2]+ +g[ua+52>>2];n=oa*+g[ua+32>>2]+qa*+g[ua+36>>2]+n*+g[ua+40>>2]+ +g[ua+56>>2];if((i|0)==(c[q>>2]|0)?(R=(i|0)==0?1:i<<1,(i|0)<(R|0)):0){if(!R)k=0;else{c[7182]=(c[7182]|0)+1;i=xb((R<<4|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}k=i;i=c[t>>2]|0}if((i|0)>0){j=0;do{ua=k+(j<<4)|0;e=(c[G>>2]|0)+(j<<4)|0;c[ua>>2]=c[e>>2];c[ua+4>>2]=c[e+4>>2];c[ua+8>>2]=c[e+8>>2];c[ua+12>>2]=c[e+12>>2];j=j+1|0}while((j|0)!=(i|0))}i=c[G>>2]|0;if(i|0){if(a[y>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[G>>2]=0}a[y>>0]=1;c[G>>2]=k;c[q>>2]=R;i=c[t>>2]|0}ua=c[G>>2]|0;g[ua+(i<<4)>>2]=l;g[ua+(i<<4)+4>>2]=m;g[ua+(i<<4)+8>>2]=n;g[ua+(i<<4)+12>>2]=0.0;c[t>>2]=(c[t>>2]|0)+1;o=+g[(c[b+20>>2]|0)+752>>2];Ub(wa+48|0,wa+128|0,wa+40|0,c[f+20>>2]|0,0);l=+g[wa+48+4>>2];m=+g[wa+48+8>>2];n=+g[wa+48+12>>2];if(l*l+m*m+n*n>1.1920928955078125e-07){oa=1.0/(l*l+m*m+n*n);g[wa+384>>2]=l*oa;g[wa+384+4>>2]=m*oa;g[wa+384+8>>2]=n*oa;g[wa+384+12>>2]=0.0;oa=+g[wa+48+56>>2];qa=+va[c[(c[ra>>2]|0)+48>>2]&15](ra);qa=oa-qa-+va[c[(c[ta>>2]|0)+48>>2]&15](ta);Tb(wa+384|0,c[ra+52>>2]|0,c[d+12>>2]|0,wa+624|0,qa-o,o,h)}do if(a[b+16>>0]|0?(S=c[h+4>>2]|0,c[S+748>>2]|0):0){i=c[S+740>>2]|0;j=c[(c[h+8>>2]|0)+8>>2]|0;if((i|0)==(j|0)){re(S,i+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(S,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,j+4|0);break}}while(0);i=c[G>>2]|0;if(i|0){if(a[y>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[G>>2]=0}}else{qa=+g[(c[b+20>>2]|0)+752>>2];b:do if(!(a[f+24>>0]|0)){Ub(wa+48|0,wa+128|0,wa,c[f+20>>2]|0,0);l=+g[wa+32>>2];if(l<0.0&(a[wa+36>>0]|0)!=0){m=+g[wa+8>>2];n=+g[wa+12>>2];o=+g[wa+16>>2];i=c[wa+20>>2]|0;pa=112}}else{G=c[d+12>>2]|0;H=c[e+12>>2]|0;c[7165]=(c[7165]|0)+1;ga=+g[T+64>>2];ha=+g[T+68>>2];p=+g[G+4>>2];ia=+g[T+72>>2];r=+g[G+8>>2];u=+g[G+16>>2];B=+g[G+20>>2];D=+g[G+24>>2];E=+g[G+32>>2];C=+g[G+36>>2];v=+g[G+40>>2];ja=+g[la+64>>2];ka=+g[la+68>>2];oa=+g[la+72>>2];ma=ga*+g[G>>2]+ha*p+ia*r+ +g[G+48>>2]-(ja*+g[H>>2]+ka*+g[H+4>>2]+oa*+g[H+8>>2]+ +g[H+48>>2]);na=ga*u+ha*B+ia*D+ +g[G+52>>2]-(ja*+g[H+16>>2]+ka*+g[H+20>>2]+oa*+g[H+24>>2]+ +g[H+52>>2]);oa=ga*E+ha*C+ia*v+ +g[G+56>>2]-(ja*+g[H+32>>2]+ka*+g[H+36>>2]+oa*+g[H+40>>2]+ +g[H+56>>2]);k=c[T+28>>2]|0;c:do if((k|0)>0){l=3402823466385288598117041.0e14;i=0;s=0.0;m=0.0;n=0.0;o=0.0;F=u;while(1){f=c[T+36>>2]|0;ia=+g[f+(i*36|0)+20>>2];ja=+g[f+(i*36|0)+24>>2];ka=+g[f+(i*36|0)+28>>2];u=ia*+g[G>>2]+ja*p+ka*r;r=ia*F+ja*B+ka*D;p=ia*E+ja*C+ka*v;g[wa+296>>2]=u;g[wa+296+4>>2]=r;g[wa+296+8>>2]=p;g[wa+296+12>>2]=0.0;if(u*ma+r*na+p*oa<0.0){g[wa+296>>2]=-u;g[wa+296+4>>2]=-r;g[wa+296+8>>2]=-p;D=-u;r=-r;p=-p}else D=u;c[7163]=(c[7163]|0)+1;if(Vh(G,H,ma,na,oa,D,r,p,T,la,l)|0){c[7164]=(c[7164]|0)+1;rg(T,G,wa+296|0,wa+624|0,wa+384|0,wa+360|0,wa+344|0);rg(la,H,wa+296|0,wa+380|0,wa+376|0,wa+328|0,wa+312|0);u=+g[wa+384>>2];v=+g[wa+380>>2];do if(u>2];C=+g[wa+624>>2];if(B=(k|0))break c;p=+g[G+4>>2];r=+g[G+8>>2];F=+g[G+16>>2];B=+g[G+20>>2];D=+g[G+24>>2];E=+g[G+32>>2];C=+g[G+36>>2];v=+g[G+40>>2]}break b}else{l=3402823466385288598117041.0e14;m=0.0;n=0.0;o=0.0}while(0);k=c[la+28>>2]|0;d:do if((k|0)>0){j=0;u=0.0;while(1){f=c[la+36>>2]|0;ja=+g[f+(j*36|0)+20>>2];ka=+g[f+(j*36|0)+24>>2];s=+g[f+(j*36|0)+28>>2];p=ja*+g[H>>2]+ka*+g[H+4>>2]+s*+g[H+8>>2];r=ja*+g[H+16>>2]+ka*+g[H+20>>2]+s*+g[H+24>>2];s=ja*+g[H+32>>2]+ka*+g[H+36>>2]+s*+g[H+40>>2];g[wa+296>>2]=p;g[wa+296+4>>2]=r;g[wa+296+8>>2]=s;g[wa+296+12>>2]=0.0;if(p*ma+r*na+s*oa<0.0){g[wa+296>>2]=-p;g[wa+296+4>>2]=-r;g[wa+296+8>>2]=-s;p=-p;r=-r;s=-s}c[7163]=(c[7163]|0)+1;if(Vh(G,H,ma,na,oa,p,r,s,T,la,l)|0){c[7164]=(c[7164]|0)+1;rg(T,G,wa+296|0,wa+624|0,wa+384|0,wa+360|0,wa+344|0);rg(la,H,wa+296|0,wa+380|0,wa+376|0,wa+328|0,wa+312|0);v=+g[wa+384>>2];B=+g[wa+380>>2];do if(v>2];D=+g[wa+624>>2];if(C=(k|0))break d}break b}while(0);k=c[T+48>>2]|0;e:do if((k|0)>0){y=0;j=-1;i=-1;s=0.0;C=0.0;U=0.0;V=0.0;D=0.0;E=0.0;Q=0.0;P=0.0;r=0.0;B=0.0;O=0.0;p=0.0;v=0.0;L=0.0;N=0.0;W=0.0;u=0.0;F=0.0;I=0.0;q=c[la+48>>2]|0;f:while(1){f=c[T+56>>2]|0;ga=+g[f+(y<<4)>>2];ha=+g[f+(y<<4)+4>>2];ka=+g[f+(y<<4)+8>>2];ia=ga*+g[G>>2]+ha*+g[G+4>>2]+ka*+g[G+8>>2];ja=ga*+g[G+16>>2]+ha*+g[G+20>>2]+ka*+g[G+24>>2];ka=ga*+g[G+32>>2]+ha*+g[G+36>>2]+ka*+g[G+40>>2];if((q|0)>0){t=0;ga=s;ha=m;Y=C;aa=D;ba=E;fa=n;ea=o;da=W;while(1){f=c[la+56>>2]|0;_=+g[f+(t<<4)>>2];ca=+g[f+(t<<4)+4>>2];$=+g[f+(t<<4)+8>>2];W=_*+g[H>>2]+ca*+g[H+4>>2]+$*+g[H+8>>2];X=_*+g[H+16>>2]+ca*+g[H+20>>2]+$*+g[H+24>>2];$=_*+g[H+32>>2]+ca*+g[H+36>>2]+$*+g[H+40>>2];g[wa+296>>2]=ja*$-ka*X;g[wa+296+4>>2]=ka*W-ia*$;g[wa+296+8>>2]=ia*X-ja*W;g[wa+296+12>>2]=0.0;do if(!(+w(+(ja*$-ka*X))>1.0e-06)){if(+w(+(ka*W-ia*$))>1.0e-06){pa=76;break}if(!(+w(+(ia*X-ja*W))>1.0e-06)){s=ga;m=ha;Z=U;_=V;ca=Q;n=fa;o=ea;W=da}else pa=76}else pa=76;while(0);do if((pa|0)==76){pa=0;o=1.0/+x(+((ia*X-ja*W)*(ia*X-ja*W)+((ja*$-ka*X)*(ja*$-ka*X)+(ka*W-ia*$)*(ka*W-ia*$))));m=(ja*$-ka*X)*o;g[wa+296>>2]=m;n=(ka*W-ia*$)*o;g[wa+296+4>>2]=n;o=(ia*X-ja*W)*o;g[wa+296+8>>2]=o;if(m*ma+n*na+oa*o<0.0){g[wa+296>>2]=-m;g[wa+296+4>>2]=-n;g[wa+296+8>>2]=-o;m=-m;n=-n;o=-o}c[7163]=(c[7163]|0)+1;if(!(Vh(G,H,ma,na,oa,m,n,o,T,la,l)|0)){s=ga;m=ha;Z=U;_=V;ca=Q;n=fa;o=ea;W=da;break}c[7164]=(c[7164]|0)+1;rg(T,G,wa+296|0,wa+624|0,wa+384|0,wa+360|0,wa+344|0);rg(la,H,wa+296|0,wa+380|0,wa+376|0,wa+328|0,wa+312|0);s=+g[wa+384>>2];C=+g[wa+380>>2];do if(!(s>2];E=+g[wa+624>>2];if(D>2];U=+g[wa+328+4>>2];V=+g[wa+328+8>>2];C=+g[wa+344>>2];E=+g[wa+344+4>>2];Q=+g[wa+344+8>>2];break}else{k=1;s=D-E;D=+g[wa+312>>2];U=+g[wa+312+4>>2];V=+g[wa+312+8>>2];C=+g[wa+360>>2];E=+g[wa+360+4>>2];Q=+g[wa+360+8>>2];break}}else{k=0;s=ga;D=Y;C=aa;E=ba}while(0);if(!k)break f;if(!(s>2]|0;if((t|0)>=(q|0))break;else{ga=s;ha=m;U=Z;V=_;Q=ca;fa=n;ea=o;da=W}}C=Y;U=Z;V=_;D=aa;E=ba;Q=ca;k=c[T+48>>2]|0}y=y+1|0;if((y|0)>=(k|0)){l=W;break e}}break b}else{j=-1;i=-1;P=0.0;r=0.0;B=0.0;O=0.0;p=0.0;v=0.0;L=0.0;N=0.0;l=0.0;u=0.0;F=0.0;I=0.0}while(0);if((j|i|0)>-1){C=P-r;D=N-p;E=I-l;r=B*O+v*L+u*F;s=C*O+D*L+E*F;l=C*B+D*v+E*u;do if(1.0-r*r==0.0)p=0.0;else{if((s-l*r)/(1.0-r*r)<-1000000015047466219876688.0e6){p=-1000000015047466219876688.0e6;break}if(!((s-l*r)/(1.0-r*r)>1000000015047466219876688.0e6)){p=(s-l*r)/(1.0-r*r);break}p=1000000015047466219876688.0e6}while(0);l=r*p-l;do if(l<-1000000015047466219876688.0e6){if(s-r*1000000015047466219876688.0e6<-1000000015047466219876688.0e6){l=-1000000015047466219876688.0e6;p=-1000000015047466219876688.0e6;break}if(!(s-r*1000000015047466219876688.0e6>1000000015047466219876688.0e6)){l=-1000000015047466219876688.0e6;p=s-r*1000000015047466219876688.0e6;break}l=-1000000015047466219876688.0e6;p=1000000015047466219876688.0e6}else{if(!(l>1000000015047466219876688.0e6))break;if(s+r*1000000015047466219876688.0e6<-1000000015047466219876688.0e6){l=1000000015047466219876688.0e6;p=-1000000015047466219876688.0e6;break}if(!(s+r*1000000015047466219876688.0e6>1000000015047466219876688.0e6)){l=1000000015047466219876688.0e6;p=s+r*1000000015047466219876688.0e6;break}l=1000000015047466219876688.0e6;p=1000000015047466219876688.0e6}while(0);B=B*l;v=v*l;u=u*l;s=B+(C-O*p);r=v+(D-L*p);l=u+(E-F*p);g[wa+624>>2]=s;g[wa+624+4>>2]=r;g[wa+624+8>>2]=l;g[wa+624+12>>2]=0.0;if(l*l+(s*s+r*r)>1.1920928955078125e-07){p=+x(+(l*l+(s*s+r*r)));g[wa+624>>2]=s*(1.0/p);g[wa+624+4>>2]=r*(1.0/p);g[wa+624+8>>2]=l*(1.0/p);if(s*(1.0/p)*ma+r*(1.0/p)*na+l*(1.0/p)*oa<0.0){g[wa+624>>2]=-(s*(1.0/p));g[wa+624+4>>2]=-(r*(1.0/p));g[wa+624+8>>2]=-(l*(1.0/p))}g[wa+384>>2]=P+B;g[wa+384+4>>2]=N+v;g[wa+384+8>>2]=I+u;g[wa+384+12>>2]=0.0;_a[c[(c[h>>2]|0)+16>>2]&15](h,wa+624|0,wa+384|0,-p)}}if(ma*m+na*n+oa*o<0.0){l=-1000000015047466219876688.0e6;m=-m;n=-n;o=-o;i=0;pa=112}else{l=-1000000015047466219876688.0e6;i=0;pa=112}}while(0);if((pa|0)==112){T=c[ra+52>>2]|0;f=c[ta+52>>2]|0;S=c[d+12>>2]|0;R=c[e+12>>2]|0;N=l-qa;F=1.0/+x(+(m*m+n*n+o*o));L=m*F;I=n*F;F=o*F;g[wa+624>>2]=L;g[wa+624+4>>2]=I;g[wa+624+8>>2]=F;c[wa+624+12>>2]=i;k=c[f+28>>2]|0;t=c[f+36>>2]|0;if((k|0)>0){m=+g[R>>2];n=+g[R+4>>2];o=+g[R+8>>2];p=+g[R+16>>2];r=+g[R+20>>2];s=+g[R+24>>2];u=+g[R+32>>2];v=+g[R+36>>2];B=+g[R+40>>2];l=-3402823466385288598117041.0e14;j=0;i=-1;while(1){C=+g[t+(j*36|0)+20>>2];D=+g[t+(j*36|0)+24>>2];E=+g[t+(j*36|0)+28>>2];q=L*(C*m+D*n+E*o)+I*(C*p+D*r+E*s)+F*(C*u+D*v+E*B)>l;i=q?j:i;j=j+1|0;if((j|0)==(k|0)){H=i;break}else l=q?L*(C*m+D*n+E*o)+I*(C*p+D*r+E*s)+F*(C*u+D*v+E*B):l}}else H=-1;a[wa+384+16>>0]=1;M=wa+384+12|0;c[M>>2]=0;J=wa+384+4|0;c[J>>2]=0;c[wa+384+8>>2]=0;K=c[t+(H*36|0)+4>>2]|0;g:do if((K|0)>0){G=t+(H*36|0)+12|0;i=0;j=0;k=0;while(1){d=c[(c[G>>2]|0)+(i<<2)>>2]|0;e=c[f+16>>2]|0;na=+g[e+(d<<4)>>2];oa=+g[e+(d<<4)+4>>2];n=+g[e+(d<<4)+8>>2];l=na*+g[R>>2]+oa*+g[R+4>>2]+n*+g[R+8>>2]+ +g[R+48>>2];m=na*+g[R+16>>2]+oa*+g[R+20>>2]+n*+g[R+24>>2]+ +g[R+52>>2];n=na*+g[R+32>>2]+oa*+g[R+36>>2]+n*+g[R+40>>2]+ +g[R+56>>2];if((j|0)==(k|0)){y=(k|0)==0?1:k<<1;if((k|0)<(y|0)){if(!y){t=0;j=k}else{c[7182]=(c[7182]|0)+1;j=xb((y<<4|3)+16|0)|0;if(!j)j=0;else{c[(j+4+15&-16)+-4>>2]=j;j=j+4+15&-16}t=j;j=c[J>>2]|0}q=c[M>>2]|0;if((j|0)<=0){if(q)pa=128}else{k=0;do{d=t+(k<<4)|0;e=q+(k<<4)|0;c[d>>2]=c[e>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];c[d+12>>2]=c[e+12>>2];k=k+1|0}while((k|0)!=(j|0));pa=128}if((pa|0)==128){pa=0;if(a[wa+384+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[q+-4>>2]|0);j=c[J>>2]|0}c[M>>2]=0}a[wa+384+16>>0]=1;c[M>>2]=t;c[wa+384+8>>2]=y}else j=k}d=c[M>>2]|0;g[d+(j<<4)>>2]=l;g[d+(j<<4)+4>>2]=m;g[d+(j<<4)+8>>2]=n;g[d+(j<<4)+12>>2]=0.0;j=(c[J>>2]|0)+1|0;c[J>>2]=j;i=i+1|0;if((i|0)>=(K|0))break g;k=c[wa+384+8>>2]|0}}while(0);if((H|0)>-1)Tb(wa+624|0,T,S,wa+384|0,N,qa,h);i=c[M>>2]|0;if(i|0){if(a[wa+384+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[M>>2]=0}}if(a[b+16>>0]|0?(ua=c[h+4>>2]|0,c[ua+748>>2]|0):0){i=c[ua+740>>2]|0;j=c[(c[h+8>>2]|0)+8>>2]|0;if((i|0)==(j|0)){re(ua,i+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);break}else{re(ua,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,j+4|0);break}}}while(0);sa=wa;return}while(0)}Ub(wa+48|0,wa+128|0,h,c[f+20>>2]|0,0);if((c[b+28>>2]|0?(c[(c[h+4>>2]|0)+748>>2]|0)<(c[b+32>>2]|0):0)?(F=+g[wa+48+4>>2],I=+g[wa+48+8>>2],L=+g[wa+48+12>>2],F*F+I*I+L*L>1.1920928955078125e-07):0){E=1.0/(F*F+I*I+L*L);if(+w(+(L*E))>.7071067690849304){n=1.0/+x(+(L*E*L*E+I*E*I*E));m=0.0;o=I*E*n;n=-(L*E*n)}else{n=1.0/+x(+(F*E*F*E+I*E*I*E));m=-(I*E*n);o=0.0;n=F*E*n}D=+va[c[(c[ra>>2]|0)+16>>2]&15](ra);B=+va[c[(c[ta>>2]|0)+16>>2]&15](ta);l=.019999999552965164/(D>2]=c[wa+128>>2];c[wa+624+4>>2]=c[wa+128+4>>2];c[wa+624+8>>2]=c[wa+128+8>>2];c[wa+624+12>>2]=c[wa+128+12>>2];c[wa+624+16>>2]=c[k>>2];c[wa+624+16+4>>2]=c[k+4>>2];c[wa+624+16+8>>2]=c[k+8>>2];c[wa+624+16+12>>2]=c[k+12>>2];c[wa+624+32>>2]=c[t>>2];c[wa+624+32+4>>2]=c[t+4>>2];c[wa+624+32+8>>2]=c[t+8>>2];c[wa+624+32+12>>2]=c[t+12>>2];c[wa+624+48>>2]=c[y>>2];c[wa+624+48+4>>2]=c[y+4>>2];c[wa+624+48+8>>2]=c[y+8>>2];c[wa+624+48+12>>2]=c[y+12>>2]}else{c[wa+624>>2]=c[G>>2];c[wa+624+4>>2]=c[G+4>>2];c[wa+624+8>>2]=c[G+8>>2];c[wa+624+12>>2]=c[G+12>>2];c[wa+624+16>>2]=c[H>>2];c[wa+624+16+4>>2]=c[H+4>>2];c[wa+624+16+8>>2]=c[H+8>>2];c[wa+624+16+12>>2]=c[H+12>>2];c[wa+624+32>>2]=c[J>>2];c[wa+624+32+4>>2]=c[J+4>>2];c[wa+624+32+8>>2]=c[J+8>>2];c[wa+624+32+12>>2]=c[J+12>>2];c[wa+624+48>>2]=c[K>>2];c[wa+624+48+4>>2]=c[K+4>>2];c[wa+624+48+8>>2]=c[K+8>>2];c[wa+624+48+12>>2]=c[K+12>>2]}i=c[b+28>>2]|0;if((i|0)>0){C=m*m+n*n+o*o;p=+x(+C);r=(l>.39269909262657166?.39269909262657166:l)*.5;p=+A(+r)/p;v=m*p;u=n*p;p=o*p;r=+z(+r);s=+x(+(L*E*L*E+(F*E*F*E+I*E*I*E)));j=0;do{if(C>1.1920928955078125e-07){o=6.2831854820251465/+(i|0)*+(j|0)*.5;n=+A(+o)/s;l=F*E*n;m=I*E*n;n=L*E*n;o=+z(+o);if(D>2]|0;aa=+g[ua>>2];ba=+g[ua+16>>2];ca=+g[ua+32>>2];da=+g[ua+4>>2];ea=+g[ua+20>>2];fa=+g[ua+36>>2];ga=+g[ua+8>>2];ja=+g[ua+24>>2];qa=+g[ua+40>>2];g[wa+128>>2]=(1.0-(na*oa+$*ha))*aa+(ka*oa-ia*ha)*ba+(ka*ha+ia*oa)*ca;g[wa+128+4>>2]=(1.0-(na*oa+$*ha))*da+(ka*oa-ia*ha)*ea+(ka*ha+ia*oa)*fa;g[wa+128+8>>2]=(1.0-(na*oa+$*ha))*ga+(ka*oa-ia*ha)*ja+(ka*ha+ia*oa)*qa;g[wa+128+12>>2]=0.0;g[wa+128+16>>2]=(ka*oa+ia*ha)*aa+(1.0-(ka*ma+$*ha))*ba+(na*ha-ia*ma)*ca;g[wa+128+20>>2]=(ka*oa+ia*ha)*da+(1.0-(ka*ma+$*ha))*ea+(na*ha-ia*ma)*fa;g[wa+128+24>>2]=(ka*oa+ia*ha)*ga+(1.0-(ka*ma+$*ha))*ja+(na*ha-ia*ma)*qa;g[wa+128+28>>2]=0.0;g[wa+128+32>>2]=(ka*ha-ia*oa)*aa+(na*ha+ia*ma)*ba+(1.0-(ka*ma+na*oa))*ca;g[wa+128+36>>2]=(ka*ha-ia*oa)*da+(na*ha+ia*ma)*ea+(1.0-(ka*ma+na*oa))*fa;g[wa+128+40>>2]=(ka*ha-ia*oa)*ga+(na*ha+ia*ma)*ja+(1.0-(ka*ma+na*oa))*qa;g[wa+128+44>>2]=0.0;ua=c[e+12>>2]|0;c[G>>2]=c[ua>>2];c[G+4>>2]=c[ua+4>>2];c[G+8>>2]=c[ua+8>>2];c[G+12>>2]=c[ua+12>>2];c[H>>2]=c[ua+16>>2];c[H+4>>2]=c[ua+16+4>>2];c[H+8>>2]=c[ua+16+8>>2];c[H+12>>2]=c[ua+16+12>>2];c[J>>2]=c[ua+32>>2];c[J+4>>2]=c[ua+32+4>>2];c[J+8>>2]=c[ua+32+8>>2];c[J+12>>2]=c[ua+32+12>>2];c[K>>2]=c[ua+48>>2];c[K+4>>2]=c[ua+48+4>>2];c[K+8>>2]=c[ua+48+8>>2];c[K+12>>2]=c[ua+48+12>>2]}else{ua=c[d+12>>2]|0;c[wa+128>>2]=c[ua>>2];c[wa+128+4>>2]=c[ua+4>>2];c[wa+128+8>>2]=c[ua+8>>2];c[wa+128+12>>2]=c[ua+12>>2];c[k>>2]=c[ua+16>>2];c[k+4>>2]=c[ua+16+4>>2];c[k+8>>2]=c[ua+16+8>>2];c[k+12>>2]=c[ua+16+12>>2];c[t>>2]=c[ua+32>>2];c[t+4>>2]=c[ua+32+4>>2];c[t+8>>2]=c[ua+32+8>>2];c[t+12>>2]=c[ua+32+12>>2];c[y>>2]=c[ua+48>>2];c[y+4>>2]=c[ua+48+4>>2];c[y+8>>2]=c[ua+48+8>>2];c[y+12>>2]=c[ua+48+12>>2];ka=n*(v*-n+(u*o+r*-m)-p*-l)+(l*(r*o-v*-l-u*-m-p*-n)+o*(p*-m+(v*o+r*-l)-u*-n))-m*(u*-l+(p*o+r*-n)-v*-m);na=l*(u*-l+(p*o+r*-n)-v*-m)+(o*(v*-n+(u*o+r*-m)-p*-l)+m*(r*o-v*-l-u*-m-p*-n))-n*(p*-m+(v*o+r*-l)-u*-n);$=m*(p*-m+(v*o+r*-l)-u*-n)+(n*(r*o-v*-l-u*-m-p*-n)+o*(u*-l+(p*o+r*-n)-v*-m))-l*(v*-n+(u*o+r*-m)-p*-l);ia=o*(r*o-v*-l-u*-m-p*-n)-l*(p*-m+(v*o+r*-l)-u*-n)-m*(v*-n+(u*o+r*-m)-p*-l)-n*(u*-l+(p*o+r*-n)-v*-m);ma=ka*(2.0/(ia*ia+($*$+(ka*ka+na*na))));oa=na*(2.0/(ia*ia+($*$+(ka*ka+na*na))));ha=$*(2.0/(ia*ia+($*$+(ka*ka+na*na))));ua=c[e+12>>2]|0;aa=+g[ua>>2];ba=+g[ua+16>>2];ca=+g[ua+32>>2];da=+g[ua+4>>2];ea=+g[ua+20>>2];fa=+g[ua+36>>2];ga=+g[ua+8>>2];ja=+g[ua+24>>2];qa=+g[ua+40>>2];g[wa+128+64>>2]=(1.0-(na*oa+$*ha))*aa+(ka*oa-ia*ha)*ba+(ka*ha+ia*oa)*ca;g[wa+128+68>>2]=(1.0-(na*oa+$*ha))*da+(ka*oa-ia*ha)*ea+(ka*ha+ia*oa)*fa;g[wa+128+72>>2]=(1.0-(na*oa+$*ha))*ga+(ka*oa-ia*ha)*ja+(ka*ha+ia*oa)*qa;g[wa+128+76>>2]=0.0;g[wa+128+80>>2]=(ka*oa+ia*ha)*aa+(1.0-(ka*ma+$*ha))*ba+(na*ha-ia*ma)*ca;g[wa+128+84>>2]=(ka*oa+ia*ha)*da+(1.0-(ka*ma+$*ha))*ea+(na*ha-ia*ma)*fa;g[wa+128+88>>2]=(ka*oa+ia*ha)*ga+(1.0-(ka*ma+$*ha))*ja+(na*ha-ia*ma)*qa;g[wa+128+92>>2]=0.0;g[wa+128+96>>2]=(ka*ha-ia*oa)*aa+(na*ha+ia*ma)*ba+(1.0-(ka*ma+na*oa))*ca;g[wa+128+100>>2]=(ka*ha-ia*oa)*da+(na*ha+ia*ma)*ea+(1.0-(ka*ma+na*oa))*fa;g[wa+128+104>>2]=(ka*ha-ia*oa)*ga+(na*ha+ia*ma)*ja+(1.0-(ka*ma+na*oa))*qa;g[wa+128+108>>2]=0.0}i=c[f+20>>2]|0;c[wa+384>>2]=8944;c[wa+384+32>>2]=h;c[wa+384+36>>2]=c[wa+128>>2];c[wa+384+36+4>>2]=c[wa+128+4>>2];c[wa+384+36+8>>2]=c[wa+128+8>>2];c[wa+384+36+12>>2]=c[wa+128+12>>2];c[wa+384+52>>2]=c[k>>2];c[wa+384+52+4>>2]=c[k+4>>2];c[wa+384+52+8>>2]=c[k+8>>2];c[wa+384+52+12>>2]=c[k+12>>2];c[wa+384+68>>2]=c[t>>2];c[wa+384+68+4>>2]=c[t+4>>2];c[wa+384+68+8>>2]=c[t+8>>2];c[wa+384+68+12>>2]=c[t+12>>2];c[wa+384+84>>2]=c[y>>2];c[wa+384+84+4>>2]=c[y+4>>2];c[wa+384+84+8>>2]=c[y+8>>2];c[wa+384+84+12>>2]=c[y+12>>2];c[wa+384+100>>2]=c[G>>2];c[wa+384+100+4>>2]=c[G+4>>2];c[wa+384+100+8>>2]=c[G+8>>2];c[wa+384+100+12>>2]=c[G+12>>2];c[wa+384+116>>2]=c[H>>2];c[wa+384+116+4>>2]=c[H+4>>2];c[wa+384+116+8>>2]=c[H+8>>2];c[wa+384+116+12>>2]=c[H+12>>2];c[wa+384+132>>2]=c[J>>2];c[wa+384+132+4>>2]=c[J+4>>2];c[wa+384+132+8>>2]=c[J+8>>2];c[wa+384+132+12>>2]=c[J+12>>2];c[wa+384+148>>2]=c[K>>2];c[wa+384+148+4>>2]=c[K+4>>2];c[wa+384+148+8>>2]=c[K+8>>2];c[wa+384+148+12>>2]=c[K+12>>2];c[wa+384+164>>2]=c[wa+624>>2];c[wa+384+164+4>>2]=c[wa+624+4>>2];c[wa+384+164+8>>2]=c[wa+624+8>>2];c[wa+384+164+12>>2]=c[wa+624+12>>2];c[wa+384+180>>2]=c[wa+624+16>>2];c[wa+384+180+4>>2]=c[wa+624+16+4>>2];c[wa+384+180+8>>2]=c[wa+624+16+8>>2];c[wa+384+180+12>>2]=c[wa+624+16+12>>2];c[wa+384+196>>2]=c[wa+624+32>>2];c[wa+384+196+4>>2]=c[wa+624+32+4>>2];c[wa+384+196+8>>2]=c[wa+624+32+8>>2];c[wa+384+196+12>>2]=c[wa+624+32+12>>2];c[wa+384+212>>2]=c[wa+624+48>>2];c[wa+384+212+4>>2]=c[wa+624+48+4>>2];c[wa+384+212+8>>2]=c[wa+624+48+8>>2];c[wa+384+212+12>>2]=c[wa+624+48+12>>2];a[wa+384+228>>0]=D>2]=i;Ub(wa+48|0,wa+128|0,wa+384|0,i,0);i=c[b+28>>2]|0}j=j+1|0}while((j|0)<(i|0))}}if(!(a[b+16>>0]|0)){sa=wa;return}i=c[h+4>>2]|0;if(!(c[i+748>>2]|0)){sa=wa;return}j=c[i+740>>2]|0;k=c[(c[h+8>>2]|0)+8>>2]|0;if((j|0)==(k|0)){re(i,j+4|0,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0);sa=wa;return}else{re(i,(c[(c[h+12>>2]|0)+8>>2]|0)+4|0,k+4|0);sa=wa;return}}function nb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0.0,l=0.0,m=0,n=0.0,o=0.0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,x=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0.0,O=0.0,P=0.0,Q=0.0;M=sa;sa=sa+16|0;f=c[b+1112>>2]|0;a:do if((f|0)>0)while(1){m=c[c[b+1120>>2]>>2]|0;f=c[m+348>>2]|0;if(f|0){sg(b+1048|0,f)|0;h=c[b+1052>>2]|0;if(h|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+1052>>2]=f;c[b+1060>>2]=(c[b+1060>>2]|0)+-1}f=c[m+52>>2]|0;if(f|0){if(a[m+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[m+52>>2]=0}a[m+56>>0]=1;c[m+52>>2]=0;c[m+44>>2]=0;c[m+48>>2]=0;f=c[m+32>>2]|0;if(f|0){if(a[m+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[m+32>>2]=0}a[m+36>>0]=1;c[m+32>>2]=0;c[m+24>>2]=0;c[m+28>>2]=0;f=c[m+12>>2]|0;if(f|0){if(a[m+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[m+12>>2]=0}a[m+16>>0]=1;c[m+12>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0);f=c[b+1112>>2]|0;if((f|0)<=0){h=f;break a}j=c[b+1120>>2]|0;h=0;do{i=j+(h<<2)|0;if((c[i>>2]|0)==(m|0)){L=23;break}h=h+1|0}while((h|0)<(f|0));if((L|0)==23){L=0;if((h|0)<(f|0)){c[i>>2]=c[j+(f+-1<<2)>>2];c[(c[b+1120>>2]|0)+(f+-1<<2)>>2]=m;c[b+1112>>2]=f+-1;f=f+-1|0}}if((f|0)<=0){h=f;break}}else h=f;while(0);f=c[b+712>>2]|0;f=(f|0)>(d|0)?d:f;if((h|0)<(f|0)){if((c[b+1116>>2]|0)<(f|0)){if(f){c[7182]=(c[7182]|0)+1;i=xb((f<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}m=c[b+1112>>2]|0;if((m|0)>0){j=0;do{c[i+(j<<2)>>2]=c[(c[b+1120>>2]|0)+(j<<2)>>2];j=j+1|0}while((j|0)!=(m|0));j=i;i=b+1120|0}else{j=i;i=b+1120|0}}else{j=0;i=b+1120|0}m=c[i>>2]|0;if(m|0){if(a[b+1124>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0)}c[i>>2]=0}a[b+1124>>0]=1;c[i>>2]=j;c[b+1116>>2]=f}else i=b+1120|0;do{c[(c[i>>2]|0)+(h<<2)>>2]=0;h=h+1|0}while((h|0)!=(f|0))}c[b+1112>>2]=f;if((f|0)>0){h=0;do{c[7182]=(c[7182]|0)+1;f=xb(403)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}a[f+16>>0]=1;c[f+12>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;a[f+36>>0]=1;c[f+32>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;a[f+56>>0]=1;c[f+52>>2]=0;c[f+44>>2]=0;c[f+48>>2]=0;j=f+348|0;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;g[f+368>>2]=100.0;g[f+372>>2]=.009999999776482582;a[f+376>>0]=0;c[(c[b+1120>>2]|0)+(h<<2)>>2]=f;j=c[b+1120>>2]|0;a[(c[j+(h<<2)>>2]|0)+377>>0]=1;h=h+1|0;f=c[b+1112>>2]|0}while((h|0)<(f|0));if((f|0)>0){i=c[b+712>>2]|0;if((i|0)>0){h=0;k=0.0;l=0.0;n=0.0;m=f;while(1){p=c[b+720>>2]|0;o=k+ +g[p+(h*104|0)+8>>2];l=l+ +g[p+(h*104|0)+12>>2];x=n+ +g[p+(h*104|0)+16>>2];d=c[j+(((h*29873|0)%(m|0)|0)<<2)>>2]|0;p=p+(h*104|0)|0;j=c[d+24>>2]|0;if((j|0)==(c[d+28>>2]|0)?(q=(j|0)==0?1:j<<1,(j|0)<(q|0)):0){if(!q)i=0;else{c[7182]=(c[7182]|0)+1;i=xb((q<<2|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}j=c[d+24>>2]|0}if((j|0)>0){m=0;do{c[i+(m<<2)>>2]=c[(c[d+32>>2]|0)+(m<<2)>>2];m=m+1|0}while((m|0)!=(j|0))}m=c[d+32>>2]|0;if(m){if(a[d+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[m+-4>>2]|0);j=c[d+24>>2]|0}c[d+32>>2]=0}a[d+36>>0]=1;c[d+32>>2]=i;c[d+28>>2]=q;i=c[b+712>>2]|0}c[(c[d+32>>2]|0)+(j<<2)>>2]=p;c[d+24>>2]=j+1;h=h+1|0;if((h|0)>=(i|0))break;k=o;n=x;m=c[b+1112>>2]|0;j=c[b+1120>>2]|0}k=1.0/+(i|0);if((f|0)>=0)if(!f){i=0;n=o*k;l=l*k;k=x*k;L=72}else{n=o*k;l=l*k;k=x*k;L=70}else{C=b+720|0;G=0;F=0}}else{n=1.0/+(i|0)*0.0;l=1.0/+(i|0)*0.0;k=1.0/+(i|0)*0.0;L=70}if((L|0)==70){c[7182]=(c[7182]|0)+1;h=xb((f<<4|3)+16|0)|0;if(!h){i=0;L=72}else{c[(h+4+15&-16)+-4>>2]=h;i=h+4+15&-16;L=72}}if((L|0)==72){h=0;do{g[i+(h<<4)>>2]=n;g[i+(h<<4)+4>>2]=l;g[i+(h<<4)+8>>2]=k;g[i+(h<<4)+12>>2]=0.0;h=h+1|0}while((h|0)!=(f|0));C=b+720|0;G=i;F=i}t=G+4|0;u=G+8|0;s=0;do{z=+(s|0)*.0625;z=2.0-(z>1.0?1.0:z);m=0;d=0;while(1){h=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;j=c[h+24>>2]|0;if((j|0)>0){i=c[h+32>>2]|0;L=c[i>>2]|0;n=+g[L+8>>2]+0.0;l=+g[L+12>>2]+0.0;k=+g[L+16>>2]+0.0;if((j|0)==1)L=82;else{h=1;do{L=c[i+(h<<2)>>2]|0;n=n+ +g[L+8>>2];l=l+ +g[L+12>>2];k=k+ +g[L+16>>2];h=h+1|0}while((h|0)<(j|0));L=80}}else{k=0.0;l=0.0;n=0.0;L=80}if((L|0)==80){L=0;if(!j)r=m;else L=82}if((L|0)==82){L=0;r=G+(d<<4)|0;o=+g[r>>2];v=G+(d<<4)+4|0;x=+g[v>>2];h=G+(d<<4)+8|0;y=+g[h>>2];n=o+z*(n*(1.0/+(j|0))-o);l=x+z*(l*(1.0/+(j|0))-x);k=y+z*(k*(1.0/+(j|0))-y);g[r>>2]=n;g[v>>2]=l;g[h>>2]=k;g[G+(d<<4)+12>>2]=0.0;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;h=c[j+24>>2]|0;if((h|0)<0){if((c[j+28>>2]|0)<0){i=c[j+32>>2]|0;if(i|0){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=0;c[j+28>>2]=0}do{c[(c[j+32>>2]|0)+(h<<2)>>2]=0;h=h+1|0}while((h|0)!=0)}c[j+24>>2]=0;r=m|(n-o)*(n-o)+(l-x)*(l-x)+(k-y)*(k-y)>1.1920928955078125e-07}d=d+1|0;if((d|0)>=(f|0))break;else m=r}s=s+1|0;h=c[b+712>>2]|0;b:do if((h|0)>0){if((f|0)<=1){p=0;while(1){m=c[c[b+1120>>2]>>2]|0;d=(c[C>>2]|0)+(p*104|0)|0;i=c[m+24>>2]|0;if((i|0)==(c[m+28>>2]|0)?(E=(i|0)==0?1:i<<1,(i|0)<(E|0)):0){if(!E)h=0;else{c[7182]=(c[7182]|0)+1;h=xb((E<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}i=c[m+24>>2]|0}if((i|0)>0){j=0;do{c[h+(j<<2)>>2]=c[(c[m+32>>2]|0)+(j<<2)>>2];j=j+1|0}while((j|0)!=(i|0))}j=c[m+32>>2]|0;if(j){if(a[m+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);i=c[m+24>>2]|0}c[m+32>>2]=0}a[m+36>>0]=1;c[m+32>>2]=h;c[m+28>>2]=E;h=c[b+712>>2]|0}c[(c[m+32>>2]|0)+(i<<2)>>2]=d;c[m+24>>2]=i+1;p=p+1|0;if((p|0)>=(h|0))break b}}q=0;do{d=c[C>>2]|0;l=+g[d+(q*104|0)+8>>2];n=+g[d+(q*104|0)+12>>2];o=+g[d+(q*104|0)+16>>2];i=1;k=+w(+(+g[G>>2]-l))+ +w(+(+g[t>>2]-n))+ +w(+(+g[u>>2]-o));j=0;while(1){x=+w(+(+g[G+(i<<4)>>2]-l))+ +w(+(+g[G+(i<<4)+4>>2]-n))+ +w(+(+g[G+(i<<4)+8>>2]-o));m=x>2]|0)+(j<<2)>>2]|0;m=d+(q*104|0)|0;i=c[p+24>>2]|0;if((i|0)==(c[p+28>>2]|0)?(D=(i|0)==0?1:i<<1,(i|0)<(D|0)):0){if(!D)h=0;else{c[7182]=(c[7182]|0)+1;h=xb((D<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}i=c[p+24>>2]|0}if((i|0)>0){j=0;do{c[h+(j<<2)>>2]=c[(c[p+32>>2]|0)+(j<<2)>>2];j=j+1|0}while((j|0)!=(i|0))}j=c[p+32>>2]|0;if(j){if(a[p+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0);i=c[p+24>>2]|0}c[p+32>>2]=0}a[p+36>>0]=1;c[p+32>>2]=h;c[p+28>>2]=D;h=c[b+712>>2]|0}c[(c[p+32>>2]|0)+(i<<2)>>2]=m;c[p+24>>2]=i+1;q=q+1|0}while((q|0)<(h|0))}while(0)}while((s|0)<(e|0)&r);if((h|0)>0){h=h<<2;c[7182]=(c[7182]|0)+1;f=xb((h|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}mk(f|0,-1,h|0)|0;v=f;u=f}else{v=0;u=0}f=c[b+1112>>2]|0;if((f|0)>0){d=c[b+1120>>2]|0;m=0;do{j=c[d+(m<<2)>>2]|0;if((c[j+24>>2]|0)>0){h=c[C>>2]|0;i=c[j+32>>2]|0;c[v+((((c[i>>2]|0)-h|0)/104|0)<<2)>>2]=m;if((c[j+24>>2]|0)>1){f=1;do{c[v+((((c[i+(f<<2)>>2]|0)-h|0)/104|0)<<2)>>2]=m;f=f+1|0}while((f|0)<(c[j+24>>2]|0))}f=c[b+1112>>2]|0}m=m+1|0}while((m|0)<(f|0))}if((c[b+752>>2]|0)>0){r=0;do{E=c[b+760>>2]|0;d=c[C>>2]|0;f=((c[E+(r*44|0)+8>>2]|0)-d|0)/104|0;c[M>>2]=f;c[M+4>>2]=((c[E+(r*44|0)+12>>2]|0)-d|0)/104|0;c[M+8>>2]=((c[E+(r*44|0)+16>>2]|0)-d|0)/104|0;d=0;while(1){p=c[v+(f<<2)>>2]|0;q=d+1|0;f=c[M+(((q|0)==3?0:q)<<2)>>2]|0;c:do if((c[v+(f<<2)>>2]|0)!=(p|0)){m=c[(c[b+1120>>2]|0)+(p<<2)>>2]|0;j=(c[C>>2]|0)+(f*104|0)|0;h=c[m+24>>2]|0;d:do if((h|0)>0){i=c[m+32>>2]|0;f=0;while(1){if((c[i+(f<<2)>>2]|0)==(j|0))break;f=f+1|0;if((f|0)>=(h|0))break d}if((f|0)!=(h|0))break c}while(0);if((h|0)==(c[m+28>>2]|0)?(I=(h|0)==0?1:h<<1,(h|0)<(I|0)):0){if(!I)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((I<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[m+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[m+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[m+32>>2]|0;if(i){if(a[m+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[m+24>>2]|0}c[m+32>>2]=0}a[m+36>>0]=1;c[m+32>>2]=f;c[m+28>>2]=I;f=h}else f=h;c[(c[m+32>>2]|0)+(f<<2)>>2]=j;c[m+24>>2]=f+1}while(0);f=c[M+((((d+2|0)>>>0)%3|0)<<2)>>2]|0;e:do if((c[v+(f<<2)>>2]|0)!=(p|0)){m=c[(c[b+1120>>2]|0)+(p<<2)>>2]|0;j=(c[C>>2]|0)+(f*104|0)|0;h=c[m+24>>2]|0;f:do if((h|0)>0){i=c[m+32>>2]|0;f=0;while(1){if((c[i+(f<<2)>>2]|0)==(j|0))break;f=f+1|0;if((f|0)>=(h|0))break f}if((f|0)!=(h|0))break e}while(0);if((h|0)==(c[m+28>>2]|0)?(H=(h|0)==0?1:h<<1,(h|0)<(H|0)):0){if(!H)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((H<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[m+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[m+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[m+32>>2]|0;if(i){if(a[m+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[m+24>>2]|0}c[m+32>>2]=0}a[m+36>>0]=1;c[m+32>>2]=f;c[m+28>>2]=H;f=h}else f=h;c[(c[m+32>>2]|0)+(f<<2)>>2]=j;c[m+24>>2]=f+1}while(0);if(q>>>0>=3)break;d=q;f=c[M+(q<<2)>>2]|0}r=r+1|0}while((r|0)<(c[b+752>>2]|0));f=c[b+1112>>2]|0}if((f|0)>1){c[7182]=(c[7182]|0)+1;f=xb(403)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}a[f+16>>0]=1;c[f+12>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;p=f+36|0;a[p>>0]=1;q=f+32|0;c[q>>2]=0;r=f+24|0;c[r>>2]=0;s=f+28|0;c[s>>2]=0;a[f+56>>0]=1;c[f+52>>2]=0;c[f+44>>2]=0;c[f+48>>2]=0;t=f+348|0;c[t>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;g[f+368>>2]=100.0;g[f+372>>2]=.009999999776482582;a[f+376>>0]=0;t=f;a[f+377>>0]=0;j=c[b+712>>2]|0;if((j|0)>0){c[7182]=(c[7182]|0)+1;f=xb((j<<2|3)+16|0)|0;if(!f)i=0;else{c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}h=c[r>>2]|0;if((h|0)>0){f=0;do{c[i+(f<<2)>>2]=c[(c[q>>2]|0)+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0))}f=c[q>>2]|0;if(f|0){if(a[p>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[q>>2]=0}a[p>>0]=1;c[q>>2]=i;c[s>>2]=j;f=c[b+712>>2]|0;if((f|0)>0){d=0;i=c[r>>2]|0;h=j;while(1){m=(c[C>>2]|0)+(d*104|0)|0;do if((i|0)==(h|0)){j=(h|0)==0?1:h<<1;if((h|0)>=(j|0)){j=h;break}if(!j)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((j<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[r>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[q>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[q>>2]|0;if(i){if(a[p>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[r>>2]|0}c[q>>2]=0}a[p>>0]=1;c[q>>2]=f;c[s>>2]=j;f=c[b+712>>2]|0}else{j=h;h=i}while(0);c[(c[q>>2]|0)+(h<<2)>>2]=m;i=h+1|0;c[r>>2]=i;d=d+1|0;if((d|0)>=(f|0))break;else h=j}}}f=c[b+1112>>2]|0;if((f|0)==(c[b+1116>>2]|0)?(K=(f|0)==0?1:f<<1,(f|0)<(K|0)):0){if(!K)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((K<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=f;f=c[b+1112>>2]|0}if((f|0)>0){h=0;do{c[i+(h<<2)>>2]=c[(c[b+1120>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0))}h=c[b+1120>>2]|0;if(h){if(a[b+1124>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);f=c[b+1112>>2]|0}c[b+1120>>2]=0}a[b+1124>>0]=1;c[b+1120>>2]=i;c[b+1116>>2]=K}c[(c[b+1120>>2]|0)+(f<<2)>>2]=t;K=f+1|0;c[b+1112>>2]=K;H=c[b+1120>>2]|0;f=H+(f<<2)|0;I=c[H>>2]|0;c[H>>2]=c[f>>2];c[f>>2]=I;f=K}if((f|0)>0){h=0;do{d=c[(c[b+1120>>2]|0)+(h<<2)>>2]|0;g:do if(!(c[d+24>>2]|0)){h=h+-1|0;f=c[d+348>>2]|0;if(f|0){sg(b+1048|0,f)|0;i=c[b+1052>>2]|0;if(i|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+1052>>2]=f;c[b+1060>>2]=(c[b+1060>>2]|0)+-1}f=c[d+52>>2]|0;if(f|0){if(a[d+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+52>>2]=0}a[d+56>>0]=1;c[d+52>>2]=0;c[d+44>>2]=0;c[d+48>>2]=0;f=c[d+32>>2]|0;if(f|0){if(a[d+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+32>>2]=0}a[d+36>>0]=1;c[d+32>>2]=0;c[d+24>>2]=0;c[d+28>>2]=0;f=c[d+12>>2]|0;if(f|0){if(a[d+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[d+12>>2]=0}a[d+16>>0]=1;c[d+12>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0);f=c[b+1112>>2]|0;if((f|0)>0){m=c[b+1120>>2]|0;i=0;while(1){j=m+(i<<2)|0;if((c[j>>2]|0)==(d|0))break;i=i+1|0;if((i|0)>=(f|0))break g}if((i|0)>=(f|0))break;c[j>>2]=c[m+(f+-1<<2)>>2];c[(c[b+1120>>2]|0)+(f+-1<<2)>>2]=d;c[b+1112>>2]=f+-1;f=f+-1|0}}while(0);h=h+1|0}while((h|0)<(f|0))}if(!((v|0)==0|(u|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[u+-4>>2]|0)}if(!((G|0)==0|(F|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[F+-4>>2]|0)}}else L=244}else L=244;h:do if((L|0)==244){m=c[b+772>>2]|0;if(!m){m=c[b+752>>2]|0;if((f|0)<(m|0)){if((c[b+1116>>2]|0)<(m|0)){if(m){c[7182]=(c[7182]|0)+1;h=xb((m<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[b+1112>>2]|0;if((j|0)>0){i=0;do{c[h+(i<<2)>>2]=c[(c[b+1120>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(j|0));j=b+1120|0}else j=b+1120|0}else{h=0;j=b+1120|0}i=c[j>>2]|0;if(i|0){if(a[b+1124>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[j>>2]=0}a[b+1124>>0]=1;c[j>>2]=h;c[b+1116>>2]=m}do{c[(c[b+1120>>2]|0)+(f<<2)>>2]=0;f=f+1|0}while((f|0)!=(m|0))}c[b+1112>>2]=m;if((m|0)>0){h=0;do{c[7182]=(c[7182]|0)+1;f=xb(403)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}a[f+16>>0]=1;c[f+12>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;a[f+36>>0]=1;c[f+32>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;a[f+56>>0]=1;c[f+52>>2]=0;c[f+44>>2]=0;c[f+48>>2]=0;L=f+348|0;c[L>>2]=0;c[L+4>>2]=0;c[L+8>>2]=0;c[L+12>>2]=0;c[L+16>>2]=0;g[f+368>>2]=100.0;g[f+372>>2]=.009999999776482582;a[f+376>>0]=0;c[(c[b+1120>>2]|0)+(h<<2)>>2]=f;a[(c[(c[b+1120>>2]|0)+(h<<2)>>2]|0)+377>>0]=1;h=h+1|0}while((h|0)<(c[b+1112>>2]|0))}if((c[b+752>>2]|0)<=0)break;d=0;while(1){j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+760>>2]|0)+(d*44|0)+8|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(p=(h|0)==0?1:h<<1,(h|0)<(p|0)):0){if(!p)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((p<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=p;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+760>>2]|0)+(d*44|0)+12|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(r=(h|0)==0?1:h<<1,(h|0)<(r|0)):0){if(!r)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((r<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=r;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+760>>2]|0)+(d*44|0)+16|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(s=(h|0)==0?1:h<<1,(h|0)<(s|0)):0){if(!s)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((s<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=s;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;d=d+1|0;if((d|0)>=(c[b+752>>2]|0))break h}}if((f|0)<(m|0)){if((c[b+1116>>2]|0)<(m|0)){c[7182]=(c[7182]|0)+1;h=xb((m<<2|3)+16|0)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}i=c[b+1112>>2]|0;if((i|0)>0){h=0;do{c[j+(h<<2)>>2]=c[(c[b+1120>>2]|0)+(h<<2)>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[b+1120>>2]|0;if(h|0){if(a[b+1124>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[b+1120>>2]=0}a[b+1124>>0]=1;c[b+1120>>2]=j;c[b+1116>>2]=m;h=b+1120|0}else h=b+1120|0;do{c[(c[h>>2]|0)+(f<<2)>>2]=0;f=f+1|0}while((f|0)!=(m|0))}c[b+1112>>2]=m;if((m|0)>0){h=0;do{c[7182]=(c[7182]|0)+1;f=xb(403)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}a[f+16>>0]=1;c[f+12>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;a[f+36>>0]=1;c[f+32>>2]=0;c[f+24>>2]=0;c[f+28>>2]=0;a[f+56>>0]=1;c[f+52>>2]=0;c[f+44>>2]=0;c[f+48>>2]=0;L=f+348|0;c[L>>2]=0;c[L+4>>2]=0;c[L+8>>2]=0;c[L+12>>2]=0;c[L+16>>2]=0;g[f+368>>2]=100.0;g[f+372>>2]=.009999999776482582;a[f+376>>0]=0;c[(c[b+1120>>2]|0)+(h<<2)>>2]=f;a[(c[(c[b+1120>>2]|0)+(h<<2)>>2]|0)+377>>0]=1;h=h+1|0}while((h|0)<(c[b+1112>>2]|0))}if((c[b+772>>2]|0)>0){d=0;do{j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+780>>2]|0)+(d*104|0)+8|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(C=(h|0)==0?1:h<<1,(h|0)<(C|0)):0){if(!C)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((C<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=C;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+780>>2]|0)+(d*104|0)+12|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(t=(h|0)==0?1:h<<1,(h|0)<(t|0)):0){if(!t)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((t<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=t;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+780>>2]|0)+(d*104|0)+16|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(u=(h|0)==0?1:h<<1,(h|0)<(u|0)):0){if(!u)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((u<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=u;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;j=c[(c[b+1120>>2]|0)+(d<<2)>>2]|0;m=(c[b+780>>2]|0)+(d*104|0)+20|0;h=c[j+24>>2]|0;if((h|0)==(c[j+28>>2]|0)?(v=(h|0)==0?1:h<<1,(h|0)<(v|0)):0){if(!v)f=0;else{c[7182]=(c[7182]|0)+1;f=xb((v<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}h=c[j+24>>2]|0}if((h|0)>0){i=0;do{c[f+(i<<2)>>2]=c[(c[j+32>>2]|0)+(i<<2)>>2];i=i+1|0}while((i|0)!=(h|0))}i=c[j+32>>2]|0;if(i){if(a[j+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);h=c[j+24>>2]|0}c[j+32>>2]=0}a[j+36>>0]=1;c[j+32>>2]=f;c[j+28>>2]=v;f=h}else f=h;c[(c[j+32>>2]|0)+(f<<2)>>2]=c[m>>2];c[j+24>>2]=f+1;d=d+1|0}while((d|0)<(c[b+772>>2]|0))}}while(0);f=c[b+1112>>2]|0;if(!f){b=0;sa=M;return b|0}if((f|0)>0){q=0;do{r=c[(c[b+1120>>2]|0)+(q<<2)>>2]|0;g[r+128>>2]=0.0;d=c[r+24>>2]|0;m=c[r+4>>2]|0;if((d|0)>(m|0)){do if((c[r+8>>2]|0)<(d|0)){if(!d){f=0;i=m}else{c[7182]=(c[7182]|0)+1;f=xb((d<<2|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=c[r+4>>2]|0}j=c[r+12>>2]|0;if((i|0)<=0){if(!j){a[r+16>>0]=1;c[r+12>>2]=f;c[r+8>>2]=d;break}}else{h=0;do{c[f+(h<<2)>>2]=c[j+(h<<2)>>2];h=h+1|0}while((h|0)!=(i|0))}if(a[r+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}a[r+16>>0]=1;c[r+12>>2]=f;c[r+8>>2]=d}else f=c[r+12>>2]|0;while(0);mk(f+(m<<2)|0,0,d-m<<2|0)|0;p=c[r+24>>2]|0}else p=d;c[r+4>>2]=d;m=(p|0)>0;if(m){h=c[r+32>>2]|0;i=c[r+12>>2]|0;f=0;do{k=+g[(c[h+(f<<2)>>2]|0)+88>>2];if(k==0.0){a[r+376>>0]=1;k=999999984306749440.0}else k=1.0/k;g[i+(f<<2)>>2]=k;l=k+ +g[r+128>>2];g[r+128>>2]=l;f=f+1|0}while((f|0)!=(p|0));g[r+128>>2]=1.0/l;f=0;k=0.0;n=0.0;o=0.0;do{L=c[h+(f<<2)>>2]|0;B=+g[i+(f<<2)>>2];k=k+ +g[L+8>>2]*B;n=n+B*+g[L+12>>2];o=o+B*+g[L+16>>2];f=f+1|0}while((f|0)!=(p|0));l=1.0/l}else{l=1.0/+g[r+128>>2];g[r+128>>2]=l;o=0.0;n=0.0;k=0.0}B=l*k;A=l*n;z=l*o;g[r+228>>2]=B;g[r+232>>2]=A;g[r+236>>2]=z;g[r+240>>2]=0.0;f=r+316|0;h=f+36|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(h|0));f=r+132|0;h=f+48|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(h|0));if(m){h=c[r+32>>2]|0;i=c[r+12>>2]|0;f=0;k=0.0;l=0.0;n=0.0;o=0.0;x=0.0;y=0.0;do{L=c[h+(f<<2)>>2]|0;Q=+g[L+8>>2]-B;O=+g[L+12>>2]-A;P=+g[L+16>>2]-z;N=+g[i+(f<<2)>>2];k=k+N*(O*O+P*P);g[r+132>>2]=k;l=N*(Q*Q+P*P)+l;g[r+152>>2]=l;n=(Q*Q+O*O)*N+n;g[r+172>>2]=n;o=o-O*Q*N;g[r+136>>2]=o;x=x-P*Q*N;g[r+140>>2]=x;y=y-P*O*N;g[r+156>>2]=y;f=f+1|0}while((f|0)!=(p|0));f=r+136|0;h=r+140|0;i=r+156|0;j=r+152|0}else{f=r+136|0;h=r+140|0;i=r+156|0;j=r+152|0;y=0.0;x=0.0;o=0.0;n=0.0;l=0.0;k=0.0}B=l*n-y*y;N=y*x-n*o;O=y*o-l*x;Q=1.0/(B*k+o*N+O*x);P=(o*x-y*k)*Q;g[r+132>>2]=B*Q;g[f>>2]=N*Q;g[h>>2]=O*Q;g[r+144>>2]=0.0;g[r+148>>2]=N*Q;g[j>>2]=(n*k-x*x)*Q;g[i>>2]=P;g[r+160>>2]=0.0;g[r+164>>2]=O*Q;g[r+168>>2]=P;g[r+172>>2]=(l*k-o*o)*Q;g[r+176>>2]=0.0;c[r+60>>2]=1065353216;c[r+64>>2]=0;c[r+64+4>>2]=0;c[r+64+8>>2]=0;c[r+64+12>>2]=0;c[r+80>>2]=1065353216;c[r+84>>2]=0;c[r+84+4>>2]=0;c[r+84+8>>2]=0;c[r+84+12>>2]=0;c[r+100>>2]=1065353216;c[r+104>>2]=0;c[r+108>>2]=c[r+228>>2];c[r+108+4>>2]=c[r+228+4>>2];c[r+108+8>>2]=c[r+228+8>>2];c[r+108+12>>2]=c[r+228+12>>2];j=c[r+44>>2]|0;if((j|0)<(p|0)){if((c[r+48>>2]|0)<(p|0)){if(!p){f=0;i=j}else{c[7182]=(c[7182]|0)+1;f=xb((p<<4|3)+16|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=c[r+44>>2]|0}if((i|0)>0){h=0;do{L=f+(h<<4)|0;K=(c[r+52>>2]|0)+(h<<4)|0;c[L>>2]=c[K>>2];c[L+4>>2]=c[K+4>>2];c[L+8>>2]=c[K+8>>2];c[L+12>>2]=c[K+12>>2];h=h+1|0}while((h|0)!=(i|0))}h=c[r+52>>2]|0;if(h|0){if(a[r+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}c[r+52>>2]=0}a[r+56>>0]=1;c[r+52>>2]=f;c[r+48>>2]=p;h=r+52|0}else h=r+52|0;f=j;do{L=(c[h>>2]|0)+(f<<4)|0;c[L>>2]=c[M>>2];c[L+4>>2]=c[M+4>>2];c[L+8>>2]=c[M+8>>2];c[L+12>>2]=c[M+12>>2];f=f+1|0}while((f|0)!=(p|0))}c[r+44>>2]=p;if(m){f=0;do{K=c[(c[r+32>>2]|0)+(f<<2)>>2]|0;P=+g[K+12>>2]-+g[r+232>>2];Q=+g[K+16>>2]-+g[r+236>>2];L=c[r+52>>2]|0;g[L+(f<<4)>>2]=+g[K+8>>2]-+g[r+228>>2];g[L+(f<<4)+4>>2]=P;g[L+(f<<4)+8>>2]=Q;g[L+(f<<4)+12>>2]=0.0;f=f+1|0}while((f|0)<(c[r+44>>2]|0))}q=q+1|0}while((q|0)<(c[b+1112>>2]|0))}Yb(b);f=c[b+1112>>2]|0;d=J(f,f)|0;m=c[b+1132>>2]|0;if((d|0)>(m|0)){do if((c[b+1136>>2]|0)<(d|0)){if(!d){f=0;i=m}else{c[7182]=(c[7182]|0)+1;f=xb(d+19|0)|0;if(!f)f=0;else{c[(f+4+15&-16)+-4>>2]=f;f=f+4+15&-16}i=c[b+1132>>2]|0}j=c[b+1140>>2]|0;if((i|0)<=0){if(!j){a[b+1144>>0]=1;c[b+1140>>2]=f;c[b+1136>>2]=d;break}}else{h=0;do{a[f+h>>0]=a[j+h>>0]|0;h=h+1|0}while((h|0)!=(i|0))}if(a[b+1144>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}a[b+1144>>0]=1;c[b+1140>>2]=f;c[b+1136>>2]=d}else f=c[b+1140>>2]|0;while(0);mk(f+m|0,0,d-m|0)|0;f=c[b+1112>>2]|0}c[b+1132>>2]=d;if((f|0)<=0){b=f;sa=M;return b|0}v=c[b+1120>>2]|0;s=c[b+1140>>2]|0;r=0;do{t=c[v+(r<<2)>>2]|0;c[t+380>>2]=r;u=c[t+24>>2]|0;q=0;do{p=c[v+(q<<2)>>2]|0;d=0;while(1){if((d|0)>=(u|0)){h=0;break}i=c[p+24>>2]|0;i:do if((i|0)>0){j=c[(c[t+32>>2]|0)+(d<<2)>>2]|0;m=c[p+32>>2]|0;h=0;while(1){if((j|0)==(c[m+(h<<2)>>2]|0)){h=1;break i}h=h+1|0;if((h|0)>=(i|0)){h=0;break}}}else h=0;while(0);if(h){h=1;break}else d=d+1|0}a[s+((J(q,f)|0)+r)>>0]=h;q=q+1|0}while((q|0)!=(f|0));r=r+1|0}while((r|0)!=(f|0));sa=M;return f|0}function ob(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0.0,o=0.0,p=0,q=0.0,r=0,s=0.0,t=0,u=0,v=0.0,y=0.0,z=0,A=0.0,B=0,C=0.0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,K=0,L=0,M=0,N=0,O=0,P=0.0,Q=0.0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0;Z=sa;sa=sa+96|0;f=c[d+4>>2]|0;i=f>>>0>8?f:8;if((i|0)>0){c[7182]=(c[7182]|0)+1;f=xb((i<<4|3)+16|0)|0;if(!f)h=0;else{c[(f+4+15&-16)+-4>>2]=f;h=f+4+15&-16}f=0;do{Y=h+(f<<4)|0;c[Y>>2]=c[Z>>2];c[Y+4>>2]=c[Z+4>>2];c[Y+8>>2]=c[Z+8>>2];c[Y+12>>2]=c[Z+12>>2];f=f+1|0}while((f|0)!=(i|0));Y=h;X=h;f=c[d+4>>2]|0}else{Y=0;X=0}j=c[d+8>>2]|0;z=c[d+12>>2]|0;D=+g[d+16>>2];do if(!f){h=1;f=0}else{i=c[b+24>>2]|0;if((i|0)<0){h=c[b+32>>2]|0;if((c[b+28>>2]|0)<0){if(h|0?a[b+36>>0]|0:0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0)}a[b+36>>0]=1;c[b+32>>2]=0;c[b+28>>2]=0;h=0}mk(h+(i<<2)|0,0,J(i,-4)|0)|0}c[b+24>>2]=0;h=j;i=0;o=3402823466385288598117041.0e14;l=-3402823466385288598117041.0e14;q=3402823466385288598117041.0e14;m=-3402823466385288598117041.0e14;s=3402823466385288598117041.0e14;n=-3402823466385288598117041.0e14;while(1){Q=+g[h>>2];o=Ql?Q:l;Q=+g[h+4>>2];q=Qm?Q:m;Q=+g[h+8>>2];s=Qn?Q:n;i=i+1|0;if((i|0)==(f|0))break;else h=h+z|0}P=l-o;Q=m-q;n=n-s;C=o+P*.5;A=q+Q*.5;y=s+n*.5;do if(f>>>0<3|(P<9.999999974752427e-07|Q<9.999999974752427e-07|n<9.999999974752427e-07)){o=P>9.999999974752427e-07&P<3402823466385288598117041.0e14?P:3402823466385288598117041.0e14;o=Q>9.999999974752427e-07&Q9.999999974752427e-07&n>2]=Q;g[Y+4>>2]=I;g[Y+8>>2]=l;g[Y+16>>2]=P;g[Y+20>>2]=I;g[Y+24>>2]=l;g[Y+32>>2]=P;g[Y+36>>2]=m;g[Y+40>>2]=l;g[Y+48>>2]=Q;g[Y+52>>2]=m;g[Y+56>>2]=l;g[Y+64>>2]=Q;g[Y+68>>2]=I;g[Y+72>>2]=o;g[Y+80>>2]=P;g[Y+84>>2]=I;g[Y+88>>2]=o;g[Y+96>>2]=P;g[Y+100>>2]=m;g[Y+104>>2]=o;g[Y+112>>2]=Q;g[Y+116>>2]=m;g[Y+120>>2]=o;o=1.0;m=1.0;l=1.0;U=8;W=57}else{r=0;u=0;t=j;i=0;while(1){q=1.0/P*+g[t>>2];s=1.0/Q*+g[t+4>>2];v=1.0/n*+g[t+8>>2];t=t+z|0;if(r){h=0;do{j=Y+(h<<4)|0;l=+g[j>>2];k=Y+(h<<4)+4|0;m=+g[k>>2];p=Y+(h<<4)+8|0;o=+g[p>>2];if(+w(+(l-q))>>0>>0);if((W|0)==28){W=0;if((q-1.0/P*C)*(q-1.0/P*C)+(s-1.0/Q*A)*(s-1.0/Q*A)+(v-1.0/n*y)*(v-1.0/n*y)>(l-1.0/P*C)*(l-1.0/P*C)+(m-1.0/Q*A)*(m-1.0/Q*A)+(o-1.0/n*y)*(o-1.0/n*y)){g[j>>2]=q;g[k>>2]=s;g[p>>2]=v}}if((h|0)==(r|0))W=32;else{p=h;K=r}}else{h=0;W=32}if((W|0)==32){W=0;g[Y+(h<<4)>>2]=q;g[Y+(h<<4)+4>>2]=s;g[Y+(h<<4)+8>>2]=v;p=h;K=h+1|0}if((i|0)==(c[b+28>>2]|0)?(B=(i|0)==0?1:i<<1,(i|0)<(B|0)):0){if(!B)h=0;else{c[7182]=(c[7182]|0)+1;h=xb((B<<2|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}i=c[b+24>>2]|0}k=c[b+32>>2]|0;if((i|0)<=0){if(k)W=43}else{j=0;do{c[h+(j<<2)>>2]=c[k+(j<<2)>>2];j=j+1|0}while((j|0)!=(i|0));W=43}if((W|0)==43){W=0;if(a[b+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}c[b+32>>2]=0;i=c[b+24>>2]|0}a[b+36>>0]=1;c[b+32>>2]=h;c[b+28>>2]=B;h=i}else h=i;c[(c[b+32>>2]|0)+(h<<2)>>2]=p;i=(c[b+24>>2]|0)+1|0;c[b+24>>2]=i;u=u+1|0;if((u|0)==(f|0))break;else r=K}t=(K|0)==0;if(t){f=1;v=3402823466385288598117041.0e14;o=-3402823466385288598117041.0e14;s=3402823466385288598117041.0e14;m=-3402823466385288598117041.0e14;q=3402823466385288598117041.0e14;l=-3402823466385288598117041.0e14}else{f=0;A=3402823466385288598117041.0e14;v=3402823466385288598117041.0e14;C=-3402823466385288598117041.0e14;o=-3402823466385288598117041.0e14;E=3402823466385288598117041.0e14;s=3402823466385288598117041.0e14;F=-3402823466385288598117041.0e14;m=-3402823466385288598117041.0e14;H=3402823466385288598117041.0e14;q=3402823466385288598117041.0e14;I=-3402823466385288598117041.0e14;l=-3402823466385288598117041.0e14;while(1){y=+g[Y+(f<<4)>>2];h=yC;o=i?y:o;D=+g[Y+(f<<4)+4>>2];j=DF;m=k?D:m;G=+g[Y+(f<<4)+8>>2];p=GI;l=r?G:l;f=f+1|0;if((f|0)==(K|0))break;else{A=h?y:A;C=i?y:C;E=j?D:E;F=k?D:F;H=p?G:H;I=r?G:I}}f=K>>>0<3}A=o-v;m=m-s;o=l-q;if(!(f|(A<9.999999974752427e-07|m<9.999999974752427e-07|o<9.999999974752427e-07))){if(!t){o=P;m=Q;l=n;U=K;W=57;break}break}y=v+A*.5;v=s+m*.5;s=q+o*.5;q=A>=9.999999974752427e-07&A<3402823466385288598117041.0e14?A:3402823466385288598117041.0e14;q=m>=9.999999974752427e-07&m=9.999999974752427e-07&o>2]=I;g[Y+4>>2]=H;g[Y+8>>2]=G;g[Y+16>>2]=l;g[Y+20>>2]=H;g[Y+24>>2]=G;g[Y+32>>2]=l;g[Y+36>>2]=m;g[Y+40>>2]=G;g[Y+48>>2]=I;g[Y+52>>2]=m;g[Y+56>>2]=G;g[Y+64>>2]=I;g[Y+68>>2]=H;g[Y+72>>2]=o;g[Y+80>>2]=l;g[Y+84>>2]=H;g[Y+88>>2]=o;g[Y+96>>2]=l;g[Y+100>>2]=m;g[Y+104>>2]=o;g[Y+112>>2]=I;g[Y+116>>2]=m;g[Y+120>>2]=o;o=P;m=Q;l=n;U=8;W=57}while(0);if((W|0)==57){f=0;do{V=Y+(f<<4)|0;g[V>>2]=o*+g[V>>2];V=Y+(f<<4)+4|0;g[V>>2]=m*+g[V>>2];V=Y+(f<<4)+8|0;g[V>>2]=l*+g[V>>2];f=f+1|0}while(f>>>0>>0);M=c[d+20>>2]|0;if((U|0)>=4){l=+g[Y>>2];o=+g[Y+4>>2];m=+g[Y+8>>2];V=U<<2;c[7182]=(c[7182]|0)+1;f=xb((V|3)+16|0)|0;if(!f)i=0;else{c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}a[Z+52+16>>0]=1;R=Z+52+12|0;c[R>>2]=0;c[Z+52+4>>2]=0;B=Z+52+8|0;c[B>>2]=0;c[7182]=(c[7182]|0)+1;h=xb((V|3)+16|0)|0;if(h){c[(h+4+15&-16)+-4>>2]=h;f=c[R>>2]|0;if(!f){f=h+4+15&-16;W=63}else{c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);a[Z+52+16>>0]=1;c[R>>2]=h+4+15&-16;c[B>>2]=U;z=R}}else{f=0;W=63}if((W|0)==63){a[Z+52+16>>0]=1;c[R>>2]=f;c[B>>2]=U;z=R}u=0;f=0;y=l;v=m;n=m;p=U;t=i;q=o;s=o;k=i;h=U;r=i;while(1){if((f|0)==(h|0)?(L=(f|0)==0?1:f<<1,(f|0)<(L|0)):0){if((L|0)!=0?(c[7182]=(c[7182]|0)+1,S=xb((L<<2|3)+16|0)|0,(S|0)!=0):0){c[(S+4+15&-16)+-4>>2]=S;j=S+4+15&-16}else j=0;i=c[R>>2]|0;if((f|0)<=0){if(i)W=75}else{h=0;do{c[j+(h<<2)>>2]=c[i+(h<<2)>>2];h=h+1|0}while((h|0)!=(f|0));W=75}if((W|0)==75){W=0;c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);c[R>>2]=0;f=c[Z+52+4>>2]|0}c[z>>2]=j;c[B>>2]=L}c[(c[R>>2]|0)+(f<<2)>>2]=1;c[Z+52+4>>2]=f+1;do if((u|0)==(p|0)){f=(u|0)==0;h=f?1:u<<1;if((u|0)<(h|0)){if((h|0)!=0?(c[7182]=(c[7182]|0)+1,T=xb((h<<2|3)+16|0)|0,(T|0)!=0):0){c[(T+4+15&-16)+-4>>2]=T;i=T+4+15&-16}else i=0;if(f){if(!t){h=1;N=i;O=i;break}}else{f=0;do{c[i+(f<<2)>>2]=c[t+(f<<2)>>2];f=f+1|0}while((f|0)!=(u|0))}if(!r){N=i;O=i}else{c[7183]=(c[7183]|0)+1;Hc(c[r+-4>>2]|0);N=i;O=i}}else{h=u;N=t;O=k;i=r}}else{h=p;N=t;O=k;i=r}while(0);c[N+(u<<2)>>2]=0;f=u+1|0;P=+g[Y+(u<<4)>>2];o=P>2];s=Q>2];n=m=(U|0))break;u=f;f=c[Z+52+4>>2]|0;y=l;l=o;v=m;p=h;t=N;k=O;h=c[B>>2]|0;r=i}a[Z+52+16>>0]=1;E=+x(+((l-o)*(l-o)+(q-s)*(q-s)+(m-n)*(m-n)))*1.0000000474974513e-03;c[Z>>2]=1008981770;c[Z+4>>2]=1017370378;c[Z+8>>2]=1065353216;g[Z+12>>2]=0.0;K=_d(Y,U,Z,Z+52|0)|0;g[Z+72>>2]=-.009999999776482582;g[Z+72+4>>2]=-.019999999552965164;g[Z+72+8>>2]=-1.0;g[Z+72+12>>2]=0.0;L=_d(Y,U,Z+72|0,Z+52|0)|0;p=Y+(K<<4)|0;r=Y+(L<<4)|0;q=+g[p>>2]-+g[r>>2];t=Y+(K<<4)+4|0;u=Y+(L<<4)+4|0;s=+g[t>>2]-+g[u>>2];z=Y+(K<<4)+8|0;B=Y+(L<<4)+8|0;v=+g[z>>2]-+g[B>>2];g[Z>>2]=q;g[Z+4>>2]=s;g[Z+8>>2]=v;g[Z+12>>2]=0.0;a:do if((K|0)!=(L|0)?!(v==0.0&s==0.0&q==0.0):0){l=v*.019999999552965164-s*0.0;g[Z+16>>2]=l;g[Z+20>>2]=q*0.0-v;g[Z+24>>2]=s-q*.019999999552965164;g[Z+28>>2]=0.0;g[Z+32>>2]=v-s*0.0;g[Z+36>>2]=v*.019999999552965164+q*0.0;g[Z+40>>2]=s*-.019999999552965164-q;g[Z+44>>2]=0.0;m=+x(+(l*l+(q*0.0-v)*(q*0.0-v)+(s-q*.019999999552965164)*(s-q*.019999999552965164)));if(m>+x(+((v-s*0.0)*(v-s*0.0)+(v*.019999999552965164+q*0.0)*(v*.019999999552965164+q*0.0)+(s*-.019999999552965164-q)*(s*-.019999999552965164-q)))){g[Z+16>>2]=l*(1.0/m);g[Z+20>>2]=(q*0.0-v)*(1.0/m);o=(s-q*.019999999552965164)*(1.0/m);n=l*(1.0/m);l=(q*0.0-v)*(1.0/m)}else{c[Z+16>>2]=c[Z+32>>2];c[Z+16+4>>2]=c[Z+32+4>>2];c[Z+16+8>>2]=c[Z+32+8>>2];c[Z+16+12>>2]=c[Z+32+12>>2];n=+g[Z+16>>2];Q=+g[Z+20>>2];o=+g[Z+24>>2];l=1.0/+x(+(n*n+Q*Q+o*o));g[Z+16>>2]=n*l;g[Z+20>>2]=Q*l;o=o*l;n=n*l;l=Q*l}g[Z+24>>2]=o;f=_d(Y,U,Z+16|0,Z+52|0)|0;if((f|0)==(K|0)|(f|0)==(L|0)){g[Z+72>>2]=-n;g[Z+72+4>>2]=-l;g[Z+72+8>>2]=-o;g[Z+72+12>>2]=0.0;k=_d(Y,U,Z+72|0,Z+52|0)|0}else k=f;if(!((k|0)==(K|0)|(k|0)==(L|0))){h=Y+(k<<4)|0;l=+g[h>>2]-+g[p>>2];i=Y+(k<<4)+4|0;m=+g[i>>2]-+g[t>>2];j=Y+(k<<4)+8|0;n=+g[j>>2]-+g[z>>2];g[Z+16>>2]=l;g[Z+20>>2]=m;g[Z+24>>2]=n;g[Z+28>>2]=0.0;o=1.0/+x(+((s*l-m*q)*(s*l-m*q)+((m*v-n*s)*(m*v-n*s)+(n*q-v*l)*(n*q-v*l))));g[Z+32>>2]=(m*v-n*s)*o;g[Z+36>>2]=(n*q-v*l)*o;g[Z+40>>2]=(s*l-m*q)*o;c[Z+44>>2]=0;f=_d(Y,U,Z+32|0,Z+52|0)|0;if((f|0)==(k|0)|((f|0)==(K|0)|(f|0)==(L|0))){g[Z+72>>2]=-((m*v-n*s)*o);g[Z+72+4>>2]=-((n*q-v*l)*o);g[Z+72+8>>2]=-((s*l-m*q)*o);g[Z+72+12>>2]=0.0;f=_d(Y,U,Z+72|0,Z+52|0)|0}if(!((f|0)==(k|0)|((f|0)==(K|0)|(f|0)==(L|0)))){C=+g[p>>2];G=+g[t>>2];A=+g[z>>2];P=+g[r>>2]-C;D=+g[u>>2]-G;H=+g[B>>2]-A;I=+g[h>>2]-C;F=+g[i>>2]-G;Q=+g[j>>2]-A;T=(+g[Y+(f<<4)+8>>2]-A)*(P*F-D*I)+((+g[Y+(f<<4)>>2]-C)*(D*Q-H*F)+(+g[Y+(f<<4)+4>>2]-G)*(H*I-P*Q))<0.0;h=T?k:f;f=T?f:k;if((K|0)!=-1){A=(+g[Y+(K<<4)>>2]+ +g[Y+(L<<4)>>2]+ +g[Y+(f<<4)>>2]+ +g[Y+(h<<4)>>2])*.25;C=(+g[Y+(K<<4)+4>>2]+ +g[Y+(L<<4)+4>>2]+ +g[Y+(f<<4)+4>>2]+ +g[Y+(h<<4)+4>>2])*.25;D=(+g[Y+(K<<4)+8>>2]+ +g[Y+(L<<4)+8>>2]+ +g[Y+(f<<4)+8>>2]+ +g[Y+(h<<4)+8>>2])*.25;T=bh(b,f,h,L)|0;c[T+12>>2]=2;c[T+16>>2]=3;c[T+20>>2]=1;T=bh(b,h,f,K)|0;c[T+12>>2]=3;c[T+16>>2]=2;c[T+20>>2]=0;T=bh(b,K,L,h)|0;c[T+12>>2]=0;c[T+16>>2]=1;c[T+20>>2]=3;T=bh(b,L,K,f)|0;c[T+12>>2]=1;c[T+16>>2]=0;c[T+20>>2]=2;c[N+(h<<2)>>2]=1;c[N+(f<<2)>>2]=1;c[N+(L<<2)>>2]=1;c[N+(K<<2)>>2]=1;f=c[b+4>>2]|0;if((f|0)>0){h=0;do{f=c[(c[b+12>>2]|0)+(h<<2)>>2]|0;S=c[f>>2]|0;L=c[f+4>>2]|0;T=c[f+8>>2]|0;q=+g[Y+(L<<4)>>2];n=q-+g[Y+(S<<4)>>2];s=+g[Y+(L<<4)+4>>2];o=s-+g[Y+(S<<4)+4>>2];m=+g[Y+(L<<4)+8>>2];l=m-+g[Y+(S<<4)+8>>2];q=+g[Y+(T<<4)>>2]-q;s=+g[Y+(T<<4)+4>>2]-s;m=+g[Y+(T<<4)+8>>2]-m;v=+x(+((n*s-o*q)*(n*s-o*q)+((o*m-l*s)*(o*m-l*s)+(l*q-n*m)*(l*q-n*m))));if(v==0.0){c[Z>>2]=1065353216;c[Z+4>>2]=0;c[Z+8>>2]=0;y=1.0;m=0.0;l=0.0}else{g[Z>>2]=(o*m-l*s)*(1.0/v);g[Z+4>>2]=(l*q-n*m)*(1.0/v);g[Z+8>>2]=(n*s-o*q)*(1.0/v);y=(o*m-l*s)*(1.0/v);m=(l*q-n*m)*(1.0/v);l=(n*s-o*q)*(1.0/v)}g[Z+12>>2]=0.0;S=_d(Y,U,Z,Z+52|0)|0;c[f+28>>2]=S;T=c[f>>2]|0;g[f+32>>2]=(+g[Y+(S<<4)>>2]-+g[Y+(T<<4)>>2])*y+(+g[Y+(S<<4)+4>>2]-+g[Y+(T<<4)+4>>2])*m+(+g[Y+(S<<4)+8>>2]-+g[Y+(T<<4)+8>>2])*l;h=h+1|0;f=c[b+4>>2]|0}while((h|0)<(f|0))}h=(M|0)==0?999999996:M+-4|0;if((h|0)>0)while(1){r=c[b+12>>2]|0;k=0;i=0;do{j=c[r+(k<<2)>>2]|0;do if(i){if(!j)break;if(+g[i+32>>2]<+g[j+32>>2])W=115}else W=115;while(0);if((W|0)==115){W=0;i=j}k=k+1|0}while((k|0)<(f|0));if((i|0)==0?1:!(+g[i+32>>2]>E)){f=1;break a}t=c[i+28>>2]|0;c[N+(t<<2)>>2]=1;f=c[b+4>>2]|0;b:do if(f|0){j=Y+(t<<4)|0;k=Y+(t<<4)+4|0;p=Y+(t<<4)+8|0;i=r;while(1){f=f+-1|0;i=c[i+(f<<2)>>2]|0;do if(i|0){S=c[i>>2]|0;M=c[i+4>>2]|0;T=c[i+8>>2]|0;H=+g[Y+(M<<4)>>2];I=+g[Y+(S<<4)>>2];q=+g[Y+(M<<4)+4>>2];v=+g[Y+(S<<4)+4>>2];y=+g[Y+(M<<4)+8>>2];F=+g[Y+(S<<4)+8>>2];G=+g[Y+(T<<4)>>2]-H;s=+g[Y+(T<<4)+4>>2]-q;P=+g[Y+(T<<4)+8>>2]-y;Q=+x(+(((H-I)*s-(q-v)*G)*((H-I)*s-(q-v)*G)+(((q-v)*P-(y-F)*s)*((q-v)*P-(y-F)*s)+((y-F)*G-(H-I)*P)*((y-F)*G-(H-I)*P))));if(!((+g[p>>2]-F)*(Q==0.0?0.0:((H-I)*s-(q-v)*G)*(1.0/Q))+((+g[j>>2]-I)*(Q==0.0?1.0:((q-v)*P-(y-F)*s)*(1.0/Q))+(+g[k>>2]-v)*(Q==0.0?0.0:((y-F)*G-(H-I)*P)*(1.0/Q)))>E*.009999999776482582))break;rd(b,i,t)}while(0);if(!f)break;i=c[b+12>>2]|0}f=c[b+4>>2]|0;if(!f)break;i=f;c:do{i=i+-1|0;k=c[b+12>>2]|0;p=c[k+(i<<2)>>2]|0;do if(p){r=c[p>>2]|0;do if((r|0)!=(t|0)){j=c[p+4>>2]|0;if((j|0)==(t|0)){j=t;break}if((c[p+8>>2]|0)!=(t|0))break c}else j=c[p+4>>2]|0;while(0);T=c[p+8>>2]|0;H=+g[Y+(j<<4)>>2];I=+g[Y+(r<<4)>>2];q=+g[Y+(j<<4)+4>>2];v=+g[Y+(r<<4)+4>>2];y=+g[Y+(j<<4)+8>>2];F=+g[Y+(r<<4)+8>>2];G=+g[Y+(T<<4)>>2]-H;s=+g[Y+(T<<4)+4>>2]-q;P=+g[Y+(T<<4)+8>>2]-y;Q=+x(+(((H-I)*s-(q-v)*G)*((H-I)*s-(q-v)*G)+(((q-v)*P-(y-F)*s)*((q-v)*P-(y-F)*s)+((y-F)*G-(H-I)*P)*((y-F)*G-(H-I)*P))));if(!(QE*.009999999776482582))break;rd(b,c[k+(c[p+12>>2]<<2)>>2]|0,t);f=c[b+4>>2]|0;i=f}while(0)}while((i|0)!=0);if(!f)break;do{f=f+-1|0;j=c[(c[b+12>>2]|0)+(f<<2)>>2]|0;if(j|0){if((c[j+28>>2]|0)>-1)break b;S=c[j>>2]|0;M=c[j+4>>2]|0;T=c[j+8>>2]|0;q=+g[Y+(M<<4)>>2];n=q-+g[Y+(S<<4)>>2];s=+g[Y+(M<<4)+4>>2];o=s-+g[Y+(S<<4)+4>>2];m=+g[Y+(M<<4)+8>>2];l=m-+g[Y+(S<<4)+8>>2];q=+g[Y+(T<<4)>>2]-q;s=+g[Y+(T<<4)+4>>2]-s;m=+g[Y+(T<<4)+8>>2]-m;v=+x(+((n*s-o*q)*(n*s-o*q)+((o*m-l*s)*(o*m-l*s)+(l*q-n*m)*(l*q-n*m))));if(v==0.0){c[Z>>2]=1065353216;c[Z+4>>2]=0;c[Z+8>>2]=0;y=1.0;m=0.0;l=0.0}else{g[Z>>2]=(o*m-l*s)*(1.0/v);g[Z+4>>2]=(l*q-n*m)*(1.0/v);g[Z+8>>2]=(n*s-o*q)*(1.0/v);y=(o*m-l*s)*(1.0/v);m=(l*q-n*m)*(1.0/v);l=(n*s-o*q)*(1.0/v)}g[Z+12>>2]=0.0;i=_d(Y,U,Z,Z+52|0)|0;c[j+28>>2]=i;if(!(c[N+(i<<2)>>2]|0)){T=c[j>>2]|0;g[j+32>>2]=(+g[Y+(i<<4)>>2]-+g[Y+(T<<4)>>2])*y+(+g[Y+(i<<4)+4>>2]-+g[Y+(T<<4)+4>>2])*m+(+g[Y+(i<<4)+8>>2]-+g[Y+(T<<4)+8>>2])*l}else c[j+28>>2]=-1}}while((f|0)!=0)}while(0);if((h|0)<=1){f=1;break a}h=h+-1|0;f=c[b+4>>2]|0}else f=1}else f=0}else W=101}else W=101}else W=101;while(0);if((W|0)==101)f=0;h=c[R>>2]|0;if(h|0){c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);c[R>>2]=0}if(!((N|0)==0|(O|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[O+-4>>2]|0)}if(f){h=c[b+4>>2]|0;if((h|0)>0){B=0;r=0;j=0;p=0;u=0;i=0;while(1){k=c[(c[b+12>>2]|0)+(B<<2)>>2]|0;if(!k)f=u;else{do if((p|0)==(r|0)){h=(r|0)==0?1:r<<1;if((r|0)>=(h|0)){h=r;break}do if(!h)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((h<<2|3)+16|0)|0;if(!f){i=0;break}c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}while(0);if((r|0)>0){f=0;do{c[i+(f<<2)>>2]=c[j+(f<<2)>>2];f=f+1|0}while((f|0)!=(r|0));if(!u){j=i;u=i;break}}else if((j|0)==0|(u|0)==0){j=i;u=i;break}c[7183]=(c[7183]|0)+1;Hc(c[u+-4>>2]|0);j=i;u=i}else h=r;while(0);c[j+(p<<2)>>2]=c[k>>2];r=p+1|0;t=(c[(c[b+12>>2]|0)+(B<<2)>>2]|0)+4|0;do if((r|0)==(h|0)){k=(h|0)==0?1:h<<1;if((h|0)>=(k|0)){z=u;break}do if(!k)i=0;else{c[7182]=(c[7182]|0)+1;f=xb((k<<2|3)+16|0)|0;if(!f){i=0;break}c[(f+4+15&-16)+-4>>2]=f;i=f+4+15&-16}while(0);if((h|0)>0){f=0;do{c[i+(f<<2)>>2]=c[j+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0));if(!u){h=k;j=i;z=i;break}}else if((j|0)==0|(u|0)==0){h=k;j=i;z=i;break}c[7183]=(c[7183]|0)+1;Hc(c[u+-4>>2]|0);h=k;j=i;z=i}else z=u;while(0);c[j+(r<<2)>>2]=c[t>>2];t=p+2|0;u=(c[(c[b+12>>2]|0)+(B<<2)>>2]|0)+8|0;do if((t|0)==(h|0)){k=(h|0)==0?1:h<<1;if((h|0)>=(k|0)){k=z;break}do if(!k)r=0;else{c[7182]=(c[7182]|0)+1;f=xb((k<<2|3)+16|0)|0;if(!f){r=0;break}c[(f+4+15&-16)+-4>>2]=f;r=f+4+15&-16}while(0);if((h|0)>0){f=0;do{c[r+(f<<2)>>2]=c[j+(f<<2)>>2];f=f+1|0}while((f|0)!=(h|0));if(!z){h=k;j=r;i=r;k=r;break}}else if((j|0)==0|(z|0)==0){h=k;j=r;i=r;k=r;break}c[7183]=(c[7183]|0)+1;Hc(c[z+-4>>2]|0);h=k;j=r;i=r;k=r}else k=z;while(0);c[j+(t<<2)>>2]=c[u>>2];T=c[b+12>>2]|0;f=c[T+(B<<2)>>2]|0;c[T+(c[f+24>>2]<<2)>>2]=0;if(f|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}r=h;p=p+3|0;h=c[b+4>>2]|0;f=k}B=B+1|0;if((B|0)>=(h|0))break;else u=f}c[Z+48>>2]=(p|0)/3|0;if((p|0)>0){c[7182]=(c[7182]|0)+1;f=xb((p<<2|3)+16|0)|0;if(!f)h=0;else{c[(f+4+15&-16)+-4>>2]=f;h=f+4+15&-16}mk(h|0,0,p<<2|0)|0;f=0;do{c[h+(f<<2)>>2]=c[j+(f<<2)>>2];f=f+1|0}while((f|0)!=(p|0));k=h;f=h}else{k=0;f=0}r=i;O=p;h=c[b+4>>2]|0;K=k}else{c[Z+48>>2]=0;r=0;j=0;f=0;O=0;K=0}if((h|0)<0){if((c[b+8>>2]|0)<0){i=c[b+12>>2]|0;if(i|0){if(a[b+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[b+12>>2]=0}a[b+16>>0]=1;c[b+12>>2]=0;c[b+8>>2]=0}do{c[(c[b+12>>2]|0)+(h<<2)>>2]=0;h=h+1|0}while((h|0)!=0)}c[b+4>>2]=0;if(!((j|0)==0|(r|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[r+-4>>2]|0)}N=c[Z+48>>2]|0;k=(U|0)>0;if(k){c[7182]=(c[7182]|0)+1;h=xb((U<<4|3)+16|0)|0;if(!h)i=0;else{c[(h+4+15&-16)+-4>>2]=h;i=h+4+15&-16}h=0;do{T=i+(h<<4)|0;c[T>>2]=c[Z>>2];c[T+4>>2]=c[Z+4>>2];c[T+8>>2]=c[Z+8>>2];c[T+12>>2]=c[Z+12>>2];h=h+1|0}while((h|0)!=(U|0));M=i;L=i}else{M=0;L=0}i=c[b+24>>2]|0;do if((i|0)>0){c[7182]=(c[7182]|0)+1;h=xb((i<<2|3)+16|0)|0;if(!h)j=0;else{c[(h+4+15&-16)+-4>>2]=h;j=h+4+15&-16}mk(j|0,0,i<<2|0)|0;if((c[b+24>>2]|0)<=0){B=j;z=j;break}i=c[b+32>>2]|0;h=0;do{c[j+(h<<2)>>2]=c[i+(h<<2)>>2];h=h+1|0}while((h|0)<(c[b+24>>2]|0));B=j;z=j}else{B=0;z=0}while(0);if(k){c[7182]=(c[7182]|0)+1;h=xb((V|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}mk(h|0,0,V|0)|0;t=h;u=h}else{t=0;u=0}mk(u|0,0,V|0)|0;if((N|0)<=0)if(!t)r=0;else{h=0;W=241}else{r=0;h=0;do{i=f+(r<<2)|0;k=c[i>>2]|0;p=t+(k<<2)|0;j=c[p>>2]|0;if(!j){c[i>>2]=h;c[M+(h<<4)>>2]=c[X+(k<<4)>>2];c[M+(h<<4)+4>>2]=c[X+(k<<4)+4>>2];c[M+(h<<4)+8>>2]=c[X+(k<<4)+8>>2];i=c[b+24>>2]|0;if((i|0)>0){j=0;do{if((c[B+(j<<2)>>2]|0)==(k|0)){c[(c[b+32>>2]|0)+(j<<2)>>2]=h;i=c[b+24>>2]|0}j=j+1|0}while((j|0)<(i|0))}h=h+1|0;c[p>>2]=h}else c[i>>2]=j+-1;r=r+1|0}while((r|0)!=(N*3|0));W=241}do if((W|0)==241){if(!u){r=h;break}c[7183]=(c[7183]|0)+1;Hc(c[u+-4>>2]|0);r=h}while(0);if(!((B|0)==0|(z|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[z+-4>>2]|0)}do if(!(c[d>>2]&1)){a[e>>0]=1;c[e+4>>2]=r;k=c[e+12>>2]|0;if((k|0)<(r|0)){if((c[e+16>>2]|0)<(r|0)){if(!r){h=0;j=k}else{c[7182]=(c[7182]|0)+1;h=xb((r<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[e+12>>2]|0}if((j|0)>0){i=0;do{b=h+(i<<4)|0;W=(c[e+20>>2]|0)+(i<<4)|0;c[b>>2]=c[W>>2];c[b+4>>2]=c[W+4>>2];c[b+8>>2]=c[W+8>>2];c[b+12>>2]=c[W+12>>2];i=i+1|0}while((i|0)!=(j|0))}i=c[e+20>>2]|0;if(i|0){if(a[e+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[e+20>>2]=0}a[e+24>>0]=1;c[e+20>>2]=h;c[e+16>>2]=r;i=e+20|0}else i=e+20|0;h=k;do{b=(c[i>>2]|0)+(h<<4)|0;c[b>>2]=c[Z>>2];c[b+4>>2]=c[Z+4>>2];c[b+8>>2]=c[Z+8>>2];c[b+12>>2]=c[Z+12>>2];h=h+1|0}while((h|0)!=(r|0))}c[e+12>>2]=r;c[e+28>>2]=N;c[e+32>>2]=N<<2;p=c[e+40>>2]|0;if((N<<2|0)>(p|0)){d:do if((c[e+44>>2]|0)<(N<<2|0)){if(!(N<<2)){h=0;j=p}else{c[7182]=(c[7182]|0)+1;h=xb((N<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[e+40>>2]|0}k=c[e+48>>2]|0;do if((j|0)>0){i=0;do{c[h+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(j|0))}else{if(k|0)break;a[e+52>>0]=1;c[e+48>>2]=h;c[e+44>>2]=N<<2;break d}while(0);if(a[e+52>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}a[e+52>>0]=1;c[e+48>>2]=h;c[e+44>>2]=N<<2}else h=c[e+48>>2]|0;while(0);mk(h+(p<<2)|0,0,(N<<2)-p<<2|0)|0}c[e+40>>2]=N<<2;Bh(c[e+20>>2]|0,L|0,r<<4|0)|0;if(!N)break;k=0;h=c[e+48>>2]|0;i=f;while(1){c[h>>2]=3;if(!(c[d>>2]&2)){c[h+4>>2]=c[i>>2];j=i+8|0}else{c[h+4>>2]=c[i+8>>2];j=i}c[h+8>>2]=c[i+4>>2];c[h+12>>2]=c[j>>2];k=k+1|0;if((k|0)==(N|0))break;else{h=h+16|0;i=i+12|0}}}else{a[e>>0]=0;c[e+4>>2]=r;k=c[e+12>>2]|0;if((k|0)<(r|0)){if((c[e+16>>2]|0)<(r|0)){if(!r){h=0;j=k}else{c[7182]=(c[7182]|0)+1;h=xb((r<<4|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[e+12>>2]|0}if((j|0)>0){i=0;do{b=h+(i<<4)|0;W=(c[e+20>>2]|0)+(i<<4)|0;c[b>>2]=c[W>>2];c[b+4>>2]=c[W+4>>2];c[b+8>>2]=c[W+8>>2];c[b+12>>2]=c[W+12>>2];i=i+1|0}while((i|0)!=(j|0))}i=c[e+20>>2]|0;if(i|0){if(a[e+24>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}c[e+20>>2]=0}a[e+24>>0]=1;c[e+20>>2]=h;c[e+16>>2]=r;i=e+20|0}else i=e+20|0;h=k;do{b=(c[i>>2]|0)+(h<<4)|0;c[b>>2]=c[Z>>2];c[b+4>>2]=c[Z+4>>2];c[b+8>>2]=c[Z+8>>2];c[b+12>>2]=c[Z+12>>2];h=h+1|0}while((h|0)!=(r|0))}c[e+12>>2]=r;c[e+28>>2]=N;c[e+32>>2]=N*3;p=c[e+40>>2]|0;if((p|0)<(N*3|0)){e:do if((c[e+44>>2]|0)<(N*3|0)){if(!N){h=0;j=p}else{c[7182]=(c[7182]|0)+1;h=xb((N*12|3)+16|0)|0;if(!h)h=0;else{c[(h+4+15&-16)+-4>>2]=h;h=h+4+15&-16}j=c[e+40>>2]|0}k=c[e+48>>2]|0;do if((j|0)>0){i=0;do{c[h+(i<<2)>>2]=c[k+(i<<2)>>2];i=i+1|0}while((i|0)!=(j|0))}else{if(k|0)break;a[e+52>>0]=1;c[e+48>>2]=h;c[e+44>>2]=N*3;break e}while(0);if(a[e+52>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}a[e+52>>0]=1;c[e+48>>2]=h;c[e+44>>2]=N*3}else h=c[e+48>>2]|0;while(0);mk(h+(p<<2)|0,0,(N*12|0)-(p<<2)|0)|0}c[e+40>>2]=N*3;Bh(c[e+20>>2]|0,L|0,r<<4|0)|0;if(!(c[d>>2]&2)){Bh(c[e+48>>2]|0,K|0,N*12|0)|0;break}if(!N)break;j=0;h=c[e+48>>2]|0;i=f;while(1){c[h>>2]=c[i+8>>2];c[h+4>>2]=c[i+4>>2];c[h+8>>2]=c[i>>2];j=j+1|0;if((j|0)==(N|0))break;else{h=h+12|0;i=i+12|0}}}while(0);do if(O){if(!f){f=0;break}c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);f=0}while(0);if((M|0)==0|(L|0)==0){h=0;break}c[7183]=(c[7183]|0)+1;Hc(c[L+-4>>2]|0);h=0;break}}}h=1;f=0}while(0);if(!((Y|0)==0|(X|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[X+-4>>2]|0)}if(!f){sa=Z;return h|0}c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0);sa=Z;return h|0}function pb(b){b=b|0;var d=0,e=0,f=0,h=0,i=0.0,j=0.0,k=0.0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0.0,D=0.0,E=0.0,F=0.0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0.0,W=0.0,X=0.0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0;U=sa;sa=sa+176|0;rb(b);if(!(Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0)){sa=U;return}if((c[b+328>>2]|0)<=0){sa=U;return}S=U+96+32|0;T=U+96+52|0;L=0;do{O=c[(c[b+336>>2]|0)+(L<<2)>>2]|0;if(Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0?(K=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,(Fa[c[(c[K>>2]|0)+48>>2]&127](K)|0)&1|0):0){e=c[b+72>>2]|0;if(!(a[O+473>>0]|0))K=e;else{c[U+80>>2]=c[O+520>>2];c[U+80+4>>2]=c[O+520+4>>2];c[U+80+8>>2]=c[O+520+8>>2];c[U+80+12>>2]=c[O+520+12>>2];i=+g[O+584>>2];j=+g[O+536>>2];k=+g[O+600>>2];q=+g[O+540>>2];r=+g[O+616>>2];s=+g[O+544>>2];t=+g[O+588>>2];u=+g[O+604>>2];v=+g[O+620>>2];w=+g[O+592>>2];y=+g[O+608>>2];z=+g[O+624>>2];A=+g[O+552>>2];B=+g[O+556>>2];C=+g[O+560>>2];D=+g[O+568>>2];E=+g[O+572>>2];F=+g[O+576>>2];ea=i*j+k*q+r*s+(j*t+q*u+s*v)*0.0+(j*w+q*y+s*z)*0.0;ca=(w*A+y*B+z*C)*0.0+(i*A+k*B+r*C+(t*A+u*B+v*C)*0.0);ba=(w*D+y*E+z*F)*0.0+(i*D+k*E+r*F+(t*D+u*E+v*F)*0.0);da=1.0/+x(+(ea*ea+ca*ca+ba*ba));aa=(i*j+k*q+r*s)*0.0+(j*t+q*u+s*v)+(j*w+q*y+s*z)*0.0;_=(w*A+y*B+z*C)*0.0+(t*A+u*B+v*C+(i*A+k*B+r*C)*0.0);Z=(w*D+y*E+z*F)*0.0+(t*D+u*E+v*F+(i*D+k*E+r*F)*0.0);$=1.0/+x(+(aa*aa+_*_+Z*Z));Y=(i*j+k*q+r*s)*0.0+(j*t+q*u+s*v)*0.0+(j*w+q*y+s*z);W=w*A+y*B+z*C+((i*A+k*B+r*C)*0.0+(t*A+u*B+v*C)*0.0);V=w*D+y*E+z*F+((i*D+k*E+r*F)*0.0+(t*D+u*E+v*F)*0.0);X=1.0/+x(+(Y*Y+W*W+V*V));K=c[(c[e>>2]|0)+8>>2]|0;ca=+g[U+80+4>>2]+ca*da*10.0;ba=+g[U+80+8>>2]+ba*da*10.0;g[U+160>>2]=+g[U+80>>2]+ea*da*10.0;g[U+160+4>>2]=ca;g[U+160+8>>2]=ba;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=0;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;ab[K&127](e,U+80|0,U+160|0,U+96|0);K=c[(c[e>>2]|0)+8>>2]|0;_=_*$*10.0+ +g[U+80+4>>2];Z=Z*$*10.0+ +g[U+80+8>>2];g[U+160>>2]=aa*$*10.0+ +g[U+80>>2];g[U+160+4>>2]=_;g[U+160+8>>2]=Z;g[U+160+12>>2]=0.0;c[U+96>>2]=0;c[U+96+4>>2]=1065353216;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;ab[K&127](e,U+80|0,U+160|0,U+96|0);K=c[(c[e>>2]|0)+8>>2]|0;W=W*X*10.0+ +g[U+80+4>>2];V=V*X*10.0+ +g[U+80+8>>2];g[U+160>>2]=Y*X*10.0+ +g[U+80>>2];g[U+160+4>>2]=W;g[U+160+8>>2]=V;g[U+160+12>>2]=0.0;c[U+96>>2]=0;c[U+96+4>>2]=0;c[U+96+8>>2]=1065353216;g[U+96+12>>2]=0.0;ab[K&127](e,U+80|0,U+160|0,U+96|0);if((c[O+484>>2]|0)>0){d=0;do{K=c[O+492>>2]|0;aa=+g[K+(d<<4)>>2];ba=+g[K+(d<<4)+4>>2];ea=+g[K+(d<<4)+8>>2];ca=+g[U+80>>2]+((i*j+k*q+r*s)*aa+(j*t+q*u+s*v)*ba+(j*w+q*y+s*z)*ea);da=+g[U+80+4>>2]+((i*A+k*B+r*C)*aa+(t*A+u*B+v*C)*ba+(w*A+y*B+z*C)*ea);ea=(i*D+k*E+r*F)*aa+(t*D+u*E+v*F)*ba+(w*D+y*E+z*F)*ea+ +g[U+80+8>>2];c[U+64>>2]=1065353216;c[U+64+4>>2]=0;c[U+64+8>>2]=1065353216;g[U+64+12>>2]=0.0;K=c[(c[e>>2]|0)+8>>2]|0;g[U+160>>2]=ca+-.10000000149011612;g[U+160+4>>2]=da;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+.10000000149011612;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[K&127](e,U+160|0,U+96|0,U+64|0);K=c[(c[e>>2]|0)+8>>2]|0;g[U+160>>2]=ca;g[U+160+4>>2]=da+-.10000000149011612;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+.10000000149011612;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[K&127](e,U+160|0,U+96|0,U+64|0);K=c[(c[e>>2]|0)+8>>2]|0;g[U+160>>2]=ca;g[U+160+4>>2]=da;g[U+160+8>>2]=ea+-.10000000149011612;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+.10000000149011612;g[U+96+12>>2]=0.0;ab[K&127](e,U+160|0,U+96|0,U+64|0);d=d+1|0}while((d|0)<(c[O+484>>2]|0))}K=c[b+72>>2]|0}J=c[b+344>>2]|0;c[U+80>>2]=0;c[U+80+4>>2]=0;c[U+80+8>>2]=0;c[U+80+12>>2]=0;c[U+64>>2]=1065353216;c[U+64+4>>2]=1065353216;c[U+64+8>>2]=1065353216;g[U+64+12>>2]=0.0;c[U+48>>2]=1065353216;c[U+48+4>>2]=0;c[U+48+8>>2]=0;g[U+48+12>>2]=0.0;if(!(J&256)){if(J&1|0?(P=c[O+712>>2]|0,(P|0)>0):0){f=0;d=P;do{e=c[O+720>>2]|0;if(c[(c[e+(f*104|0)+4>>2]|0)+16>>2]&1){d=c[(c[K>>2]|0)+8>>2]|0;I=e+(f*104|0)+8|0;G=e+(f*104|0)+12|0;o=c[G>>2]|0;H=e+(f*104|0)+16|0;p=c[H>>2]|0;g[U+160>>2]=+g[I>>2]+-.10000000149011612;c[U+160+4>>2]=o;c[U+160+8>>2]=p;g[U+160+12>>2]=0.0;da=+g[G>>2]+0.0;ea=+g[H>>2]+0.0;g[U+96>>2]=+g[I>>2]+.10000000149011612;g[U+96+4>>2]=da;g[U+96+8>>2]=ea;g[U+96+12>>2]=0.0;c[U+32>>2]=1065353216;c[U+32+4>>2]=0;c[U+32+8>>2]=0;g[U+32+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[(c[K>>2]|0)+8>>2]|0;ea=+g[G>>2]+-.10000000149011612;p=c[H>>2]|0;c[U+160>>2]=c[I>>2];g[U+160+4>>2]=ea;c[U+160+8>>2]=p;g[U+160+12>>2]=0.0;ea=+g[G>>2]+.10000000149011612;da=+g[H>>2]+0.0;g[U+96>>2]=+g[I>>2]+0.0;g[U+96+4>>2]=ea;g[U+96+8>>2]=da;g[U+96+12>>2]=0.0;c[U+32>>2]=0;c[U+32+4>>2]=1065353216;c[U+32+8>>2]=0;g[U+32+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[(c[K>>2]|0)+8>>2]|0;p=c[G>>2]|0;da=+g[H>>2]+-.10000000149011612;c[U+160>>2]=c[I>>2];c[U+160+4>>2]=p;g[U+160+8>>2]=da;g[U+160+12>>2]=0.0;da=+g[G>>2]+0.0;ea=+g[H>>2]+.10000000149011612;g[U+96>>2]=+g[I>>2]+0.0;g[U+96+4>>2]=da;g[U+96+8>>2]=ea;g[U+96+12>>2]=0.0;c[U+32>>2]=0;c[U+32+4>>2]=0;c[U+32+8>>2]=1065353216;g[U+32+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[O+712>>2]|0}f=f+1|0}while((f|0)<(d|0))}if(J&2|0?(Q=c[O+732>>2]|0,(Q|0)>0):0){f=0;d=Q;do{e=c[O+740>>2]|0;if(c[(c[e+(f*52|0)+4>>2]|0)+16>>2]&1){ab[c[(c[K>>2]|0)+8>>2]&127](K,(c[e+(f*52|0)+8>>2]|0)+8|0,(c[e+(f*52|0)+12>>2]|0)+8|0,U+80|0);d=c[O+732>>2]|0}f=f+1|0}while((f|0)<(d|0))}if(J&16|0?(R=c[O+712>>2]|0,(R|0)>0):0){f=0;d=R;do{e=c[O+720>>2]|0;if(c[(c[e+(f*104|0)+4>>2]|0)+16>>2]&1){ca=+g[e+(f*104|0)+72>>2]*.5;ea=+g[e+(f*104|0)+76>>2]*.5;da=+g[e+(f*104|0)+80>>2]*.5;I=c[(c[K>>2]|0)+8>>2]|0;d=e+(f*104|0)+8|0;G=e+(f*104|0)+12|0;aa=ea+ +g[G>>2];H=e+(f*104|0)+16|0;ba=da+ +g[H>>2];g[U+160>>2]=ca+ +g[d>>2];g[U+160+4>>2]=aa;g[U+160+8>>2]=ba;g[U+160+12>>2]=0.0;ab[I&127](K,d,U+160|0,U+64|0);I=c[(c[K>>2]|0)+8>>2]|0;ea=+g[G>>2]-ea;da=+g[H>>2]-da;g[U+160>>2]=+g[d>>2]-ca;g[U+160+4>>2]=ea;g[U+160+8>>2]=da;g[U+160+12>>2]=0.0;da=+g[U+64+4>>2]*.5;ea=+g[U+64+8>>2]*.5;g[U+96>>2]=+g[U+64>>2]*.5;g[U+96+4>>2]=da;g[U+96+8>>2]=ea;g[U+96+12>>2]=0.0;ab[I&127](K,d,U+160|0,U+96|0);d=c[O+712>>2]|0}f=f+1|0}while((f|0)<(d|0))}if(J&32|0){if((a[26696]|0)==0?mz(26696)|0:0){c[6092]=1065353216;c[6093]=0;c[6094]=0;c[6095]=0;c[6096]=0;c[6097]=1065353216;c[6098]=0;c[6099]=0;c[6100]=0;c[6101]=0;c[6102]=1065353216;g[6103]=0.0}if((c[O+812>>2]|0)>0){d=0;do{I=c[O+820>>2]|0;G=c[I+(d*104|0)+24>>2]|0;A=+g[G+8>>2];H=I+(d*104|0)+4|0;B=+g[H>>2];C=+g[G+12>>2];p=I+(d*104|0)+8|0;D=+g[p>>2];V=+g[G+16>>2];G=I+(d*104|0)+12|0;W=+g[G>>2];X=+g[I+(d*104|0)+20>>2]+(A*B+C*D+V*W);g[U+160>>2]=A-B*X;g[U+160+4>>2]=C-D*X;g[U+160+8>>2]=V-W*X;g[U+160+12>>2]=0.0;Y=+g[H>>2];da=+g[p>>2];E=+g[G>>2];I=Y>2];Z=+g[24368+(I<<4)+4>>2];ba=+g[24368+(I<<4)>>2];$=1.0/+x(+((Y*Z-da*ba)*(Y*Z-da*ba)+((da*F-E*Z)*(da*F-E*Z)+(E*ba-Y*F)*(E*ba-Y*F))));_=E*(E*ba-Y*F)*$-da*(Y*Z-da*ba)*$;aa=Y*(Y*Z-da*ba)*$-E*(da*F-E*Z)*$;ca=da*(da*F-E*Z)*$-Y*(E*ba-Y*F)*$;ea=1.0/+x(+(ca*ca+(_*_+aa*aa)));I=c[(c[K>>2]|0)+8>>2]|0;g[U+96>>2]=A-B*X-(da*F-E*Z)*$*.5;g[U+96+4>>2]=C-D*X-(E*ba-Y*F)*$*.5;g[U+96+8>>2]=V-W*X-(Y*Z-da*ba)*$*.5;g[U+96+12>>2]=0.0;g[U+32>>2]=A-B*X+(da*F-E*Z)*$*.5;g[U+32+4>>2]=C-D*X+(E*ba-Y*F)*$*.5;g[U+32+8>>2]=V-W*X+(Y*Z-da*ba)*$*.5;g[U+32+12>>2]=0.0;ab[I&127](K,U+96|0,U+32|0,U+48|0);I=c[(c[K>>2]|0)+8>>2]|0;$=+g[U+160>>2];ba=+g[U+160+4>>2];da=+g[U+160+8>>2];g[U+96>>2]=$-_*ea*.5;g[U+96+4>>2]=ba-aa*ea*.5;g[U+96+8>>2]=da-ca*ea*.5;g[U+96+12>>2]=0.0;g[U+32>>2]=_*ea*.5+$;g[U+32+4>>2]=aa*ea*.5+ba;g[U+32+8>>2]=ca*ea*.5+da;g[U+32+12>>2]=0.0;ab[I&127](K,U+96|0,U+32|0,U+48|0);I=c[(c[K>>2]|0)+8>>2]|0;da=+g[p>>2]*.5*3.0+ +g[U+160+4>>2];ea=+g[G>>2]*.5*3.0+ +g[U+160+8>>2];g[U+96>>2]=+g[H>>2]*.5*3.0+ +g[U+160>>2];g[U+96+4>>2]=da;g[U+96+8>>2]=ea;g[U+96+12>>2]=0.0;c[U+32>>2]=1065353216;c[U+32+4>>2]=1065353216;c[U+32+8>>2]=0;g[U+32+12>>2]=0.0;ab[I&127](K,U+160|0,U+96|0,U+32|0);d=d+1|0}while((d|0)<(c[O+812>>2]|0))}}if(J&4|0?(c[U+160>>2]=0,c[U+160+4>>2]=1060320051,c[U+160+8>>2]=0,g[U+160+12>>2]=0.0,M=c[O+752>>2]|0,(M|0)>0):0){f=0;d=M;do{e=c[O+760>>2]|0;if(c[(c[e+(f*44|0)+4>>2]|0)+16>>2]&1){d=c[e+(f*44|0)+8>>2]|0;Y=+g[d+8>>2];$=+g[d+12>>2];ca=+g[d+16>>2];d=c[e+(f*44|0)+12>>2]|0;Z=+g[d+8>>2];aa=+g[d+12>>2];da=+g[d+16>>2];d=c[e+(f*44|0)+16>>2]|0;_=+g[d+8>>2];ba=+g[d+12>>2];ea=+g[d+16>>2];d=c[(c[K>>2]|0)+28>>2]|0;g[U+96>>2]=(Y+Z+_)*.3333333432674408+(Y-(Y+Z+_)*.3333333432674408)*.800000011920929;g[U+96+4>>2]=($+aa+ba)*.3333333432674408+($-($+aa+ba)*.3333333432674408)*.800000011920929;g[U+96+8>>2]=(ca+da+ea)*.3333333432674408+(ca-(ca+da+ea)*.3333333432674408)*.800000011920929;g[U+96+12>>2]=0.0;g[U+32>>2]=(Y+Z+_)*.3333333432674408+(Z-(Y+Z+_)*.3333333432674408)*.800000011920929;g[U+32+4>>2]=($+aa+ba)*.3333333432674408+(aa-($+aa+ba)*.3333333432674408)*.800000011920929;g[U+32+8>>2]=(ca+da+ea)*.3333333432674408+(da-(ca+da+ea)*.3333333432674408)*.800000011920929;g[U+32+12>>2]=0.0;g[U+16>>2]=(Y+Z+_)*.3333333432674408+(_-(Y+Z+_)*.3333333432674408)*.800000011920929;g[U+16+4>>2]=($+aa+ba)*.3333333432674408+(ba-($+aa+ba)*.3333333432674408)*.800000011920929;g[U+16+8>>2]=(ca+da+ea)*.3333333432674408+(ea-(ca+da+ea)*.3333333432674408)*.800000011920929;g[U+16+12>>2]=0.0;fb[d&1](K,U+96|0,U+32|0,U+16|0,U+160|0,1.0);d=c[O+752>>2]|0}f=f+1|0}while((f|0)<(d|0))}if(J&8|0?(c[U+160>>2]=1050253722,c[U+160+4>>2]=1050253722,c[U+160+8>>2]=1060320051,g[U+160+12>>2]=0.0,N=c[O+772>>2]|0,(N|0)>0):0){f=0;d=N;do{e=c[O+780>>2]|0;if(c[(c[e+(f*104|0)+4>>2]|0)+16>>2]&1){d=c[e+(f*104|0)+8>>2]|0;w=+g[d+8>>2];A=+g[d+12>>2];D=+g[d+16>>2];d=c[e+(f*104|0)+12>>2]|0;y=+g[d+8>>2];B=+g[d+12>>2];E=+g[d+16>>2];d=c[e+(f*104|0)+16>>2]|0;z=+g[d+8>>2];C=+g[d+12>>2];F=+g[d+16>>2];d=c[e+(f*104|0)+20>>2]|0;ca=+g[d+8>>2];da=+g[d+12>>2];ea=+g[d+16>>2];d=c[(c[K>>2]|0)+28>>2]|0;$=(w+y+z+ca)*.25+(w-(w+y+z+ca)*.25)*.800000011920929;aa=(A+B+C+da)*.25+(A-(A+B+C+da)*.25)*.800000011920929;ba=(D+E+F+ea)*.25+(D-(D+E+F+ea)*.25)*.800000011920929;g[U+96>>2]=$;g[U+96+4>>2]=aa;g[U+96+8>>2]=ba;g[U+96+12>>2]=0.0;V=(w+y+z+ca)*.25+(y-(w+y+z+ca)*.25)*.800000011920929;W=(A+B+C+da)*.25+(B-(A+B+C+da)*.25)*.800000011920929;X=(D+E+F+ea)*.25+(E-(D+E+F+ea)*.25)*.800000011920929;g[U+32>>2]=V;g[U+32+4>>2]=W;g[U+32+8>>2]=X;g[U+32+12>>2]=0.0;Y=(w+y+z+ca)*.25+(z-(w+y+z+ca)*.25)*.800000011920929;Z=(A+B+C+da)*.25+(C-(A+B+C+da)*.25)*.800000011920929;_=(D+E+F+ea)*.25+(F-(D+E+F+ea)*.25)*.800000011920929;g[U+16>>2]=Y;g[U+16+4>>2]=Z;g[U+16+8>>2]=_;g[U+16+12>>2]=0.0;fb[d&1](K,U+96|0,U+32|0,U+16|0,U+160|0,1.0);d=c[(c[K>>2]|0)+28>>2]|0;g[U+96>>2]=$;g[U+96+4>>2]=aa;g[U+96+8>>2]=ba;g[U+96+12>>2]=0.0;g[U+32>>2]=V;g[U+32+4>>2]=W;g[U+32+8>>2]=X;g[U+32+12>>2]=0.0;ca=(w+y+z+ca)*.25+(ca-(w+y+z+ca)*.25)*.800000011920929;da=(A+B+C+da)*.25+(da-(A+B+C+da)*.25)*.800000011920929;ea=(D+E+F+ea)*.25+(ea-(D+E+F+ea)*.25)*.800000011920929;g[U+16>>2]=ca;g[U+16+4>>2]=da;g[U+16+8>>2]=ea;g[U+16+12>>2]=0.0;fb[d&1](K,U+96|0,U+32|0,U+16|0,U+160|0,1.0);d=c[(c[K>>2]|0)+28>>2]|0;g[U+96>>2]=V;g[U+96+4>>2]=W;g[U+96+8>>2]=X;g[U+96+12>>2]=0.0;g[U+32>>2]=Y;g[U+32+4>>2]=Z;g[U+32+8>>2]=_;g[U+32+12>>2]=0.0;g[U+16>>2]=ca;g[U+16+4>>2]=da;g[U+16+8>>2]=ea;g[U+16+12>>2]=0.0;fb[d&1](K,U+96|0,U+32|0,U+16|0,U+160|0,1.0);d=c[(c[K>>2]|0)+28>>2]|0;g[U+96>>2]=Y;g[U+96+4>>2]=Z;g[U+96+8>>2]=_;g[U+96+12>>2]=0.0;g[U+32>>2]=$;g[U+32+4>>2]=aa;g[U+32+8>>2]=ba;g[U+32+12>>2]=0.0;g[U+16>>2]=ca;g[U+16+4>>2]=da;g[U+16+8>>2]=ea;g[U+16+12>>2]=0.0;fb[d&1](K,U+96|0,U+32|0,U+16|0,U+160|0,1.0);d=c[O+772>>2]|0}f=f+1|0}while((f|0)<(d|0))}}else{lI();d=c[O+1112>>2]|0;if((d|0)>0){I=0;do{if(a[(c[(c[O+1120>>2]|0)+(I<<2)>>2]|0)+377>>0]|0){ba=+(Kq()|0)*4.656612873077393e-10;ca=+(Kq()|0)*4.656612873077393e-10;da=+(Kq()|0)*4.656612873077393e-10;ea=1.0/+x(+(da*da+(ba*ba+ca*ca)));g[U+160>>2]=ba*ea*.75;g[U+160+4>>2]=ca*ea*.75;g[U+160+8>>2]=da*ea*.75;g[U+160+12>>2]=0.0;f=c[(c[(c[O+1120>>2]|0)+(I<<2)>>2]|0)+24>>2]|0;if((f|0)>0){c[7182]=(c[7182]|0)+1;d=xb((f<<4|3)+16|0)|0;if(!d)e=0;else{c[(d+4+15&-16)+-4>>2]=d;e=d+4+15&-16}d=0;do{H=e+(d<<4)|0;c[H>>2]=c[U+96>>2];c[H+4>>2]=c[U+96+4>>2];c[H+8>>2]=c[U+96+8>>2];c[H+12>>2]=c[U+96+12>>2];d=d+1|0}while((d|0)!=(f|0));d=0;do{G=(c[(c[(c[(c[O+1120>>2]|0)+(I<<2)>>2]|0)+32>>2]|0)+(d<<2)>>2]|0)+8|0;H=e+(d<<4)|0;c[H>>2]=c[G>>2];c[H+4>>2]=c[G+4>>2];c[H+8>>2]=c[G+8>>2];c[H+12>>2]=c[G+12>>2];d=d+1|0}while((d|0)!=(f|0));H=e;G=e}else{H=0;G=0}a[U+96+16>>0]=1;c[U+96+12>>2]=0;c[U+96+4>>2]=0;c[U+96+8>>2]=0;a[U+96+36>>0]=1;c[S>>2]=0;c[U+96+24>>2]=0;c[U+96+28>>2]=0;a[U+96+56>>0]=1;c[T>>2]=0;c[U+96+44>>2]=0;c[U+96+48>>2]=0;zb(U+96|0,G,f);o=c[U+96+44>>2]|0;if((o|0)>0){m=c[S>>2]|0;l=0;do{p=c[(c[T>>2]|0)+(l<<2)>>2]|0;e=c[m+(p*12|0)+4>>2]|0;d=m+(p*12|0)+(e*12|0)+((c[m+(p*12|0)+(e*12|0)>>2]|0)*12|0)|0;if((d|0)!=(m+(p*12|0)|0)){n=c[U+96+12>>2]|0;e=c[m+(p*12|0)+(e*12|0)+8>>2]|0;f=c[m+(p*12|0)+8>>2]|0;while(1){h=c[d+8>>2]|0;fb[c[(c[K>>2]|0)+28>>2]&1](K,n+(e<<4)|0,n+(f<<4)|0,n+(h<<4)|0,U+160|0,1.0);e=d+((c[d+4>>2]|0)*12|0)|0;d=e+((c[e>>2]|0)*12|0)|0;if((d|0)==(m+(p*12|0)|0))break;else{e=f;f=h}}}l=l+1|0}while((l|0)<(o|0))}d=c[T>>2]|0;if(d|0){if(a[U+96+56>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[T>>2]=0}a[U+96+56>>0]=1;c[T>>2]=0;c[U+96+44>>2]=0;c[U+96+48>>2]=0;d=c[S>>2]|0;if(d|0){if(a[U+96+36>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[S>>2]=0}a[U+96+36>>0]=1;c[S>>2]=0;c[U+96+24>>2]=0;c[U+96+28>>2]=0;d=c[U+96+12>>2]|0;if(d|0){if(a[U+96+16>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[d+-4>>2]|0)}c[U+96+12>>2]=0}if(!((H|0)==0|(G|0)==0)){c[7183]=(c[7183]|0)+1;Hc(c[G+-4>>2]|0)}d=c[O+1112>>2]|0}I=I+1|0}while((I|0)<(d|0))}}if(J&64|0){if((c[O+792>>2]|0)>0){d=0;do{I=c[O+800>>2]|0;G=c[I+(d*96|0)+20>>2]|0;aa=+g[I+(d*96|0)+4>>2];ba=+g[I+(d*96|0)+8>>2];ca=+g[I+(d*96|0)+12>>2];da=aa*+g[G+20>>2]+ba*+g[G+24>>2]+ca*+g[G+28>>2]+ +g[G+56>>2];ea=aa*+g[G+36>>2]+ba*+g[G+40>>2]+ca*+g[G+44>>2]+ +g[G+60>>2];g[U+32>>2]=aa*+g[G+4>>2]+ba*+g[G+8>>2]+ca*+g[G+12>>2]+ +g[G+52>>2];g[U+32+4>>2]=da;g[U+32+8>>2]=ea;g[U+32+12>>2]=0.0;I=I+(d*96|0)|0;G=c[I>>2]|0;c[U+16>>2]=1065353216;c[U+16+4>>2]=0;c[U+16+8>>2]=0;g[U+16+12>>2]=0.0;H=c[(c[K>>2]|0)+8>>2]|0;ea=+g[G+8>>2];da=+g[G+12>>2];ca=+g[G+16>>2];g[U+160>>2]=ea+-.25;g[U+160+4>>2]=da;g[U+160+8>>2]=ca;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+.25;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ca+0.0;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);H=c[(c[K>>2]|0)+8>>2]|0;ca=+g[G+8>>2];da=+g[G+12>>2];ea=+g[G+16>>2];g[U+160>>2]=ca;g[U+160+4>>2]=da+-.25;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+.25;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);H=c[(c[K>>2]|0)+8>>2]|0;ea=+g[G+8>>2];da=+g[G+12>>2];ca=+g[G+16>>2];g[U+160>>2]=ea;g[U+160+4>>2]=da;g[U+160+8>>2]=ca+-.25;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ca+.25;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);c[U+16>>2]=0;c[U+16+4>>2]=1065353216;c[U+16+8>>2]=0;g[U+16+12>>2]=0.0;H=c[(c[K>>2]|0)+8>>2]|0;ca=+g[U+32>>2];da=+g[U+32+4>>2];ea=+g[U+32+8>>2];g[U+160>>2]=ca+-.25;g[U+160+4>>2]=da;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+.25;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);H=c[(c[K>>2]|0)+8>>2]|0;ea=+g[U+32>>2];da=+g[U+32+4>>2];ca=+g[U+32+8>>2];g[U+160>>2]=ea;g[U+160+4>>2]=da+-.25;g[U+160+8>>2]=ca;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+0.0;g[U+96+4>>2]=da+.25;g[U+96+8>>2]=ca+0.0;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);H=c[(c[K>>2]|0)+8>>2]|0;ca=+g[U+32>>2];da=+g[U+32+4>>2];ea=+g[U+32+8>>2];g[U+160>>2]=ca;g[U+160+4>>2]=da;g[U+160+8>>2]=ea+-.25;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+.25;g[U+96+12>>2]=0.0;ab[H&127](K,U+160|0,U+96|0,U+16|0);H=c[(c[K>>2]|0)+8>>2]|0;I=(c[I>>2]|0)+8|0;c[U+160>>2]=1065353216;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;ab[H&127](K,I,U+32|0,U+160|0);d=d+1|0}while((d|0)<(c[O+792>>2]|0))}d=c[O+712>>2]|0;if((d|0)>0){f=0;do{e=c[O+720>>2]|0;if((c[(c[e+(f*104|0)+4>>2]|0)+16>>2]&1|0)!=0?+g[e+(f*104|0)+88>>2]<=0.0:0){c[U+32>>2]=1065353216;c[U+32+4>>2]=0;c[U+32+8>>2]=0;g[U+32+12>>2]=0.0;d=c[(c[K>>2]|0)+8>>2]|0;G=e+(f*104|0)+8|0;ca=+g[G>>2];H=e+(f*104|0)+12|0;da=+g[H>>2];I=e+(f*104|0)+16|0;ea=+g[I>>2];g[U+160>>2]=ca+-.25;g[U+160+4>>2]=da;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+.25;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[(c[K>>2]|0)+8>>2]|0;ea=+g[G>>2];da=+g[H>>2];ca=+g[I>>2];g[U+160>>2]=ea;g[U+160+4>>2]=da+-.25;g[U+160+8>>2]=ca;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+0.0;g[U+96+4>>2]=da+.25;g[U+96+8>>2]=ca+0.0;g[U+96+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[(c[K>>2]|0)+8>>2]|0;ca=+g[G>>2];da=+g[H>>2];ea=+g[I>>2];g[U+160>>2]=ca;g[U+160+4>>2]=da;g[U+160+8>>2]=ea+-.25;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+.25;g[U+96+12>>2]=0.0;ab[d&127](K,U+160|0,U+96|0,U+32|0);d=c[O+712>>2]|0}f=f+1|0}while((f|0)<(d|0))}}if(J&128|0?(c[O+692>>2]|0)>0:0){e=0;do{f=c[O+700>>2]|0;h=f+(e*60|0)+8|0;c[U+160>>2]=c[h>>2];c[U+160+4>>2]=c[h+4>>2];c[U+160+8>>2]=c[h+8>>2];c[U+160+12>>2]=c[h+12>>2];h=c[f+(e*60|0)+24>>2]|0;if((h|0)>0){d=0;i=+g[U+160>>2];j=+g[U+160+4>>2];k=+g[U+160+8>>2];do{I=c[f+(e*60|0)+28+(d<<2)>>2]|0;ea=+g[f+(e*60|0)+44+(d<<2)>>2];i=+g[I+8>>2]*ea+i;j=ea*+g[I+12>>2]+j;k=ea*+g[I+16>>2]+k;g[U+160+8>>2]=k;d=d+1|0}while((d|0)!=(h|0));g[U+160>>2]=i;g[U+160+4>>2]=j}Za[c[(c[K>>2]|0)+40>>2]&127](K,U+160|0,c[f+(e*60|0)+4>>2]|0);e=e+1|0}while((e|0)<(c[O+692>>2]|0))}if(J&512|0){I=c[O+928>>2]|0;c[U+160>>2]=1065353216;c[U+160+4>>2]=0;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=1065353216;c[U+96+8>>2]=1065353216;g[U+96+12>>2]=0.0;Xe(K,I,0,U+160|0,U+96|0)}if(J&1024|0){I=c[O+988>>2]|0;c[U+160>>2]=0;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=0;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=0;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;Xe(K,I,0,U+160|0,U+96|0)}if(J&2048|0){I=c[O+1048>>2]|0;c[U+160>>2]=0;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=0;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;Xe(K,I,0,U+160|0,U+96|0)}a:do if(J&4096|0?(c[O+852>>2]|0)>0:0){d=0;while(1){e=c[(c[O+860>>2]|0)+(d<<2)>>2]|0;switch(Fa[c[(c[e>>2]|0)+20>>2]&127](e)|0){case 0:{J=Jh(e+4|0)|0;ea=+g[e+28>>2];da=+g[e+32>>2];ca=+g[e+36>>2];ba=ea*+g[J+16>>2]+da*+g[J+20>>2]+ca*+g[J+24>>2]+ +g[J+52>>2];aa=ea*+g[J+32>>2]+da*+g[J+36>>2]+ca*+g[J+40>>2]+ +g[J+56>>2];g[U+32>>2]=ea*+g[J>>2]+da*+g[J+4>>2]+ca*+g[J+8>>2]+ +g[J+48>>2];g[U+32+4>>2]=ba;g[U+32+8>>2]=aa;g[U+32+12>>2]=0.0;J=Jh(e+16|0)|0;aa=+g[e+44>>2];ba=+g[e+48>>2];ca=+g[e+52>>2];da=aa*+g[J+16>>2]+ba*+g[J+20>>2]+ca*+g[J+24>>2]+ +g[J+52>>2];ea=aa*+g[J+32>>2]+ba*+g[J+36>>2]+ca*+g[J+40>>2]+ +g[J+56>>2];g[U+16>>2]=aa*+g[J>>2]+ba*+g[J+4>>2]+ca*+g[J+8>>2]+ +g[J+48>>2];g[U+16+4>>2]=da;g[U+16+8>>2]=ea;g[U+16+12>>2]=0.0;J=c[(c[K>>2]|0)+8>>2]|0;I=(Jh(e+4|0)|0)+48|0;c[U+160>>2]=1065353216;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=0;g[U+160+12>>2]=0.0;ab[J&127](K,I,U+32|0,U+160|0);I=c[(c[K>>2]|0)+8>>2]|0;J=(Jh(e+16|0)|0)+48|0;c[U+160>>2]=0;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;ab[I&127](K,J,U+16|0,U+160|0);c[U>>2]=1065353216;c[U+4>>2]=1065353216;c[U+8>>2]=0;g[U+12>>2]=0.0;J=c[(c[K>>2]|0)+8>>2]|0;ea=+g[U+32>>2];da=+g[U+32+4>>2];ca=+g[U+32+8>>2];g[U+160>>2]=ea+-.25;g[U+160+4>>2]=da;g[U+160+8>>2]=ca;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+.25;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ca+0.0;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);J=c[(c[K>>2]|0)+8>>2]|0;ca=+g[U+32>>2];da=+g[U+32+4>>2];ea=+g[U+32+8>>2];g[U+160>>2]=ca;g[U+160+4>>2]=da+-.25;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+.25;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);J=c[(c[K>>2]|0)+8>>2]|0;ea=+g[U+32>>2];da=+g[U+32+4>>2];ca=+g[U+32+8>>2];g[U+160>>2]=ea;g[U+160+4>>2]=da;g[U+160+8>>2]=ca+-.25;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ca+.25;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);c[U>>2]=0;c[U+4>>2]=1065353216;c[U+8>>2]=1065353216;g[U+12>>2]=0.0;J=c[(c[K>>2]|0)+8>>2]|0;ca=+g[U+16>>2];da=+g[U+16+4>>2];ea=+g[U+16+8>>2];g[U+160>>2]=ca+-.25;g[U+160+4>>2]=da;g[U+160+8>>2]=ea;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+.25;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+0.0;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);J=c[(c[K>>2]|0)+8>>2]|0;ea=+g[U+16>>2];da=+g[U+16+4>>2];ca=+g[U+16+8>>2];g[U+160>>2]=ea;g[U+160+4>>2]=da+-.25;g[U+160+8>>2]=ca;g[U+160+12>>2]=0.0;g[U+96>>2]=ea+0.0;g[U+96+4>>2]=da+.25;g[U+96+8>>2]=ca+0.0;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);J=c[(c[K>>2]|0)+8>>2]|0;ca=+g[U+16>>2];da=+g[U+16+4>>2];ea=+g[U+16+8>>2];g[U+160>>2]=ca;g[U+160+4>>2]=da;g[U+160+8>>2]=ea+-.25;g[U+160+12>>2]=0.0;g[U+96>>2]=ca+0.0;g[U+96+4>>2]=da+0.0;g[U+96+8>>2]=ea+.25;g[U+96+12>>2]=0.0;ab[J&127](K,U+160|0,U+96|0,U);break}case 1:{J=(Jh(e+4|0)|0)+48|0;c[U+160>>2]=c[J>>2];c[U+160+4>>2]=c[J+4>>2];c[U+160+8>>2]=c[J+8>>2];c[U+160+12>>2]=c[J+12>>2];J=(Jh(e+16|0)|0)+48|0;c[U+96>>2]=c[J>>2];c[U+96+4>>2]=c[J+4>>2];c[U+96+8>>2]=c[J+8>>2];c[U+96+12>>2]=c[J+12>>2];J=Jh(e+4|0)|0;_=+g[e+28>>2];Z=+g[e+32>>2];ba=+g[e+36>>2];$=+g[J>>2]*_+ +g[J+4>>2]*Z+ +g[J+8>>2]*ba;aa=_*+g[J+16>>2]+Z*+g[J+20>>2]+ba*+g[J+24>>2];ba=_*+g[J+32>>2]+Z*+g[J+36>>2]+ba*+g[J+40>>2];J=Jh(e+16|0)|0;Z=+g[e+44>>2];_=+g[e+48>>2];ea=+g[e+52>>2];ca=+g[J>>2]*Z+ +g[J+4>>2]*_+ +g[J+8>>2]*ea;da=Z*+g[J+16>>2]+_*+g[J+20>>2]+ea*+g[J+24>>2];ea=Z*+g[J+32>>2]+_*+g[J+36>>2]+ea*+g[J+40>>2];J=c[(c[K>>2]|0)+8>>2]|0;_=aa*10.0+ +g[U+160+4>>2];Z=ba*10.0+ +g[U+160+8>>2];g[U+32>>2]=$*10.0+ +g[U+160>>2];g[U+32+4>>2]=_;g[U+32+8>>2]=Z;g[U+32+12>>2]=0.0;c[U+16>>2]=1065353216;c[U+16+4>>2]=1065353216;c[U+16+8>>2]=0;g[U+16+12>>2]=0.0;ab[J&127](K,U+160|0,U+32|0,U+16|0);J=c[(c[K>>2]|0)+8>>2]|0;Z=da*10.0+ +g[U+160+4>>2];_=ea*10.0+ +g[U+160+8>>2];g[U+32>>2]=ca*10.0+ +g[U+160>>2];g[U+32+4>>2]=Z;g[U+32+8>>2]=_;g[U+32+12>>2]=0.0;c[U+16>>2]=1065353216;c[U+16+4>>2]=1065353216;c[U+16+8>>2]=0;g[U+16+12>>2]=0.0;ab[J&127](K,U+160|0,U+32|0,U+16|0);J=c[(c[K>>2]|0)+8>>2]|0;aa=aa*10.0+ +g[U+96+4>>2];ba=ba*10.0+ +g[U+96+8>>2];g[U+32>>2]=$*10.0+ +g[U+96>>2];g[U+32+4>>2]=aa;g[U+32+8>>2]=ba;g[U+32+12>>2]=0.0;c[U+16>>2]=0;c[U+16+4>>2]=1065353216;c[U+16+8>>2]=1065353216;g[U+16+12>>2]=0.0;ab[J&127](K,U+96|0,U+32|0,U+16|0);J=c[(c[K>>2]|0)+8>>2]|0;da=da*10.0+ +g[U+96+4>>2];ea=ea*10.0+ +g[U+96+8>>2];g[U+32>>2]=ca*10.0+ +g[U+96>>2];g[U+32+4>>2]=da;g[U+32+8>>2]=ea;g[U+32+12>>2]=0.0;c[U+16>>2]=0;c[U+16+4>>2]=1065353216;c[U+16+8>>2]=1065353216;g[U+16+12>>2]=0.0;ab[J&127](K,U+96|0,U+32|0,U+16|0);break}default:{}}d=d+1|0;if((d|0)>=(c[O+852>>2]|0))break a}}while(0)}d=c[b+72>>2]|0;if(d|0?(Fa[c[(c[d>>2]|0)+48>>2]&127](d)|0)&2|0:0){if(a[b+348>>0]|0){J=c[b+72>>2]|0;K=c[O+928>>2]|0;c[U+160>>2]=1065353216;c[U+160+4>>2]=0;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=1065353216;c[U+96+8>>2]=1065353216;g[U+96+12>>2]=0.0;Xe(J,K,0,U+160|0,U+96|0)}if(a[b+349>>0]|0){J=c[b+72>>2]|0;K=c[O+988>>2]|0;c[U+160>>2]=0;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=0;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=0;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;Xe(J,K,0,U+160|0,U+96|0)}if(a[b+350>>0]|0){K=c[b+72>>2]|0;O=c[O+1048>>2]|0;c[U+160>>2]=0;c[U+160+4>>2]=1065353216;c[U+160+8>>2]=1065353216;g[U+160+12>>2]=0.0;c[U+96>>2]=1065353216;c[U+96+4>>2]=0;c[U+96+8>>2]=0;g[U+96+12>>2]=0.0;Xe(K,O,0,U+160|0,U+96|0)}}L=L+1|0}while((L|0)<(c[b+328>>2]|0));sa=U;return}function qb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var h=0,i=0,j=0,k=0,l=0.0,m=0.0,n=0,o=0,p=0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,y=0.0,z=0.0,A=0.0,B=0.0,C=0,D=0.0,E=0.0,F=0.0,G=0.0,H=0.0,I=0.0,J=0.0,K=0.0,L=0.0,M=0.0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0.0,ea=0.0;ca=sa;sa=sa+80|0;if((e|0)<=0){sa=ca;return}T=0;do{W=c[d+(T<<2)>>2]|0;X=c[W+740>>2]|0;Y=c[W+744>>2]|0;Z=Xc(b,X,+g[f+12>>2])|0;_=Xc(b,Y,+g[f+12>>2])|0;$=c[b+16>>2]|0;if(!(((((+g[$+(Z*244|0)+128>>2]==0.0?+g[$+(Z*244|0)+132>>2]==0.0:0)?+g[$+(Z*244|0)+136>>2]==0.0:0)?+g[$+(_*244|0)+128>>2]==0.0:0)?+g[$+(_*244|0)+132>>2]==0.0:0)?+g[$+(_*244|0)+136>>2]==0.0:0))ba=9;if((ba|0)==9?(ba=0,aa=c[W+748>>2]|0,(aa|0)>0):0){U=0;h=1;i=aa;do{R=W+4+(U*184|0)|0;n=W+4+(U*184|0)+80|0;if(+g[n>>2]<=+g[W+756>>2]){S=c[b+28>>2]|0;if((S|0)==(c[b+32>>2]|0)?(V=(S|0)==0?1:S<<1,(S|0)<(V|0)):0){if(!V){i=0;k=S}else{c[7182]=(c[7182]|0)+1;i=xb((V*152|3)+16|0)|0;if(!i)i=0;else{c[(i+4+15&-16)+-4>>2]=i;i=i+4+15&-16}k=c[b+28>>2]|0}if((k|0)>0){j=0;do{Bh(i+(j*152|0)|0,(c[b+36>>2]|0)+(j*152|0)|0,152)|0;j=j+1|0}while((j|0)!=(k|0))}j=c[b+36>>2]|0;if(j|0){if(a[b+40>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[j+-4>>2]|0)}c[b+36>>2]=0}a[b+40>>0]=1;c[b+36>>2]=i;c[b+32>>2]=V;i=c[b+28>>2]|0}else i=S;c[b+28>>2]=i+1;Q=c[b+36>>2]|0;o=(c[X+236>>2]&2|0)==0?0:X;p=(c[Y+236>>2]&2|0)==0?0:Y;c[Q+(S*152|0)+144>>2]=Z;c[Q+(S*152|0)+148>>2]=_;c[Q+(S*152|0)+132>>2]=R;A=+g[W+4+(U*184|0)+48>>2]-+g[X+52>>2];B=+g[W+4+(U*184|0)+52>>2]-+g[X+56>>2];z=+g[W+4+(U*184|0)+56>>2]-+g[X+60>>2];g[ca+64>>2]=A;g[ca+64+4>>2]=B;g[ca+64+8>>2]=z;g[ca+64+12>>2]=0.0;E=+g[W+4+(U*184|0)+32>>2]-+g[Y+52>>2];F=+g[W+4+(U*184|0)+36>>2]-+g[Y+56>>2];D=+g[W+4+(U*184|0)+40>>2]-+g[Y+60>>2];g[ca+48>>2]=E;g[ca+48+4>>2]=F;g[ca+48+8>>2]=D;g[ca+48+12>>2]=0.0;if(!(c[$+(Z*244|0)+240>>2]|0)){m=0.0;r=0.0;t=0.0}else{M=+g[$+(Z*244|0)+192>>2]+ +g[$+(Z*244|0)+224>>2];t=+g[$+(Z*244|0)+196>>2]+ +g[$+(Z*244|0)+228>>2];r=+g[$+(Z*244|0)+200>>2]+ +g[$+(Z*244|0)+232>>2];m=+g[$+(Z*244|0)+176>>2]+ +g[$+(Z*244|0)+208>>2]+(z*t-B*r);r=+g[$+(Z*244|0)+180>>2]+ +g[$+(Z*244|0)+212>>2]+(A*r-z*M);t=+g[$+(Z*244|0)+184>>2]+ +g[$+(Z*244|0)+216>>2]+(B*M-A*t)}if(!(c[$+(_*244|0)+240>>2]|0)){l=0.0;q=0.0;s=0.0}else{M=+g[$+(_*244|0)+192>>2]+ +g[$+(_*244|0)+224>>2];s=+g[$+(_*244|0)+196>>2]+ +g[$+(_*244|0)+228>>2];q=+g[$+(_*244|0)+200>>2]+ +g[$+(_*244|0)+232>>2];l=+g[$+(_*244|0)+176>>2]+ +g[$+(_*244|0)+208>>2]+(D*s-F*q);q=+g[$+(_*244|0)+180>>2]+ +g[$+(_*244|0)+212>>2]+(E*q-D*M);s=+g[$+(_*244|0)+184>>2]+ +g[$+(_*244|0)+216>>2]+(F*M-E*s)}M=m-l;L=r-q;H=t-s;N=W+4+(U*184|0)+64|0;I=+g[N>>2];O=W+4+(U*184|0)+68|0;J=+g[O>>2];P=W+4+(U*184|0)+72|0;K=+g[P>>2];k=c[b+16>>2]|0;i=c[k+(Z*244|0)+240>>2]|0;j=c[k+(_*244|0)+240>>2]|0;if(i|0){l=((B*K-z*J)*+g[i+264>>2]+(z*I-K*A)*+g[i+268>>2]+(J*A-B*I)*+g[i+272>>2])*+g[i+544>>2];m=((B*K-z*J)*+g[i+280>>2]+(z*I-K*A)*+g[i+284>>2]+(J*A-B*I)*+g[i+288>>2])*+g[i+548>>2];q=((B*K-z*J)*+g[i+296>>2]+(z*I-K*A)*+g[i+300>>2]+(J*A-B*I)*+g[i+304>>2])*+g[i+552>>2]}else{l=0.0;m=0.0;q=0.0}g[Q+(S*152|0)+64>>2]=l;g[Q+(S*152|0)+68>>2]=m;g[Q+(S*152|0)+72>>2]=q;g[Q+(S*152|0)+76>>2]=0.0;u=+g[P>>2];v=+g[O>>2];y=+g[N>>2];if(j|0){r=(+g[j+264>>2]*-(F*u-D*v)+ +g[j+268>>2]*-(D*y-u*E)+ +g[j+272>>2]*-(v*E-F*y))*+g[j+544>>2];s=(+g[j+280>>2]*-(F*u-D*v)+ +g[j+284>>2]*-(D*y-u*E)+ +g[j+288>>2]*-(v*E-F*y))*+g[j+548>>2];t=(+g[j+296>>2]*-(F*u-D*v)+ +g[j+300>>2]*-(D*y-u*E)+ +g[j+304>>2]*-(v*E-F*y))*+g[j+552>>2]}else{r=0.0;s=0.0;t=0.0}g[Q+(S*152|0)+80>>2]=r;g[Q+(S*152|0)+84>>2]=s;g[Q+(S*152|0)+88>>2]=t;g[Q+(S*152|0)+92>>2]=0.0;if(i|0)m=+g[i+344>>2]+((m*z-q*B)*+g[N>>2]+(q*A-z*l)*+g[O>>2]+(B*l-m*A)*+g[P>>2]);else m=0.0;if(j|0){G=-r;l=-s;t=-t;l=+g[j+344>>2]+((D*l-F*t)*+g[N>>2]+(E*t-D*G)*+g[O>>2]+(F*G-E*l)*+g[P>>2])}else l=0.0;g[Q+(S*152|0)+108>>2]=1.0/(m+l);if(i|0){c[Q+(S*152|0)+16>>2]=c[N>>2];c[Q+(S*152|0)+16+4>>2]=c[N+4>>2];c[Q+(S*152|0)+16+8>>2]=c[N+8>>2];c[Q+(S*152|0)+16+12>>2]=c[N+12>>2];g[Q+(S*152|0)>>2]=B*K-z*J;g[Q+(S*152|0)+4>>2]=z*I-K*A;g[Q+(S*152|0)+8>>2]=J*A-B*I;g[Q+(S*152|0)+12>>2]=0.0}else{c[Q+(S*152|0)>>2]=0;c[Q+(S*152|0)+4>>2]=0;c[Q+(S*152|0)+8>>2]=0;c[Q+(S*152|0)+12>>2]=0;c[Q+(S*152|0)+16>>2]=0;c[Q+(S*152|0)+20>>2]=0;c[Q+(S*152|0)+24>>2]=0;c[Q+(S*152|0)+28>>2]=0}if(j|0){t=-+g[O>>2];G=-+g[P>>2];g[Q+(S*152|0)+48>>2]=-+g[N>>2];g[Q+(S*152|0)+52>>2]=t;g[Q+(S*152|0)+56>>2]=G;g[Q+(S*152|0)+60>>2]=0.0;g[Q+(S*152|0)+32>>2]=-(F*u-D*v);g[Q+(S*152|0)+36>>2]=-(D*y-u*E);g[Q+(S*152|0)+40>>2]=-(v*E-F*y);g[Q+(S*152|0)+44>>2]=0.0}else{c[Q+(S*152|0)+32>>2]=0;c[Q+(S*152|0)+32+4>>2]=0;c[Q+(S*152|0)+32+8>>2]=0;c[Q+(S*152|0)+32+12>>2]=0;c[Q+(S*152|0)+32+16>>2]=0;c[Q+(S*152|0)+32+20>>2]=0;c[Q+(S*152|0)+32+24>>2]=0;c[Q+(S*152|0)+32+28>>2]=0}G=+g[n>>2]+ +g[f+56>>2];if(i|0){r=+g[i+332>>2];s=+g[i+336>>2];y=+g[i+328>>2];t=r*z-s*B+ +g[i+312>>2];s=+g[i+316>>2]+(s*A-z*y);r=B*y-r*A+ +g[i+320>>2]}else{t=0.0;s=0.0;r=0.0}if(j|0){l=+g[j+332>>2];m=+g[j+336>>2];B=+g[j+328>>2];q=l*D-m*F+ +g[j+312>>2];m=+g[j+316>>2]+(m*E-D*B);l=F*B-l*E+ +g[j+320>>2]}else{q=0.0;m=0.0;l=0.0}D=(t-q)*+g[N>>2]+(s-m)*+g[O>>2]+(r-l)*+g[P>>2];c[Q+(S*152|0)+104>>2]=c[W+4+(U*184|0)+84>>2];D=D*+g[W+4+(U*184|0)+92>>2];D=D>=-0.0?0.0:-D;do if(!(c[f+64>>2]&4))g[Q+(S*152|0)+100>>2]=0.0;else{l=+g[W+4+(U*184|0)+120>>2]*+g[f+60>>2];g[Q+(S*152|0)+100>>2]=l;do if(i|0){if(!(c[k+(Z*244|0)+240>>2]|0))break;F=l*+g[Q+(S*152|0)+20>>2]*+g[k+(Z*244|0)+132>>2]*+g[i+352>>2]*+g[k+(Z*244|0)+116>>2];E=l*+g[Q+(S*152|0)+24>>2]*+g[k+(Z*244|0)+136>>2]*+g[i+356>>2]*+g[k+(Z*244|0)+120>>2];g[k+(Z*244|0)+64>>2]=+g[k+(Z*244|0)+112>>2]*l*+g[Q+(S*152|0)+16>>2]*+g[k+(Z*244|0)+128>>2]*+g[i+348>>2]+ +g[k+(Z*244|0)+64>>2];g[k+(Z*244|0)+68>>2]=F+ +g[k+(Z*244|0)+68>>2];g[k+(Z*244|0)+72>>2]=E+ +g[k+(Z*244|0)+72>>2];E=l*+g[k+(Z*244|0)+100>>2]*+g[Q+(S*152|0)+68>>2];F=l*+g[k+(Z*244|0)+104>>2]*+g[Q+(S*152|0)+72>>2];g[k+(Z*244|0)+80>>2]=l*+g[k+(Z*244|0)+96>>2]*+g[Q+(S*152|0)+64>>2]+ +g[k+(Z*244|0)+80>>2];g[k+(Z*244|0)+84>>2]=E+ +g[k+(Z*244|0)+84>>2];g[k+(Z*244|0)+88>>2]=F+ +g[k+(Z*244|0)+88>>2]}while(0);if(!j)break;l=+g[Q+(S*152|0)+100>>2];if(!(c[k+(_*244|0)+240>>2]|0))break;F=+g[Q+(S*152|0)+88>>2];E=+g[Q+(S*152|0)+84>>2];B=+g[Q+(S*152|0)+80>>2];z=l*+g[Q+(S*152|0)+52>>2]*+g[k+(_*244|0)+132>>2]*+g[j+352>>2]*+g[k+(_*244|0)+116>>2];A=l*+g[Q+(S*152|0)+56>>2]*+g[k+(_*244|0)+136>>2]*+g[j+356>>2]*+g[k+(_*244|0)+120>>2];g[k+(_*244|0)+64>>2]=+g[k+(_*244|0)+112>>2]*l*+g[Q+(S*152|0)+48>>2]*+g[k+(_*244|0)+128>>2]*+g[j+348>>2]+ +g[k+(_*244|0)+64>>2];g[k+(_*244|0)+68>>2]=z+ +g[k+(_*244|0)+68>>2];g[k+(_*244|0)+72>>2]=A+ +g[k+(_*244|0)+72>>2];E=E*+g[k+(_*244|0)+100>>2]*-l;F=F*+g[k+(_*244|0)+104>>2]*-l;g[k+(_*244|0)+80>>2]=+g[k+(_*244|0)+80>>2]-B*+g[k+(_*244|0)+96>>2]*-l;g[k+(_*244|0)+84>>2]=+g[k+(_*244|0)+84>>2]-E;g[k+(_*244|0)+88>>2]=+g[k+(_*244|0)+88>>2]-F}while(0);g[Q+(S*152|0)+96>>2]=0.0;if(!(c[k+(Z*244|0)+240>>2]|0)){l=0.0;m=0.0;q=0.0;r=0.0;s=0.0;t=0.0}else{l=+g[k+(Z*244|0)+208>>2];m=+g[k+(Z*244|0)+212>>2];q=+g[k+(Z*244|0)+216>>2];r=+g[k+(Z*244|0)+224>>2];s=+g[k+(Z*244|0)+228>>2];t=+g[k+(Z*244|0)+232>>2]}if(!(c[k+(_*244|0)+240>>2]|0)){u=0.0;v=0.0;y=0.0;z=0.0;A=0.0;B=0.0}else{u=+g[k+(_*244|0)+208>>2];v=+g[k+(_*244|0)+212>>2];y=+g[k+(_*244|0)+216>>2];z=+g[k+(_*244|0)+224>>2];A=+g[k+(_*244|0)+228>>2];B=+g[k+(_*244|0)+232>>2]}l=D-((l+ +g[k+(Z*244|0)+176>>2])*+g[Q+(S*152|0)+16>>2]+(m+ +g[k+(Z*244|0)+180>>2])*+g[Q+(S*152|0)+20>>2]+(q+ +g[k+(Z*244|0)+184>>2])*+g[Q+(S*152|0)+24>>2]+((r+ +g[k+(Z*244|0)+192>>2])*+g[Q+(S*152|0)>>2]+(s+ +g[k+(Z*244|0)+196>>2])*+g[Q+(S*152|0)+4>>2]+(t+ +g[k+(Z*244|0)+200>>2])*+g[Q+(S*152|0)+8>>2])+((u+ +g[k+(_*244|0)+176>>2])*+g[Q+(S*152|0)+48>>2]+(v+ +g[k+(_*244|0)+180>>2])*+g[Q+(S*152|0)+52>>2]+(y+ +g[k+(_*244|0)+184>>2])*+g[Q+(S*152|0)+56>>2]+((z+ +g[k+(_*244|0)+192>>2])*+g[Q+(S*152|0)+32>>2]+(A+ +g[k+(_*244|0)+196>>2])*+g[Q+(S*152|0)+36>>2]+(B+ +g[k+(_*244|0)+200>>2])*+g[Q+(S*152|0)+40>>2])));i=(c[f+44>>2]|0)==0;if(G>0.0){l=l-G/+g[f+12>>2];m=0.0}else m=-(G*(i|G>+g[f+48>>2]?+g[f+32>>2]:+g[f+36>>2]))/+g[f+12>>2];E=+g[Q+(S*152|0)+108>>2];F=m*E;E=l*E;C=i|G>+g[f+48>>2];g[Q+(S*152|0)+112>>2]=C?F+E:E;g[Q+(S*152|0)+128>>2]=C?0.0:F;g[Q+(S*152|0)+116>>2]=0.0;g[Q+(S*152|0)+120>>2]=0.0;g[Q+(S*152|0)+124>>2]=1.0e10;c[Q+(S*152|0)+140>>2]=c[b+68>>2];if(!o){m=0.0;t=0.0;u=0.0}else{m=+g[o+328>>2];t=+g[o+332>>2];u=+g[o+336>>2]}if(!p){l=0.0;q=0.0;r=0.0}else{l=+g[p+328>>2];q=+g[p+332>>2];r=+g[p+336>>2]}s=l-m;m=q-t;r=r-u;g[ca+32>>2]=s;g[ca+32+4>>2]=m;g[ca+32+8>>2]=r;g[ca+32+12>>2]=0.0;do if((h|0)>0?+g[W+4+(U*184|0)+88>>2]>0.0:0){h=h+-1|0;l=+x(+(s*s+m*m+r*r));if(l>+g[f+80>>2]){g[ca+32>>2]=s*(1.0/l);g[ca+32+4>>2]=m*(1.0/l);g[ca+32+8>>2]=r*(1.0/l);if(!(c[X+180>>2]&2)){q=s*(1.0/l);m=m*(1.0/l);l=r*(1.0/l)}else{u=+g[X+4>>2];y=+g[X+20>>2];B=+g[X+36>>2];v=+g[X+8>>2];z=+g[X+24>>2];E=+g[X+40>>2];q=+g[X+12>>2];A=+g[X+28>>2];G=+g[X+44>>2];D=(s*(1.0/l)*u+m*(1.0/l)*y+r*(1.0/l)*B)*+g[X+164>>2];F=(s*(1.0/l)*v+m*(1.0/l)*z+r*(1.0/l)*E)*+g[X+168>>2];l=(s*(1.0/l)*q+m*(1.0/l)*A+r*(1.0/l)*G)*+g[X+172>>2];g[ca+32>>2]=u*D+v*F+q*l;g[ca+32+4>>2]=y*D+z*F+A*l;g[ca+32+8>>2]=B*D+E*F+G*l;g[ca+32+12>>2]=0.0;q=u*D+v*F+q*l;m=y*D+z*F+A*l;l=B*D+E*F+G*l}if(c[Y+180>>2]&2){t=+g[Y+4>>2];y=+g[Y+20>>2];B=+g[Y+36>>2];u=+g[Y+8>>2];z=+g[Y+24>>2];E=+g[Y+40>>2];v=+g[Y+12>>2];A=+g[Y+28>>2];G=+g[Y+44>>2];D=(t*q+y*m+B*l)*+g[Y+164>>2];F=(q*u+m*z+l*E)*+g[Y+168>>2];l=(q*v+m*A+l*G)*+g[Y+172>>2];g[ca+32>>2]=t*D+u*F+v*l;g[ca+32+4>>2]=y*D+z*F+A*l;g[ca+32+8>>2]=B*D+E*F+G*l;g[ca+32+12>>2]=0.0;q=t*D+u*F+v*l;m=y*D+z*F+A*l;l=B*D+E*F+G*l}if(!(+x(+(q*q+m*m+l*l))>.001))break;Oc(b,ca+32|0,Z,_,S,R);break}Oc(b,N,Z,_,S,R);l=+g[P>>2];if(+w(+l)>.7071067690849304){G=+g[O>>2];m=1.0/+x(+(l*l+G*G));g[ca+16>>2]=0.0;g[ca+16+4>>2]=-(l*m);g[ca+16+8>>2]=G*m;g[ca>>2]=(l*l+G*G)*m;F=+g[N>>2];g[ca+4>>2]=-(F*G*m);u=F*-(l*m);r=-(l*m);s=G*m;q=(l*l+G*G)*m;m=-(F*G*m);l=0.0}else{q=+g[N>>2];F=+g[O>>2];G=1.0/+x(+(q*q+F*F));g[ca+16>>2]=-(F*G);g[ca+16+4>>2]=q*G;g[ca+16+8>>2]=0.0;g[ca>>2]=-(l*q*G);g[ca+4>>2]=l*-(F*G);u=(q*q+F*F)*G;r=q*G;s=0.0;q=-(l*q*G);m=l*-(F*G);l=-(F*G)}g[ca+8>>2]=u;j=(c[X+180>>2]&2|0)==0;if(!j){da=+g[X+4>>2];y=+g[X+20>>2];B=+g[X+36>>2];t=+g[X+8>>2];z=+g[X+24>>2];E=+g[X+40>>2];v=+g[X+12>>2];A=+g[X+28>>2];G=+g[X+44>>2];D=(da*l+y*r+B*s)*+g[X+164>>2];F=(l*t+r*z+s*E)*+g[X+168>>2];s=(l*v+r*A+s*G)*+g[X+172>>2];g[ca+16>>2]=da*D+t*F+v*s;g[ca+16+4>>2]=y*D+z*F+A*s;g[ca+16+8>>2]=B*D+E*F+G*s;g[ca+16+12>>2]=0.0;l=da*D+t*F+v*s;r=y*D+z*F+A*s;s=B*D+E*F+G*s}i=(c[Y+180>>2]&2|0)==0;if(i)t=l;else{v=+g[Y+4>>2];z=+g[Y+20>>2];D=+g[Y+36>>2];y=+g[Y+8>>2];A=+g[Y+24>>2];F=+g[Y+40>>2];t=+g[Y+12>>2];B=+g[Y+28>>2];da=+g[Y+44>>2];E=(v*l+z*r+D*s)*+g[Y+164>>2];G=(l*y+r*A+s*F)*+g[Y+168>>2];s=(l*t+r*B+s*da)*+g[Y+172>>2];g[ca+16>>2]=v*E+y*G+t*s;g[ca+16+4>>2]=z*E+A*G+B*s;g[ca+16+8>>2]=D*E+F*G+da*s;g[ca+16+12>>2]=0.0;t=v*E+y*G+t*s;r=z*E+A*G+B*s;s=D*E+F*G+da*s}if(j)l=u;else{ea=+g[X+4>>2];z=+g[X+20>>2];D=+g[X+36>>2];v=+g[X+8>>2];A=+g[X+24>>2];F=+g[X+40>>2];y=+g[X+12>>2];B=+g[X+28>>2];da=+g[X+44>>2];E=(ea*q+z*m+u*D)*+g[X+164>>2];G=(q*v+m*A+u*F)*+g[X+168>>2];l=(q*y+m*B+u*da)*+g[X+172>>2];g[ca>>2]=ea*E+v*G+y*l;g[ca+4>>2]=z*E+A*G+B*l;g[ca+8>>2]=D*E+F*G+da*l;g[ca+12>>2]=0.0;q=ea*E+v*G+y*l;m=z*E+A*G+B*l;l=D*E+F*G+da*l}if(!i){v=+g[Y+4>>2];A=+g[Y+20>>2];E=+g[Y+36>>2];y=+g[Y+8>>2];B=+g[Y+24>>2];G=+g[Y+40>>2];z=+g[Y+12>>2];D=+g[Y+28>>2];ea=+g[Y+44>>2];F=(v*q+A*m+E*l)*+g[Y+164>>2];da=(q*y+m*B+l*G)*+g[Y+168>>2];l=(q*z+m*D+l*ea)*+g[Y+172>>2];g[ca>>2]=v*F+y*da+z*l;g[ca+4>>2]=A*F+B*da+D*l;g[ca+8>>2]=E*F+G*da+ea*l;g[ca+12>>2]=0.0;q=v*F+y*da+z*l;m=A*F+B*da+D*l;l=E*F+G*da+ea*l}if(+x(+(t*t+r*r+s*s))>.001)Oc(b,ca+16|0,Z,_,S,R);if(+x(+(q*q+m*m+l*l))>.001)Oc(b,ca,Z,_,S,R)}while(0);do if(!(c[f+64>>2]&32))ba=93;else{if(!(a[W+4+(U*184|0)+116>>0]|0)){ba=93;break}qc(b,W+4+(U*184|0)+152|0,Z,_,S,R,ca+64|0,ca+48|0,1.0,+g[W+4+(U*184|0)+132>>2],+g[W+4+(U*184|0)+140>>2]);if(!(c[f+64>>2]&16))break;qc(b,W+4+(U*184|0)+168|0,Z,_,S,R,ca+64|0,ca+48|0,1.0,+g[W+4+(U*184|0)+136>>2],+g[W+4+(U*184|0)+144>>2])}while(0);do if((ba|0)==93){ba=0;l=+g[N>>2];v=+g[O>>2];u=+g[P>>2];m=M-(M*I+L*J+H*K)*l;s=L-(M*I+L*J+H*K)*v;r=H-(M*I+L*J+H*K)*u;C=W+4+(U*184|0)+152|0;g[W+4+(U*184|0)+152>>2]=m;i=W+4+(U*184|0)+156|0;g[i>>2]=s;o=W+4+(U*184|0)+160|0;g[o>>2]=r;p=W+4+(U*184|0)+164|0;g[p>>2]=0.0;if((c[f+64>>2]&64|0)==0?m*m+s*s+r*r>1.1920928955078125e-07:0){l=1.0/+x(+(m*m+s*s+r*r));g[C>>2]=m*l;g[i>>2]=s*l;g[o>>2]=r*l;if(!(c[X+180>>2]&1)){q=m*l;m=s*l;l=r*l}else{F=+g[X+4>>2];H=+g[X+20>>2];K=+g[X+36>>2];G=+g[X+8>>2];I=+g[X+24>>2];M=+g[X+40>>2];q=+g[X+12>>2];J=+g[X+28>>2];ea=+g[X+44>>2];L=(m*l*F+s*l*H+r*l*K)*+g[X+164>>2];da=(m*l*G+s*l*I+r*l*M)*+g[X+168>>2];l=(m*l*q+s*l*J+r*l*ea)*+g[X+172>>2];g[C>>2]=F*L+G*da+q*l;g[i>>2]=H*L+I*da+J*l;g[o>>2]=K*L+M*da+ea*l;g[p>>2]=0.0;q=F*L+G*da+q*l;m=H*L+I*da+J*l;l=K*L+M*da+ea*l}if(c[Y+180>>2]&1|0){D=+g[Y+4>>2];G=+g[Y+20>>2];J=+g[Y+36>>2];E=+g[Y+8>>2];H=+g[Y+24>>2];L=+g[Y+40>>2];F=+g[Y+12>>2];I=+g[Y+28>>2];da=+g[Y+44>>2];K=(D*q+G*m+J*l)*+g[Y+164>>2];M=(q*E+m*H+l*L)*+g[Y+168>>2];ea=(q*F+m*I+l*da)*+g[Y+172>>2];g[C>>2]=D*K+E*M+F*ea;g[i>>2]=G*K+H*M+I*ea;g[o>>2]=J*K+L*M+da*ea;g[p>>2]=0.0}qc(b,C,Z,_,S,R,ca+64|0,ca+48|0,1.0,0.0,0.0);if(!(c[f+64>>2]&16))break;da=+g[i>>2];q=+g[P>>2];K=+g[o>>2];L=+g[O>>2];ea=+g[N>>2];M=+g[C>>2];n=W+4+(U*184|0)+168|0;g[W+4+(U*184|0)+168>>2]=da*q-K*L;i=W+4+(U*184|0)+172|0;j=W+4+(U*184|0)+176|0;k=W+4+(U*184|0)+180|0;g[k>>2]=0.0;m=1.0/+x(+((da*q-K*L)*(da*q-K*L)+(K*ea-q*M)*(K*ea-q*M)+(L*M-da*ea)*(L*M-da*ea)));l=(da*q-K*L)*m;g[n>>2]=l;q=(K*ea-q*M)*m;g[i>>2]=q;m=(L*M-da*ea)*m;g[j>>2]=m;if(c[X+180>>2]&1){E=+g[X+4>>2];H=+g[X+20>>2];K=+g[X+36>>2];F=+g[X+8>>2];I=+g[X+24>>2];M=+g[X+40>>2];G=+g[X+12>>2];J=+g[X+28>>2];ea=+g[X+44>>2];L=(l*E+q*H+m*K)*+g[X+164>>2];da=(l*F+q*I+m*M)*+g[X+168>>2];m=(l*G+q*J+m*ea)*+g[X+172>>2];g[n>>2]=E*L+F*da+G*m;g[i>>2]=H*L+I*da+J*m;g[j>>2]=K*L+M*da+ea*m;g[k>>2]=0.0;l=E*L+F*da+G*m;q=H*L+I*da+J*m;m=K*L+M*da+ea*m}if(c[Y+180>>2]&1|0){D=+g[Y+4>>2];G=+g[Y+20>>2];J=+g[Y+36>>2];E=+g[Y+8>>2];H=+g[Y+24>>2];L=+g[Y+40>>2];F=+g[Y+12>>2];I=+g[Y+28>>2];da=+g[Y+44>>2];K=(D*l+G*q+J*m)*+g[Y+164>>2];M=(l*E+q*H+m*L)*+g[Y+168>>2];ea=(l*F+q*I+m*da)*+g[Y+172>>2];g[n>>2]=D*K+E*M+F*ea;g[i>>2]=G*K+H*M+I*ea;g[j>>2]=J*K+L*M+da*ea;g[k>>2]=0.0}qc(b,n,Z,_,S,R,ca+64|0,ca+48|0,1.0,0.0,0.0);break}n=W+4+(U*184|0)+168|0;if(+w(+u)>.7071067690849304){ea=1.0/+x(+(v*v+u*u));g[C>>2]=0.0;g[i>>2]=-(u*ea);g[o>>2]=v*ea;s=-(l*v*ea);t=l*-(u*ea);r=(v*v+u*u)*ea;q=0.0;m=-(u*ea);l=v*ea}else{m=1.0/+x(+(l*l+v*v));g[C>>2]=-(v*m);g[i>>2]=l*m;g[o>>2]=0.0;s=u*-(v*m);t=(l*l+v*v)*m;r=-(u*l*m);q=-(v*m);m=l*m;l=0.0}g[n>>2]=r;k=W+4+(U*184|0)+172|0;g[k>>2]=s;j=W+4+(U*184|0)+176|0;g[j>>2]=t;if(c[X+180>>2]&1){E=+g[X+4>>2];H=+g[X+20>>2];K=+g[X+36>>2];F=+g[X+8>>2];I=+g[X+24>>2];M=+g[X+40>>2];G=+g[X+12>>2];J=+g[X+28>>2];ea=+g[X+44>>2];L=(E*q+H*m+K*l)*+g[X+164>>2];da=(q*F+m*I+l*M)*+g[X+168>>2];l=(q*G+m*J+l*ea)*+g[X+172>>2];g[C>>2]=E*L+F*da+G*l;g[i>>2]=H*L+I*da+J*l;g[o>>2]=K*L+M*da+ea*l;g[p>>2]=0.0;q=E*L+F*da+G*l;m=H*L+I*da+J*l;l=K*L+M*da+ea*l}if(c[Y+180>>2]&1|0){D=+g[Y+4>>2];G=+g[Y+20>>2];J=+g[Y+36>>2];E=+g[Y+8>>2];H=+g[Y+24>>2];L=+g[Y+40>>2];F=+g[Y+12>>2];I=+g[Y+28>>2];da=+g[Y+44>>2];K=(D*q+G*m+J*l)*+g[Y+164>>2];M=(q*E+m*H+l*L)*+g[Y+168>>2];ea=(q*F+m*I+l*da)*+g[Y+172>>2];g[C>>2]=D*K+E*M+F*ea;g[i>>2]=G*K+H*M+I*ea;g[o>>2]=J*K+L*M+da*ea;g[p>>2]=0.0}qc(b,C,Z,_,S,R,ca+64|0,ca+48|0,1.0,0.0,0.0);i=c[f+64>>2]|0;if(i&16){if(c[X+180>>2]&1|0){D=+g[X+4>>2];A=+g[n>>2];G=+g[X+20>>2];B=+g[k>>2];J=+g[X+36>>2];ea=+g[j>>2];E=+g[X+8>>2];H=+g[X+24>>2];L=+g[X+40>>2];F=+g[X+12>>2];I=+g[X+28>>2];da=+g[X+44>>2];K=(D*A+G*B+J*ea)*+g[X+164>>2];M=(A*E+B*H+ea*L)*+g[X+168>>2];ea=(A*F+B*I+ea*da)*+g[X+172>>2];g[n>>2]=D*K+E*M+F*ea;g[k>>2]=G*K+H*M+I*ea;g[j>>2]=J*K+L*M+da*ea;g[W+4+(U*184|0)+180>>2]=0.0}if(c[Y+180>>2]&1|0){D=+g[Y+4>>2];A=+g[n>>2];G=+g[Y+20>>2];B=+g[k>>2];J=+g[Y+36>>2];ea=+g[j>>2];E=+g[Y+8>>2];H=+g[Y+24>>2];L=+g[Y+40>>2];F=+g[Y+12>>2];I=+g[Y+28>>2];da=+g[Y+44>>2];K=(D*A+G*B+J*ea)*+g[Y+164>>2];M=(A*E+B*H+ea*L)*+g[Y+168>>2];ea=(A*F+B*I+ea*da)*+g[Y+172>>2];g[n>>2]=D*K+E*M+F*ea;g[k>>2]=G*K+H*M+I*ea;g[j>>2]=J*K+L*M+da*ea;g[W+4+(U*184|0)+180>>2]=0.0}qc(b,n,Z,_,S,R,ca+64|0,ca+48|0,1.0,0.0,0.0);i=c[f+64>>2]|0}if((i&80|0)!=80)break;a[W+4+(U*184|0)+116>>0]=1}while(0);n=c[b+16>>2]|0;o=c[n+(Z*244|0)+240>>2]|0;p=c[n+(_*244|0)+240>>2]|0;j=c[Q+(S*152|0)+140>>2]|0;k=c[b+76>>2]|0;i=c[f+64>>2]|0;do if(!(i&4))g[k+(j*152|0)+100>>2]=0.0;else{l=+g[W+4+(U*184|0)+124>>2]*+g[f+60>>2];g[k+(j*152|0)+100>>2]=l;if(o|0){M=+g[o+344>>2];ea=l*M*+g[k+(j*152|0)+20>>2]*+g[o+352>>2]*+g[n+(Z*244|0)+116>>2];da=l*M*+g[k+(j*152|0)+24>>2]*+g[o+356>>2]*+g[n+(Z*244|0)+120>>2];g[n+(Z*244|0)+64>>2]=l*M*+g[k+(j*152|0)+16>>2]*+g[o+348>>2]*+g[n+(Z*244|0)+112>>2]+ +g[n+(Z*244|0)+64>>2];g[n+(Z*244|0)+68>>2]=ea+ +g[n+(Z*244|0)+68>>2];g[n+(Z*244|0)+72>>2]=da+ +g[n+(Z*244|0)+72>>2];da=l*+g[n+(Z*244|0)+100>>2]*+g[k+(j*152|0)+68>>2];ea=l*+g[n+(Z*244|0)+104>>2]*+g[k+(j*152|0)+72>>2];g[n+(Z*244|0)+80>>2]=l*+g[n+(Z*244|0)+96>>2]*+g[k+(j*152|0)+64>>2]+ +g[n+(Z*244|0)+80>>2];g[n+(Z*244|0)+84>>2]=da+ +g[n+(Z*244|0)+84>>2];g[n+(Z*244|0)+88>>2]=ea+ +g[n+(Z*244|0)+88>>2]}if(!p)break;I=+g[p+344>>2];L=+g[k+(j*152|0)+80>>2];da=+g[k+(j*152|0)+84>>2];ea=+g[k+(j*152|0)+88>>2];M=+g[k+(j*152|0)+100>>2];J=+g[k+(j*152|0)+52>>2]*I*+g[p+352>>2]*M*+g[n+(_*244|0)+116>>2];K=+g[k+(j*152|0)+56>>2]*I*+g[p+356>>2]*M*+g[n+(_*244|0)+120>>2];g[n+(_*244|0)+64>>2]=+g[k+(j*152|0)+48>>2]*I*+g[p+348>>2]*M*+g[n+(_*244|0)+112>>2]+ +g[n+(_*244|0)+64>>2];g[n+(_*244|0)+68>>2]=J+ +g[n+(_*244|0)+68>>2];g[n+(_*244|0)+72>>2]=K+ +g[n+(_*244|0)+72>>2];da=da*+g[n+(_*244|0)+100>>2]*-M;ea=ea*+g[n+(_*244|0)+104>>2]*-M;g[n+(_*244|0)+80>>2]=+g[n+(_*244|0)+80>>2]-L*+g[n+(_*244|0)+96>>2]*-M;g[n+(_*244|0)+84>>2]=+g[n+(_*244|0)+84>>2]-da;g[n+(_*244|0)+88>>2]=+g[n+(_*244|0)+88>>2]-ea}while(0);do if(i&16|0){if(!(i&4)){g[k+((j+1|0)*152|0)+100>>2]=0.0;break}l=+g[W+4+(U*184|0)+128>>2]*+g[f+60>>2];g[k+((j+1|0)*152|0)+100>>2]=l;if(o|0){M=+g[o+344>>2];ea=l*M*+g[k+((j+1|0)*152|0)+20>>2]*+g[n+(Z*244|0)+116>>2];da=l*M*+g[k+((j+1|0)*152|0)+24>>2]*+g[n+(Z*244|0)+120>>2];g[n+(Z*244|0)+64>>2]=l*M*+g[k+((j+1|0)*152|0)+16>>2]*+g[n+(Z*244|0)+112>>2]+ +g[n+(Z*244|0)+64>>2];g[n+(Z*244|0)+68>>2]=ea+ +g[n+(Z*244|0)+68>>2];g[n+(Z*244|0)+72>>2]=da+ +g[n+(Z*244|0)+72>>2];da=l*+g[n+(Z*244|0)+100>>2]*+g[k+((j+1|0)*152|0)+68>>2];ea=l*+g[n+(Z*244|0)+104>>2]*+g[k+((j+1|0)*152|0)+72>>2];g[n+(Z*244|0)+80>>2]=l*+g[n+(Z*244|0)+96>>2]*+g[k+((j+1|0)*152|0)+64>>2]+ +g[n+(Z*244|0)+80>>2];g[n+(Z*244|0)+84>>2]=da+ +g[n+(Z*244|0)+84>>2];g[n+(Z*244|0)+88>>2]=ea+ +g[n+(Z*244|0)+88>>2]}if(!p)break;I=+g[p+344>>2];L=+g[k+((j+1|0)*152|0)+80>>2];da=+g[k+((j+1|0)*152|0)+84>>2];ea=+g[k+((j+1|0)*152|0)+88>>2];M=+g[k+((j+1|0)*152|0)+100>>2];J=+g[k+((j+1|0)*152|0)+52>>2]*I*M*+g[n+(_*244|0)+116>>2];K=+g[k+((j+1|0)*152|0)+56>>2]*I*M*+g[n+(_*244|0)+120>>2];g[n+(_*244|0)+64>>2]=+g[k+((j+1|0)*152|0)+48>>2]*I*M*+g[n+(_*244|0)+112>>2]+ +g[n+(_*244|0)+64>>2];g[n+(_*244|0)+68>>2]=J+ +g[n+(_*244|0)+68>>2];g[n+(_*244|0)+72>>2]=K+ +g[n+(_*244|0)+72>>2];da=da*+g[n+(_*244|0)+100>>2]*-M;ea=ea*+g[n+(_*244|0)+104>>2]*-M;g[n+(_*244|0)+80>>2]=+g[n+(_*244|0)+80>>2]-L*+g[n+(_*244|0)+96>>2]*-M;g[n+(_*244|0)+84>>2]=+g[n+(_*244|0)+84>>2]-da;g[n+(_*244|0)+88>>2]=+g[n+(_*244|0)+88>>2]-ea}while(0);i=c[W+748>>2]|0}U=U+1|0}while((U|0)<(i|0))}T=T+1|0}while((T|0)!=(e|0));sa=ca;return}function rb(b){b=b|0;var d=0,e=0,f=0.0,h=0.0,i=0.0,k=0,l=0,m=0,n=0,o=0,p=0.0,q=0.0,r=0.0,s=0.0,t=0.0,u=0.0,v=0.0,w=0.0,x=0.0,y=0.0,B=0.0,C=0.0,D=0,E=0.0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0,ja=0,ka=0,ma=0;Z=sa;sa=sa+176|0;Ki(16605);qd(b);if((Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0?(X=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,(Fa[c[(c[X>>2]|0)+48>>2]&127](X)|0)&6144|0):0)?(d=Fa[c[(c[b>>2]|0)+104>>2]&127](b)|0,(d|0)>0):0){Q=Z+112+44|0;L=Z+112+4|0;N=Z+112+8|0;O=Z+112+16|0;P=Z+112+20|0;G=Z+112+24|0;H=Z+112+32|0;I=Z+112+36|0;J=Z+112+40|0;F=Z+112+48|0;K=Z+112+52|0;M=Z+112+56|0;R=Z+112+16|0;S=Z+112+32|0;T=Z+112+48|0;U=Z+112+16|0;V=Z+112+32|0;W=Z+112+48|0;X=Z+112+48|0;do{D=d;d=d+-1|0;o=Ha[c[(c[b>>2]|0)+108>>2]&31](b,d)|0;e=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;e=((Fa[c[(c[e>>2]|0)+48>>2]&127](e)|0)&2048|0)!=0;n=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=((Fa[c[(c[n>>2]|0)+48>>2]&127](n)|0)&4096|0)!=0;E=+g[o+40>>2];a:do if(!(E<=0.0))switch(c[o+4>>2]|0){case 3:{c[Z+112>>2]=1065353216;c[Z+112+4>>2]=0;c[Z+112+4+4>>2]=0;c[Z+112+4+8>>2]=0;c[Z+112+4+12>>2]=0;c[Z+112+20>>2]=1065353216;c[Z+112+24>>2]=0;c[Z+112+24+4>>2]=0;c[Z+112+24+8>>2]=0;c[Z+112+24+12>>2]=0;c[Z+112+40>>2]=1065353216;c[Q>>2]=0;c[Q+4>>2]=0;c[Q+8>>2]=0;c[Q+12>>2]=0;c[Q+16>>2]=0;C=+g[o+300>>2];B=+g[o+304>>2];y=+g[o+308>>2];n=c[o+28>>2]|0;x=C*+g[n+20>>2]+B*+g[n+24>>2]+y*+g[n+28>>2]+ +g[n+56>>2];w=C*+g[n+36>>2]+B*+g[n+40>>2]+y*+g[n+44>>2]+ +g[n+60>>2];g[Z+112+48>>2]=C*+g[n+4>>2]+B*+g[n+8>>2]+y*+g[n+12>>2]+ +g[n+52>>2];g[Z+112+52>>2]=x;g[Z+112+56>>2]=w;g[Z+112+60>>2]=0.0;n=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[n>>2]|0)+56>>2]&7](n,Z+112|0,E);w=+g[o+316>>2];x=+g[o+320>>2];y=+g[o+324>>2];o=c[o+32>>2]|0;B=w*+g[o+20>>2]+x*+g[o+24>>2]+y*+g[o+28>>2]+ +g[o+56>>2];C=w*+g[o+36>>2]+x*+g[o+40>>2]+y*+g[o+44>>2]+ +g[o+60>>2];g[Z+112+48>>2]=w*+g[o+4>>2]+x*+g[o+8>>2]+y*+g[o+12>>2]+ +g[o+52>>2];g[Z+112+52>>2]=B;g[Z+112+56>>2]=C;g[Z+112+60>>2]=0.0;if(e){o=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[o>>2]|0)+56>>2]&7](o,Z+112|0,E)}break a}case 4:{m=c[o+28>>2]|0;f=+g[o+552>>2];da=+g[m+4>>2];h=+g[o+552+16>>2];ca=+g[m+8>>2];i=+g[o+552+32>>2];ba=+g[m+12>>2];p=+g[o+552+4>>2];q=+g[o+552+20>>2];r=+g[o+552+36>>2];s=+g[o+552+8>>2];u=+g[o+552+24>>2];w=+g[o+552+40>>2];aa=+g[m+20>>2];$=+g[m+24>>2];_=+g[m+28>>2];t=+g[m+36>>2];v=+g[m+40>>2];x=+g[m+44>>2];fa=+g[o+552+48>>2];ea=+g[o+552+52>>2];C=+g[o+552+56>>2];y=+g[m+52>>2]+(da*fa+ca*ea+ba*C);B=aa*fa+$*ea+_*C+ +g[m+56>>2];C=t*fa+v*ea+x*C+ +g[m+60>>2];g[Z+112>>2]=f*da+h*ca+i*ba;g[Z+112+4>>2]=da*p+ca*q+ba*r;g[Z+112+8>>2]=da*s+ca*u+ba*w;g[Z+112+12>>2]=0.0;g[Z+112+16>>2]=f*aa+h*$+i*_;g[Z+112+20>>2]=p*aa+q*$+r*_;g[Z+112+24>>2]=s*aa+u*$+w*_;g[Z+112+28>>2]=0.0;g[Z+112+32>>2]=f*t+h*v+i*x;g[Z+112+36>>2]=p*t+q*v+r*x;g[Z+112+40>>2]=s*t+u*v+w*x;g[Z+112+44>>2]=0.0;g[Z+112+48>>2]=y;g[Z+112+52>>2]=B;g[Z+112+56>>2]=C;g[Z+112+60>>2]=0.0;if(e){m=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[m>>2]|0)+56>>2]&7](m,Z+112|0,E);m=c[o+32>>2]|0;u=+g[o+616>>2];i=+g[m+4>>2];v=+g[o+616+16>>2];p=+g[m+8>>2];w=+g[o+616+32>>2];q=+g[m+12>>2];x=+g[o+616+4>>2];y=+g[o+616+20>>2];B=+g[o+616+36>>2];C=+g[o+616+8>>2];$=+g[o+616+24>>2];ba=+g[o+616+40>>2];r=+g[m+20>>2];s=+g[m+24>>2];t=+g[m+28>>2];_=+g[m+36>>2];aa=+g[m+40>>2];ca=+g[m+44>>2];f=+g[o+616+48>>2];h=+g[o+616+52>>2];fa=+g[o+616+56>>2];da=+g[m+52>>2]+(i*f+p*h+q*fa);ea=r*f+s*h+t*fa+ +g[m+56>>2];fa=_*f+aa*h+ca*fa+ +g[m+60>>2];g[Z+112>>2]=u*i+v*p+w*q;g[Z+112+4>>2]=i*x+p*y+q*B;g[Z+112+8>>2]=i*C+p*$+q*ba;g[Z+112+12>>2]=0.0;g[Z+112+16>>2]=u*r+v*s+w*t;g[Z+112+20>>2]=x*r+y*s+B*t;g[Z+112+24>>2]=C*r+$*s+ba*t;g[Z+112+28>>2]=0.0;g[Z+112+32>>2]=u*_+v*aa+w*ca;g[Z+112+36>>2]=x*_+y*aa+B*ca;g[Z+112+40>>2]=C*_+$*aa+ba*ca;g[Z+112+44>>2]=0.0;g[Z+112+48>>2]=da;g[Z+112+52>>2]=ea;g[Z+112+56>>2]=fa;g[Z+112+60>>2]=0.0;m=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[m>>2]|0)+56>>2]&7](m,Z+112|0,E)}else{m=c[o+32>>2]|0;u=+g[o+616>>2];i=+g[m+4>>2];v=+g[o+616+16>>2];p=+g[m+8>>2];w=+g[o+616+32>>2];q=+g[m+12>>2];x=+g[o+616+4>>2];y=+g[o+616+20>>2];B=+g[o+616+36>>2];C=+g[o+616+8>>2];$=+g[o+616+24>>2];ba=+g[o+616+40>>2];r=+g[m+20>>2];s=+g[m+24>>2];t=+g[m+28>>2];_=+g[m+36>>2];aa=+g[m+40>>2];ca=+g[m+44>>2];f=+g[o+616+48>>2];h=+g[o+616+52>>2];fa=+g[o+616+56>>2];da=+g[m+52>>2]+(i*f+p*h+q*fa);ea=r*f+s*h+t*fa+ +g[m+56>>2];fa=_*f+aa*h+ca*fa+ +g[m+60>>2];g[Z+112>>2]=u*i+v*p+w*q;g[Z+112+4>>2]=i*x+p*y+q*B;g[Z+112+8>>2]=i*C+p*$+q*ba;g[Z+112+12>>2]=0.0;g[Z+112+16>>2]=u*r+v*s+w*t;g[Z+112+20>>2]=x*r+y*s+B*t;g[Z+112+24>>2]=C*r+$*s+ba*t;g[Z+112+28>>2]=0.0;g[Z+112+32>>2]=u*_+v*aa+w*ca;g[Z+112+36>>2]=x*_+y*aa+B*ca;g[Z+112+40>>2]=C*_+$*aa+ba*ca;g[Z+112+44>>2]=0.0;g[Z+112+48>>2]=da;g[Z+112+52>>2]=ea;g[Z+112+56>>2]=fa;g[Z+112+60>>2]=0.0}i=+g[o+688>>2];f=+g[o+688+4>>2];if(!((i-f)%6.2831854820251465<-3.1415927410125732))if((i-f)%6.2831854820251465>3.1415927410125732)h=(i-f)%6.2831854820251465+-6.2831854820251465;else h=(i-f)%6.2831854820251465;else h=(i-f)%6.2831854820251465+6.2831854820251465;if(!((i+f)%6.2831854820251465<-3.1415927410125732))if((i+f)%6.2831854820251465>3.1415927410125732)f=(i+f)%6.2831854820251465+-6.2831854820251465;else f=(i+f)%6.2831854820251465;else f=(i+f)%6.2831854820251465+6.2831854820251465;if(!(h==f)?(Y=h>f,n):0){c[Z+96>>2]=c[Z+112+8>>2];c[Z+96+4>>2]=c[Z+112+24>>2];c[Z+96+8>>2]=c[Z+112+40>>2];g[Z+96+12>>2]=0.0;c[Z+80>>2]=c[Z+112>>2];c[Z+80+4>>2]=c[Z+112+16>>2];c[Z+80+8>>2]=c[Z+112+32>>2];g[Z+80+12>>2]=0.0;o=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=c[(c[o>>2]|0)+60>>2]|0;c[Z+64>>2]=0;c[Z+64+4>>2]=0;c[Z+64+8>>2]=0;c[Z+64+12>>2]=0;db[n&1](o,Z+112+48|0,Z+96|0,Z+80|0,E,E,Y?0.0:h,Y?6.2831854820251465:f,Z+64|0,Y^1,10.0)}break a}case 5:{m=c[o+28>>2]|0;u=+g[o+300>>2];i=+g[m+4>>2];v=+g[o+300+16>>2];p=+g[m+8>>2];w=+g[o+300+32>>2];q=+g[m+12>>2];x=+g[o+300+4>>2];y=+g[o+300+20>>2];B=+g[o+300+36>>2];C=+g[o+300+8>>2];$=+g[o+300+24>>2];ba=+g[o+300+40>>2];r=+g[m+20>>2];s=+g[m+24>>2];t=+g[m+28>>2];_=+g[m+36>>2];aa=+g[m+40>>2];ca=+g[m+44>>2];f=+g[o+300+48>>2];h=+g[o+300+52>>2];fa=+g[o+300+56>>2];da=+g[m+52>>2]+(i*f+p*h+q*fa);ea=r*f+s*h+t*fa+ +g[m+56>>2];fa=_*f+aa*h+ca*fa+ +g[m+60>>2];g[Z+112>>2]=u*i+v*p+w*q;g[L>>2]=i*x+p*y+q*B;g[N>>2]=i*C+p*$+q*ba;g[Z+112+12>>2]=0.0;g[O>>2]=u*r+v*s+w*t;g[P>>2]=x*r+y*s+B*t;g[G>>2]=C*r+$*s+ba*t;g[Z+112+28>>2]=0.0;g[H>>2]=u*_+v*aa+w*ca;g[I>>2]=x*_+y*aa+B*ca;g[J>>2]=C*_+$*aa+ba*ca;g[Z+112+44>>2]=0.0;g[F>>2]=da;g[K>>2]=ea;g[M>>2]=fa;g[Z+112+60>>2]=0.0;if(e){m=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[m>>2]|0)+56>>2]&7](m,Z+112|0,E);m=c[o+32>>2]|0;u=+g[o+364>>2];i=+g[m+4>>2];v=+g[o+364+16>>2];p=+g[m+8>>2];w=+g[o+364+32>>2];q=+g[m+12>>2];x=+g[o+364+4>>2];y=+g[o+364+20>>2];B=+g[o+364+36>>2];C=+g[o+364+8>>2];$=+g[o+364+24>>2];ba=+g[o+364+40>>2];r=+g[m+20>>2];s=+g[m+24>>2];t=+g[m+28>>2];_=+g[m+36>>2];aa=+g[m+40>>2];ca=+g[m+44>>2];f=+g[o+364+48>>2];h=+g[o+364+52>>2];fa=+g[o+364+56>>2];da=+g[m+52>>2]+(i*f+p*h+q*fa);ea=r*f+s*h+t*fa+ +g[m+56>>2];fa=_*f+aa*h+ca*fa+ +g[m+60>>2];g[Z+112>>2]=u*i+v*p+w*q;g[L>>2]=i*x+p*y+q*B;g[N>>2]=i*C+p*$+q*ba;g[Z+112+12>>2]=0.0;g[O>>2]=u*r+v*s+w*t;g[P>>2]=x*r+y*s+B*t;g[G>>2]=C*r+$*s+ba*t;g[Z+112+28>>2]=0.0;g[H>>2]=u*_+v*aa+w*ca;g[I>>2]=x*_+y*aa+B*ca;g[J>>2]=C*_+$*aa+ba*ca;g[Z+112+44>>2]=0.0;g[F>>2]=da;g[K>>2]=ea;g[M>>2]=fa;g[Z+112+60>>2]=0.0;m=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[m>>2]|0)+56>>2]&7](m,Z+112|0,E)}else{m=c[o+32>>2]|0;u=+g[o+364>>2];i=+g[m+4>>2];v=+g[o+364+16>>2];p=+g[m+8>>2];w=+g[o+364+32>>2];q=+g[m+12>>2];x=+g[o+364+4>>2];y=+g[o+364+20>>2];B=+g[o+364+36>>2];C=+g[o+364+8>>2];$=+g[o+364+24>>2];ba=+g[o+364+40>>2];r=+g[m+20>>2];s=+g[m+24>>2];t=+g[m+28>>2];_=+g[m+36>>2];aa=+g[m+40>>2];ca=+g[m+44>>2];f=+g[o+364+48>>2];h=+g[o+364+52>>2];fa=+g[o+364+56>>2];da=+g[m+52>>2]+(i*f+p*h+q*fa);ea=r*f+s*h+t*fa+ +g[m+56>>2];fa=_*f+aa*h+ca*fa+ +g[m+60>>2];g[Z+112>>2]=u*i+v*p+w*q;g[L>>2]=i*x+p*y+q*B;g[N>>2]=i*C+p*$+q*ba;g[Z+112+12>>2]=0.0;g[O>>2]=u*r+v*s+w*t;g[P>>2]=x*r+y*s+B*t;g[G>>2]=C*r+$*s+ba*t;g[Z+112+28>>2]=0.0;g[H>>2]=u*_+v*aa+w*ca;g[I>>2]=x*_+y*aa+B*ca;g[J>>2]=C*_+$*aa+ba*ca;g[Z+112+44>>2]=0.0;g[F>>2]=da;g[K>>2]=ea;g[M>>2]=fa;g[Z+112+60>>2]=0.0}if(n){Xj(Z+96|0,o,6.0868353843688965,E);ba=+g[Z+96>>2];ca=+g[Z+96+4>>2];da=+g[Z+96+8>>2];ea=ba*+g[O>>2]+ca*+g[P>>2]+da*+g[G>>2]+ +g[K>>2];fa=ba*+g[H>>2]+ca*+g[I>>2]+da*+g[J>>2]+ +g[M>>2];g[Z+96>>2]=ba*+g[Z+112>>2]+ca*+g[L>>2]+da*+g[N>>2]+ +g[F>>2];g[Z+96+4>>2]=ea;g[Z+96+8>>2]=fa;g[Z+96+12>>2]=0.0;e=0;do{Xj(Z+80|0,o,+(e|0)*6.283185005187988*.03125,E);ba=+g[Z+80>>2];ca=+g[Z+80+4>>2];da=+g[Z+80+8>>2];ea=ba*+g[O>>2]+ca*+g[P>>2]+da*+g[G>>2]+ +g[K>>2];fa=ba*+g[H>>2]+ca*+g[I>>2]+da*+g[J>>2]+ +g[M>>2];g[Z+80>>2]=ba*+g[Z+112>>2]+ca*+g[L>>2]+da*+g[N>>2]+ +g[F>>2];g[Z+80+4>>2]=ea;g[Z+80+8>>2]=fa;g[Z+80+12>>2]=0.0;n=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;m=c[(c[n>>2]|0)+8>>2]|0;c[Z+64>>2]=0;c[Z+64+4>>2]=0;c[Z+64+8>>2]=0;c[Z+64+12>>2]=0;ab[m&127](n,Z+96|0,Z+80|0,Z+64|0);if(!(e&3)){n=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;m=c[(c[n>>2]|0)+8>>2]|0;c[Z+64>>2]=0;c[Z+64+4>>2]=0;c[Z+64+8>>2]=0;c[Z+64+12>>2]=0;ab[m&127](n,X,Z+80|0,Z+64|0)}c[Z+96>>2]=c[Z+80>>2];c[Z+96+4>>2]=c[Z+80+4>>2];c[Z+96+8>>2]=c[Z+80+8>>2];c[Z+96+12>>2]=c[Z+80+12>>2];e=e+1|0}while((e|0)!=32);B=+g[o+452>>2];C=+g[o+512>>2];e=c[o+32>>2]|0;if(+g[e+344>>2]>0.0){ba=+g[o+364>>2];ca=+g[e+4>>2];da=+g[o+364+16>>2];ea=+g[e+8>>2];fa=+g[o+364+32>>2];w=+g[e+12>>2];$=+g[o+364+4>>2];aa=+g[o+364+20>>2];v=+g[o+364+36>>2];ga=+g[o+364+8>>2];_=+g[o+364+24>>2];u=+g[o+364+40>>2];ia=+g[e+20>>2];ha=+g[e+24>>2];t=+g[e+28>>2];s=+g[e+36>>2];r=+g[e+40>>2];q=+g[e+44>>2];i=+g[o+364+48>>2];f=+g[o+364+52>>2];h=+g[o+364+56>>2];x=ia*i+ha*f+t*h;y=ca*i+ea*f+w*h;f=s*i+r*f;h=q*h;i=ga*s+_*r+u*q;p=$*s+aa*r+v*q;q=ba*s+da*r+fa*q;r=ga*ia+_*ha+u*t;s=$*ia+aa*ha+v*t;t=ba*ia+da*ha+fa*t;u=ca*ga+ea*_+w*u;v=ca*$+ea*aa+w*v;w=ba*ca+da*ea+fa*w}else{e=c[o+28>>2]|0;ea=+g[o+300>>2];fa=+g[e+4>>2];ga=+g[o+300+16>>2];ha=+g[e+8>>2];ia=+g[o+300+32>>2];w=+g[e+12>>2];ca=+g[o+300+4>>2];da=+g[o+300+20>>2];v=+g[o+300+36>>2];aa=+g[o+300+8>>2];ba=+g[o+300+24>>2];u=+g[o+300+40>>2];_=+g[e+20>>2];$=+g[e+24>>2];t=+g[e+28>>2];s=+g[e+36>>2];r=+g[e+40>>2];q=+g[e+44>>2];i=+g[o+300+48>>2];f=+g[o+300+52>>2];h=+g[o+300+56>>2];x=_*i+$*f+t*h;y=fa*i+ha*f+w*h;f=s*i+r*f;h=q*h;i=aa*s+ba*r+u*q;p=ca*s+da*r+v*q;q=ea*s+ga*r+ia*q;r=aa*_+ba*$+u*t;s=ca*_+da*$+v*t;t=ea*_+ga*$+ia*t;u=fa*aa+ha*ba+w*u;v=fa*ca+ha*da+w*v;w=ea*fa+ga*ha+ia*w}ga=+g[e+52>>2]+y;ha=x+ +g[e+56>>2];ia=f+h+ +g[e+60>>2];g[Z+112>>2]=w;g[L>>2]=v;g[N>>2]=u;g[Z+112+12>>2]=0.0;g[O>>2]=t;g[P>>2]=s;g[G>>2]=r;g[Z+112+28>>2]=0.0;g[H>>2]=q;g[I>>2]=p;g[J>>2]=i;g[Z+112+44>>2]=0.0;g[F>>2]=ga;g[K>>2]=ha;g[M>>2]=ia;g[Z+112+60>>2]=0.0;c[Z+80>>2]=c[X>>2];c[Z+80+4>>2]=c[X+4>>2];c[Z+80+8>>2]=c[X+8>>2];c[Z+80+12>>2]=c[X+12>>2];g[Z+64>>2]=w;g[Z+64+4>>2]=t;g[Z+64+8>>2]=q;g[Z+64+12>>2]=0.0;g[Z+48>>2]=v;g[Z+48+4>>2]=s;g[Z+48+8>>2]=p;g[Z+48+12>>2]=0.0;o=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=c[(c[o>>2]|0)+60>>2]|0;c[Z+32>>2]=0;c[Z+32+4>>2]=0;c[Z+32+8>>2]=0;c[Z+32+12>>2]=0;db[n&1](o,Z+80|0,Z+64|0,Z+48|0,E,E,-C-B,B-C,Z+32|0,1,10.0)}break a}case 6:case 9:{c[Z+112>>2]=c[o+1064>>2];c[Z+112+4>>2]=c[o+1064+4>>2];c[Z+112+8>>2]=c[o+1064+8>>2];c[Z+112+12>>2]=c[o+1064+12>>2];k=o+1064+16|0;c[R>>2]=c[k>>2];c[R+4>>2]=c[k+4>>2];c[R+8>>2]=c[k+8>>2];c[R+12>>2]=c[k+12>>2];l=o+1064+32|0;c[S>>2]=c[l>>2];c[S+4>>2]=c[l+4>>2];c[S+8>>2]=c[l+8>>2];c[S+12>>2]=c[l+12>>2];m=o+1064+48|0;c[T>>2]=c[m>>2];c[T+4>>2]=c[m+4>>2];c[T+8>>2]=c[m+8>>2];c[T+12>>2]=c[m+12>>2];if(e){e=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[e>>2]|0)+56>>2]&7](e,Z+112|0,E);c[Z+112>>2]=c[o+1128>>2];c[Z+112+4>>2]=c[o+1128+4>>2];c[Z+112+8>>2]=c[o+1128+8>>2];c[Z+112+12>>2]=c[o+1128+12>>2];c[R>>2]=c[o+1128+16>>2];c[R+4>>2]=c[o+1128+16+4>>2];c[R+8>>2]=c[o+1128+16+8>>2];c[R+12>>2]=c[o+1128+16+12>>2];c[S>>2]=c[o+1128+32>>2];c[S+4>>2]=c[o+1128+32+4>>2];c[S+8>>2]=c[o+1128+32+8>>2];c[S+12>>2]=c[o+1128+32+12>>2];c[T>>2]=c[o+1128+48>>2];c[T+4>>2]=c[o+1128+48+4>>2];c[T+8>>2]=c[o+1128+48+8>>2];c[T+12>>2]=c[o+1128+48+12>>2];e=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[e>>2]|0)+56>>2]&7](e,Z+112|0,E)}else{c[Z+112>>2]=c[o+1128>>2];c[Z+112+4>>2]=c[o+1128+4>>2];c[Z+112+8>>2]=c[o+1128+8>>2];c[Z+112+12>>2]=c[o+1128+12>>2];c[R>>2]=c[o+1128+16>>2];c[R+4>>2]=c[o+1128+16+4>>2];c[R+8>>2]=c[o+1128+16+8>>2];c[R+12>>2]=c[o+1128+16+12>>2];c[S>>2]=c[o+1128+32>>2];c[S+4>>2]=c[o+1128+32+4>>2];c[S+8>>2]=c[o+1128+32+8>>2];c[S+12>>2]=c[o+1128+32+12>>2];c[T>>2]=c[o+1128+48>>2];c[T+4>>2]=c[o+1128+48+4>>2];c[T+8>>2]=c[o+1128+48+8>>2];c[T+12>>2]=c[o+1128+48+12>>2]}if(n){c[Z+112>>2]=c[o+1064>>2];c[Z+112+4>>2]=c[o+1064+4>>2];c[Z+112+8>>2]=c[o+1064+8>>2];c[Z+112+12>>2]=c[o+1064+12>>2];c[R>>2]=c[k>>2];c[R+4>>2]=c[k+4>>2];c[R+8>>2]=c[k+8>>2];c[R+12>>2]=c[k+12>>2];c[S>>2]=c[l>>2];c[S+4>>2]=c[l+4>>2];c[S+8>>2]=c[l+8>>2];c[S+12>>2]=c[l+12>>2];c[T>>2]=c[m>>2];c[T+4>>2]=c[m+4>>2];c[T+8>>2]=c[m+8>>2];c[T+12>>2]=c[m+12>>2];e=o+1128+48|0;c[Z+96>>2]=c[Z+112+8>>2];c[Z+96+4>>2]=c[Z+112+24>>2];c[Z+96+8>>2]=c[Z+112+40>>2];g[Z+96+12>>2]=0.0;c[Z+80>>2]=c[Z+112>>2];c[Z+80+4>>2]=c[Z+112+16>>2];c[Z+80+8>>2]=c[Z+112+32>>2];g[Z+80+12>>2]=0.0;ea=+g[o+932>>2];f=+g[o+932+4>>2];ha=+g[o+996>>2];ga=+g[o+996+4>>2];ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=c[(c[ja>>2]|0)+64>>2]|0;c[Z+64>>2]=0;c[Z+64+4>>2]=0;c[Z+64+8>>2]=0;c[Z+64+12>>2]=0;cb[n&1](ja,e,Z+96|0,Z+80|0,E*.8999999761581421,ea,f,ha,ga,Z+64|0,10.0,1);ja=c[Z+112+20>>2]|0;n=c[Z+112+36>>2]|0;c[Z+80>>2]=c[Z+112+4>>2];c[Z+80+4>>2]=ja;c[Z+80+8>>2]=n;g[Z+80+12>>2]=0.0;ga=+g[o+1196>>2];ha=+g[o+1200>>2];f=+z(+ga);ga=+A(+ga);ea=+z(+ha);ha=+A(+ha);fa=+g[Z+80>>2];ia=+g[Z+80+4>>2];h=+g[Z+80+8>>2];g[Z+64>>2]=f*ea*fa+f*ha*ia-ga*h;g[Z+64+4>>2]=ea*ia-ha*fa;g[Z+64+8>>2]=ga*ea*fa+ga*ha*ia+f*h;c[Z+112>>2]=c[o+1128>>2];c[Z+112+4>>2]=c[o+1128+4>>2];c[Z+112+8>>2]=c[o+1128+8>>2];c[Z+112+12>>2]=c[o+1128+12>>2];c[R>>2]=c[o+1128+16>>2];c[R+4>>2]=c[o+1128+16+4>>2];c[R+8>>2]=c[o+1128+16+8>>2];c[R+12>>2]=c[o+1128+16+12>>2];c[S>>2]=c[o+1128+32>>2];c[S+4>>2]=c[o+1128+32+4>>2];c[S+8>>2]=c[o+1128+32+8>>2];c[S+12>>2]=c[o+1128+32+12>>2];c[T>>2]=c[e>>2];c[T+4>>2]=c[e+4>>2];c[T+8>>2]=c[e+8>>2];c[T+12>>2]=c[e+12>>2];h=-+g[Z+112+16>>2];f=-+g[Z+112+32>>2];g[Z+48>>2]=-+g[Z+112>>2];g[Z+48+4>>2]=h;g[Z+48+8>>2]=f;g[Z+48+12>>2]=0.0;f=+g[o+868>>2];h=+g[o+868+4>>2];if(!(f>h)){if(f>2]|0)+20>>2]&127](b)|0;n=c[(c[ja>>2]|0)+60>>2]|0;c[Z+32>>2]=0;c[Z+32+4>>2]=0;c[Z+32+8>>2]=0;c[Z+32+12>>2]=0;db[n&1](ja,e,Z+48|0,Z+64|0,E,E,f,h,Z+32|0,1,10.0)}}else{ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=c[(c[ja>>2]|0)+60>>2]|0;c[Z+32>>2]=0;c[Z+32+4>>2]=0;c[Z+32+8>>2]=0;c[Z+32+12>>2]=0;db[n&1](ja,e,Z+48|0,Z+64|0,E,E,-3.1415927410125732,3.1415927410125732,Z+32|0,0,10.0)}c[Z+112>>2]=c[o+1064>>2];c[Z+112+4>>2]=c[o+1064+4>>2];c[Z+112+8>>2]=c[o+1064+8>>2];c[Z+112+12>>2]=c[o+1064+12>>2];c[R>>2]=c[k>>2];c[R+4>>2]=c[k+4>>2];c[R+8>>2]=c[k+8>>2];c[R+12>>2]=c[k+12>>2];c[S>>2]=c[l>>2];c[S+4>>2]=c[l+4>>2];c[S+8>>2]=c[l+8>>2];c[S+12>>2]=c[l+12>>2];c[T>>2]=c[m>>2];c[T+4>>2]=c[m+4>>2];c[T+8>>2]=c[m+8>>2];c[T+12>>2]=c[m+12>>2];c[Z+32>>2]=c[o+680>>2];c[Z+32+4>>2]=c[o+680+4>>2];c[Z+32+8>>2]=c[o+680+8>>2];c[Z+32+12>>2]=c[o+680+12>>2];c[Z+16>>2]=c[o+680+16>>2];c[Z+16+4>>2]=c[o+680+16+4>>2];c[Z+16+8>>2]=c[o+680+16+8>>2];c[Z+16+12>>2]=c[o+680+16+12>>2];ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;o=c[(c[ja>>2]|0)+72>>2]|0;c[Z>>2]=0;c[Z+4>>2]=0;c[Z+8>>2]=0;c[Z+12>>2]=0;eb[o&31](ja,Z+32|0,Z+16|0,Z+112|0,Z)}break a}case 7:{c[Z+112>>2]=c[o+824>>2];c[Z+112+4>>2]=c[o+824+4>>2];c[Z+112+8>>2]=c[o+824+8>>2];c[Z+112+12>>2]=c[o+824+12>>2];c[U>>2]=c[o+824+16>>2];c[U+4>>2]=c[o+824+16+4>>2];c[U+8>>2]=c[o+824+16+8>>2];c[U+12>>2]=c[o+824+16+12>>2];c[V>>2]=c[o+824+32>>2];c[V+4>>2]=c[o+824+32+4>>2];c[V+8>>2]=c[o+824+32+8>>2];c[V+12>>2]=c[o+824+32+12>>2];c[W>>2]=c[o+824+48>>2];c[W+4>>2]=c[o+824+48+4>>2];c[W+8>>2]=c[o+824+48+8>>2];c[W+12>>2]=c[o+824+48+12>>2];if(e){ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[ja>>2]|0)+56>>2]&7](ja,Z+112|0,E);c[Z+112>>2]=c[o+888>>2];c[Z+112+4>>2]=c[o+888+4>>2];c[Z+112+8>>2]=c[o+888+8>>2];c[Z+112+12>>2]=c[o+888+12>>2];c[U>>2]=c[o+888+16>>2];c[U+4>>2]=c[o+888+16+4>>2];c[U+8>>2]=c[o+888+16+8>>2];c[U+12>>2]=c[o+888+16+12>>2];c[V>>2]=c[o+888+32>>2];c[V+4>>2]=c[o+888+32+4>>2];c[V+8>>2]=c[o+888+32+8>>2];c[V+12>>2]=c[o+888+32+12>>2];c[W>>2]=c[o+888+48>>2];c[W+4>>2]=c[o+888+48+4>>2];c[W+8>>2]=c[o+888+48+8>>2];c[W+12>>2]=c[o+888+48+12>>2];ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;Wa[c[(c[ja>>2]|0)+56>>2]&7](ja,Z+112|0,E)}else{c[Z+112>>2]=c[o+888>>2];c[Z+112+4>>2]=c[o+888+4>>2];c[Z+112+8>>2]=c[o+888+8>>2];c[Z+112+12>>2]=c[o+888+12>>2];c[U>>2]=c[o+888+16>>2];c[U+4>>2]=c[o+888+16+4>>2];c[U+8>>2]=c[o+888+16+8>>2];c[U+12>>2]=c[o+888+16+12>>2];c[V>>2]=c[o+888+32>>2];c[V+4>>2]=c[o+888+32+4>>2];c[V+8>>2]=c[o+888+32+8>>2];c[V+12>>2]=c[o+888+32+12>>2];c[W>>2]=c[o+888+48>>2];c[W+4>>2]=c[o+888+48+4>>2];c[W+8>>2]=c[o+888+48+8>>2];c[W+12>>2]=c[o+888+48+12>>2]}if(n){ka=(a[o+180>>0]|0)==0?o+888|0:o+824|0;e=c[ka>>2]|0;m=c[ka+4>>2]|0;k=c[ka+16>>2]|0;n=c[ka+20>>2]|0;l=c[ka+32>>2]|0;ja=c[ka+36>>2]|0;B=+g[ka+48>>2];aa=+g[ka+52>>2];ea=+g[ka+56>>2];ia=+g[o+184>>2];$=(c[j>>2]=e,+g[j>>2]);_=(c[j>>2]=m,+g[j>>2])*0.0;C=+g[ka+8>>2]*0.0;da=(c[j>>2]=k,+g[j>>2]);ca=(c[j>>2]=n,+g[j>>2])*0.0;ba=+g[ka+24>>2]*0.0;ha=(c[j>>2]=l,+g[j>>2]);ga=(c[j>>2]=ja,+g[j>>2])*0.0;fa=+g[ka+40>>2]*0.0;g[Z+96>>2]=B+(C+(_+ia*$));g[Z+96+4>>2]=aa+(ba+(ca+ia*da));g[Z+96+8>>2]=ea+(fa+(ga+ia*ha));g[Z+96+12>>2]=0.0;ia=+g[o+188>>2];g[Z+80>>2]=B+(C+(_+ia*$));g[Z+80+4>>2]=aa+(ba+(ca+ia*da));g[Z+80+8>>2]=ea+(fa+(ga+ia*ha));g[Z+80+12>>2]=0.0;ka=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;ma=c[(c[ka>>2]|0)+8>>2]|0;c[Z+64>>2]=0;c[Z+64+4>>2]=0;c[Z+64+8>>2]=0;c[Z+64+12>>2]=0;ab[ma&127](ka,Z+96|0,Z+80|0,Z+64|0);c[Z+64>>2]=e;c[Z+64+4>>2]=k;c[Z+64+8>>2]=l;g[Z+64+12>>2]=0.0;c[Z+48>>2]=m;c[Z+48+4>>2]=n;c[Z+48+8>>2]=ja;g[Z+48+12>>2]=0.0;ha=+g[o+192>>2];ia=+g[o+196>>2];ja=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0;n=c[(c[ja>>2]|0)+60>>2]|0;c[Z+32>>2]=0;c[Z+32+4>>2]=0;c[Z+32+8>>2]=0;c[Z+32+12>>2]=0;db[n&1](ja,o+888+48|0,Z+64|0,Z+48|0,E,E,ha,ia,Z+32|0,1,10.0)}break a}default:break a}while(0)}while((D|0)>1)}if((((Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0?(ma=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,(Fa[c[(c[ma>>2]|0)+48>>2]&127](ma)|0)&16387|0):0)?Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0:0)?(ma=Fa[c[(c[b>>2]|0)+20>>2]&127](b)|0,Fa[c[(c[ma>>2]|0)+48>>2]&127](ma)|0):0)?(c[b+280>>2]|0)>0:0){d=0;do{ma=c[(c[b+288>>2]|0)+(d<<2)>>2]|0;Va[c[(c[ma>>2]|0)+12>>2]&127](ma,c[b+72>>2]|0);d=d+1|0}while((d|0)<(c[b+280>>2]|0))}d=c[3084]|0;ma=(c[d+16>>2]|0)+-1|0;c[d+16>>2]=ma;if(ma|0){sa=Z;return}do if(c[d+4>>2]|0){la(Z+112|0,0)|0;ma=c[7181]|0;g[d+8>>2]=+g[d+8>>2]+ +(((c[Z+112+4>>2]|0)-(c[ma+4>>2]|0)+(((c[Z+112>>2]|0)-(c[ma>>2]|0)|0)*1e6|0)-(c[d+12>>2]|0)|0)>>>0)/1.0e3;if(!(c[d+16>>2]|0)){d=c[3084]|0;break}else{sa=Z;return}}while(0);c[3084]=c[d+20>>2];sa=Z;return}function sb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;ve(b,e,f)|0;F=c[b+872>>2]|0;c[e+292>>2]=F;if(F){F=Ha[c[(c[f>>2]|0)+28>>2]&31](f,b+868|0)|0;c[e+260>>2]=F;if(F|0){j=c[e+292>>2]|0;m=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,j)|0;if((j|0)>0){g=c[m+8>>2]|0;h=0;while(1){k=c[(c[b+880>>2]|0)+(h<<2)>>2]|0;if(!k){i=0;l=0}else{i=k;l=Ha[c[(c[f>>2]|0)+28>>2]&31](f,k)|0}c[g>>2]=l;if(!(Ha[c[(c[f>>2]|0)+24>>2]&31](f,i)|0)){F=Ja[c[(c[f>>2]|0)+16>>2]&63](f,16,1)|0;E=c[F+8>>2]|0;c[E+12>>2]=c[k+16>>2];c[E+4>>2]=c[k+8>>2];c[E>>2]=c[k+4>>2];c[E+8>>2]=c[k+12>>2];eb[c[(c[f>>2]|0)+20>>2]&31](f,F,15001,1414349395,i)}h=h+1|0;if((h|0)>=(j|0)){g=f;break}else g=g+4|0}}else g=f;eb[c[(c[g>>2]|0)+20>>2]&31](f,m,15001,1497453121,b+868|0)}}else c[e+260>>2]=0;F=c[b+712>>2]|0;c[e+296>>2]=F;if(F){F=Ha[c[(c[f>>2]|0)+28>>2]&31](f,b+708|0)|0;c[e+264>>2]=F;if(!F){x=0;h=0;i=0;j=0;k=0}else{E=c[e+296>>2]|0;F=Ja[c[(c[f>>2]|0)+16>>2]&63](f,100,E)|0;if((E|0)>0){C=0;D=c[F+8>>2]|0;p=0;t=0;u=0;g=0;h=0;q=0;y=0;w=0;i=0;r=0;j=0;k=0;B=0;x=0;while(1){m=c[b+720>>2]|0;c[D+52>>2]=c[m+(C*104|0)+56>>2];c[D+56>>2]=c[m+(C*104|0)+60>>2];c[D+60>>2]=c[m+(C*104|0)+64>>2];c[D+64>>2]=c[m+(C*104|0)+68>>2];c[D+88>>2]=c[m+(C*104|0)+92>>2];l=a[m+(C*104|0)+100>>0]<<7&255;c[D+92>>2]=(7?l<<24>>24>>7:l<<24>>24)<<24>>24;c[D+84>>2]=c[m+(C*104|0)+88>>2];l=c[m+(C*104|0)+4>>2]|0;if(!l)l=0;else{l=Ha[c[(c[f>>2]|0)+28>>2]&31](f,l)|0;m=c[b+720>>2]|0}c[D>>2]=l;o=m+(C*104|0)|0;c[D+68>>2]=c[m+(C*104|0)+72>>2];c[D+72>>2]=c[m+(C*104|0)+76>>2];c[D+76>>2]=c[m+(C*104|0)+80>>2];c[D+80>>2]=c[m+(C*104|0)+84>>2];c[D+4>>2]=c[m+(C*104|0)+8>>2];c[D+8>>2]=c[m+(C*104|0)+12>>2];c[D+12>>2]=c[m+(C*104|0)+16>>2];c[D+16>>2]=c[m+(C*104|0)+20>>2];c[D+20>>2]=c[m+(C*104|0)+24>>2];c[D+24>>2]=c[m+(C*104|0)+28>>2];c[D+28>>2]=c[m+(C*104|0)+32>>2];c[D+32>>2]=c[m+(C*104|0)+36>>2];c[D+36>>2]=c[m+(C*104|0)+40>>2];c[D+40>>2]=c[m+(C*104|0)+44>>2];c[D+44>>2]=c[m+(C*104|0)+48>>2];c[D+48>>2]=c[m+(C*104|0)+52>>2];v=((10?o+~(o<<15)>>10:o+~(o<<15)|0)^o+~(o<<15))*9|0;v=(6?v>>6:v)^v;v=(16?v+~(v<<11)>>16:v+~(v<<11)|0)^v+~(v<<11);s=v&j+-1;a:do if(s>>>0>>0?(G=c[h+(s<<2)>>2]|0,(G|0)!=-1):0){l=G;while(1){if((c[g+(l<<3)>>2]|0)==(o|0))break;l=c[i+(l<<2)>>2]|0;if((l|0)==-1){J=27;break a}}c[k+(l<<2)>>2]=C;s=u;o=y;m=w;n=B;l=x}else J=27;while(0);if((J|0)==27){J=0;do if((r|0)==(j|0)){m=(j|0)==0?1:j<<1;if((j|0)<(m|0)){if((m|0)!=0?(c[7182]=(c[7182]|0)+1,H=xb((m<<2|3)+16|0)|0,(H|0)!=0):0){c[(H+4+15&-16)+-4>>2]=H;n=H+4+15&-16}else n=0;if((j|0)<=0){if(!k){A=m;k=n;l=j;break}}else{l=0;do{c[n+(l<<2)>>2]=c[k+(l<<2)>>2];l=l+1|0}while((l|0)!=(j|0))}c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0);A=m;k=n;l=j}else{A=j;l=j}}else{A=j;l=r}while(0);c[k+(l<<2)>>2]=C;z=r+1|0;do if((t|0)==(u|0)){m=(t|0)==0?1:t<<1;if((t|0)<(m|0)){if((m|0)!=0?(c[7182]=(c[7182]|0)+1,I=xb((m<<3|3)+16|0)|0,(I|0)!=0):0){c[(I+4+15&-16)+-4>>2]=I;n=I+4+15&-16}else n=0;if((t|0)<=0){if(!g){u=m;g=n;break}}else{l=0;do{L=g+(l<<3)|0;K=c[L+4>>2]|0;u=n+(l<<3)|0;c[u>>2]=c[L>>2];c[u+4>>2]=K;l=l+1|0}while((l|0)!=(t|0))}c[7183]=(c[7183]|0)+1;Hc(c[g+-4>>2]|0);u=m;g=n}else u=t}while(0);c[g+(t<<3)>>2]=o;t=t+1|0;if((j|0)<(A|0)){if((q|0)<(A|0)){do if((p|0)<(A|0)){do if(!A)l=0;else{c[7182]=(c[7182]|0)+1;j=xb((A<<2|3)+16|0)|0;if(!j){l=0;break}c[(j+4+15&-16)+-4>>2]=j;l=j+4+15&-16}while(0);if((q|0)<=0){if(!h){p=A;h=l;s=l;break}}else{j=0;do{c[l+(j<<2)>>2]=c[h+(j<<2)>>2];j=j+1|0}while((j|0)!=(q|0))}c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);p=A;h=l;s=l}else s=x;while(0);o=A<<2;mk(h+(q<<2)|0,0,o-(q<<2)|0)|0;if((y|0)<(A|0)){do if((w|0)<(A|0)){do if(!A)l=0;else{c[7182]=(c[7182]|0)+1;j=xb((o|3)+16|0)|0;if(!j){l=0;break}c[(j+4+15&-16)+-4>>2]=j;l=j+4+15&-16}while(0);if((y|0)<=0){if(!i){m=A;i=l;j=l;break}}else{j=0;do{c[l+(j<<2)>>2]=c[i+(j<<2)>>2];j=j+1|0}while((j|0)!=(y|0))}c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0);m=A;i=l;j=l}else{m=w;j=B}while(0);mk(i+(y<<2)|0,0,o-(y<<2)|0)|0;n=j}else{m=w;n=B}if((A|0)>0){mk(s|0,-1,o|0)|0;mk(n|0,-1,o|0)|0}if((q|0)>0){l=A+-1|0;j=0;do{L=c[g+(j<<3)>>2]|0;L=((10?L+~(L<<15)>>10:L+~(L<<15)|0)^L+~(L<<15))*9|0;L=(6?L>>6:L)^L;L=h+((((16?L+~(L<<11)>>16:L+~(L<<11)|0)^L+~(L<<11))&l)<<2)|0;c[i+(j<<2)>>2]=c[L>>2];c[L>>2]=j;j=j+1|0}while((j|0)!=(q|0));l=A;o=A;j=s}else{l=A;o=A;j=s}}else{l=q;o=y;m=w;n=B;j=x}s=v&A+-1;q=l;l=j}else{o=y;m=w;n=B;l=x}s=h+(s<<2)|0;c[i+(r<<2)>>2]=c[s>>2];c[s>>2]=r;s=u;r=z;j=A}C=C+1|0;if((C|0)>=(E|0))break;else{D=D+100|0;u=s;y=o;w=m;B=n;x=l}}}else{g=0;h=0;i=0;j=0;k=0}eb[c[(c[f>>2]|0)+20>>2]&31](f,F,15022,1145979475,b+708|0);x=g}}else{c[e+264>>2]=0;x=0;h=0;i=0;j=0;k=0}L=c[b+732>>2]|0;c[e+300>>2]=L;if(L){L=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[b+740>>2]|0)|0;c[e+268>>2]=L;if(L|0){p=c[e+300>>2]|0;q=Ja[c[(c[f>>2]|0)+16>>2]&63](f,20,p)|0;if((p|0)>0){m=c[b+740>>2]|0;n=c[q+8>>2]|0;o=0;g=m;while(1){l=a[m+(o*52|0)+20>>0]<<7&255;c[n+16>>2]=(7?l<<24>>24>>7:l<<24>>24)<<24>>24;l=c[m+(o*52|0)+4>>2]|0;if(!l)l=0;else{l=Ha[c[(c[f>>2]|0)+28>>2]&31](f,l)|0;m=c[b+740>>2]|0;g=m}c[n>>2]=l;l=c[m+(o*52|0)+8>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+4>>2]=l;l=c[m+(o*52|0)+12>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+8>>2]=l;c[n+12>>2]=c[m+(o*52|0)+16>>2];o=o+1|0;if((o|0)>=(p|0))break;else n=n+20|0}}else g=c[b+740>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,q,15039,1497453121,g)}}else c[e+268>>2]=0;L=c[b+752>>2]|0;c[e+304>>2]=L;if(L){L=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[b+760>>2]|0)|0;c[e+272>>2]=L;if(L|0){p=c[e+304>>2]|0;q=Ja[c[(c[f>>2]|0)+16>>2]&63](f,36,p)|0;if((p|0)>0){m=c[b+760>>2]|0;n=c[q+8>>2]|0;o=0;g=m;while(1){l=c[m+(o*44|0)+4>>2]|0;if(!l)l=0;else{l=Ha[c[(c[f>>2]|0)+28>>2]&31](f,l)|0;m=c[b+760>>2]|0;g=m}c[n+16>>2]=l;c[n>>2]=c[m+(o*44|0)+20>>2];c[n+4>>2]=c[m+(o*44|0)+24>>2];c[n+8>>2]=c[m+(o*44|0)+28>>2];c[n+12>>2]=c[m+(o*44|0)+32>>2];l=c[m+(o*44|0)+8>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+20>>2]=l;l=c[m+(o*44|0)+12>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+24>>2]=l;l=c[m+(o*44|0)+16>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+28>>2]=l;c[n+32>>2]=c[m+(o*44|0)+36>>2];o=o+1|0;if((o|0)>=(p|0))break;else n=n+36|0}}else g=c[b+760>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,q,15056,1497453121,g)}}else c[e+272>>2]=0;L=c[b+772>>2]|0;c[e+308>>2]=L;if(L){L=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[b+780>>2]|0)|0;c[e+276>>2]=L;if(L|0){p=c[e+308>>2]|0;q=Ja[c[(c[f>>2]|0)+16>>2]&63](f,100,p)|0;if((p|0)>0){m=c[b+780>>2]|0;n=c[q+8>>2]|0;o=0;g=m;while(1){c[n>>2]=c[m+(o*104|0)+32>>2];c[n+4>>2]=c[m+(o*104|0)+36>>2];c[n+8>>2]=c[m+(o*104|0)+40>>2];c[n+12>>2]=c[m+(o*104|0)+44>>2];l=c[m+8>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+68>>2]=l;c[n+16>>2]=c[m+(o*104|0)+48>>2];c[n+20>>2]=c[m+(o*104|0)+52>>2];c[n+24>>2]=c[m+(o*104|0)+56>>2];c[n+28>>2]=c[m+(o*104|0)+60>>2];l=c[m+116>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+72>>2]=l;c[n+32>>2]=c[m+(o*104|0)+64>>2];c[n+36>>2]=c[m+(o*104|0)+68>>2];c[n+40>>2]=c[m+(o*104|0)+72>>2];c[n+44>>2]=c[m+(o*104|0)+76>>2];l=c[m+224>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+76>>2]=l;c[n+48>>2]=c[m+(o*104|0)+80>>2];c[n+52>>2]=c[m+(o*104|0)+84>>2];c[n+56>>2]=c[m+(o*104|0)+88>>2];c[n+60>>2]=c[m+(o*104|0)+92>>2];l=c[m+332>>2]|0;if(!l)l=-1;else l=(l-(c[b+720>>2]|0)|0)/104|0;c[n+80>>2]=l;c[n+88>>2]=c[m+(o*104|0)+96>>2];c[n+92>>2]=c[m+(o*104|0)+100>>2];l=c[m+(o*104|0)+4>>2]|0;if(!l)l=0;else{l=Ha[c[(c[f>>2]|0)+28>>2]&31](f,l)|0;m=c[b+780>>2]|0;g=m}c[n+64>>2]=l;c[n+84>>2]=c[m+(o*104|0)+24>>2];o=o+1|0;if((o|0)>=(p|0))break;else n=n+100|0}}else g=c[b+780>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,q,15073,1497453121,g)}}else c[e+276>>2]=0;L=c[b+792>>2]|0;c[e+312>>2]=L;if(L){L=Ha[c[(c[f>>2]|0)+28>>2]&31](f,c[b+800>>2]|0)|0;c[e+280>>2]=L;if(!L)w=f;else{o=c[e+312>>2]|0;p=Ja[c[(c[f>>2]|0)+16>>2]&63](f,92,o)|0;if((o|0)>0){m=c[p+8>>2]|0;n=0;while(1){l=c[b+800>>2]|0;c[m>>2]=c[l+(n*96|0)+28>>2];c[m+4>>2]=c[l+(n*96|0)+32>>2];c[m+8>>2]=c[l+(n*96|0)+36>>2];c[m+12>>2]=c[l+(n*96|0)+40>>2];c[m+16>>2]=c[l+(n*96|0)+44>>2];c[m+20>>2]=c[l+(n*96|0)+48>>2];c[m+24>>2]=c[l+(n*96|0)+52>>2];c[m+28>>2]=c[l+(n*96|0)+56>>2];c[m+32>>2]=c[l+(n*96|0)+60>>2];c[m+36>>2]=c[l+(n*96|0)+64>>2];c[m+40>>2]=c[l+(n*96|0)+68>>2];c[m+44>>2]=c[l+(n*96|0)+72>>2];c[m+48>>2]=c[l+(n*96|0)+76>>2];c[m+52>>2]=c[l+(n*96|0)+80>>2];c[m+56>>2]=c[l+(n*96|0)+84>>2];c[m+60>>2]=c[l+(n*96|0)+88>>2];c[m+88>>2]=c[l+(n*96|0)+92>>2];c[m+64>>2]=c[l+(n*96|0)+4>>2];c[m+68>>2]=c[l+(n*96|0)+8>>2];c[m+72>>2]=c[l+(n*96|0)+12>>2];c[m+76>>2]=c[l+(n*96|0)+16>>2];g=c[l+(n*96|0)>>2]|0;if(!g)g=-1;else g=(g-(c[b+720>>2]|0)|0)/104|0;c[m+84>>2]=g;g=c[l+(n*96|0)+20>>2]|0;if(!g)g=0;else g=Ha[c[(c[f>>2]|0)+28>>2]&31](f,g)|0;c[m+80>>2]=g;n=n+1|0;if((n|0)>=(o|0))break;else m=m+92|0}}eb[c[(c[f>>2]|0)+20>>2]&31](f,p,15091,1497453121,c[b+800>>2]|0);w=f}}else{c[e+280>>2]=0;w=f}c[e+352>>2]=c[b+316>>2];c[e+328>>2]=c[b+292>>2];c[e+344>>2]=c[b+308>>2];c[e+324>>2]=c[b+288>>2];c[e+340>>2]=c[b+304>>2];c[e+336>>2]=c[b+300>>2];c[e+412>>2]=c[b+376>>2];c[e+416>>2]=c[b+380>>2];c[e+420>>2]=c[b+384>>2];c[e+408>>2]=c[b+372>>2];q=c[b+364>>2]|0;c[e+332>>2]=c[b+296>>2];c[e+356>>2]=c[b+320>>2];c[e+424>>2]=c[b+388>>2];c[e+348>>2]=c[b+312>>2];c[e+360>>2]=c[b+324>>2];c[e+364>>2]=c[b+328>>2];c[e+368>>2]=c[b+332>>2];c[e+372>>2]=c[b+336>>2];c[e+404>>2]=c[b+368>>2];c[e+400>>2]=q;c[e+376>>2]=c[b+340>>2];c[e+380>>2]=c[b+344>>2];c[e+384>>2]=c[b+348>>2];c[e+388>>2]=c[b+352>>2];c[e+392>>2]=c[b+356>>2];c[e+396>>2]=c[b+360>>2];c[e+256>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,b+472|0)|0;q=Ja[c[(c[f>>2]|0)+16>>2]&63](f,192,1)|0;p=c[q+8>>2]|0;c[p+96>>2]=c[b+632>>2];c[p+100>>2]=c[b+636>>2];c[p+104>>2]=c[b+640>>2];c[p+108>>2]=c[b+644>>2];c[p+112>>2]=c[b+648>>2];c[p+116>>2]=c[b+652>>2];c[p+120>>2]=c[b+656>>2];c[p+124>>2]=c[b+660>>2];c[p+128>>2]=c[b+664>>2];c[p+132>>2]=c[b+668>>2];c[p+136>>2]=c[b+672>>2];c[p+140>>2]=c[b+676>>2];c[p+180>>2]=d[b+473>>0];c[p+176>>2]=d[b+472>>0];c[p+144>>2]=c[b+520>>2];c[p+148>>2]=c[b+524>>2];c[p+152>>2]=c[b+528>>2];c[p+156>>2]=c[b+532>>2];L=c[b+484>>2]|0;c[p+168>>2]=L;if(L){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[b+492>>2]|0)|0;n=c[p+168>>2]|0;c[p+160>>2]=L;if(n|0){o=Ja[c[(c[f>>2]|0)+16>>2]&63](f,16,n)|0;if((n|0)>0){g=c[b+492>>2]|0;l=c[o+8>>2]|0;m=0;while(1){c[l>>2]=c[g+(m<<4)>>2];c[l+4>>2]=c[g+(m<<4)+4>>2];c[l+8>>2]=c[g+(m<<4)+8>>2];c[l+12>>2]=c[g+(m<<4)+12>>2];m=m+1|0;if((m|0)==(n|0))break;else l=l+16|0}}else g=c[b+492>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,o,23625,1497453121,g)}}else c[p+160>>2]=0;c[p+184>>2]=c[b+476>>2];c[p>>2]=c[b+536>>2];c[p+4>>2]=c[b+540>>2];c[p+8>>2]=c[b+544>>2];c[p+12>>2]=c[b+548>>2];c[p+16>>2]=c[b+552>>2];c[p+20>>2]=c[b+556>>2];c[p+24>>2]=c[b+560>>2];c[p+28>>2]=c[b+564>>2];c[p+32>>2]=c[b+568>>2];c[p+36>>2]=c[b+572>>2];c[p+40>>2]=c[b+576>>2];c[p+44>>2]=c[b+580>>2];c[p+48>>2]=c[b+584>>2];c[p+52>>2]=c[b+588>>2];c[p+56>>2]=c[b+592>>2];c[p+60>>2]=c[b+596>>2];c[p+64>>2]=c[b+600>>2];c[p+68>>2]=c[b+604>>2];c[p+72>>2]=c[b+608>>2];c[p+76>>2]=c[b+612>>2];c[p+80>>2]=c[b+616>>2];c[p+84>>2]=c[b+620>>2];c[p+88>>2]=c[b+624>>2];c[p+92>>2]=c[b+628>>2];L=c[b+504>>2]|0;c[p+172>>2]=L;if(L){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[b+512>>2]|0)|0;n=c[p+172>>2]|0;c[p+164>>2]=L;if(n|0){o=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,n)|0;if((n|0)>0){g=c[b+512>>2]|0;l=0;m=c[o+8>>2]|0;while(1){c[m>>2]=c[g+(l<<2)>>2];l=l+1|0;if((l|0)==(n|0))break;else m=m+4|0}}else g=c[b+512>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,o,15111,1497453121,g)}}else c[p+164>>2]=0;eb[c[(c[f>>2]|0)+20>>2]&31](f,q,15117,1497453121,b+472|0);L=c[b+1112>>2]|0;c[e+316>>2]=L;if(L){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[c[b+1120>>2]>>2]|0)|0;u=c[e+316>>2]|0;c[e+284>>2]=L;if(u|0){v=Ja[c[(c[f>>2]|0)+16>>2]&63](f,348,u)|0;if((u|0)>0){t=j+-1|0;r=0;s=c[v+8>>2]|0;while(1){j=c[(c[b+1120>>2]|0)+(r<<2)>>2]|0;L=s+320|0;c[L>>2]=c[j+360>>2];c[s+256>>2]=c[j+332>>2];c[s+260>>2]=c[j+336>>2];c[s+264>>2]=c[j+340>>2];c[s+268>>2]=c[j+344>>2];c[s+344>>2]=c[j+380>>2];c[s+340>>2]=d[j+377>>0];c[s+160>>2]=c[j+228>>2];c[s+164>>2]=c[j+232>>2];c[s+168>>2]=c[j+236>>2];c[s+172>>2]=c[j+240>>2];c[s+336>>2]=d[j+376>>0];c[s+208>>2]=c[j+276>>2];c[s+212>>2]=c[j+280>>2];c[s+216>>2]=c[j+284>>2];c[s+220>>2]=c[j+288>>2];c[s+224>>2]=c[j+292>>2];c[s+228>>2]=c[j+296>>2];c[s+232>>2]=c[j+300>>2];c[s+236>>2]=c[j+304>>2];c[s>>2]=c[j+60>>2];c[s+4>>2]=c[j+64>>2];c[s+8>>2]=c[j+68>>2];c[s+12>>2]=c[j+72>>2];c[s+16>>2]=c[j+76>>2];c[s+20>>2]=c[j+80>>2];c[s+24>>2]=c[j+84>>2];c[s+28>>2]=c[j+88>>2];c[s+32>>2]=c[j+92>>2];c[s+36>>2]=c[j+96>>2];c[s+40>>2]=c[j+100>>2];c[s+44>>2]=c[j+104>>2];c[s+48>>2]=c[j+108>>2];c[s+52>>2]=c[j+112>>2];c[s+56>>2]=c[j+116>>2];c[s+60>>2]=c[j+120>>2];c[s+296>>2]=c[j+124>>2];c[s+300>>2]=c[j+128>>2];c[s+112>>2]=c[j+180>>2];c[s+116>>2]=c[j+184>>2];c[s+120>>2]=c[j+188>>2];c[s+124>>2]=c[j+192>>2];c[s+128>>2]=c[j+196>>2];c[s+132>>2]=c[j+200>>2];c[s+136>>2]=c[j+204>>2];c[s+140>>2]=c[j+208>>2];c[s+144>>2]=c[j+212>>2];c[s+148>>2]=c[j+216>>2];c[s+152>>2]=c[j+220>>2];c[s+156>>2]=c[j+224>>2];g=s+316|0;c[g>>2]=c[j+356>>2];c[s+64>>2]=c[j+132>>2];c[s+68>>2]=c[j+136>>2];c[s+72>>2]=c[j+140>>2];c[s+76>>2]=c[j+144>>2];c[s+80>>2]=c[j+148>>2];c[s+84>>2]=c[j+152>>2];c[s+88>>2]=c[j+156>>2];c[s+92>>2]=c[j+160>>2];c[s+96>>2]=c[j+164>>2];c[s+100>>2]=c[j+168>>2];c[s+104>>2]=c[j+172>>2];c[s+108>>2]=c[j+176>>2];c[s+240>>2]=c[j+316>>2];c[s+244>>2]=c[j+320>>2];c[s+248>>2]=c[j+324>>2];c[s+252>>2]=c[j+328>>2];c[s+324>>2]=c[j+364>>2];c[s+328>>2]=c[j+368>>2];c[s+312>>2]=c[j+352>>2];c[g>>2]=c[j+356>>2];c[L>>2]=c[j+360>>2];c[s+332>>2]=c[j+372>>2];L=c[j+44>>2]|0;g=s+284|0;c[g>>2]=L;p=s+292|0;c[p>>2]=c[j+4>>2];q=s+288|0;c[q>>2]=c[j+24>>2];c[s+304>>2]=c[j+308>>2];c[s+176>>2]=c[j+244>>2];c[s+180>>2]=c[j+248>>2];c[s+184>>2]=c[j+252>>2];c[s+188>>2]=c[j+256>>2];c[s+192>>2]=c[j+260>>2];c[s+196>>2]=c[j+264>>2];c[s+200>>2]=c[j+268>>2];c[s+204>>2]=c[j+272>>2];c[s+308>>2]=c[j+312>>2];if(L){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[j+52>>2]|0)|0;c[s+272>>2]=L;if(L|0){m=c[g>>2]|0;o=Ja[c[(c[f>>2]|0)+16>>2]&63](f,16,m)|0;if((m|0)>0){g=(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+52|0;n=c[g>>2]|0;j=0;l=c[o+8>>2]|0;while(1){c[l>>2]=c[n+(j<<4)>>2];c[l+4>>2]=c[n+(j<<4)+4>>2];c[l+8>>2]=c[n+(j<<4)+8>>2];c[l+12>>2]=c[n+(j<<4)+12>>2];j=j+1|0;if((j|0)==(m|0))break;else l=l+16|0}}else g=(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+52|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,o,23625,1497453121,c[g>>2]|0)}}else c[s+272>>2]=0;if(c[p>>2]|0){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+12>>2]|0)|0;c[s+280>>2]=L;if(L|0){m=c[p>>2]|0;o=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,m)|0;if((m|0)>0){g=(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+12|0;n=c[g>>2]|0;j=0;l=c[o+8>>2]|0;while(1){c[l>>2]=c[n+(j<<2)>>2];j=j+1|0;if((j|0)==(m|0))break;else l=l+4|0}}else g=(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+12|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,o,15111,1497453121,c[g>>2]|0)}}else c[s+280>>2]=0;if(c[q>>2]|0){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,(c[(c[b+1120>>2]|0)+(r<<2)>>2]|0)+20|0)|0;c[s+276>>2]=L;if(L|0){p=c[p>>2]|0;q=Ja[c[(c[f>>2]|0)+16>>2]&63](f,4,p)|0;if((p|0)>0){g=c[(c[b+1120>>2]|0)+(r<<2)>>2]|0;o=c[g+32>>2]|0;m=0;n=c[q+8>>2]|0;while(1){l=c[o+(m<<2)>>2]|0;j=((10?~(l<<15)+l>>10:~(l<<15)+l|0)^~(l<<15)+l)*9|0;j=(6?j>>6:j)^j;j=c[h+((((16?j+~(j<<11)>>16:j+~(j<<11)|0)^j+~(j<<11))&t)<<2)>>2]|0;if((c[x+(j<<3)>>2]|0)!=(l|0))do j=c[i+(j<<2)>>2]|0;while((c[x+(j<<3)>>2]|0)!=(l|0));c[n>>2]=c[k+(j<<2)>>2];m=m+1|0;if((m|0)==(p|0))break;else n=n+4|0}}else g=c[(c[b+1120>>2]|0)+(r<<2)>>2]|0;eb[c[(c[f>>2]|0)+20>>2]&31](f,q,15154,1497453121,g+20|0)}}else c[s+276>>2]=0;r=r+1|0;if((r|0)>=(u|0))break;else s=s+348|0}}eb[c[(c[f>>2]|0)+20>>2]&31](f,v,15134,1497453121,c[c[b+1120>>2]>>2]|0)}}else c[e+284>>2]=0;L=c[b+852>>2]|0;c[e+320>>2]=L;if(L){L=Ha[c[(c[w>>2]|0)+28>>2]&31](f,c[b+860>>2]|0)|0;c[e+288>>2]=L;if(L|0){n=c[b+852>>2]|0;o=Ja[c[(c[f>>2]|0)+16>>2]&63](f,104,n)|0;if((n|0)>0){l=0;m=c[o+8>>2]|0;while(1){g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0;c[m+96>>2]=Fa[c[(c[g>>2]|0)+20>>2]&127](g)|0;g=(c[b+860>>2]|0)+(l<<2)|0;L=c[g>>2]|0;c[m+8>>2]=c[L+28>>2];c[m+12>>2]=c[L+32>>2];c[m+16>>2]=c[L+36>>2];c[m+20>>2]=c[L+40>>2];c[m+24>>2]=c[L+44>>2];c[m+28>>2]=c[L+48>>2];c[m+32>>2]=c[L+52>>2];c[m+36>>2]=c[L+56>>2];c[m+40>>2]=c[L+60>>2];c[m+44>>2]=c[L+64>>2];c[m+48>>2]=c[L+68>>2];c[m+52>>2]=d[L+152>>0];L=m+56|0;c[m>>2]=0;p=m+4|0;c[p>>2]=0;c[L>>2]=0;c[L+4>>2]=0;c[L+8>>2]=0;c[L+12>>2]=0;c[L+16>>2]=0;c[L+20>>2]=0;c[L+24>>2]=0;c[L+28>>2]=0;g=c[(c[g>>2]|0)+4>>2]|0;if(g|0){c[m+88>>2]=1;c[m>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,g)|0}g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0;j=c[g+12>>2]|0;if(j){c[m+88>>2]=3;c[m>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,j)|0;g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0}j=c[g+8>>2]|0;if(j){c[m+88>>2]=2;c[m>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,j)|0;g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0}j=c[g+16>>2]|0;if(j){c[m+92>>2]=1;c[p>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,j)|0;g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0}j=c[g+24>>2]|0;if(j){c[m+92>>2]=3;c[p>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,j)|0;g=c[(c[b+860>>2]|0)+(l<<2)>>2]|0}g=c[g+20>>2]|0;if(g|0){c[m+92>>2]=2;c[p>>2]=Ha[c[(c[w>>2]|0)+28>>2]&31](f,g)|0}l=l+1|0;if((l|0)>=(n|0))break;else m=m+104|0}}eb[c[(c[f>>2]|0)+20>>2]&31](f,o,15158,1497453121,c[b+860>>2]|0)}}else c[e+288>>2]=0;if(x|0){c[7183]=(c[7183]|0)+1;Hc(c[x+-4>>2]|0)}if(k|0){c[7183]=(c[7183]|0)+1;Hc(c[k+-4>>2]|0)}if(i|0){c[7183]=(c[7183]|0)+1;Hc(c[i+-4>>2]|0)}if(!h)return 15178;c[7183]=(c[7183]|0)+1;Hc(c[h+-4>>2]|0);return 15178}function tb(b,d){b=b|0;d=+d;var e=0,f=0,h=0,i=0.0,k=0.0,l=0.0,m=0.0,n=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=0,u=0.0,v=0.0,y=0,z=0,A=0,B=0.0,C=0.0,D=0.0,E=0.0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0.0,P=0.0,Q=0.0,R=0,S=0,T=0.0,U=0.0,V=0.0,W=0.0,X=0,Y=0.0,Z=0.0,_=0.0,$=0.0,aa=0.0,ba=0.0,ca=0.0,da=0.0,ea=0.0,fa=0.0,ga=0.0,ha=0.0,ia=0.0;X=sa;sa=sa+240|0;e=c[b+24>>2]|0;if((e|0)<=0){sa=X;return}H=X+128+76|0;I=X+80+16|0;J=X+80+32|0;G=0;do{F=c[(c[b+32>>2]|0)+(G<<2)>>2]|0;switch(c[F+216>>2]|0){case 2:case 5:break;default:{if(a[F+924>>0]|0){a[F+924>>0]=0;f=c[F+732>>2]|0;if((f|0)>0){h=c[F+740>>2]|0;e=0;do{z=c[h+(e*52|0)+8>>2]|0;A=c[h+(e*52|0)+12>>2]|0;C=+g[z+8>>2]-+g[A+8>>2];D=+g[z+12>>2]-+g[A+12>>2];E=+g[z+16>>2]-+g[A+16>>2];E=+x(+(C*C+D*D+E*E));g[h+(e*52|0)+16>>2]=E;g[h+(e*52|0)+28>>2]=E*E;e=e+1|0}while((e|0)!=(f|0));e=0;do{g[h+(e*52|0)+24>>2]=(+g[(c[h+(e*52|0)+8>>2]|0)+88>>2]+ +g[(c[h+(e*52|0)+12>>2]|0)+88>>2])/+g[(c[h+(e*52|0)+4>>2]|0)+4>>2];e=e+1|0}while((e|0)!=(f|0))}cf(F);e=c[F+988>>2]|0;if(e|0)Gm(F+988|0,e);e=c[F+992>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[F+992>>2]=0;c[F+996>>2]=-1;e=c[F+1020>>2]|0;if(e|0){if(a[F+1024>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[F+1020>>2]=0}a[F+1024>>0]=1;c[F+1020>>2]=0;c[F+1012>>2]=0;c[F+1016>>2]=0;c[F+1004>>2]=0;if(c[F+388>>2]&16|0){e=c[F+988>>2]|0;if(e|0)Gm(F+988|0,e);e=c[F+992>>2]|0;if(e|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[F+992>>2]=0;c[F+996>>2]=-1;e=c[F+1020>>2]|0;if(e|0){if(a[F+1024>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[e+-4>>2]|0)}c[F+1020>>2]=0}a[F+1024>>0]=1;c[F+1020>>2]=0;c[F+1012>>2]=0;c[F+1016>>2]=0;c[F+1004>>2]=0;if((c[F+752>>2]|0)>0){f=0;do{h=c[F+760>>2]|0;t=h+(f*44|0)|0;z=c[h+(f*44|0)+8>>2]|0;A=c[h+(f*44|0)+12>>2]|0;e=c[h+(f*44|0)+16>>2]|0;o=+g[z+8>>2];p=+g[z+12>>2];q=+g[z+16>>2];m=+g[z+20>>2];B=+g[A+8>>2];i=B>2];n=E>2];k=D>2];l=C>2];i=C>2];n=D>2];k=E>2];l=B>2]|0;if(!e){c[7182]=(c[7182]|0)+1;e=xb(63)|0;if(!e)e=0;else{c[(e+4+15&-16)+-4>>2]=e;e=e+4+15&-16}y=e;z=y+44|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0))}else c[F+992>>2]=0;c[e+32>>2]=0;c[e+36>>2]=t;c[e+40>>2]=0;g[e>>2]=i;g[e+4>>2]=n;g[e+8>>2]=k;g[e+12>>2]=l;g[e+16>>2]=o;g[e+20>>2]=p;g[e+24>>2]=q;g[e+28>>2]=m;ue(F+988|0,c[F+988>>2]|0,e);c[F+1e3>>2]=(c[F+1e3>>2]|0)+1;c[h+(f*44|0)+40>>2]=e;f=f+1|0}while((f|0)<(c[F+752>>2]|0))}}}l=+g[F+368>>2]*d;g[F+452>>2]=l;g[F+456>>2]=1.0/l;g[F+460>>2]=l*3.0;f=c[F+192>>2]|0;l=+va[c[(c[f>>2]|0)+48>>2]&15](f);g[F+464>>2]=l;g[F+468>>2]=l*.25;f=c[F+684>>2]|0;l=+g[F+452>>2];i=+g[f+40>>2]*l;k=l*+g[f+44>>2];l=l*+g[f+48>>2];f=c[F+712>>2]|0;if((f|0)>0){h=c[F+720>>2]|0;e=0;do{if(+g[h+(e*104|0)+88>>2]>0.0){A=h+(e*104|0)+40|0;g[A>>2]=i+ +g[A>>2];A=h+(e*104|0)+44|0;g[A>>2]=k+ +g[A>>2];A=h+(e*104|0)+48|0;g[A>>2]=l+ +g[A>>2]}e=e+1|0}while((e|0)!=(f|0))}Ki(15356);n=+g[F+308>>2];o=+g[F+312>>2];t=+g[F+304>>2]>0.0?1:+g[F+300>>2]>0.0;y=c[F+712>>2]|0;if(n!=0.0|o>0.0){if((y|0)>0){f=c[F+720>>2]|0;k=+g[f+8>>2];l=+g[f+12>>2];m=+g[f+16>>2];f=c[F+752>>2]|0;if((f|0)>0){h=c[F+760>>2]|0;e=0;i=0.0;do{A=c[h+(e*44|0)+8>>2]|0;z=c[h+(e*44|0)+12>>2]|0;D=+g[z+8>>2]-k;u=+g[z+12>>2]-l;B=+g[z+16>>2]-m;z=c[h+(e*44|0)+16>>2]|0;C=+g[z+8>>2]-k;v=+g[z+12>>2]-l;E=+g[z+16>>2]-m;i=i+((+g[A+16>>2]-m)*(D*v-u*C)+((+g[A+8>>2]-k)*(u*E-B*v)+(+g[A+12>>2]-l)*(B*C-D*E)));e=e+1|0}while((e|0)!=(f|0))}else i=0.0;i=i/6.0}else i=0.0;k=n*(1.0/+w(+i));i=o*(+g[F+476>>2]-i)}else{i=0.0;k=0.0}if((y|0)>0)if(t){e=0;do{f=c[F+720>>2]|0;if(+g[f+(e*104|0)+88>>2]>0.0){Zd(F,F+1212|0,e);if(n!=0.0){C=k*+g[f+(e*104|0)+92>>2];D=C*+g[f+(e*104|0)+76>>2];E=C*+g[f+(e*104|0)+80>>2];A=f+(e*104|0)+56|0;g[A>>2]=+g[f+(e*104|0)+72>>2]*C+ +g[A>>2];A=f+(e*104|0)+60|0;g[A>>2]=D+ +g[A>>2];A=f+(e*104|0)+64|0;g[A>>2]=E+ +g[A>>2]}if(o>0.0){C=i*+g[f+(e*104|0)+92>>2];D=C*+g[f+(e*104|0)+76>>2];E=C*+g[f+(e*104|0)+80>>2];A=f+(e*104|0)+56|0;g[A>>2]=+g[f+(e*104|0)+72>>2]*C+ +g[A>>2];A=f+(e*104|0)+60|0;g[A>>2]=D+ +g[A>>2];A=f+(e*104|0)+64|0;g[A>>2]=E+ +g[A>>2]}}e=e+1|0}while((e|0)!=(y|0))}else{f=c[F+720>>2]|0;e=0;do{if(+g[f+(e*104|0)+88>>2]>0.0){if(n!=0.0){C=k*+g[f+(e*104|0)+92>>2];D=C*+g[f+(e*104|0)+76>>2];E=C*+g[f+(e*104|0)+80>>2];A=f+(e*104|0)+56|0;g[A>>2]=+g[f+(e*104|0)+72>>2]*C+ +g[A>>2];A=f+(e*104|0)+60|0;g[A>>2]=D+ +g[A>>2];A=f+(e*104|0)+64|0;g[A>>2]=E+ +g[A>>2]}if(o>0.0){C=i*+g[f+(e*104|0)+92>>2];D=C*+g[f+(e*104|0)+76>>2];E=C*+g[f+(e*104|0)+80>>2];A=f+(e*104|0)+56|0;g[A>>2]=+g[f+(e*104|0)+72>>2]*C+ +g[A>>2];A=f+(e*104|0)+60|0;g[A>>2]=D+ +g[A>>2];A=f+(e*104|0)+64|0;g[A>>2]=E+ +g[A>>2]}}e=e+1|0}while((e|0)!=(y|0))}f=c[F+752>>2]|0;if((f|0)>0){e=0;do{B=+g[F+452>>2];p=+g[F+304>>2];m=+g[F+300>>2];a:do if((p>0.0|m>0.0?(K=c[F+288>>2]|0,(K|0)>3):0)?(L=c[F+760>>2]|0,M=c[L+(e*44|0)+8>>2]|0,N=c[L+(e*44|0)+12>>2]|0,O=+g[M+40>>2],P=+g[M+44>>2],Q=+g[M+48>>2],R=c[L+(e*44|0)+16>>2]|0,S=c[c[F+684>>2]>>2]|0,T=(O+ +g[N+40>>2]+ +g[R+40>>2])*.3333333432674408-+g[F+1212>>2],U=(P+ +g[N+44>>2]+ +g[R+44>>2])*.3333333432674408-+g[F+1216>>2],V=(Q+ +g[N+48>>2]+ +g[R+48>>2])*.3333333432674408-+g[F+1220>>2],W=+x(+(T*T+U*U+V*V)),T*T+U*U+V*V>1.1920928955078125e-07):0){s=T*(1.0/W);u=U*(1.0/W);v=V*(1.0/W);o=+g[L+(e*44|0)+20>>2];q=+g[L+(e*44|0)+24>>2];r=+g[L+(e*44|0)+28>>2];switch(K|0){case 5:break;case 4:case 6:{i=T*o+U*q+V*r<0.0?-1.0:1.0;if(!(V*r*i+(T*o*i+U*q*i)>0.0))break a;n=-((T*T+U*U+V*V)*(V*r*i+(T*o*i+U*q*i))*+g[L+(e*44|0)+36>>2]*(c[j>>2]=S,+g[j>>2]));s=(s*m*n+(o*i*p*n+0.0))*.3333333432674408;q=(u*m*n+(q*i*p*n+0.0))*.3333333432674408;n=(v*m*n+(r*i*p*n+0.0))*.3333333432674408;o=1.0/+x(+(n*n+(s*s+q*q)));i=B*+g[M+88>>2];if(n*i*n*i+(s*i*s*i+q*i*q*i)>O*O+P*P+Q*Q){g[M+56>>2]=+g[M+56>>2]-1.0/i*s*o*(s*o*O+q*o*P+n*o*Q);g[M+60>>2]=+g[M+60>>2]-1.0/i*q*o*(s*o*O+q*o*P+n*o*Q);g[M+64>>2]=+g[M+64>>2]-1.0/i*n*o*(s*o*O+q*o*P+n*o*Q)}else{g[M+56>>2]=s+ +g[M+56>>2];g[M+60>>2]=q+ +g[M+60>>2];g[M+64>>2]=n+ +g[M+64>>2]}i=B*+g[N+88>>2];k=+g[N+40>>2];l=+g[N+44>>2];m=+g[N+48>>2];if(n*i*n*i+(s*i*s*i+q*i*q*i)>k*k+l*l+m*m){g[N+56>>2]=+g[N+56>>2]-1.0/i*s*o*(s*o*k+q*o*l+n*o*m);g[N+60>>2]=+g[N+60>>2]-1.0/i*q*o*(s*o*k+q*o*l+n*o*m);g[N+64>>2]=+g[N+64>>2]-1.0/i*n*o*(s*o*k+q*o*l+n*o*m)}else{g[N+56>>2]=s+ +g[N+56>>2];g[N+60>>2]=q+ +g[N+60>>2];g[N+64>>2]=n+ +g[N+64>>2]}i=B*+g[R+88>>2];k=+g[R+40>>2];l=+g[R+44>>2];m=+g[R+48>>2];if(n*i*n*i+(s*i*s*i+q*i*q*i)>k*k+l*l+m*m){g[R+56>>2]=+g[R+56>>2]-1.0/i*s*o*(s*o*k+q*o*l+n*o*m);g[R+60>>2]=+g[R+60>>2]-1.0/i*q*o*(s*o*k+q*o*l+n*o*m);g[R+64>>2]=+g[R+64>>2]-1.0/i*n*o*(s*o*k+q*o*l+n*o*m);break a}else{g[R+56>>2]=s+ +g[R+56>>2];g[R+60>>2]=q+ +g[R+60>>2];g[R+64>>2]=n+ +g[R+64>>2];break a}}default:break a}n=T*o+U*q+V*r<0.0?-1.0:1.0;i=v*r*n+(s*o*n+u*q*n);k=+g[L+(e*44|0)+36>>2]*.5;l=(c[j>>2]=S,+g[j>>2]);m=i*(T*T+U*U+V*V)*m*.5*l*k;if(i>0.0&i<.9847999811172485){C=+x(+(1.0-i*i))*p*.5*l*W*k;D=(v*(s*r*n-v*o*n)-u*(u*o*n-s*q*n))*C*.3333333432674408;E=(s*(u*o*n-s*q*n)-v*(v*q*n-u*r*n))*C*.3333333432674408;C=(u*(v*q*n-u*r*n)-s*(s*r*n-v*o*n))*C*.3333333432674408}else{D=0.0;E=0.0;C=0.0}i=+g[M+88>>2];if(i>0.0){i=v*m*-.3333333432674408*i*B*v*m*-.3333333432674408*i*B+(s*m*-.3333333432674408*i*B*s*m*-.3333333432674408*i*B+u*m*-.3333333432674408*i*B*u*m*-.3333333432674408*i*B);if(i>0.0?i>=O*O+P*P+Q*Q:0){i=+x(+(O*O+P*P+Q*Q))/+x(+i)*.800000011920929;l=s*m*-.3333333432674408*i;k=u*m*-.3333333432674408*i;i=v*m*-.3333333432674408*i}else{l=s*m*-.3333333432674408;k=u*m*-.3333333432674408;i=v*m*-.3333333432674408}v=k+ +g[M+60>>2];B=i+ +g[M+64>>2];g[M+56>>2]=D+(l+ +g[M+56>>2]);g[M+60>>2]=E+v;g[M+64>>2]=C+B}else{l=s*m*-.3333333432674408;k=u*m*-.3333333432674408;i=v*m*-.3333333432674408}m=+g[N+88>>2];if(m>0.0){n=+g[F+452>>2];q=l*m*n;r=k*m*n;m=i*m*n;n=+g[N+40>>2];o=+g[N+44>>2];p=+g[N+48>>2];if(m*m+(q*q+r*r)>0.0?m*m+(q*q+r*r)>=n*n+o*o+p*p:0){B=+x(+(n*n+o*o+p*p))/+x(+(m*m+(q*q+r*r)))*.800000011920929;l=l*B;k=k*B;i=i*B}v=k+ +g[N+60>>2];B=i+ +g[N+64>>2];g[N+56>>2]=D+(l+ +g[N+56>>2]);g[N+60>>2]=E+v;g[N+64>>2]=C+B}m=+g[R+88>>2];if(m>0.0){n=+g[F+452>>2];q=l*m*n;r=k*m*n;m=i*m*n;n=+g[R+40>>2];o=+g[R+44>>2];p=+g[R+48>>2];if(m*m+(q*q+r*r)>0.0?m*m+(q*q+r*r)>=n*n+o*o+p*p:0){B=+x(+(n*n+o*o+p*p))/+x(+(m*m+(q*q+r*r)))*.800000011920929;l=l*B;k=k*B;i=i*B}v=k+ +g[R+60>>2];B=i+ +g[R+64>>2];g[R+56>>2]=D+(l+ +g[R+56>>2]);g[R+60>>2]=E+v;g[R+64>>2]=C+B}}while(0);e=e+1|0}while((e|0)!=(f|0))}e=c[3084]|0;A=(c[e+16>>2]|0)+-1|0;c[e+16>>2]=A;do if(!A){if(c[e+4>>2]|0){la(X+128|0,0)|0;A=c[7181]|0;g[e+8>>2]=+g[e+8>>2]+ +(((c[X+128+4>>2]|0)-(c[A+4>>2]|0)+(((c[X+128>>2]|0)-(c[A>>2]|0)|0)*1e6|0)-(c[e+12>>2]|0)|0)>>>0)/1.0e3;if(c[e+16>>2]|0)break;e=c[3084]|0}c[3084]=c[e+20>>2]}while(0);f=c[F+712>>2]|0;if((f|0)>0){e=0;do{z=c[F+720>>2]|0;y=z+(e*104|0)+8|0;A=z+(e*104|0)+24|0;c[A>>2]=c[y>>2];c[A+4>>2]=c[y+4>>2];c[A+8>>2]=c[y+8>>2];c[A+12>>2]=c[y+12>>2];A=z+(e*104|0)+56|0;D=+g[z+(e*104|0)+88>>2];E=+g[F+452>>2];B=+g[A>>2]*D*E;C=D*+g[z+(e*104|0)+60>>2]*E;D=E*D*+g[z+(e*104|0)+64>>2];E=+g[(c[F+684>>2]|0)+12>>2]/E;B=B>E?E:B;C=C>E?E:C;D=D>E?E:D;t=z+(e*104|0)+40|0;B=(B<-E?-E:B)+ +g[t>>2];g[t>>2]=B;t=z+(e*104|0)+44|0;C=(C<-E?-E:C)+ +g[t>>2];g[t>>2]=C;t=z+(e*104|0)+48|0;D=(D<-E?-E:D)+ +g[t>>2];g[t>>2]=D;E=+g[F+452>>2];g[y>>2]=B*E+ +g[y>>2];y=z+(e*104|0)+12|0;g[y>>2]=C*E+ +g[y>>2];z=z+(e*104|0)+16|0;g[z>>2]=D*E+ +g[z>>2];c[A>>2]=0;c[A+4>>2]=0;c[A+8>>2]=0;c[A+12>>2]=0;e=e+1|0}while((e|0)!=(f|0))}Yb(F);e=c[F+928>>2]|0;if(e){A=c[F+192>>2]|0;C=+va[c[(c[A>>2]|0)+48>>2]&15](A);E=+g[e+4>>2]-C;D=+g[e+8>>2]-C;g[F+892>>2]=+g[e>>2]-C;g[F+896>>2]=E;g[F+900>>2]=D;g[F+904>>2]=0.0;D=C+ +g[e+20>>2];E=C+ +g[e+24>>2];g[F+908>>2]=C+ +g[e+16>>2];g[F+912>>2]=D;g[F+916>>2]=E;g[F+920>>2]=0.0;e=c[F+188>>2]|0;if(e|0){A=c[F+684>>2]|0;z=c[A+32>>2]|0;eb[c[(c[z>>2]|0)+16>>2]&31](z,e,F+892|0,F+908|0,c[A+36>>2]|0)}}else{c[F+892>>2]=0;c[F+892+4>>2]=0;c[F+892+8>>2]=0;c[F+892+12>>2]=0;c[F+892+16>>2]=0;c[F+892+20>>2]=0;c[F+892+24>>2]=0;c[F+892+28>>2]=0}f=c[F+712>>2]|0;if((f|0)>0){e=0;do{z=c[F+720>>2]|0;D=+g[F+464>>2];B=+g[z+(e*104|0)+8>>2];E=+g[z+(e*104|0)+12>>2];C=+g[z+(e*104|0)+16>>2];g[X>>2]=B-D;g[X+4>>2]=E-D;g[X+8>>2]=C-D;g[X+12>>2]=0.0;g[X+16>>2]=D+B;g[X+20>>2]=D+E;g[X+24>>2]=D+C;g[X+28>>2]=0.0;A=c[z+(e*104|0)+96>>2]|0;C=+g[F+460>>2];D=C*+g[z+(e*104|0)+44>>2];E=C*+g[z+(e*104|0)+48>>2];g[X+128>>2]=+g[z+(e*104|0)+40>>2]*C;g[X+128+4>>2]=D;g[X+128+8>>2]=E;g[X+128+12>>2]=0.0;Bg(F+928|0,A,X,X+128|0,+g[F+468>>2])|0;e=e+1|0}while((e|0)!=(f|0))}if(c[F+988>>2]|0?(c[F+752>>2]|0)>0:0){e=0;do{A=c[F+760>>2]|0;t=c[A+(e*44|0)+8>>2]|0;y=c[A+(e*44|0)+12>>2]|0;z=c[A+(e*44|0)+16>>2]|0;B=(+g[t+40>>2]+ +g[y+40>>2]+ +g[z+40>>2])*.3333333432674408;C=(+g[t+44>>2]+ +g[y+44>>2]+ +g[z+44>>2])*.3333333432674408;D=(+g[t+48>>2]+ +g[y+48>>2]+ +g[z+48>>2])*.3333333432674408;r=+g[F+464>>2];o=+g[t+8>>2];q=+g[t+12>>2];u=+g[t+16>>2];E=+g[t+20>>2];v=+g[y+8>>2];i=v>2];k=s>2];l=p>2];m=n>2];p=+g[z+12>>2];s=+g[z+16>>2];v=+g[z+20>>2];g[X>>2]=(n>2]=(p>2]=(s>2]=v>2]=r+(o>2]=r+(q>2]=r+(u>2]=E>2]|0;E=+g[F+460>>2];g[X+128>>2]=B*E;g[X+128+4>>2]=C*E;g[X+128+8>>2]=D*E;g[X+128+12>>2]=0.0;Bg(F+988|0,A,X,X+128|0,+g[F+468>>2])|0;e=e+1|0}while((e|0)<(c[F+752>>2]|0))}do if(a[F+473>>0]|0){A=c[F+712>>2]|0;if((A|0)>0){f=c[F+720>>2]|0;h=c[F+512>>2]|0;e=0;i=0.0;k=0.0;l=0.0;do{E=+g[h+(e<<2)>>2];i=i+ +g[f+(e*104|0)+8>>2]*E;k=k+E*+g[f+(e*104|0)+12>>2];l=l+E*+g[f+(e*104|0)+16>>2];e=e+1|0}while((e|0)!=(A|0))}else{i=0.0;k=0.0;l=0.0}g[F+520>>2]=i;g[F+524>>2]=k;g[F+528>>2]=l;g[F+532>>2]=0.0;y=X+128+4|0;z=y+44|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));g[X+128>>2]=1.1920928955078125e-07;g[X+128+20>>2]=2.384185791015625e-07;g[X+128+40>>2]=3.5762786865234375e-07;if((A|0)>0){f=c[F+512>>2]|0;h=c[F+720>>2]|0;t=c[F+492>>2]|0;e=0;m=1.1920928955078125e-07;n=0.0;o=0.0;p=0.0;q=2.384185791015625e-07;r=0.0;s=0.0;u=0.0;v=3.5762786865234375e-07;do{D=+g[f+(e<<2)>>2];Z=(+g[h+(e*104|0)+8>>2]-i)*D;Y=(+g[h+(e*104|0)+12>>2]-k)*D;D=D*(+g[h+(e*104|0)+16>>2]-l);B=+g[t+(e<<4)>>2];C=+g[t+(e<<4)+4>>2];E=+g[t+(e<<4)+8>>2];m=Z*B+m;n=Z*C+n;o=Z*E+o;p=Y*B+p;q=Y*C+q;r=Y*E+r;s=D*B+s;u=D*C+u;v=D*E+v;e=e+1|0}while((e|0)!=(A|0));g[X+128>>2]=m;g[X+128+4>>2]=n;g[X+128+8>>2]=o;g[X+128+16>>2]=p;g[X+128+20>>2]=q;g[X+128+24>>2]=r;g[X+128+32>>2]=s;g[X+128+36>>2]=u;g[X+128+40>>2]=v}if((a[26680]|0)==0?mz(26680)|0:0){g[6830]=9.999999747378752e-05;c[6831]=16}oc(X+128|0,X+80|0,X+32|0);c[F+536>>2]=c[X+80>>2];c[F+536+4>>2]=c[X+80+4>>2];c[F+536+8>>2]=c[X+80+8>>2];c[F+536+12>>2]=c[X+80+12>>2];c[F+552>>2]=c[I>>2];c[F+552+4>>2]=c[I+4>>2];c[F+552+8>>2]=c[I+8>>2];c[F+552+12>>2]=c[I+12>>2];c[F+568>>2]=c[J>>2];c[F+568+4>>2]=c[J+4>>2];c[F+568+8>>2]=c[J+8>>2];c[F+568+12>>2]=c[J+12>>2];ca=+g[X+80>>2];_=+g[I>>2];C=+g[J>>2];ba=+g[X+80+4>>2];u=+g[X+80+20>>2];E=+g[X+80+36>>2];aa=+g[X+80+8>>2];v=+g[X+80+24>>2];Z=+g[X+80+40>>2];n=+g[F+632>>2];m=+g[F+636>>2];l=+g[F+640>>2];ia=+g[F+648>>2];ha=+g[F+652>>2];o=+g[F+656>>2];D=+g[F+664>>2];Y=+g[F+668>>2];s=+g[F+672>>2];ga=+g[X+128>>2];fa=+g[X+128+16>>2];p=+g[X+128+32>>2];i=(ca*n+ba*m+aa*l)*ga+(_*n+u*m+v*l)*fa+(C*n+E*m+Z*l)*p;ea=+g[X+128+4>>2];da=+g[X+128+20>>2];q=+g[X+128+36>>2];k=(ca*n+ba*m+aa*l)*ea+(_*n+u*m+v*l)*da+(C*n+E*m+Z*l)*q;$=+g[X+128+8>>2];B=+g[X+128+24>>2];r=+g[X+128+40>>2];l=(ca*n+ba*m+aa*l)*$+(_*n+u*m+v*l)*B+(C*n+E*m+Z*l)*r;m=(ca*ia+ba*ha+aa*o)*ga+(_*ia+u*ha+v*o)*fa+(C*ia+E*ha+Z*o)*p;n=(ca*ia+ba*ha+aa*o)*ea+(_*ia+u*ha+v*o)*da+(C*ia+E*ha+Z*o)*q;o=(ca*ia+ba*ha+aa*o)*$+(_*ia+u*ha+v*o)*B+(C*ia+E*ha+Z*o)*r;p=ga*(ca*D+ba*Y+aa*s)+fa*(_*D+u*Y+v*s)+(C*D+E*Y+Z*s)*p;q=(ca*D+ba*Y+aa*s)*ea+(_*D+u*Y+v*s)*da+(C*D+E*Y+Z*s)*q;r=(ca*D+ba*Y+aa*s)*$+(_*D+u*Y+v*s)*B+(C*D+E*Y+Z*s)*r;g[F+584>>2]=i;g[F+588>>2]=k;g[F+592>>2]=l;g[F+596>>2]=0.0;g[F+600>>2]=m;g[F+604>>2]=n;g[F+608>>2]=o;g[F+612>>2]=0.0;g[F+616>>2]=p;g[F+620>>2]=q;g[F+624>>2]=r;g[F+628>>2]=0.0;s=+g[F+364>>2];if(s>1.0){ia=1.0/(l*(q*m-n*p)+(i*(n*r-o*q)+k*(o*p-r*m)))<1.0?1.0:s<1.0/(l*(q*m-n*p)+(i*(n*r-o*q)+k*(o*p-r*m)))?s:1.0/(l*(q*m-n*p)+(i*(n*r-o*q)+k*(o*p-r*m)));g[F+584>>2]=i*ia;g[F+588>>2]=k*ia;g[F+592>>2]=l*ia;g[F+596>>2]=0.0;g[F+600>>2]=m*ia;g[F+604>>2]=n*ia;g[F+608>>2]=o*ia;g[F+612>>2]=0.0;g[F+616>>2]=p*ia;g[F+620>>2]=q*ia;g[F+624>>2]=r*ia;g[F+628>>2]=0.0}if(a[F+473>>0]|0){if(!(+g[F+320>>2]>0.0))break;i=+g[F+536>>2];n=+g[F+540>>2];o=+g[F+544>>2];p=+g[F+552>>2];q=+g[F+556>>2];r=+g[F+560>>2];k=+g[F+568>>2];l=+g[F+572>>2];m=+g[F+576>>2];f=c[F+712>>2]|0;if((f|0)<=0)break;e=0;do{h=c[F+720>>2]|0;if(+g[h+(e*104|0)+88>>2]>0.0){y=c[F+492>>2]|0;da=+g[y+(e<<4)>>2];ea=+g[y+(e<<4)+4>>2];fa=+g[y+(e<<4)+8>>2];ca=+g[F+320>>2];y=h+(e*104|0)+8|0;ga=+g[y>>2];z=h+(e*104|0)+12|0;ha=+g[z>>2];A=h+(e*104|0)+16|0;ia=+g[A>>2];ha=ha+ca*(p*da+q*ea+r*fa+ +g[F+524>>2]-ha);ia=ia+ca*(k*da+l*ea+m*fa+ +g[F+528>>2]-ia);g[y>>2]=ga+ca*(+g[F+520>>2]+(i*da+n*ea+o*fa)-ga);g[z>>2]=ha;g[A>>2]=ia;g[h+(e*104|0)+20>>2]=0.0}e=e+1|0}while((e|0)!=(f|0))}}while(0);y=X+128|0;z=y+104|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));e=c[F+812>>2]|0;if((e|0)<0){if((c[F+816>>2]|0)<0){f=c[F+820>>2]|0;if(f|0){if(a[F+824>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[F+820>>2]=0}a[F+824>>0]=1;c[F+820>>2]=0;c[F+816>>2]=0}do{A=c[F+820>>2]|0;z=A+(e*104|0)|0;c[z>>2]=c[X+128>>2];c[z+4>>2]=c[X+128+4>>2];c[z+8>>2]=c[X+128+8>>2];c[z+12>>2]=c[X+128+12>>2];c[z+16>>2]=c[X+128+16>>2];c[z+20>>2]=c[X+128+20>>2];c[z+24>>2]=c[X+128+24>>2];z=A+(e*104|0)+28|0;c[z>>2]=c[X+128+28>>2];c[z+4>>2]=c[X+128+28+4>>2];c[z+8>>2]=c[X+128+28+8>>2];c[z+12>>2]=c[X+128+28+12>>2];z=A+(e*104|0)+44|0;c[z>>2]=c[X+128+44>>2];c[z+4>>2]=c[X+128+44+4>>2];c[z+8>>2]=c[X+128+44+8>>2];c[z+12>>2]=c[X+128+44+12>>2];z=A+(e*104|0)+60|0;c[z>>2]=c[X+128+60>>2];c[z+4>>2]=c[X+128+60+4>>2];c[z+8>>2]=c[X+128+60+8>>2];c[z+12>>2]=c[X+128+60+12>>2];A=A+(e*104|0)+76|0;c[A>>2]=c[H>>2];c[A+4>>2]=c[H+4>>2];c[A+8>>2]=c[H+8>>2];c[A+12>>2]=c[H+12>>2];c[A+16>>2]=c[H+16>>2];c[A+20>>2]=c[H+20>>2];c[A+24>>2]=c[H+24>>2];e=e+1|0}while((e|0)!=0)}c[F+812>>2]=0;y=X+128|0;z=y+56|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));e=c[F+832>>2]|0;if((e|0)<0){if((c[F+836>>2]|0)<0){f=c[F+840>>2]|0;if(f|0){if(a[F+844>>0]|0){c[7183]=(c[7183]|0)+1;Hc(c[f+-4>>2]|0)}c[F+840>>2]=0}a[F+844>>0]=1;c[F+840>>2]=0;c[F+836>>2]=0}do{y=(c[F+840>>2]|0)+(e*56|0)|0;f=X+128|0;z=y+56|0;do{c[y>>2]=c[f>>2];y=y+4|0;f=f+4|0}while((y|0)<(z|0));e=e+1|0}while((e|0)!=0)}c[F+832>>2]=0;uf(F+928|0,1);uf(F+988|0,1);uf(F+1048|0,1);e=c[b+24>>2]|0}}G=G+1|0}while((G|0)<(e|0));sa=X;return}function ub(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,K=0,L=0,M=0,N=0,O=0;K=sa;sa=sa+144|0;a:do switch(d-b|0){case 0:{c[e>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;sa=K;return}case 2:{f=c[(c[a+92>>2]|0)+(b<<2)>>2]|0;i=c[f+88>>2]|0;j=c[f+200>>2]|0;h=c[f+92>>2]|0;g=c[f+204>>2]|0;if((i|0)==(j|0)&(h|0)==(g|0))if((c[f+96>>2]|0)==(c[f+208>>2]|0))break a;else g=h;g=h-g|0;do if(g|i-j){c[f>>2]=f+112;c[f+4>>2]=f+112;c[f+112>>2]=f;c[f+116>>2]=f;I=(i-j|0)<0|(i-j|0)==0&(g|0)<0;c[e>>2]=I?f:f+112|0;c[e+4>>2]=I?f+112|0:f;if((g|0)<0|(i-j|0)<0&(g|0)==0){c[e+8>>2]=f;g=f;h=f+112|0;f=f+112|0;break}else{c[e+8>>2]=f+112;g=f;h=f+112|0;break}}else{h=(c[f+96>>2]|0)>(c[f+208>>2]|0);I=h?f+112|0:f;c[I>>2]=I;c[I+4>>2]=I;c[e>>2]=I;c[e+4>>2]=I;c[e+8>>2]=I;g=I;h=h?f:f+112|0;f=I}while(0);c[e+12>>2]=f;a=df(a,g,h)|0;c[a>>2]=a;c[a+4>>2]=a;c[g+8>>2]=a;a=c[a+8>>2]|0;c[a>>2]=a;c[a+4>>2]=a;c[h+8>>2]=a;sa=K;return}case 1:{f=c[(c[a+92>>2]|0)+(b<<2)>>2]|0;break}default:{m=((d-b|0)/2|0)+b|0;l=c[a+92>>2]|0;k=c[l+(m+-1<<2)>>2]|0;i=c[k+88>>2]|0;j=c[k+92>>2]|0;k=c[k+96>>2]|0;b:do if((m|0)<(d|0)){f=m;do{h=c[l+(f<<2)>>2]|0;if((c[h+88>>2]|0)!=(i|0))break b;if((c[h+92>>2]|0)!=(j|0))break b;if((c[h+96>>2]|0)!=(k|0))break b;f=f+1|0}while((f|0)<(d|0))}else f=m;while(0);ub(a,b,m,e);c[K+96>>2]=0;c[K+96+4>>2]=0;c[K+96+8>>2]=0;c[K+96+12>>2]=0;ub(a,f,d,K+96|0);j=c[K+96+4>>2]|0;c:do if(j|0){z=c[e+4>>2]|0;if(!z){c[e>>2]=c[K+96>>2];c[e+4>>2]=c[K+96+4>>2];c[e+8>>2]=c[K+96+8>>2];c[e+12>>2]=c[K+96+12>>2];break}c[a+100>>2]=(c[a+100>>2]|0)+-1;l=c[e+12>>2]|0;h=c[K+96+8>>2]|0;i=c[l+88>>2]|0;d:do if((i|0)==(c[h+88>>2]|0)?(g=c[l+92>>2]|0,(g|0)==(c[h+92>>2]|0)):0){k=c[h+4>>2]|0;if((k|0)==(h|0)){f=c[h+8>>2]|0;if(!f)f=i;else{h=c[f+12>>2]|0;f=c[h+88>>2]|0;g=c[h+92>>2]|0}k=h;j=f+1|0;d=l;m=c[h+96>>2]|0;f=l;b=h;break}i=c[h>>2]|0;c[k>>2]=i;c[i+4>>2]=k;if((h|0)==(c[K+96>>2]|0)){f=c[i+88>>2]|0;g=c[k+88>>2]|0;do if((f|0)<(g|0))f=i;else{if((f|0)==(g|0)?(c[i+92>>2]|0)<(c[k+92>>2]|0):0){f=i;break}f=k}while(0);c[K+96>>2]=f}if((h|0)==(j|0)){f=c[i+88>>2]|0;g=c[k+88>>2]|0;do if((f|0)<=(g|0)){if((f|0)==(g|0)?(c[i+92>>2]|0)>(c[k+92>>2]|0):0)break;c[K+96+4>>2]=k;i=k;G=39;break d}while(0);c[K+96+4>>2]=i;G=39}else{i=j;G=39}}else{i=j;G=39}while(0);if((G|0)==39){x=c[e>>2]|0;y=c[K+96>>2]|0;d=z;j=0;b=0;v=1;w=0;n=i;while(1){h=c[n+88>>2]|0;m=c[d+88>>2]|0;g=J(h-m|0,v)|0;e:do if((g|0)<=0){if((g|0)<0){u=(w|0)!=0;k=d;f=n;l=c[d+92>>2]|0;t=c[n+92>>2]|0;while(1){q=c[(u?f+4|0:f)>>2]|0;r=(q|0)==(f|0);s=f+88|0;while(1){d=k+88|0;p=t-l|0;if(!r?(A=c[q+88>>2]|0,B=J(A-h|0,v)|0,C=c[q+92>>2]|0,D=C-t|0,(D|0)>-1):0){if(!B)break;if((B|0)<0?(J(D,g)|0)<=(J(B,p)|0):0)break}o=c[(u?k+4|0:k)>>2]|0;if((o|0)==(k|0))break e;F=c[o+88>>2]|0;m=J(F-(c[d>>2]|0)|0,v)|0;n=c[o+92>>2]|0;l=n-l|0;h=c[s>>2]|0;d=J(h-F|0,v)|0;if(!((l|0)>0&(d|0)<0))break e;if(m|0){if((m|0)>=0)break e;if((J(l,g)|0)>=(J(m,p)|0))break e}k=o;g=d;l=n}f=q;g=J(A-(c[d>>2]|0)|0,v)|0;t=C;h=A}}f=c[d+92>>2]|0;l=(w|0)!=0;g=c[(l?d:d+4|0)>>2]|0;f:do if((g|0)!=(d|0))if(l){h=d;k=f;while(1){if((c[g+88>>2]|0)!=(m|0)){k=h;break f}F=k;k=c[g+92>>2]|0;if((k|0)>(F|0)){k=h;break f}f=c[g>>2]|0;if((f|0)==(d|0)){k=g;break}else{h=g;g=f}}}else{h=d;k=f;while(1){if((c[g+88>>2]|0)!=(m|0)){k=h;break f}F=k;k=c[g+92>>2]|0;if((k|0)>(F|0)){k=h;break f}f=c[g+4>>2]|0;if((f|0)==(d|0)){k=g;break}else{h=g;g=f}}}else k=d;while(0);f=c[n+92>>2]|0;h=c[(l?n+4|0:n)>>2]|0;if((h|0)!=(n|0))if(l){g=f;f=n;while(1){if((c[h+88>>2]|0)!=(m|0))break e;F=g;g=c[h+92>>2]|0;if((g|0)<(F|0))break e;f=c[h+4>>2]|0;if((f|0)==(n|0)){f=h;break}else{F=h;h=f;f=F}}}else{g=f;f=n;while(1){if((c[h+88>>2]|0)!=(m|0))break e;F=g;g=c[h+92>>2]|0;if((g|0)<(F|0))break e;f=c[h>>2]|0;if((f|0)==(n|0)){f=h;break}else{F=h;h=f;f=F}}}else f=n}else{r=(w|0)!=0;h=d;f=n;q=c[n+92>>2]|0;while(1){o=f+88|0;k=h;h=c[h+92>>2]|0;while(1){p=q-h|0;l=c[(r?k:k+4|0)>>2]|0;if((l|0)==(k|0))break;d=c[l+88>>2]|0;m=J(d-(c[k+88>>2]|0)|0,v)|0;n=c[l+92>>2]|0;h=n-h|0;if((h|0)>=1)break;if(m|0){if((m|0)>=0)break;if((J(h,g)|0)>(J(m,p)|0))break}g=J((c[o>>2]|0)-d|0,v)|0;k=l;h=n}n=c[(r?f:f+4|0)>>2]|0;if((n|0)==(f|0))break e;l=c[n+88>>2]|0;d=J(l-(c[o>>2]|0)|0,v)|0;m=c[n+92>>2]|0;h=m-q|0;l=J(l-(c[k+88>>2]|0)|0,v)|0;if(!((h|0)<0&(l|0)>0))break e;if(d|0){if((d|0)>=0)break e;if((J(h,g)|0)>=(J(d,p)|0))break e}g=l;h=k;f=n;q=m}}while(0);g=(w|0)==0;b=g?f:b;j=g?k:j;n=g?y:f;d=g?x:k;w=w+1|0;if((w|0)==2)break;else v=g?-1:v}c[d+4>>2]=n;c[n>>2]=d;c[j>>2]=b;c[b+4>>2]=j;if((c[y+88>>2]|0)<(c[x+88>>2]|0))c[e>>2]=y;if((c[i+88>>2]|0)>=(c[z+88>>2]|0))c[e+4>>2]=i;c[e+12>>2]=c[K+96+12>>2];g=j;k=b;l=b+88|0;v=c[l>>2]|0;q=c[j+88>>2]|0;i=b+92|0;w=c[i>>2]|0;x=c[j+92>>2]|0;h=b+96|0;y=c[h>>2]|0;r=c[j+96>>2]|0;z=((w-x|0)<0)<<31>>31;A=0-(v-q)|0;B=lv(0,0,A|0,((A|0)<0)<<31>>31|0)|0;B=Vr(B|0,Q()|0,y-r|0,((y-r|0)<0)<<31>>31|0)|0;C=Q()|0;D=Vr(y-r|0,((y-r|0)<0)<<31>>31|0,w-x|0,z|0)|0;e=Q()|0;s=Vr(A|0,((A|0)<0)<<31>>31|0,v-q|0,((v-q|0)<0)<<31>>31|0)|0;F=Q()|0;E=Vr(w-x|0,z|0,w-x|0,z|0)|0;E=lv(s|0,F|0,E|0,Q()|0)|0;F=Q()|0;s=c[j+8>>2]|0;c[K+120>>2]=0;if(!s)s=0;else{t=lv(0,0,w-x|0,z|0)|0;u=Q()|0;p=s;f=0;do{n=c[p+12>>2]|0;d=c[n+88>>2]|0;m=c[n+92>>2]|0;n=c[n+96>>2]|0;M=Vr(m-x|0,((m-x|0)<0)<<31>>31|0,A|0,((A|0)<0)<<31>>31|0)|0;o=Q()|0;L=Vr(t|0,u|0,d-q|0,((d-q|0)<0)<<31>>31|0)|0;g:do if((M|0)==(L|0)&(o|0)==(Q()|0)?(L=Vr(B|0,C|0,d-q|0,((d-q|0)<0)<<31>>31|0)|0,o=Q()|0,M=Vr(D|0,e|0,m-x|0,((m-x|0)<0)<<31>>31|0)|0,o=xv(M|0,Q()|0,L|0,o|0)|0,L=Q()|0,M=Vr(E|0,F|0,n-r|0,((n-r|0)<0)<<31>>31|0)|0,M=xv(o|0,L|0,M|0,Q()|0)|0,L=Q()|0,(L|0)>0|(L|0)==0&M>>>0>0):0){do if(f|0){o=(c[f+4>>2]|0)==(p|0);if((c[f>>2]|0)!=(p|0))if(o)break;else break g;if(!o)break g;L=c[f+12>>2]|0;N=c[(c[p+8>>2]|0)+12>>2]|0;M=c[N+88>>2]|0;o=c[N+92>>2]|0;N=c[N+96>>2]|0;O=(c[L+96>>2]|0)-N|0;o=(J(n-N|0,(c[L+92>>2]|0)-o|0)|0)-(J(O,m-o|0)|0)|0;M=(J(O,d-M|0)|0)-(J(n-N|0,(c[L+88>>2]|0)-M|0)|0)|0;o=Vr(o|0,((o|0)<0)<<31>>31|0,w-x|0,z|0)|0;L=Q()|0;M=Vr(M|0,((M|0)<0)<<31>>31|0,A|0,((A|0)<0)<<31>>31|0)|0;M=xv(o|0,L|0,M|0,Q()|0)|0;L=Q()|0;if((L|0)>0|(L|0)==0&M>>>0>0)break g}while(0);f=p}while(0);p=c[p>>2]|0}while((p|0)!=(s|0));c[K+120>>2]=f;s=f}p=c[b+8>>2]|0;c[K+72>>2]=0;if(!p)f=0;else{q=lv(0,0,w-x|0,z|0)|0;r=Q()|0;o=p;f=0;do{n=c[o+12>>2]|0;d=c[n+88>>2]|0;m=c[n+92>>2]|0;n=c[n+96>>2]|0;M=Vr(m-w|0,((m-w|0)<0)<<31>>31|0,A|0,((A|0)<0)<<31>>31|0)|0;O=Q()|0;N=Vr(q|0,r|0,d-v|0,((d-v|0)<0)<<31>>31|0)|0;do if((M|0)==(N|0)&(O|0)==(Q()|0)?(N=Vr(B|0,C|0,d-v|0,((d-v|0)<0)<<31>>31|0)|0,M=Q()|0,O=Vr(D|0,e|0,m-w|0,((m-w|0)<0)<<31>>31|0)|0,M=xv(O|0,Q()|0,N|0,M|0)|0,N=Q()|0,O=Vr(E|0,F|0,n-y|0,((n-y|0)<0)<<31>>31|0)|0,O=xv(M|0,N|0,O|0,Q()|0)|0,N=Q()|0,(N|0)>0|(N|0)==0&O>>>0>0):0){if(f|0){if((c[f>>2]|0)!=(o|0))break;if((c[f+4>>2]|0)==(o|0)?(N=c[f+12>>2]|0,L=c[(c[o+8>>2]|0)+12>>2]|0,O=c[L+88>>2]|0,M=c[L+92>>2]|0,L=c[L+96>>2]|0,u=(c[N+96>>2]|0)-L|0,M=(J(n-L|0,(c[N+92>>2]|0)-M|0)|0)-(J(u,m-M|0)|0)|0,O=(J(u,d-O|0)|0)-(J(n-L|0,(c[N+88>>2]|0)-O|0)|0)|0,M=Vr(M|0,((M|0)<0)<<31>>31|0,w-x|0,z|0)|0,N=Q()|0,O=Vr(O|0,((O|0)<0)<<31>>31|0,A|0,((A|0)<0)<<31>>31|0)|0,O=xv(M|0,N|0,O|0,Q()|0)|0,N=Q()|0,!((N|0)>0|(N|0)==0&O>>>0>0)):0)break}f=o}while(0);o=c[o>>2]|0}while((o|0)!=(p|0));c[K+72>>2]=f}if((s|0)!=0|(f|0)!=0){yb(a,j,b,K+120|0,K+72|0);f=c[K+120>>2]|0;if(f){j=c[f+12>>2]|0;g=j}f=c[K+72>>2]|0;if(!f)f=j;else{b=c[f+12>>2]|0;k=b;l=b+88|0;h=b+96|0;i=b+92|0;f=j}}else f=j;j=c[l>>2]|0;d=g;m=(c[h>>2]|0)+1|0;g=c[i>>2]|0}D=0;e=0;h=0;v=0;E=1;A=0;B=0;i=0;y=0;z=j;x=d;u=b;t=f;while(1){O=c[t+88>>2]|0;F=(c[u+88>>2]|0)-O|0;N=c[t+92>>2]|0;w=(c[u+92>>2]|0)-N|0;C=c[t+96>>2]|0;r=(c[u+96>>2]|0)-C|0;c[K+120>>2]=F;c[K+120+4>>2]=w;c[K+120+8>>2]=r;c[K+120+12>>2]=-1;O=z-O|0;N=g-N|0;C=m-C|0;s=(J(N,r)|0)-(J(C,w)|0)|0;C=(J(C,F)|0)-(J(O,r)|0)|0;N=(J(O,w)|0)-(J(N,F)|0)|0;c[K+72>>2]=s;c[K+72+4>>2]=((s|0)<0)<<31>>31;c[K+72+8>>2]=C;c[K+72+8+4>>2]=((C|0)<0)<<31>>31;c[K+72+16>>2]=N;c[K+72+16+4>>2]=((N|0)<0)<<31>>31;O=Vr(N|0,((N|0)<0)<<31>>31|0,w|0,((w|0)<0)<<31>>31|0)|0;M=Q()|0;L=Vr(C|0,((C|0)<0)<<31>>31|0,r|0,((r|0)<0)<<31>>31|0)|0;L=lv(O|0,M|0,L|0,Q()|0)|0;M=Q()|0;r=Vr(s|0,((s|0)<0)<<31>>31|0,r|0,((r|0)<0)<<31>>31|0)|0;O=Q()|0;N=Vr(N|0,((N|0)<0)<<31>>31|0,F|0,((F|0)<0)<<31>>31|0)|0;N=lv(r|0,O|0,N|0,Q()|0)|0;O=Q()|0;F=Vr(C|0,((C|0)<0)<<31>>31|0,F|0,((F|0)<0)<<31>>31|0)|0;C=Q()|0;w=Vr(s|0,((s|0)<0)<<31>>31|0,w|0,((w|0)<0)<<31>>31|0)|0;w=lv(F|0,C|0,w|0,Q()|0)|0;C=Q()|0;c[K+48>>2]=L;c[K+48+4>>2]=M;c[K+48+8>>2]=N;c[K+48+8+4>>2]=O;c[K+48+16>>2]=w;c[K+48+16+4>>2]=C;c[K+24>>2]=0;c[K+24+4>>2]=0;c[K+24+8>>2]=0;c[K+24+12>>2]=0;c[K+24+16>>2]=0;C=Ic(a,0,t,K+120|0,K+72|0,K+48|0,K+24|0)|0;c[K>>2]=0;c[K+4>>2]=0;c[K+8>>2]=0;c[K+12>>2]=0;c[K+16>>2]=0;w=Ic(a,1,u,K+120|0,K+72|0,K+48|0,K)|0;do if((C|0)!=0|(w|0)!=0){j=C|0?-1:1;do if((C|0)!=0&(w|0)!=0){s=c[K+24+16>>2]|0;j=c[K+16>>2]|0;if((s|0)!=(j|0)){o=s-j|0;break}if(!s)o=0;else{O=c[K+24>>2]|0;q=c[K+24+4>>2]|0;d=c[K+8>>2]|0;M=c[K+8+4>>2]|0;l=Vr(d|0,0,O|0,0)|0;j=Q()|0;O=Vr(M|0,0,O|0,0)|0;N=Q()|0;d=Vr(d|0,0,q|0,0)|0;n=Q()|0;q=Vr(M|0,0,q|0,0)|0;M=Q()|0;d=xv(O|0,0,d|0,0)|0;O=Q()|0;M=xv(N|0,0,q|0,M|0)|0;n=xv(M|0,Q()|0,n|0,0)|0;O=xv(n|0,Q()|0,O|0,0)|0;n=Q()|0;j=xv(0,d|0,l|0,j|0)|0;l=Q()|0;d=xv(O|0,n|0,(l>>>0>>0|(l|0)==(d|0)&j>>>0<0)&1|0,0)|0;n=Q()|0;O=c[K+24+8>>2]|0;M=c[K+24+8+4>>2]|0;q=c[K>>2]|0;N=c[K+4>>2]|0;p=Vr(q|0,0,O|0,0)|0;o=Q()|0;O=Vr(N|0,0,O|0,0)|0;L=Q()|0;q=Vr(q|0,0,M|0,0)|0;r=Q()|0;M=Vr(N|0,0,M|0,0)|0;N=Q()|0;q=xv(O|0,0,q|0,0)|0;O=Q()|0;N=xv(L|0,0,M|0,N|0)|0;r=xv(N|0,Q()|0,r|0,0)|0;O=xv(r|0,Q()|0,O|0,0)|0;r=Q()|0;o=xv(0,q|0,p|0,o|0)|0;p=Q()|0;q=xv(O|0,r|0,(p>>>0>>0|(p|0)==(q|0)&o>>>0<0)&1|0,0)|0;r=Q()|0;if(n>>>0>>0|(n|0)==(r|0)&d>>>0>>0)j=-1;else j=n>>>0>r>>>0|(n|0)==(r|0)&d>>>0>q>>>0?1:l>>>0

>>0|(l|0)==(p|0)&j>>>0>>0?-1:(l>>>0>p>>>0|(l|0)==(p|0)&j>>>0>o>>>0)&1;o=J(j,s)|0}}else o=j;while(0);do if(!E)if((o|0)>-1)if((c[K+16>>2]|0)<0&((c[K+8>>2]|0)==0?(c[K+8+4>>2]|0)==0:0)){n=y;break}else{G=139;break}else if((c[K+24+16>>2]|0)<0&((c[K+24+8>>2]|0)==0?(c[K+24+8+4>>2]|0)==0:0)){n=y;break}else{G=139;break}else G=139;while(0);if((G|0)==139){G=0;l=df(a,t,u)|0;if(!v)h=l;else c[v+4>>2]=l;c[l>>2]=v;j=c[l+8>>2]|0;if(!y)i=j;else c[y>>2]=j;c[j+4>>2]=y;v=l;n=j}c[K+116>>2]=C;c[K+112>>2]=w;if(!o){yb(a,x,k,K+116|0,K+112|0);j=c[K+112>>2]|0}else j=w;if((o|0)>-1&(j|0)!=0){d=(A|0)!=0;if(d?(H=c[A>>2]|0,(H|0)!=(w|0)):0){j=H;do{l=j;j=c[j>>2]|0;m=c[l+8>>2]|0;if((j|0)==(l|0))g=0;else{c[j+4>>2]=c[l+4>>2];c[c[l+4>>2]>>2]=j;g=j}c[(c[m+12>>2]|0)+8>>2]=g;g=c[m>>2]|0;if((g|0)==(m|0)){c[(c[l+12>>2]|0)+8>>2]=0;g=m+4|0}else{c[g+4>>2]=c[m+4>>2];c[c[m+4>>2]>>2]=g;c[(c[l+12>>2]|0)+8>>2]=g;g=m+4|0}c[l+4>>2]=0;c[l+4+4>>2]=0;c[l+4+8>>2]=0;c[l+4+12>>2]=0;c[l>>2]=c[a+56>>2];c[a+56>>2]=l;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[m>>2]=c[a+56>>2];c[a+56>>2]=m;c[a+116>>2]=(c[a+116>>2]|0)+-1}while((j|0)!=(w|0))}do if(n)if(d){c[A>>2]=i;c[i+4>>2]=A;c[n>>2]=w;c[w+4>>2]=n;g=B;i=0;break}else{g=c[w+4>>2]|0;c[g>>2]=i;c[i+4>>2]=g;c[n>>2]=w;c[w+4>>2]=n;g=i;i=0;break}else g=d?B:w;while(0);O=k;k=c[K+112>>2]|0;s=c[k+8>>2]|0;q=g;A=0;k=c[k+12>>2]|0;j=c[O+88>>2]|0;m=c[O+96>>2]|0;g=c[O+92>>2]|0}else{s=A;q=B;A=n;j=z}if((o|0)<1&(c[K+116>>2]|0)!=0){d=(D|0)!=0;if(d?(I=c[D+4>>2]|0,(I|0)!=(C|0)):0){j=I;do{m=j+4|0;l=j;j=c[m>>2]|0;g=c[l>>2]|0;n=c[l+8>>2]|0;if((g|0)==(l|0))g=0;else{c[g+4>>2]=j;c[c[m>>2]>>2]=g}c[(c[n+12>>2]|0)+8>>2]=g;g=c[n>>2]|0;if((g|0)==(n|0)){c[(c[l+12>>2]|0)+8>>2]=0;g=n+4|0}else{c[g+4>>2]=c[n+4>>2];c[c[n+4>>2]>>2]=g;c[(c[l+12>>2]|0)+8>>2]=g;g=n+4|0}c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[l>>2]=c[a+56>>2];c[a+56>>2]=l;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[n>>2]=c[a+56>>2];c[a+56>>2]=n;c[a+116>>2]=(c[a+116>>2]|0)+-1}while((j|0)!=(C|0))}do if(v)if(d){c[h>>2]=D;c[D+4>>2]=h;c[C>>2]=v;c[v+4>>2]=C;g=e;h=0;break}else{g=c[C>>2]|0;c[h>>2]=g;c[g+4>>2]=h;c[C>>2]=v;c[v+4>>2]=C;g=h;h=0;break}else g=d?e:C;while(0);O=x;x=c[K+116>>2]|0;r=c[x+8>>2]|0;p=g;v=0;w=c[O+88>>2]|0;x=c[x+12>>2]|0;y=c[O+96>>2]|0;g=c[O+92>>2]|0}else{r=D;p=e;w=j;y=m}if((f|0)==(x|0)&(b|0)==(k|0)){if(r){o=r+4|0;j=c[o>>2]|0;if((j|0)!=(p|0))do{m=j+4|0;d=j;j=c[m>>2]|0;l=c[d>>2]|0;n=c[d+8>>2]|0;if((l|0)==(d|0))l=0;else{c[l+4>>2]=j;c[c[m>>2]>>2]=l}c[(c[n+12>>2]|0)+8>>2]=l;l=c[n>>2]|0;if((l|0)==(n|0)){c[(c[d+12>>2]|0)+8>>2]=0;l=n+4|0}else{c[l+4>>2]=c[n+4>>2];c[c[n+4>>2]>>2]=l;c[(c[d+12>>2]|0)+8>>2]=l;l=n+4|0}c[m>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[d>>2]=c[a+56>>2];c[a+56>>2]=d;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;c[n>>2]=c[a+56>>2];c[a+56>>2]=n;c[a+116>>2]=(c[a+116>>2]|0)+-1}while((j|0)!=(p|0));if(v|0){c[h>>2]=r;c[o>>2]=h;c[p>>2]=v;c[v+4>>2]=p}}else{c[h>>2]=v;c[v+4>>2]=h;c[x+8>>2]=v}if(!s){c[A>>2]=i;c[i+4>>2]=A;c[b+8>>2]=A;u=0;t=E;s=0;n=v;o=A;d=k;j=w;l=x;m=y;break}j=c[s>>2]|0;if((j|0)!=(q|0))do{d=j;j=c[j>>2]|0;m=c[d+8>>2]|0;if((j|0)==(d|0))l=0;else{c[j+4>>2]=c[d+4>>2];c[c[d+4>>2]>>2]=j;l=j}c[(c[m+12>>2]|0)+8>>2]=l;l=c[m>>2]|0;if((l|0)==(m|0)){c[(c[d+12>>2]|0)+8>>2]=0;l=m+4|0}else{c[l+4>>2]=c[m+4>>2];c[c[m+4>>2]>>2]=l;c[(c[d+12>>2]|0)+8>>2]=l;l=m+4|0}c[d+4>>2]=0;c[d+4+4>>2]=0;c[d+4+8>>2]=0;c[d+4+12>>2]=0;c[d>>2]=c[a+56>>2];c[a+56>>2]=d;c[l>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;c[m>>2]=c[a+56>>2];c[a+56>>2]=m;c[a+116>>2]=(c[a+116>>2]|0)+-1}while((j|0)!=(q|0));if(!A){u=0;t=E;n=v;o=0;d=k;j=w;l=x;m=y}else{c[s>>2]=i;c[i+4>>2]=s;c[A>>2]=q;c[q+4>>2]=A;u=0;t=E;n=v;o=A;d=k;j=w;l=x;m=y}}else{u=1;t=0;n=v;o=A;d=k;j=w;l=x;m=y}}else{r=df(a,t,u)|0;c[r>>2]=r;c[r+4>>2]=r;c[t+8>>2]=r;t=c[r+8>>2]|0;c[t>>2]=t;c[t+4>>2]=t;c[u+8>>2]=t;u=0;t=E;r=D;s=A;p=e;n=v;q=B;o=y;d=k;j=z;l=x}while(0);if(!u)break c;D=r;e=p;v=n;E=t;A=s;B=q;y=o;k=d;z=j;x=l;u=d;t=l}}while(0);sa=K;return}}while(0);c[f+8>>2]=0;c[f>>2]=f;c[f+4>>2]=f;c[e>>2]=f;c[e+4>>2]=f;c[e+8>>2]=f;c[e+12>>2]=f;sa=K;return} - -// EMSCRIPTEN_END_FUNCS -var va=[II,ho,sG,Jz,cG,iG,zD,Tp,Sp,Tp,II,II,II,II,II,II];var wa=[kI,kw];var xa=[fD,Bj,Bj,fD];var ya=[bH,Vi,Cj,Kh,IE,pk,Gn,pj,cm,Qm,Xg,$l,Pl,Il,bH,bH];var za=[FA,Qj,Pj,FA];var Aa=[bF,cc];var Ba=[vC,hu,ud,hu,hu,vd,hu,hu,jf,Je,lt,hu,hu,vC,vC,vC];var Ca=[tw,wp];var Da=[kv,Bb,Xh,kv];var Ea=[nu,si,ac,nu];var Fa=[HI,QE,EH,KH,rF,bE,bE,GF,AE,$G,iI,ar,sH,fI,mI,kH,uG,EH,YG,SH,iI,PH,PH,KH,EF,hE,rE,nH,WG,iI,uG,wF,YE,wG,YF,LF,gG,KH,lz,hv,hG,ZE,Su,VD,VD,uH,VH,JG,hI,_G,cI,dI,aI,RD,wH,_G,DH,OG,HH,uG,JH,vG,MF,MF,EH,YH,_G,XH,WH,_C,pH,EH,EH,EH,jI,eI,ZH,fI,eI,wG,KF,oH,UH,_G,OH,NH,AE,OC,DF,uF,uF,GF,GF,oI,EH,KH,GF,GF,oI,bE,EH,LE,LE,GF,Ys,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI,HI];var Ga=[yF,Lf];var Ha=[bI,Sq,_q,Tq,SF,SF,SF,lb,Ly,Ly,hc,wl,tm,Ex,en,Ns,Ik,mq,Ep,hk,Ph,Mn,jq,bI,bI,bI,bI,bI,bI,bI,bI,bI];var Ia=[jH,Qe,HD,HD,jm,jH,jH,jH];var Ja=[XG,$m,Uh,sb,Qn,Kk,Bf,ih,vg,Oe,Bm,hh,ah,Ie,ve,Le,Am,aq,Aj,Ve,Ak,Vf,Lk,sh,zk,Vd,yk,Uc,_B,_B,De,sj,Ff,Wf,Lh,Tn,Ek,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG,XG];var Ka=[_E,ym,Ao,Un,Nj,Mj,lh,Rm,Wk,Uk,ml,Ef,jl,To,dm,hl,cl,fi,nl,Vb,qv,Tw,He,_E,_E,_E,_E,_E,_E,_E,_E,_E];var La=[fA,rc,Lc,bd];var Ma=[gv,vc,af,gv];var Na=[ju,Wb,Eg,ju];var Oa=[NI,vI,Lj,ot];var Pa=[LI,EI,DI,EI,rI,EI,DI,EI,rI,EI,DI,EI,rI,EI,DI,EI,rI,EI,PG,EI,rI,EI,rI,EI,DI,EI,rI,Oo,$p,nn,$i,zy,EI,DI,DI,DI,DI,Fc,Dv,EI,DI,EI,DI,EI,Sx,DI,DI,EI,Sx,DI,DI,EI,DI,Ey,fx,EI,DI,EI,DI,vp,Po,ni,UB,uj,bu,vi,jk,pb,eh,wf,Tm,Qd,Yk,EI,DI,EI,DI,po,Dn,ag,lu,rb,DI,Ij,xB,gH,iv,EI,gH,iv,Be,qm,iv,iv,Yd,rI,iv,iv,wc,iv,Pb,zf,bt,tE,Hh,SE,DI,vo,Jn,Ms,DI,EI,DI,hH,jv,mo,zn,Xk,cu,So,fq,EI,DI,se,NA,DI,DI,DI,DI,DI,DI,DI,DI,DI,DI,Jj,cC,iq,ap,No,uo,DI,yp,np,oq,ep,EI,DI,cj,UE,qd,DI,DI,DI,DI,DI,EI,DI,EI,QG,DI,DI,DI,DI,DI,DI,cq,Zo,EI,DI,rq,ip,DI,DI,DI,ck,iB,DI,Xi,zz,DI,Bl,Tu,xi,Sx,Sx,Sx,Sx,cp,oo,EI,DI,DI,DI,EI,Sx,DI,EI,DI,EI,Sx,rI,rI,Nl,Cl,Sx,Sx,Sx,Po,DI,Po,TG,bv,DI,DI,_F,Mu,Sx,Sx,Sx,Eh,av,Mi,Ku,EI,Ku,Wo,kq,Hj,hB,DI,DI,Jo,TE,EI,DI,DI,DI,Fh,bv,rI,EI,DI,DI,DI,DI,DI,DI,EI,DI,EI,DI,eq,$o,DI,DI,Kj,PC,Dh,Iu,Ko,Ln,EI,DI,EI,EI,DI,DI,Yr,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI,LI];var Qa=[BI,tb,ec,pm,pF,ME,KG,ME,$j,gc,pf,Hd,Hf,wj,te,Xb,Id,Nb,wE,ME,$k,$k,$k,Gi,BI,BI,BI,BI,BI,BI,BI,BI];var Ra=[$H,md,Sf,Pi,qf,Ze,$H,$H];var Sa=[gC,ie,he,Sc];var Ta=[MH,ng,YA,YA,It,mj,ki,zo,It,It,Ci,Dk,ql,It,tj,MH];var Ua=[HG,Oj];var Va=[AI,Tz,PA,gq,Jr,ZF,oB,bB,ZF,on,ok,ZF,Ls,tn,Mb,yd,jp,ZF,ZF,ZF,ZF,ZA,Jf,Gf,Pg,jj,Wl,ej,Ar,Cg,_h,Ro,Xw,zw,Xw,zw,Qb,ZF,Di,yt,jn,xp,mh,Kw,Zc,pi,zj,Rg,Et,Ge,xe,Fb,lk,xc,fj,Db,ii,ZF,Ok,Yj,ik,el,tA,Zj,Cz,Sm,hj,Di,Ni,Di,Vj,Gq,lp,Di,Fi,Ym,yq,um,sd,Lm,Pk,Ot,Lt,Mt,Qg,gm,em,mg,yr,Cp,kk,Xr,Qo,kk,Gc,Cc,$q,kk,Xr,ZF,ZF,Zg,$g,Bd,Xm,ZF,ZF,ZF,yx,ZA,Ee,uc,nh,Pt,ut,ut,ZF,Di,ZF,ZF,AI,AI,AI,AI,AI,AI,AI,AI];var Wa=[LH,Mf,Ov,Wu,wr,rk,Gb,LH];var Xa=[GG,kp,QC,Dj,$n,ji,fm,wm];var Ya=[DE,Dg];var Za=[CH,Cw,vE,Sh,Ud,Bv,Ch,En,vE,Ri,dj,kt,vE,$c,Dc,vE,qk,il,dk,Np,qi,Ae,uh,vE,vE,Zh,zh,je,Sw,Rw,vE,vE,vE,vE,Mc,th,kj,Tj,Ws,Sg,Dt,qe,Kd,Kd,Gg,qk,qj,Sn,Tg,qk,rh,vE,yl,Hn,Fl,ll,Vk,oj,nm,om,mm,_m,mn,Bc,sn,vE,vE,vE,vE,bp,lo,no,Kl,aj,vh,eo,vE,vE,vE,vE,Qh,Nc,qh,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH,CH];var _a=[FG,_y,wb,pd,Sd,_y,Wi,Nd,Hl,lm,FG,FG,FG,FG,FG,FG];var $a=[OB,gs];var ab=[$F,Ru,rf,Ue,ye,LA,LA,LA,ff,$e,mt,_j,Iq,Vt,bk,Sb,Kb,pe,Rs,Ig,We,qb,Wt,Tl,Gk,jo,$e,ne,$f,kf,Rd,su,ls,Qf,Mg,mt,Gh,dl,Fs,Lg,id,ol,Ji,Ui,Eo,Kf,gg,ch,Yh,gk,LA,jh,ig,Nh,LA,LA,Hi,Li,zl,ak,yj,xd,Jd,Ih,Lb,Li,Nk,Fk,Mk,nc,cn,Ti,cn,Qk,mp,pn,uk,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F,$F];var bb=[CE,$u];var cb=[At,Gd];var db=[tu,nf];var eb=[XD,dt,cd,og,bl,xf,Yo,Zb,me,gf,bf,mb,mc,Jb,Wd,nd,Ub,iu,If,vb,dd,sk,xh,we,XD,XD,XD,XD,XD,XD,XD,XD];var fb=[NB,ko];var gb=[jB,hd,Tk,Ml,so,Im,gi,jB];var hb=[tz,lg];var ib=[dw,pq];var jb=[Vv,_g];var kb=[Ju,Al,Al,Ju];return{__GLOBAL__sub_I_btQuickprof_cpp:Yp,___cxa_can_catch:Vp,___cxa_is_pointer_type:xy,___muldi3:Vr,___udivdi3:VA,_bitshift64Lshr:xt,_bitshift64Shl:it,_emscripten_bind_Anchor___destroy___0:qD,_emscripten_bind_Anchor_get_m_body_0:XF,_emscripten_bind_Anchor_get_m_c0_0:vH,_emscripten_bind_Anchor_get_m_c1_0:uH,_emscripten_bind_Anchor_get_m_c2_0:bG,_emscripten_bind_Anchor_get_m_influence_0:nG,_emscripten_bind_Anchor_get_m_local_0:oI,_emscripten_bind_Anchor_get_m_node_0:MG,_emscripten_bind_Anchor_set_m_body_1:GD,_emscripten_bind_Anchor_set_m_c0_1:pB,_emscripten_bind_Anchor_set_m_c1_1:Mr,_emscripten_bind_Anchor_set_m_c2_1:cE,_emscripten_bind_Anchor_set_m_influence_1:lE,_emscripten_bind_Anchor_set_m_local_1:Or,_emscripten_bind_Anchor_set_m_node_1:qE,_emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2:ys,_emscripten_bind_ClosestConvexResultCallback___destroy___0:jw,_emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0:oG,_emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0:oC,_emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0:nC,_emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0:mI,_emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0:vH,_emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0:UD,_emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0:gE,_emscripten_bind_ClosestConvexResultCallback_hasHit_0:Rx,_emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1:PF,_emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1:Lz,_emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1:Kz,_emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1:Qq,_emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1:Xq,_emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1:Rq,_emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1:Wq,_emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2:Vs,_emscripten_bind_ClosestRayResultCallback___destroy___0:jw,_emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0:oG,_emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0:zC,_emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0:IC,_emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0:bE,_emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0:AF,_emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0:OG,_emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0:PE,_emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0:aG,_emscripten_bind_ClosestRayResultCallback_hasHit_0:ry,_emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1:PF,_emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1:Yz,_emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1:eA,_emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1:bB,_emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1:qr,_emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1:yr,_emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1:cr,_emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1:zr,_emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0:tt,_emscripten_bind_ConcreteContactResultCallback___destroy___0:jw,_emscripten_bind_ConcreteContactResultCallback_addSingleResult_7:Cq,_emscripten_bind_Config___destroy___0:Ty,_emscripten_bind_Config_get_citerations_0:MF,_emscripten_bind_Config_get_collisions_0:vF,_emscripten_bind_Config_get_diterations_0:uF,_emscripten_bind_Config_get_kAHR_0:fG,_emscripten_bind_Config_get_kCHR_0:eG,_emscripten_bind_Config_get_kDF_0:tG,_emscripten_bind_Config_get_kDG_0:sG,_emscripten_bind_Config_get_kDP_0:BG,_emscripten_bind_Config_get_kKHR_0:dG,_emscripten_bind_Config_get_kLF_0:rG,_emscripten_bind_Config_get_kMT_0:qG,_emscripten_bind_Config_get_kPR_0:pG,_emscripten_bind_Config_get_kSHR_0:cG,_emscripten_bind_Config_get_kSKHR_CL_0:JF,_emscripten_bind_Config_get_kSK_SPLT_CL_0:nF,_emscripten_bind_Config_get_kSRHR_CL_0:IF,_emscripten_bind_Config_get_kSR_SPLT_CL_0:mF,_emscripten_bind_Config_get_kSSHR_CL_0:HF,_emscripten_bind_Config_get_kSS_SPLT_CL_0:iG,_emscripten_bind_Config_get_kVCF_0:oG,_emscripten_bind_Config_get_kVC_0:nG,_emscripten_bind_Config_get_maxvolume_0:CF,_emscripten_bind_Config_get_piterations_0:tF,_emscripten_bind_Config_get_timescale_0:BF,_emscripten_bind_Config_get_viterations_0:sF,_emscripten_bind_Config_set_citerations_1:NC,_emscripten_bind_Config_set_collisions_1:MC,_emscripten_bind_Config_set_diterations_1:LC,_emscripten_bind_Config_set_kAHR_1:fE,_emscripten_bind_Config_set_kCHR_1:eE,_emscripten_bind_Config_set_kDF_1:pE,_emscripten_bind_Config_set_kDG_1:pF,_emscripten_bind_Config_set_kDP_1:OF,_emscripten_bind_Config_set_kKHR_1:dE,_emscripten_bind_Config_set_kLF_1:oE,_emscripten_bind_Config_set_kMT_1:nE,_emscripten_bind_Config_set_kPR_1:mE,_emscripten_bind_Config_set_kSHR_1:ME,_emscripten_bind_Config_set_kSKHR_CL_1:FD,_emscripten_bind_Config_set_kSK_SPLT_CL_1:pD,_emscripten_bind_Config_set_kSRHR_CL_1:ED,_emscripten_bind_Config_set_kSR_SPLT_CL_1:oD,_emscripten_bind_Config_set_kSSHR_CL_1:DD,_emscripten_bind_Config_set_kSS_SPLT_CL_1:wE,_emscripten_bind_Config_set_kVCF_1:PF,_emscripten_bind_Config_set_kVC_1:lE,_emscripten_bind_Config_set_maxvolume_1:yD,_emscripten_bind_Config_set_piterations_1:KC,_emscripten_bind_Config_set_timescale_1:xD,_emscripten_bind_Config_set_viterations_1:JC,_emscripten_bind_ContactResultCallback___destroy___0:jw,_emscripten_bind_ContactResultCallback_addSingleResult_7:Cq,_emscripten_bind_ConvexResultCallback___destroy___0:jw,_emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0:oG,_emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0:oC,_emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0:nC,_emscripten_bind_ConvexResultCallback_hasHit_0:Rx,_emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1:PF,_emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1:Lz,_emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1:Kz,_emscripten_bind_DebugDrawer_DebugDrawer_0:hz,_emscripten_bind_DebugDrawer___destroy___0:jw,_emscripten_bind_DebugDrawer_draw3dText_2:sv,_emscripten_bind_DebugDrawer_drawContactPoint_5:es,_emscripten_bind_DebugDrawer_drawLine_3:su,_emscripten_bind_DebugDrawer_getDebugMode_0:lz,_emscripten_bind_DebugDrawer_reportErrorWarning_1:rw,_emscripten_bind_DebugDrawer_setDebugMode_1:bx,_emscripten_bind_LocalConvexResult_LocalConvexResult_5:vq,_emscripten_bind_LocalConvexResult___destroy___0:qD,_emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0:MG,_emscripten_bind_LocalConvexResult_get_m_hitFraction_0:dG,_emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0:nI,_emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0:zH,_emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0:rF,_emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1:qE,_emscripten_bind_LocalConvexResult_set_m_hitFraction_1:dE,_emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1:Zr,_emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1:Sr,_emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1:oB,_emscripten_bind_LocalShapeInfo___destroy___0:qD,_emscripten_bind_LocalShapeInfo_get_m_shapePart_0:MG,_emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0:rF,_emscripten_bind_LocalShapeInfo_set_m_shapePart_1:qE,_emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1:oB,_emscripten_bind_Material___destroy___0:qD,_emscripten_bind_Material_get_m_flags_0:GF,_emscripten_bind_Material_get_m_kAST_0:BG,_emscripten_bind_Material_get_m_kLST_0:oG,_emscripten_bind_Material_get_m_kVST_0:sG,_emscripten_bind_Material_set_m_flags_1:nD,_emscripten_bind_Material_set_m_kAST_1:OF,_emscripten_bind_Material_set_m_kLST_1:PF,_emscripten_bind_Material_set_m_kVST_1:pF,_emscripten_bind_Node___destroy___0:qD,_emscripten_bind_Node_get_m_area_0:bG,_emscripten_bind_Node_get_m_f_0:BH,_emscripten_bind_Node_get_m_im_0:AG,_emscripten_bind_Node_get_m_n_0:AH,_emscripten_bind_Node_get_m_q_0:zH,_emscripten_bind_Node_get_m_v_0:yH,_emscripten_bind_Node_get_m_x_0:nI,_emscripten_bind_Node_set_m_area_1:cE,_emscripten_bind_Node_set_m_f_1:Ur,_emscripten_bind_Node_set_m_im_1:zE,_emscripten_bind_Node_set_m_n_1:Tr,_emscripten_bind_Node_set_m_q_1:Sr,_emscripten_bind_Node_set_m_v_1:Rr,_emscripten_bind_Node_set_m_x_1:Zr,_emscripten_bind_RayResultCallback___destroy___0:jw,_emscripten_bind_RayResultCallback_get_m_closestHitFraction_0:oG,_emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0:zC,_emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0:IC,_emscripten_bind_RayResultCallback_get_m_collisionObject_0:bE,_emscripten_bind_RayResultCallback_hasHit_0:ry,_emscripten_bind_RayResultCallback_set_m_closestHitFraction_1:PF,_emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1:Yz,_emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1:eA,_emscripten_bind_RayResultCallback_set_m_collisionObject_1:bB,_emscripten_bind_RaycastInfo___destroy___0:qD,_emscripten_bind_RaycastInfo_get_m_contactNormalWS_0:JI,_emscripten_bind_RaycastInfo_get_m_contactPointWS_0:QF,_emscripten_bind_RaycastInfo_get_m_groundObject_0:tF,_emscripten_bind_RaycastInfo_get_m_hardPointWS_0:aG,_emscripten_bind_RaycastInfo_get_m_isInContact_0:wD,_emscripten_bind_RaycastInfo_get_m_suspensionLength_0:qG,_emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0:OG,_emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0:AF,_emscripten_bind_RaycastInfo_set_m_contactNormalWS_1:Pr,_emscripten_bind_RaycastInfo_set_m_contactPointWS_1:vr,_emscripten_bind_RaycastInfo_set_m_groundObject_1:KC,_emscripten_bind_RaycastInfo_set_m_hardPointWS_1:zr,_emscripten_bind_RaycastInfo_set_m_isInContact_1:gB,_emscripten_bind_RaycastInfo_set_m_suspensionLength_1:nE,_emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1:yr,_emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1:qr,_emscripten_bind_VoidPtr___destroy___0:qD,_emscripten_bind_btActionInterface___destroy___0:jw,_emscripten_bind_btActionInterface_updateAction_2:ov,_emscripten_bind_btAxisSweep3___destroy___0:jw,_emscripten_bind_btAxisSweep3_btAxisSweep3_2:us,_emscripten_bind_btAxisSweep3_btAxisSweep3_3:Lr,_emscripten_bind_btAxisSweep3_btAxisSweep3_4:or,_emscripten_bind_btAxisSweep3_btAxisSweep3_5:Mq,_emscripten_bind_btBoxShape___destroy___0:jw,_emscripten_bind_btBoxShape_btBoxShape_1:ai,_emscripten_bind_btBoxShape_calculateLocalInertia_2:_u,_emscripten_bind_btBoxShape_getLocalScaling_0:ez,_emscripten_bind_btBoxShape_getMargin_0:Jz,_emscripten_bind_btBoxShape_setLocalScaling_1:Pw,_emscripten_bind_btBoxShape_setMargin_1:Ox,_emscripten_bind_btBroadphaseInterface___destroy___0:jw,_emscripten_bind_btBroadphaseProxy___destroy___0:SA,_emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0:HC,_emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0:ZC,_emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1:dA,_emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1:kA,_emscripten_bind_btBvhTriangleMeshShape___destroy___0:jw,_emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2:Is,_emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3:$r,_emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2:_u,_emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0:ez,_emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1:Pw,_emscripten_bind_btCapsuleShapeX___destroy___0:jw,_emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2:Nm,_emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2:_u,_emscripten_bind_btCapsuleShapeX_getHalfHeight_0:LB,_emscripten_bind_btCapsuleShapeX_getLocalScaling_0:ez,_emscripten_bind_btCapsuleShapeX_getMargin_0:Jz,_emscripten_bind_btCapsuleShapeX_getRadius_0:mD,_emscripten_bind_btCapsuleShapeX_getUpAxis_0:QD,_emscripten_bind_btCapsuleShapeX_setLocalScaling_1:Pw,_emscripten_bind_btCapsuleShapeX_setMargin_1:Ox,_emscripten_bind_btCapsuleShapeZ___destroy___0:jw,_emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2:Mm,_emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2:_u,_emscripten_bind_btCapsuleShapeZ_getHalfHeight_0:LB,_emscripten_bind_btCapsuleShapeZ_getLocalScaling_0:ez,_emscripten_bind_btCapsuleShapeZ_getMargin_0:Jz,_emscripten_bind_btCapsuleShapeZ_getRadius_0:mD,_emscripten_bind_btCapsuleShapeZ_getUpAxis_0:QD,_emscripten_bind_btCapsuleShapeZ_setLocalScaling_1:Pw,_emscripten_bind_btCapsuleShapeZ_setMargin_1:Ox,_emscripten_bind_btCapsuleShape___destroy___0:jw,_emscripten_bind_btCapsuleShape_btCapsuleShape_2:Pm,_emscripten_bind_btCapsuleShape_calculateLocalInertia_2:_u,_emscripten_bind_btCapsuleShape_getHalfHeight_0:LB,_emscripten_bind_btCapsuleShape_getLocalScaling_0:ez,_emscripten_bind_btCapsuleShape_getMargin_0:Jz,_emscripten_bind_btCapsuleShape_getRadius_0:mD,_emscripten_bind_btCapsuleShape_getUpAxis_0:QD,_emscripten_bind_btCapsuleShape_setLocalScaling_1:Pw,_emscripten_bind_btCapsuleShape_setMargin_1:Ox,_emscripten_bind_btCollisionConfiguration___destroy___0:jw,_emscripten_bind_btCollisionDispatcher___destroy___0:jw,_emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1:xk,_emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1:Mv,_emscripten_bind_btCollisionDispatcher_getNumManifolds_0:Mz,_emscripten_bind_btCollisionObject___destroy___0:hw,_emscripten_bind_btCollisionObject_activate_0:rt,_emscripten_bind_btCollisionObject_activate_1:ks,_emscripten_bind_btCollisionObject_forceActivationState_1:eB,_emscripten_bind_btCollisionObject_getCollisionFlags_0:jD,_emscripten_bind_btCollisionObject_getCollisionShape_0:iD,_emscripten_bind_btCollisionObject_getUserIndex_0:$B,_emscripten_bind_btCollisionObject_getUserPointer_0:BD,_emscripten_bind_btCollisionObject_getWorldTransform_0:FE,_emscripten_bind_btCollisionObject_isActive_0:xA,_emscripten_bind_btCollisionObject_isKinematicObject_0:hy,_emscripten_bind_btCollisionObject_isStaticObject_0:$y,_emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0:Ew,_emscripten_bind_btCollisionObject_setActivationState_1:Gv,_emscripten_bind_btCollisionObject_setAnisotropicFriction_2:Xu,_emscripten_bind_btCollisionObject_setCcdMotionThreshold_1:dy,_emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1:Mx,_emscripten_bind_btCollisionObject_setCollisionFlags_1:Oy,_emscripten_bind_btCollisionObject_setCollisionShape_1:ww,_emscripten_bind_btCollisionObject_setContactProcessingThreshold_1:ky,_emscripten_bind_btCollisionObject_setFriction_1:wA,_emscripten_bind_btCollisionObject_setRestitution_1:Gz,_emscripten_bind_btCollisionObject_setRollingFriction_1:Wy,_emscripten_bind_btCollisionObject_setUserIndex_1:Pz,_emscripten_bind_btCollisionObject_setUserPointer_1:Pz,_emscripten_bind_btCollisionObject_setWorldTransform_1:ox,_emscripten_bind_btCollisionShape___destroy___0:jw,_emscripten_bind_btCollisionShape_calculateLocalInertia_2:_u,_emscripten_bind_btCollisionShape_getLocalScaling_0:ez,_emscripten_bind_btCollisionShape_getMargin_0:Jz,_emscripten_bind_btCollisionShape_setLocalScaling_1:Pw,_emscripten_bind_btCollisionShape_setMargin_1:Ox,_emscripten_bind_btCollisionWorld___destroy___0:jw,_emscripten_bind_btCollisionWorld_addCollisionObject_1:Av,_emscripten_bind_btCollisionWorld_addCollisionObject_2:Bu,_emscripten_bind_btCollisionWorld_addCollisionObject_3:Gt,_emscripten_bind_btCollisionWorld_contactPairTest_3:gj,_emscripten_bind_btCollisionWorld_contactTest_2:zm,_emscripten_bind_btCollisionWorld_convexSweepTest_5:fr,_emscripten_bind_btCollisionWorld_debugDrawObject_3:Nt,_emscripten_bind_btCollisionWorld_debugDrawWorld_0:Ry,_emscripten_bind_btCollisionWorld_getBroadphase_0:lD,_emscripten_bind_btCollisionWorld_getDebugDrawer_0:Cy,_emscripten_bind_btCollisionWorld_getDispatchInfo_0:SB,_emscripten_bind_btCollisionWorld_getDispatcher_0:kD,_emscripten_bind_btCollisionWorld_getPairCache_0:kz,_emscripten_bind_btCollisionWorld_rayTest_3:ku,_emscripten_bind_btCollisionWorld_removeCollisionObject_1:Wv,_emscripten_bind_btCollisionWorld_setDebugDrawer_1:qw,_emscripten_bind_btCollisionWorld_updateSingleAabb_1:yw,_emscripten_bind_btCompoundShape___destroy___0:jw,_emscripten_bind_btCompoundShape_addChildShape_2:_c,_emscripten_bind_btCompoundShape_btCompoundShape_0:Si,_emscripten_bind_btCompoundShape_btCompoundShape_1:Ii,_emscripten_bind_btCompoundShape_calculateLocalInertia_2:_u,_emscripten_bind_btCompoundShape_getChildShape_1:gz,_emscripten_bind_btCompoundShape_getLocalScaling_0:ez,_emscripten_bind_btCompoundShape_getMargin_0:Jz,_emscripten_bind_btCompoundShape_getNumChildShapes_0:EA,_emscripten_bind_btCompoundShape_removeChildShapeByIndex_1:lx,_emscripten_bind_btCompoundShape_setLocalScaling_1:Pw,_emscripten_bind_btCompoundShape_setMargin_1:Ox,_emscripten_bind_btConcaveShape___destroy___0:jw,_emscripten_bind_btConcaveShape_calculateLocalInertia_2:_u,_emscripten_bind_btConcaveShape_getLocalScaling_0:ez,_emscripten_bind_btConcaveShape_setLocalScaling_1:Pw,_emscripten_bind_btConeShapeX___destroy___0:jw,_emscripten_bind_btConeShapeX_btConeShapeX_2:El,_emscripten_bind_btConeShapeX_calculateLocalInertia_2:_u,_emscripten_bind_btConeShapeX_getLocalScaling_0:ez,_emscripten_bind_btConeShapeX_setLocalScaling_1:Pw,_emscripten_bind_btConeShapeZ___destroy___0:jw,_emscripten_bind_btConeShapeZ_btConeShapeZ_2:Dl,_emscripten_bind_btConeShapeZ_calculateLocalInertia_2:_u,_emscripten_bind_btConeShapeZ_getLocalScaling_0:ez,_emscripten_bind_btConeShapeZ_setLocalScaling_1:Pw,_emscripten_bind_btConeShape___destroy___0:jw,_emscripten_bind_btConeShape_btConeShape_2:Ol,_emscripten_bind_btConeShape_calculateLocalInertia_2:_u,_emscripten_bind_btConeShape_getLocalScaling_0:ez,_emscripten_bind_btConeShape_setLocalScaling_1:Pw,_emscripten_bind_btConeTwistConstraint___destroy___0:jw,_emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2:kg,_emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4:Pf,_emscripten_bind_btConeTwistConstraint_enableFeedback_1:Fy,_emscripten_bind_btConeTwistConstraint_enableMotor_1:wy,_emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btConeTwistConstraint_getParam_2:cv,_emscripten_bind_btConeTwistConstraint_setAngularOnly_1:Nx,_emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btConeTwistConstraint_setDamping_1:dz,_emscripten_bind_btConeTwistConstraint_setLimit_2:ex,_emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1:Kv,_emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1:qx,_emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1:ru,_emscripten_bind_btConeTwistConstraint_setMotorTarget_1:wh,_emscripten_bind_btConeTwistConstraint_setParam_3:qu,_emscripten_bind_btConstraintSetting___destroy___0:qD,_emscripten_bind_btConstraintSetting_btConstraintSetting_0:Sy,_emscripten_bind_btConstraintSetting_get_m_damping_0:oG,_emscripten_bind_btConstraintSetting_get_m_impulseClamp_0:BG,_emscripten_bind_btConstraintSetting_get_m_tau_0:hF,_emscripten_bind_btConstraintSetting_set_m_damping_1:PF,_emscripten_bind_btConstraintSetting_set_m_impulseClamp_1:OF,_emscripten_bind_btConstraintSetting_set_m_tau_1:jG,_emscripten_bind_btConstraintSolver___destroy___0:jw,_emscripten_bind_btContactSolverInfo___destroy___0:qD,_emscripten_bind_btContactSolverInfo_get_m_numIterations_0:XF,_emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0:sA,_emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0:TB,_emscripten_bind_btContactSolverInfo_set_m_numIterations_1:GD,_emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1:Bx,_emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1:jA,_emscripten_bind_btConvexHullShape___destroy___0:jw,_emscripten_bind_btConvexHullShape_addPoint_1:vy,_emscripten_bind_btConvexHullShape_addPoint_2:uw,_emscripten_bind_btConvexHullShape_btConvexHullShape_0:fw,_emscripten_bind_btConvexHullShape_btConvexHullShape_1:Zu,_emscripten_bind_btConvexHullShape_btConvexHullShape_2:fu,_emscripten_bind_btConvexHullShape_calculateLocalInertia_2:_u,_emscripten_bind_btConvexHullShape_getConvexPolyhedron_0:QD,_emscripten_bind_btConvexHullShape_getLocalScaling_0:ez,_emscripten_bind_btConvexHullShape_getMargin_0:Jz,_emscripten_bind_btConvexHullShape_getNumVertices_0:qy,_emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1:nv,_emscripten_bind_btConvexHullShape_recalcLocalAabb_0:cz,_emscripten_bind_btConvexHullShape_setLocalScaling_1:Pw,_emscripten_bind_btConvexHullShape_setMargin_1:Ox,_emscripten_bind_btConvexPolyhedron___destroy___0:jw,_emscripten_bind_btConvexPolyhedron_get_m_faces_0:zH,_emscripten_bind_btConvexPolyhedron_get_m_vertices_0:oI,_emscripten_bind_btConvexPolyhedron_set_m_faces_1:Ix,_emscripten_bind_btConvexPolyhedron_set_m_vertices_1:kx,_emscripten_bind_btConvexShape___destroy___0:jw,_emscripten_bind_btConvexShape_calculateLocalInertia_2:_u,_emscripten_bind_btConvexShape_getLocalScaling_0:ez,_emscripten_bind_btConvexShape_getMargin_0:Jz,_emscripten_bind_btConvexShape_setLocalScaling_1:Pw,_emscripten_bind_btConvexShape_setMargin_1:Ox,_emscripten_bind_btConvexTriangleMeshShape___destroy___0:jw,_emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1:_k,_emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2:Hk,_emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2:_u,_emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0:ez,_emscripten_bind_btConvexTriangleMeshShape_getMargin_0:Jz,_emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1:Pw,_emscripten_bind_btConvexTriangleMeshShape_setMargin_1:Ox,_emscripten_bind_btCylinderShapeX___destroy___0:jw,_emscripten_bind_btCylinderShapeX_btCylinderShapeX_1:at,_emscripten_bind_btCylinderShapeX_calculateLocalInertia_2:_u,_emscripten_bind_btCylinderShapeX_getLocalScaling_0:ez,_emscripten_bind_btCylinderShapeX_getMargin_0:Jz,_emscripten_bind_btCylinderShapeX_setLocalScaling_1:Pw,_emscripten_bind_btCylinderShapeX_setMargin_1:Ox,_emscripten_bind_btCylinderShapeZ___destroy___0:jw,_emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1:$s,_emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2:_u,_emscripten_bind_btCylinderShapeZ_getLocalScaling_0:ez,_emscripten_bind_btCylinderShapeZ_getMargin_0:Jz,_emscripten_bind_btCylinderShapeZ_setLocalScaling_1:Pw,_emscripten_bind_btCylinderShapeZ_setMargin_1:Ox,_emscripten_bind_btCylinderShape___destroy___0:jw,_emscripten_bind_btCylinderShape_btCylinderShape_1:Uv,_emscripten_bind_btCylinderShape_calculateLocalInertia_2:_u,_emscripten_bind_btCylinderShape_getLocalScaling_0:ez,_emscripten_bind_btCylinderShape_getMargin_0:Jz,_emscripten_bind_btCylinderShape_setLocalScaling_1:Pw,_emscripten_bind_btCylinderShape_setMargin_1:Ox,_emscripten_bind_btDbvtBroadphase___destroy___0:jw,_emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0:Ow,_emscripten_bind_btDefaultCollisionConfiguration___destroy___0:jw,_emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0:Mp,_emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1:Ks,_emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0:qD,_emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0:Vu,_emscripten_bind_btDefaultMotionState___destroy___0:jw,_emscripten_bind_btDefaultMotionState_btDefaultMotionState_0:Dr,_emscripten_bind_btDefaultMotionState_btDefaultMotionState_1:hs,_emscripten_bind_btDefaultMotionState_btDefaultMotionState_2:ht,_emscripten_bind_btDefaultMotionState_getWorldTransform_1:pw,_emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0:oI,_emscripten_bind_btDefaultMotionState_setWorldTransform_1:ww,_emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1:gy,_emscripten_bind_btDefaultSoftBodySolver___destroy___0:jw,_emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0:zp,_emscripten_bind_btDefaultVehicleRaycaster___destroy___0:jw,_emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1:Eu,_emscripten_bind_btDefaultVehicleRaycaster_castRay_3:Xt,_emscripten_bind_btDiscreteDynamicsWorld___destroy___0:jw,_emscripten_bind_btDiscreteDynamicsWorld_addAction_1:Xw,_emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1:Yu,_emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2:eu,_emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3:Gt,_emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1:Jv,_emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2:Fu,_emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1:_v,_emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3:Ct,_emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4:_p,_emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3:gj,_emscripten_bind_btDiscreteDynamicsWorld_contactTest_2:zm,_emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5:fr,_emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3:Nt,_emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0:Ry,_emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0:lD,_emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0:Cy,_emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0:SB,_emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0:kD,_emscripten_bind_btDiscreteDynamicsWorld_getGravity_0:Zn,_emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0:kz,_emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0:wB,_emscripten_bind_btDiscreteDynamicsWorld_rayTest_3:ku,_emscripten_bind_btDiscreteDynamicsWorld_removeAction_1:zw,_emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1:Wv,_emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1:Nv,_emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1:Pv,_emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1:qw,_emscripten_bind_btDiscreteDynamicsWorld_setGravity_1:ew,_emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1:Du,_emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2:Ht,_emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3:Kt,_emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1:yw,_emscripten_bind_btDispatcherInfo___destroy___0:qD,_emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0:tG,_emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0:eG,_emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0:bE,_emscripten_bind_btDispatcherInfo_get_m_enableSPU_0:YC,_emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0:YB,_emscripten_bind_btDispatcherInfo_get_m_stepCount_0:rF,_emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0:sG,_emscripten_bind_btDispatcherInfo_get_m_timeStep_0:hF,_emscripten_bind_btDispatcherInfo_get_m_useContinuous_0:mC,_emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0:Rz,_emscripten_bind_btDispatcherInfo_get_m_useEpa_0:vD,_emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1:pE,_emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1:eE,_emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1:bB,_emscripten_bind_btDispatcherInfo_set_m_enableSPU_1:XA,_emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1:rA,_emscripten_bind_btDispatcherInfo_set_m_stepCount_1:oB,_emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1:pF,_emscripten_bind_btDispatcherInfo_set_m_timeStep_1:jG,_emscripten_bind_btDispatcherInfo_set_m_useContinuous_1:DA,_emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1:py,_emscripten_bind_btDispatcherInfo_set_m_useEpa_1:fB,_emscripten_bind_btDispatcher___destroy___0:jw,_emscripten_bind_btDispatcher_getManifoldByIndexInternal_1:Mv,_emscripten_bind_btDispatcher_getNumManifolds_0:Mz,_emscripten_bind_btDynamicsWorld___destroy___0:jw,_emscripten_bind_btDynamicsWorld_addAction_1:Xw,_emscripten_bind_btDynamicsWorld_addCollisionObject_1:Av,_emscripten_bind_btDynamicsWorld_addCollisionObject_2:Bu,_emscripten_bind_btDynamicsWorld_addCollisionObject_3:Gt,_emscripten_bind_btDynamicsWorld_contactPairTest_3:gj,_emscripten_bind_btDynamicsWorld_contactTest_2:zm,_emscripten_bind_btDynamicsWorld_convexSweepTest_5:fr,_emscripten_bind_btDynamicsWorld_debugDrawObject_3:Nt,_emscripten_bind_btDynamicsWorld_debugDrawWorld_0:Ry,_emscripten_bind_btDynamicsWorld_getBroadphase_0:lD,_emscripten_bind_btDynamicsWorld_getDebugDrawer_0:Cy,_emscripten_bind_btDynamicsWorld_getDispatchInfo_0:SB,_emscripten_bind_btDynamicsWorld_getDispatcher_0:kD,_emscripten_bind_btDynamicsWorld_getPairCache_0:kz,_emscripten_bind_btDynamicsWorld_getSolverInfo_0:wB,_emscripten_bind_btDynamicsWorld_rayTest_3:ku,_emscripten_bind_btDynamicsWorld_removeAction_1:zw,_emscripten_bind_btDynamicsWorld_removeCollisionObject_1:Wv,_emscripten_bind_btDynamicsWorld_setDebugDrawer_1:qw,_emscripten_bind_btDynamicsWorld_updateSingleAabb_1:yw,_emscripten_bind_btFaceArray___destroy___0:ax,_emscripten_bind_btFaceArray_at_1:by,_emscripten_bind_btFaceArray_size_0:cF,_emscripten_bind_btFace___destroy___0:cA,_emscripten_bind_btFace_get_m_indices_0:JI,_emscripten_bind_btFace_get_m_plane_1:RB,_emscripten_bind_btFace_set_m_indices_1:yA,_emscripten_bind_btFace_set_m_plane_2:Iz,_emscripten_bind_btFixedConstraint___destroy___0:jw,_emscripten_bind_btFixedConstraint_btFixedConstraint_4:Ah,_emscripten_bind_btFixedConstraint_enableFeedback_1:Fy,_emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btFixedConstraint_getParam_2:cv,_emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btFixedConstraint_setParam_3:qu,_emscripten_bind_btGeneric6DofConstraint___destroy___0:jw,_emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3:Cr,_emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5:lq,_emscripten_bind_btGeneric6DofConstraint_enableFeedback_1:Fy,_emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0:$D,_emscripten_bind_btGeneric6DofConstraint_getParam_2:cv,_emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1:zv,_emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1:yv,_emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1:Iv,_emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1:Hv,_emscripten_bind_btGeneric6DofConstraint_setParam_3:qu,_emscripten_bind_btGeneric6DofSpringConstraint___destroy___0:jw,_emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3:al,_emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5:Jk,_emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1:Fy,_emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2:Zq,_emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0:$D,_emscripten_bind_btGeneric6DofSpringConstraint_getParam_2:cv,_emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1:zv,_emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1:yv,_emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2:jx,_emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1:Iv,_emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1:Hv,_emscripten_bind_btGeneric6DofSpringConstraint_setParam_3:qu,_emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2:$w,_emscripten_bind_btGhostObject___destroy___0:hw,_emscripten_bind_btGhostObject_activate_0:rt,_emscripten_bind_btGhostObject_activate_1:ks,_emscripten_bind_btGhostObject_btGhostObject_0:hi,_emscripten_bind_btGhostObject_forceActivationState_1:eB,_emscripten_bind_btGhostObject_getCollisionFlags_0:jD,_emscripten_bind_btGhostObject_getCollisionShape_0:iD,_emscripten_bind_btGhostObject_getNumOverlappingObjects_0:uz,_emscripten_bind_btGhostObject_getOverlappingObject_1:Wx,_emscripten_bind_btGhostObject_getUserIndex_0:$B,_emscripten_bind_btGhostObject_getUserPointer_0:BD,_emscripten_bind_btGhostObject_getWorldTransform_0:FE,_emscripten_bind_btGhostObject_isActive_0:xA,_emscripten_bind_btGhostObject_isKinematicObject_0:hy,_emscripten_bind_btGhostObject_isStaticObject_0:$y,_emscripten_bind_btGhostObject_isStaticOrKinematicObject_0:Ew,_emscripten_bind_btGhostObject_setActivationState_1:Gv,_emscripten_bind_btGhostObject_setAnisotropicFriction_2:Xu,_emscripten_bind_btGhostObject_setCcdMotionThreshold_1:dy,_emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1:Mx,_emscripten_bind_btGhostObject_setCollisionFlags_1:Oy,_emscripten_bind_btGhostObject_setCollisionShape_1:ww,_emscripten_bind_btGhostObject_setContactProcessingThreshold_1:ky,_emscripten_bind_btGhostObject_setFriction_1:wA,_emscripten_bind_btGhostObject_setRestitution_1:Gz,_emscripten_bind_btGhostObject_setRollingFriction_1:Wy,_emscripten_bind_btGhostObject_setUserIndex_1:Pz,_emscripten_bind_btGhostObject_setUserPointer_1:Pz,_emscripten_bind_btGhostObject_setWorldTransform_1:ox,_emscripten_bind_btGhostPairCallback___destroy___0:jw,_emscripten_bind_btGhostPairCallback_btGhostPairCallback_0:Zy,_emscripten_bind_btHeightfieldTerrainShape___destroy___0:jw,_emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9:bg,_emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2:_u,_emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0:ez,_emscripten_bind_btHeightfieldTerrainShape_getMargin_0:Jz,_emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1:Pw,_emscripten_bind_btHeightfieldTerrainShape_setMargin_1:Ox,_emscripten_bind_btHingeConstraint___destroy___0:jw,_emscripten_bind_btHingeConstraint_btHingeConstraint_2:vf,_emscripten_bind_btHingeConstraint_btHingeConstraint_3:tf,_emscripten_bind_btHingeConstraint_btHingeConstraint_4:Xf,_emscripten_bind_btHingeConstraint_btHingeConstraint_5:Uf,_emscripten_bind_btHingeConstraint_btHingeConstraint_6:hq,_emscripten_bind_btHingeConstraint_btHingeConstraint_7:Hp,_emscripten_bind_btHingeConstraint_enableAngularMotor_3:Ou,_emscripten_bind_btHingeConstraint_enableFeedback_1:Fy,_emscripten_bind_btHingeConstraint_enableMotor_1:rz,_emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btHingeConstraint_getParam_2:cv,_emscripten_bind_btHingeConstraint_setAngularOnly_1:Ky,_emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btHingeConstraint_setLimit_4:Lu,_emscripten_bind_btHingeConstraint_setLimit_5:au,_emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1:ay,_emscripten_bind_btHingeConstraint_setMotorTarget_2:ei,_emscripten_bind_btHingeConstraint_setParam_3:qu,_emscripten_bind_btIDebugDraw___destroy___0:jw,_emscripten_bind_btIDebugDraw_draw3dText_2:sv,_emscripten_bind_btIDebugDraw_drawContactPoint_5:es,_emscripten_bind_btIDebugDraw_drawLine_3:su,_emscripten_bind_btIDebugDraw_getDebugMode_0:lz,_emscripten_bind_btIDebugDraw_reportErrorWarning_1:rw,_emscripten_bind_btIDebugDraw_setDebugMode_1:bx,_emscripten_bind_btIntArray___destroy___0:Fx,_emscripten_bind_btIntArray_at_1:Ww,_emscripten_bind_btIntArray_size_0:cF,_emscripten_bind_btKinematicCharacterController___destroy___0:jw,_emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3:Ej,_emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4:xj,_emscripten_bind_btKinematicCharacterController_canJump_0:Hx,_emscripten_bind_btKinematicCharacterController_getGhostObject_0:bE,_emscripten_bind_btKinematicCharacterController_getGravity_0:cG,_emscripten_bind_btKinematicCharacterController_getMaxSlope_0:eG,_emscripten_bind_btKinematicCharacterController_jump_0:fy,_emscripten_bind_btKinematicCharacterController_onGround_0:lz,_emscripten_bind_btKinematicCharacterController_playerStep_2:Gu,_emscripten_bind_btKinematicCharacterController_preStep_1:Tv,_emscripten_bind_btKinematicCharacterController_setFallSpeed_1:lE,_emscripten_bind_btKinematicCharacterController_setGravity_1:ME,_emscripten_bind_btKinematicCharacterController_setJumpSpeed_1:pE,_emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1:nE,_emscripten_bind_btKinematicCharacterController_setMaxSlope_1:iw,_emscripten_bind_btKinematicCharacterController_setUpAxis_1:dx,_emscripten_bind_btKinematicCharacterController_setUpInterpolate_1:mv,_emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1:pv,_emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2:Ut,_emscripten_bind_btKinematicCharacterController_setWalkDirection_1:qw,_emscripten_bind_btKinematicCharacterController_updateAction_2:ov,_emscripten_bind_btKinematicCharacterController_warp_1:aw,_emscripten_bind_btManifoldPoint___destroy___0:qD,_emscripten_bind_btManifoldPoint_getAppliedImpulse_0:Yy,_emscripten_bind_btManifoldPoint_getDistance_0:Bz,_emscripten_bind_btManifoldPoint_getPositionWorldOnA_0:$D,_emscripten_bind_btManifoldPoint_getPositionWorldOnB_0:bA,_emscripten_bind_btManifoldPoint_get_m_localPointA_0:JI,_emscripten_bind_btManifoldPoint_get_m_localPointB_0:QF,_emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0:lF,_emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0:IH,_emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0:IG,_emscripten_bind_btManifoldPoint_set_m_localPointA_1:Pr,_emscripten_bind_btManifoldPoint_set_m_localPointB_1:vr,_emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1:nr,_emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1:Fr,_emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1:jr,_emscripten_bind_btMatrix3x3___destroy___0:qD,_emscripten_bind_btMatrix3x3_getRotation_1:bz,_emscripten_bind_btMatrix3x3_getRow_1:Pp,_emscripten_bind_btMatrix3x3_setEulerZYX_3:Hw,_emscripten_bind_btMotionState___destroy___0:jw,_emscripten_bind_btMotionState_getWorldTransform_1:pw,_emscripten_bind_btMotionState_setWorldTransform_1:ww,_emscripten_bind_btOverlappingPairCache___destroy___0:jw,_emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1:Nv,_emscripten_bind_btOverlappingPairCallback___destroy___0:jw,_emscripten_bind_btPairCachingGhostObject___destroy___0:hw,_emscripten_bind_btPairCachingGhostObject_activate_0:rt,_emscripten_bind_btPairCachingGhostObject_activate_1:ks,_emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0:kh,_emscripten_bind_btPairCachingGhostObject_forceActivationState_1:eB,_emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0:jD,_emscripten_bind_btPairCachingGhostObject_getCollisionShape_0:iD,_emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0:uz,_emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1:Wx,_emscripten_bind_btPairCachingGhostObject_getUserIndex_0:$B,_emscripten_bind_btPairCachingGhostObject_getUserPointer_0:BD,_emscripten_bind_btPairCachingGhostObject_getWorldTransform_0:FE,_emscripten_bind_btPairCachingGhostObject_isActive_0:xA,_emscripten_bind_btPairCachingGhostObject_isKinematicObject_0:hy,_emscripten_bind_btPairCachingGhostObject_isStaticObject_0:$y,_emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0:Ew,_emscripten_bind_btPairCachingGhostObject_setActivationState_1:Gv,_emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2:Xu,_emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1:dy,_emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1:Mx,_emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1:Oy,_emscripten_bind_btPairCachingGhostObject_setCollisionShape_1:ww,_emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1:ky,_emscripten_bind_btPairCachingGhostObject_setFriction_1:wA,_emscripten_bind_btPairCachingGhostObject_setRestitution_1:Gz,_emscripten_bind_btPairCachingGhostObject_setRollingFriction_1:Wy,_emscripten_bind_btPairCachingGhostObject_setUserIndex_1:Pz,_emscripten_bind_btPairCachingGhostObject_setUserPointer_1:Pz,_emscripten_bind_btPairCachingGhostObject_setWorldTransform_1:ox,_emscripten_bind_btPersistentManifold___destroy___0:SA,_emscripten_bind_btPersistentManifold_btPersistentManifold_0:mi,_emscripten_bind_btPersistentManifold_getBody0_0:XC,_emscripten_bind_btPersistentManifold_getBody1_0:WC,_emscripten_bind_btPersistentManifold_getContactPoint_1:Ax,_emscripten_bind_btPersistentManifold_getNumContacts_0:XB,_emscripten_bind_btPoint2PointConstraint___destroy___0:jw,_emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2:nj,_emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4:Gj,_emscripten_bind_btPoint2PointConstraint_enableFeedback_1:Fy,_emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btPoint2PointConstraint_getParam_2:cv,_emscripten_bind_btPoint2PointConstraint_getPivotInA_0:aA,_emscripten_bind_btPoint2PointConstraint_getPivotInB_0:$z,_emscripten_bind_btPoint2PointConstraint_get_m_setting_0:gF,_emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btPoint2PointConstraint_setParam_3:qu,_emscripten_bind_btPoint2PointConstraint_setPivotA_1:wx,_emscripten_bind_btPoint2PointConstraint_setPivotB_1:vx,_emscripten_bind_btPoint2PointConstraint_set_m_setting_1:Es,_emscripten_bind_btQuadWord___destroy___0:qD,_emscripten_bind_btQuadWord_setW_1:uD,_emscripten_bind_btQuadWord_setX_1:ND,_emscripten_bind_btQuadWord_setY_1:MD,_emscripten_bind_btQuadWord_setZ_1:LD,_emscripten_bind_btQuadWord_w_0:_D,_emscripten_bind_btQuadWord_x_0:zF,_emscripten_bind_btQuadWord_y_0:ZD,_emscripten_bind_btQuadWord_z_0:YD,_emscripten_bind_btQuaternion___destroy___0:qD,_emscripten_bind_btQuaternion_angleShortestPath_1:uy,_emscripten_bind_btQuaternion_angle_1:dB,_emscripten_bind_btQuaternion_btQuaternion_4:ro,_emscripten_bind_btQuaternion_dot_1:KB,_emscripten_bind_btQuaternion_getAngleShortestPath_0:CA,_emscripten_bind_btQuaternion_getAngle_0:aB,_emscripten_bind_btQuaternion_getAxis_0:Ho,_emscripten_bind_btQuaternion_inverse_0:Go,_emscripten_bind_btQuaternion_length2_0:kE,_emscripten_bind_btQuaternion_length_0:GE,_emscripten_bind_btQuaternion_normalize_0:aE,_emscripten_bind_btQuaternion_normalized_0:xo,_emscripten_bind_btQuaternion_op_add_1:JB,_emscripten_bind_btQuaternion_op_div_1:lC,_emscripten_bind_btQuaternion_op_mul_1:gt,_emscripten_bind_btQuaternion_op_mulq_1:vB,_emscripten_bind_btQuaternion_op_sub_1:IB,_emscripten_bind_btQuaternion_setEulerZYX_3:$v,_emscripten_bind_btQuaternion_setRotation_2:Vw,_emscripten_bind_btQuaternion_setValue_4:Xo,_emscripten_bind_btQuaternion_setW_1:uD,_emscripten_bind_btQuaternion_setX_1:ND,_emscripten_bind_btQuaternion_setY_1:MD,_emscripten_bind_btQuaternion_setZ_1:LD,_emscripten_bind_btQuaternion_w_0:_D,_emscripten_bind_btQuaternion_x_0:zF,_emscripten_bind_btQuaternion_y_0:ZD,_emscripten_bind_btQuaternion_z_0:YD,_emscripten_bind_btRaycastVehicle___destroy___0:jw,_emscripten_bind_btRaycastVehicle_addWheel_7:gd,_emscripten_bind_btRaycastVehicle_applyEngineForce_2:vv,_emscripten_bind_btRaycastVehicle_btRaycastVehicle_3:wk,_emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0:nB,_emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0:oy,_emscripten_bind_btRaycastVehicle_getForwardAxis_0:yC,_emscripten_bind_btRaycastVehicle_getForwardVector_0:Kn,_emscripten_bind_btRaycastVehicle_getNumWheels_0:mB,_emscripten_bind_btRaycastVehicle_getRightAxis_0:VC,_emscripten_bind_btRaycastVehicle_getRigidBody_0:UC,_emscripten_bind_btRaycastVehicle_getSteeringValue_1:Nw,_emscripten_bind_btRaycastVehicle_getUpAxis_0:tD,_emscripten_bind_btRaycastVehicle_getUserConstraintId_0:WB,_emscripten_bind_btRaycastVehicle_getUserConstraintType_0:HB,_emscripten_bind_btRaycastVehicle_getWheelInfo_1:qz,_emscripten_bind_btRaycastVehicle_getWheelTransformWS_1:Vx,_emscripten_bind_btRaycastVehicle_rayCast_1:Xy,_emscripten_bind_btRaycastVehicle_resetSuspension_0:gl,_emscripten_bind_btRaycastVehicle_setBrake_2:Zv,_emscripten_bind_btRaycastVehicle_setCoordinateSystem_3:Bt,_emscripten_bind_btRaycastVehicle_setPitchControl_1:az,_emscripten_bind_btRaycastVehicle_setSteeringValue_2:uv,_emscripten_bind_btRaycastVehicle_setUserConstraintId_1:ey,_emscripten_bind_btRaycastVehicle_setUserConstraintType_1:Ux,_emscripten_bind_btRaycastVehicle_updateAction_2:ov,_emscripten_bind_btRaycastVehicle_updateFriction_1:Gw,_emscripten_bind_btRaycastVehicle_updateSuspension_1:Rk,_emscripten_bind_btRaycastVehicle_updateVehicle_1:Mw,_emscripten_bind_btRaycastVehicle_updateWheelTransform_2:ft,_emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1:uu,_emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2:wt,_emscripten_bind_btRigidBodyConstructionInfo___destroy___0:qD,_emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3:bn,_emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4:Bq,_emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0:Qz,_emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0:jz,_emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0:KA,_emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0:qA,_emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0:pz,_emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0:QB,_emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0:BA,_emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0:xC,_emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0:bG,_emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0:JA,_emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0:aC,_emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0:uB,_emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1:Qx,_emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1:px,_emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1:Jy,_emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1:Qy,_emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1:ux,_emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1:Hz,_emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1:By,_emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1:pA,_emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1:cE,_emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1:Iy,_emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1:Xz,_emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1:cD,_emscripten_bind_btRigidBody___destroy___0:hw,_emscripten_bind_btRigidBody_activate_0:rt,_emscripten_bind_btRigidBody_activate_1:ks,_emscripten_bind_btRigidBody_applyCentralForce_1:Yt,_emscripten_bind_btRigidBody_applyCentralImpulse_1:Jt,_emscripten_bind_btRigidBody_applyCentralLocalForce_1:st,_emscripten_bind_btRigidBody_applyForce_2:_w,_emscripten_bind_btRigidBody_applyGravity_0:On,_emscripten_bind_btRigidBody_applyImpulse_2:xw,_emscripten_bind_btRigidBody_applyLocalTorque_1:$t,_emscripten_bind_btRigidBody_applyTorqueImpulse_1:St,_emscripten_bind_btRigidBody_applyTorque_1:Au,_emscripten_bind_btRigidBody_btRigidBody_1:Wh,_emscripten_bind_btRigidBody_forceActivationState_1:eB,_emscripten_bind_btRigidBody_getAabb_2:Js,_emscripten_bind_btRigidBody_getAngularVelocity_0:cB,_emscripten_bind_btRigidBody_getBroadphaseProxy_0:GC,_emscripten_bind_btRigidBody_getCenterOfMassTransform_0:FE,_emscripten_bind_btRigidBody_getCollisionFlags_0:jD,_emscripten_bind_btRigidBody_getCollisionShape_0:iD,_emscripten_bind_btRigidBody_getGravity_0:CD,_emscripten_bind_btRigidBody_getLinearVelocity_0:lB,_emscripten_bind_btRigidBody_getMotionState_0:sD,_emscripten_bind_btRigidBody_getUserIndex_0:$B,_emscripten_bind_btRigidBody_getUserPointer_0:BD,_emscripten_bind_btRigidBody_getWorldTransform_0:FE,_emscripten_bind_btRigidBody_isActive_0:xA,_emscripten_bind_btRigidBody_isKinematicObject_0:hy,_emscripten_bind_btRigidBody_isStaticObject_0:$y,_emscripten_bind_btRigidBody_isStaticOrKinematicObject_0:Ew,_emscripten_bind_btRigidBody_setActivationState_1:Gv,_emscripten_bind_btRigidBody_setAngularFactor_1:ny,_emscripten_bind_btRigidBody_setAngularVelocity_1:Px,_emscripten_bind_btRigidBody_setAnisotropicFriction_2:Xu,_emscripten_bind_btRigidBody_setCcdMotionThreshold_1:dy,_emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1:Mx,_emscripten_bind_btRigidBody_setCenterOfMassTransform_1:ow,_emscripten_bind_btRigidBody_setCollisionFlags_1:Oy,_emscripten_bind_btRigidBody_setCollisionShape_1:ww,_emscripten_bind_btRigidBody_setContactProcessingThreshold_1:ky,_emscripten_bind_btRigidBody_setDamping_2:gn,_emscripten_bind_btRigidBody_setFriction_1:wA,_emscripten_bind_btRigidBody_setGravity_1:rm,_emscripten_bind_btRigidBody_setLinearFactor_1:Ay,_emscripten_bind_btRigidBody_setLinearVelocity_1:$x,_emscripten_bind_btRigidBody_setMassProps_2:ij,_emscripten_bind_btRigidBody_setMotionState_1:my,_emscripten_bind_btRigidBody_setRestitution_1:Gz,_emscripten_bind_btRigidBody_setRollingFriction_1:Wy,_emscripten_bind_btRigidBody_setSleepingThresholds_2:Fw,_emscripten_bind_btRigidBody_setUserIndex_1:Pz,_emscripten_bind_btRigidBody_setUserPointer_1:Pz,_emscripten_bind_btRigidBody_setWorldTransform_1:ox,_emscripten_bind_btRigidBody_upcast_1:Wz,_emscripten_bind_btRigidBody_updateInertiaTensor_0:bj,_emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0:jw,_emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0:rj,_emscripten_bind_btShapeHull___destroy___0:Ug,_emscripten_bind_btShapeHull_btShapeHull_1:Vo,_emscripten_bind_btShapeHull_buildHull_1:Ec,_emscripten_bind_btShapeHull_getVertexPointer_0:GB,_emscripten_bind_btShapeHull_numVertices_0:rF,_emscripten_bind_btSliderConstraint___destroy___0:jw,_emscripten_bind_btSliderConstraint_btSliderConstraint_3:Ad,_emscripten_bind_btSliderConstraint_btSliderConstraint_5:Ke,_emscripten_bind_btSliderConstraint_enableFeedback_1:Fy,_emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btSliderConstraint_getParam_2:cv,_emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btSliderConstraint_setLowerAngLimit_1:ly,_emscripten_bind_btSliderConstraint_setLowerLinLimit_1:ky,_emscripten_bind_btSliderConstraint_setParam_3:qu,_emscripten_bind_btSliderConstraint_setUpperAngLimit_1:jy,_emscripten_bind_btSliderConstraint_setUpperLinLimit_1:iy,_emscripten_bind_btSoftBodyArray___destroy___0:Fx,_emscripten_bind_btSoftBodyArray_at_1:Ww,_emscripten_bind_btSoftBodyArray_size_0:cF,_emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4:tg,_emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4:as,_emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5:Wc,_emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10:sc,_emscripten_bind_btSoftBodyHelpers_CreatePatch_9:zc,_emscripten_bind_btSoftBodyHelpers_CreateRope_5:Yf,_emscripten_bind_btSoftBodyHelpers___destroy___0:qD,_emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0:dH,_emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0:jw,_emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0:gp,_emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1:Kr,_emscripten_bind_btSoftBodySolver___destroy___0:jw,_emscripten_bind_btSoftBodyWorldInfo___destroy___0:ix,_emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0:Hy,_emscripten_bind_btSoftBodyWorldInfo_get_air_density_0:hF,_emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0:PD,_emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0:OD,_emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0:yH,_emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0:sG,_emscripten_bind_btSoftBodyWorldInfo_get_water_density_0:oG,_emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0:QF,_emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0:BG,_emscripten_bind_btSoftBodyWorldInfo_set_air_density_1:jG,_emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1:UA,_emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1:TA,_emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1:Rr,_emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1:pF,_emscripten_bind_btSoftBodyWorldInfo_set_water_density_1:PF,_emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1:vr,_emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1:OF,_emscripten_bind_btSoftBody___destroy___0:hw,_emscripten_bind_btSoftBody_activate_0:rt,_emscripten_bind_btSoftBody_activate_1:ks,_emscripten_bind_btSoftBody_addAeroForceToNode_2:Yv,_emscripten_bind_btSoftBody_addForce_1:_l,_emscripten_bind_btSoftBody_addForce_2:fn,_emscripten_bind_btSoftBody_appendAnchor_4:lf,_emscripten_bind_btSoftBody_appendFace_4:pu,_emscripten_bind_btSoftBody_appendLink_4:ou,_emscripten_bind_btSoftBody_appendMaterial_0:FC,_emscripten_bind_btSoftBody_appendNode_2:ic,_emscripten_bind_btSoftBody_appendTetra_5:Ye,_emscripten_bind_btSoftBody_btSoftBody_4:Qr,_emscripten_bind_btSoftBody_checkFace_3:ek,_emscripten_bind_btSoftBody_checkLink_2:fl,_emscripten_bind_btSoftBody_forceActivationState_1:eB,_emscripten_bind_btSoftBody_generateBendingConstraints_2:fc,_emscripten_bind_btSoftBody_generateClusters_1:Py,_emscripten_bind_btSoftBody_generateClusters_2:cx,_emscripten_bind_btSoftBody_getCollisionFlags_0:jD,_emscripten_bind_btSoftBody_getCollisionShape_0:iD,_emscripten_bind_btSoftBody_getTotalMass_0:to,_emscripten_bind_btSoftBody_getUserIndex_0:$B,_emscripten_bind_btSoftBody_getUserPointer_0:BD,_emscripten_bind_btSoftBody_getWorldTransform_0:FE,_emscripten_bind_btSoftBody_get_m_anchors_0:LG,_emscripten_bind_btSoftBody_get_m_cfg_0:cH,_emscripten_bind_btSoftBody_get_m_materials_0:zG,_emscripten_bind_btSoftBody_get_m_nodes_0:VG,_emscripten_bind_btSoftBody_isActive_0:xA,_emscripten_bind_btSoftBody_isKinematicObject_0:hy,_emscripten_bind_btSoftBody_isStaticObject_0:$y,_emscripten_bind_btSoftBody_isStaticOrKinematicObject_0:Ew,_emscripten_bind_btSoftBody_rotate_1:vj,_emscripten_bind_btSoftBody_scale_1:fe,_emscripten_bind_btSoftBody_setActivationState_1:Gv,_emscripten_bind_btSoftBody_setAnisotropicFriction_2:Xu,_emscripten_bind_btSoftBody_setCcdMotionThreshold_1:dy,_emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1:Mx,_emscripten_bind_btSoftBody_setCollisionFlags_1:Oy,_emscripten_bind_btSoftBody_setCollisionShape_1:ww,_emscripten_bind_btSoftBody_setContactProcessingThreshold_1:ky,_emscripten_bind_btSoftBody_setFriction_1:wA,_emscripten_bind_btSoftBody_setMass_2:Tt,_emscripten_bind_btSoftBody_setRestitution_1:Gz,_emscripten_bind_btSoftBody_setRollingFriction_1:Wy,_emscripten_bind_btSoftBody_setTotalMass_2:Ag,_emscripten_bind_btSoftBody_setUserIndex_1:Pz,_emscripten_bind_btSoftBody_setUserPointer_1:Pz,_emscripten_bind_btSoftBody_setWorldTransform_1:ox,_emscripten_bind_btSoftBody_set_m_anchors_1:Lw,_emscripten_bind_btSoftBody_set_m_cfg_1:Vz,_emscripten_bind_btSoftBody_set_m_materials_1:mw,_emscripten_bind_btSoftBody_set_m_nodes_1:hx,_emscripten_bind_btSoftBody_transform_1:Oz,_emscripten_bind_btSoftBody_translate_1:ul,_emscripten_bind_btSoftBody_upcast_1:iA,_emscripten_bind_btSoftRigidDynamicsWorld___destroy___0:jw,_emscripten_bind_btSoftRigidDynamicsWorld_addAction_1:Xw,_emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1:Yu,_emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2:eu,_emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3:Gt,_emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1:Jv,_emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2:Fu,_emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1:_v,_emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3:Ct,_emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3:Ei,_emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5:Ne,_emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3:gj,_emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2:zm,_emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5:fr,_emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3:Nt,_emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0:Ry,_emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0:lD,_emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0:Cy,_emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0:SB,_emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0:kD,_emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0:Yn,_emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0:kz,_emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0:Vy,_emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0:wB,_emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0:Fz,_emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3:ku,_emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1:zw,_emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1:Wv,_emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1:Nv,_emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1:Pv,_emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1:$h,_emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1:qw,_emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1:ew,_emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1:Du,_emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2:Ht,_emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3:Kt,_emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1:yw,_emscripten_bind_btSphereShape___destroy___0:jw,_emscripten_bind_btSphereShape_btSphereShape_1:nx,_emscripten_bind_btSphereShape_calculateLocalInertia_2:_u,_emscripten_bind_btSphereShape_getLocalScaling_0:ez,_emscripten_bind_btSphereShape_getMargin_0:Jz,_emscripten_bind_btSphereShape_setLocalScaling_1:Pw,_emscripten_bind_btSphereShape_setMargin_1:Ox,_emscripten_bind_btStaticPlaneShape___destroy___0:jw,_emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2:rl,_emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2:_u,_emscripten_bind_btStaticPlaneShape_getLocalScaling_0:ez,_emscripten_bind_btStaticPlaneShape_setLocalScaling_1:Pw,_emscripten_bind_btStridingMeshInterface___destroy___0:jw,_emscripten_bind_btTransform___destroy___0:qD,_emscripten_bind_btTransform_btTransform_0:GH,_emscripten_bind_btTransform_btTransform_2:Uu,_emscripten_bind_btTransform_getBasis_0:UG,_emscripten_bind_btTransform_getOrigin_0:$D,_emscripten_bind_btTransform_getRotation_0:wo,_emscripten_bind_btTransform_inverse_0:gr,_emscripten_bind_btTransform_op_mul_1:VB,_emscripten_bind_btTransform_setFromOpenGLMatrix_1:Gy,_emscripten_bind_btTransform_setIdentity_0:JD,_emscripten_bind_btTransform_setOrigin_1:Uz,_emscripten_bind_btTransform_setRotation_1:hA,_emscripten_bind_btTriangleMeshShape___destroy___0:jw,_emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2:_u,_emscripten_bind_btTriangleMeshShape_getLocalScaling_0:ez,_emscripten_bind_btTriangleMeshShape_setLocalScaling_1:Pw,_emscripten_bind_btTriangleMesh___destroy___0:jw,_emscripten_bind_btTriangleMesh_addTriangle_3:Zm,_emscripten_bind_btTriangleMesh_addTriangle_4:Hm,_emscripten_bind_btTriangleMesh_btTriangleMesh_0:Dw,_emscripten_bind_btTriangleMesh_btTriangleMesh_1:tv,_emscripten_bind_btTriangleMesh_btTriangleMesh_2:yu,_emscripten_bind_btTypedConstraint___destroy___0:jw,_emscripten_bind_btTypedConstraint_enableFeedback_1:Fy,_emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0:Gx,_emscripten_bind_btTypedConstraint_getParam_2:cv,_emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1:ty,_emscripten_bind_btTypedConstraint_setParam_3:qu,_emscripten_bind_btVector3Array___destroy___0:Fx,_emscripten_bind_btVector3Array_at_1:Ez,_emscripten_bind_btVector3Array_size_0:cF,_emscripten_bind_btVector3___destroy___0:SA,_emscripten_bind_btVector3_btVector3_0:rH,_emscripten_bind_btVector3_btVector3_3:Bp,_emscripten_bind_btVector3_dot_1:Us,_emscripten_bind_btVector3_length_0:Lx,_emscripten_bind_btVector3_normalize_0:$E,_emscripten_bind_btVector3_op_add_1:EC,_emscripten_bind_btVector3_op_mul_1:qt,_emscripten_bind_btVector3_op_sub_1:DC,_emscripten_bind_btVector3_rotate_2:go,_emscripten_bind_btVector3_setValue_3:nq,_emscripten_bind_btVector3_setX_1:ND,_emscripten_bind_btVector3_setY_1:MD,_emscripten_bind_btVector3_setZ_1:LD,_emscripten_bind_btVector3_x_0:zF,_emscripten_bind_btVector3_y_0:ZD,_emscripten_bind_btVector3_z_0:YD,_emscripten_bind_btVector4___destroy___0:SA,_emscripten_bind_btVector4_btVector4_0:rH,_emscripten_bind_btVector4_btVector4_4:qo,_emscripten_bind_btVector4_dot_1:Us,_emscripten_bind_btVector4_length_0:Lx,_emscripten_bind_btVector4_normalize_0:$E,_emscripten_bind_btVector4_op_add_1:EC,_emscripten_bind_btVector4_op_mul_1:qt,_emscripten_bind_btVector4_op_sub_1:DC,_emscripten_bind_btVector4_rotate_2:fo,_emscripten_bind_btVector4_setValue_4:Xo,_emscripten_bind_btVector4_setX_1:ND,_emscripten_bind_btVector4_setY_1:MD,_emscripten_bind_btVector4_setZ_1:LD,_emscripten_bind_btVector4_w_0:_D,_emscripten_bind_btVector4_x_0:zF,_emscripten_bind_btVector4_y_0:ZD,_emscripten_bind_btVector4_z_0:YD,_emscripten_bind_btVehicleRaycasterResult___destroy___0:qD,_emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0:qG,_emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0:QF,_emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0:JI,_emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1:nE,_emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1:vr,_emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1:Pr,_emscripten_bind_btVehicleRaycaster___destroy___0:jw,_emscripten_bind_btVehicleRaycaster_castRay_3:Xt,_emscripten_bind_btVehicleTuning_btVehicleTuning_0:_x,_emscripten_bind_btVehicleTuning_get_m_frictionSlip_0:rG,_emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0:pG,_emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0:sG,_emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0:oG,_emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0:BG,_emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0:hF,_emscripten_bind_btVehicleTuning_set_m_frictionSlip_1:oE,_emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1:mE,_emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1:pF,_emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1:PF,_emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1:OF,_emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1:jG,_emscripten_bind_btWheelInfoConstructionInfo___destroy___0:qD,_emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0:RA,_emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0:JI,_emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0:iG,_emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0:CF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0:IF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0:fG,_emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0:HF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0:IG,_emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0:QF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0:JF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0:mF,_emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0:nF,_emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1:oz,_emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1:Pr,_emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1:wE,_emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1:yD,_emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1:ED,_emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1:fE,_emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1:DD,_emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1:jr,_emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1:vr,_emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1:FD,_emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1:oD,_emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1:pD,_emscripten_bind_btWheelInfo___destroy___0:qD,_emscripten_bind_btWheelInfo_btWheelInfo_1:gw,_emscripten_bind_btWheelInfo_getSuspensionRestLength_0:ID,_emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0:TC,_emscripten_bind_btWheelInfo_get_m_brake_0:fF,_emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0:OE,_emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0:FB,_emscripten_bind_btWheelInfo_get_m_deltaRotation_0:jE,_emscripten_bind_btWheelInfo_get_m_engineForce_0:EE,_emscripten_bind_btWheelInfo_get_m_frictionSlip_0:yE,_emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0:AD,_emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0:hD,_emscripten_bind_btWheelInfo_get_m_raycastInfo_0:JI,_emscripten_bind_btWheelInfo_get_m_rollInfluence_0:iE,_emscripten_bind_btWheelInfo_get_m_rotation_0:XE,_emscripten_bind_btWheelInfo_get_m_skidInfo_0:WE,_emscripten_bind_btWheelInfo_get_m_steering_0:VE,_emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0:kC,_emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0:ID,_emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0:rD,_emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0:WF,_emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0:qF,_emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0:wC,_emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0:CC,_emscripten_bind_btWheelInfo_get_m_wheelsRadius_0:xE,_emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0:gD,_emscripten_bind_btWheelInfo_get_m_worldTransform_0:lH,_emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1:WA,_emscripten_bind_btWheelInfo_set_m_brake_1:BC,_emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1:Yq,_emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1:Az,_emscripten_bind_btWheelInfo_set_m_deltaRotation_1:tB,_emscripten_bind_btWheelInfo_set_m_engineForce_1:PB,_emscripten_bind_btWheelInfo_set_m_frictionSlip_1:EB,_emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1:CB,_emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1:IA,_emscripten_bind_btWheelInfo_set_m_raycastInfo_1:Qs,_emscripten_bind_btWheelInfo_set_m_rollInfluence_1:sB,_emscripten_bind_btWheelInfo_set_m_rotation_1:jC,_emscripten_bind_btWheelInfo_set_m_skidInfo_1:iC,_emscripten_bind_btWheelInfo_set_m_steering_1:hC,_emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1:_z,_emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1:HA,_emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1:QA,_emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1:rr,_emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1:ir,_emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1:oA,_emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1:vA,_emscripten_bind_btWheelInfo_set_m_wheelsRadius_1:DB,_emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1:GA,_emscripten_bind_btWheelInfo_set_m_worldTransform_1:yz,_emscripten_bind_btWheelInfo_updateWheel_2:oi,_emscripten_bind_tAnchorArray___destroy___0:Fx,_emscripten_bind_tAnchorArray_at_1:Br,_emscripten_bind_tAnchorArray_clear_0:uE,_emscripten_bind_tAnchorArray_pop_back_0:gA,_emscripten_bind_tAnchorArray_push_back_1:gx,_emscripten_bind_tAnchorArray_size_0:cF,_emscripten_bind_tMaterialArray___destroy___0:Fx,_emscripten_bind_tMaterialArray_at_1:Ww,_emscripten_bind_tMaterialArray_size_0:cF,_emscripten_bind_tNodeArray___destroy___0:Fx,_emscripten_bind_tNodeArray_at_1:Zw,_emscripten_bind_tNodeArray_size_0:cF,_emscripten_enum_PHY_ScalarType_PHY_DOUBLE:MI,_emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88:gI,_emscripten_enum_PHY_ScalarType_PHY_FLOAT:uI,_emscripten_enum_PHY_ScalarType_PHY_INTEGER:qI,_emscripten_enum_PHY_ScalarType_PHY_SHORT:tI,_emscripten_enum_PHY_ScalarType_PHY_UCHAR:sI,_emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM:tI,_emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP:MI,_emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM:gI,_emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP:qI,_free:Hc,_i64Add:xv,_i64Subtract:lv,_llvm_bswap_i16:iH,_llvm_bswap_i32:kB,_malloc:xb,_memcpy:Bh,_memmove:fp,_memset:mk,_sbrk:io,dynCall_di:FF,dynCall_did:eD,dynCall_diidii:Nu,dynCall_diii:Ny,dynCall_diiidii:pt,dynCall_diiii:cw,dynCall_diiiii:xu,dynCall_diiiiiiii:ur,dynCall_diiiiiiiii:zq,dynCall_diiiiiiiiii:Gp,dynCall_ii:jF,dynCall_iidid:Uw,dynCall_iii:rB,dynCall_iiid:iz,dynCall_iiii:sy,dynCall_iiiii:Sv,dynCall_iiiiiii:_s,dynCall_iiiiiiiiii:uq,dynCall_iiiiiiiiiii:Dp,dynCall_v:pI,dynCall_vi:EG,dynCall_vid:WD,dynCall_vidd:$A,dynCall_viddiii:du,dynCall_vidi:mA,dynCall_vidii:tx,dynCall_vii:dD,dynCall_viid:uA,dynCall_viidi:sx,dynCall_viidii:fv,dynCall_viii:xz,dynCall_viiid:mx,dynCall_viiidii:Rt,dynCall_viiii:vw,dynCall_viiiid:ev,dynCall_viiiidddddidi:op,dynCall_viiiiddddiid:Rp,dynCall_viiiii:Qu,dynCall_viiiiid:Qt,dynCall_viiiiii:zt,dynCall_viiiiiii:qs,dynCall_viiiiiiiid:Pq,dynCall_viiiiiiiii:Hq,dynCall_viiiiiiiiii:Up,establishStackSpace:VF,setThrew:SC,stackAlloc:Nz,stackRestore:FI,stackSave:KI}}) - - -// EMSCRIPTEN_END_ASM -(eb,d.Ba,buffer),Oa=d.__GLOBAL__sub_I_btQuickprof_cpp=h.__GLOBAL__sub_I_btQuickprof_cpp;d.___cxa_can_catch=h.___cxa_can_catch;d.___cxa_is_pointer_type=h.___cxa_is_pointer_type; -d.___muldi3=h.___muldi3;d.___udivdi3=h.___udivdi3;d._bitshift64Lshr=h._bitshift64Lshr;d._bitshift64Shl=h._bitshift64Shl; -var gb=d._emscripten_bind_Anchor___destroy___0=h._emscripten_bind_Anchor___destroy___0,hb=d._emscripten_bind_Anchor_get_m_body_0=h._emscripten_bind_Anchor_get_m_body_0,ib=d._emscripten_bind_Anchor_get_m_c0_0=h._emscripten_bind_Anchor_get_m_c0_0,jb=d._emscripten_bind_Anchor_get_m_c1_0=h._emscripten_bind_Anchor_get_m_c1_0,kb=d._emscripten_bind_Anchor_get_m_c2_0=h._emscripten_bind_Anchor_get_m_c2_0,lb=d._emscripten_bind_Anchor_get_m_influence_0=h._emscripten_bind_Anchor_get_m_influence_0,mb=d._emscripten_bind_Anchor_get_m_local_0= -h._emscripten_bind_Anchor_get_m_local_0,nb=d._emscripten_bind_Anchor_get_m_node_0=h._emscripten_bind_Anchor_get_m_node_0,ob=d._emscripten_bind_Anchor_set_m_body_1=h._emscripten_bind_Anchor_set_m_body_1,pb=d._emscripten_bind_Anchor_set_m_c0_1=h._emscripten_bind_Anchor_set_m_c0_1,qb=d._emscripten_bind_Anchor_set_m_c1_1=h._emscripten_bind_Anchor_set_m_c1_1,rb=d._emscripten_bind_Anchor_set_m_c2_1=h._emscripten_bind_Anchor_set_m_c2_1,sb=d._emscripten_bind_Anchor_set_m_influence_1=h._emscripten_bind_Anchor_set_m_influence_1, -tb=d._emscripten_bind_Anchor_set_m_local_1=h._emscripten_bind_Anchor_set_m_local_1,ub=d._emscripten_bind_Anchor_set_m_node_1=h._emscripten_bind_Anchor_set_m_node_1,vb=d._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2=h._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2,wb=d._emscripten_bind_ClosestConvexResultCallback___destroy___0=h._emscripten_bind_ClosestConvexResultCallback___destroy___0,xb=d._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0= -h._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0,yb=d._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0,zb=d._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0,Ab=d._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0, -Bb=d._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0,Cb=d._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0,Db=d._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0=h._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0,Eb=d._emscripten_bind_ClosestConvexResultCallback_hasHit_0=h._emscripten_bind_ClosestConvexResultCallback_hasHit_0, -Fb=d._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1,Gb=d._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1,Hb=d._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1,Ib=d._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1= -h._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1,Jb=d._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1,Kb=d._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1,Mb=d._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1=h._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1,Nb=d._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2= -h._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2,Ob=d._emscripten_bind_ClosestRayResultCallback___destroy___0=h._emscripten_bind_ClosestRayResultCallback___destroy___0,Pb=d._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0=h._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0,Qb=d._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0=h._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0,Rb=d._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0= -h._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0,Sb=d._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0=h._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0,Tb=d._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0=h._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0,Ub=d._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0=h._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0,Vb=d._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0= -h._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0,Wb=d._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0=h._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0,Xb=d._emscripten_bind_ClosestRayResultCallback_hasHit_0=h._emscripten_bind_ClosestRayResultCallback_hasHit_0,Yb=d._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1=h._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1,Zb=d._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1= -h._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1,$b=d._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1=h._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1,ac=d._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1=h._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1,bc=d._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1=h._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1,cc=d._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1= -h._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1,dc=d._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1=h._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1,ec=d._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1=h._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1,fc=d._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0=h._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0,hc=d._emscripten_bind_ConcreteContactResultCallback___destroy___0= -h._emscripten_bind_ConcreteContactResultCallback___destroy___0,ic=d._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7=h._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7,jc=d._emscripten_bind_Config___destroy___0=h._emscripten_bind_Config___destroy___0,kc=d._emscripten_bind_Config_get_citerations_0=h._emscripten_bind_Config_get_citerations_0,lc=d._emscripten_bind_Config_get_collisions_0=h._emscripten_bind_Config_get_collisions_0,mc=d._emscripten_bind_Config_get_diterations_0= -h._emscripten_bind_Config_get_diterations_0,nc=d._emscripten_bind_Config_get_kAHR_0=h._emscripten_bind_Config_get_kAHR_0,oc=d._emscripten_bind_Config_get_kCHR_0=h._emscripten_bind_Config_get_kCHR_0,pc=d._emscripten_bind_Config_get_kDF_0=h._emscripten_bind_Config_get_kDF_0,qc=d._emscripten_bind_Config_get_kDG_0=h._emscripten_bind_Config_get_kDG_0,rc=d._emscripten_bind_Config_get_kDP_0=h._emscripten_bind_Config_get_kDP_0,sc=d._emscripten_bind_Config_get_kKHR_0=h._emscripten_bind_Config_get_kKHR_0,tc= -d._emscripten_bind_Config_get_kLF_0=h._emscripten_bind_Config_get_kLF_0,uc=d._emscripten_bind_Config_get_kMT_0=h._emscripten_bind_Config_get_kMT_0,vc=d._emscripten_bind_Config_get_kPR_0=h._emscripten_bind_Config_get_kPR_0,wc=d._emscripten_bind_Config_get_kSHR_0=h._emscripten_bind_Config_get_kSHR_0,xc=d._emscripten_bind_Config_get_kSKHR_CL_0=h._emscripten_bind_Config_get_kSKHR_CL_0,yc=d._emscripten_bind_Config_get_kSK_SPLT_CL_0=h._emscripten_bind_Config_get_kSK_SPLT_CL_0,zc=d._emscripten_bind_Config_get_kSRHR_CL_0= -h._emscripten_bind_Config_get_kSRHR_CL_0,Ac=d._emscripten_bind_Config_get_kSR_SPLT_CL_0=h._emscripten_bind_Config_get_kSR_SPLT_CL_0,Bc=d._emscripten_bind_Config_get_kSSHR_CL_0=h._emscripten_bind_Config_get_kSSHR_CL_0,Cc=d._emscripten_bind_Config_get_kSS_SPLT_CL_0=h._emscripten_bind_Config_get_kSS_SPLT_CL_0,Dc=d._emscripten_bind_Config_get_kVCF_0=h._emscripten_bind_Config_get_kVCF_0,Ec=d._emscripten_bind_Config_get_kVC_0=h._emscripten_bind_Config_get_kVC_0,Fc=d._emscripten_bind_Config_get_maxvolume_0= -h._emscripten_bind_Config_get_maxvolume_0,Gc=d._emscripten_bind_Config_get_piterations_0=h._emscripten_bind_Config_get_piterations_0,Hc=d._emscripten_bind_Config_get_timescale_0=h._emscripten_bind_Config_get_timescale_0,Ic=d._emscripten_bind_Config_get_viterations_0=h._emscripten_bind_Config_get_viterations_0,Jc=d._emscripten_bind_Config_set_citerations_1=h._emscripten_bind_Config_set_citerations_1,Kc=d._emscripten_bind_Config_set_collisions_1=h._emscripten_bind_Config_set_collisions_1,Lc=d._emscripten_bind_Config_set_diterations_1= -h._emscripten_bind_Config_set_diterations_1,Mc=d._emscripten_bind_Config_set_kAHR_1=h._emscripten_bind_Config_set_kAHR_1,Nc=d._emscripten_bind_Config_set_kCHR_1=h._emscripten_bind_Config_set_kCHR_1,Oc=d._emscripten_bind_Config_set_kDF_1=h._emscripten_bind_Config_set_kDF_1,Pc=d._emscripten_bind_Config_set_kDG_1=h._emscripten_bind_Config_set_kDG_1,Qc=d._emscripten_bind_Config_set_kDP_1=h._emscripten_bind_Config_set_kDP_1,Rc=d._emscripten_bind_Config_set_kKHR_1=h._emscripten_bind_Config_set_kKHR_1,Sc= -d._emscripten_bind_Config_set_kLF_1=h._emscripten_bind_Config_set_kLF_1,Tc=d._emscripten_bind_Config_set_kMT_1=h._emscripten_bind_Config_set_kMT_1,Uc=d._emscripten_bind_Config_set_kPR_1=h._emscripten_bind_Config_set_kPR_1,Vc=d._emscripten_bind_Config_set_kSHR_1=h._emscripten_bind_Config_set_kSHR_1,Wc=d._emscripten_bind_Config_set_kSKHR_CL_1=h._emscripten_bind_Config_set_kSKHR_CL_1,Xc=d._emscripten_bind_Config_set_kSK_SPLT_CL_1=h._emscripten_bind_Config_set_kSK_SPLT_CL_1,Yc=d._emscripten_bind_Config_set_kSRHR_CL_1= -h._emscripten_bind_Config_set_kSRHR_CL_1,Zc=d._emscripten_bind_Config_set_kSR_SPLT_CL_1=h._emscripten_bind_Config_set_kSR_SPLT_CL_1,$c=d._emscripten_bind_Config_set_kSSHR_CL_1=h._emscripten_bind_Config_set_kSSHR_CL_1,ad=d._emscripten_bind_Config_set_kSS_SPLT_CL_1=h._emscripten_bind_Config_set_kSS_SPLT_CL_1,bd=d._emscripten_bind_Config_set_kVCF_1=h._emscripten_bind_Config_set_kVCF_1,cd=d._emscripten_bind_Config_set_kVC_1=h._emscripten_bind_Config_set_kVC_1,dd=d._emscripten_bind_Config_set_maxvolume_1= -h._emscripten_bind_Config_set_maxvolume_1,ed=d._emscripten_bind_Config_set_piterations_1=h._emscripten_bind_Config_set_piterations_1,fd=d._emscripten_bind_Config_set_timescale_1=h._emscripten_bind_Config_set_timescale_1,gd=d._emscripten_bind_Config_set_viterations_1=h._emscripten_bind_Config_set_viterations_1,hd=d._emscripten_bind_ContactResultCallback___destroy___0=h._emscripten_bind_ContactResultCallback___destroy___0,id=d._emscripten_bind_ContactResultCallback_addSingleResult_7=h._emscripten_bind_ContactResultCallback_addSingleResult_7, -jd=d._emscripten_bind_ConvexResultCallback___destroy___0=h._emscripten_bind_ConvexResultCallback___destroy___0,kd=d._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0=h._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0,ld=d._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0=h._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0,md=d._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0=h._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0, -nd=d._emscripten_bind_ConvexResultCallback_hasHit_0=h._emscripten_bind_ConvexResultCallback_hasHit_0,od=d._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1=h._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1,pd=d._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1=h._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1,qd=d._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1=h._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1, -rd=d._emscripten_bind_DebugDrawer_DebugDrawer_0=h._emscripten_bind_DebugDrawer_DebugDrawer_0,sd=d._emscripten_bind_DebugDrawer___destroy___0=h._emscripten_bind_DebugDrawer___destroy___0,td=d._emscripten_bind_DebugDrawer_draw3dText_2=h._emscripten_bind_DebugDrawer_draw3dText_2,ud=d._emscripten_bind_DebugDrawer_drawContactPoint_5=h._emscripten_bind_DebugDrawer_drawContactPoint_5,vd=d._emscripten_bind_DebugDrawer_drawLine_3=h._emscripten_bind_DebugDrawer_drawLine_3,wd=d._emscripten_bind_DebugDrawer_getDebugMode_0= -h._emscripten_bind_DebugDrawer_getDebugMode_0,xd=d._emscripten_bind_DebugDrawer_reportErrorWarning_1=h._emscripten_bind_DebugDrawer_reportErrorWarning_1,yd=d._emscripten_bind_DebugDrawer_setDebugMode_1=h._emscripten_bind_DebugDrawer_setDebugMode_1,zd=d._emscripten_bind_LocalConvexResult_LocalConvexResult_5=h._emscripten_bind_LocalConvexResult_LocalConvexResult_5,Ad=d._emscripten_bind_LocalConvexResult___destroy___0=h._emscripten_bind_LocalConvexResult___destroy___0,Bd=d._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0= -h._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0,Cd=d._emscripten_bind_LocalConvexResult_get_m_hitFraction_0=h._emscripten_bind_LocalConvexResult_get_m_hitFraction_0,Dd=d._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0=h._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0,Ed=d._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0=h._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0,Fd=d._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0=h._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0, -Gd=d._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1=h._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1,Hd=d._emscripten_bind_LocalConvexResult_set_m_hitFraction_1=h._emscripten_bind_LocalConvexResult_set_m_hitFraction_1,Id=d._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1=h._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1,Jd=d._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1=h._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1,Kd=d._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1= -h._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1,Ld=d._emscripten_bind_LocalShapeInfo___destroy___0=h._emscripten_bind_LocalShapeInfo___destroy___0,Md=d._emscripten_bind_LocalShapeInfo_get_m_shapePart_0=h._emscripten_bind_LocalShapeInfo_get_m_shapePart_0,Nd=d._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0=h._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0,Od=d._emscripten_bind_LocalShapeInfo_set_m_shapePart_1=h._emscripten_bind_LocalShapeInfo_set_m_shapePart_1,Pd=d._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1= -h._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1,Qd=d._emscripten_bind_Material___destroy___0=h._emscripten_bind_Material___destroy___0,Rd=d._emscripten_bind_Material_get_m_flags_0=h._emscripten_bind_Material_get_m_flags_0,Sd=d._emscripten_bind_Material_get_m_kAST_0=h._emscripten_bind_Material_get_m_kAST_0,Td=d._emscripten_bind_Material_get_m_kLST_0=h._emscripten_bind_Material_get_m_kLST_0,Ud=d._emscripten_bind_Material_get_m_kVST_0=h._emscripten_bind_Material_get_m_kVST_0,Vd=d._emscripten_bind_Material_set_m_flags_1= -h._emscripten_bind_Material_set_m_flags_1,Wd=d._emscripten_bind_Material_set_m_kAST_1=h._emscripten_bind_Material_set_m_kAST_1,Xd=d._emscripten_bind_Material_set_m_kLST_1=h._emscripten_bind_Material_set_m_kLST_1,Yd=d._emscripten_bind_Material_set_m_kVST_1=h._emscripten_bind_Material_set_m_kVST_1,Zd=d._emscripten_bind_Node___destroy___0=h._emscripten_bind_Node___destroy___0,$d=d._emscripten_bind_Node_get_m_area_0=h._emscripten_bind_Node_get_m_area_0,ae=d._emscripten_bind_Node_get_m_f_0=h._emscripten_bind_Node_get_m_f_0, -be=d._emscripten_bind_Node_get_m_im_0=h._emscripten_bind_Node_get_m_im_0,ce=d._emscripten_bind_Node_get_m_n_0=h._emscripten_bind_Node_get_m_n_0,de=d._emscripten_bind_Node_get_m_q_0=h._emscripten_bind_Node_get_m_q_0,ee=d._emscripten_bind_Node_get_m_v_0=h._emscripten_bind_Node_get_m_v_0,fe=d._emscripten_bind_Node_get_m_x_0=h._emscripten_bind_Node_get_m_x_0,ge=d._emscripten_bind_Node_set_m_area_1=h._emscripten_bind_Node_set_m_area_1,he=d._emscripten_bind_Node_set_m_f_1=h._emscripten_bind_Node_set_m_f_1, -ie=d._emscripten_bind_Node_set_m_im_1=h._emscripten_bind_Node_set_m_im_1,je=d._emscripten_bind_Node_set_m_n_1=h._emscripten_bind_Node_set_m_n_1,ke=d._emscripten_bind_Node_set_m_q_1=h._emscripten_bind_Node_set_m_q_1,le=d._emscripten_bind_Node_set_m_v_1=h._emscripten_bind_Node_set_m_v_1,me=d._emscripten_bind_Node_set_m_x_1=h._emscripten_bind_Node_set_m_x_1,ne=d._emscripten_bind_RayResultCallback___destroy___0=h._emscripten_bind_RayResultCallback___destroy___0,oe=d._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0= -h._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0,pe=d._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0=h._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0,qe=d._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0=h._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0,re=d._emscripten_bind_RayResultCallback_get_m_collisionObject_0=h._emscripten_bind_RayResultCallback_get_m_collisionObject_0,se=d._emscripten_bind_RayResultCallback_hasHit_0= -h._emscripten_bind_RayResultCallback_hasHit_0,te=d._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1=h._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1,ue=d._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1=h._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1,ve=d._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1=h._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1,we=d._emscripten_bind_RayResultCallback_set_m_collisionObject_1= -h._emscripten_bind_RayResultCallback_set_m_collisionObject_1,xe=d._emscripten_bind_RaycastInfo___destroy___0=h._emscripten_bind_RaycastInfo___destroy___0,ye=d._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0=h._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0,ze=d._emscripten_bind_RaycastInfo_get_m_contactPointWS_0=h._emscripten_bind_RaycastInfo_get_m_contactPointWS_0,Ae=d._emscripten_bind_RaycastInfo_get_m_groundObject_0=h._emscripten_bind_RaycastInfo_get_m_groundObject_0,Be=d._emscripten_bind_RaycastInfo_get_m_hardPointWS_0= -h._emscripten_bind_RaycastInfo_get_m_hardPointWS_0,Ce=d._emscripten_bind_RaycastInfo_get_m_isInContact_0=h._emscripten_bind_RaycastInfo_get_m_isInContact_0,De=d._emscripten_bind_RaycastInfo_get_m_suspensionLength_0=h._emscripten_bind_RaycastInfo_get_m_suspensionLength_0,Ee=d._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0=h._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0,Fe=d._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0=h._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0,Ge=d._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1= -h._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1,He=d._emscripten_bind_RaycastInfo_set_m_contactPointWS_1=h._emscripten_bind_RaycastInfo_set_m_contactPointWS_1,Ie=d._emscripten_bind_RaycastInfo_set_m_groundObject_1=h._emscripten_bind_RaycastInfo_set_m_groundObject_1,Je=d._emscripten_bind_RaycastInfo_set_m_hardPointWS_1=h._emscripten_bind_RaycastInfo_set_m_hardPointWS_1,Ke=d._emscripten_bind_RaycastInfo_set_m_isInContact_1=h._emscripten_bind_RaycastInfo_set_m_isInContact_1,Le=d._emscripten_bind_RaycastInfo_set_m_suspensionLength_1= -h._emscripten_bind_RaycastInfo_set_m_suspensionLength_1,Me=d._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1=h._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1,Ne=d._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1=h._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1,Oe=d._emscripten_bind_VoidPtr___destroy___0=h._emscripten_bind_VoidPtr___destroy___0,Pe=d._emscripten_bind_btActionInterface___destroy___0=h._emscripten_bind_btActionInterface___destroy___0,Qe=d._emscripten_bind_btActionInterface_updateAction_2= -h._emscripten_bind_btActionInterface_updateAction_2,Re=d._emscripten_bind_btAxisSweep3___destroy___0=h._emscripten_bind_btAxisSweep3___destroy___0,Se=d._emscripten_bind_btAxisSweep3_btAxisSweep3_2=h._emscripten_bind_btAxisSweep3_btAxisSweep3_2,Te=d._emscripten_bind_btAxisSweep3_btAxisSweep3_3=h._emscripten_bind_btAxisSweep3_btAxisSweep3_3,Ue=d._emscripten_bind_btAxisSweep3_btAxisSweep3_4=h._emscripten_bind_btAxisSweep3_btAxisSweep3_4,Ve=d._emscripten_bind_btAxisSweep3_btAxisSweep3_5=h._emscripten_bind_btAxisSweep3_btAxisSweep3_5, -We=d._emscripten_bind_btBoxShape___destroy___0=h._emscripten_bind_btBoxShape___destroy___0,Xe=d._emscripten_bind_btBoxShape_btBoxShape_1=h._emscripten_bind_btBoxShape_btBoxShape_1,Ye=d._emscripten_bind_btBoxShape_calculateLocalInertia_2=h._emscripten_bind_btBoxShape_calculateLocalInertia_2,Ze=d._emscripten_bind_btBoxShape_getLocalScaling_0=h._emscripten_bind_btBoxShape_getLocalScaling_0,$e=d._emscripten_bind_btBoxShape_getMargin_0=h._emscripten_bind_btBoxShape_getMargin_0,af=d._emscripten_bind_btBoxShape_setLocalScaling_1= -h._emscripten_bind_btBoxShape_setLocalScaling_1,bf=d._emscripten_bind_btBoxShape_setMargin_1=h._emscripten_bind_btBoxShape_setMargin_1,cf=d._emscripten_bind_btBroadphaseInterface___destroy___0=h._emscripten_bind_btBroadphaseInterface___destroy___0,df=d._emscripten_bind_btBroadphaseProxy___destroy___0=h._emscripten_bind_btBroadphaseProxy___destroy___0,ef=d._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0=h._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0,ff=d._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0= -h._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0,gf=d._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1=h._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1,hf=d._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1=h._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1,jf=d._emscripten_bind_btBvhTriangleMeshShape___destroy___0=h._emscripten_bind_btBvhTriangleMeshShape___destroy___0,kf=d._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2= -h._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2,lf=d._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3=h._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3,mf=d._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2=h._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2,nf=d._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0=h._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0,of=d._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1= -h._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1,pf=d._emscripten_bind_btCapsuleShapeX___destroy___0=h._emscripten_bind_btCapsuleShapeX___destroy___0,qf=d._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2=h._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2,rf=d._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2=h._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2,sf=d._emscripten_bind_btCapsuleShapeX_getHalfHeight_0=h._emscripten_bind_btCapsuleShapeX_getHalfHeight_0,tf=d._emscripten_bind_btCapsuleShapeX_getLocalScaling_0= -h._emscripten_bind_btCapsuleShapeX_getLocalScaling_0,uf=d._emscripten_bind_btCapsuleShapeX_getMargin_0=h._emscripten_bind_btCapsuleShapeX_getMargin_0,vf=d._emscripten_bind_btCapsuleShapeX_getRadius_0=h._emscripten_bind_btCapsuleShapeX_getRadius_0,wf=d._emscripten_bind_btCapsuleShapeX_getUpAxis_0=h._emscripten_bind_btCapsuleShapeX_getUpAxis_0,xf=d._emscripten_bind_btCapsuleShapeX_setLocalScaling_1=h._emscripten_bind_btCapsuleShapeX_setLocalScaling_1,yf=d._emscripten_bind_btCapsuleShapeX_setMargin_1= -h._emscripten_bind_btCapsuleShapeX_setMargin_1,zf=d._emscripten_bind_btCapsuleShapeZ___destroy___0=h._emscripten_bind_btCapsuleShapeZ___destroy___0,Af=d._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2=h._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2,Bf=d._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2=h._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2,Cf=d._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0=h._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0,Df=d._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0= -h._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0,Ef=d._emscripten_bind_btCapsuleShapeZ_getMargin_0=h._emscripten_bind_btCapsuleShapeZ_getMargin_0,Ff=d._emscripten_bind_btCapsuleShapeZ_getRadius_0=h._emscripten_bind_btCapsuleShapeZ_getRadius_0,Gf=d._emscripten_bind_btCapsuleShapeZ_getUpAxis_0=h._emscripten_bind_btCapsuleShapeZ_getUpAxis_0,Hf=d._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1=h._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1,If=d._emscripten_bind_btCapsuleShapeZ_setMargin_1= -h._emscripten_bind_btCapsuleShapeZ_setMargin_1,Jf=d._emscripten_bind_btCapsuleShape___destroy___0=h._emscripten_bind_btCapsuleShape___destroy___0,Kf=d._emscripten_bind_btCapsuleShape_btCapsuleShape_2=h._emscripten_bind_btCapsuleShape_btCapsuleShape_2,Lf=d._emscripten_bind_btCapsuleShape_calculateLocalInertia_2=h._emscripten_bind_btCapsuleShape_calculateLocalInertia_2,Mf=d._emscripten_bind_btCapsuleShape_getHalfHeight_0=h._emscripten_bind_btCapsuleShape_getHalfHeight_0,Nf=d._emscripten_bind_btCapsuleShape_getLocalScaling_0= -h._emscripten_bind_btCapsuleShape_getLocalScaling_0,Of=d._emscripten_bind_btCapsuleShape_getMargin_0=h._emscripten_bind_btCapsuleShape_getMargin_0,Pf=d._emscripten_bind_btCapsuleShape_getRadius_0=h._emscripten_bind_btCapsuleShape_getRadius_0,Qf=d._emscripten_bind_btCapsuleShape_getUpAxis_0=h._emscripten_bind_btCapsuleShape_getUpAxis_0,Rf=d._emscripten_bind_btCapsuleShape_setLocalScaling_1=h._emscripten_bind_btCapsuleShape_setLocalScaling_1,Sf=d._emscripten_bind_btCapsuleShape_setMargin_1=h._emscripten_bind_btCapsuleShape_setMargin_1, -Tf=d._emscripten_bind_btCollisionConfiguration___destroy___0=h._emscripten_bind_btCollisionConfiguration___destroy___0,Uf=d._emscripten_bind_btCollisionDispatcher___destroy___0=h._emscripten_bind_btCollisionDispatcher___destroy___0,Vf=d._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1=h._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1,Wf=d._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1=h._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1, -Xf=d._emscripten_bind_btCollisionDispatcher_getNumManifolds_0=h._emscripten_bind_btCollisionDispatcher_getNumManifolds_0,Yf=d._emscripten_bind_btCollisionObject___destroy___0=h._emscripten_bind_btCollisionObject___destroy___0,Zf=d._emscripten_bind_btCollisionObject_activate_0=h._emscripten_bind_btCollisionObject_activate_0,$f=d._emscripten_bind_btCollisionObject_activate_1=h._emscripten_bind_btCollisionObject_activate_1,ag=d._emscripten_bind_btCollisionObject_forceActivationState_1=h._emscripten_bind_btCollisionObject_forceActivationState_1, -bg=d._emscripten_bind_btCollisionObject_getCollisionFlags_0=h._emscripten_bind_btCollisionObject_getCollisionFlags_0,cg=d._emscripten_bind_btCollisionObject_getCollisionShape_0=h._emscripten_bind_btCollisionObject_getCollisionShape_0,dg=d._emscripten_bind_btCollisionObject_getUserIndex_0=h._emscripten_bind_btCollisionObject_getUserIndex_0,eg=d._emscripten_bind_btCollisionObject_getUserPointer_0=h._emscripten_bind_btCollisionObject_getUserPointer_0,fg=d._emscripten_bind_btCollisionObject_getWorldTransform_0= -h._emscripten_bind_btCollisionObject_getWorldTransform_0,gg=d._emscripten_bind_btCollisionObject_isActive_0=h._emscripten_bind_btCollisionObject_isActive_0,hg=d._emscripten_bind_btCollisionObject_isKinematicObject_0=h._emscripten_bind_btCollisionObject_isKinematicObject_0,ig=d._emscripten_bind_btCollisionObject_isStaticObject_0=h._emscripten_bind_btCollisionObject_isStaticObject_0,jg=d._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0=h._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0, -kg=d._emscripten_bind_btCollisionObject_setActivationState_1=h._emscripten_bind_btCollisionObject_setActivationState_1,lg=d._emscripten_bind_btCollisionObject_setAnisotropicFriction_2=h._emscripten_bind_btCollisionObject_setAnisotropicFriction_2,mg=d._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1=h._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1,ng=d._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1=h._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1,og= -d._emscripten_bind_btCollisionObject_setCollisionFlags_1=h._emscripten_bind_btCollisionObject_setCollisionFlags_1,pg=d._emscripten_bind_btCollisionObject_setCollisionShape_1=h._emscripten_bind_btCollisionObject_setCollisionShape_1,qg=d._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1=h._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1,rg=d._emscripten_bind_btCollisionObject_setFriction_1=h._emscripten_bind_btCollisionObject_setFriction_1,sg=d._emscripten_bind_btCollisionObject_setRestitution_1= -h._emscripten_bind_btCollisionObject_setRestitution_1,tg=d._emscripten_bind_btCollisionObject_setRollingFriction_1=h._emscripten_bind_btCollisionObject_setRollingFriction_1,ug=d._emscripten_bind_btCollisionObject_setUserIndex_1=h._emscripten_bind_btCollisionObject_setUserIndex_1,vg=d._emscripten_bind_btCollisionObject_setUserPointer_1=h._emscripten_bind_btCollisionObject_setUserPointer_1,wg=d._emscripten_bind_btCollisionObject_setWorldTransform_1=h._emscripten_bind_btCollisionObject_setWorldTransform_1, -xg=d._emscripten_bind_btCollisionShape___destroy___0=h._emscripten_bind_btCollisionShape___destroy___0,yg=d._emscripten_bind_btCollisionShape_calculateLocalInertia_2=h._emscripten_bind_btCollisionShape_calculateLocalInertia_2,zg=d._emscripten_bind_btCollisionShape_getLocalScaling_0=h._emscripten_bind_btCollisionShape_getLocalScaling_0,Ag=d._emscripten_bind_btCollisionShape_getMargin_0=h._emscripten_bind_btCollisionShape_getMargin_0,Bg=d._emscripten_bind_btCollisionShape_setLocalScaling_1=h._emscripten_bind_btCollisionShape_setLocalScaling_1, -Cg=d._emscripten_bind_btCollisionShape_setMargin_1=h._emscripten_bind_btCollisionShape_setMargin_1,Dg=d._emscripten_bind_btCollisionWorld___destroy___0=h._emscripten_bind_btCollisionWorld___destroy___0,Eg=d._emscripten_bind_btCollisionWorld_addCollisionObject_1=h._emscripten_bind_btCollisionWorld_addCollisionObject_1,Fg=d._emscripten_bind_btCollisionWorld_addCollisionObject_2=h._emscripten_bind_btCollisionWorld_addCollisionObject_2,Gg=d._emscripten_bind_btCollisionWorld_addCollisionObject_3=h._emscripten_bind_btCollisionWorld_addCollisionObject_3, -Hg=d._emscripten_bind_btCollisionWorld_contactPairTest_3=h._emscripten_bind_btCollisionWorld_contactPairTest_3,Ig=d._emscripten_bind_btCollisionWorld_contactTest_2=h._emscripten_bind_btCollisionWorld_contactTest_2,Jg=d._emscripten_bind_btCollisionWorld_convexSweepTest_5=h._emscripten_bind_btCollisionWorld_convexSweepTest_5,Kg=d._emscripten_bind_btCollisionWorld_debugDrawObject_3=h._emscripten_bind_btCollisionWorld_debugDrawObject_3,Lg=d._emscripten_bind_btCollisionWorld_debugDrawWorld_0=h._emscripten_bind_btCollisionWorld_debugDrawWorld_0, -Mg=d._emscripten_bind_btCollisionWorld_getBroadphase_0=h._emscripten_bind_btCollisionWorld_getBroadphase_0,Ng=d._emscripten_bind_btCollisionWorld_getDebugDrawer_0=h._emscripten_bind_btCollisionWorld_getDebugDrawer_0,Og=d._emscripten_bind_btCollisionWorld_getDispatchInfo_0=h._emscripten_bind_btCollisionWorld_getDispatchInfo_0,Pg=d._emscripten_bind_btCollisionWorld_getDispatcher_0=h._emscripten_bind_btCollisionWorld_getDispatcher_0,Qg=d._emscripten_bind_btCollisionWorld_getPairCache_0=h._emscripten_bind_btCollisionWorld_getPairCache_0, -Rg=d._emscripten_bind_btCollisionWorld_rayTest_3=h._emscripten_bind_btCollisionWorld_rayTest_3,Sg=d._emscripten_bind_btCollisionWorld_removeCollisionObject_1=h._emscripten_bind_btCollisionWorld_removeCollisionObject_1,Tg=d._emscripten_bind_btCollisionWorld_setDebugDrawer_1=h._emscripten_bind_btCollisionWorld_setDebugDrawer_1,Ug=d._emscripten_bind_btCollisionWorld_updateSingleAabb_1=h._emscripten_bind_btCollisionWorld_updateSingleAabb_1,Vg=d._emscripten_bind_btCompoundShape___destroy___0=h._emscripten_bind_btCompoundShape___destroy___0, -Wg=d._emscripten_bind_btCompoundShape_addChildShape_2=h._emscripten_bind_btCompoundShape_addChildShape_2,Xg=d._emscripten_bind_btCompoundShape_btCompoundShape_0=h._emscripten_bind_btCompoundShape_btCompoundShape_0,Yg=d._emscripten_bind_btCompoundShape_btCompoundShape_1=h._emscripten_bind_btCompoundShape_btCompoundShape_1,Zg=d._emscripten_bind_btCompoundShape_calculateLocalInertia_2=h._emscripten_bind_btCompoundShape_calculateLocalInertia_2,$g=d._emscripten_bind_btCompoundShape_getChildShape_1=h._emscripten_bind_btCompoundShape_getChildShape_1, -ah=d._emscripten_bind_btCompoundShape_getLocalScaling_0=h._emscripten_bind_btCompoundShape_getLocalScaling_0,bh=d._emscripten_bind_btCompoundShape_getMargin_0=h._emscripten_bind_btCompoundShape_getMargin_0,ch=d._emscripten_bind_btCompoundShape_getNumChildShapes_0=h._emscripten_bind_btCompoundShape_getNumChildShapes_0,dh=d._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1=h._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1,eh=d._emscripten_bind_btCompoundShape_setLocalScaling_1=h._emscripten_bind_btCompoundShape_setLocalScaling_1, -fh=d._emscripten_bind_btCompoundShape_setMargin_1=h._emscripten_bind_btCompoundShape_setMargin_1,gh=d._emscripten_bind_btConcaveShape___destroy___0=h._emscripten_bind_btConcaveShape___destroy___0,hh=d._emscripten_bind_btConcaveShape_calculateLocalInertia_2=h._emscripten_bind_btConcaveShape_calculateLocalInertia_2,ih=d._emscripten_bind_btConcaveShape_getLocalScaling_0=h._emscripten_bind_btConcaveShape_getLocalScaling_0,jh=d._emscripten_bind_btConcaveShape_setLocalScaling_1=h._emscripten_bind_btConcaveShape_setLocalScaling_1, -kh=d._emscripten_bind_btConeShapeX___destroy___0=h._emscripten_bind_btConeShapeX___destroy___0,lh=d._emscripten_bind_btConeShapeX_btConeShapeX_2=h._emscripten_bind_btConeShapeX_btConeShapeX_2,mh=d._emscripten_bind_btConeShapeX_calculateLocalInertia_2=h._emscripten_bind_btConeShapeX_calculateLocalInertia_2,nh=d._emscripten_bind_btConeShapeX_getLocalScaling_0=h._emscripten_bind_btConeShapeX_getLocalScaling_0,oh=d._emscripten_bind_btConeShapeX_setLocalScaling_1=h._emscripten_bind_btConeShapeX_setLocalScaling_1, -ph=d._emscripten_bind_btConeShapeZ___destroy___0=h._emscripten_bind_btConeShapeZ___destroy___0,qh=d._emscripten_bind_btConeShapeZ_btConeShapeZ_2=h._emscripten_bind_btConeShapeZ_btConeShapeZ_2,rh=d._emscripten_bind_btConeShapeZ_calculateLocalInertia_2=h._emscripten_bind_btConeShapeZ_calculateLocalInertia_2,sh=d._emscripten_bind_btConeShapeZ_getLocalScaling_0=h._emscripten_bind_btConeShapeZ_getLocalScaling_0,th=d._emscripten_bind_btConeShapeZ_setLocalScaling_1=h._emscripten_bind_btConeShapeZ_setLocalScaling_1, -uh=d._emscripten_bind_btConeShape___destroy___0=h._emscripten_bind_btConeShape___destroy___0,vh=d._emscripten_bind_btConeShape_btConeShape_2=h._emscripten_bind_btConeShape_btConeShape_2,wh=d._emscripten_bind_btConeShape_calculateLocalInertia_2=h._emscripten_bind_btConeShape_calculateLocalInertia_2,xh=d._emscripten_bind_btConeShape_getLocalScaling_0=h._emscripten_bind_btConeShape_getLocalScaling_0,yh=d._emscripten_bind_btConeShape_setLocalScaling_1=h._emscripten_bind_btConeShape_setLocalScaling_1, -zh=d._emscripten_bind_btConeTwistConstraint___destroy___0=h._emscripten_bind_btConeTwistConstraint___destroy___0,Ah=d._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2=h._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2,Bh=d._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4=h._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4,Ch=d._emscripten_bind_btConeTwistConstraint_enableFeedback_1=h._emscripten_bind_btConeTwistConstraint_enableFeedback_1,Dh= -d._emscripten_bind_btConeTwistConstraint_enableMotor_1=h._emscripten_bind_btConeTwistConstraint_enableMotor_1,Eh=d._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0,Fh=d._emscripten_bind_btConeTwistConstraint_getParam_2=h._emscripten_bind_btConeTwistConstraint_getParam_2,Gh=d._emscripten_bind_btConeTwistConstraint_setAngularOnly_1=h._emscripten_bind_btConeTwistConstraint_setAngularOnly_1,Hh=d._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1= -h._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1,Ih=d._emscripten_bind_btConeTwistConstraint_setDamping_1=h._emscripten_bind_btConeTwistConstraint_setDamping_1,Jh=d._emscripten_bind_btConeTwistConstraint_setLimit_2=h._emscripten_bind_btConeTwistConstraint_setLimit_2,Kh=d._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1=h._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1,Lh=d._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1= -h._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1,Mh=d._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1=h._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1,Nh=d._emscripten_bind_btConeTwistConstraint_setMotorTarget_1=h._emscripten_bind_btConeTwistConstraint_setMotorTarget_1,Oh=d._emscripten_bind_btConeTwistConstraint_setParam_3=h._emscripten_bind_btConeTwistConstraint_setParam_3,Ph=d._emscripten_bind_btConstraintSetting___destroy___0=h._emscripten_bind_btConstraintSetting___destroy___0, -Qh=d._emscripten_bind_btConstraintSetting_btConstraintSetting_0=h._emscripten_bind_btConstraintSetting_btConstraintSetting_0,Rh=d._emscripten_bind_btConstraintSetting_get_m_damping_0=h._emscripten_bind_btConstraintSetting_get_m_damping_0,Sh=d._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0=h._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0,Th=d._emscripten_bind_btConstraintSetting_get_m_tau_0=h._emscripten_bind_btConstraintSetting_get_m_tau_0,Uh=d._emscripten_bind_btConstraintSetting_set_m_damping_1= -h._emscripten_bind_btConstraintSetting_set_m_damping_1,Vh=d._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1=h._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1,Wh=d._emscripten_bind_btConstraintSetting_set_m_tau_1=h._emscripten_bind_btConstraintSetting_set_m_tau_1,Xh=d._emscripten_bind_btConstraintSolver___destroy___0=h._emscripten_bind_btConstraintSolver___destroy___0,Yh=d._emscripten_bind_btContactSolverInfo___destroy___0=h._emscripten_bind_btContactSolverInfo___destroy___0,Zh= -d._emscripten_bind_btContactSolverInfo_get_m_numIterations_0=h._emscripten_bind_btContactSolverInfo_get_m_numIterations_0,$h=d._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0=h._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0,ai=d._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0=h._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0,bi=d._emscripten_bind_btContactSolverInfo_set_m_numIterations_1=h._emscripten_bind_btContactSolverInfo_set_m_numIterations_1, -ci=d._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1=h._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1,di=d._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1=h._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1,ei=d._emscripten_bind_btConvexHullShape___destroy___0=h._emscripten_bind_btConvexHullShape___destroy___0,fi=d._emscripten_bind_btConvexHullShape_addPoint_1=h._emscripten_bind_btConvexHullShape_addPoint_1,gi=d._emscripten_bind_btConvexHullShape_addPoint_2= -h._emscripten_bind_btConvexHullShape_addPoint_2,hi=d._emscripten_bind_btConvexHullShape_btConvexHullShape_0=h._emscripten_bind_btConvexHullShape_btConvexHullShape_0,ii=d._emscripten_bind_btConvexHullShape_btConvexHullShape_1=h._emscripten_bind_btConvexHullShape_btConvexHullShape_1,ji=d._emscripten_bind_btConvexHullShape_btConvexHullShape_2=h._emscripten_bind_btConvexHullShape_btConvexHullShape_2,ki=d._emscripten_bind_btConvexHullShape_calculateLocalInertia_2=h._emscripten_bind_btConvexHullShape_calculateLocalInertia_2, -li=d._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0=h._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0,mi=d._emscripten_bind_btConvexHullShape_getLocalScaling_0=h._emscripten_bind_btConvexHullShape_getLocalScaling_0,ni=d._emscripten_bind_btConvexHullShape_getMargin_0=h._emscripten_bind_btConvexHullShape_getMargin_0,oi=d._emscripten_bind_btConvexHullShape_getNumVertices_0=h._emscripten_bind_btConvexHullShape_getNumVertices_0,pi=d._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1= -h._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1,qi=d._emscripten_bind_btConvexHullShape_recalcLocalAabb_0=h._emscripten_bind_btConvexHullShape_recalcLocalAabb_0,ri=d._emscripten_bind_btConvexHullShape_setLocalScaling_1=h._emscripten_bind_btConvexHullShape_setLocalScaling_1,si=d._emscripten_bind_btConvexHullShape_setMargin_1=h._emscripten_bind_btConvexHullShape_setMargin_1,ti=d._emscripten_bind_btConvexPolyhedron___destroy___0=h._emscripten_bind_btConvexPolyhedron___destroy___0, -ui=d._emscripten_bind_btConvexPolyhedron_get_m_faces_0=h._emscripten_bind_btConvexPolyhedron_get_m_faces_0,vi=d._emscripten_bind_btConvexPolyhedron_get_m_vertices_0=h._emscripten_bind_btConvexPolyhedron_get_m_vertices_0,wi=d._emscripten_bind_btConvexPolyhedron_set_m_faces_1=h._emscripten_bind_btConvexPolyhedron_set_m_faces_1,xi=d._emscripten_bind_btConvexPolyhedron_set_m_vertices_1=h._emscripten_bind_btConvexPolyhedron_set_m_vertices_1,yi=d._emscripten_bind_btConvexShape___destroy___0=h._emscripten_bind_btConvexShape___destroy___0, -zi=d._emscripten_bind_btConvexShape_calculateLocalInertia_2=h._emscripten_bind_btConvexShape_calculateLocalInertia_2,Ai=d._emscripten_bind_btConvexShape_getLocalScaling_0=h._emscripten_bind_btConvexShape_getLocalScaling_0,Bi=d._emscripten_bind_btConvexShape_getMargin_0=h._emscripten_bind_btConvexShape_getMargin_0,Ci=d._emscripten_bind_btConvexShape_setLocalScaling_1=h._emscripten_bind_btConvexShape_setLocalScaling_1,Di=d._emscripten_bind_btConvexShape_setMargin_1=h._emscripten_bind_btConvexShape_setMargin_1, -Ei=d._emscripten_bind_btConvexTriangleMeshShape___destroy___0=h._emscripten_bind_btConvexTriangleMeshShape___destroy___0,Fi=d._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1=h._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1,Gi=d._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2=h._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2,Hi=d._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2=h._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2, -Ii=d._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0=h._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0,Ji=d._emscripten_bind_btConvexTriangleMeshShape_getMargin_0=h._emscripten_bind_btConvexTriangleMeshShape_getMargin_0,Ki=d._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1=h._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1,Li=d._emscripten_bind_btConvexTriangleMeshShape_setMargin_1=h._emscripten_bind_btConvexTriangleMeshShape_setMargin_1,Mi=d._emscripten_bind_btCylinderShapeX___destroy___0= -h._emscripten_bind_btCylinderShapeX___destroy___0,Ni=d._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1=h._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1,Oi=d._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2=h._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2,Pi=d._emscripten_bind_btCylinderShapeX_getLocalScaling_0=h._emscripten_bind_btCylinderShapeX_getLocalScaling_0,Qi=d._emscripten_bind_btCylinderShapeX_getMargin_0=h._emscripten_bind_btCylinderShapeX_getMargin_0,Ri=d._emscripten_bind_btCylinderShapeX_setLocalScaling_1= -h._emscripten_bind_btCylinderShapeX_setLocalScaling_1,Si=d._emscripten_bind_btCylinderShapeX_setMargin_1=h._emscripten_bind_btCylinderShapeX_setMargin_1,Ti=d._emscripten_bind_btCylinderShapeZ___destroy___0=h._emscripten_bind_btCylinderShapeZ___destroy___0,Ui=d._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1=h._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1,Vi=d._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2=h._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2,Wi=d._emscripten_bind_btCylinderShapeZ_getLocalScaling_0= -h._emscripten_bind_btCylinderShapeZ_getLocalScaling_0,Xi=d._emscripten_bind_btCylinderShapeZ_getMargin_0=h._emscripten_bind_btCylinderShapeZ_getMargin_0,Yi=d._emscripten_bind_btCylinderShapeZ_setLocalScaling_1=h._emscripten_bind_btCylinderShapeZ_setLocalScaling_1,Zi=d._emscripten_bind_btCylinderShapeZ_setMargin_1=h._emscripten_bind_btCylinderShapeZ_setMargin_1,$i=d._emscripten_bind_btCylinderShape___destroy___0=h._emscripten_bind_btCylinderShape___destroy___0,aj=d._emscripten_bind_btCylinderShape_btCylinderShape_1= -h._emscripten_bind_btCylinderShape_btCylinderShape_1,bj=d._emscripten_bind_btCylinderShape_calculateLocalInertia_2=h._emscripten_bind_btCylinderShape_calculateLocalInertia_2,cj=d._emscripten_bind_btCylinderShape_getLocalScaling_0=h._emscripten_bind_btCylinderShape_getLocalScaling_0,dj=d._emscripten_bind_btCylinderShape_getMargin_0=h._emscripten_bind_btCylinderShape_getMargin_0,ej=d._emscripten_bind_btCylinderShape_setLocalScaling_1=h._emscripten_bind_btCylinderShape_setLocalScaling_1,fj=d._emscripten_bind_btCylinderShape_setMargin_1= -h._emscripten_bind_btCylinderShape_setMargin_1,gj=d._emscripten_bind_btDbvtBroadphase___destroy___0=h._emscripten_bind_btDbvtBroadphase___destroy___0,hj=d._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0=h._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0,ij=d._emscripten_bind_btDefaultCollisionConfiguration___destroy___0=h._emscripten_bind_btDefaultCollisionConfiguration___destroy___0,jj=d._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0=h._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0, -kj=d._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1=h._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1,lj=d._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0=h._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0,mj=d._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0=h._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0,nj=d._emscripten_bind_btDefaultMotionState___destroy___0= -h._emscripten_bind_btDefaultMotionState___destroy___0,oj=d._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0=h._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0,pj=d._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1=h._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1,qj=d._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2=h._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2,rj=d._emscripten_bind_btDefaultMotionState_getWorldTransform_1= -h._emscripten_bind_btDefaultMotionState_getWorldTransform_1,sj=d._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0=h._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0,tj=d._emscripten_bind_btDefaultMotionState_setWorldTransform_1=h._emscripten_bind_btDefaultMotionState_setWorldTransform_1,uj=d._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1=h._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1,vj=d._emscripten_bind_btDefaultSoftBodySolver___destroy___0= -h._emscripten_bind_btDefaultSoftBodySolver___destroy___0,wj=d._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0=h._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0,xj=d._emscripten_bind_btDefaultVehicleRaycaster___destroy___0=h._emscripten_bind_btDefaultVehicleRaycaster___destroy___0,yj=d._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1=h._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1,zj=d._emscripten_bind_btDefaultVehicleRaycaster_castRay_3= -h._emscripten_bind_btDefaultVehicleRaycaster_castRay_3,Aj=d._emscripten_bind_btDiscreteDynamicsWorld___destroy___0=h._emscripten_bind_btDiscreteDynamicsWorld___destroy___0,Bj=d._emscripten_bind_btDiscreteDynamicsWorld_addAction_1=h._emscripten_bind_btDiscreteDynamicsWorld_addAction_1,Cj=d._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1=h._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1,Dj=d._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2=h._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2, -Ej=d._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3=h._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3,Fj=d._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1=h._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1,Gj=d._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2=h._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2,Hj=d._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1=h._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1,Ij=d._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3= -h._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3,Jj=d._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4=h._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4,Kj=d._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3=h._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3,Lj=d._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2=h._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2,Mj=d._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5= -h._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5,Nj=d._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3=h._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3,Oj=d._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0=h._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0,Pj=d._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0=h._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0,Qj=d._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0=h._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0, -Rj=d._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0=h._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0,Sj=d._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0=h._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0,Tj=d._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0=h._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0,Uj=d._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0=h._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0,Vj=d._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0= -h._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0,Wj=d._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3=h._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3,Xj=d._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1=h._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1,Yj=d._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1=h._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1,Zj=d._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1=h._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1, -ak=d._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1=h._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1,bk=d._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1=h._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1,ck=d._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1=h._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1,dk=d._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1=h._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1,ek=d._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2= -h._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2,fk=d._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3=h._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3,gk=d._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1=h._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1,hk=d._emscripten_bind_btDispatcherInfo___destroy___0=h._emscripten_bind_btDispatcherInfo___destroy___0,ik=d._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0=h._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0, -jk=d._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0=h._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0,kk=d._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0=h._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0,lk=d._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0=h._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0,mk=d._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0=h._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0, -nk=d._emscripten_bind_btDispatcherInfo_get_m_stepCount_0=h._emscripten_bind_btDispatcherInfo_get_m_stepCount_0,ok=d._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0=h._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0,pk=d._emscripten_bind_btDispatcherInfo_get_m_timeStep_0=h._emscripten_bind_btDispatcherInfo_get_m_timeStep_0,qk=d._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0=h._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0,rk=d._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0= -h._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0,sk=d._emscripten_bind_btDispatcherInfo_get_m_useEpa_0=h._emscripten_bind_btDispatcherInfo_get_m_useEpa_0,tk=d._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1=h._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1,uk=d._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1=h._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1,vk=d._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1= -h._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1,wk=d._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1=h._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1,xk=d._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1=h._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1,yk=d._emscripten_bind_btDispatcherInfo_set_m_stepCount_1=h._emscripten_bind_btDispatcherInfo_set_m_stepCount_1,zk=d._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1=h._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1, -Ak=d._emscripten_bind_btDispatcherInfo_set_m_timeStep_1=h._emscripten_bind_btDispatcherInfo_set_m_timeStep_1,Bk=d._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1=h._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1,Ck=d._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1=h._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1,Dk=d._emscripten_bind_btDispatcherInfo_set_m_useEpa_1=h._emscripten_bind_btDispatcherInfo_set_m_useEpa_1,Ek=d._emscripten_bind_btDispatcher___destroy___0= -h._emscripten_bind_btDispatcher___destroy___0,Fk=d._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1=h._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1,Gk=d._emscripten_bind_btDispatcher_getNumManifolds_0=h._emscripten_bind_btDispatcher_getNumManifolds_0,Hk=d._emscripten_bind_btDynamicsWorld___destroy___0=h._emscripten_bind_btDynamicsWorld___destroy___0,Ik=d._emscripten_bind_btDynamicsWorld_addAction_1=h._emscripten_bind_btDynamicsWorld_addAction_1,Jk=d._emscripten_bind_btDynamicsWorld_addCollisionObject_1= -h._emscripten_bind_btDynamicsWorld_addCollisionObject_1,Kk=d._emscripten_bind_btDynamicsWorld_addCollisionObject_2=h._emscripten_bind_btDynamicsWorld_addCollisionObject_2,Lk=d._emscripten_bind_btDynamicsWorld_addCollisionObject_3=h._emscripten_bind_btDynamicsWorld_addCollisionObject_3,Mk=d._emscripten_bind_btDynamicsWorld_contactPairTest_3=h._emscripten_bind_btDynamicsWorld_contactPairTest_3,Nk=d._emscripten_bind_btDynamicsWorld_contactTest_2=h._emscripten_bind_btDynamicsWorld_contactTest_2,Ok=d._emscripten_bind_btDynamicsWorld_convexSweepTest_5= -h._emscripten_bind_btDynamicsWorld_convexSweepTest_5,Pk=d._emscripten_bind_btDynamicsWorld_debugDrawObject_3=h._emscripten_bind_btDynamicsWorld_debugDrawObject_3,Qk=d._emscripten_bind_btDynamicsWorld_debugDrawWorld_0=h._emscripten_bind_btDynamicsWorld_debugDrawWorld_0,Rk=d._emscripten_bind_btDynamicsWorld_getBroadphase_0=h._emscripten_bind_btDynamicsWorld_getBroadphase_0,Sk=d._emscripten_bind_btDynamicsWorld_getDebugDrawer_0=h._emscripten_bind_btDynamicsWorld_getDebugDrawer_0,Tk=d._emscripten_bind_btDynamicsWorld_getDispatchInfo_0= -h._emscripten_bind_btDynamicsWorld_getDispatchInfo_0,Uk=d._emscripten_bind_btDynamicsWorld_getDispatcher_0=h._emscripten_bind_btDynamicsWorld_getDispatcher_0,Vk=d._emscripten_bind_btDynamicsWorld_getPairCache_0=h._emscripten_bind_btDynamicsWorld_getPairCache_0,Wk=d._emscripten_bind_btDynamicsWorld_getSolverInfo_0=h._emscripten_bind_btDynamicsWorld_getSolverInfo_0,Xk=d._emscripten_bind_btDynamicsWorld_rayTest_3=h._emscripten_bind_btDynamicsWorld_rayTest_3,Yk=d._emscripten_bind_btDynamicsWorld_removeAction_1= -h._emscripten_bind_btDynamicsWorld_removeAction_1,Zk=d._emscripten_bind_btDynamicsWorld_removeCollisionObject_1=h._emscripten_bind_btDynamicsWorld_removeCollisionObject_1,$k=d._emscripten_bind_btDynamicsWorld_setDebugDrawer_1=h._emscripten_bind_btDynamicsWorld_setDebugDrawer_1,al=d._emscripten_bind_btDynamicsWorld_updateSingleAabb_1=h._emscripten_bind_btDynamicsWorld_updateSingleAabb_1,bl=d._emscripten_bind_btFaceArray___destroy___0=h._emscripten_bind_btFaceArray___destroy___0,cl=d._emscripten_bind_btFaceArray_at_1= -h._emscripten_bind_btFaceArray_at_1,dl=d._emscripten_bind_btFaceArray_size_0=h._emscripten_bind_btFaceArray_size_0,el=d._emscripten_bind_btFace___destroy___0=h._emscripten_bind_btFace___destroy___0,fl=d._emscripten_bind_btFace_get_m_indices_0=h._emscripten_bind_btFace_get_m_indices_0,gl=d._emscripten_bind_btFace_get_m_plane_1=h._emscripten_bind_btFace_get_m_plane_1,hl=d._emscripten_bind_btFace_set_m_indices_1=h._emscripten_bind_btFace_set_m_indices_1,il=d._emscripten_bind_btFace_set_m_plane_2=h._emscripten_bind_btFace_set_m_plane_2, -jl=d._emscripten_bind_btFixedConstraint___destroy___0=h._emscripten_bind_btFixedConstraint___destroy___0,kl=d._emscripten_bind_btFixedConstraint_btFixedConstraint_4=h._emscripten_bind_btFixedConstraint_btFixedConstraint_4,ll=d._emscripten_bind_btFixedConstraint_enableFeedback_1=h._emscripten_bind_btFixedConstraint_enableFeedback_1,ml=d._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0,nl=d._emscripten_bind_btFixedConstraint_getParam_2= -h._emscripten_bind_btFixedConstraint_getParam_2,ol=d._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1,pl=d._emscripten_bind_btFixedConstraint_setParam_3=h._emscripten_bind_btFixedConstraint_setParam_3,ql=d._emscripten_bind_btGeneric6DofConstraint___destroy___0=h._emscripten_bind_btGeneric6DofConstraint___destroy___0,rl=d._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3=h._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3, -sl=d._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5=h._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5,tl=d._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1=h._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1,ul=d._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0,vl=d._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0=h._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0, -wl=d._emscripten_bind_btGeneric6DofConstraint_getParam_2=h._emscripten_bind_btGeneric6DofConstraint_getParam_2,xl=d._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1=h._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1,yl=d._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1=h._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1,zl=d._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1, -Al=d._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1=h._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1,Bl=d._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1=h._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1,Cl=d._emscripten_bind_btGeneric6DofConstraint_setParam_3=h._emscripten_bind_btGeneric6DofConstraint_setParam_3,Dl=d._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0=h._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0, -El=d._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3=h._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3,Fl=d._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5=h._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5,Gl=d._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1=h._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1,Hl=d._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2= -h._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2,Il=d._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0,Jl=d._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0=h._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0,Kl=d._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2=h._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2,Ll=d._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1= -h._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1,Ml=d._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1=h._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1,Nl=d._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1,Ol=d._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2=h._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2, -Pl=d._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1=h._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1,Ql=d._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1=h._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1,Rl=d._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3=h._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3,Sl=d._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2=h._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2, -Tl=d._emscripten_bind_btGhostObject___destroy___0=h._emscripten_bind_btGhostObject___destroy___0,Ul=d._emscripten_bind_btGhostObject_activate_0=h._emscripten_bind_btGhostObject_activate_0,Vl=d._emscripten_bind_btGhostObject_activate_1=h._emscripten_bind_btGhostObject_activate_1,Wl=d._emscripten_bind_btGhostObject_btGhostObject_0=h._emscripten_bind_btGhostObject_btGhostObject_0,Xl=d._emscripten_bind_btGhostObject_forceActivationState_1=h._emscripten_bind_btGhostObject_forceActivationState_1,Yl=d._emscripten_bind_btGhostObject_getCollisionFlags_0= -h._emscripten_bind_btGhostObject_getCollisionFlags_0,Zl=d._emscripten_bind_btGhostObject_getCollisionShape_0=h._emscripten_bind_btGhostObject_getCollisionShape_0,$l=d._emscripten_bind_btGhostObject_getNumOverlappingObjects_0=h._emscripten_bind_btGhostObject_getNumOverlappingObjects_0,am=d._emscripten_bind_btGhostObject_getOverlappingObject_1=h._emscripten_bind_btGhostObject_getOverlappingObject_1,bm=d._emscripten_bind_btGhostObject_getUserIndex_0=h._emscripten_bind_btGhostObject_getUserIndex_0,cm= -d._emscripten_bind_btGhostObject_getUserPointer_0=h._emscripten_bind_btGhostObject_getUserPointer_0,dm=d._emscripten_bind_btGhostObject_getWorldTransform_0=h._emscripten_bind_btGhostObject_getWorldTransform_0,em=d._emscripten_bind_btGhostObject_isActive_0=h._emscripten_bind_btGhostObject_isActive_0,fm=d._emscripten_bind_btGhostObject_isKinematicObject_0=h._emscripten_bind_btGhostObject_isKinematicObject_0,gm=d._emscripten_bind_btGhostObject_isStaticObject_0=h._emscripten_bind_btGhostObject_isStaticObject_0, -hm=d._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0=h._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0,im=d._emscripten_bind_btGhostObject_setActivationState_1=h._emscripten_bind_btGhostObject_setActivationState_1,jm=d._emscripten_bind_btGhostObject_setAnisotropicFriction_2=h._emscripten_bind_btGhostObject_setAnisotropicFriction_2,km=d._emscripten_bind_btGhostObject_setCcdMotionThreshold_1=h._emscripten_bind_btGhostObject_setCcdMotionThreshold_1,lm=d._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1= -h._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1,mm=d._emscripten_bind_btGhostObject_setCollisionFlags_1=h._emscripten_bind_btGhostObject_setCollisionFlags_1,nm=d._emscripten_bind_btGhostObject_setCollisionShape_1=h._emscripten_bind_btGhostObject_setCollisionShape_1,om=d._emscripten_bind_btGhostObject_setContactProcessingThreshold_1=h._emscripten_bind_btGhostObject_setContactProcessingThreshold_1,pm=d._emscripten_bind_btGhostObject_setFriction_1=h._emscripten_bind_btGhostObject_setFriction_1, -qm=d._emscripten_bind_btGhostObject_setRestitution_1=h._emscripten_bind_btGhostObject_setRestitution_1,rm=d._emscripten_bind_btGhostObject_setRollingFriction_1=h._emscripten_bind_btGhostObject_setRollingFriction_1,sm=d._emscripten_bind_btGhostObject_setUserIndex_1=h._emscripten_bind_btGhostObject_setUserIndex_1,tm=d._emscripten_bind_btGhostObject_setUserPointer_1=h._emscripten_bind_btGhostObject_setUserPointer_1,um=d._emscripten_bind_btGhostObject_setWorldTransform_1=h._emscripten_bind_btGhostObject_setWorldTransform_1, -wm=d._emscripten_bind_btGhostPairCallback___destroy___0=h._emscripten_bind_btGhostPairCallback___destroy___0,xm=d._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0=h._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0,ym=d._emscripten_bind_btHeightfieldTerrainShape___destroy___0=h._emscripten_bind_btHeightfieldTerrainShape___destroy___0,zm=d._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9=h._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9, -Am=d._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2=h._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2,Bm=d._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0=h._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0,Cm=d._emscripten_bind_btHeightfieldTerrainShape_getMargin_0=h._emscripten_bind_btHeightfieldTerrainShape_getMargin_0,Dm=d._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1=h._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1, -Em=d._emscripten_bind_btHeightfieldTerrainShape_setMargin_1=h._emscripten_bind_btHeightfieldTerrainShape_setMargin_1,Fm=d._emscripten_bind_btHingeConstraint___destroy___0=h._emscripten_bind_btHingeConstraint___destroy___0,Gm=d._emscripten_bind_btHingeConstraint_btHingeConstraint_2=h._emscripten_bind_btHingeConstraint_btHingeConstraint_2,Hm=d._emscripten_bind_btHingeConstraint_btHingeConstraint_3=h._emscripten_bind_btHingeConstraint_btHingeConstraint_3,Im=d._emscripten_bind_btHingeConstraint_btHingeConstraint_4= -h._emscripten_bind_btHingeConstraint_btHingeConstraint_4,Jm=d._emscripten_bind_btHingeConstraint_btHingeConstraint_5=h._emscripten_bind_btHingeConstraint_btHingeConstraint_5,Km=d._emscripten_bind_btHingeConstraint_btHingeConstraint_6=h._emscripten_bind_btHingeConstraint_btHingeConstraint_6,Lm=d._emscripten_bind_btHingeConstraint_btHingeConstraint_7=h._emscripten_bind_btHingeConstraint_btHingeConstraint_7,Mm=d._emscripten_bind_btHingeConstraint_enableAngularMotor_3=h._emscripten_bind_btHingeConstraint_enableAngularMotor_3, -Nm=d._emscripten_bind_btHingeConstraint_enableFeedback_1=h._emscripten_bind_btHingeConstraint_enableFeedback_1,Om=d._emscripten_bind_btHingeConstraint_enableMotor_1=h._emscripten_bind_btHingeConstraint_enableMotor_1,Pm=d._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0,Qm=d._emscripten_bind_btHingeConstraint_getParam_2=h._emscripten_bind_btHingeConstraint_getParam_2,Rm=d._emscripten_bind_btHingeConstraint_setAngularOnly_1= -h._emscripten_bind_btHingeConstraint_setAngularOnly_1,Sm=d._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1,Tm=d._emscripten_bind_btHingeConstraint_setLimit_4=h._emscripten_bind_btHingeConstraint_setLimit_4,Um=d._emscripten_bind_btHingeConstraint_setLimit_5=h._emscripten_bind_btHingeConstraint_setLimit_5,Vm=d._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1=h._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1, -Wm=d._emscripten_bind_btHingeConstraint_setMotorTarget_2=h._emscripten_bind_btHingeConstraint_setMotorTarget_2,Xm=d._emscripten_bind_btHingeConstraint_setParam_3=h._emscripten_bind_btHingeConstraint_setParam_3,Ym=d._emscripten_bind_btIDebugDraw___destroy___0=h._emscripten_bind_btIDebugDraw___destroy___0,Zm=d._emscripten_bind_btIDebugDraw_draw3dText_2=h._emscripten_bind_btIDebugDraw_draw3dText_2,$m=d._emscripten_bind_btIDebugDraw_drawContactPoint_5=h._emscripten_bind_btIDebugDraw_drawContactPoint_5, -an=d._emscripten_bind_btIDebugDraw_drawLine_3=h._emscripten_bind_btIDebugDraw_drawLine_3,bn=d._emscripten_bind_btIDebugDraw_getDebugMode_0=h._emscripten_bind_btIDebugDraw_getDebugMode_0,cn=d._emscripten_bind_btIDebugDraw_reportErrorWarning_1=h._emscripten_bind_btIDebugDraw_reportErrorWarning_1,dn=d._emscripten_bind_btIDebugDraw_setDebugMode_1=h._emscripten_bind_btIDebugDraw_setDebugMode_1,en=d._emscripten_bind_btIntArray___destroy___0=h._emscripten_bind_btIntArray___destroy___0,fn=d._emscripten_bind_btIntArray_at_1= -h._emscripten_bind_btIntArray_at_1,gn=d._emscripten_bind_btIntArray_size_0=h._emscripten_bind_btIntArray_size_0,hn=d._emscripten_bind_btKinematicCharacterController___destroy___0=h._emscripten_bind_btKinematicCharacterController___destroy___0,jn=d._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3=h._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3,kn=d._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4=h._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4, -ln=d._emscripten_bind_btKinematicCharacterController_canJump_0=h._emscripten_bind_btKinematicCharacterController_canJump_0,mn=d._emscripten_bind_btKinematicCharacterController_getGhostObject_0=h._emscripten_bind_btKinematicCharacterController_getGhostObject_0,nn=d._emscripten_bind_btKinematicCharacterController_getGravity_0=h._emscripten_bind_btKinematicCharacterController_getGravity_0,on=d._emscripten_bind_btKinematicCharacterController_getMaxSlope_0=h._emscripten_bind_btKinematicCharacterController_getMaxSlope_0, -pn=d._emscripten_bind_btKinematicCharacterController_jump_0=h._emscripten_bind_btKinematicCharacterController_jump_0,qn=d._emscripten_bind_btKinematicCharacterController_onGround_0=h._emscripten_bind_btKinematicCharacterController_onGround_0,rn=d._emscripten_bind_btKinematicCharacterController_playerStep_2=h._emscripten_bind_btKinematicCharacterController_playerStep_2,sn=d._emscripten_bind_btKinematicCharacterController_preStep_1=h._emscripten_bind_btKinematicCharacterController_preStep_1,tn=d._emscripten_bind_btKinematicCharacterController_setFallSpeed_1= -h._emscripten_bind_btKinematicCharacterController_setFallSpeed_1,un=d._emscripten_bind_btKinematicCharacterController_setGravity_1=h._emscripten_bind_btKinematicCharacterController_setGravity_1,vn=d._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1=h._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1,wn=d._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1=h._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1,xn=d._emscripten_bind_btKinematicCharacterController_setMaxSlope_1= -h._emscripten_bind_btKinematicCharacterController_setMaxSlope_1,yn=d._emscripten_bind_btKinematicCharacterController_setUpAxis_1=h._emscripten_bind_btKinematicCharacterController_setUpAxis_1,zn=d._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1=h._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1,An=d._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1=h._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1,Bn=d._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2= -h._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2,Cn=d._emscripten_bind_btKinematicCharacterController_setWalkDirection_1=h._emscripten_bind_btKinematicCharacterController_setWalkDirection_1,Dn=d._emscripten_bind_btKinematicCharacterController_updateAction_2=h._emscripten_bind_btKinematicCharacterController_updateAction_2,En=d._emscripten_bind_btKinematicCharacterController_warp_1=h._emscripten_bind_btKinematicCharacterController_warp_1,Fn=d._emscripten_bind_btManifoldPoint___destroy___0= -h._emscripten_bind_btManifoldPoint___destroy___0,Gn=d._emscripten_bind_btManifoldPoint_getAppliedImpulse_0=h._emscripten_bind_btManifoldPoint_getAppliedImpulse_0,Hn=d._emscripten_bind_btManifoldPoint_getDistance_0=h._emscripten_bind_btManifoldPoint_getDistance_0,In=d._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0=h._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0,Jn=d._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0=h._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0,Kn=d._emscripten_bind_btManifoldPoint_get_m_localPointA_0= -h._emscripten_bind_btManifoldPoint_get_m_localPointA_0,Ln=d._emscripten_bind_btManifoldPoint_get_m_localPointB_0=h._emscripten_bind_btManifoldPoint_get_m_localPointB_0,Mn=d._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0=h._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0,Nn=d._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0=h._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0,On=d._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0=h._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0, -Pn=d._emscripten_bind_btManifoldPoint_set_m_localPointA_1=h._emscripten_bind_btManifoldPoint_set_m_localPointA_1,Qn=d._emscripten_bind_btManifoldPoint_set_m_localPointB_1=h._emscripten_bind_btManifoldPoint_set_m_localPointB_1,Rn=d._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1=h._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1,Sn=d._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1=h._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1,Tn=d._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1= -h._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1,Un=d._emscripten_bind_btMatrix3x3___destroy___0=h._emscripten_bind_btMatrix3x3___destroy___0,Vn=d._emscripten_bind_btMatrix3x3_getRotation_1=h._emscripten_bind_btMatrix3x3_getRotation_1,Wn=d._emscripten_bind_btMatrix3x3_getRow_1=h._emscripten_bind_btMatrix3x3_getRow_1,Xn=d._emscripten_bind_btMatrix3x3_setEulerZYX_3=h._emscripten_bind_btMatrix3x3_setEulerZYX_3,Yn=d._emscripten_bind_btMotionState___destroy___0=h._emscripten_bind_btMotionState___destroy___0, -Zn=d._emscripten_bind_btMotionState_getWorldTransform_1=h._emscripten_bind_btMotionState_getWorldTransform_1,$n=d._emscripten_bind_btMotionState_setWorldTransform_1=h._emscripten_bind_btMotionState_setWorldTransform_1,ao=d._emscripten_bind_btOverlappingPairCache___destroy___0=h._emscripten_bind_btOverlappingPairCache___destroy___0,bo=d._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1=h._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1,co=d._emscripten_bind_btOverlappingPairCallback___destroy___0= -h._emscripten_bind_btOverlappingPairCallback___destroy___0,eo=d._emscripten_bind_btPairCachingGhostObject___destroy___0=h._emscripten_bind_btPairCachingGhostObject___destroy___0,fo=d._emscripten_bind_btPairCachingGhostObject_activate_0=h._emscripten_bind_btPairCachingGhostObject_activate_0,go=d._emscripten_bind_btPairCachingGhostObject_activate_1=h._emscripten_bind_btPairCachingGhostObject_activate_1,ho=d._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0=h._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0, -io=d._emscripten_bind_btPairCachingGhostObject_forceActivationState_1=h._emscripten_bind_btPairCachingGhostObject_forceActivationState_1,jo=d._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0=h._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0,ko=d._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0=h._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0,lo=d._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0=h._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0, -mo=d._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1=h._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1,no=d._emscripten_bind_btPairCachingGhostObject_getUserIndex_0=h._emscripten_bind_btPairCachingGhostObject_getUserIndex_0,oo=d._emscripten_bind_btPairCachingGhostObject_getUserPointer_0=h._emscripten_bind_btPairCachingGhostObject_getUserPointer_0,po=d._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0=h._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0, -qo=d._emscripten_bind_btPairCachingGhostObject_isActive_0=h._emscripten_bind_btPairCachingGhostObject_isActive_0,ro=d._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0=h._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0,so=d._emscripten_bind_btPairCachingGhostObject_isStaticObject_0=h._emscripten_bind_btPairCachingGhostObject_isStaticObject_0,to=d._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0=h._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0, -uo=d._emscripten_bind_btPairCachingGhostObject_setActivationState_1=h._emscripten_bind_btPairCachingGhostObject_setActivationState_1,vo=d._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2=h._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2,wo=d._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1=h._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1,xo=d._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1=h._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1, -yo=d._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1=h._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1,zo=d._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1=h._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1,Ao=d._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1=h._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1,Bo=d._emscripten_bind_btPairCachingGhostObject_setFriction_1=h._emscripten_bind_btPairCachingGhostObject_setFriction_1, -Co=d._emscripten_bind_btPairCachingGhostObject_setRestitution_1=h._emscripten_bind_btPairCachingGhostObject_setRestitution_1,Do=d._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1=h._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1,Eo=d._emscripten_bind_btPairCachingGhostObject_setUserIndex_1=h._emscripten_bind_btPairCachingGhostObject_setUserIndex_1,Fo=d._emscripten_bind_btPairCachingGhostObject_setUserPointer_1=h._emscripten_bind_btPairCachingGhostObject_setUserPointer_1, -Go=d._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1=h._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1,Ho=d._emscripten_bind_btPersistentManifold___destroy___0=h._emscripten_bind_btPersistentManifold___destroy___0,Io=d._emscripten_bind_btPersistentManifold_btPersistentManifold_0=h._emscripten_bind_btPersistentManifold_btPersistentManifold_0,Jo=d._emscripten_bind_btPersistentManifold_getBody0_0=h._emscripten_bind_btPersistentManifold_getBody0_0,Ko=d._emscripten_bind_btPersistentManifold_getBody1_0= -h._emscripten_bind_btPersistentManifold_getBody1_0,Lo=d._emscripten_bind_btPersistentManifold_getContactPoint_1=h._emscripten_bind_btPersistentManifold_getContactPoint_1,Mo=d._emscripten_bind_btPersistentManifold_getNumContacts_0=h._emscripten_bind_btPersistentManifold_getNumContacts_0,No=d._emscripten_bind_btPoint2PointConstraint___destroy___0=h._emscripten_bind_btPoint2PointConstraint___destroy___0,Oo=d._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2=h._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2, -Po=d._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4=h._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4,Qo=d._emscripten_bind_btPoint2PointConstraint_enableFeedback_1=h._emscripten_bind_btPoint2PointConstraint_enableFeedback_1,Ro=d._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0,So=d._emscripten_bind_btPoint2PointConstraint_getParam_2=h._emscripten_bind_btPoint2PointConstraint_getParam_2, -To=d._emscripten_bind_btPoint2PointConstraint_getPivotInA_0=h._emscripten_bind_btPoint2PointConstraint_getPivotInA_0,Uo=d._emscripten_bind_btPoint2PointConstraint_getPivotInB_0=h._emscripten_bind_btPoint2PointConstraint_getPivotInB_0,Vo=d._emscripten_bind_btPoint2PointConstraint_get_m_setting_0=h._emscripten_bind_btPoint2PointConstraint_get_m_setting_0,Wo=d._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1, -Xo=d._emscripten_bind_btPoint2PointConstraint_setParam_3=h._emscripten_bind_btPoint2PointConstraint_setParam_3,Yo=d._emscripten_bind_btPoint2PointConstraint_setPivotA_1=h._emscripten_bind_btPoint2PointConstraint_setPivotA_1,Zo=d._emscripten_bind_btPoint2PointConstraint_setPivotB_1=h._emscripten_bind_btPoint2PointConstraint_setPivotB_1,$o=d._emscripten_bind_btPoint2PointConstraint_set_m_setting_1=h._emscripten_bind_btPoint2PointConstraint_set_m_setting_1,ap=d._emscripten_bind_btQuadWord___destroy___0= -h._emscripten_bind_btQuadWord___destroy___0,bp=d._emscripten_bind_btQuadWord_setW_1=h._emscripten_bind_btQuadWord_setW_1,cp=d._emscripten_bind_btQuadWord_setX_1=h._emscripten_bind_btQuadWord_setX_1,dp=d._emscripten_bind_btQuadWord_setY_1=h._emscripten_bind_btQuadWord_setY_1,ep=d._emscripten_bind_btQuadWord_setZ_1=h._emscripten_bind_btQuadWord_setZ_1,fp=d._emscripten_bind_btQuadWord_w_0=h._emscripten_bind_btQuadWord_w_0,gp=d._emscripten_bind_btQuadWord_x_0=h._emscripten_bind_btQuadWord_x_0,hp=d._emscripten_bind_btQuadWord_y_0= -h._emscripten_bind_btQuadWord_y_0,ip=d._emscripten_bind_btQuadWord_z_0=h._emscripten_bind_btQuadWord_z_0,jp=d._emscripten_bind_btQuaternion___destroy___0=h._emscripten_bind_btQuaternion___destroy___0,kp=d._emscripten_bind_btQuaternion_angleShortestPath_1=h._emscripten_bind_btQuaternion_angleShortestPath_1,lp=d._emscripten_bind_btQuaternion_angle_1=h._emscripten_bind_btQuaternion_angle_1,mp=d._emscripten_bind_btQuaternion_btQuaternion_4=h._emscripten_bind_btQuaternion_btQuaternion_4,np=d._emscripten_bind_btQuaternion_dot_1= -h._emscripten_bind_btQuaternion_dot_1,op=d._emscripten_bind_btQuaternion_getAngleShortestPath_0=h._emscripten_bind_btQuaternion_getAngleShortestPath_0,pp=d._emscripten_bind_btQuaternion_getAngle_0=h._emscripten_bind_btQuaternion_getAngle_0,qp=d._emscripten_bind_btQuaternion_getAxis_0=h._emscripten_bind_btQuaternion_getAxis_0,rp=d._emscripten_bind_btQuaternion_inverse_0=h._emscripten_bind_btQuaternion_inverse_0,sp=d._emscripten_bind_btQuaternion_length2_0=h._emscripten_bind_btQuaternion_length2_0, -tp=d._emscripten_bind_btQuaternion_length_0=h._emscripten_bind_btQuaternion_length_0,up=d._emscripten_bind_btQuaternion_normalize_0=h._emscripten_bind_btQuaternion_normalize_0,vp=d._emscripten_bind_btQuaternion_normalized_0=h._emscripten_bind_btQuaternion_normalized_0,wp=d._emscripten_bind_btQuaternion_op_add_1=h._emscripten_bind_btQuaternion_op_add_1,xp=d._emscripten_bind_btQuaternion_op_div_1=h._emscripten_bind_btQuaternion_op_div_1,yp=d._emscripten_bind_btQuaternion_op_mul_1=h._emscripten_bind_btQuaternion_op_mul_1, -zp=d._emscripten_bind_btQuaternion_op_mulq_1=h._emscripten_bind_btQuaternion_op_mulq_1,Ap=d._emscripten_bind_btQuaternion_op_sub_1=h._emscripten_bind_btQuaternion_op_sub_1,Bp=d._emscripten_bind_btQuaternion_setEulerZYX_3=h._emscripten_bind_btQuaternion_setEulerZYX_3,Cp=d._emscripten_bind_btQuaternion_setRotation_2=h._emscripten_bind_btQuaternion_setRotation_2,Dp=d._emscripten_bind_btQuaternion_setValue_4=h._emscripten_bind_btQuaternion_setValue_4,Ep=d._emscripten_bind_btQuaternion_setW_1=h._emscripten_bind_btQuaternion_setW_1, -Fp=d._emscripten_bind_btQuaternion_setX_1=h._emscripten_bind_btQuaternion_setX_1,Gp=d._emscripten_bind_btQuaternion_setY_1=h._emscripten_bind_btQuaternion_setY_1,Hp=d._emscripten_bind_btQuaternion_setZ_1=h._emscripten_bind_btQuaternion_setZ_1,Ip=d._emscripten_bind_btQuaternion_w_0=h._emscripten_bind_btQuaternion_w_0,Jp=d._emscripten_bind_btQuaternion_x_0=h._emscripten_bind_btQuaternion_x_0,Kp=d._emscripten_bind_btQuaternion_y_0=h._emscripten_bind_btQuaternion_y_0,Lp=d._emscripten_bind_btQuaternion_z_0= -h._emscripten_bind_btQuaternion_z_0,Mp=d._emscripten_bind_btRaycastVehicle___destroy___0=h._emscripten_bind_btRaycastVehicle___destroy___0,Np=d._emscripten_bind_btRaycastVehicle_addWheel_7=h._emscripten_bind_btRaycastVehicle_addWheel_7,Op=d._emscripten_bind_btRaycastVehicle_applyEngineForce_2=h._emscripten_bind_btRaycastVehicle_applyEngineForce_2,Pp=d._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3=h._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3,Qp=d._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0= -h._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0,Rp=d._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0=h._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0,Sp=d._emscripten_bind_btRaycastVehicle_getForwardAxis_0=h._emscripten_bind_btRaycastVehicle_getForwardAxis_0,Tp=d._emscripten_bind_btRaycastVehicle_getForwardVector_0=h._emscripten_bind_btRaycastVehicle_getForwardVector_0,Up=d._emscripten_bind_btRaycastVehicle_getNumWheels_0=h._emscripten_bind_btRaycastVehicle_getNumWheels_0, -Vp=d._emscripten_bind_btRaycastVehicle_getRightAxis_0=h._emscripten_bind_btRaycastVehicle_getRightAxis_0,Wp=d._emscripten_bind_btRaycastVehicle_getRigidBody_0=h._emscripten_bind_btRaycastVehicle_getRigidBody_0,Xp=d._emscripten_bind_btRaycastVehicle_getSteeringValue_1=h._emscripten_bind_btRaycastVehicle_getSteeringValue_1,Yp=d._emscripten_bind_btRaycastVehicle_getUpAxis_0=h._emscripten_bind_btRaycastVehicle_getUpAxis_0,Zp=d._emscripten_bind_btRaycastVehicle_getUserConstraintId_0=h._emscripten_bind_btRaycastVehicle_getUserConstraintId_0, -$p=d._emscripten_bind_btRaycastVehicle_getUserConstraintType_0=h._emscripten_bind_btRaycastVehicle_getUserConstraintType_0,aq=d._emscripten_bind_btRaycastVehicle_getWheelInfo_1=h._emscripten_bind_btRaycastVehicle_getWheelInfo_1,bq=d._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1=h._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1,cq=d._emscripten_bind_btRaycastVehicle_rayCast_1=h._emscripten_bind_btRaycastVehicle_rayCast_1,dq=d._emscripten_bind_btRaycastVehicle_resetSuspension_0=h._emscripten_bind_btRaycastVehicle_resetSuspension_0, -eq=d._emscripten_bind_btRaycastVehicle_setBrake_2=h._emscripten_bind_btRaycastVehicle_setBrake_2,fq=d._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3=h._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3,gq=d._emscripten_bind_btRaycastVehicle_setPitchControl_1=h._emscripten_bind_btRaycastVehicle_setPitchControl_1,hq=d._emscripten_bind_btRaycastVehicle_setSteeringValue_2=h._emscripten_bind_btRaycastVehicle_setSteeringValue_2,iq=d._emscripten_bind_btRaycastVehicle_setUserConstraintId_1= -h._emscripten_bind_btRaycastVehicle_setUserConstraintId_1,jq=d._emscripten_bind_btRaycastVehicle_setUserConstraintType_1=h._emscripten_bind_btRaycastVehicle_setUserConstraintType_1,kq=d._emscripten_bind_btRaycastVehicle_updateAction_2=h._emscripten_bind_btRaycastVehicle_updateAction_2,lq=d._emscripten_bind_btRaycastVehicle_updateFriction_1=h._emscripten_bind_btRaycastVehicle_updateFriction_1,mq=d._emscripten_bind_btRaycastVehicle_updateSuspension_1=h._emscripten_bind_btRaycastVehicle_updateSuspension_1, -nq=d._emscripten_bind_btRaycastVehicle_updateVehicle_1=h._emscripten_bind_btRaycastVehicle_updateVehicle_1,oq=d._emscripten_bind_btRaycastVehicle_updateWheelTransform_2=h._emscripten_bind_btRaycastVehicle_updateWheelTransform_2,pq=d._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1=h._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1,qq=d._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2=h._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2,rq=d._emscripten_bind_btRigidBodyConstructionInfo___destroy___0= -h._emscripten_bind_btRigidBodyConstructionInfo___destroy___0,sq=d._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3=h._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3,tq=d._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4=h._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4,uq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0, -vq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0,wq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0,xq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0,yq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0= -h._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0,zq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0,Aq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0,Bq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0, -Cq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0,Dq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0,Eq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0=h._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0,Fq=d._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0= -h._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0,Gq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1,Hq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1,Iq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1= -h._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1,Jq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1,Kq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1,Lq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1, -Mq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1,Nq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1,Oq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1,Pq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1= -h._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1,Qq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1,Rq=d._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1=h._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1,Sq=d._emscripten_bind_btRigidBody___destroy___0=h._emscripten_bind_btRigidBody___destroy___0,Tq=d._emscripten_bind_btRigidBody_activate_0=h._emscripten_bind_btRigidBody_activate_0, -Uq=d._emscripten_bind_btRigidBody_activate_1=h._emscripten_bind_btRigidBody_activate_1,Vq=d._emscripten_bind_btRigidBody_applyCentralForce_1=h._emscripten_bind_btRigidBody_applyCentralForce_1,Wq=d._emscripten_bind_btRigidBody_applyCentralImpulse_1=h._emscripten_bind_btRigidBody_applyCentralImpulse_1,Xq=d._emscripten_bind_btRigidBody_applyCentralLocalForce_1=h._emscripten_bind_btRigidBody_applyCentralLocalForce_1,Yq=d._emscripten_bind_btRigidBody_applyForce_2=h._emscripten_bind_btRigidBody_applyForce_2, -Zq=d._emscripten_bind_btRigidBody_applyGravity_0=h._emscripten_bind_btRigidBody_applyGravity_0,$q=d._emscripten_bind_btRigidBody_applyImpulse_2=h._emscripten_bind_btRigidBody_applyImpulse_2,ar=d._emscripten_bind_btRigidBody_applyLocalTorque_1=h._emscripten_bind_btRigidBody_applyLocalTorque_1,br=d._emscripten_bind_btRigidBody_applyTorqueImpulse_1=h._emscripten_bind_btRigidBody_applyTorqueImpulse_1,cr=d._emscripten_bind_btRigidBody_applyTorque_1=h._emscripten_bind_btRigidBody_applyTorque_1,dr=d._emscripten_bind_btRigidBody_btRigidBody_1= -h._emscripten_bind_btRigidBody_btRigidBody_1,er=d._emscripten_bind_btRigidBody_forceActivationState_1=h._emscripten_bind_btRigidBody_forceActivationState_1,fr=d._emscripten_bind_btRigidBody_getAabb_2=h._emscripten_bind_btRigidBody_getAabb_2,gr=d._emscripten_bind_btRigidBody_getAngularVelocity_0=h._emscripten_bind_btRigidBody_getAngularVelocity_0,hr=d._emscripten_bind_btRigidBody_getBroadphaseProxy_0=h._emscripten_bind_btRigidBody_getBroadphaseProxy_0,ir=d._emscripten_bind_btRigidBody_getCenterOfMassTransform_0= -h._emscripten_bind_btRigidBody_getCenterOfMassTransform_0,jr=d._emscripten_bind_btRigidBody_getCollisionFlags_0=h._emscripten_bind_btRigidBody_getCollisionFlags_0,kr=d._emscripten_bind_btRigidBody_getCollisionShape_0=h._emscripten_bind_btRigidBody_getCollisionShape_0,lr=d._emscripten_bind_btRigidBody_getGravity_0=h._emscripten_bind_btRigidBody_getGravity_0,mr=d._emscripten_bind_btRigidBody_getLinearVelocity_0=h._emscripten_bind_btRigidBody_getLinearVelocity_0,nr=d._emscripten_bind_btRigidBody_getMotionState_0= -h._emscripten_bind_btRigidBody_getMotionState_0,or=d._emscripten_bind_btRigidBody_getUserIndex_0=h._emscripten_bind_btRigidBody_getUserIndex_0,pr=d._emscripten_bind_btRigidBody_getUserPointer_0=h._emscripten_bind_btRigidBody_getUserPointer_0,qr=d._emscripten_bind_btRigidBody_getWorldTransform_0=h._emscripten_bind_btRigidBody_getWorldTransform_0,rr=d._emscripten_bind_btRigidBody_isActive_0=h._emscripten_bind_btRigidBody_isActive_0,sr=d._emscripten_bind_btRigidBody_isKinematicObject_0=h._emscripten_bind_btRigidBody_isKinematicObject_0, -tr=d._emscripten_bind_btRigidBody_isStaticObject_0=h._emscripten_bind_btRigidBody_isStaticObject_0,ur=d._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0=h._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0,vr=d._emscripten_bind_btRigidBody_setActivationState_1=h._emscripten_bind_btRigidBody_setActivationState_1,wr=d._emscripten_bind_btRigidBody_setAngularFactor_1=h._emscripten_bind_btRigidBody_setAngularFactor_1,xr=d._emscripten_bind_btRigidBody_setAngularVelocity_1=h._emscripten_bind_btRigidBody_setAngularVelocity_1, -yr=d._emscripten_bind_btRigidBody_setAnisotropicFriction_2=h._emscripten_bind_btRigidBody_setAnisotropicFriction_2,zr=d._emscripten_bind_btRigidBody_setCcdMotionThreshold_1=h._emscripten_bind_btRigidBody_setCcdMotionThreshold_1,Ar=d._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1=h._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1,Br=d._emscripten_bind_btRigidBody_setCenterOfMassTransform_1=h._emscripten_bind_btRigidBody_setCenterOfMassTransform_1,Cr=d._emscripten_bind_btRigidBody_setCollisionFlags_1= -h._emscripten_bind_btRigidBody_setCollisionFlags_1,Dr=d._emscripten_bind_btRigidBody_setCollisionShape_1=h._emscripten_bind_btRigidBody_setCollisionShape_1,Er=d._emscripten_bind_btRigidBody_setContactProcessingThreshold_1=h._emscripten_bind_btRigidBody_setContactProcessingThreshold_1,Fr=d._emscripten_bind_btRigidBody_setDamping_2=h._emscripten_bind_btRigidBody_setDamping_2,Gr=d._emscripten_bind_btRigidBody_setFriction_1=h._emscripten_bind_btRigidBody_setFriction_1,Hr=d._emscripten_bind_btRigidBody_setGravity_1= -h._emscripten_bind_btRigidBody_setGravity_1,Ir=d._emscripten_bind_btRigidBody_setLinearFactor_1=h._emscripten_bind_btRigidBody_setLinearFactor_1,Jr=d._emscripten_bind_btRigidBody_setLinearVelocity_1=h._emscripten_bind_btRigidBody_setLinearVelocity_1,Kr=d._emscripten_bind_btRigidBody_setMassProps_2=h._emscripten_bind_btRigidBody_setMassProps_2,Lr=d._emscripten_bind_btRigidBody_setMotionState_1=h._emscripten_bind_btRigidBody_setMotionState_1,Mr=d._emscripten_bind_btRigidBody_setRestitution_1=h._emscripten_bind_btRigidBody_setRestitution_1, -Nr=d._emscripten_bind_btRigidBody_setRollingFriction_1=h._emscripten_bind_btRigidBody_setRollingFriction_1,Or=d._emscripten_bind_btRigidBody_setSleepingThresholds_2=h._emscripten_bind_btRigidBody_setSleepingThresholds_2,Pr=d._emscripten_bind_btRigidBody_setUserIndex_1=h._emscripten_bind_btRigidBody_setUserIndex_1,Qr=d._emscripten_bind_btRigidBody_setUserPointer_1=h._emscripten_bind_btRigidBody_setUserPointer_1,Rr=d._emscripten_bind_btRigidBody_setWorldTransform_1=h._emscripten_bind_btRigidBody_setWorldTransform_1, -Sr=d._emscripten_bind_btRigidBody_upcast_1=h._emscripten_bind_btRigidBody_upcast_1,Tr=d._emscripten_bind_btRigidBody_updateInertiaTensor_0=h._emscripten_bind_btRigidBody_updateInertiaTensor_0,Ur=d._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0=h._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0,Vr=d._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0=h._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0, -Wr=d._emscripten_bind_btShapeHull___destroy___0=h._emscripten_bind_btShapeHull___destroy___0,Xr=d._emscripten_bind_btShapeHull_btShapeHull_1=h._emscripten_bind_btShapeHull_btShapeHull_1,Yr=d._emscripten_bind_btShapeHull_buildHull_1=h._emscripten_bind_btShapeHull_buildHull_1,Zr=d._emscripten_bind_btShapeHull_getVertexPointer_0=h._emscripten_bind_btShapeHull_getVertexPointer_0,$r=d._emscripten_bind_btShapeHull_numVertices_0=h._emscripten_bind_btShapeHull_numVertices_0,as=d._emscripten_bind_btSliderConstraint___destroy___0= -h._emscripten_bind_btSliderConstraint___destroy___0,bs=d._emscripten_bind_btSliderConstraint_btSliderConstraint_3=h._emscripten_bind_btSliderConstraint_btSliderConstraint_3,cs=d._emscripten_bind_btSliderConstraint_btSliderConstraint_5=h._emscripten_bind_btSliderConstraint_btSliderConstraint_5,ds=d._emscripten_bind_btSliderConstraint_enableFeedback_1=h._emscripten_bind_btSliderConstraint_enableFeedback_1,es=d._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0, -gs=d._emscripten_bind_btSliderConstraint_getParam_2=h._emscripten_bind_btSliderConstraint_getParam_2,hs=d._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1,is=d._emscripten_bind_btSliderConstraint_setLowerAngLimit_1=h._emscripten_bind_btSliderConstraint_setLowerAngLimit_1,js=d._emscripten_bind_btSliderConstraint_setLowerLinLimit_1=h._emscripten_bind_btSliderConstraint_setLowerLinLimit_1,ks=d._emscripten_bind_btSliderConstraint_setParam_3= -h._emscripten_bind_btSliderConstraint_setParam_3,ls=d._emscripten_bind_btSliderConstraint_setUpperAngLimit_1=h._emscripten_bind_btSliderConstraint_setUpperAngLimit_1,ms=d._emscripten_bind_btSliderConstraint_setUpperLinLimit_1=h._emscripten_bind_btSliderConstraint_setUpperLinLimit_1,ns=d._emscripten_bind_btSoftBodyArray___destroy___0=h._emscripten_bind_btSoftBodyArray___destroy___0,ps=d._emscripten_bind_btSoftBodyArray_at_1=h._emscripten_bind_btSoftBodyArray_at_1,qs=d._emscripten_bind_btSoftBodyArray_size_0= -h._emscripten_bind_btSoftBodyArray_size_0,rs=d._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4=h._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4,ss=d._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4=h._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4,ts=d._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5=h._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5,us=d._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10=h._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10, -vs=d._emscripten_bind_btSoftBodyHelpers_CreatePatch_9=h._emscripten_bind_btSoftBodyHelpers_CreatePatch_9,xs=d._emscripten_bind_btSoftBodyHelpers_CreateRope_5=h._emscripten_bind_btSoftBodyHelpers_CreateRope_5,ys=d._emscripten_bind_btSoftBodyHelpers___destroy___0=h._emscripten_bind_btSoftBodyHelpers___destroy___0,zs=d._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0=h._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0,As=d._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0= -h._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0,Bs=d._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0=h._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0,Cs=d._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1=h._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1, -Ds=d._emscripten_bind_btSoftBodySolver___destroy___0=h._emscripten_bind_btSoftBodySolver___destroy___0,Es=d._emscripten_bind_btSoftBodyWorldInfo___destroy___0=h._emscripten_bind_btSoftBodyWorldInfo___destroy___0,Fs=d._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0=h._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0,Gs=d._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0=h._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0,Hs=d._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0= -h._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0,Is=d._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0=h._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0,Js=d._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0=h._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0,Ks=d._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0=h._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0,Ls=d._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0=h._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0, -Ms=d._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0=h._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0,Ns=d._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0=h._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0,Os=d._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1=h._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1,Ps=d._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1=h._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1,Qs=d._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1= -h._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1,Rs=d._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1=h._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1,Ss=d._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1=h._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1,Ts=d._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1=h._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1,Us=d._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1=h._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1, -Vs=d._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1=h._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1,Ws=d._emscripten_bind_btSoftBody___destroy___0=h._emscripten_bind_btSoftBody___destroy___0,Xs=d._emscripten_bind_btSoftBody_activate_0=h._emscripten_bind_btSoftBody_activate_0,Ys=d._emscripten_bind_btSoftBody_activate_1=h._emscripten_bind_btSoftBody_activate_1,Zs=d._emscripten_bind_btSoftBody_addAeroForceToNode_2=h._emscripten_bind_btSoftBody_addAeroForceToNode_2,$s=d._emscripten_bind_btSoftBody_addForce_1= -h._emscripten_bind_btSoftBody_addForce_1,at=d._emscripten_bind_btSoftBody_addForce_2=h._emscripten_bind_btSoftBody_addForce_2,bt=d._emscripten_bind_btSoftBody_appendAnchor_4=h._emscripten_bind_btSoftBody_appendAnchor_4,ct=d._emscripten_bind_btSoftBody_appendFace_4=h._emscripten_bind_btSoftBody_appendFace_4,dt=d._emscripten_bind_btSoftBody_appendLink_4=h._emscripten_bind_btSoftBody_appendLink_4,et=d._emscripten_bind_btSoftBody_appendMaterial_0=h._emscripten_bind_btSoftBody_appendMaterial_0,ft=d._emscripten_bind_btSoftBody_appendNode_2= -h._emscripten_bind_btSoftBody_appendNode_2,gt=d._emscripten_bind_btSoftBody_appendTetra_5=h._emscripten_bind_btSoftBody_appendTetra_5,ht=d._emscripten_bind_btSoftBody_btSoftBody_4=h._emscripten_bind_btSoftBody_btSoftBody_4,it=d._emscripten_bind_btSoftBody_checkFace_3=h._emscripten_bind_btSoftBody_checkFace_3,jt=d._emscripten_bind_btSoftBody_checkLink_2=h._emscripten_bind_btSoftBody_checkLink_2,kt=d._emscripten_bind_btSoftBody_forceActivationState_1=h._emscripten_bind_btSoftBody_forceActivationState_1, -lt=d._emscripten_bind_btSoftBody_generateBendingConstraints_2=h._emscripten_bind_btSoftBody_generateBendingConstraints_2,mt=d._emscripten_bind_btSoftBody_generateClusters_1=h._emscripten_bind_btSoftBody_generateClusters_1,nt=d._emscripten_bind_btSoftBody_generateClusters_2=h._emscripten_bind_btSoftBody_generateClusters_2,ot=d._emscripten_bind_btSoftBody_getCollisionFlags_0=h._emscripten_bind_btSoftBody_getCollisionFlags_0,pt=d._emscripten_bind_btSoftBody_getCollisionShape_0=h._emscripten_bind_btSoftBody_getCollisionShape_0, -qt=d._emscripten_bind_btSoftBody_getTotalMass_0=h._emscripten_bind_btSoftBody_getTotalMass_0,rt=d._emscripten_bind_btSoftBody_getUserIndex_0=h._emscripten_bind_btSoftBody_getUserIndex_0,st=d._emscripten_bind_btSoftBody_getUserPointer_0=h._emscripten_bind_btSoftBody_getUserPointer_0,tt=d._emscripten_bind_btSoftBody_getWorldTransform_0=h._emscripten_bind_btSoftBody_getWorldTransform_0,ut=d._emscripten_bind_btSoftBody_get_m_anchors_0=h._emscripten_bind_btSoftBody_get_m_anchors_0,vt=d._emscripten_bind_btSoftBody_get_m_cfg_0= -h._emscripten_bind_btSoftBody_get_m_cfg_0,wt=d._emscripten_bind_btSoftBody_get_m_materials_0=h._emscripten_bind_btSoftBody_get_m_materials_0,xt=d._emscripten_bind_btSoftBody_get_m_nodes_0=h._emscripten_bind_btSoftBody_get_m_nodes_0,yt=d._emscripten_bind_btSoftBody_isActive_0=h._emscripten_bind_btSoftBody_isActive_0,zt=d._emscripten_bind_btSoftBody_isKinematicObject_0=h._emscripten_bind_btSoftBody_isKinematicObject_0,At=d._emscripten_bind_btSoftBody_isStaticObject_0=h._emscripten_bind_btSoftBody_isStaticObject_0, -Bt=d._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0=h._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0,Ct=d._emscripten_bind_btSoftBody_rotate_1=h._emscripten_bind_btSoftBody_rotate_1,Dt=d._emscripten_bind_btSoftBody_scale_1=h._emscripten_bind_btSoftBody_scale_1,Et=d._emscripten_bind_btSoftBody_setActivationState_1=h._emscripten_bind_btSoftBody_setActivationState_1,Ft=d._emscripten_bind_btSoftBody_setAnisotropicFriction_2=h._emscripten_bind_btSoftBody_setAnisotropicFriction_2,Gt=d._emscripten_bind_btSoftBody_setCcdMotionThreshold_1= -h._emscripten_bind_btSoftBody_setCcdMotionThreshold_1,Ht=d._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1=h._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1,It=d._emscripten_bind_btSoftBody_setCollisionFlags_1=h._emscripten_bind_btSoftBody_setCollisionFlags_1,Jt=d._emscripten_bind_btSoftBody_setCollisionShape_1=h._emscripten_bind_btSoftBody_setCollisionShape_1,Kt=d._emscripten_bind_btSoftBody_setContactProcessingThreshold_1=h._emscripten_bind_btSoftBody_setContactProcessingThreshold_1, -Lt=d._emscripten_bind_btSoftBody_setFriction_1=h._emscripten_bind_btSoftBody_setFriction_1,Mt=d._emscripten_bind_btSoftBody_setMass_2=h._emscripten_bind_btSoftBody_setMass_2,Nt=d._emscripten_bind_btSoftBody_setRestitution_1=h._emscripten_bind_btSoftBody_setRestitution_1,Ot=d._emscripten_bind_btSoftBody_setRollingFriction_1=h._emscripten_bind_btSoftBody_setRollingFriction_1,Pt=d._emscripten_bind_btSoftBody_setTotalMass_2=h._emscripten_bind_btSoftBody_setTotalMass_2,Qt=d._emscripten_bind_btSoftBody_setUserIndex_1= -h._emscripten_bind_btSoftBody_setUserIndex_1,Rt=d._emscripten_bind_btSoftBody_setUserPointer_1=h._emscripten_bind_btSoftBody_setUserPointer_1,St=d._emscripten_bind_btSoftBody_setWorldTransform_1=h._emscripten_bind_btSoftBody_setWorldTransform_1,Tt=d._emscripten_bind_btSoftBody_set_m_anchors_1=h._emscripten_bind_btSoftBody_set_m_anchors_1,Ut=d._emscripten_bind_btSoftBody_set_m_cfg_1=h._emscripten_bind_btSoftBody_set_m_cfg_1,Vt=d._emscripten_bind_btSoftBody_set_m_materials_1=h._emscripten_bind_btSoftBody_set_m_materials_1, -Wt=d._emscripten_bind_btSoftBody_set_m_nodes_1=h._emscripten_bind_btSoftBody_set_m_nodes_1,Xt=d._emscripten_bind_btSoftBody_transform_1=h._emscripten_bind_btSoftBody_transform_1,Yt=d._emscripten_bind_btSoftBody_translate_1=h._emscripten_bind_btSoftBody_translate_1,Zt=d._emscripten_bind_btSoftBody_upcast_1=h._emscripten_bind_btSoftBody_upcast_1,$t=d._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0=h._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0,au=d._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1= -h._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1,bu=d._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1=h._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1,cu=d._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2=h._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2,du=d._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3=h._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3,eu=d._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1= -h._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1,fu=d._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2=h._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2,gu=d._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1=h._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1,hu=d._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3=h._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3,iu=d._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3=h._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3, -ju=d._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5=h._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5,ku=d._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3=h._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3,lu=d._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2=h._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2,mu=d._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5=h._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5, -nu=d._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3=h._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3,ou=d._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0=h._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0,pu=d._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0,qu=d._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0,ru= -d._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0,su=d._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0,tu=d._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0,uu=d._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0,vu=d._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0= -h._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0,wu=d._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0,xu=d._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0=h._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0,yu=d._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3=h._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3,zu=d._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1=h._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1, -Au=d._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1=h._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1,Bu=d._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1=h._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1,Cu=d._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1=h._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1,Du=d._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1=h._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1, -Eu=d._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1=h._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1,Fu=d._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1=h._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1,Gu=d._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1=h._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1,Hu=d._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2=h._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2,Iu=d._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3= -h._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3,Ju=d._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1=h._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1,Ku=d._emscripten_bind_btSphereShape___destroy___0=h._emscripten_bind_btSphereShape___destroy___0,Lu=d._emscripten_bind_btSphereShape_btSphereShape_1=h._emscripten_bind_btSphereShape_btSphereShape_1,Mu=d._emscripten_bind_btSphereShape_calculateLocalInertia_2=h._emscripten_bind_btSphereShape_calculateLocalInertia_2, -Nu=d._emscripten_bind_btSphereShape_getLocalScaling_0=h._emscripten_bind_btSphereShape_getLocalScaling_0,Ou=d._emscripten_bind_btSphereShape_getMargin_0=h._emscripten_bind_btSphereShape_getMargin_0,Pu=d._emscripten_bind_btSphereShape_setLocalScaling_1=h._emscripten_bind_btSphereShape_setLocalScaling_1,Qu=d._emscripten_bind_btSphereShape_setMargin_1=h._emscripten_bind_btSphereShape_setMargin_1,Ru=d._emscripten_bind_btStaticPlaneShape___destroy___0=h._emscripten_bind_btStaticPlaneShape___destroy___0, -Su=d._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2=h._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2,Tu=d._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2=h._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2,Uu=d._emscripten_bind_btStaticPlaneShape_getLocalScaling_0=h._emscripten_bind_btStaticPlaneShape_getLocalScaling_0,Vu=d._emscripten_bind_btStaticPlaneShape_setLocalScaling_1=h._emscripten_bind_btStaticPlaneShape_setLocalScaling_1,Wu=d._emscripten_bind_btStridingMeshInterface___destroy___0= -h._emscripten_bind_btStridingMeshInterface___destroy___0,Xu=d._emscripten_bind_btTransform___destroy___0=h._emscripten_bind_btTransform___destroy___0,Yu=d._emscripten_bind_btTransform_btTransform_0=h._emscripten_bind_btTransform_btTransform_0,Zu=d._emscripten_bind_btTransform_btTransform_2=h._emscripten_bind_btTransform_btTransform_2,$u=d._emscripten_bind_btTransform_getBasis_0=h._emscripten_bind_btTransform_getBasis_0,av=d._emscripten_bind_btTransform_getOrigin_0=h._emscripten_bind_btTransform_getOrigin_0, -bv=d._emscripten_bind_btTransform_getRotation_0=h._emscripten_bind_btTransform_getRotation_0,cv=d._emscripten_bind_btTransform_inverse_0=h._emscripten_bind_btTransform_inverse_0,dv=d._emscripten_bind_btTransform_op_mul_1=h._emscripten_bind_btTransform_op_mul_1,ev=d._emscripten_bind_btTransform_setFromOpenGLMatrix_1=h._emscripten_bind_btTransform_setFromOpenGLMatrix_1,fv=d._emscripten_bind_btTransform_setIdentity_0=h._emscripten_bind_btTransform_setIdentity_0,gv=d._emscripten_bind_btTransform_setOrigin_1= -h._emscripten_bind_btTransform_setOrigin_1,hv=d._emscripten_bind_btTransform_setRotation_1=h._emscripten_bind_btTransform_setRotation_1,iv=d._emscripten_bind_btTriangleMeshShape___destroy___0=h._emscripten_bind_btTriangleMeshShape___destroy___0,jv=d._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2=h._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2,kv=d._emscripten_bind_btTriangleMeshShape_getLocalScaling_0=h._emscripten_bind_btTriangleMeshShape_getLocalScaling_0,lv=d._emscripten_bind_btTriangleMeshShape_setLocalScaling_1= -h._emscripten_bind_btTriangleMeshShape_setLocalScaling_1,mv=d._emscripten_bind_btTriangleMesh___destroy___0=h._emscripten_bind_btTriangleMesh___destroy___0,nv=d._emscripten_bind_btTriangleMesh_addTriangle_3=h._emscripten_bind_btTriangleMesh_addTriangle_3,ov=d._emscripten_bind_btTriangleMesh_addTriangle_4=h._emscripten_bind_btTriangleMesh_addTriangle_4,pv=d._emscripten_bind_btTriangleMesh_btTriangleMesh_0=h._emscripten_bind_btTriangleMesh_btTriangleMesh_0,qv=d._emscripten_bind_btTriangleMesh_btTriangleMesh_1= -h._emscripten_bind_btTriangleMesh_btTriangleMesh_1,rv=d._emscripten_bind_btTriangleMesh_btTriangleMesh_2=h._emscripten_bind_btTriangleMesh_btTriangleMesh_2,sv=d._emscripten_bind_btTypedConstraint___destroy___0=h._emscripten_bind_btTypedConstraint___destroy___0,tv=d._emscripten_bind_btTypedConstraint_enableFeedback_1=h._emscripten_bind_btTypedConstraint_enableFeedback_1,uv=d._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0=h._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0, -vv=d._emscripten_bind_btTypedConstraint_getParam_2=h._emscripten_bind_btTypedConstraint_getParam_2,wv=d._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1=h._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1,xv=d._emscripten_bind_btTypedConstraint_setParam_3=h._emscripten_bind_btTypedConstraint_setParam_3,yv=d._emscripten_bind_btVector3Array___destroy___0=h._emscripten_bind_btVector3Array___destroy___0,zv=d._emscripten_bind_btVector3Array_at_1=h._emscripten_bind_btVector3Array_at_1, -Av=d._emscripten_bind_btVector3Array_size_0=h._emscripten_bind_btVector3Array_size_0,Bv=d._emscripten_bind_btVector3___destroy___0=h._emscripten_bind_btVector3___destroy___0,Cv=d._emscripten_bind_btVector3_btVector3_0=h._emscripten_bind_btVector3_btVector3_0,Dv=d._emscripten_bind_btVector3_btVector3_3=h._emscripten_bind_btVector3_btVector3_3,Ev=d._emscripten_bind_btVector3_dot_1=h._emscripten_bind_btVector3_dot_1,Fv=d._emscripten_bind_btVector3_length_0=h._emscripten_bind_btVector3_length_0,Gv=d._emscripten_bind_btVector3_normalize_0= -h._emscripten_bind_btVector3_normalize_0,Hv=d._emscripten_bind_btVector3_op_add_1=h._emscripten_bind_btVector3_op_add_1,Iv=d._emscripten_bind_btVector3_op_mul_1=h._emscripten_bind_btVector3_op_mul_1,Jv=d._emscripten_bind_btVector3_op_sub_1=h._emscripten_bind_btVector3_op_sub_1,Kv=d._emscripten_bind_btVector3_rotate_2=h._emscripten_bind_btVector3_rotate_2,Lv=d._emscripten_bind_btVector3_setValue_3=h._emscripten_bind_btVector3_setValue_3,Mv=d._emscripten_bind_btVector3_setX_1=h._emscripten_bind_btVector3_setX_1, -Nv=d._emscripten_bind_btVector3_setY_1=h._emscripten_bind_btVector3_setY_1,Ov=d._emscripten_bind_btVector3_setZ_1=h._emscripten_bind_btVector3_setZ_1,Pv=d._emscripten_bind_btVector3_x_0=h._emscripten_bind_btVector3_x_0,Qv=d._emscripten_bind_btVector3_y_0=h._emscripten_bind_btVector3_y_0,Rv=d._emscripten_bind_btVector3_z_0=h._emscripten_bind_btVector3_z_0,Sv=d._emscripten_bind_btVector4___destroy___0=h._emscripten_bind_btVector4___destroy___0,Tv=d._emscripten_bind_btVector4_btVector4_0=h._emscripten_bind_btVector4_btVector4_0, -Uv=d._emscripten_bind_btVector4_btVector4_4=h._emscripten_bind_btVector4_btVector4_4,Vv=d._emscripten_bind_btVector4_dot_1=h._emscripten_bind_btVector4_dot_1,Wv=d._emscripten_bind_btVector4_length_0=h._emscripten_bind_btVector4_length_0,Xv=d._emscripten_bind_btVector4_normalize_0=h._emscripten_bind_btVector4_normalize_0,Yv=d._emscripten_bind_btVector4_op_add_1=h._emscripten_bind_btVector4_op_add_1,Zv=d._emscripten_bind_btVector4_op_mul_1=h._emscripten_bind_btVector4_op_mul_1,$v=d._emscripten_bind_btVector4_op_sub_1= -h._emscripten_bind_btVector4_op_sub_1,aw=d._emscripten_bind_btVector4_rotate_2=h._emscripten_bind_btVector4_rotate_2,bw=d._emscripten_bind_btVector4_setValue_4=h._emscripten_bind_btVector4_setValue_4,cw=d._emscripten_bind_btVector4_setX_1=h._emscripten_bind_btVector4_setX_1,dw=d._emscripten_bind_btVector4_setY_1=h._emscripten_bind_btVector4_setY_1,ew=d._emscripten_bind_btVector4_setZ_1=h._emscripten_bind_btVector4_setZ_1,fw=d._emscripten_bind_btVector4_w_0=h._emscripten_bind_btVector4_w_0,gw=d._emscripten_bind_btVector4_x_0= -h._emscripten_bind_btVector4_x_0,hw=d._emscripten_bind_btVector4_y_0=h._emscripten_bind_btVector4_y_0,iw=d._emscripten_bind_btVector4_z_0=h._emscripten_bind_btVector4_z_0,jw=d._emscripten_bind_btVehicleRaycasterResult___destroy___0=h._emscripten_bind_btVehicleRaycasterResult___destroy___0,kw=d._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0=h._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0,lw=d._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0=h._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0, -mw=d._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0=h._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0,nw=d._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1=h._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1,ow=d._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1=h._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1,pw=d._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1=h._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1, -qw=d._emscripten_bind_btVehicleRaycaster___destroy___0=h._emscripten_bind_btVehicleRaycaster___destroy___0,rw=d._emscripten_bind_btVehicleRaycaster_castRay_3=h._emscripten_bind_btVehicleRaycaster_castRay_3,sw=d._emscripten_bind_btVehicleTuning_btVehicleTuning_0=h._emscripten_bind_btVehicleTuning_btVehicleTuning_0,tw=d._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0=h._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0,uw=d._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0=h._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0, -vw=d._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0=h._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0,ww=d._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0=h._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0,xw=d._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0=h._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0,yw=d._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0=h._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0, -zw=d._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1=h._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1,Aw=d._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1=h._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1,Bw=d._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1=h._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1,Cw=d._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1=h._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1, -Dw=d._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1=h._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1,Ew=d._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1=h._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1,Fw=d._emscripten_bind_btWheelInfoConstructionInfo___destroy___0=h._emscripten_bind_btWheelInfoConstructionInfo___destroy___0,Gw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0, -Hw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0,Iw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0,Jw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0,Kw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0= -h._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0,Lw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0,Mw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0,Nw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0, -Ow=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0,Pw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0,Qw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0=h._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0,Rw=d._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0= -h._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0,Sw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1,Tw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1,Uw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1, -Vw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1,Ww=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1,Xw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1,Yw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1= -h._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1,Zw=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1,$w=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1,ax=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1,bx=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1= -h._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1,cx=d._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1=h._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1,dx=d._emscripten_bind_btWheelInfo___destroy___0=h._emscripten_bind_btWheelInfo___destroy___0,ex=d._emscripten_bind_btWheelInfo_btWheelInfo_1=h._emscripten_bind_btWheelInfo_btWheelInfo_1,fx=d._emscripten_bind_btWheelInfo_getSuspensionRestLength_0=h._emscripten_bind_btWheelInfo_getSuspensionRestLength_0, -gx=d._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0=h._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0,hx=d._emscripten_bind_btWheelInfo_get_m_brake_0=h._emscripten_bind_btWheelInfo_get_m_brake_0,ix=d._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0=h._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0,jx=d._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0=h._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0,kx=d._emscripten_bind_btWheelInfo_get_m_deltaRotation_0= -h._emscripten_bind_btWheelInfo_get_m_deltaRotation_0,lx=d._emscripten_bind_btWheelInfo_get_m_engineForce_0=h._emscripten_bind_btWheelInfo_get_m_engineForce_0,mx=d._emscripten_bind_btWheelInfo_get_m_frictionSlip_0=h._emscripten_bind_btWheelInfo_get_m_frictionSlip_0,nx=d._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0=h._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0,ox=d._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0=h._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0, -px=d._emscripten_bind_btWheelInfo_get_m_raycastInfo_0=h._emscripten_bind_btWheelInfo_get_m_raycastInfo_0,qx=d._emscripten_bind_btWheelInfo_get_m_rollInfluence_0=h._emscripten_bind_btWheelInfo_get_m_rollInfluence_0,rx=d._emscripten_bind_btWheelInfo_get_m_rotation_0=h._emscripten_bind_btWheelInfo_get_m_rotation_0,sx=d._emscripten_bind_btWheelInfo_get_m_skidInfo_0=h._emscripten_bind_btWheelInfo_get_m_skidInfo_0,tx=d._emscripten_bind_btWheelInfo_get_m_steering_0=h._emscripten_bind_btWheelInfo_get_m_steering_0, -ux=d._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0=h._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0,vx=d._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0=h._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0,wx=d._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0=h._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0,xx=d._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0=h._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0,yx=d._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0= -h._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0,zx=d._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0=h._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0,Ax=d._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0=h._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0,Bx=d._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0=h._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0,Cx=d._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0=h._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0, -Dx=d._emscripten_bind_btWheelInfo_get_m_worldTransform_0=h._emscripten_bind_btWheelInfo_get_m_worldTransform_0,Ex=d._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1=h._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1,Fx=d._emscripten_bind_btWheelInfo_set_m_brake_1=h._emscripten_bind_btWheelInfo_set_m_brake_1,Gx=d._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1=h._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1,Hx=d._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1= -h._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1,Ix=d._emscripten_bind_btWheelInfo_set_m_deltaRotation_1=h._emscripten_bind_btWheelInfo_set_m_deltaRotation_1,Jx=d._emscripten_bind_btWheelInfo_set_m_engineForce_1=h._emscripten_bind_btWheelInfo_set_m_engineForce_1,Kx=d._emscripten_bind_btWheelInfo_set_m_frictionSlip_1=h._emscripten_bind_btWheelInfo_set_m_frictionSlip_1,Lx=d._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1=h._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1, -Mx=d._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1=h._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1,Nx=d._emscripten_bind_btWheelInfo_set_m_raycastInfo_1=h._emscripten_bind_btWheelInfo_set_m_raycastInfo_1,Ox=d._emscripten_bind_btWheelInfo_set_m_rollInfluence_1=h._emscripten_bind_btWheelInfo_set_m_rollInfluence_1,Px=d._emscripten_bind_btWheelInfo_set_m_rotation_1=h._emscripten_bind_btWheelInfo_set_m_rotation_1,Qx=d._emscripten_bind_btWheelInfo_set_m_skidInfo_1=h._emscripten_bind_btWheelInfo_set_m_skidInfo_1, -Rx=d._emscripten_bind_btWheelInfo_set_m_steering_1=h._emscripten_bind_btWheelInfo_set_m_steering_1,Sx=d._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1=h._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1,Tx=d._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1=h._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1,Ux=d._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1=h._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1,Vx=d._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1= -h._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1,Wx=d._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1=h._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1,Xx=d._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1=h._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1,Yx=d._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1=h._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1,Zx=d._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1=h._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1, -$x=d._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1=h._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1,ay=d._emscripten_bind_btWheelInfo_set_m_worldTransform_1=h._emscripten_bind_btWheelInfo_set_m_worldTransform_1,by=d._emscripten_bind_btWheelInfo_updateWheel_2=h._emscripten_bind_btWheelInfo_updateWheel_2,cy=d._emscripten_bind_tAnchorArray___destroy___0=h._emscripten_bind_tAnchorArray___destroy___0,dy=d._emscripten_bind_tAnchorArray_at_1=h._emscripten_bind_tAnchorArray_at_1, -ey=d._emscripten_bind_tAnchorArray_clear_0=h._emscripten_bind_tAnchorArray_clear_0,fy=d._emscripten_bind_tAnchorArray_pop_back_0=h._emscripten_bind_tAnchorArray_pop_back_0,gy=d._emscripten_bind_tAnchorArray_push_back_1=h._emscripten_bind_tAnchorArray_push_back_1,hy=d._emscripten_bind_tAnchorArray_size_0=h._emscripten_bind_tAnchorArray_size_0,iy=d._emscripten_bind_tMaterialArray___destroy___0=h._emscripten_bind_tMaterialArray___destroy___0,jy=d._emscripten_bind_tMaterialArray_at_1=h._emscripten_bind_tMaterialArray_at_1, -ky=d._emscripten_bind_tMaterialArray_size_0=h._emscripten_bind_tMaterialArray_size_0,ly=d._emscripten_bind_tNodeArray___destroy___0=h._emscripten_bind_tNodeArray___destroy___0,my=d._emscripten_bind_tNodeArray_at_1=h._emscripten_bind_tNodeArray_at_1,ny=d._emscripten_bind_tNodeArray_size_0=h._emscripten_bind_tNodeArray_size_0,oy=d._emscripten_enum_PHY_ScalarType_PHY_DOUBLE=h._emscripten_enum_PHY_ScalarType_PHY_DOUBLE,py=d._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88=h._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88, -qy=d._emscripten_enum_PHY_ScalarType_PHY_FLOAT=h._emscripten_enum_PHY_ScalarType_PHY_FLOAT,ry=d._emscripten_enum_PHY_ScalarType_PHY_INTEGER=h._emscripten_enum_PHY_ScalarType_PHY_INTEGER,sy=d._emscripten_enum_PHY_ScalarType_PHY_SHORT=h._emscripten_enum_PHY_ScalarType_PHY_SHORT,ty=d._emscripten_enum_PHY_ScalarType_PHY_UCHAR=h._emscripten_enum_PHY_ScalarType_PHY_UCHAR,uy=d._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM=h._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM,vy=d._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP= -h._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP,wy=d._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM=h._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM,xy=d._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP=h._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP,fb=d._free=h._free;d._i64Add=h._i64Add;d._i64Subtract=h._i64Subtract;d._llvm_bswap_i16=h._llvm_bswap_i16;d._llvm_bswap_i32=h._llvm_bswap_i32;var Ua=d._malloc=h._malloc;d._memcpy=h._memcpy; -d._memmove=h._memmove;d._memset=h._memset;d._sbrk=h._sbrk;d.establishStackSpace=h.establishStackSpace;d.setThrew=h.setThrew;d.stackAlloc=h.stackAlloc;d.stackRestore=h.stackRestore;d.stackSave=h.stackSave;d.dynCall_di=h.dynCall_di;d.dynCall_did=h.dynCall_did;d.dynCall_diidii=h.dynCall_diidii;d.dynCall_diii=h.dynCall_diii;d.dynCall_diiidii=h.dynCall_diiidii;d.dynCall_diiii=h.dynCall_diiii;d.dynCall_diiiii=h.dynCall_diiiii;d.dynCall_diiiiiiii=h.dynCall_diiiiiiii;d.dynCall_diiiiiiiii=h.dynCall_diiiiiiiii; -d.dynCall_diiiiiiiiii=h.dynCall_diiiiiiiiii;d.dynCall_ii=h.dynCall_ii;d.dynCall_iidid=h.dynCall_iidid;d.dynCall_iii=h.dynCall_iii;d.dynCall_iiid=h.dynCall_iiid;d.dynCall_iiii=h.dynCall_iiii;d.dynCall_iiiii=h.dynCall_iiiii;d.dynCall_iiiiiii=h.dynCall_iiiiiii;d.dynCall_iiiiiiiiii=h.dynCall_iiiiiiiiii;d.dynCall_iiiiiiiiiii=h.dynCall_iiiiiiiiiii;d.dynCall_v=h.dynCall_v;d.dynCall_vi=h.dynCall_vi;d.dynCall_vid=h.dynCall_vid;d.dynCall_vidd=h.dynCall_vidd;d.dynCall_viddiii=h.dynCall_viddiii; -d.dynCall_vidi=h.dynCall_vidi;d.dynCall_vidii=h.dynCall_vidii;d.dynCall_vii=h.dynCall_vii;d.dynCall_viid=h.dynCall_viid;d.dynCall_viidi=h.dynCall_viidi;d.dynCall_viidii=h.dynCall_viidii;d.dynCall_viii=h.dynCall_viii;d.dynCall_viiid=h.dynCall_viiid;d.dynCall_viiidii=h.dynCall_viiidii;d.dynCall_viiii=h.dynCall_viiii;d.dynCall_viiiid=h.dynCall_viiiid;d.dynCall_viiiidddddidi=h.dynCall_viiiidddddidi;d.dynCall_viiiiddddiid=h.dynCall_viiiiddddiid;d.dynCall_viiiii=h.dynCall_viiiii;d.dynCall_viiiiid=h.dynCall_viiiiid; -d.dynCall_viiiiii=h.dynCall_viiiiii;d.dynCall_viiiiiii=h.dynCall_viiiiiii;d.dynCall_viiiiiiiid=h.dynCall_viiiiiiiid;d.dynCall_viiiiiiiii=h.dynCall_viiiiiiiii;d.dynCall_viiiiiiiiii=h.dynCall_viiiiiiiiii;d.asm=h;d.Pointer_stringify=function(a,b){if(0===b||!a)return"";for(var e=0,f,g=0;;){f=wa[a+g>>0];e|=f;if(0==f&&!b)break;g++;if(b&&g==b)break}b||(b=g);f="";if(128>e){for(;0=c.size?(assert(0>=1;break;case 4:e>>=2;break;case 8:e>>= -3}for(var f=0;f=f&&(f=65536+((f&1023)<<10)|a.charCodeAt(++e)&1023);127>=f?++b:b=2047>=f?b+2:65535>=f?b+3:2097151>=f?b+4:67108863>=f?b+5:b+6}b=Array(b+1);f=b.length;e=0;if(0=n){var A=a.charCodeAt(++g);n=65536+((n&1023)<<10)|A&1023}if(127>=n){if(e>=f)break;b[e++]=n}else{if(2047>=n){if(e+1>=f)break;b[e++]=192|n>>6}else{if(65535>= -n){if(e+2>=f)break;b[e++]=224|n>>12}else{if(e+3>=f)break;b[e++]=240|n>>18;b[e++]=128|n>>12&63}b[e++]=128|n>>6&63}b[e++]=128|n&63}}b[e]=0}a=c.fa(b,va);c.copy(b,va,a)}return a}function Hy(a){if("object"===typeof a){var b=c.fa(a,ya);c.copy(a,ya,b);return b}return a}function Iy(){throw"cannot construct a btCollisionWorld, no constructor in IDL";}Iy.prototype=Object.create(k.prototype);Iy.prototype.constructor=Iy;Iy.prototype.K=Iy;Iy.L={};d.btCollisionWorld=Iy; -Iy.prototype.getDispatcher=function(){return m(Pg(this.J),Jy)};Iy.prototype.rayTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Rg(f,a,b,e)};Iy.prototype.getPairCache=function(){return m(Qg(this.J),Ky)};Iy.prototype.getDispatchInfo=function(){return m(Og(this.J),p)}; -Iy.prototype.addCollisionObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?Eg(f,a):void 0===e?Fg(f,a,b):Gg(f,a,b,e)};Iy.prototype.removeCollisionObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sg(b,a)};Iy.prototype.getBroadphase=function(){return m(Mg(this.J),Ly)}; -Iy.prototype.convexSweepTest=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);Jg(n,a,b,e,f,g)};Iy.prototype.contactPairTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Hg(f,a,b,e)}; -Iy.prototype.contactTest=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Ig(e,a,b)};Iy.prototype.updateSingleAabb=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ug(b,a)};Iy.prototype.setDebugDrawer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tg(b,a)};Iy.prototype.getDebugDrawer=function(){return m(Ng(this.J),My)};Iy.prototype.debugDrawWorld=function(){Lg(this.J)}; -Iy.prototype.debugDrawObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Kg(f,a,b,e)};Iy.prototype.__destroy__=function(){Dg(this.J)};function q(){throw"cannot construct a btCollisionShape, no constructor in IDL";}q.prototype=Object.create(k.prototype);q.prototype.constructor=q;q.prototype.K=q;q.L={};d.btCollisionShape=q;q.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bg(b,a)}; -q.prototype.getLocalScaling=function(){return m(zg(this.J),r)};q.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);yg(e,a,b)};q.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Cg(b,a)};q.prototype.getMargin=function(){return Ag(this.J)};q.prototype.__destroy__=function(){xg(this.J)};function t(){throw"cannot construct a btCollisionObject, no constructor in IDL";}t.prototype=Object.create(k.prototype); -t.prototype.constructor=t;t.prototype.K=t;t.L={};d.btCollisionObject=t;t.prototype.setAnisotropicFriction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);lg(e,a,b)};t.prototype.getCollisionShape=function(){return m(cg(this.J),q)};t.prototype.setContactProcessingThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);qg(b,a)};t.prototype.setActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);kg(b,a)}; -t.prototype.forceActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ag(b,a)};t.prototype.activate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);void 0===a?Zf(b):$f(b,a)};t.prototype.isActive=function(){return!!gg(this.J)};t.prototype.isKinematicObject=function(){return!!hg(this.J)};t.prototype.isStaticObject=function(){return!!ig(this.J)};t.prototype.isStaticOrKinematicObject=function(){return!!jg(this.J)}; -t.prototype.setRestitution=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);sg(b,a)};t.prototype.setFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);rg(b,a)};t.prototype.setRollingFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tg(b,a)};t.prototype.getWorldTransform=function(){return m(fg(this.J),u)};t.prototype.getCollisionFlags=function(){return bg(this.J)};t.prototype.setCollisionFlags=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);og(b,a)}; -t.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wg(b,a)};t.prototype.setCollisionShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);pg(b,a)};t.prototype.setCcdMotionThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);mg(b,a)};t.prototype.setCcdSweptSphereRadius=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ng(b,a)};t.prototype.getUserIndex=function(){return dg(this.J)}; -t.prototype.setUserIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ug(b,a)};t.prototype.getUserPointer=function(){return m(eg(this.J),Ny)};t.prototype.setUserPointer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);vg(b,a)};t.prototype.__destroy__=function(){Yf(this.J)};function v(){throw"cannot construct a btDynamicsWorld, no constructor in IDL";}v.prototype=Object.create(Iy.prototype);v.prototype.constructor=v;v.prototype.K=v;v.L={};d.btDynamicsWorld=v; -v.prototype.addAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ik(b,a)};v.prototype.removeAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yk(b,a)};v.prototype.getSolverInfo=function(){return m(Wk(this.J),w)};v.prototype.getDispatcher=function(){return m(Uk(this.J),Jy)};v.prototype.rayTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Xk(f,a,b,e)}; -v.prototype.getPairCache=function(){return m(Vk(this.J),Ky)};v.prototype.getDispatchInfo=function(){return m(Tk(this.J),p)};v.prototype.addCollisionObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?Jk(f,a):void 0===e?Kk(f,a,b):Lk(f,a,b,e)};v.prototype.removeCollisionObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zk(b,a)};v.prototype.getBroadphase=function(){return m(Rk(this.J),Ly)}; -v.prototype.convexSweepTest=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);Ok(n,a,b,e,f,g)};v.prototype.contactPairTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Mk(f,a,b,e)}; -v.prototype.contactTest=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Nk(e,a,b)};v.prototype.updateSingleAabb=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);al(b,a)};v.prototype.setDebugDrawer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$k(b,a)};v.prototype.getDebugDrawer=function(){return m(Sk(this.J),My)};v.prototype.debugDrawWorld=function(){Qk(this.J)}; -v.prototype.debugDrawObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Pk(f,a,b,e)};v.prototype.__destroy__=function(){Hk(this.J)};function Oy(){throw"cannot construct a btTypedConstraint, no constructor in IDL";}Oy.prototype=Object.create(k.prototype);Oy.prototype.constructor=Oy;Oy.prototype.K=Oy;Oy.L={};d.btTypedConstraint=Oy; -Oy.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tv(b,a)};Oy.prototype.getBreakingImpulseThreshold=function(){return uv(this.J)};Oy.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wv(b,a)};Oy.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return vv(e,a,b)}; -Oy.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);xv(f,a,b,e)};Oy.prototype.__destroy__=function(){sv(this.J)};function Py(){throw"cannot construct a btConcaveShape, no constructor in IDL";}Py.prototype=Object.create(q.prototype);Py.prototype.constructor=Py;Py.prototype.K=Py;Py.L={};d.btConcaveShape=Py;Py.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);jh(b,a)}; -Py.prototype.getLocalScaling=function(){return m(ih(this.J),r)};Py.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);hh(e,a,b)};Py.prototype.__destroy__=function(){gh(this.J)};function Qy(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=Kf(a,b);l(Qy)[this.J]=this}Qy.prototype=Object.create(q.prototype);Qy.prototype.constructor=Qy;Qy.prototype.K=Qy;Qy.L={};d.btCapsuleShape=Qy; -Qy.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sf(b,a)};Qy.prototype.getMargin=function(){return Of(this.J)};Qy.prototype.getUpAxis=function(){return Qf(this.J)};Qy.prototype.getRadius=function(){return Pf(this.J)};Qy.prototype.getHalfHeight=function(){return Mf(this.J)};Qy.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rf(b,a)};Qy.prototype.getLocalScaling=function(){return m(Nf(this.J),r)}; -Qy.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Lf(e,a,b)};Qy.prototype.__destroy__=function(){Jf(this.J)};function My(){throw"cannot construct a btIDebugDraw, no constructor in IDL";}My.prototype=Object.create(k.prototype);My.prototype.constructor=My;My.prototype.K=My;My.L={};d.btIDebugDraw=My; -My.prototype.drawLine=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);an(f,a,b,e)};My.prototype.drawContactPoint=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);$m(n,a,b,e,f,g)}; -My.prototype.reportErrorWarning=function(a){var b=this.J;c.M();a=a&&"object"===typeof a?a.J:Gy(a);cn(b,a)};My.prototype.draw3dText=function(a,b){var e=this.J;c.M();a&&"object"===typeof a&&(a=a.J);b=b&&"object"===typeof b?b.J:Gy(b);Zm(e,a,b)};My.prototype.setDebugMode=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dn(b,a)};My.prototype.getDebugMode=function(){return bn(this.J)};My.prototype.__destroy__=function(){Ym(this.J)}; -function Ry(a){a&&"object"===typeof a&&(a=a.J);this.J=void 0===a?jj():kj(a);l(Ry)[this.J]=this}Ry.prototype=Object.create(k.prototype);Ry.prototype.constructor=Ry;Ry.prototype.K=Ry;Ry.L={};d.btDefaultCollisionConfiguration=Ry;Ry.prototype.__destroy__=function(){ij(this.J)};function x(){throw"cannot construct a ConvexResultCallback, no constructor in IDL";}x.prototype=Object.create(k.prototype);x.prototype.constructor=x;x.prototype.K=x;x.L={};d.ConvexResultCallback=x;x.prototype.hasHit=function(){return!!nd(this.J)}; -x.prototype.get_m_collisionFilterGroup=x.prototype.N=function(){return ld(this.J)};x.prototype.set_m_collisionFilterGroup=x.prototype.P=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);pd(b,a)};Object.defineProperty(x.prototype,"m_collisionFilterGroup",{get:x.prototype.N,set:x.prototype.P});x.prototype.get_m_collisionFilterMask=x.prototype.O=function(){return md(this.J)};x.prototype.set_m_collisionFilterMask=x.prototype.R=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);qd(b,a)}; -Object.defineProperty(x.prototype,"m_collisionFilterMask",{get:x.prototype.O,set:x.prototype.R});x.prototype.get_m_closestHitFraction=x.prototype.S=function(){return kd(this.J)};x.prototype.set_m_closestHitFraction=x.prototype.T=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);od(b,a)};Object.defineProperty(x.prototype,"m_closestHitFraction",{get:x.prototype.S,set:x.prototype.T});x.prototype.__destroy__=function(){jd(this.J)}; -function Sy(){throw"cannot construct a btTriangleMeshShape, no constructor in IDL";}Sy.prototype=Object.create(Py.prototype);Sy.prototype.constructor=Sy;Sy.prototype.K=Sy;Sy.L={};d.btTriangleMeshShape=Sy;Sy.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);lv(b,a)};Sy.prototype.getLocalScaling=function(){return m(kv(this.J),r)};Sy.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);jv(e,a,b)}; -Sy.prototype.__destroy__=function(){iv(this.J)};function y(){this.J=Wl();l(y)[this.J]=this}y.prototype=Object.create(t.prototype);y.prototype.constructor=y;y.prototype.K=y;y.L={};d.btGhostObject=y;y.prototype.getNumOverlappingObjects=function(){return $l(this.J)};y.prototype.getOverlappingObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(am(b,a),t)}; -y.prototype.setAnisotropicFriction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);jm(e,a,b)};y.prototype.getCollisionShape=function(){return m(Zl(this.J),q)};y.prototype.setContactProcessingThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);om(b,a)};y.prototype.setActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);im(b,a)}; -y.prototype.forceActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xl(b,a)};y.prototype.activate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);void 0===a?Ul(b):Vl(b,a)};y.prototype.isActive=function(){return!!em(this.J)};y.prototype.isKinematicObject=function(){return!!fm(this.J)};y.prototype.isStaticObject=function(){return!!gm(this.J)};y.prototype.isStaticOrKinematicObject=function(){return!!hm(this.J)}; -y.prototype.setRestitution=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);qm(b,a)};y.prototype.setFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);pm(b,a)};y.prototype.setRollingFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);rm(b,a)};y.prototype.getWorldTransform=function(){return m(dm(this.J),u)};y.prototype.getCollisionFlags=function(){return Yl(this.J)};y.prototype.setCollisionFlags=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);mm(b,a)}; -y.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);um(b,a)};y.prototype.setCollisionShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);nm(b,a)};y.prototype.setCcdMotionThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);km(b,a)};y.prototype.setCcdSweptSphereRadius=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);lm(b,a)};y.prototype.getUserIndex=function(){return bm(this.J)}; -y.prototype.setUserIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);sm(b,a)};y.prototype.getUserPointer=function(){return m(cm(this.J),Ny)};y.prototype.setUserPointer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tm(b,a)};y.prototype.__destroy__=function(){Tl(this.J)};function Ty(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=vh(a,b);l(Ty)[this.J]=this}Ty.prototype=Object.create(q.prototype);Ty.prototype.constructor=Ty;Ty.prototype.K=Ty;Ty.L={}; -d.btConeShape=Ty;Ty.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yh(b,a)};Ty.prototype.getLocalScaling=function(){return m(xh(this.J),r)};Ty.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);wh(e,a,b)};Ty.prototype.__destroy__=function(){uh(this.J)};function Uy(){throw"cannot construct a btActionInterface, no constructor in IDL";}Uy.prototype=Object.create(k.prototype); -Uy.prototype.constructor=Uy;Uy.prototype.K=Uy;Uy.L={};d.btActionInterface=Uy;Uy.prototype.updateAction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Qe(e,a,b)};Uy.prototype.__destroy__=function(){Pe(this.J)}; -function r(a,b,e){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);this.J=void 0===a?Cv():void 0===b?_emscripten_bind_btVector3_btVector3_1(a):void 0===e?_emscripten_bind_btVector3_btVector3_2(a,b):Dv(a,b,e);l(r)[this.J]=this}r.prototype=Object.create(k.prototype);r.prototype.constructor=r;r.prototype.K=r;r.L={};d.btVector3=r;r.prototype.length=r.prototype.length=function(){return Fv(this.J)};r.prototype.x=r.prototype.x=function(){return Pv(this.J)}; -r.prototype.y=r.prototype.y=function(){return Qv(this.J)};r.prototype.z=r.prototype.z=function(){return Rv(this.J)};r.prototype.setX=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mv(b,a)};r.prototype.setY=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nv(b,a)};r.prototype.setZ=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ov(b,a)}; -r.prototype.setValue=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Lv(f,a,b,e)};r.prototype.normalize=r.prototype.normalize=function(){Gv(this.J)};r.prototype.rotate=r.prototype.rotate=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return m(Kv(e,a,b),r)};r.prototype.dot=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return Ev(b,a)}; -r.prototype.op_mul=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Iv(b,a),r)};r.prototype.op_add=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Hv(b,a),r)};r.prototype.op_sub=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Jv(b,a),r)};r.prototype.__destroy__=function(){Bv(this.J)};function Vy(){throw"cannot construct a btVehicleRaycaster, no constructor in IDL";}Vy.prototype=Object.create(k.prototype);Vy.prototype.constructor=Vy; -Vy.prototype.K=Vy;Vy.L={};d.btVehicleRaycaster=Vy;Vy.prototype.castRay=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);rw(f,a,b,e)};Vy.prototype.__destroy__=function(){qw(this.J)};function Wy(){throw"cannot construct a btQuadWord, no constructor in IDL";}Wy.prototype=Object.create(k.prototype);Wy.prototype.constructor=Wy;Wy.prototype.K=Wy;Wy.L={};d.btQuadWord=Wy;Wy.prototype.x=Wy.prototype.x=function(){return gp(this.J)}; -Wy.prototype.y=Wy.prototype.y=function(){return hp(this.J)};Wy.prototype.z=Wy.prototype.z=function(){return ip(this.J)};Wy.prototype.w=Wy.prototype.za=function(){return fp(this.J)};Wy.prototype.setX=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cp(b,a)};Wy.prototype.setY=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dp(b,a)};Wy.prototype.setZ=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ep(b,a)}; -Wy.prototype.setW=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bp(b,a)};Wy.prototype.__destroy__=function(){ap(this.J)};function Xy(a){a&&"object"===typeof a&&(a=a.J);this.J=aj(a);l(Xy)[this.J]=this}Xy.prototype=Object.create(q.prototype);Xy.prototype.constructor=Xy;Xy.prototype.K=Xy;Xy.L={};d.btCylinderShape=Xy;Xy.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);fj(b,a)};Xy.prototype.getMargin=function(){return dj(this.J)}; -Xy.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ej(b,a)};Xy.prototype.getLocalScaling=function(){return m(cj(this.J),r)};Xy.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);bj(e,a,b)};Xy.prototype.__destroy__=function(){$i(this.J)}; -function z(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=Jj(a,b,e,f);l(z)[this.J]=this}z.prototype=Object.create(v.prototype);z.prototype.constructor=z;z.prototype.K=z;z.L={};d.btDiscreteDynamicsWorld=z;z.prototype.setGravity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ck(b,a)};z.prototype.getGravity=function(){return m(Tj(this.J),r)}; -z.prototype.addRigidBody=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?Hj(f,a):void 0===e?_emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_2(f,a,b):Ij(f,a,b,e)};z.prototype.removeRigidBody=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ak(b,a)};z.prototype.addConstraint=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);void 0===b?Fj(e,a):Gj(e,a,b)}; -z.prototype.removeConstraint=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zj(b,a)};z.prototype.stepSimulation=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);return void 0===b?dk(f,a):void 0===e?ek(f,a,b):fk(f,a,b,e)};z.prototype.getDispatcher=function(){return m(Sj(this.J),Jy)}; -z.prototype.rayTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Wj(f,a,b,e)};z.prototype.getPairCache=function(){return m(Uj(this.J),Ky)};z.prototype.getDispatchInfo=function(){return m(Rj(this.J),p)};z.prototype.addCollisionObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?Cj(f,a):void 0===e?Dj(f,a,b):Ej(f,a,b,e)}; -z.prototype.removeCollisionObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yj(b,a)};z.prototype.getBroadphase=function(){return m(Pj(this.J),Ly)};z.prototype.convexSweepTest=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);Mj(n,a,b,e,f,g)}; -z.prototype.contactPairTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Kj(f,a,b,e)};z.prototype.contactTest=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Lj(e,a,b)};z.prototype.updateSingleAabb=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gk(b,a)};z.prototype.setDebugDrawer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bk(b,a)}; -z.prototype.getDebugDrawer=function(){return m(Qj(this.J),My)};z.prototype.debugDrawWorld=function(){Oj(this.J)};z.prototype.debugDrawObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Nj(f,a,b,e)};z.prototype.addAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bj(b,a)};z.prototype.removeAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xj(b,a)}; -z.prototype.getSolverInfo=function(){return m(Vj(this.J),w)};z.prototype.__destroy__=function(){Aj(this.J)};function Yy(){throw"cannot construct a btConvexShape, no constructor in IDL";}Yy.prototype=Object.create(q.prototype);Yy.prototype.constructor=Yy;Yy.prototype.K=Yy;Yy.L={};d.btConvexShape=Yy;Yy.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ci(b,a)};Yy.prototype.getLocalScaling=function(){return m(Ai(this.J),r)}; -Yy.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);zi(e,a,b)};Yy.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Di(b,a)};Yy.prototype.getMargin=function(){return Bi(this.J)};Yy.prototype.__destroy__=function(){yi(this.J)};function Jy(){throw"cannot construct a btDispatcher, no constructor in IDL";}Jy.prototype=Object.create(k.prototype);Jy.prototype.constructor=Jy;Jy.prototype.K=Jy;Jy.L={}; -d.btDispatcher=Jy;Jy.prototype.getNumManifolds=function(){return Gk(this.J)};Jy.prototype.getManifoldByIndexInternal=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Fk(b,a),Zy)};Jy.prototype.__destroy__=function(){Ek(this.J)}; -function $y(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=void 0===f?rl(a,b,e):void 0===g?_emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_4(a,b,e,f):sl(a,b,e,f,g);l($y)[this.J]=this}$y.prototype=Object.create(Oy.prototype);$y.prototype.constructor=$y;$y.prototype.K=$y;$y.L={};d.btGeneric6DofConstraint=$y; -$y.prototype.setLinearLowerLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Al(b,a)};$y.prototype.setLinearUpperLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bl(b,a)};$y.prototype.setAngularLowerLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xl(b,a)};$y.prototype.setAngularUpperLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yl(b,a)};$y.prototype.getFrameOffsetA=function(){return m(vl(this.J),u)}; -$y.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tl(b,a)};$y.prototype.getBreakingImpulseThreshold=function(){return ul(this.J)};$y.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zl(b,a)};$y.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return wl(e,a,b)}; -$y.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Cl(f,a,b,e)};$y.prototype.__destroy__=function(){ql(this.J)};function az(){throw"cannot construct a btStridingMeshInterface, no constructor in IDL";}az.prototype=Object.create(k.prototype);az.prototype.constructor=az;az.prototype.K=az;az.L={};d.btStridingMeshInterface=az;az.prototype.__destroy__=function(){Wu(this.J)}; -function bz(){throw"cannot construct a btMotionState, no constructor in IDL";}bz.prototype=Object.create(k.prototype);bz.prototype.constructor=bz;bz.prototype.K=bz;bz.L={};d.btMotionState=bz;bz.prototype.getWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zn(b,a)};bz.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$n(b,a)};bz.prototype.__destroy__=function(){Yn(this.J)}; -function cz(){throw"cannot construct a ContactResultCallback, no constructor in IDL";}cz.prototype=Object.create(k.prototype);cz.prototype.constructor=cz;cz.prototype.K=cz;cz.L={};d.ContactResultCallback=cz; -cz.prototype.addSingleResult=function(a,b,e,f,g,n,A){var Q=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);return id(Q,a,b,e,f,g,n,A)};cz.prototype.__destroy__=function(){hd(this.J)};function dz(){throw"cannot construct a btSoftBodySolver, no constructor in IDL";}dz.prototype=Object.create(k.prototype); -dz.prototype.constructor=dz;dz.prototype.K=dz;dz.L={};d.btSoftBodySolver=dz;dz.prototype.__destroy__=function(){Ds(this.J)};function B(){throw"cannot construct a RayResultCallback, no constructor in IDL";}B.prototype=Object.create(k.prototype);B.prototype.constructor=B;B.prototype.K=B;B.L={};d.RayResultCallback=B;B.prototype.hasHit=function(){return!!se(this.J)};B.prototype.get_m_collisionFilterGroup=B.prototype.N=function(){return pe(this.J)}; -B.prototype.set_m_collisionFilterGroup=B.prototype.P=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ue(b,a)};Object.defineProperty(B.prototype,"m_collisionFilterGroup",{get:B.prototype.N,set:B.prototype.P});B.prototype.get_m_collisionFilterMask=B.prototype.O=function(){return qe(this.J)};B.prototype.set_m_collisionFilterMask=B.prototype.R=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ve(b,a)};Object.defineProperty(B.prototype,"m_collisionFilterMask",{get:B.prototype.O,set:B.prototype.R}); -B.prototype.get_m_closestHitFraction=B.prototype.S=function(){return oe(this.J)};B.prototype.set_m_closestHitFraction=B.prototype.T=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);te(b,a)};Object.defineProperty(B.prototype,"m_closestHitFraction",{get:B.prototype.S,set:B.prototype.T});B.prototype.get_m_collisionObject=B.prototype.ia=function(){return m(re(this.J),t)};B.prototype.set_m_collisionObject=B.prototype.ra=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);we(b,a)}; -Object.defineProperty(B.prototype,"m_collisionObject",{get:B.prototype.ia,set:B.prototype.ra});B.prototype.__destroy__=function(){ne(this.J)};function ez(){throw"cannot construct a btMatrix3x3, no constructor in IDL";}ez.prototype=Object.create(k.prototype);ez.prototype.constructor=ez;ez.prototype.K=ez;ez.L={};d.btMatrix3x3=ez;ez.prototype.setEulerZYX=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Xn(f,a,b,e)}; -ez.prototype.getRotation=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vn(b,a)};ez.prototype.getRow=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Wn(b,a),r)};ez.prototype.__destroy__=function(){Un(this.J)};function p(){throw"cannot construct a btDispatcherInfo, no constructor in IDL";}p.prototype=Object.create(k.prototype);p.prototype.constructor=p;p.prototype.K=p;p.L={};d.btDispatcherInfo=p;p.prototype.get_m_timeStep=p.prototype.Rc=function(){return pk(this.J)}; -p.prototype.set_m_timeStep=p.prototype.Af=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ak(b,a)};Object.defineProperty(p.prototype,"m_timeStep",{get:p.prototype.Rc,set:p.prototype.Af});p.prototype.get_m_stepCount=p.prototype.Ic=function(){return nk(this.J)};p.prototype.set_m_stepCount=p.prototype.rf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yk(b,a)};Object.defineProperty(p.prototype,"m_stepCount",{get:p.prototype.Ic,set:p.prototype.rf}); -p.prototype.get_m_dispatchFunc=p.prototype.Cb=function(){return kk(this.J)};p.prototype.set_m_dispatchFunc=p.prototype.ke=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);vk(b,a)};Object.defineProperty(p.prototype,"m_dispatchFunc",{get:p.prototype.Cb,set:p.prototype.ke});p.prototype.get_m_timeOfImpact=p.prototype.Qc=function(){return ok(this.J)};p.prototype.set_m_timeOfImpact=p.prototype.zf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zk(b,a)}; -Object.defineProperty(p.prototype,"m_timeOfImpact",{get:p.prototype.Qc,set:p.prototype.zf});p.prototype.get_m_useContinuous=p.prototype.Tc=function(){return!!qk(this.J)};p.prototype.set_m_useContinuous=p.prototype.Cf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bk(b,a)};Object.defineProperty(p.prototype,"m_useContinuous",{get:p.prototype.Tc,set:p.prototype.Cf});p.prototype.get_m_enableSatConvex=p.prototype.Gb=function(){return!!mk(this.J)}; -p.prototype.set_m_enableSatConvex=p.prototype.oe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xk(b,a)};Object.defineProperty(p.prototype,"m_enableSatConvex",{get:p.prototype.Gb,set:p.prototype.oe});p.prototype.get_m_enableSPU=p.prototype.Fb=function(){return!!lk(this.J)};p.prototype.set_m_enableSPU=p.prototype.ne=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wk(b,a)};Object.defineProperty(p.prototype,"m_enableSPU",{get:p.prototype.Fb,set:p.prototype.ne}); -p.prototype.get_m_useEpa=p.prototype.Vc=function(){return!!sk(this.J)};p.prototype.set_m_useEpa=p.prototype.Ef=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dk(b,a)};Object.defineProperty(p.prototype,"m_useEpa",{get:p.prototype.Vc,set:p.prototype.Ef});p.prototype.get_m_allowedCcdPenetration=p.prototype.gb=function(){return ik(this.J)};p.prototype.set_m_allowedCcdPenetration=p.prototype.Pd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tk(b,a)}; -Object.defineProperty(p.prototype,"m_allowedCcdPenetration",{get:p.prototype.gb,set:p.prototype.Pd});p.prototype.get_m_useConvexConservativeDistanceUtil=p.prototype.Uc=function(){return!!rk(this.J)};p.prototype.set_m_useConvexConservativeDistanceUtil=p.prototype.Df=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ck(b,a)};Object.defineProperty(p.prototype,"m_useConvexConservativeDistanceUtil",{get:p.prototype.Uc,set:p.prototype.Df}); -p.prototype.get_m_convexConservativeDistanceThreshold=p.prototype.xb=function(){return jk(this.J)};p.prototype.set_m_convexConservativeDistanceThreshold=p.prototype.fe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);uk(b,a)};Object.defineProperty(p.prototype,"m_convexConservativeDistanceThreshold",{get:p.prototype.xb,set:p.prototype.fe});p.prototype.__destroy__=function(){hk(this.J)};function C(){throw"cannot construct a Material, no constructor in IDL";}C.prototype=Object.create(k.prototype); -C.prototype.constructor=C;C.prototype.K=C;C.L={};d.Material=C;C.prototype.get_m_kLST=C.prototype.bc=function(){return Td(this.J)};C.prototype.set_m_kLST=C.prototype.Ke=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xd(b,a)};Object.defineProperty(C.prototype,"m_kLST",{get:C.prototype.bc,set:C.prototype.Ke});C.prototype.get_m_kAST=C.prototype.ac=function(){return Sd(this.J)};C.prototype.set_m_kAST=C.prototype.Je=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wd(b,a)}; -Object.defineProperty(C.prototype,"m_kAST",{get:C.prototype.ac,set:C.prototype.Je});C.prototype.get_m_kVST=C.prototype.cc=function(){return Ud(this.J)};C.prototype.set_m_kVST=C.prototype.Le=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yd(b,a)};Object.defineProperty(C.prototype,"m_kVST",{get:C.prototype.cc,set:C.prototype.Le});C.prototype.get_m_flags=C.prototype.Kb=function(){return Rd(this.J)}; -C.prototype.set_m_flags=C.prototype.se=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vd(b,a)};Object.defineProperty(C.prototype,"m_flags",{get:C.prototype.Kb,set:C.prototype.se});C.prototype.__destroy__=function(){Qd(this.J)};function D(){throw"cannot construct a btWheelInfoConstructionInfo, no constructor in IDL";}D.prototype=Object.create(k.prototype);D.prototype.constructor=D;D.prototype.K=D;D.L={};d.btWheelInfoConstructionInfo=D; -D.prototype.get_m_chassisConnectionCS=D.prototype.sb=function(){return m(Hw(this.J),r)};D.prototype.set_m_chassisConnectionCS=D.prototype.ae=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tw(b,a)};Object.defineProperty(D.prototype,"m_chassisConnectionCS",{get:D.prototype.sb,set:D.prototype.ae});D.prototype.get_m_wheelDirectionCS=D.prototype.ma=function(){return m(Ow(this.J),r)}; -D.prototype.set_m_wheelDirectionCS=D.prototype.va=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$w(b,a)};Object.defineProperty(D.prototype,"m_wheelDirectionCS",{get:D.prototype.ma,set:D.prototype.va});D.prototype.get_m_wheelAxleCS=D.prototype.la=function(){return m(Nw(this.J),r)};D.prototype.set_m_wheelAxleCS=D.prototype.ua=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zw(b,a)};Object.defineProperty(D.prototype,"m_wheelAxleCS",{get:D.prototype.la,set:D.prototype.ua}); -D.prototype.get_m_suspensionRestLength=D.prototype.Nc=function(){return Lw(this.J)};D.prototype.set_m_suspensionRestLength=D.prototype.wf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xw(b,a)};Object.defineProperty(D.prototype,"m_suspensionRestLength",{get:D.prototype.Nc,set:D.prototype.wf});D.prototype.get_m_maxSuspensionTravelCm=D.prototype.W=function(){return Kw(this.J)}; -D.prototype.set_m_maxSuspensionTravelCm=D.prototype.ba=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ww(b,a)};Object.defineProperty(D.prototype,"m_maxSuspensionTravelCm",{get:D.prototype.W,set:D.prototype.ba});D.prototype.get_m_wheelRadius=D.prototype.$c=function(){return Pw(this.J)};D.prototype.set_m_wheelRadius=D.prototype.Jf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ax(b,a)};Object.defineProperty(D.prototype,"m_wheelRadius",{get:D.prototype.$c,set:D.prototype.Jf}); -D.prototype.get_m_suspensionStiffness=D.prototype.X=function(){return Mw(this.J)};D.prototype.set_m_suspensionStiffness=D.prototype.da=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yw(b,a)};Object.defineProperty(D.prototype,"m_suspensionStiffness",{get:D.prototype.X,set:D.prototype.da});D.prototype.get_m_wheelsDampingCompression=D.prototype.na=function(){return Qw(this.J)}; -D.prototype.set_m_wheelsDampingCompression=D.prototype.wa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bx(b,a)};Object.defineProperty(D.prototype,"m_wheelsDampingCompression",{get:D.prototype.na,set:D.prototype.wa});D.prototype.get_m_wheelsDampingRelaxation=D.prototype.oa=function(){return Rw(this.J)};D.prototype.set_m_wheelsDampingRelaxation=D.prototype.xa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cx(b,a)}; -Object.defineProperty(D.prototype,"m_wheelsDampingRelaxation",{get:D.prototype.oa,set:D.prototype.xa});D.prototype.get_m_frictionSlip=D.prototype.U=function(){return Iw(this.J)};D.prototype.set_m_frictionSlip=D.prototype.$=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Uw(b,a)};Object.defineProperty(D.prototype,"m_frictionSlip",{get:D.prototype.U,set:D.prototype.$});D.prototype.get_m_maxSuspensionForce=D.prototype.V=function(){return Jw(this.J)}; -D.prototype.set_m_maxSuspensionForce=D.prototype.aa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vw(b,a)};Object.defineProperty(D.prototype,"m_maxSuspensionForce",{get:D.prototype.V,set:D.prototype.aa});D.prototype.get_m_bIsFrontWheel=D.prototype.ha=function(){return!!Gw(this.J)};D.prototype.set_m_bIsFrontWheel=D.prototype.qa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sw(b,a)};Object.defineProperty(D.prototype,"m_bIsFrontWheel",{get:D.prototype.ha,set:D.prototype.qa}); -D.prototype.__destroy__=function(){Fw(this.J)};function fz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=void 0===b?Fi(a):Gi(a,b);l(fz)[this.J]=this}fz.prototype=Object.create(Yy.prototype);fz.prototype.constructor=fz;fz.prototype.K=fz;fz.L={};d.btConvexTriangleMeshShape=fz;fz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ki(b,a)};fz.prototype.getLocalScaling=function(){return m(Ii(this.J),r)}; -fz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Hi(e,a,b)};fz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Li(b,a)};fz.prototype.getMargin=function(){return Ji(this.J)};fz.prototype.__destroy__=function(){Ei(this.J)};function Ly(){throw"cannot construct a btBroadphaseInterface, no constructor in IDL";}Ly.prototype=Object.create(k.prototype);Ly.prototype.constructor=Ly;Ly.prototype.K=Ly; -Ly.L={};d.btBroadphaseInterface=Ly;Ly.prototype.__destroy__=function(){cf(this.J)};function E(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=void 0===f?sq(a,b,e):tq(a,b,e,f);l(E)[this.J]=this}E.prototype=Object.create(k.prototype);E.prototype.constructor=E;E.prototype.K=E;E.L={};d.btRigidBodyConstructionInfo=E;E.prototype.get_m_linearDamping=E.prototype.dc=function(){return Cq(this.J)}; -E.prototype.set_m_linearDamping=E.prototype.Me=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Oq(b,a)};Object.defineProperty(E.prototype,"m_linearDamping",{get:E.prototype.dc,set:E.prototype.Me});E.prototype.get_m_angularDamping=E.prototype.ib=function(){return zq(this.J)};E.prototype.set_m_angularDamping=E.prototype.Rd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lq(b,a)};Object.defineProperty(E.prototype,"m_angularDamping",{get:E.prototype.ib,set:E.prototype.Rd}); -E.prototype.get_m_friction=E.prototype.Lb=function(){return Bq(this.J)};E.prototype.set_m_friction=E.prototype.te=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nq(b,a)};Object.defineProperty(E.prototype,"m_friction",{get:E.prototype.Lb,set:E.prototype.te});E.prototype.get_m_rollingFriction=E.prototype.Ac=function(){return Fq(this.J)};E.prototype.set_m_rollingFriction=E.prototype.hf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rq(b,a)}; -Object.defineProperty(E.prototype,"m_rollingFriction",{get:E.prototype.Ac,set:E.prototype.hf});E.prototype.get_m_restitution=E.prototype.yc=function(){return Eq(this.J)};E.prototype.set_m_restitution=E.prototype.ff=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qq(b,a)};Object.defineProperty(E.prototype,"m_restitution",{get:E.prototype.yc,set:E.prototype.ff});E.prototype.get_m_linearSleepingThreshold=E.prototype.ec=function(){return Dq(this.J)}; -E.prototype.set_m_linearSleepingThreshold=E.prototype.Ne=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pq(b,a)};Object.defineProperty(E.prototype,"m_linearSleepingThreshold",{get:E.prototype.ec,set:E.prototype.Ne});E.prototype.get_m_angularSleepingThreshold=E.prototype.jb=function(){return Aq(this.J)};E.prototype.set_m_angularSleepingThreshold=E.prototype.Sd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mq(b,a)}; -Object.defineProperty(E.prototype,"m_angularSleepingThreshold",{get:E.prototype.jb,set:E.prototype.Sd});E.prototype.get_m_additionalDamping=E.prototype.cb=function(){return!!xq(this.J)};E.prototype.set_m_additionalDamping=E.prototype.Md=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jq(b,a)};Object.defineProperty(E.prototype,"m_additionalDamping",{get:E.prototype.cb,set:E.prototype.Md});E.prototype.get_m_additionalDampingFactor=E.prototype.eb=function(){return wq(this.J)}; -E.prototype.set_m_additionalDampingFactor=E.prototype.Nd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Iq(b,a)};Object.defineProperty(E.prototype,"m_additionalDampingFactor",{get:E.prototype.eb,set:E.prototype.Nd});E.prototype.get_m_additionalLinearDampingThresholdSqr=E.prototype.fb=function(){return yq(this.J)};E.prototype.set_m_additionalLinearDampingThresholdSqr=E.prototype.Od=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kq(b,a)}; -Object.defineProperty(E.prototype,"m_additionalLinearDampingThresholdSqr",{get:E.prototype.fb,set:E.prototype.Od});E.prototype.get_m_additionalAngularDampingThresholdSqr=E.prototype.bb=function(){return vq(this.J)};E.prototype.set_m_additionalAngularDampingThresholdSqr=E.prototype.Ld=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hq(b,a)};Object.defineProperty(E.prototype,"m_additionalAngularDampingThresholdSqr",{get:E.prototype.bb,set:E.prototype.Ld}); -E.prototype.get_m_additionalAngularDampingFactor=E.prototype.ab=function(){return uq(this.J)};E.prototype.set_m_additionalAngularDampingFactor=E.prototype.Kd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gq(b,a)};Object.defineProperty(E.prototype,"m_additionalAngularDampingFactor",{get:E.prototype.ab,set:E.prototype.Kd});E.prototype.__destroy__=function(){rq(this.J)};function gz(){throw"cannot construct a btCollisionConfiguration, no constructor in IDL";}gz.prototype=Object.create(k.prototype); -gz.prototype.constructor=gz;gz.prototype.K=gz;gz.L={};d.btCollisionConfiguration=gz;gz.prototype.__destroy__=function(){Tf(this.J)};function Zy(){this.J=Io();l(Zy)[this.J]=this}Zy.prototype=Object.create(k.prototype);Zy.prototype.constructor=Zy;Zy.prototype.K=Zy;Zy.L={};d.btPersistentManifold=Zy;Zy.prototype.getBody0=function(){return m(Jo(this.J),t)};Zy.prototype.getBody1=function(){return m(Ko(this.J),t)};Zy.prototype.getNumContacts=function(){return Mo(this.J)}; -Zy.prototype.getContactPoint=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Lo(b,a),F)};Zy.prototype.__destroy__=function(){Ho(this.J)};function hz(a){a&&"object"===typeof a&&(a=a.J);this.J=void 0===a?Xg():Yg(a);l(hz)[this.J]=this}hz.prototype=Object.create(q.prototype);hz.prototype.constructor=hz;hz.prototype.K=hz;hz.L={};d.btCompoundShape=hz;hz.prototype.addChildShape=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Wg(e,a,b)}; -hz.prototype.removeChildShapeByIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dh(b,a)};hz.prototype.getNumChildShapes=function(){return ch(this.J)};hz.prototype.getChildShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m($g(b,a),q)};hz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);fh(b,a)};hz.prototype.getMargin=function(){return bh(this.J)}; -hz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);eh(b,a)};hz.prototype.getLocalScaling=function(){return m(ah(this.J),r)};hz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Zg(e,a,b)};hz.prototype.__destroy__=function(){Vg(this.J)};function G(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=vb(a,b);l(G)[this.J]=this}G.prototype=Object.create(x.prototype); -G.prototype.constructor=G;G.prototype.K=G;G.L={};d.ClosestConvexResultCallback=G;G.prototype.hasHit=function(){return!!Eb(this.J)};G.prototype.get_m_convexFromWorld=G.prototype.yb=function(){return m(Ab(this.J),r)};G.prototype.set_m_convexFromWorld=G.prototype.ge=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ib(b,a)};Object.defineProperty(G.prototype,"m_convexFromWorld",{get:G.prototype.yb,set:G.prototype.ge}); -G.prototype.get_m_convexToWorld=G.prototype.zb=function(){return m(Bb(this.J),r)};G.prototype.set_m_convexToWorld=G.prototype.he=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jb(b,a)};Object.defineProperty(G.prototype,"m_convexToWorld",{get:G.prototype.zb,set:G.prototype.he});G.prototype.get_m_hitNormalWorld=G.prototype.ja=function(){return m(Cb(this.J),r)};G.prototype.set_m_hitNormalWorld=G.prototype.sa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kb(b,a)}; -Object.defineProperty(G.prototype,"m_hitNormalWorld",{get:G.prototype.ja,set:G.prototype.sa});G.prototype.get_m_hitPointWorld=G.prototype.ka=function(){return m(Db(this.J),r)};G.prototype.set_m_hitPointWorld=G.prototype.ta=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mb(b,a)};Object.defineProperty(G.prototype,"m_hitPointWorld",{get:G.prototype.ka,set:G.prototype.ta});G.prototype.get_m_collisionFilterGroup=G.prototype.N=function(){return yb(this.J)}; -G.prototype.set_m_collisionFilterGroup=G.prototype.P=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gb(b,a)};Object.defineProperty(G.prototype,"m_collisionFilterGroup",{get:G.prototype.N,set:G.prototype.P});G.prototype.get_m_collisionFilterMask=G.prototype.O=function(){return zb(this.J)};G.prototype.set_m_collisionFilterMask=G.prototype.R=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hb(b,a)};Object.defineProperty(G.prototype,"m_collisionFilterMask",{get:G.prototype.O,set:G.prototype.R}); -G.prototype.get_m_closestHitFraction=G.prototype.S=function(){return xb(this.J)};G.prototype.set_m_closestHitFraction=G.prototype.T=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Fb(b,a)};Object.defineProperty(G.prototype,"m_closestHitFraction",{get:G.prototype.S,set:G.prototype.T});G.prototype.__destroy__=function(){wb(this.J)};function iz(){throw"cannot construct a tMaterialArray, no constructor in IDL";}iz.prototype=Object.create(k.prototype);iz.prototype.constructor=iz; -iz.prototype.K=iz;iz.L={};d.tMaterialArray=iz;iz.prototype.size=iz.prototype.size=function(){return ky(this.J)};iz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(jy(b,a),C)};iz.prototype.__destroy__=function(){iy(this.J)};function jz(a){a&&"object"===typeof a&&(a=a.J);this.J=yj(a);l(jz)[this.J]=this}jz.prototype=Object.create(Vy.prototype);jz.prototype.constructor=jz;jz.prototype.K=jz;jz.L={};d.btDefaultVehicleRaycaster=jz; -jz.prototype.castRay=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);zj(f,a,b,e)};jz.prototype.__destroy__=function(){xj(this.J)};function H(){this.J=Qh();l(H)[this.J]=this}H.prototype=Object.create(k.prototype);H.prototype.constructor=H;H.prototype.K=H;H.L={};d.btConstraintSetting=H;H.prototype.get_m_tau=H.prototype.Pc=function(){return Th(this.J)}; -H.prototype.set_m_tau=H.prototype.yf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wh(b,a)};Object.defineProperty(H.prototype,"m_tau",{get:H.prototype.Pc,set:H.prototype.yf});H.prototype.get_m_damping=H.prototype.Ab=function(){return Rh(this.J)};H.prototype.set_m_damping=H.prototype.ie=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Uh(b,a)};Object.defineProperty(H.prototype,"m_damping",{get:H.prototype.Ab,set:H.prototype.ie});H.prototype.get_m_impulseClamp=H.prototype.Xb=function(){return Sh(this.J)}; -H.prototype.set_m_impulseClamp=H.prototype.Fe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vh(b,a)};Object.defineProperty(H.prototype,"m_impulseClamp",{get:H.prototype.Xb,set:H.prototype.Fe});H.prototype.__destroy__=function(){Ph(this.J)};function kz(){throw"cannot construct a LocalShapeInfo, no constructor in IDL";}kz.prototype=Object.create(k.prototype);kz.prototype.constructor=kz;kz.prototype.K=kz;kz.L={};d.LocalShapeInfo=kz;kz.prototype.get_m_shapePart=kz.prototype.Dc=function(){return Md(this.J)}; -kz.prototype.set_m_shapePart=kz.prototype.lf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Od(b,a)};Object.defineProperty(kz.prototype,"m_shapePart",{get:kz.prototype.Dc,set:kz.prototype.lf});kz.prototype.get_m_triangleIndex=kz.prototype.Sc=function(){return Nd(this.J)};kz.prototype.set_m_triangleIndex=kz.prototype.Bf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pd(b,a)};Object.defineProperty(kz.prototype,"m_triangleIndex",{get:kz.prototype.Sc,set:kz.prototype.Bf}); -kz.prototype.__destroy__=function(){Ld(this.J)};function I(a){a&&"object"===typeof a&&(a=a.J);this.J=dr(a);l(I)[this.J]=this}I.prototype=Object.create(t.prototype);I.prototype.constructor=I;I.prototype.K=I;I.L={};d.btRigidBody=I;I.prototype.getCenterOfMassTransform=function(){return m(ir(this.J),u)};I.prototype.setCenterOfMassTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Br(b,a)}; -I.prototype.setSleepingThresholds=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Or(e,a,b)};I.prototype.setDamping=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Fr(e,a,b)};I.prototype.setMassProps=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Kr(e,a,b)};I.prototype.setLinearFactor=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ir(b,a)}; -I.prototype.applyTorque=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cr(b,a)};I.prototype.applyLocalTorque=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ar(b,a)};I.prototype.applyForce=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Yq(e,a,b)};I.prototype.applyCentralForce=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vq(b,a)}; -I.prototype.applyCentralLocalForce=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xq(b,a)};I.prototype.applyTorqueImpulse=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);br(b,a)};I.prototype.applyImpulse=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);$q(e,a,b)};I.prototype.applyCentralImpulse=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wq(b,a)};I.prototype.updateInertiaTensor=function(){Tr(this.J)}; -I.prototype.getLinearVelocity=function(){return m(mr(this.J),r)};I.prototype.getAngularVelocity=function(){return m(gr(this.J),r)};I.prototype.setLinearVelocity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jr(b,a)};I.prototype.setAngularVelocity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xr(b,a)};I.prototype.getMotionState=function(){return m(nr(this.J),bz)};I.prototype.setMotionState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lr(b,a)}; -I.prototype.setAngularFactor=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wr(b,a)};I.prototype.upcast=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Sr(b,a),I)};I.prototype.getAabb=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);fr(e,a,b)};I.prototype.applyGravity=function(){Zq(this.J)};I.prototype.getGravity=function(){return m(lr(this.J),r)}; -I.prototype.setGravity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hr(b,a)};I.prototype.getBroadphaseProxy=function(){return m(hr(this.J),lz)};I.prototype.setAnisotropicFriction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);yr(e,a,b)};I.prototype.getCollisionShape=function(){return m(kr(this.J),q)};I.prototype.setContactProcessingThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Er(b,a)}; -I.prototype.setActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);vr(b,a)};I.prototype.forceActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);er(b,a)};I.prototype.activate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);void 0===a?Tq(b):Uq(b,a)};I.prototype.isActive=function(){return!!rr(this.J)};I.prototype.isKinematicObject=function(){return!!sr(this.J)};I.prototype.isStaticObject=function(){return!!tr(this.J)}; -I.prototype.isStaticOrKinematicObject=function(){return!!ur(this.J)};I.prototype.setRestitution=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mr(b,a)};I.prototype.setFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gr(b,a)};I.prototype.setRollingFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nr(b,a)};I.prototype.getWorldTransform=function(){return m(qr(this.J),u)};I.prototype.getCollisionFlags=function(){return jr(this.J)}; -I.prototype.setCollisionFlags=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Cr(b,a)};I.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rr(b,a)};I.prototype.setCollisionShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dr(b,a)};I.prototype.setCcdMotionThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zr(b,a)};I.prototype.setCcdSweptSphereRadius=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ar(b,a)}; -I.prototype.getUserIndex=function(){return or(this.J)};I.prototype.setUserIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pr(b,a)};I.prototype.getUserPointer=function(){return m(pr(this.J),Ny)};I.prototype.setUserPointer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qr(b,a)};I.prototype.__destroy__=function(){Sq(this.J)};function mz(){throw"cannot construct a btConvexPolyhedron, no constructor in IDL";}mz.prototype=Object.create(k.prototype);mz.prototype.constructor=mz; -mz.prototype.K=mz;mz.L={};d.btConvexPolyhedron=mz;mz.prototype.get_m_vertices=mz.prototype.Xc=function(){return m(vi(this.J),nz)};mz.prototype.set_m_vertices=mz.prototype.Gf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xi(b,a)};Object.defineProperty(mz.prototype,"m_vertices",{get:mz.prototype.Xc,set:mz.prototype.Gf});mz.prototype.get_m_faces=mz.prototype.Jb=function(){return m(ui(this.J),oz)}; -mz.prototype.set_m_faces=mz.prototype.re=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wi(b,a)};Object.defineProperty(mz.prototype,"m_faces",{get:mz.prototype.Jb,set:mz.prototype.re});mz.prototype.__destroy__=function(){ti(this.J)};function pz(){this.J=hj();l(pz)[this.J]=this}pz.prototype=Object.create(k.prototype);pz.prototype.constructor=pz;pz.prototype.K=pz;pz.L={};d.btDbvtBroadphase=pz;pz.prototype.__destroy__=function(){gj(this.J)}; -function qz(a,b,e,f,g,n,A,Q,ha){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);Q&&"object"===typeof Q&&(Q=Q.J);ha&&"object"===typeof ha&&(ha=ha.J);this.J=zm(a,b,e,f,g,n,A,Q,ha);l(qz)[this.J]=this}qz.prototype=Object.create(Py.prototype);qz.prototype.constructor=qz;qz.prototype.K=qz;qz.L={};d.btHeightfieldTerrainShape=qz; -qz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Em(b,a)};qz.prototype.getMargin=function(){return Cm(this.J)};qz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dm(b,a)};qz.prototype.getLocalScaling=function(){return m(Bm(this.J),r)};qz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Am(e,a,b)};qz.prototype.__destroy__=function(){ym(this.J)}; -function rz(){this.J=wj();l(rz)[this.J]=this}rz.prototype=Object.create(dz.prototype);rz.prototype.constructor=rz;rz.prototype.K=rz;rz.L={};d.btDefaultSoftBodySolver=rz;rz.prototype.__destroy__=function(){vj(this.J)};function sz(a){a&&"object"===typeof a&&(a=a.J);this.J=Vf(a);l(sz)[this.J]=this}sz.prototype=Object.create(Jy.prototype);sz.prototype.constructor=sz;sz.prototype.K=sz;sz.L={};d.btCollisionDispatcher=sz;sz.prototype.getNumManifolds=function(){return Xf(this.J)}; -sz.prototype.getManifoldByIndexInternal=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Wf(b,a),Zy)};sz.prototype.__destroy__=function(){Uf(this.J)};function tz(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=void 0===e?Se(a,b):void 0===f?Te(a,b,e):void 0===g?Ue(a,b,e,f):Ve(a,b,e,f,g);l(tz)[this.J]=this}tz.prototype=Object.create(k.prototype); -tz.prototype.constructor=tz;tz.prototype.K=tz;tz.L={};d.btAxisSweep3=tz;tz.prototype.__destroy__=function(){Re(this.J)};function J(){this.J=Fs();l(J)[this.J]=this}J.prototype=Object.create(k.prototype);J.prototype.constructor=J;J.prototype.K=J;J.L={};d.btSoftBodyWorldInfo=J;J.prototype.get_air_density=J.prototype.Fa=function(){return Gs(this.J)};J.prototype.set_air_density=J.prototype.od=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Os(b,a)}; -Object.defineProperty(J.prototype,"air_density",{get:J.prototype.Fa,set:J.prototype.od});J.prototype.get_water_density=J.prototype.kd=function(){return Ls(this.J)};J.prototype.set_water_density=J.prototype.Sf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ts(b,a)};Object.defineProperty(J.prototype,"water_density",{get:J.prototype.kd,set:J.prototype.Sf});J.prototype.get_water_offset=J.prototype.md=function(){return Ns(this.J)}; -J.prototype.set_water_offset=J.prototype.Uf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vs(b,a)};Object.defineProperty(J.prototype,"water_offset",{get:J.prototype.md,set:J.prototype.Uf});J.prototype.get_m_maxDisplacement=J.prototype.lc=function(){return Ks(this.J)};J.prototype.set_m_maxDisplacement=J.prototype.Te=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ss(b,a)};Object.defineProperty(J.prototype,"m_maxDisplacement",{get:J.prototype.lc,set:J.prototype.Te}); -J.prototype.get_water_normal=J.prototype.ld=function(){return m(Ms(this.J),r)};J.prototype.set_water_normal=J.prototype.Tf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Us(b,a)};Object.defineProperty(J.prototype,"water_normal",{get:J.prototype.ld,set:J.prototype.Tf});J.prototype.get_m_broadphase=J.prototype.nb=function(){return m(Hs(this.J),Ly)};J.prototype.set_m_broadphase=J.prototype.Wd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ps(b,a)}; -Object.defineProperty(J.prototype,"m_broadphase",{get:J.prototype.nb,set:J.prototype.Wd});J.prototype.get_m_dispatcher=J.prototype.Db=function(){return m(Is(this.J),Jy)};J.prototype.set_m_dispatcher=J.prototype.le=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qs(b,a)};Object.defineProperty(J.prototype,"m_dispatcher",{get:J.prototype.Db,set:J.prototype.le});J.prototype.get_m_gravity=J.prototype.Nb=function(){return m(Js(this.J),r)}; -J.prototype.set_m_gravity=J.prototype.ve=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rs(b,a)};Object.defineProperty(J.prototype,"m_gravity",{get:J.prototype.Nb,set:J.prototype.ve});J.prototype.__destroy__=function(){Es(this.J)}; -function uz(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=void 0===e?Ah(a,b):void 0===f?_emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_3(a,b,e):Bh(a,b,e,f);l(uz)[this.J]=this}uz.prototype=Object.create(Oy.prototype);uz.prototype.constructor=uz;uz.prototype.K=uz;uz.L={};d.btConeTwistConstraint=uz; -uz.prototype.setLimit=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Jh(e,a,b)};uz.prototype.setAngularOnly=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gh(b,a)};uz.prototype.setDamping=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ih(b,a)};uz.prototype.enableMotor=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dh(b,a)};uz.prototype.setMaxMotorImpulse=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lh(b,a)}; -uz.prototype.setMaxMotorImpulseNormalized=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kh(b,a)};uz.prototype.setMotorTarget=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nh(b,a)};uz.prototype.setMotorTargetInConstraintSpace=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mh(b,a)};uz.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ch(b,a)};uz.prototype.getBreakingImpulseThreshold=function(){return Eh(this.J)}; -uz.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hh(b,a)};uz.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return Fh(e,a,b)};uz.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Oh(f,a,b,e)};uz.prototype.__destroy__=function(){zh(this.J)}; -function vz(a,b,e,f,g,n,A){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);this.J=void 0===e?Gm(a,b):void 0===f?Hm(a,b,e):void 0===g?Im(a,b,e,f):void 0===n?Jm(a,b,e,f,g):void 0===A?Km(a,b,e,f,g,n):Lm(a,b,e,f,g,n,A);l(vz)[this.J]=this}vz.prototype=Object.create(Oy.prototype);vz.prototype.constructor=vz;vz.prototype.K=vz; -vz.L={};d.btHingeConstraint=vz;vz.prototype.setLimit=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);void 0===g?Tm(n,a,b,e,f):Um(n,a,b,e,f,g)};vz.prototype.enableAngularMotor=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Mm(f,a,b,e)}; -vz.prototype.setAngularOnly=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rm(b,a)};vz.prototype.enableMotor=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Om(b,a)};vz.prototype.setMaxMotorImpulse=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vm(b,a)};vz.prototype.setMotorTarget=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Wm(e,a,b)}; -vz.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nm(b,a)};vz.prototype.getBreakingImpulseThreshold=function(){return Pm(this.J)};vz.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sm(b,a)};vz.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return Qm(e,a,b)}; -vz.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Xm(f,a,b,e)};vz.prototype.__destroy__=function(){Fm(this.J)};function wz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=qh(a,b);l(wz)[this.J]=this}wz.prototype=Object.create(Ty.prototype);wz.prototype.constructor=wz;wz.prototype.K=wz;wz.L={};d.btConeShapeZ=wz; -wz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);th(b,a)};wz.prototype.getLocalScaling=function(){return m(sh(this.J),r)};wz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);rh(e,a,b)};wz.prototype.__destroy__=function(){ph(this.J)};function xz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=lh(a,b);l(xz)[this.J]=this}xz.prototype=Object.create(Ty.prototype); -xz.prototype.constructor=xz;xz.prototype.K=xz;xz.L={};d.btConeShapeX=xz;xz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);oh(b,a)};xz.prototype.getLocalScaling=function(){return m(nh(this.J),r)};xz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);mh(e,a,b)};xz.prototype.__destroy__=function(){kh(this.J)}; -function yz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=void 0===a?pv():void 0===b?qv(a):rv(a,b);l(yz)[this.J]=this}yz.prototype=Object.create(az.prototype);yz.prototype.constructor=yz;yz.prototype.K=yz;yz.L={};d.btTriangleMesh=yz;yz.prototype.addTriangle=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);void 0===f?nv(g,a,b,e):ov(g,a,b,e,f)}; -yz.prototype.__destroy__=function(){mv(this.J)};function zz(a,b){c.M();"object"==typeof a&&(a=Hy(a));b&&"object"===typeof b&&(b=b.J);this.J=void 0===a?hi():void 0===b?ii(a):ji(a,b);l(zz)[this.J]=this}zz.prototype=Object.create(q.prototype);zz.prototype.constructor=zz;zz.prototype.K=zz;zz.L={};d.btConvexHullShape=zz;zz.prototype.addPoint=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);void 0===b?fi(e,a):gi(e,a,b)}; -zz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);si(b,a)};zz.prototype.getMargin=function(){return ni(this.J)};zz.prototype.getNumVertices=function(){return oi(this.J)};zz.prototype.initializePolyhedralFeatures=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return!!pi(b,a)};zz.prototype.recalcLocalAabb=function(){qi(this.J)};zz.prototype.getConvexPolyhedron=function(){return m(li(this.J),mz)}; -zz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ri(b,a)};zz.prototype.getLocalScaling=function(){return m(mi(this.J),r)};zz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);ki(e,a,b)};zz.prototype.__destroy__=function(){ei(this.J)};function K(){this.J=sw();l(K)[this.J]=this}K.prototype=Object.create(k.prototype);K.prototype.constructor=K;K.prototype.K=K;K.L={};d.btVehicleTuning=K; -K.prototype.get_m_suspensionStiffness=K.prototype.X=function(){return yw(this.J)};K.prototype.set_m_suspensionStiffness=K.prototype.da=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ew(b,a)};Object.defineProperty(K.prototype,"m_suspensionStiffness",{get:K.prototype.X,set:K.prototype.da});K.prototype.get_m_suspensionCompression=K.prototype.Jc=function(){return ww(this.J)}; -K.prototype.set_m_suspensionCompression=K.prototype.sf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Cw(b,a)};Object.defineProperty(K.prototype,"m_suspensionCompression",{get:K.prototype.Jc,set:K.prototype.sf});K.prototype.get_m_suspensionDamping=K.prototype.Kc=function(){return xw(this.J)};K.prototype.set_m_suspensionDamping=K.prototype.tf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dw(b,a)};Object.defineProperty(K.prototype,"m_suspensionDamping",{get:K.prototype.Kc,set:K.prototype.tf}); -K.prototype.get_m_maxSuspensionTravelCm=K.prototype.W=function(){return vw(this.J)};K.prototype.set_m_maxSuspensionTravelCm=K.prototype.ba=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bw(b,a)};Object.defineProperty(K.prototype,"m_maxSuspensionTravelCm",{get:K.prototype.W,set:K.prototype.ba});K.prototype.get_m_frictionSlip=K.prototype.U=function(){return tw(this.J)};K.prototype.set_m_frictionSlip=K.prototype.$=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zw(b,a)}; -Object.defineProperty(K.prototype,"m_frictionSlip",{get:K.prototype.U,set:K.prototype.$});K.prototype.get_m_maxSuspensionForce=K.prototype.V=function(){return uw(this.J)};K.prototype.set_m_maxSuspensionForce=K.prototype.aa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Aw(b,a)};Object.defineProperty(K.prototype,"m_maxSuspensionForce",{get:K.prototype.V,set:K.prototype.aa});function Az(){throw"cannot construct a btCollisionObjectWrapper, no constructor in IDL";}Az.prototype=Object.create(k.prototype); -Az.prototype.constructor=Az;Az.prototype.K=Az;Az.L={};d.btCollisionObjectWrapper=Az;function Bz(a){a&&"object"===typeof a&&(a=a.J);this.J=Xr(a);l(Bz)[this.J]=this}Bz.prototype=Object.create(k.prototype);Bz.prototype.constructor=Bz;Bz.prototype.K=Bz;Bz.L={};d.btShapeHull=Bz;Bz.prototype.buildHull=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return!!Yr(b,a)};Bz.prototype.numVertices=function(){return $r(this.J)};Bz.prototype.getVertexPointer=function(){return m(Zr(this.J),r)}; -Bz.prototype.__destroy__=function(){Wr(this.J)};function Cz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=void 0===a?oj():void 0===b?pj(a):qj(a,b);l(Cz)[this.J]=this}Cz.prototype=Object.create(bz.prototype);Cz.prototype.constructor=Cz;Cz.prototype.K=Cz;Cz.L={};d.btDefaultMotionState=Cz;Cz.prototype.getWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);rj(b,a)}; -Cz.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tj(b,a)};Cz.prototype.get_m_graphicsWorldTrans=Cz.prototype.Mb=function(){return m(sj(this.J),u)};Cz.prototype.set_m_graphicsWorldTrans=Cz.prototype.ue=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);uj(b,a)};Object.defineProperty(Cz.prototype,"m_graphicsWorldTrans",{get:Cz.prototype.Mb,set:Cz.prototype.ue});Cz.prototype.__destroy__=function(){nj(this.J)}; -function L(a){a&&"object"===typeof a&&(a=a.J);this.J=ex(a);l(L)[this.J]=this}L.prototype=Object.create(k.prototype);L.prototype.constructor=L;L.prototype.K=L;L.L={};d.btWheelInfo=L;L.prototype.getSuspensionRestLength=function(){return fx(this.J)};L.prototype.updateWheel=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);by(e,a,b)};L.prototype.get_m_suspensionStiffness=L.prototype.X=function(){return wx(this.J)}; -L.prototype.set_m_suspensionStiffness=L.prototype.da=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ux(b,a)};Object.defineProperty(L.prototype,"m_suspensionStiffness",{get:L.prototype.X,set:L.prototype.da});L.prototype.get_m_frictionSlip=L.prototype.U=function(){return mx(this.J)};L.prototype.set_m_frictionSlip=L.prototype.$=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kx(b,a)};Object.defineProperty(L.prototype,"m_frictionSlip",{get:L.prototype.U,set:L.prototype.$}); -L.prototype.get_m_engineForce=L.prototype.Hb=function(){return lx(this.J)};L.prototype.set_m_engineForce=L.prototype.pe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jx(b,a)};Object.defineProperty(L.prototype,"m_engineForce",{get:L.prototype.Hb,set:L.prototype.pe});L.prototype.get_m_rollInfluence=L.prototype.zc=function(){return qx(this.J)};L.prototype.set_m_rollInfluence=L.prototype.gf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ox(b,a)}; -Object.defineProperty(L.prototype,"m_rollInfluence",{get:L.prototype.zc,set:L.prototype.gf});L.prototype.get_m_suspensionRestLength1=L.prototype.Oc=function(){return vx(this.J)};L.prototype.set_m_suspensionRestLength1=L.prototype.xf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tx(b,a)};Object.defineProperty(L.prototype,"m_suspensionRestLength1",{get:L.prototype.Oc,set:L.prototype.xf});L.prototype.get_m_wheelsRadius=L.prototype.ad=function(){return Bx(this.J)}; -L.prototype.set_m_wheelsRadius=L.prototype.Kf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zx(b,a)};Object.defineProperty(L.prototype,"m_wheelsRadius",{get:L.prototype.ad,set:L.prototype.Kf});L.prototype.get_m_wheelsDampingCompression=L.prototype.na=function(){return zx(this.J)};L.prototype.set_m_wheelsDampingCompression=L.prototype.wa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xx(b,a)};Object.defineProperty(L.prototype,"m_wheelsDampingCompression",{get:L.prototype.na,set:L.prototype.wa}); -L.prototype.get_m_wheelsDampingRelaxation=L.prototype.oa=function(){return Ax(this.J)};L.prototype.set_m_wheelsDampingRelaxation=L.prototype.xa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yx(b,a)};Object.defineProperty(L.prototype,"m_wheelsDampingRelaxation",{get:L.prototype.oa,set:L.prototype.xa});L.prototype.get_m_steering=L.prototype.Hc=function(){return tx(this.J)};L.prototype.set_m_steering=L.prototype.qf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rx(b,a)}; -Object.defineProperty(L.prototype,"m_steering",{get:L.prototype.Hc,set:L.prototype.qf});L.prototype.get_m_maxSuspensionForce=L.prototype.V=function(){return nx(this.J)};L.prototype.set_m_maxSuspensionForce=L.prototype.aa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lx(b,a)};Object.defineProperty(L.prototype,"m_maxSuspensionForce",{get:L.prototype.V,set:L.prototype.aa});L.prototype.get_m_maxSuspensionTravelCm=L.prototype.W=function(){return ox(this.J)}; -L.prototype.set_m_maxSuspensionTravelCm=L.prototype.ba=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mx(b,a)};Object.defineProperty(L.prototype,"m_maxSuspensionTravelCm",{get:L.prototype.W,set:L.prototype.ba});L.prototype.get_m_wheelsSuspensionForce=L.prototype.bd=function(){return Cx(this.J)};L.prototype.set_m_wheelsSuspensionForce=L.prototype.Lf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$x(b,a)}; -Object.defineProperty(L.prototype,"m_wheelsSuspensionForce",{get:L.prototype.bd,set:L.prototype.Lf});L.prototype.get_m_bIsFrontWheel=L.prototype.ha=function(){return!!gx(this.J)};L.prototype.set_m_bIsFrontWheel=L.prototype.qa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ex(b,a)};Object.defineProperty(L.prototype,"m_bIsFrontWheel",{get:L.prototype.ha,set:L.prototype.qa});L.prototype.get_m_raycastInfo=L.prototype.xc=function(){return m(px(this.J),M)}; -L.prototype.set_m_raycastInfo=L.prototype.ef=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nx(b,a)};Object.defineProperty(L.prototype,"m_raycastInfo",{get:L.prototype.xc,set:L.prototype.ef});L.prototype.get_m_chassisConnectionPointCS=L.prototype.tb=function(){return m(ix(this.J),r)};L.prototype.set_m_chassisConnectionPointCS=L.prototype.be=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gx(b,a)}; -Object.defineProperty(L.prototype,"m_chassisConnectionPointCS",{get:L.prototype.tb,set:L.prototype.be});L.prototype.get_m_worldTransform=L.prototype.cd=function(){return m(Dx(this.J),u)};L.prototype.set_m_worldTransform=L.prototype.Mf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ay(b,a)};Object.defineProperty(L.prototype,"m_worldTransform",{get:L.prototype.cd,set:L.prototype.Mf});L.prototype.get_m_wheelDirectionCS=L.prototype.ma=function(){return m(yx(this.J),r)}; -L.prototype.set_m_wheelDirectionCS=L.prototype.va=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wx(b,a)};Object.defineProperty(L.prototype,"m_wheelDirectionCS",{get:L.prototype.ma,set:L.prototype.va});L.prototype.get_m_wheelAxleCS=L.prototype.la=function(){return m(xx(this.J),r)};L.prototype.set_m_wheelAxleCS=L.prototype.ua=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vx(b,a)};Object.defineProperty(L.prototype,"m_wheelAxleCS",{get:L.prototype.la,set:L.prototype.ua}); -L.prototype.get_m_rotation=L.prototype.Bc=function(){return rx(this.J)};L.prototype.set_m_rotation=L.prototype.jf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Px(b,a)};Object.defineProperty(L.prototype,"m_rotation",{get:L.prototype.Bc,set:L.prototype.jf});L.prototype.get_m_deltaRotation=L.prototype.Bb=function(){return kx(this.J)};L.prototype.set_m_deltaRotation=L.prototype.je=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ix(b,a)}; -Object.defineProperty(L.prototype,"m_deltaRotation",{get:L.prototype.Bb,set:L.prototype.je});L.prototype.get_m_brake=L.prototype.mb=function(){return hx(this.J)};L.prototype.set_m_brake=L.prototype.Vd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Fx(b,a)};Object.defineProperty(L.prototype,"m_brake",{get:L.prototype.mb,set:L.prototype.Vd});L.prototype.get_m_clippedInvContactDotSuspension=L.prototype.ub=function(){return jx(this.J)}; -L.prototype.set_m_clippedInvContactDotSuspension=L.prototype.ce=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hx(b,a)};Object.defineProperty(L.prototype,"m_clippedInvContactDotSuspension",{get:L.prototype.ub,set:L.prototype.ce});L.prototype.get_m_suspensionRelativeVelocity=L.prototype.Mc=function(){return ux(this.J)};L.prototype.set_m_suspensionRelativeVelocity=L.prototype.vf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sx(b,a)}; -Object.defineProperty(L.prototype,"m_suspensionRelativeVelocity",{get:L.prototype.Mc,set:L.prototype.vf});L.prototype.get_m_skidInfo=L.prototype.Ec=function(){return sx(this.J)};L.prototype.set_m_skidInfo=L.prototype.mf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qx(b,a)};Object.defineProperty(L.prototype,"m_skidInfo",{get:L.prototype.Ec,set:L.prototype.mf});L.prototype.__destroy__=function(){dx(this.J)}; -function N(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=void 0===a?Tv():void 0===b?_emscripten_bind_btVector4_btVector4_1(a):void 0===e?_emscripten_bind_btVector4_btVector4_2(a,b):void 0===f?_emscripten_bind_btVector4_btVector4_3(a,b,e):Uv(a,b,e,f);l(N)[this.J]=this}N.prototype=Object.create(r.prototype);N.prototype.constructor=N;N.prototype.K=N;N.L={};d.btVector4=N;N.prototype.w=N.prototype.za=function(){return fw(this.J)}; -N.prototype.setValue=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);bw(g,a,b,e,f)};N.prototype.length=N.prototype.length=function(){return Wv(this.J)};N.prototype.x=N.prototype.x=function(){return gw(this.J)};N.prototype.y=N.prototype.y=function(){return hw(this.J)};N.prototype.z=N.prototype.z=function(){return iw(this.J)}; -N.prototype.setX=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cw(b,a)};N.prototype.setY=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dw(b,a)};N.prototype.setZ=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ew(b,a)};N.prototype.normalize=N.prototype.normalize=function(){Xv(this.J)};N.prototype.rotate=N.prototype.rotate=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return m(aw(e,a,b),r)}; -N.prototype.dot=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return Vv(b,a)};N.prototype.op_mul=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Zv(b,a),r)};N.prototype.op_add=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Yv(b,a),r)};N.prototype.op_sub=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m($v(b,a),r)};N.prototype.__destroy__=function(){Sv(this.J)};function Dz(){this.J=mj();l(Dz)[this.J]=this}Dz.prototype=Object.create(k.prototype); -Dz.prototype.constructor=Dz;Dz.prototype.K=Dz;Dz.L={};d.btDefaultCollisionConstructionInfo=Dz;Dz.prototype.__destroy__=function(){lj(this.J)};function O(){throw"cannot construct a Anchor, no constructor in IDL";}O.prototype=Object.create(k.prototype);O.prototype.constructor=O;O.prototype.K=O;O.L={};d.Anchor=O;O.prototype.get_m_node=O.prototype.nc=function(){return m(nb(this.J),Node)};O.prototype.set_m_node=O.prototype.Ve=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ub(b,a)}; -Object.defineProperty(O.prototype,"m_node",{get:O.prototype.nc,set:O.prototype.Ve});O.prototype.get_m_local=O.prototype.fc=function(){return m(mb(this.J),r)};O.prototype.set_m_local=O.prototype.Oe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tb(b,a)};Object.defineProperty(O.prototype,"m_local",{get:O.prototype.fc,set:O.prototype.Oe});O.prototype.get_m_body=O.prototype.lb=function(){return m(hb(this.J),I)}; -O.prototype.set_m_body=O.prototype.Ud=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ob(b,a)};Object.defineProperty(O.prototype,"m_body",{get:O.prototype.lb,set:O.prototype.Ud});O.prototype.get_m_influence=O.prototype.Zb=function(){return lb(this.J)};O.prototype.set_m_influence=O.prototype.He=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);sb(b,a)};Object.defineProperty(O.prototype,"m_influence",{get:O.prototype.Zb,set:O.prototype.He}); -O.prototype.get_m_c0=O.prototype.ob=function(){return m(ib(this.J),ez)};O.prototype.set_m_c0=O.prototype.Xd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);pb(b,a)};Object.defineProperty(O.prototype,"m_c0",{get:O.prototype.ob,set:O.prototype.Xd});O.prototype.get_m_c1=O.prototype.pb=function(){return m(jb(this.J),r)};O.prototype.set_m_c1=O.prototype.Yd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);qb(b,a)};Object.defineProperty(O.prototype,"m_c1",{get:O.prototype.pb,set:O.prototype.Yd}); -O.prototype.get_m_c2=O.prototype.qb=function(){return kb(this.J)};O.prototype.set_m_c2=O.prototype.Zd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);rb(b,a)};Object.defineProperty(O.prototype,"m_c2",{get:O.prototype.qb,set:O.prototype.Zd});O.prototype.__destroy__=function(){gb(this.J)};function P(){throw"cannot construct a btVehicleRaycasterResult, no constructor in IDL";}P.prototype=Object.create(k.prototype);P.prototype.constructor=P;P.prototype.K=P;P.L={};d.btVehicleRaycasterResult=P; -P.prototype.get_m_hitPointInWorld=P.prototype.Ub=function(){return m(mw(this.J),r)};P.prototype.set_m_hitPointInWorld=P.prototype.Ce=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);pw(b,a)};Object.defineProperty(P.prototype,"m_hitPointInWorld",{get:P.prototype.Ub,set:P.prototype.Ce});P.prototype.get_m_hitNormalInWorld=P.prototype.Sb=function(){return m(lw(this.J),r)};P.prototype.set_m_hitNormalInWorld=P.prototype.Ae=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ow(b,a)}; -Object.defineProperty(P.prototype,"m_hitNormalInWorld",{get:P.prototype.Sb,set:P.prototype.Ae});P.prototype.get_m_distFraction=P.prototype.Eb=function(){return kw(this.J)};P.prototype.set_m_distFraction=P.prototype.me=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);nw(b,a)};Object.defineProperty(P.prototype,"m_distFraction",{get:P.prototype.Eb,set:P.prototype.me});P.prototype.__destroy__=function(){jw(this.J)}; -function nz(){throw"cannot construct a btVector3Array, no constructor in IDL";}nz.prototype=Object.create(k.prototype);nz.prototype.constructor=nz;nz.prototype.K=nz;nz.L={};d.btVector3Array=nz;nz.prototype.size=nz.prototype.size=function(){return Av(this.J)};nz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(zv(b,a),r)};nz.prototype.__destroy__=function(){yv(this.J)};function Ez(){throw"cannot construct a btConstraintSolver, no constructor in IDL";}Ez.prototype=Object.create(k.prototype); -Ez.prototype.constructor=Ez;Ez.prototype.K=Ez;Ez.L={};d.btConstraintSolver=Ez;Ez.prototype.__destroy__=function(){Xh(this.J)};function R(a,b,e){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);this.J=Pp(a,b,e);l(R)[this.J]=this}R.prototype=Object.create(Uy.prototype);R.prototype.constructor=R;R.prototype.K=R;R.L={};d.btRaycastVehicle=R; -R.prototype.applyEngineForce=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Op(e,a,b)};R.prototype.setSteeringValue=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);hq(e,a,b)};R.prototype.getWheelTransformWS=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(bq(b,a),u)}; -R.prototype.updateWheelTransform=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);oq(e,a,b)};R.prototype.addWheel=function(a,b,e,f,g,n,A){var Q=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);return m(Np(Q,a,b,e,f,g,n,A),L)};R.prototype.getNumWheels=function(){return Up(this.J)}; -R.prototype.getRigidBody=function(){return m(Wp(this.J),I)};R.prototype.getWheelInfo=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(aq(b,a),L)};R.prototype.setBrake=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);eq(e,a,b)};R.prototype.setCoordinateSystem=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);fq(f,a,b,e)};R.prototype.getCurrentSpeedKmHour=function(){return Rp(this.J)}; -R.prototype.getChassisWorldTransform=function(){return m(Qp(this.J),u)};R.prototype.rayCast=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return cq(b,a)};R.prototype.updateVehicle=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);nq(b,a)};R.prototype.resetSuspension=function(){dq(this.J)};R.prototype.getSteeringValue=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return Xp(b,a)}; -R.prototype.updateWheelTransformsWS=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);void 0===b?pq(e,a):qq(e,a,b)};R.prototype.setPitchControl=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gq(b,a)};R.prototype.updateSuspension=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);mq(b,a)};R.prototype.updateFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);lq(b,a)};R.prototype.getRightAxis=function(){return Vp(this.J)}; -R.prototype.getUpAxis=function(){return Yp(this.J)};R.prototype.getForwardAxis=function(){return Sp(this.J)};R.prototype.getForwardVector=function(){return m(Tp(this.J),r)};R.prototype.getUserConstraintType=function(){return $p(this.J)};R.prototype.setUserConstraintType=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);jq(b,a)};R.prototype.setUserConstraintId=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);iq(b,a)};R.prototype.getUserConstraintId=function(){return Zp(this.J)}; -R.prototype.updateAction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);kq(e,a,b)};R.prototype.__destroy__=function(){Mp(this.J)};function Fz(a){a&&"object"===typeof a&&(a=a.J);this.J=Ni(a);l(Fz)[this.J]=this}Fz.prototype=Object.create(Xy.prototype);Fz.prototype.constructor=Fz;Fz.prototype.K=Fz;Fz.L={};d.btCylinderShapeX=Fz;Fz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Si(b,a)};Fz.prototype.getMargin=function(){return Qi(this.J)}; -Fz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ri(b,a)};Fz.prototype.getLocalScaling=function(){return m(Pi(this.J),r)};Fz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Oi(e,a,b)};Fz.prototype.__destroy__=function(){Mi(this.J)};function Gz(a){a&&"object"===typeof a&&(a=a.J);this.J=Ui(a);l(Gz)[this.J]=this}Gz.prototype=Object.create(Xy.prototype);Gz.prototype.constructor=Gz; -Gz.prototype.K=Gz;Gz.L={};d.btCylinderShapeZ=Gz;Gz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zi(b,a)};Gz.prototype.getMargin=function(){return Xi(this.J)};Gz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yi(b,a)};Gz.prototype.getLocalScaling=function(){return m(Wi(this.J),r)};Gz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Vi(e,a,b)}; -Gz.prototype.__destroy__=function(){Ti(this.J)};function Hz(){this.J=Vr();l(Hz)[this.J]=this}Hz.prototype=Object.create(k.prototype);Hz.prototype.constructor=Hz;Hz.prototype.K=Hz;Hz.L={};d.btSequentialImpulseConstraintSolver=Hz;Hz.prototype.__destroy__=function(){Ur(this.J)};function Iz(){throw"cannot construct a tAnchorArray, no constructor in IDL";}Iz.prototype=Object.create(k.prototype);Iz.prototype.constructor=Iz;Iz.prototype.K=Iz;Iz.L={};d.tAnchorArray=Iz; -Iz.prototype.size=Iz.prototype.size=function(){return hy(this.J)};Iz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(dy(b,a),O)};Iz.prototype.clear=Iz.prototype.clear=function(){ey(this.J)};Iz.prototype.push_back=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gy(b,a)};Iz.prototype.pop_back=function(){fy(this.J)};Iz.prototype.__destroy__=function(){cy(this.J)};function M(){throw"cannot construct a RaycastInfo, no constructor in IDL";}M.prototype=Object.create(k.prototype); -M.prototype.constructor=M;M.prototype.K=M;M.L={};d.RaycastInfo=M;M.prototype.get_m_contactNormalWS=M.prototype.vb=function(){return m(ye(this.J),r)};M.prototype.set_m_contactNormalWS=M.prototype.de=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ge(b,a)};Object.defineProperty(M.prototype,"m_contactNormalWS",{get:M.prototype.vb,set:M.prototype.de});M.prototype.get_m_contactPointWS=M.prototype.wb=function(){return m(ze(this.J),r)}; -M.prototype.set_m_contactPointWS=M.prototype.ee=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);He(b,a)};Object.defineProperty(M.prototype,"m_contactPointWS",{get:M.prototype.wb,set:M.prototype.ee});M.prototype.get_m_suspensionLength=M.prototype.Lc=function(){return De(this.J)};M.prototype.set_m_suspensionLength=M.prototype.uf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Le(b,a)};Object.defineProperty(M.prototype,"m_suspensionLength",{get:M.prototype.Lc,set:M.prototype.uf}); -M.prototype.get_m_hardPointWS=M.prototype.Pb=function(){return m(Be(this.J),r)};M.prototype.set_m_hardPointWS=M.prototype.xe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Je(b,a)};Object.defineProperty(M.prototype,"m_hardPointWS",{get:M.prototype.Pb,set:M.prototype.xe});M.prototype.get_m_wheelDirectionWS=M.prototype.Zc=function(){return m(Fe(this.J),r)};M.prototype.set_m_wheelDirectionWS=M.prototype.If=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ne(b,a)}; -Object.defineProperty(M.prototype,"m_wheelDirectionWS",{get:M.prototype.Zc,set:M.prototype.If});M.prototype.get_m_wheelAxleWS=M.prototype.Yc=function(){return m(Ee(this.J),r)};M.prototype.set_m_wheelAxleWS=M.prototype.Hf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Me(b,a)};Object.defineProperty(M.prototype,"m_wheelAxleWS",{get:M.prototype.Yc,set:M.prototype.Hf});M.prototype.get_m_isInContact=M.prototype.$b=function(){return!!Ce(this.J)}; -M.prototype.set_m_isInContact=M.prototype.Ie=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ke(b,a)};Object.defineProperty(M.prototype,"m_isInContact",{get:M.prototype.$b,set:M.prototype.Ie});M.prototype.get_m_groundObject=M.prototype.Ob=function(){return Ae(this.J)};M.prototype.set_m_groundObject=M.prototype.we=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ie(b,a)};Object.defineProperty(M.prototype,"m_groundObject",{get:M.prototype.Ob,set:M.prototype.we}); -M.prototype.__destroy__=function(){xe(this.J)};function Jz(){throw"cannot construct a tNodeArray, no constructor in IDL";}Jz.prototype=Object.create(k.prototype);Jz.prototype.constructor=Jz;Jz.prototype.K=Jz;Jz.L={};d.tNodeArray=Jz;Jz.prototype.size=Jz.prototype.size=function(){return ny(this.J)};Jz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(my(b,a),Node)};Jz.prototype.__destroy__=function(){ly(this.J)}; -function S(a,b,e,f){c.M();a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);"object"==typeof f&&(f=Hy(f));this.J=ht(a,b,e,f);l(S)[this.J]=this}S.prototype=Object.create(t.prototype);S.prototype.constructor=S;S.prototype.K=S;S.L={};d.btSoftBody=S;S.prototype.checkLink=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return!!jt(e,a,b)}; -S.prototype.checkFace=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);return!!it(f,a,b,e)};S.prototype.appendMaterial=function(){return m(et(this.J),C)};S.prototype.appendNode=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);ft(e,a,b)}; -S.prototype.appendLink=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);dt(g,a,b,e,f)};S.prototype.appendFace=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);ct(g,a,b,e,f)}; -S.prototype.appendTetra=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);gt(n,a,b,e,f,g)};S.prototype.appendAnchor=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);bt(g,a,b,e,f)}; -S.prototype.addForce=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);void 0===b?$s(e,a):at(e,a,b)};S.prototype.addAeroForceToNode=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Zs(e,a,b)};S.prototype.getTotalMass=function(){return qt(this.J)};S.prototype.setTotalMass=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Pt(e,a,b)}; -S.prototype.setMass=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Mt(e,a,b)};S.prototype.transform=S.prototype.transform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xt(b,a)};S.prototype.translate=S.prototype.translate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yt(b,a)};S.prototype.rotate=S.prototype.rotate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ct(b,a)}; -S.prototype.scale=S.prototype.scale=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Dt(b,a)};S.prototype.generateClusters=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return void 0===b?mt(e,a):nt(e,a,b)};S.prototype.generateBendingConstraints=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return lt(e,a,b)};S.prototype.upcast=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Zt(b,a),S)}; -S.prototype.setAnisotropicFriction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Ft(e,a,b)};S.prototype.getCollisionShape=function(){return m(pt(this.J),q)};S.prototype.setContactProcessingThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kt(b,a)};S.prototype.setActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Et(b,a)}; -S.prototype.forceActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);kt(b,a)};S.prototype.activate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);void 0===a?Xs(b):Ys(b,a)};S.prototype.isActive=function(){return!!yt(this.J)};S.prototype.isKinematicObject=function(){return!!zt(this.J)};S.prototype.isStaticObject=function(){return!!At(this.J)};S.prototype.isStaticOrKinematicObject=function(){return!!Bt(this.J)}; -S.prototype.setRestitution=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nt(b,a)};S.prototype.setFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lt(b,a)};S.prototype.setRollingFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ot(b,a)};S.prototype.getWorldTransform=function(){return m(tt(this.J),u)};S.prototype.getCollisionFlags=function(){return ot(this.J)};S.prototype.setCollisionFlags=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);It(b,a)}; -S.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);St(b,a)};S.prototype.setCollisionShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jt(b,a)};S.prototype.setCcdMotionThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gt(b,a)};S.prototype.setCcdSweptSphereRadius=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ht(b,a)};S.prototype.getUserIndex=function(){return rt(this.J)}; -S.prototype.setUserIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qt(b,a)};S.prototype.getUserPointer=function(){return m(st(this.J),Ny)};S.prototype.setUserPointer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rt(b,a)};S.prototype.get_m_cfg=S.prototype.rb=function(){return m(vt(this.J),T)};S.prototype.set_m_cfg=S.prototype.$d=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ut(b,a)};Object.defineProperty(S.prototype,"m_cfg",{get:S.prototype.rb,set:S.prototype.$d}); -S.prototype.get_m_nodes=S.prototype.oc=function(){return m(xt(this.J),Jz)};S.prototype.set_m_nodes=S.prototype.We=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wt(b,a)};Object.defineProperty(S.prototype,"m_nodes",{get:S.prototype.oc,set:S.prototype.We});S.prototype.get_m_materials=S.prototype.kc=function(){return m(wt(this.J),iz)};S.prototype.set_m_materials=S.prototype.Se=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vt(b,a)}; -Object.defineProperty(S.prototype,"m_materials",{get:S.prototype.kc,set:S.prototype.Se});S.prototype.get_m_anchors=S.prototype.hb=function(){return m(ut(this.J),Iz)};S.prototype.set_m_anchors=S.prototype.Qd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tt(b,a)};Object.defineProperty(S.prototype,"m_anchors",{get:S.prototype.hb,set:S.prototype.Qd});S.prototype.__destroy__=function(){Ws(this.J)};function Kz(){throw"cannot construct a btIntArray, no constructor in IDL";}Kz.prototype=Object.create(k.prototype); -Kz.prototype.constructor=Kz;Kz.prototype.K=Kz;Kz.L={};d.btIntArray=Kz;Kz.prototype.size=Kz.prototype.size=function(){return gn(this.J)};Kz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return fn(b,a)};Kz.prototype.__destroy__=function(){en(this.J)};function T(){throw"cannot construct a Config, no constructor in IDL";}T.prototype=Object.create(k.prototype);T.prototype.constructor=T;T.prototype.K=T;T.L={};d.Config=T;T.prototype.get_kVCF=T.prototype.$a=function(){return Dc(this.J)}; -T.prototype.set_kVCF=T.prototype.Jd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bd(b,a)};Object.defineProperty(T.prototype,"kVCF",{get:T.prototype.$a,set:T.prototype.Jd});T.prototype.get_kDP=T.prototype.Na=function(){return rc(this.J)};T.prototype.set_kDP=T.prototype.wd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qc(b,a)};Object.defineProperty(T.prototype,"kDP",{get:T.prototype.Na,set:T.prototype.wd});T.prototype.get_kDG=T.prototype.Ma=function(){return qc(this.J)}; -T.prototype.set_kDG=T.prototype.vd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pc(b,a)};Object.defineProperty(T.prototype,"kDG",{get:T.prototype.Ma,set:T.prototype.vd});T.prototype.get_kLF=T.prototype.Pa=function(){return tc(this.J)};T.prototype.set_kLF=T.prototype.yd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sc(b,a)};Object.defineProperty(T.prototype,"kLF",{get:T.prototype.Pa,set:T.prototype.yd});T.prototype.get_kPR=T.prototype.Ra=function(){return vc(this.J)}; -T.prototype.set_kPR=T.prototype.Ad=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Uc(b,a)};Object.defineProperty(T.prototype,"kPR",{get:T.prototype.Ra,set:T.prototype.Ad});T.prototype.get_kVC=T.prototype.Za=function(){return Ec(this.J)};T.prototype.set_kVC=T.prototype.Id=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cd(b,a)};Object.defineProperty(T.prototype,"kVC",{get:T.prototype.Za,set:T.prototype.Id});T.prototype.get_kDF=T.prototype.La=function(){return pc(this.J)}; -T.prototype.set_kDF=T.prototype.ud=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Oc(b,a)};Object.defineProperty(T.prototype,"kDF",{get:T.prototype.La,set:T.prototype.ud});T.prototype.get_kMT=T.prototype.Qa=function(){return uc(this.J)};T.prototype.set_kMT=T.prototype.zd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tc(b,a)};Object.defineProperty(T.prototype,"kMT",{get:T.prototype.Qa,set:T.prototype.zd});T.prototype.get_kCHR=T.prototype.Ka=function(){return oc(this.J)}; -T.prototype.set_kCHR=T.prototype.td=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nc(b,a)};Object.defineProperty(T.prototype,"kCHR",{get:T.prototype.Ka,set:T.prototype.td});T.prototype.get_kKHR=T.prototype.Oa=function(){return sc(this.J)};T.prototype.set_kKHR=T.prototype.xd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rc(b,a)};Object.defineProperty(T.prototype,"kKHR",{get:T.prototype.Oa,set:T.prototype.xd});T.prototype.get_kSHR=T.prototype.Sa=function(){return wc(this.J)}; -T.prototype.set_kSHR=T.prototype.Bd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vc(b,a)};Object.defineProperty(T.prototype,"kSHR",{get:T.prototype.Sa,set:T.prototype.Bd});T.prototype.get_kAHR=T.prototype.Ja=function(){return nc(this.J)};T.prototype.set_kAHR=T.prototype.sd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Mc(b,a)};Object.defineProperty(T.prototype,"kAHR",{get:T.prototype.Ja,set:T.prototype.sd});T.prototype.get_kSRHR_CL=T.prototype.Va=function(){return zc(this.J)}; -T.prototype.set_kSRHR_CL=T.prototype.Ed=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yc(b,a)};Object.defineProperty(T.prototype,"kSRHR_CL",{get:T.prototype.Va,set:T.prototype.Ed});T.prototype.get_kSKHR_CL=T.prototype.Ta=function(){return xc(this.J)};T.prototype.set_kSKHR_CL=T.prototype.Cd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wc(b,a)};Object.defineProperty(T.prototype,"kSKHR_CL",{get:T.prototype.Ta,set:T.prototype.Cd});T.prototype.get_kSSHR_CL=T.prototype.Xa=function(){return Bc(this.J)}; -T.prototype.set_kSSHR_CL=T.prototype.Gd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$c(b,a)};Object.defineProperty(T.prototype,"kSSHR_CL",{get:T.prototype.Xa,set:T.prototype.Gd});T.prototype.get_kSR_SPLT_CL=T.prototype.Wa=function(){return Ac(this.J)};T.prototype.set_kSR_SPLT_CL=T.prototype.Fd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zc(b,a)};Object.defineProperty(T.prototype,"kSR_SPLT_CL",{get:T.prototype.Wa,set:T.prototype.Fd}); -T.prototype.get_kSK_SPLT_CL=T.prototype.Ua=function(){return yc(this.J)};T.prototype.set_kSK_SPLT_CL=T.prototype.Dd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Xc(b,a)};Object.defineProperty(T.prototype,"kSK_SPLT_CL",{get:T.prototype.Ua,set:T.prototype.Dd});T.prototype.get_kSS_SPLT_CL=T.prototype.Ya=function(){return Cc(this.J)};T.prototype.set_kSS_SPLT_CL=T.prototype.Hd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ad(b,a)}; -Object.defineProperty(T.prototype,"kSS_SPLT_CL",{get:T.prototype.Ya,set:T.prototype.Hd});T.prototype.get_maxvolume=T.prototype.ed=function(){return Fc(this.J)};T.prototype.set_maxvolume=T.prototype.Of=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dd(b,a)};Object.defineProperty(T.prototype,"maxvolume",{get:T.prototype.ed,set:T.prototype.Of});T.prototype.get_timescale=T.prototype.hd=function(){return Hc(this.J)}; -T.prototype.set_timescale=T.prototype.Qf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);fd(b,a)};Object.defineProperty(T.prototype,"timescale",{get:T.prototype.hd,set:T.prototype.Qf});T.prototype.get_viterations=T.prototype.jd=function(){return Ic(this.J)};T.prototype.set_viterations=T.prototype.Rf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gd(b,a)};Object.defineProperty(T.prototype,"viterations",{get:T.prototype.jd,set:T.prototype.Rf}); -T.prototype.get_piterations=T.prototype.gd=function(){return Gc(this.J)};T.prototype.set_piterations=T.prototype.Pf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ed(b,a)};Object.defineProperty(T.prototype,"piterations",{get:T.prototype.gd,set:T.prototype.Pf});T.prototype.get_diterations=T.prototype.Ia=function(){return mc(this.J)};T.prototype.set_diterations=T.prototype.rd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Lc(b,a)}; -Object.defineProperty(T.prototype,"diterations",{get:T.prototype.Ia,set:T.prototype.rd});T.prototype.get_citerations=T.prototype.Ga=function(){return kc(this.J)};T.prototype.set_citerations=T.prototype.pd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jc(b,a)};Object.defineProperty(T.prototype,"citerations",{get:T.prototype.Ga,set:T.prototype.pd});T.prototype.get_collisions=T.prototype.Ha=function(){return lc(this.J)}; -T.prototype.set_collisions=T.prototype.qd=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kc(b,a)};Object.defineProperty(T.prototype,"collisions",{get:T.prototype.Ha,set:T.prototype.qd});T.prototype.__destroy__=function(){jc(this.J)};function Node(){throw"cannot construct a Node, no constructor in IDL";}Node.prototype=Object.create(k.prototype);Node.prototype.constructor=Node;Node.prototype.K=Node;Node.L={};d.Node=Node; -Node.prototype.get_m_x=Node.prototype.dd=function(){return m(fe(this.J),r)};Node.prototype.set_m_x=Node.prototype.Nf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);me(b,a)};Object.defineProperty(Node.prototype,"m_x",{get:Node.prototype.dd,set:Node.prototype.Nf});Node.prototype.get_m_q=Node.prototype.uc=function(){return m(de(this.J),r)};Node.prototype.set_m_q=Node.prototype.bf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ke(b,a)}; -Object.defineProperty(Node.prototype,"m_q",{get:Node.prototype.uc,set:Node.prototype.bf});Node.prototype.get_m_v=Node.prototype.Wc=function(){return m(ee(this.J),r)};Node.prototype.set_m_v=Node.prototype.Ff=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);le(b,a)};Object.defineProperty(Node.prototype,"m_v",{get:Node.prototype.Wc,set:Node.prototype.Ff});Node.prototype.get_m_f=Node.prototype.Ib=function(){return m(ae(this.J),r)}; -Node.prototype.set_m_f=Node.prototype.qe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);he(b,a)};Object.defineProperty(Node.prototype,"m_f",{get:Node.prototype.Ib,set:Node.prototype.qe});Node.prototype.get_m_n=Node.prototype.mc=function(){return m(ce(this.J),r)};Node.prototype.set_m_n=Node.prototype.Ue=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);je(b,a)};Object.defineProperty(Node.prototype,"m_n",{get:Node.prototype.mc,set:Node.prototype.Ue}); -Node.prototype.get_m_im=Node.prototype.Wb=function(){return be(this.J)};Node.prototype.set_m_im=Node.prototype.Ee=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ie(b,a)};Object.defineProperty(Node.prototype,"m_im",{get:Node.prototype.Wb,set:Node.prototype.Ee});Node.prototype.get_m_area=Node.prototype.kb=function(){return $d(this.J)};Node.prototype.set_m_area=Node.prototype.Td=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ge(b,a)}; -Object.defineProperty(Node.prototype,"m_area",{get:Node.prototype.kb,set:Node.prototype.Td});Node.prototype.__destroy__=function(){Zd(this.J)};function Lz(){this.J=xm();l(Lz)[this.J]=this}Lz.prototype=Object.create(k.prototype);Lz.prototype.constructor=Lz;Lz.prototype.K=Lz;Lz.L={};d.btGhostPairCallback=Lz;Lz.prototype.__destroy__=function(){wm(this.J)};function Mz(){throw"cannot construct a btOverlappingPairCallback, no constructor in IDL";}Mz.prototype=Object.create(k.prototype); -Mz.prototype.constructor=Mz;Mz.prototype.K=Mz;Mz.L={};d.btOverlappingPairCallback=Mz;Mz.prototype.__destroy__=function(){co(this.J)};function U(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=void 0===f?jn(a,b,e):kn(a,b,e,f);l(U)[this.J]=this}U.prototype=Object.create(Uy.prototype);U.prototype.constructor=U;U.prototype.K=U;U.L={};d.btKinematicCharacterController=U; -U.prototype.setUpAxis=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yn(b,a)};U.prototype.setWalkDirection=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Cn(b,a)};U.prototype.setVelocityForTimeInterval=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Bn(e,a,b)};U.prototype.warp=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);En(b,a)};U.prototype.preStep=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);sn(b,a)}; -U.prototype.playerStep=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);rn(e,a,b)};U.prototype.setFallSpeed=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);tn(b,a)};U.prototype.setJumpSpeed=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);vn(b,a)};U.prototype.setMaxJumpHeight=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wn(b,a)};U.prototype.canJump=function(){return!!ln(this.J)};U.prototype.jump=function(){pn(this.J)}; -U.prototype.setGravity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);un(b,a)};U.prototype.getGravity=function(){return nn(this.J)};U.prototype.setMaxSlope=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xn(b,a)};U.prototype.getMaxSlope=function(){return on(this.J)};U.prototype.getGhostObject=function(){return m(mn(this.J),V)};U.prototype.setUseGhostSweepTest=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);An(b,a)};U.prototype.onGround=function(){return!!qn(this.J)}; -U.prototype.setUpInterpolate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zn(b,a)};U.prototype.updateAction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Dn(e,a,b)};U.prototype.__destroy__=function(){hn(this.J)};function Nz(){throw"cannot construct a btSoftBodyArray, no constructor in IDL";}Nz.prototype=Object.create(k.prototype);Nz.prototype.constructor=Nz;Nz.prototype.K=Nz;Nz.L={};d.btSoftBodyArray=Nz;Nz.prototype.size=Nz.prototype.size=function(){return qs(this.J)}; -Nz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(ps(b,a),S)};Nz.prototype.__destroy__=function(){ns(this.J)};function oz(){throw"cannot construct a btFaceArray, no constructor in IDL";}oz.prototype=Object.create(k.prototype);oz.prototype.constructor=oz;oz.prototype.K=oz;oz.L={};d.btFaceArray=oz;oz.prototype.size=oz.prototype.size=function(){return dl(this.J)};oz.prototype.at=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(cl(b,a),Oz)}; -oz.prototype.__destroy__=function(){bl(this.J)};function Pz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=Su(a,b);l(Pz)[this.J]=this}Pz.prototype=Object.create(Py.prototype);Pz.prototype.constructor=Pz;Pz.prototype.K=Pz;Pz.L={};d.btStaticPlaneShape=Pz;Pz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Vu(b,a)};Pz.prototype.getLocalScaling=function(){return m(Uu(this.J),r)}; -Pz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Tu(e,a,b)};Pz.prototype.__destroy__=function(){Ru(this.J)};function Ky(){throw"cannot construct a btOverlappingPairCache, no constructor in IDL";}Ky.prototype=Object.create(k.prototype);Ky.prototype.constructor=Ky;Ky.prototype.K=Ky;Ky.L={};d.btOverlappingPairCache=Ky;Ky.prototype.setInternalGhostPairCallback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bo(b,a)}; -Ky.prototype.__destroy__=function(){ao(this.J)};function W(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=ju(a,b,e,f,g);l(W)[this.J]=this}W.prototype=Object.create(z.prototype);W.prototype.constructor=W;W.prototype.K=W;W.L={};d.btSoftRigidDynamicsWorld=W; -W.prototype.addSoftBody=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);iu(f,a,b,e)};W.prototype.removeSoftBody=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Du(b,a)};W.prototype.removeCollisionObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Au(b,a)};W.prototype.getWorldInfo=function(){return m(xu(this.J),J)};W.prototype.getSoftBodyArray=function(){return m(vu(this.J),Nz)}; -W.prototype.getDispatcher=function(){return m(su(this.J),Jy)};W.prototype.rayTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);yu(f,a,b,e)};W.prototype.getPairCache=function(){return m(uu(this.J),Ky)};W.prototype.getDispatchInfo=function(){return m(ru(this.J),p)}; -W.prototype.addCollisionObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?bu(f,a):void 0===e?cu(f,a,b):du(f,a,b,e)};W.prototype.getBroadphase=function(){return m(pu(this.J),Ly)}; -W.prototype.convexSweepTest=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);mu(n,a,b,e,f,g)};W.prototype.contactPairTest=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);ku(f,a,b,e)}; -W.prototype.contactTest=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);lu(e,a,b)};W.prototype.updateSingleAabb=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ju(b,a)};W.prototype.setDebugDrawer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Eu(b,a)};W.prototype.getDebugDrawer=function(){return m(qu(this.J),My)};W.prototype.debugDrawWorld=function(){ou(this.J)}; -W.prototype.debugDrawObject=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);nu(f,a,b,e)};W.prototype.setGravity=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Fu(b,a)};W.prototype.getGravity=function(){return m(tu(this.J),r)}; -W.prototype.addRigidBody=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);void 0===b?gu(f,a):void 0===e?_emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_2(f,a,b):hu(f,a,b,e)};W.prototype.removeRigidBody=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Cu(b,a)};W.prototype.addConstraint=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);void 0===b?eu(e,a):fu(e,a,b)}; -W.prototype.removeConstraint=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bu(b,a)};W.prototype.stepSimulation=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);return void 0===b?Gu(f,a):void 0===e?Hu(f,a,b):Iu(f,a,b,e)};W.prototype.addAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);au(b,a)};W.prototype.removeAction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zu(b,a)}; -W.prototype.getSolverInfo=function(){return m(wu(this.J),w)};W.prototype.__destroy__=function(){$t(this.J)};function Qz(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=kl(a,b,e,f);l(Qz)[this.J]=this}Qz.prototype=Object.create(Oy.prototype);Qz.prototype.constructor=Qz;Qz.prototype.K=Qz;Qz.L={};d.btFixedConstraint=Qz; -Qz.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ll(b,a)};Qz.prototype.getBreakingImpulseThreshold=function(){return ml(this.J)};Qz.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ol(b,a)};Qz.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return nl(e,a,b)}; -Qz.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);pl(f,a,b,e)};Qz.prototype.__destroy__=function(){jl(this.J)};function u(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=void 0===a?Yu():void 0===b?_emscripten_bind_btTransform_btTransform_1(a):Zu(a,b);l(u)[this.J]=this}u.prototype=Object.create(k.prototype);u.prototype.constructor=u;u.prototype.K=u;u.L={};d.btTransform=u; -u.prototype.setIdentity=function(){fv(this.J)};u.prototype.setOrigin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gv(b,a)};u.prototype.setRotation=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);hv(b,a)};u.prototype.getOrigin=function(){return m(av(this.J),r)};u.prototype.getRotation=function(){return m(bv(this.J),X)};u.prototype.getBasis=function(){return m($u(this.J),ez)};u.prototype.setFromOpenGLMatrix=function(a){var b=this.J;c.M();"object"==typeof a&&(a=Hy(a));ev(b,a)}; -u.prototype.inverse=u.prototype.inverse=function(){return m(cv(this.J),u)};u.prototype.op_mul=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(dv(b,a),u)};u.prototype.__destroy__=function(){Xu(this.J)};function Y(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=Nb(a,b);l(Y)[this.J]=this}Y.prototype=Object.create(B.prototype);Y.prototype.constructor=Y;Y.prototype.K=Y;Y.L={};d.ClosestRayResultCallback=Y;Y.prototype.hasHit=function(){return!!Xb(this.J)}; -Y.prototype.get_m_rayFromWorld=Y.prototype.vc=function(){return m(Vb(this.J),r)};Y.prototype.set_m_rayFromWorld=Y.prototype.cf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);dc(b,a)};Object.defineProperty(Y.prototype,"m_rayFromWorld",{get:Y.prototype.vc,set:Y.prototype.cf});Y.prototype.get_m_rayToWorld=Y.prototype.wc=function(){return m(Wb(this.J),r)};Y.prototype.set_m_rayToWorld=Y.prototype.df=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ec(b,a)}; -Object.defineProperty(Y.prototype,"m_rayToWorld",{get:Y.prototype.wc,set:Y.prototype.df});Y.prototype.get_m_hitNormalWorld=Y.prototype.ja=function(){return m(Tb(this.J),r)};Y.prototype.set_m_hitNormalWorld=Y.prototype.sa=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bc(b,a)};Object.defineProperty(Y.prototype,"m_hitNormalWorld",{get:Y.prototype.ja,set:Y.prototype.sa});Y.prototype.get_m_hitPointWorld=Y.prototype.ka=function(){return m(Ub(this.J),r)}; -Y.prototype.set_m_hitPointWorld=Y.prototype.ta=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);cc(b,a)};Object.defineProperty(Y.prototype,"m_hitPointWorld",{get:Y.prototype.ka,set:Y.prototype.ta});Y.prototype.get_m_collisionFilterGroup=Y.prototype.N=function(){return Qb(this.J)};Y.prototype.set_m_collisionFilterGroup=Y.prototype.P=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zb(b,a)};Object.defineProperty(Y.prototype,"m_collisionFilterGroup",{get:Y.prototype.N,set:Y.prototype.P}); -Y.prototype.get_m_collisionFilterMask=Y.prototype.O=function(){return Rb(this.J)};Y.prototype.set_m_collisionFilterMask=Y.prototype.R=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$b(b,a)};Object.defineProperty(Y.prototype,"m_collisionFilterMask",{get:Y.prototype.O,set:Y.prototype.R});Y.prototype.get_m_closestHitFraction=Y.prototype.S=function(){return Pb(this.J)};Y.prototype.set_m_closestHitFraction=Y.prototype.T=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yb(b,a)}; -Object.defineProperty(Y.prototype,"m_closestHitFraction",{get:Y.prototype.S,set:Y.prototype.T});Y.prototype.get_m_collisionObject=Y.prototype.ia=function(){return m(Sb(this.J),t)};Y.prototype.set_m_collisionObject=Y.prototype.ra=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ac(b,a)};Object.defineProperty(Y.prototype,"m_collisionObject",{get:Y.prototype.ia,set:Y.prototype.ra});Y.prototype.__destroy__=function(){Ob(this.J)}; -function Rz(a){a&&"object"===typeof a&&(a=a.J);this.J=void 0===a?Bs():Cs(a);l(Rz)[this.J]=this}Rz.prototype=Object.create(Ry.prototype);Rz.prototype.constructor=Rz;Rz.prototype.K=Rz;Rz.L={};d.btSoftBodyRigidBodyCollisionConfiguration=Rz;Rz.prototype.__destroy__=function(){As(this.J)};function Sz(){this.J=fc();l(Sz)[this.J]=this}Sz.prototype=Object.create(cz.prototype);Sz.prototype.constructor=Sz;Sz.prototype.K=Sz;Sz.L={};d.ConcreteContactResultCallback=Sz; -Sz.prototype.addSingleResult=function(a,b,e,f,g,n,A){var Q=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);return ic(Q,a,b,e,f,g,n,A)};Sz.prototype.__destroy__=function(){hc(this.J)}; -function Tz(a,b,e){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);this.J=void 0===e?kf(a,b):lf(a,b,e);l(Tz)[this.J]=this}Tz.prototype=Object.create(Sy.prototype);Tz.prototype.constructor=Tz;Tz.prototype.K=Tz;Tz.L={};d.btBvhTriangleMeshShape=Tz;Tz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);of(b,a)};Tz.prototype.getLocalScaling=function(){return m(nf(this.J),r)}; -Tz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);mf(e,a,b)};Tz.prototype.__destroy__=function(){jf(this.J)}; -function Uz(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=void 0===f?bs(a,b,e):void 0===g?_emscripten_bind_btSliderConstraint_btSliderConstraint_4(a,b,e,f):cs(a,b,e,f,g);l(Uz)[this.J]=this}Uz.prototype=Object.create(Oy.prototype);Uz.prototype.constructor=Uz;Uz.prototype.K=Uz;Uz.L={};d.btSliderConstraint=Uz; -Uz.prototype.setLowerLinLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);js(b,a)};Uz.prototype.setUpperLinLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ms(b,a)};Uz.prototype.setLowerAngLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);is(b,a)};Uz.prototype.setUpperAngLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ls(b,a)};Uz.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ds(b,a)}; -Uz.prototype.getBreakingImpulseThreshold=function(){return es(this.J)};Uz.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);hs(b,a)};Uz.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return gs(e,a,b)};Uz.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);ks(f,a,b,e)};Uz.prototype.__destroy__=function(){as(this.J)}; -function V(){this.J=ho();l(V)[this.J]=this}V.prototype=Object.create(y.prototype);V.prototype.constructor=V;V.prototype.K=V;V.L={};d.btPairCachingGhostObject=V;V.prototype.setAnisotropicFriction=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);vo(e,a,b)};V.prototype.getCollisionShape=function(){return m(ko(this.J),q)};V.prototype.setContactProcessingThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ao(b,a)}; -V.prototype.setActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);uo(b,a)};V.prototype.forceActivationState=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);io(b,a)};V.prototype.activate=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);void 0===a?fo(b):go(b,a)};V.prototype.isActive=function(){return!!qo(this.J)};V.prototype.isKinematicObject=function(){return!!ro(this.J)};V.prototype.isStaticObject=function(){return!!so(this.J)}; -V.prototype.isStaticOrKinematicObject=function(){return!!to(this.J)};V.prototype.setRestitution=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Co(b,a)};V.prototype.setFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Bo(b,a)};V.prototype.setRollingFriction=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Do(b,a)};V.prototype.getWorldTransform=function(){return m(po(this.J),u)};V.prototype.getCollisionFlags=function(){return jo(this.J)}; -V.prototype.setCollisionFlags=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yo(b,a)};V.prototype.setWorldTransform=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Go(b,a)};V.prototype.setCollisionShape=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);zo(b,a)};V.prototype.setCcdMotionThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);wo(b,a)};V.prototype.setCcdSweptSphereRadius=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xo(b,a)}; -V.prototype.getUserIndex=function(){return no(this.J)};V.prototype.setUserIndex=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Eo(b,a)};V.prototype.getUserPointer=function(){return m(oo(this.J),Ny)};V.prototype.setUserPointer=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Fo(b,a)};V.prototype.getNumOverlappingObjects=function(){return lo(this.J)};V.prototype.getOverlappingObject=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(mo(b,a),t)}; -V.prototype.__destroy__=function(){eo(this.J)};function F(){throw"cannot construct a btManifoldPoint, no constructor in IDL";}F.prototype=Object.create(k.prototype);F.prototype.constructor=F;F.prototype.K=F;F.L={};d.btManifoldPoint=F;F.prototype.getPositionWorldOnA=function(){return m(In(this.J),r)};F.prototype.getPositionWorldOnB=function(){return m(Jn(this.J),r)};F.prototype.getAppliedImpulse=function(){return Gn(this.J)};F.prototype.getDistance=function(){return Hn(this.J)}; -F.prototype.get_m_localPointA=F.prototype.hc=function(){return m(Kn(this.J),r)};F.prototype.set_m_localPointA=F.prototype.Pe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pn(b,a)};Object.defineProperty(F.prototype,"m_localPointA",{get:F.prototype.hc,set:F.prototype.Pe});F.prototype.get_m_localPointB=F.prototype.ic=function(){return m(Ln(this.J),r)};F.prototype.set_m_localPointB=F.prototype.Qe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qn(b,a)}; -Object.defineProperty(F.prototype,"m_localPointB",{get:F.prototype.ic,set:F.prototype.Qe});F.prototype.get_m_positionWorldOnB=F.prototype.tc=function(){return m(On(this.J),r)};F.prototype.set_m_positionWorldOnB=F.prototype.af=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Tn(b,a)};Object.defineProperty(F.prototype,"m_positionWorldOnB",{get:F.prototype.tc,set:F.prototype.af});F.prototype.get_m_positionWorldOnA=F.prototype.sc=function(){return m(Nn(this.J),r)}; -F.prototype.set_m_positionWorldOnA=F.prototype.$e=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Sn(b,a)};Object.defineProperty(F.prototype,"m_positionWorldOnA",{get:F.prototype.sc,set:F.prototype.$e});F.prototype.get_m_normalWorldOnB=F.prototype.pc=function(){return m(Mn(this.J),r)};F.prototype.set_m_normalWorldOnB=F.prototype.Xe=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Rn(b,a)};Object.defineProperty(F.prototype,"m_normalWorldOnB",{get:F.prototype.pc,set:F.prototype.Xe}); -F.prototype.__destroy__=function(){Fn(this.J)};function Vz(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=void 0===e?Oo(a,b):void 0===f?_emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_3(a,b,e):Po(a,b,e,f);l(Vz)[this.J]=this}Vz.prototype=Object.create(Oy.prototype);Vz.prototype.constructor=Vz;Vz.prototype.K=Vz;Vz.L={};d.btPoint2PointConstraint=Vz; -Vz.prototype.setPivotA=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Yo(b,a)};Vz.prototype.setPivotB=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Zo(b,a)};Vz.prototype.getPivotInA=function(){return m(To(this.J),r)};Vz.prototype.getPivotInB=function(){return m(Uo(this.J),r)};Vz.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qo(b,a)};Vz.prototype.getBreakingImpulseThreshold=function(){return Ro(this.J)}; -Vz.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Wo(b,a)};Vz.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return So(e,a,b)};Vz.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Xo(f,a,b,e)};Vz.prototype.get_m_setting=Vz.prototype.Cc=function(){return m(Vo(this.J),H)}; -Vz.prototype.set_m_setting=Vz.prototype.kf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);$o(b,a)};Object.defineProperty(Vz.prototype,"m_setting",{get:Vz.prototype.Cc,set:Vz.prototype.kf});Vz.prototype.__destroy__=function(){No(this.J)};function Wz(){this.J=zs();l(Wz)[this.J]=this}Wz.prototype=Object.create(k.prototype);Wz.prototype.constructor=Wz;Wz.prototype.K=Wz;Wz.L={};d.btSoftBodyHelpers=Wz; -Wz.prototype.CreateRope=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);return m(xs(n,a,b,e,f,g),S)}; -Wz.prototype.CreatePatch=function(a,b,e,f,g,n,A,Q,ha){var Lb=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);Q&&"object"===typeof Q&&(Q=Q.J);ha&&"object"===typeof ha&&(ha=ha.J);return m(vs(Lb,a,b,e,f,g,n,A,Q,ha),S)}; -Wz.prototype.CreatePatchUV=function(a,b,e,f,g,n,A,Q,ha,Lb){var cA=this.J;c.M();a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);n&&"object"===typeof n&&(n=n.J);A&&"object"===typeof A&&(A=A.J);Q&&"object"===typeof Q&&(Q=Q.J);ha&&"object"===typeof ha&&(ha=ha.J);"object"==typeof Lb&&(Lb=Hy(Lb));return m(us(cA,a,b,e,f,g,n,A,Q,ha,Lb),S)}; -Wz.prototype.CreateEllipsoid=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);return m(rs(g,a,b,e,f),S)}; -Wz.prototype.CreateFromTriMesh=function(a,b,e,f,g){var n=this.J;c.M();a&&"object"===typeof a&&(a=a.J);"object"==typeof b&&(b=Hy(b));if("object"==typeof e&&"object"===typeof e){var A=c.fa(e,xa);c.copy(e,xa,A);e=A}f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);return m(ts(n,a,b,e,f,g),S)}; -Wz.prototype.CreateFromConvexHull=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);return m(ss(g,a,b,e,f),S)};Wz.prototype.__destroy__=function(){ys(this.J)};function Ny(){throw"cannot construct a VoidPtr, no constructor in IDL";}Ny.prototype=Object.create(k.prototype);Ny.prototype.constructor=Ny;Ny.prototype.K=Ny;Ny.L={};d.VoidPtr=Ny;Ny.prototype.__destroy__=function(){Oe(this.J)}; -function lz(){throw"cannot construct a btBroadphaseProxy, no constructor in IDL";}lz.prototype=Object.create(k.prototype);lz.prototype.constructor=lz;lz.prototype.K=lz;lz.L={};d.btBroadphaseProxy=lz;lz.prototype.get_m_collisionFilterGroup=lz.prototype.N=function(){return ef(this.J)};lz.prototype.set_m_collisionFilterGroup=lz.prototype.P=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);gf(b,a)};Object.defineProperty(lz.prototype,"m_collisionFilterGroup",{get:lz.prototype.N,set:lz.prototype.P}); -lz.prototype.get_m_collisionFilterMask=lz.prototype.O=function(){return ff(this.J)};lz.prototype.set_m_collisionFilterMask=lz.prototype.R=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);hf(b,a)};Object.defineProperty(lz.prototype,"m_collisionFilterMask",{get:lz.prototype.O,set:lz.prototype.R});lz.prototype.__destroy__=function(){df(this.J)};function Xz(a){a&&"object"===typeof a&&(a=a.J);this.J=Xe(a);l(Xz)[this.J]=this}Xz.prototype=Object.create(q.prototype);Xz.prototype.constructor=Xz; -Xz.prototype.K=Xz;Xz.L={};d.btBoxShape=Xz;Xz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bf(b,a)};Xz.prototype.getMargin=function(){return $e(this.J)};Xz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);af(b,a)};Xz.prototype.getLocalScaling=function(){return m(Ze(this.J),r)};Xz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Ye(e,a,b)}; -Xz.prototype.__destroy__=function(){We(this.J)};function Oz(){throw"cannot construct a btFace, no constructor in IDL";}Oz.prototype=Object.create(k.prototype);Oz.prototype.constructor=Oz;Oz.prototype.K=Oz;Oz.L={};d.btFace=Oz;Oz.prototype.get_m_indices=Oz.prototype.Yb=function(){return m(fl(this.J),Kz)};Oz.prototype.set_m_indices=Oz.prototype.Ge=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);hl(b,a)};Object.defineProperty(Oz.prototype,"m_indices",{get:Oz.prototype.Yb,set:Oz.prototype.Ge}); -Oz.prototype.get_m_plane=Oz.prototype.rc=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return gl(b,a)};Oz.prototype.set_m_plane=Oz.prototype.Ze=function(a,b){var e=this.J;c.M();a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);il(e,a,b)};Object.defineProperty(Oz.prototype,"m_plane",{get:Oz.prototype.rc,set:Oz.prototype.Ze});Oz.prototype.__destroy__=function(){el(this.J)};function Yz(){this.J=rd();l(Yz)[this.J]=this}Yz.prototype=Object.create(My.prototype); -Yz.prototype.constructor=Yz;Yz.prototype.K=Yz;Yz.L={};d.DebugDrawer=Yz;Yz.prototype.drawLine=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);vd(f,a,b,e)};Yz.prototype.drawContactPoint=function(a,b,e,f,g){var n=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);ud(n,a,b,e,f,g)}; -Yz.prototype.reportErrorWarning=function(a){var b=this.J;c.M();a=a&&"object"===typeof a?a.J:Gy(a);xd(b,a)};Yz.prototype.draw3dText=function(a,b){var e=this.J;c.M();a&&"object"===typeof a&&(a=a.J);b=b&&"object"===typeof b?b.J:Gy(b);td(e,a,b)};Yz.prototype.setDebugMode=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yd(b,a)};Yz.prototype.getDebugMode=function(){return wd(this.J)};Yz.prototype.__destroy__=function(){sd(this.J)}; -function Zz(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=qf(a,b);l(Zz)[this.J]=this}Zz.prototype=Object.create(Qy.prototype);Zz.prototype.constructor=Zz;Zz.prototype.K=Zz;Zz.L={};d.btCapsuleShapeX=Zz;Zz.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);yf(b,a)};Zz.prototype.getMargin=function(){return uf(this.J)};Zz.prototype.getUpAxis=function(){return wf(this.J)};Zz.prototype.getRadius=function(){return vf(this.J)}; -Zz.prototype.getHalfHeight=function(){return sf(this.J)};Zz.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);xf(b,a)};Zz.prototype.getLocalScaling=function(){return m(tf(this.J),r)};Zz.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);rf(e,a,b)};Zz.prototype.__destroy__=function(){pf(this.J)}; -function X(a,b,e,f){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);this.J=mp(a,b,e,f);l(X)[this.J]=this}X.prototype=Object.create(Wy.prototype);X.prototype.constructor=X;X.prototype.K=X;X.L={};d.btQuaternion=X;X.prototype.setValue=function(a,b,e,f){var g=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);Dp(g,a,b,e,f)}; -X.prototype.setEulerZYX=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Bp(f,a,b,e)};X.prototype.setRotation=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Cp(e,a,b)};X.prototype.normalize=X.prototype.normalize=function(){up(this.J)};X.prototype.length2=function(){return sp(this.J)};X.prototype.length=X.prototype.length=function(){return tp(this.J)}; -X.prototype.dot=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return np(b,a)};X.prototype.normalized=function(){return m(vp(this.J),X)};X.prototype.getAxis=function(){return m(qp(this.J),r)};X.prototype.inverse=X.prototype.inverse=function(){return m(rp(this.J),X)};X.prototype.getAngle=function(){return pp(this.J)};X.prototype.getAngleShortestPath=function(){return op(this.J)};X.prototype.angle=X.prototype.angle=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return lp(b,a)}; -X.prototype.angleShortestPath=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return kp(b,a)};X.prototype.op_add=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(wp(b,a),X)};X.prototype.op_sub=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(Ap(b,a),X)};X.prototype.op_mul=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(yp(b,a),X)};X.prototype.op_mulq=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(zp(b,a),X)}; -X.prototype.op_div=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);return m(xp(b,a),X)};X.prototype.x=X.prototype.x=function(){return Jp(this.J)};X.prototype.y=X.prototype.y=function(){return Kp(this.J)};X.prototype.z=X.prototype.z=function(){return Lp(this.J)};X.prototype.w=X.prototype.za=function(){return Ip(this.J)};X.prototype.setX=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Fp(b,a)};X.prototype.setY=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gp(b,a)}; -X.prototype.setZ=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hp(b,a)};X.prototype.setW=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ep(b,a)};X.prototype.__destroy__=function(){jp(this.J)};function $z(a,b){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);this.J=Af(a,b);l($z)[this.J]=this}$z.prototype=Object.create(Qy.prototype);$z.prototype.constructor=$z;$z.prototype.K=$z;$z.L={};d.btCapsuleShapeZ=$z; -$z.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);If(b,a)};$z.prototype.getMargin=function(){return Ef(this.J)};$z.prototype.getUpAxis=function(){return Gf(this.J)};$z.prototype.getRadius=function(){return Ff(this.J)};$z.prototype.getHalfHeight=function(){return Cf(this.J)};$z.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hf(b,a)};$z.prototype.getLocalScaling=function(){return m(Df(this.J),r)}; -$z.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Bf(e,a,b)};$z.prototype.__destroy__=function(){zf(this.J)};function w(){throw"cannot construct a btContactSolverInfo, no constructor in IDL";}w.prototype=Object.create(k.prototype);w.prototype.constructor=w;w.prototype.K=w;w.L={};d.btContactSolverInfo=w;w.prototype.get_m_splitImpulse=w.prototype.Fc=function(){return!!ai(this.J)}; -w.prototype.set_m_splitImpulse=w.prototype.nf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);di(b,a)};Object.defineProperty(w.prototype,"m_splitImpulse",{get:w.prototype.Fc,set:w.prototype.nf});w.prototype.get_m_splitImpulsePenetrationThreshold=w.prototype.Gc=function(){return $h(this.J)};w.prototype.set_m_splitImpulsePenetrationThreshold=w.prototype.pf=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);ci(b,a)}; -Object.defineProperty(w.prototype,"m_splitImpulsePenetrationThreshold",{get:w.prototype.Gc,set:w.prototype.pf});w.prototype.get_m_numIterations=w.prototype.qc=function(){return Zh(this.J)};w.prototype.set_m_numIterations=w.prototype.Ye=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);bi(b,a)};Object.defineProperty(w.prototype,"m_numIterations",{get:w.prototype.qc,set:w.prototype.Ye});w.prototype.__destroy__=function(){Yh(this.J)}; -function aA(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=void 0===f?El(a,b,e):void 0===g?_emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_4(a,b,e,f):Fl(a,b,e,f,g);l(aA)[this.J]=this}aA.prototype=Object.create($y.prototype);aA.prototype.constructor=aA;aA.prototype.K=aA;aA.L={};d.btGeneric6DofSpringConstraint=aA; -aA.prototype.enableSpring=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Hl(e,a,b)};aA.prototype.setStiffness=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Sl(e,a,b)};aA.prototype.setDamping=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Ol(e,a,b)};aA.prototype.setLinearLowerLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pl(b,a)}; -aA.prototype.setLinearUpperLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ql(b,a)};aA.prototype.setAngularLowerLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ll(b,a)};aA.prototype.setAngularUpperLimit=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Ml(b,a)};aA.prototype.getFrameOffsetA=function(){return m(Jl(this.J),u)};aA.prototype.enableFeedback=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gl(b,a)};aA.prototype.getBreakingImpulseThreshold=function(){return Il(this.J)}; -aA.prototype.setBreakingImpulseThreshold=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Nl(b,a)};aA.prototype.getParam=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);return Kl(e,a,b)};aA.prototype.setParam=function(a,b,e){var f=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);Rl(f,a,b,e)};aA.prototype.__destroy__=function(){Dl(this.J)}; -function bA(a){a&&"object"===typeof a&&(a=a.J);this.J=Lu(a);l(bA)[this.J]=this}bA.prototype=Object.create(q.prototype);bA.prototype.constructor=bA;bA.prototype.K=bA;bA.L={};d.btSphereShape=bA;bA.prototype.setMargin=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Qu(b,a)};bA.prototype.getMargin=function(){return Ou(this.J)};bA.prototype.setLocalScaling=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Pu(b,a)};bA.prototype.getLocalScaling=function(){return m(Nu(this.J),r)}; -bA.prototype.calculateLocalInertia=function(a,b){var e=this.J;a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);Mu(e,a,b)};bA.prototype.__destroy__=function(){Ku(this.J)};function Z(a,b,e,f,g){a&&"object"===typeof a&&(a=a.J);b&&"object"===typeof b&&(b=b.J);e&&"object"===typeof e&&(e=e.J);f&&"object"===typeof f&&(f=f.J);g&&"object"===typeof g&&(g=g.J);this.J=zd(a,b,e,f,g);l(Z)[this.J]=this}Z.prototype=Object.create(k.prototype);Z.prototype.constructor=Z;Z.prototype.K=Z;Z.L={}; -d.LocalConvexResult=Z;Z.prototype.get_m_hitCollisionObject=Z.prototype.Qb=function(){return m(Bd(this.J),t)};Z.prototype.set_m_hitCollisionObject=Z.prototype.ye=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Gd(b,a)};Object.defineProperty(Z.prototype,"m_hitCollisionObject",{get:Z.prototype.Qb,set:Z.prototype.ye});Z.prototype.get_m_localShapeInfo=Z.prototype.jc=function(){return m(Fd(this.J),kz)}; -Z.prototype.set_m_localShapeInfo=Z.prototype.Re=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Kd(b,a)};Object.defineProperty(Z.prototype,"m_localShapeInfo",{get:Z.prototype.jc,set:Z.prototype.Re});Z.prototype.get_m_hitNormalLocal=Z.prototype.Tb=function(){return m(Dd(this.J),r)};Z.prototype.set_m_hitNormalLocal=Z.prototype.Be=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Id(b,a)};Object.defineProperty(Z.prototype,"m_hitNormalLocal",{get:Z.prototype.Tb,set:Z.prototype.Be}); -Z.prototype.get_m_hitPointLocal=Z.prototype.Vb=function(){return m(Ed(this.J),r)};Z.prototype.set_m_hitPointLocal=Z.prototype.De=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Jd(b,a)};Object.defineProperty(Z.prototype,"m_hitPointLocal",{get:Z.prototype.Vb,set:Z.prototype.De});Z.prototype.get_m_hitFraction=Z.prototype.Rb=function(){return Cd(this.J)};Z.prototype.set_m_hitFraction=Z.prototype.ze=function(a){var b=this.J;a&&"object"===typeof a&&(a=a.J);Hd(b,a)}; -Object.defineProperty(Z.prototype,"m_hitFraction",{get:Z.prototype.Rb,set:Z.prototype.ze});Z.prototype.__destroy__=function(){Ad(this.J)};(function(){function a(){d.BT_CONSTRAINT_ERP=vy();d.BT_CONSTRAINT_STOP_ERP=xy();d.BT_CONSTRAINT_CFM=uy();d.BT_CONSTRAINT_STOP_CFM=wy();d.PHY_FLOAT=qy();d.PHY_DOUBLE=oy();d.PHY_INTEGER=ry();d.PHY_SHORT=sy();d.PHY_FIXEDPOINT88=py();d.PHY_UCHAR=ty()}d.calledRun?a():Ea.unshift(a)})();this.Ammo=d; - - - - return Ammo; -} -); -})(); -if (typeof exports === 'object' && typeof module === 'object') - module.exports = Ammo; - else if (typeof define === 'function' && define['amd']) - define([], function() { return Ammo; }); - else if (typeof exports === 'object') - exports["Ammo"] = Ammo; - \ No newline at end of file diff --git a/examples/js/libs/ammo.wasm.js b/examples/js/libs/ammo.wasm.js new file mode 100644 index 00000000000000..a7f835cf6cb85c --- /dev/null +++ b/examples/js/libs/ammo.wasm.js @@ -0,0 +1,822 @@ + +// This is ammo.js, a port of Bullet Physics to JavaScript. zlib licensed. + +var Ammo = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(Ammo) { + Ammo = Ammo || {}; + + +var b;b||(b=typeof Ammo !== 'undefined' ? Ammo : {});var ba;b.ready=new Promise(function(a){ba=a});var ca={},da;for(da in b)b.hasOwnProperty(da)&&(ca[da]=b[da]);var ea=!1,fa=!1,ha=!1,ia=!1;ea="object"===typeof window;fa="function"===typeof importScripts;ha="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node;ia=!ea&&!ha&&!fa;var ja="",ka,la,ma,na; +if(ha)ja=fa?require("path").dirname(ja)+"/":__dirname+"/",ka=function(a,c){ma||(ma=require("fs"));na||(na=require("path"));a=na.normalize(a);return ma.readFileSync(a,c?null:"utf8")},la=function(a){a=ka(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a},1>=2;d=za[a++];)Xa.push(105>d?Ca[++c>>1]:Aa[c]),++c;return Xa}var Za={f:function(){oa()},c:function(a,c,d){c=Ya(c,d);return Va[a].apply(null,c)},a:function(a,c,d){c=Ya(c,d);return Va[a].apply(null,c)},d:function(a,c,d){za.copyWithin(a,c,c+d)},e:function(){oa("OOM")},b:function(a){var c=Date.now();Aa[a>>2]=c/1E3|0;Aa[a+4>>2]=c%1E3*1E3|0;return 0},memory:sa,table:ua}; +(function(){function a(g){b.asm=g.exports;Ma--;b.monitorRunDependencies&&b.monitorRunDependencies(Ma);0==Ma&&(null!==Na&&(clearInterval(Na),Na=null),Oa&&(g=Oa,Oa=null,g()))}function c(g){a(g.instance)}function d(g){return Ua().then(function(n){return WebAssembly.instantiate(n,e)}).then(g,function(n){qa("failed to asynchronously prepare wasm: "+n);oa(n)})}var e={a:Za};Ma++;b.monitorRunDependencies&&b.monitorRunDependencies(Ma);if(b.instantiateWasm)try{return b.instantiateWasm(e,a)}catch(g){return qa("Module.instantiateWasm callback failed with error: "+ +g),!1}(function(){if(ra||"function"!==typeof WebAssembly.instantiateStreaming||Ra()||Pa("file://")||"function"!==typeof fetch)return d(c);fetch(Qa,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,e).then(c,function(n){qa("wasm streaming compile failed: "+n);qa("falling back to ArrayBuffer instantiation");return d(c)})})})();return{}})();var Wa=b.___wasm_call_ctors=function(){return(Wa=b.___wasm_call_ctors=b.asm.g).apply(null,arguments)}; +b.___em_js__array_bounds_check_error=function(){return(b.___em_js__array_bounds_check_error=b.asm.h).apply(null,arguments)}; +var $a=b._emscripten_bind_btCollisionWorld_getDispatcher_0=function(){return($a=b._emscripten_bind_btCollisionWorld_getDispatcher_0=b.asm.i).apply(null,arguments)},ab=b._emscripten_bind_btCollisionWorld_rayTest_3=function(){return(ab=b._emscripten_bind_btCollisionWorld_rayTest_3=b.asm.j).apply(null,arguments)},bb=b._emscripten_bind_btCollisionWorld_getPairCache_0=function(){return(bb=b._emscripten_bind_btCollisionWorld_getPairCache_0=b.asm.k).apply(null,arguments)},cb=b._emscripten_bind_btCollisionWorld_getDispatchInfo_0= +function(){return(cb=b._emscripten_bind_btCollisionWorld_getDispatchInfo_0=b.asm.l).apply(null,arguments)},db=b._emscripten_bind_btCollisionWorld_addCollisionObject_1=function(){return(db=b._emscripten_bind_btCollisionWorld_addCollisionObject_1=b.asm.m).apply(null,arguments)},eb=b._emscripten_bind_btCollisionWorld_addCollisionObject_2=function(){return(eb=b._emscripten_bind_btCollisionWorld_addCollisionObject_2=b.asm.n).apply(null,arguments)},fb=b._emscripten_bind_btCollisionWorld_addCollisionObject_3= +function(){return(fb=b._emscripten_bind_btCollisionWorld_addCollisionObject_3=b.asm.o).apply(null,arguments)},gb=b._emscripten_bind_btCollisionWorld_removeCollisionObject_1=function(){return(gb=b._emscripten_bind_btCollisionWorld_removeCollisionObject_1=b.asm.p).apply(null,arguments)},hb=b._emscripten_bind_btCollisionWorld_getBroadphase_0=function(){return(hb=b._emscripten_bind_btCollisionWorld_getBroadphase_0=b.asm.q).apply(null,arguments)},ib=b._emscripten_bind_btCollisionWorld_convexSweepTest_5= +function(){return(ib=b._emscripten_bind_btCollisionWorld_convexSweepTest_5=b.asm.r).apply(null,arguments)},jb=b._emscripten_bind_btCollisionWorld_contactPairTest_3=function(){return(jb=b._emscripten_bind_btCollisionWorld_contactPairTest_3=b.asm.s).apply(null,arguments)},kb=b._emscripten_bind_btCollisionWorld_contactTest_2=function(){return(kb=b._emscripten_bind_btCollisionWorld_contactTest_2=b.asm.t).apply(null,arguments)},lb=b._emscripten_bind_btCollisionWorld_updateSingleAabb_1=function(){return(lb= +b._emscripten_bind_btCollisionWorld_updateSingleAabb_1=b.asm.u).apply(null,arguments)},mb=b._emscripten_bind_btCollisionWorld_setDebugDrawer_1=function(){return(mb=b._emscripten_bind_btCollisionWorld_setDebugDrawer_1=b.asm.v).apply(null,arguments)},nb=b._emscripten_bind_btCollisionWorld_getDebugDrawer_0=function(){return(nb=b._emscripten_bind_btCollisionWorld_getDebugDrawer_0=b.asm.w).apply(null,arguments)},ob=b._emscripten_bind_btCollisionWorld_debugDrawWorld_0=function(){return(ob=b._emscripten_bind_btCollisionWorld_debugDrawWorld_0= +b.asm.x).apply(null,arguments)},pb=b._emscripten_bind_btCollisionWorld_debugDrawObject_3=function(){return(pb=b._emscripten_bind_btCollisionWorld_debugDrawObject_3=b.asm.y).apply(null,arguments)},qb=b._emscripten_bind_btCollisionWorld___destroy___0=function(){return(qb=b._emscripten_bind_btCollisionWorld___destroy___0=b.asm.z).apply(null,arguments)},rb=b._emscripten_bind_btCollisionShape_setLocalScaling_1=function(){return(rb=b._emscripten_bind_btCollisionShape_setLocalScaling_1=b.asm.A).apply(null, +arguments)},sb=b._emscripten_bind_btCollisionShape_getLocalScaling_0=function(){return(sb=b._emscripten_bind_btCollisionShape_getLocalScaling_0=b.asm.B).apply(null,arguments)},tb=b._emscripten_bind_btCollisionShape_calculateLocalInertia_2=function(){return(tb=b._emscripten_bind_btCollisionShape_calculateLocalInertia_2=b.asm.C).apply(null,arguments)},ub=b._emscripten_bind_btCollisionShape_setMargin_1=function(){return(ub=b._emscripten_bind_btCollisionShape_setMargin_1=b.asm.D).apply(null,arguments)}, +vb=b._emscripten_bind_btCollisionShape_getMargin_0=function(){return(vb=b._emscripten_bind_btCollisionShape_getMargin_0=b.asm.E).apply(null,arguments)},wb=b._emscripten_bind_btCollisionShape___destroy___0=function(){return(wb=b._emscripten_bind_btCollisionShape___destroy___0=b.asm.F).apply(null,arguments)},xb=b._emscripten_bind_btCollisionObject_setAnisotropicFriction_2=function(){return(xb=b._emscripten_bind_btCollisionObject_setAnisotropicFriction_2=b.asm.G).apply(null,arguments)},yb=b._emscripten_bind_btCollisionObject_getCollisionShape_0= +function(){return(yb=b._emscripten_bind_btCollisionObject_getCollisionShape_0=b.asm.H).apply(null,arguments)},zb=b._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1=function(){return(zb=b._emscripten_bind_btCollisionObject_setContactProcessingThreshold_1=b.asm.I).apply(null,arguments)},Ab=b._emscripten_bind_btCollisionObject_setActivationState_1=function(){return(Ab=b._emscripten_bind_btCollisionObject_setActivationState_1=b.asm.J).apply(null,arguments)},Bb=b._emscripten_bind_btCollisionObject_forceActivationState_1= +function(){return(Bb=b._emscripten_bind_btCollisionObject_forceActivationState_1=b.asm.K).apply(null,arguments)},Cb=b._emscripten_bind_btCollisionObject_activate_0=function(){return(Cb=b._emscripten_bind_btCollisionObject_activate_0=b.asm.L).apply(null,arguments)},Db=b._emscripten_bind_btCollisionObject_activate_1=function(){return(Db=b._emscripten_bind_btCollisionObject_activate_1=b.asm.M).apply(null,arguments)},Eb=b._emscripten_bind_btCollisionObject_isActive_0=function(){return(Eb=b._emscripten_bind_btCollisionObject_isActive_0= +b.asm.N).apply(null,arguments)},Fb=b._emscripten_bind_btCollisionObject_isKinematicObject_0=function(){return(Fb=b._emscripten_bind_btCollisionObject_isKinematicObject_0=b.asm.O).apply(null,arguments)},Gb=b._emscripten_bind_btCollisionObject_isStaticObject_0=function(){return(Gb=b._emscripten_bind_btCollisionObject_isStaticObject_0=b.asm.P).apply(null,arguments)},Hb=b._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0=function(){return(Hb=b._emscripten_bind_btCollisionObject_isStaticOrKinematicObject_0= +b.asm.Q).apply(null,arguments)},Ib=b._emscripten_bind_btCollisionObject_getRestitution_0=function(){return(Ib=b._emscripten_bind_btCollisionObject_getRestitution_0=b.asm.R).apply(null,arguments)},Jb=b._emscripten_bind_btCollisionObject_getFriction_0=function(){return(Jb=b._emscripten_bind_btCollisionObject_getFriction_0=b.asm.S).apply(null,arguments)},Kb=b._emscripten_bind_btCollisionObject_getRollingFriction_0=function(){return(Kb=b._emscripten_bind_btCollisionObject_getRollingFriction_0=b.asm.T).apply(null, +arguments)},Lb=b._emscripten_bind_btCollisionObject_setRestitution_1=function(){return(Lb=b._emscripten_bind_btCollisionObject_setRestitution_1=b.asm.U).apply(null,arguments)},Mb=b._emscripten_bind_btCollisionObject_setFriction_1=function(){return(Mb=b._emscripten_bind_btCollisionObject_setFriction_1=b.asm.V).apply(null,arguments)},Nb=b._emscripten_bind_btCollisionObject_setRollingFriction_1=function(){return(Nb=b._emscripten_bind_btCollisionObject_setRollingFriction_1=b.asm.W).apply(null,arguments)}, +Ob=b._emscripten_bind_btCollisionObject_getWorldTransform_0=function(){return(Ob=b._emscripten_bind_btCollisionObject_getWorldTransform_0=b.asm.X).apply(null,arguments)},Pb=b._emscripten_bind_btCollisionObject_getCollisionFlags_0=function(){return(Pb=b._emscripten_bind_btCollisionObject_getCollisionFlags_0=b.asm.Y).apply(null,arguments)},Qb=b._emscripten_bind_btCollisionObject_setCollisionFlags_1=function(){return(Qb=b._emscripten_bind_btCollisionObject_setCollisionFlags_1=b.asm.Z).apply(null,arguments)}, +Sb=b._emscripten_bind_btCollisionObject_setWorldTransform_1=function(){return(Sb=b._emscripten_bind_btCollisionObject_setWorldTransform_1=b.asm._).apply(null,arguments)},Tb=b._emscripten_bind_btCollisionObject_setCollisionShape_1=function(){return(Tb=b._emscripten_bind_btCollisionObject_setCollisionShape_1=b.asm.$).apply(null,arguments)},Ub=b._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1=function(){return(Ub=b._emscripten_bind_btCollisionObject_setCcdMotionThreshold_1=b.asm.aa).apply(null, +arguments)},Vb=b._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1=function(){return(Vb=b._emscripten_bind_btCollisionObject_setCcdSweptSphereRadius_1=b.asm.ba).apply(null,arguments)},Wb=b._emscripten_bind_btCollisionObject_getUserIndex_0=function(){return(Wb=b._emscripten_bind_btCollisionObject_getUserIndex_0=b.asm.ca).apply(null,arguments)},Xb=b._emscripten_bind_btCollisionObject_setUserIndex_1=function(){return(Xb=b._emscripten_bind_btCollisionObject_setUserIndex_1=b.asm.da).apply(null, +arguments)},Yb=b._emscripten_bind_btCollisionObject_getUserPointer_0=function(){return(Yb=b._emscripten_bind_btCollisionObject_getUserPointer_0=b.asm.ea).apply(null,arguments)},Zb=b._emscripten_bind_btCollisionObject_setUserPointer_1=function(){return(Zb=b._emscripten_bind_btCollisionObject_setUserPointer_1=b.asm.fa).apply(null,arguments)},$b=b._emscripten_bind_btCollisionObject_getBroadphaseHandle_0=function(){return($b=b._emscripten_bind_btCollisionObject_getBroadphaseHandle_0=b.asm.ga).apply(null, +arguments)},ac=b._emscripten_bind_btCollisionObject___destroy___0=function(){return(ac=b._emscripten_bind_btCollisionObject___destroy___0=b.asm.ha).apply(null,arguments)},bc=b._emscripten_bind_btDynamicsWorld_addAction_1=function(){return(bc=b._emscripten_bind_btDynamicsWorld_addAction_1=b.asm.ia).apply(null,arguments)},cc=b._emscripten_bind_btDynamicsWorld_removeAction_1=function(){return(cc=b._emscripten_bind_btDynamicsWorld_removeAction_1=b.asm.ja).apply(null,arguments)},dc=b._emscripten_bind_btDynamicsWorld_getSolverInfo_0= +function(){return(dc=b._emscripten_bind_btDynamicsWorld_getSolverInfo_0=b.asm.ka).apply(null,arguments)},ec=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_1=function(){return(ec=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_1=b.asm.la).apply(null,arguments)},fc=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_2=function(){return(fc=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_2=b.asm.ma).apply(null,arguments)},hc=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_3= +function(){return(hc=b._emscripten_bind_btDynamicsWorld_setInternalTickCallback_3=b.asm.na).apply(null,arguments)},ic=b._emscripten_bind_btDynamicsWorld_getDispatcher_0=function(){return(ic=b._emscripten_bind_btDynamicsWorld_getDispatcher_0=b.asm.oa).apply(null,arguments)},jc=b._emscripten_bind_btDynamicsWorld_rayTest_3=function(){return(jc=b._emscripten_bind_btDynamicsWorld_rayTest_3=b.asm.pa).apply(null,arguments)},kc=b._emscripten_bind_btDynamicsWorld_getPairCache_0=function(){return(kc=b._emscripten_bind_btDynamicsWorld_getPairCache_0= +b.asm.qa).apply(null,arguments)},lc=b._emscripten_bind_btDynamicsWorld_getDispatchInfo_0=function(){return(lc=b._emscripten_bind_btDynamicsWorld_getDispatchInfo_0=b.asm.ra).apply(null,arguments)},mc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_1=function(){return(mc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_1=b.asm.sa).apply(null,arguments)},nc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_2=function(){return(nc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_2= +b.asm.ta).apply(null,arguments)},oc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_3=function(){return(oc=b._emscripten_bind_btDynamicsWorld_addCollisionObject_3=b.asm.ua).apply(null,arguments)},pc=b._emscripten_bind_btDynamicsWorld_removeCollisionObject_1=function(){return(pc=b._emscripten_bind_btDynamicsWorld_removeCollisionObject_1=b.asm.va).apply(null,arguments)},qc=b._emscripten_bind_btDynamicsWorld_getBroadphase_0=function(){return(qc=b._emscripten_bind_btDynamicsWorld_getBroadphase_0= +b.asm.wa).apply(null,arguments)},rc=b._emscripten_bind_btDynamicsWorld_convexSweepTest_5=function(){return(rc=b._emscripten_bind_btDynamicsWorld_convexSweepTest_5=b.asm.xa).apply(null,arguments)},sc=b._emscripten_bind_btDynamicsWorld_contactPairTest_3=function(){return(sc=b._emscripten_bind_btDynamicsWorld_contactPairTest_3=b.asm.ya).apply(null,arguments)},tc=b._emscripten_bind_btDynamicsWorld_contactTest_2=function(){return(tc=b._emscripten_bind_btDynamicsWorld_contactTest_2=b.asm.za).apply(null, +arguments)},uc=b._emscripten_bind_btDynamicsWorld_updateSingleAabb_1=function(){return(uc=b._emscripten_bind_btDynamicsWorld_updateSingleAabb_1=b.asm.Aa).apply(null,arguments)},vc=b._emscripten_bind_btDynamicsWorld_setDebugDrawer_1=function(){return(vc=b._emscripten_bind_btDynamicsWorld_setDebugDrawer_1=b.asm.Ba).apply(null,arguments)},wc=b._emscripten_bind_btDynamicsWorld_getDebugDrawer_0=function(){return(wc=b._emscripten_bind_btDynamicsWorld_getDebugDrawer_0=b.asm.Ca).apply(null,arguments)},xc= +b._emscripten_bind_btDynamicsWorld_debugDrawWorld_0=function(){return(xc=b._emscripten_bind_btDynamicsWorld_debugDrawWorld_0=b.asm.Da).apply(null,arguments)},yc=b._emscripten_bind_btDynamicsWorld_debugDrawObject_3=function(){return(yc=b._emscripten_bind_btDynamicsWorld_debugDrawObject_3=b.asm.Ea).apply(null,arguments)},zc=b._emscripten_bind_btDynamicsWorld___destroy___0=function(){return(zc=b._emscripten_bind_btDynamicsWorld___destroy___0=b.asm.Fa).apply(null,arguments)},Ac=b._emscripten_bind_btTypedConstraint_enableFeedback_1= +function(){return(Ac=b._emscripten_bind_btTypedConstraint_enableFeedback_1=b.asm.Ga).apply(null,arguments)},Bc=b._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0=function(){return(Bc=b._emscripten_bind_btTypedConstraint_getBreakingImpulseThreshold_0=b.asm.Ha).apply(null,arguments)},Cc=b._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1=function(){return(Cc=b._emscripten_bind_btTypedConstraint_setBreakingImpulseThreshold_1=b.asm.Ia).apply(null,arguments)},Dc=b._emscripten_bind_btTypedConstraint_getParam_2= +function(){return(Dc=b._emscripten_bind_btTypedConstraint_getParam_2=b.asm.Ja).apply(null,arguments)},Ec=b._emscripten_bind_btTypedConstraint_setParam_3=function(){return(Ec=b._emscripten_bind_btTypedConstraint_setParam_3=b.asm.Ka).apply(null,arguments)},Fc=b._emscripten_bind_btTypedConstraint___destroy___0=function(){return(Fc=b._emscripten_bind_btTypedConstraint___destroy___0=b.asm.La).apply(null,arguments)},Gc=b._emscripten_bind_btConcaveShape_setLocalScaling_1=function(){return(Gc=b._emscripten_bind_btConcaveShape_setLocalScaling_1= +b.asm.Ma).apply(null,arguments)},Hc=b._emscripten_bind_btConcaveShape_getLocalScaling_0=function(){return(Hc=b._emscripten_bind_btConcaveShape_getLocalScaling_0=b.asm.Na).apply(null,arguments)},Ic=b._emscripten_bind_btConcaveShape_calculateLocalInertia_2=function(){return(Ic=b._emscripten_bind_btConcaveShape_calculateLocalInertia_2=b.asm.Oa).apply(null,arguments)},Jc=b._emscripten_bind_btConcaveShape___destroy___0=function(){return(Jc=b._emscripten_bind_btConcaveShape___destroy___0=b.asm.Pa).apply(null, +arguments)},Kc=b._emscripten_bind_btCapsuleShape_btCapsuleShape_2=function(){return(Kc=b._emscripten_bind_btCapsuleShape_btCapsuleShape_2=b.asm.Qa).apply(null,arguments)},Lc=b._emscripten_bind_btCapsuleShape_setMargin_1=function(){return(Lc=b._emscripten_bind_btCapsuleShape_setMargin_1=b.asm.Ra).apply(null,arguments)},Mc=b._emscripten_bind_btCapsuleShape_getMargin_0=function(){return(Mc=b._emscripten_bind_btCapsuleShape_getMargin_0=b.asm.Sa).apply(null,arguments)},Nc=b._emscripten_bind_btCapsuleShape_getUpAxis_0= +function(){return(Nc=b._emscripten_bind_btCapsuleShape_getUpAxis_0=b.asm.Ta).apply(null,arguments)},Oc=b._emscripten_bind_btCapsuleShape_getRadius_0=function(){return(Oc=b._emscripten_bind_btCapsuleShape_getRadius_0=b.asm.Ua).apply(null,arguments)},Pc=b._emscripten_bind_btCapsuleShape_getHalfHeight_0=function(){return(Pc=b._emscripten_bind_btCapsuleShape_getHalfHeight_0=b.asm.Va).apply(null,arguments)},Qc=b._emscripten_bind_btCapsuleShape_setLocalScaling_1=function(){return(Qc=b._emscripten_bind_btCapsuleShape_setLocalScaling_1= +b.asm.Wa).apply(null,arguments)},Rc=b._emscripten_bind_btCapsuleShape_getLocalScaling_0=function(){return(Rc=b._emscripten_bind_btCapsuleShape_getLocalScaling_0=b.asm.Xa).apply(null,arguments)},Sc=b._emscripten_bind_btCapsuleShape_calculateLocalInertia_2=function(){return(Sc=b._emscripten_bind_btCapsuleShape_calculateLocalInertia_2=b.asm.Ya).apply(null,arguments)},Tc=b._emscripten_bind_btCapsuleShape___destroy___0=function(){return(Tc=b._emscripten_bind_btCapsuleShape___destroy___0=b.asm.Za).apply(null, +arguments)},Uc=b._emscripten_bind_btIDebugDraw_drawLine_3=function(){return(Uc=b._emscripten_bind_btIDebugDraw_drawLine_3=b.asm._a).apply(null,arguments)},Vc=b._emscripten_bind_btIDebugDraw_drawContactPoint_5=function(){return(Vc=b._emscripten_bind_btIDebugDraw_drawContactPoint_5=b.asm.$a).apply(null,arguments)},Wc=b._emscripten_bind_btIDebugDraw_reportErrorWarning_1=function(){return(Wc=b._emscripten_bind_btIDebugDraw_reportErrorWarning_1=b.asm.ab).apply(null,arguments)},Xc=b._emscripten_bind_btIDebugDraw_draw3dText_2= +function(){return(Xc=b._emscripten_bind_btIDebugDraw_draw3dText_2=b.asm.bb).apply(null,arguments)},Yc=b._emscripten_bind_btIDebugDraw_setDebugMode_1=function(){return(Yc=b._emscripten_bind_btIDebugDraw_setDebugMode_1=b.asm.cb).apply(null,arguments)},Zc=b._emscripten_bind_btIDebugDraw_getDebugMode_0=function(){return(Zc=b._emscripten_bind_btIDebugDraw_getDebugMode_0=b.asm.db).apply(null,arguments)},$c=b._emscripten_bind_btIDebugDraw___destroy___0=function(){return($c=b._emscripten_bind_btIDebugDraw___destroy___0= +b.asm.eb).apply(null,arguments)},ad=b._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0=function(){return(ad=b._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_0=b.asm.fb).apply(null,arguments)},bd=b._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1=function(){return(bd=b._emscripten_bind_btDefaultCollisionConfiguration_btDefaultCollisionConfiguration_1=b.asm.gb).apply(null,arguments)},cd=b._emscripten_bind_btDefaultCollisionConfiguration___destroy___0= +function(){return(cd=b._emscripten_bind_btDefaultCollisionConfiguration___destroy___0=b.asm.hb).apply(null,arguments)},dd=b._emscripten_bind_btTriangleMeshShape_setLocalScaling_1=function(){return(dd=b._emscripten_bind_btTriangleMeshShape_setLocalScaling_1=b.asm.ib).apply(null,arguments)},ed=b._emscripten_bind_btTriangleMeshShape_getLocalScaling_0=function(){return(ed=b._emscripten_bind_btTriangleMeshShape_getLocalScaling_0=b.asm.jb).apply(null,arguments)},fd=b._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2= +function(){return(fd=b._emscripten_bind_btTriangleMeshShape_calculateLocalInertia_2=b.asm.kb).apply(null,arguments)},gd=b._emscripten_bind_btTriangleMeshShape___destroy___0=function(){return(gd=b._emscripten_bind_btTriangleMeshShape___destroy___0=b.asm.lb).apply(null,arguments)},hd=b._emscripten_bind_btGhostObject_btGhostObject_0=function(){return(hd=b._emscripten_bind_btGhostObject_btGhostObject_0=b.asm.mb).apply(null,arguments)},id=b._emscripten_bind_btGhostObject_getNumOverlappingObjects_0=function(){return(id= +b._emscripten_bind_btGhostObject_getNumOverlappingObjects_0=b.asm.nb).apply(null,arguments)},jd=b._emscripten_bind_btGhostObject_getOverlappingObject_1=function(){return(jd=b._emscripten_bind_btGhostObject_getOverlappingObject_1=b.asm.ob).apply(null,arguments)},kd=b._emscripten_bind_btGhostObject_setAnisotropicFriction_2=function(){return(kd=b._emscripten_bind_btGhostObject_setAnisotropicFriction_2=b.asm.pb).apply(null,arguments)},ld=b._emscripten_bind_btGhostObject_getCollisionShape_0=function(){return(ld= +b._emscripten_bind_btGhostObject_getCollisionShape_0=b.asm.qb).apply(null,arguments)},md=b._emscripten_bind_btGhostObject_setContactProcessingThreshold_1=function(){return(md=b._emscripten_bind_btGhostObject_setContactProcessingThreshold_1=b.asm.rb).apply(null,arguments)},nd=b._emscripten_bind_btGhostObject_setActivationState_1=function(){return(nd=b._emscripten_bind_btGhostObject_setActivationState_1=b.asm.sb).apply(null,arguments)},od=b._emscripten_bind_btGhostObject_forceActivationState_1=function(){return(od= +b._emscripten_bind_btGhostObject_forceActivationState_1=b.asm.tb).apply(null,arguments)},pd=b._emscripten_bind_btGhostObject_activate_0=function(){return(pd=b._emscripten_bind_btGhostObject_activate_0=b.asm.ub).apply(null,arguments)},qd=b._emscripten_bind_btGhostObject_activate_1=function(){return(qd=b._emscripten_bind_btGhostObject_activate_1=b.asm.vb).apply(null,arguments)},rd=b._emscripten_bind_btGhostObject_isActive_0=function(){return(rd=b._emscripten_bind_btGhostObject_isActive_0=b.asm.wb).apply(null, +arguments)},sd=b._emscripten_bind_btGhostObject_isKinematicObject_0=function(){return(sd=b._emscripten_bind_btGhostObject_isKinematicObject_0=b.asm.xb).apply(null,arguments)},td=b._emscripten_bind_btGhostObject_isStaticObject_0=function(){return(td=b._emscripten_bind_btGhostObject_isStaticObject_0=b.asm.yb).apply(null,arguments)},ud=b._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0=function(){return(ud=b._emscripten_bind_btGhostObject_isStaticOrKinematicObject_0=b.asm.zb).apply(null,arguments)}, +vd=b._emscripten_bind_btGhostObject_getRestitution_0=function(){return(vd=b._emscripten_bind_btGhostObject_getRestitution_0=b.asm.Ab).apply(null,arguments)},wd=b._emscripten_bind_btGhostObject_getFriction_0=function(){return(wd=b._emscripten_bind_btGhostObject_getFriction_0=b.asm.Bb).apply(null,arguments)},xd=b._emscripten_bind_btGhostObject_getRollingFriction_0=function(){return(xd=b._emscripten_bind_btGhostObject_getRollingFriction_0=b.asm.Cb).apply(null,arguments)},yd=b._emscripten_bind_btGhostObject_setRestitution_1= +function(){return(yd=b._emscripten_bind_btGhostObject_setRestitution_1=b.asm.Db).apply(null,arguments)},zd=b._emscripten_bind_btGhostObject_setFriction_1=function(){return(zd=b._emscripten_bind_btGhostObject_setFriction_1=b.asm.Eb).apply(null,arguments)},Ad=b._emscripten_bind_btGhostObject_setRollingFriction_1=function(){return(Ad=b._emscripten_bind_btGhostObject_setRollingFriction_1=b.asm.Fb).apply(null,arguments)},Bd=b._emscripten_bind_btGhostObject_getWorldTransform_0=function(){return(Bd=b._emscripten_bind_btGhostObject_getWorldTransform_0= +b.asm.Gb).apply(null,arguments)},Cd=b._emscripten_bind_btGhostObject_getCollisionFlags_0=function(){return(Cd=b._emscripten_bind_btGhostObject_getCollisionFlags_0=b.asm.Hb).apply(null,arguments)},Dd=b._emscripten_bind_btGhostObject_setCollisionFlags_1=function(){return(Dd=b._emscripten_bind_btGhostObject_setCollisionFlags_1=b.asm.Ib).apply(null,arguments)},Ed=b._emscripten_bind_btGhostObject_setWorldTransform_1=function(){return(Ed=b._emscripten_bind_btGhostObject_setWorldTransform_1=b.asm.Jb).apply(null, +arguments)},Fd=b._emscripten_bind_btGhostObject_setCollisionShape_1=function(){return(Fd=b._emscripten_bind_btGhostObject_setCollisionShape_1=b.asm.Kb).apply(null,arguments)},Gd=b._emscripten_bind_btGhostObject_setCcdMotionThreshold_1=function(){return(Gd=b._emscripten_bind_btGhostObject_setCcdMotionThreshold_1=b.asm.Lb).apply(null,arguments)},Hd=b._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1=function(){return(Hd=b._emscripten_bind_btGhostObject_setCcdSweptSphereRadius_1=b.asm.Mb).apply(null, +arguments)},Id=b._emscripten_bind_btGhostObject_getUserIndex_0=function(){return(Id=b._emscripten_bind_btGhostObject_getUserIndex_0=b.asm.Nb).apply(null,arguments)},Jd=b._emscripten_bind_btGhostObject_setUserIndex_1=function(){return(Jd=b._emscripten_bind_btGhostObject_setUserIndex_1=b.asm.Ob).apply(null,arguments)},Kd=b._emscripten_bind_btGhostObject_getUserPointer_0=function(){return(Kd=b._emscripten_bind_btGhostObject_getUserPointer_0=b.asm.Pb).apply(null,arguments)},Ld=b._emscripten_bind_btGhostObject_setUserPointer_1= +function(){return(Ld=b._emscripten_bind_btGhostObject_setUserPointer_1=b.asm.Qb).apply(null,arguments)},Md=b._emscripten_bind_btGhostObject_getBroadphaseHandle_0=function(){return(Md=b._emscripten_bind_btGhostObject_getBroadphaseHandle_0=b.asm.Rb).apply(null,arguments)},Nd=b._emscripten_bind_btGhostObject___destroy___0=function(){return(Nd=b._emscripten_bind_btGhostObject___destroy___0=b.asm.Sb).apply(null,arguments)},Od=b._emscripten_bind_btConeShape_btConeShape_2=function(){return(Od=b._emscripten_bind_btConeShape_btConeShape_2= +b.asm.Tb).apply(null,arguments)},Pd=b._emscripten_bind_btConeShape_setLocalScaling_1=function(){return(Pd=b._emscripten_bind_btConeShape_setLocalScaling_1=b.asm.Ub).apply(null,arguments)},Qd=b._emscripten_bind_btConeShape_getLocalScaling_0=function(){return(Qd=b._emscripten_bind_btConeShape_getLocalScaling_0=b.asm.Vb).apply(null,arguments)},Rd=b._emscripten_bind_btConeShape_calculateLocalInertia_2=function(){return(Rd=b._emscripten_bind_btConeShape_calculateLocalInertia_2=b.asm.Wb).apply(null,arguments)}, +Sd=b._emscripten_bind_btConeShape___destroy___0=function(){return(Sd=b._emscripten_bind_btConeShape___destroy___0=b.asm.Xb).apply(null,arguments)},Td=b._emscripten_bind_btActionInterface_updateAction_2=function(){return(Td=b._emscripten_bind_btActionInterface_updateAction_2=b.asm.Yb).apply(null,arguments)},Ud=b._emscripten_bind_btActionInterface___destroy___0=function(){return(Ud=b._emscripten_bind_btActionInterface___destroy___0=b.asm.Zb).apply(null,arguments)},Vd=b._emscripten_bind_btVector3_btVector3_0= +function(){return(Vd=b._emscripten_bind_btVector3_btVector3_0=b.asm._b).apply(null,arguments)},Wd=b._emscripten_bind_btVector3_btVector3_3=function(){return(Wd=b._emscripten_bind_btVector3_btVector3_3=b.asm.$b).apply(null,arguments)},Xd=b._emscripten_bind_btVector3_length_0=function(){return(Xd=b._emscripten_bind_btVector3_length_0=b.asm.ac).apply(null,arguments)},Yd=b._emscripten_bind_btVector3_x_0=function(){return(Yd=b._emscripten_bind_btVector3_x_0=b.asm.bc).apply(null,arguments)},Zd=b._emscripten_bind_btVector3_y_0= +function(){return(Zd=b._emscripten_bind_btVector3_y_0=b.asm.cc).apply(null,arguments)},$d=b._emscripten_bind_btVector3_z_0=function(){return($d=b._emscripten_bind_btVector3_z_0=b.asm.dc).apply(null,arguments)},ae=b._emscripten_bind_btVector3_setX_1=function(){return(ae=b._emscripten_bind_btVector3_setX_1=b.asm.ec).apply(null,arguments)},be=b._emscripten_bind_btVector3_setY_1=function(){return(be=b._emscripten_bind_btVector3_setY_1=b.asm.fc).apply(null,arguments)},ce=b._emscripten_bind_btVector3_setZ_1= +function(){return(ce=b._emscripten_bind_btVector3_setZ_1=b.asm.gc).apply(null,arguments)},de=b._emscripten_bind_btVector3_setValue_3=function(){return(de=b._emscripten_bind_btVector3_setValue_3=b.asm.hc).apply(null,arguments)},ee=b._emscripten_bind_btVector3_normalize_0=function(){return(ee=b._emscripten_bind_btVector3_normalize_0=b.asm.ic).apply(null,arguments)},fe=b._emscripten_bind_btVector3_rotate_2=function(){return(fe=b._emscripten_bind_btVector3_rotate_2=b.asm.jc).apply(null,arguments)},ge= +b._emscripten_bind_btVector3_dot_1=function(){return(ge=b._emscripten_bind_btVector3_dot_1=b.asm.kc).apply(null,arguments)},he=b._emscripten_bind_btVector3_op_mul_1=function(){return(he=b._emscripten_bind_btVector3_op_mul_1=b.asm.lc).apply(null,arguments)},ie=b._emscripten_bind_btVector3_op_add_1=function(){return(ie=b._emscripten_bind_btVector3_op_add_1=b.asm.mc).apply(null,arguments)},je=b._emscripten_bind_btVector3_op_sub_1=function(){return(je=b._emscripten_bind_btVector3_op_sub_1=b.asm.nc).apply(null, +arguments)},ke=b._emscripten_bind_btVector3___destroy___0=function(){return(ke=b._emscripten_bind_btVector3___destroy___0=b.asm.oc).apply(null,arguments)},le=b._emscripten_bind_btVehicleRaycaster_castRay_3=function(){return(le=b._emscripten_bind_btVehicleRaycaster_castRay_3=b.asm.pc).apply(null,arguments)},me=b._emscripten_bind_btVehicleRaycaster___destroy___0=function(){return(me=b._emscripten_bind_btVehicleRaycaster___destroy___0=b.asm.qc).apply(null,arguments)},ne=b._emscripten_bind_btQuadWord_x_0= +function(){return(ne=b._emscripten_bind_btQuadWord_x_0=b.asm.rc).apply(null,arguments)},oe=b._emscripten_bind_btQuadWord_y_0=function(){return(oe=b._emscripten_bind_btQuadWord_y_0=b.asm.sc).apply(null,arguments)},pe=b._emscripten_bind_btQuadWord_z_0=function(){return(pe=b._emscripten_bind_btQuadWord_z_0=b.asm.tc).apply(null,arguments)},qe=b._emscripten_bind_btQuadWord_w_0=function(){return(qe=b._emscripten_bind_btQuadWord_w_0=b.asm.uc).apply(null,arguments)},re=b._emscripten_bind_btQuadWord_setX_1= +function(){return(re=b._emscripten_bind_btQuadWord_setX_1=b.asm.vc).apply(null,arguments)},se=b._emscripten_bind_btQuadWord_setY_1=function(){return(se=b._emscripten_bind_btQuadWord_setY_1=b.asm.wc).apply(null,arguments)},te=b._emscripten_bind_btQuadWord_setZ_1=function(){return(te=b._emscripten_bind_btQuadWord_setZ_1=b.asm.xc).apply(null,arguments)},ue=b._emscripten_bind_btQuadWord_setW_1=function(){return(ue=b._emscripten_bind_btQuadWord_setW_1=b.asm.yc).apply(null,arguments)},ve=b._emscripten_bind_btQuadWord___destroy___0= +function(){return(ve=b._emscripten_bind_btQuadWord___destroy___0=b.asm.zc).apply(null,arguments)},we=b._emscripten_bind_btCylinderShape_btCylinderShape_1=function(){return(we=b._emscripten_bind_btCylinderShape_btCylinderShape_1=b.asm.Ac).apply(null,arguments)},xe=b._emscripten_bind_btCylinderShape_setMargin_1=function(){return(xe=b._emscripten_bind_btCylinderShape_setMargin_1=b.asm.Bc).apply(null,arguments)},ye=b._emscripten_bind_btCylinderShape_getMargin_0=function(){return(ye=b._emscripten_bind_btCylinderShape_getMargin_0= +b.asm.Cc).apply(null,arguments)},ze=b._emscripten_bind_btCylinderShape_setLocalScaling_1=function(){return(ze=b._emscripten_bind_btCylinderShape_setLocalScaling_1=b.asm.Dc).apply(null,arguments)},Ae=b._emscripten_bind_btCylinderShape_getLocalScaling_0=function(){return(Ae=b._emscripten_bind_btCylinderShape_getLocalScaling_0=b.asm.Ec).apply(null,arguments)},Be=b._emscripten_bind_btCylinderShape_calculateLocalInertia_2=function(){return(Be=b._emscripten_bind_btCylinderShape_calculateLocalInertia_2= +b.asm.Fc).apply(null,arguments)},Ce=b._emscripten_bind_btCylinderShape___destroy___0=function(){return(Ce=b._emscripten_bind_btCylinderShape___destroy___0=b.asm.Gc).apply(null,arguments)},De=b._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4=function(){return(De=b._emscripten_bind_btDiscreteDynamicsWorld_btDiscreteDynamicsWorld_4=b.asm.Hc).apply(null,arguments)},Ee=b._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1=function(){return(Ee=b._emscripten_bind_btDiscreteDynamicsWorld_setGravity_1= +b.asm.Ic).apply(null,arguments)},Fe=b._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0=function(){return(Fe=b._emscripten_bind_btDiscreteDynamicsWorld_getGravity_0=b.asm.Jc).apply(null,arguments)},Ge=b._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1=function(){return(Ge=b._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_1=b.asm.Kc).apply(null,arguments)},He=b._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3=function(){return(He=b._emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_3= +b.asm.Lc).apply(null,arguments)},Ie=b._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1=function(){return(Ie=b._emscripten_bind_btDiscreteDynamicsWorld_removeRigidBody_1=b.asm.Mc).apply(null,arguments)},Je=b._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1=function(){return(Je=b._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_1=b.asm.Nc).apply(null,arguments)},Ke=b._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2=function(){return(Ke=b._emscripten_bind_btDiscreteDynamicsWorld_addConstraint_2= +b.asm.Oc).apply(null,arguments)},Le=b._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1=function(){return(Le=b._emscripten_bind_btDiscreteDynamicsWorld_removeConstraint_1=b.asm.Pc).apply(null,arguments)},Me=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1=function(){return(Me=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_1=b.asm.Qc).apply(null,arguments)},Ne=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2=function(){return(Ne=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_2= +b.asm.Rc).apply(null,arguments)},Oe=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3=function(){return(Oe=b._emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3=b.asm.Sc).apply(null,arguments)},Pe=b._emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1=function(){return(Pe=b._emscripten_bind_btDiscreteDynamicsWorld_setContactAddedCallback_1=b.asm.Tc).apply(null,arguments)},Qe=b._emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1=function(){return(Qe= +b._emscripten_bind_btDiscreteDynamicsWorld_setContactProcessedCallback_1=b.asm.Uc).apply(null,arguments)},Re=b._emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1=function(){return(Re=b._emscripten_bind_btDiscreteDynamicsWorld_setContactDestroyedCallback_1=b.asm.Vc).apply(null,arguments)},Se=b._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0=function(){return(Se=b._emscripten_bind_btDiscreteDynamicsWorld_getDispatcher_0=b.asm.Wc).apply(null,arguments)},Te=b._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3= +function(){return(Te=b._emscripten_bind_btDiscreteDynamicsWorld_rayTest_3=b.asm.Xc).apply(null,arguments)},Ue=b._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0=function(){return(Ue=b._emscripten_bind_btDiscreteDynamicsWorld_getPairCache_0=b.asm.Yc).apply(null,arguments)},Ve=b._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0=function(){return(Ve=b._emscripten_bind_btDiscreteDynamicsWorld_getDispatchInfo_0=b.asm.Zc).apply(null,arguments)},We=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1= +function(){return(We=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_1=b.asm._c).apply(null,arguments)},Xe=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2=function(){return(Xe=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_2=b.asm.$c).apply(null,arguments)},Ye=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3=function(){return(Ye=b._emscripten_bind_btDiscreteDynamicsWorld_addCollisionObject_3=b.asm.ad).apply(null,arguments)},Ze=b._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1= +function(){return(Ze=b._emscripten_bind_btDiscreteDynamicsWorld_removeCollisionObject_1=b.asm.bd).apply(null,arguments)},$e=b._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0=function(){return($e=b._emscripten_bind_btDiscreteDynamicsWorld_getBroadphase_0=b.asm.cd).apply(null,arguments)},af=b._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5=function(){return(af=b._emscripten_bind_btDiscreteDynamicsWorld_convexSweepTest_5=b.asm.dd).apply(null,arguments)},bf=b._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3= +function(){return(bf=b._emscripten_bind_btDiscreteDynamicsWorld_contactPairTest_3=b.asm.ed).apply(null,arguments)},cf=b._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2=function(){return(cf=b._emscripten_bind_btDiscreteDynamicsWorld_contactTest_2=b.asm.fd).apply(null,arguments)},df=b._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1=function(){return(df=b._emscripten_bind_btDiscreteDynamicsWorld_updateSingleAabb_1=b.asm.gd).apply(null,arguments)},ef=b._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1= +function(){return(ef=b._emscripten_bind_btDiscreteDynamicsWorld_setDebugDrawer_1=b.asm.hd).apply(null,arguments)},ff=b._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0=function(){return(ff=b._emscripten_bind_btDiscreteDynamicsWorld_getDebugDrawer_0=b.asm.id).apply(null,arguments)},gf=b._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0=function(){return(gf=b._emscripten_bind_btDiscreteDynamicsWorld_debugDrawWorld_0=b.asm.jd).apply(null,arguments)},hf=b._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3= +function(){return(hf=b._emscripten_bind_btDiscreteDynamicsWorld_debugDrawObject_3=b.asm.kd).apply(null,arguments)},jf=b._emscripten_bind_btDiscreteDynamicsWorld_addAction_1=function(){return(jf=b._emscripten_bind_btDiscreteDynamicsWorld_addAction_1=b.asm.ld).apply(null,arguments)},kf=b._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1=function(){return(kf=b._emscripten_bind_btDiscreteDynamicsWorld_removeAction_1=b.asm.md).apply(null,arguments)},lf=b._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0= +function(){return(lf=b._emscripten_bind_btDiscreteDynamicsWorld_getSolverInfo_0=b.asm.nd).apply(null,arguments)},mf=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1=function(){return(mf=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_1=b.asm.od).apply(null,arguments)},nf=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2=function(){return(nf=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_2=b.asm.pd).apply(null,arguments)}, +of=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3=function(){return(of=b._emscripten_bind_btDiscreteDynamicsWorld_setInternalTickCallback_3=b.asm.qd).apply(null,arguments)},pf=b._emscripten_bind_btDiscreteDynamicsWorld___destroy___0=function(){return(pf=b._emscripten_bind_btDiscreteDynamicsWorld___destroy___0=b.asm.rd).apply(null,arguments)},qf=b._emscripten_bind_btConvexShape_setLocalScaling_1=function(){return(qf=b._emscripten_bind_btConvexShape_setLocalScaling_1=b.asm.sd).apply(null, +arguments)},rf=b._emscripten_bind_btConvexShape_getLocalScaling_0=function(){return(rf=b._emscripten_bind_btConvexShape_getLocalScaling_0=b.asm.td).apply(null,arguments)},sf=b._emscripten_bind_btConvexShape_calculateLocalInertia_2=function(){return(sf=b._emscripten_bind_btConvexShape_calculateLocalInertia_2=b.asm.ud).apply(null,arguments)},tf=b._emscripten_bind_btConvexShape_setMargin_1=function(){return(tf=b._emscripten_bind_btConvexShape_setMargin_1=b.asm.vd).apply(null,arguments)},uf=b._emscripten_bind_btConvexShape_getMargin_0= +function(){return(uf=b._emscripten_bind_btConvexShape_getMargin_0=b.asm.wd).apply(null,arguments)},vf=b._emscripten_bind_btConvexShape___destroy___0=function(){return(vf=b._emscripten_bind_btConvexShape___destroy___0=b.asm.xd).apply(null,arguments)},wf=b._emscripten_bind_btDispatcher_getNumManifolds_0=function(){return(wf=b._emscripten_bind_btDispatcher_getNumManifolds_0=b.asm.yd).apply(null,arguments)},xf=b._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1=function(){return(xf=b._emscripten_bind_btDispatcher_getManifoldByIndexInternal_1= +b.asm.zd).apply(null,arguments)},yf=b._emscripten_bind_btDispatcher___destroy___0=function(){return(yf=b._emscripten_bind_btDispatcher___destroy___0=b.asm.Ad).apply(null,arguments)},zf=b._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3=function(){return(zf=b._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_3=b.asm.Bd).apply(null,arguments)},Af=b._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5=function(){return(Af=b._emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_5= +b.asm.Cd).apply(null,arguments)},Bf=b._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1=function(){return(Bf=b._emscripten_bind_btGeneric6DofConstraint_setLinearLowerLimit_1=b.asm.Dd).apply(null,arguments)},Cf=b._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1=function(){return(Cf=b._emscripten_bind_btGeneric6DofConstraint_setLinearUpperLimit_1=b.asm.Ed).apply(null,arguments)},Df=b._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1=function(){return(Df=b._emscripten_bind_btGeneric6DofConstraint_setAngularLowerLimit_1= +b.asm.Fd).apply(null,arguments)},Ef=b._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1=function(){return(Ef=b._emscripten_bind_btGeneric6DofConstraint_setAngularUpperLimit_1=b.asm.Gd).apply(null,arguments)},Ff=b._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0=function(){return(Ff=b._emscripten_bind_btGeneric6DofConstraint_getFrameOffsetA_0=b.asm.Hd).apply(null,arguments)},Gf=b._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1=function(){return(Gf=b._emscripten_bind_btGeneric6DofConstraint_enableFeedback_1= +b.asm.Id).apply(null,arguments)},Hf=b._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0=function(){return(Hf=b._emscripten_bind_btGeneric6DofConstraint_getBreakingImpulseThreshold_0=b.asm.Jd).apply(null,arguments)},If=b._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1=function(){return(If=b._emscripten_bind_btGeneric6DofConstraint_setBreakingImpulseThreshold_1=b.asm.Kd).apply(null,arguments)},Jf=b._emscripten_bind_btGeneric6DofConstraint_getParam_2=function(){return(Jf= +b._emscripten_bind_btGeneric6DofConstraint_getParam_2=b.asm.Ld).apply(null,arguments)},Kf=b._emscripten_bind_btGeneric6DofConstraint_setParam_3=function(){return(Kf=b._emscripten_bind_btGeneric6DofConstraint_setParam_3=b.asm.Md).apply(null,arguments)},Lf=b._emscripten_bind_btGeneric6DofConstraint___destroy___0=function(){return(Lf=b._emscripten_bind_btGeneric6DofConstraint___destroy___0=b.asm.Nd).apply(null,arguments)},Mf=b._emscripten_bind_btStridingMeshInterface_setScaling_1=function(){return(Mf= +b._emscripten_bind_btStridingMeshInterface_setScaling_1=b.asm.Od).apply(null,arguments)},Nf=b._emscripten_bind_btStridingMeshInterface___destroy___0=function(){return(Nf=b._emscripten_bind_btStridingMeshInterface___destroy___0=b.asm.Pd).apply(null,arguments)},Of=b._emscripten_bind_btMotionState_getWorldTransform_1=function(){return(Of=b._emscripten_bind_btMotionState_getWorldTransform_1=b.asm.Qd).apply(null,arguments)},Pf=b._emscripten_bind_btMotionState_setWorldTransform_1=function(){return(Pf=b._emscripten_bind_btMotionState_setWorldTransform_1= +b.asm.Rd).apply(null,arguments)},Qf=b._emscripten_bind_btMotionState___destroy___0=function(){return(Qf=b._emscripten_bind_btMotionState___destroy___0=b.asm.Sd).apply(null,arguments)},Rf=b._emscripten_bind_ConvexResultCallback_hasHit_0=function(){return(Rf=b._emscripten_bind_ConvexResultCallback_hasHit_0=b.asm.Td).apply(null,arguments)},Sf=b._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0=function(){return(Sf=b._emscripten_bind_ConvexResultCallback_get_m_collisionFilterGroup_0= +b.asm.Ud).apply(null,arguments)},Tf=b._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1=function(){return(Tf=b._emscripten_bind_ConvexResultCallback_set_m_collisionFilterGroup_1=b.asm.Vd).apply(null,arguments)},Uf=b._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0=function(){return(Uf=b._emscripten_bind_ConvexResultCallback_get_m_collisionFilterMask_0=b.asm.Wd).apply(null,arguments)},Vf=b._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1=function(){return(Vf= +b._emscripten_bind_ConvexResultCallback_set_m_collisionFilterMask_1=b.asm.Xd).apply(null,arguments)},Wf=b._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0=function(){return(Wf=b._emscripten_bind_ConvexResultCallback_get_m_closestHitFraction_0=b.asm.Yd).apply(null,arguments)},Xf=b._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1=function(){return(Xf=b._emscripten_bind_ConvexResultCallback_set_m_closestHitFraction_1=b.asm.Zd).apply(null,arguments)},Yf=b._emscripten_bind_ConvexResultCallback___destroy___0= +function(){return(Yf=b._emscripten_bind_ConvexResultCallback___destroy___0=b.asm._d).apply(null,arguments)},Zf=b._emscripten_bind_ContactResultCallback_addSingleResult_7=function(){return(Zf=b._emscripten_bind_ContactResultCallback_addSingleResult_7=b.asm.$d).apply(null,arguments)},$f=b._emscripten_bind_ContactResultCallback___destroy___0=function(){return($f=b._emscripten_bind_ContactResultCallback___destroy___0=b.asm.ae).apply(null,arguments)},ag=b._emscripten_bind_btSoftBodySolver___destroy___0= +function(){return(ag=b._emscripten_bind_btSoftBodySolver___destroy___0=b.asm.be).apply(null,arguments)},bg=b._emscripten_bind_RayResultCallback_hasHit_0=function(){return(bg=b._emscripten_bind_RayResultCallback_hasHit_0=b.asm.ce).apply(null,arguments)},cg=b._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0=function(){return(cg=b._emscripten_bind_RayResultCallback_get_m_collisionFilterGroup_0=b.asm.de).apply(null,arguments)},dg=b._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1= +function(){return(dg=b._emscripten_bind_RayResultCallback_set_m_collisionFilterGroup_1=b.asm.ee).apply(null,arguments)},eg=b._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0=function(){return(eg=b._emscripten_bind_RayResultCallback_get_m_collisionFilterMask_0=b.asm.fe).apply(null,arguments)},fg=b._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1=function(){return(fg=b._emscripten_bind_RayResultCallback_set_m_collisionFilterMask_1=b.asm.ge).apply(null,arguments)},gg=b._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0= +function(){return(gg=b._emscripten_bind_RayResultCallback_get_m_closestHitFraction_0=b.asm.he).apply(null,arguments)},hg=b._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1=function(){return(hg=b._emscripten_bind_RayResultCallback_set_m_closestHitFraction_1=b.asm.ie).apply(null,arguments)},ig=b._emscripten_bind_RayResultCallback_get_m_collisionObject_0=function(){return(ig=b._emscripten_bind_RayResultCallback_get_m_collisionObject_0=b.asm.je).apply(null,arguments)},jg=b._emscripten_bind_RayResultCallback_set_m_collisionObject_1= +function(){return(jg=b._emscripten_bind_RayResultCallback_set_m_collisionObject_1=b.asm.ke).apply(null,arguments)},kg=b._emscripten_bind_RayResultCallback___destroy___0=function(){return(kg=b._emscripten_bind_RayResultCallback___destroy___0=b.asm.le).apply(null,arguments)},lg=b._emscripten_bind_btMatrix3x3_setEulerZYX_3=function(){return(lg=b._emscripten_bind_btMatrix3x3_setEulerZYX_3=b.asm.me).apply(null,arguments)},mg=b._emscripten_bind_btMatrix3x3_getRotation_1=function(){return(mg=b._emscripten_bind_btMatrix3x3_getRotation_1= +b.asm.ne).apply(null,arguments)},ng=b._emscripten_bind_btMatrix3x3_getRow_1=function(){return(ng=b._emscripten_bind_btMatrix3x3_getRow_1=b.asm.oe).apply(null,arguments)},og=b._emscripten_bind_btMatrix3x3___destroy___0=function(){return(og=b._emscripten_bind_btMatrix3x3___destroy___0=b.asm.pe).apply(null,arguments)},pg=b._emscripten_bind_btScalarArray_size_0=function(){return(pg=b._emscripten_bind_btScalarArray_size_0=b.asm.qe).apply(null,arguments)},qg=b._emscripten_bind_btScalarArray_at_1=function(){return(qg= +b._emscripten_bind_btScalarArray_at_1=b.asm.re).apply(null,arguments)},rg=b._emscripten_bind_btScalarArray___destroy___0=function(){return(rg=b._emscripten_bind_btScalarArray___destroy___0=b.asm.se).apply(null,arguments)},sg=b._emscripten_bind_Material_get_m_kLST_0=function(){return(sg=b._emscripten_bind_Material_get_m_kLST_0=b.asm.te).apply(null,arguments)},tg=b._emscripten_bind_Material_set_m_kLST_1=function(){return(tg=b._emscripten_bind_Material_set_m_kLST_1=b.asm.ue).apply(null,arguments)},ug= +b._emscripten_bind_Material_get_m_kAST_0=function(){return(ug=b._emscripten_bind_Material_get_m_kAST_0=b.asm.ve).apply(null,arguments)},vg=b._emscripten_bind_Material_set_m_kAST_1=function(){return(vg=b._emscripten_bind_Material_set_m_kAST_1=b.asm.we).apply(null,arguments)},wg=b._emscripten_bind_Material_get_m_kVST_0=function(){return(wg=b._emscripten_bind_Material_get_m_kVST_0=b.asm.xe).apply(null,arguments)},xg=b._emscripten_bind_Material_set_m_kVST_1=function(){return(xg=b._emscripten_bind_Material_set_m_kVST_1= +b.asm.ye).apply(null,arguments)},yg=b._emscripten_bind_Material_get_m_flags_0=function(){return(yg=b._emscripten_bind_Material_get_m_flags_0=b.asm.ze).apply(null,arguments)},zg=b._emscripten_bind_Material_set_m_flags_1=function(){return(zg=b._emscripten_bind_Material_set_m_flags_1=b.asm.Ae).apply(null,arguments)},Ag=b._emscripten_bind_Material___destroy___0=function(){return(Ag=b._emscripten_bind_Material___destroy___0=b.asm.Be).apply(null,arguments)},Bg=b._emscripten_bind_btDispatcherInfo_get_m_timeStep_0= +function(){return(Bg=b._emscripten_bind_btDispatcherInfo_get_m_timeStep_0=b.asm.Ce).apply(null,arguments)},Cg=b._emscripten_bind_btDispatcherInfo_set_m_timeStep_1=function(){return(Cg=b._emscripten_bind_btDispatcherInfo_set_m_timeStep_1=b.asm.De).apply(null,arguments)},Dg=b._emscripten_bind_btDispatcherInfo_get_m_stepCount_0=function(){return(Dg=b._emscripten_bind_btDispatcherInfo_get_m_stepCount_0=b.asm.Ee).apply(null,arguments)},Eg=b._emscripten_bind_btDispatcherInfo_set_m_stepCount_1=function(){return(Eg= +b._emscripten_bind_btDispatcherInfo_set_m_stepCount_1=b.asm.Fe).apply(null,arguments)},Fg=b._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0=function(){return(Fg=b._emscripten_bind_btDispatcherInfo_get_m_dispatchFunc_0=b.asm.Ge).apply(null,arguments)},Gg=b._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1=function(){return(Gg=b._emscripten_bind_btDispatcherInfo_set_m_dispatchFunc_1=b.asm.He).apply(null,arguments)},Hg=b._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0=function(){return(Hg= +b._emscripten_bind_btDispatcherInfo_get_m_timeOfImpact_0=b.asm.Ie).apply(null,arguments)},Ig=b._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1=function(){return(Ig=b._emscripten_bind_btDispatcherInfo_set_m_timeOfImpact_1=b.asm.Je).apply(null,arguments)},Jg=b._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0=function(){return(Jg=b._emscripten_bind_btDispatcherInfo_get_m_useContinuous_0=b.asm.Ke).apply(null,arguments)},Kg=b._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1=function(){return(Kg= +b._emscripten_bind_btDispatcherInfo_set_m_useContinuous_1=b.asm.Le).apply(null,arguments)},Lg=b._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0=function(){return(Lg=b._emscripten_bind_btDispatcherInfo_get_m_enableSatConvex_0=b.asm.Me).apply(null,arguments)},Mg=b._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1=function(){return(Mg=b._emscripten_bind_btDispatcherInfo_set_m_enableSatConvex_1=b.asm.Ne).apply(null,arguments)},Ng=b._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0= +function(){return(Ng=b._emscripten_bind_btDispatcherInfo_get_m_enableSPU_0=b.asm.Oe).apply(null,arguments)},Og=b._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1=function(){return(Og=b._emscripten_bind_btDispatcherInfo_set_m_enableSPU_1=b.asm.Pe).apply(null,arguments)},Pg=b._emscripten_bind_btDispatcherInfo_get_m_useEpa_0=function(){return(Pg=b._emscripten_bind_btDispatcherInfo_get_m_useEpa_0=b.asm.Qe).apply(null,arguments)},Qg=b._emscripten_bind_btDispatcherInfo_set_m_useEpa_1=function(){return(Qg= +b._emscripten_bind_btDispatcherInfo_set_m_useEpa_1=b.asm.Re).apply(null,arguments)},Rg=b._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0=function(){return(Rg=b._emscripten_bind_btDispatcherInfo_get_m_allowedCcdPenetration_0=b.asm.Se).apply(null,arguments)},Sg=b._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1=function(){return(Sg=b._emscripten_bind_btDispatcherInfo_set_m_allowedCcdPenetration_1=b.asm.Te).apply(null,arguments)},Tg=b._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0= +function(){return(Tg=b._emscripten_bind_btDispatcherInfo_get_m_useConvexConservativeDistanceUtil_0=b.asm.Ue).apply(null,arguments)},Ug=b._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1=function(){return(Ug=b._emscripten_bind_btDispatcherInfo_set_m_useConvexConservativeDistanceUtil_1=b.asm.Ve).apply(null,arguments)},Vg=b._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0=function(){return(Vg=b._emscripten_bind_btDispatcherInfo_get_m_convexConservativeDistanceThreshold_0= +b.asm.We).apply(null,arguments)},Wg=b._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1=function(){return(Wg=b._emscripten_bind_btDispatcherInfo_set_m_convexConservativeDistanceThreshold_1=b.asm.Xe).apply(null,arguments)},Xg=b._emscripten_bind_btDispatcherInfo___destroy___0=function(){return(Xg=b._emscripten_bind_btDispatcherInfo___destroy___0=b.asm.Ye).apply(null,arguments)},Yg=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0=function(){return(Yg= +b._emscripten_bind_btWheelInfoConstructionInfo_get_m_chassisConnectionCS_0=b.asm.Ze).apply(null,arguments)},Zg=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1=function(){return(Zg=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_chassisConnectionCS_1=b.asm._e).apply(null,arguments)},$g=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0=function(){return($g=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelDirectionCS_0=b.asm.$e).apply(null, +arguments)},ah=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1=function(){return(ah=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelDirectionCS_1=b.asm.af).apply(null,arguments)},bh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0=function(){return(bh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelAxleCS_0=b.asm.bf).apply(null,arguments)},ch=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1=function(){return(ch=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelAxleCS_1= +b.asm.cf).apply(null,arguments)},dh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0=function(){return(dh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionRestLength_0=b.asm.df).apply(null,arguments)},eh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1=function(){return(eh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionRestLength_1=b.asm.ef).apply(null,arguments)},fh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0= +function(){return(fh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionTravelCm_0=b.asm.ff).apply(null,arguments)},gh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1=function(){return(gh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionTravelCm_1=b.asm.gf).apply(null,arguments)},hh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0=function(){return(hh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelRadius_0=b.asm.hf).apply(null, +arguments)},ih=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1=function(){return(ih=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelRadius_1=b.asm.jf).apply(null,arguments)},jh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0=function(){return(jh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_suspensionStiffness_0=b.asm.kf).apply(null,arguments)},kh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1=function(){return(kh= +b._emscripten_bind_btWheelInfoConstructionInfo_set_m_suspensionStiffness_1=b.asm.lf).apply(null,arguments)},lh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0=function(){return(lh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingCompression_0=b.asm.mf).apply(null,arguments)},mh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1=function(){return(mh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingCompression_1= +b.asm.nf).apply(null,arguments)},nh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0=function(){return(nh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_wheelsDampingRelaxation_0=b.asm.of).apply(null,arguments)},oh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1=function(){return(oh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_wheelsDampingRelaxation_1=b.asm.pf).apply(null,arguments)},ph=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0= +function(){return(ph=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_frictionSlip_0=b.asm.qf).apply(null,arguments)},qh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1=function(){return(qh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_frictionSlip_1=b.asm.rf).apply(null,arguments)},rh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0=function(){return(rh=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_maxSuspensionForce_0=b.asm.sf).apply(null, +arguments)},sh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1=function(){return(sh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_maxSuspensionForce_1=b.asm.tf).apply(null,arguments)},th=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0=function(){return(th=b._emscripten_bind_btWheelInfoConstructionInfo_get_m_bIsFrontWheel_0=b.asm.uf).apply(null,arguments)},uh=b._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1=function(){return(uh= +b._emscripten_bind_btWheelInfoConstructionInfo_set_m_bIsFrontWheel_1=b.asm.vf).apply(null,arguments)},vh=b._emscripten_bind_btWheelInfoConstructionInfo___destroy___0=function(){return(vh=b._emscripten_bind_btWheelInfoConstructionInfo___destroy___0=b.asm.wf).apply(null,arguments)},wh=b._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1=function(){return(wh=b._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_1=b.asm.xf).apply(null,arguments)},xh=b._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2= +function(){return(xh=b._emscripten_bind_btConvexTriangleMeshShape_btConvexTriangleMeshShape_2=b.asm.yf).apply(null,arguments)},yh=b._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1=function(){return(yh=b._emscripten_bind_btConvexTriangleMeshShape_setLocalScaling_1=b.asm.zf).apply(null,arguments)},zh=b._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0=function(){return(zh=b._emscripten_bind_btConvexTriangleMeshShape_getLocalScaling_0=b.asm.Af).apply(null,arguments)},Ah=b._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2= +function(){return(Ah=b._emscripten_bind_btConvexTriangleMeshShape_calculateLocalInertia_2=b.asm.Bf).apply(null,arguments)},Bh=b._emscripten_bind_btConvexTriangleMeshShape_setMargin_1=function(){return(Bh=b._emscripten_bind_btConvexTriangleMeshShape_setMargin_1=b.asm.Cf).apply(null,arguments)},Ch=b._emscripten_bind_btConvexTriangleMeshShape_getMargin_0=function(){return(Ch=b._emscripten_bind_btConvexTriangleMeshShape_getMargin_0=b.asm.Df).apply(null,arguments)},Dh=b._emscripten_bind_btConvexTriangleMeshShape___destroy___0= +function(){return(Dh=b._emscripten_bind_btConvexTriangleMeshShape___destroy___0=b.asm.Ef).apply(null,arguments)},Eh=b._emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0=function(){return(Eh=b._emscripten_bind_btBroadphaseInterface_getOverlappingPairCache_0=b.asm.Ff).apply(null,arguments)},Fh=b._emscripten_bind_btBroadphaseInterface___destroy___0=function(){return(Fh=b._emscripten_bind_btBroadphaseInterface___destroy___0=b.asm.Gf).apply(null,arguments)},Gh=b._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3= +function(){return(Gh=b._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_3=b.asm.Hf).apply(null,arguments)},Hh=b._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4=function(){return(Hh=b._emscripten_bind_btRigidBodyConstructionInfo_btRigidBodyConstructionInfo_4=b.asm.If).apply(null,arguments)},Ih=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0=function(){return(Ih=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearDamping_0= +b.asm.Jf).apply(null,arguments)},Jh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1=function(){return(Jh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearDamping_1=b.asm.Kf).apply(null,arguments)},Kh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0=function(){return(Kh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularDamping_0=b.asm.Lf).apply(null,arguments)},Lh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1=function(){return(Lh= +b._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularDamping_1=b.asm.Mf).apply(null,arguments)},Mh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0=function(){return(Mh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_friction_0=b.asm.Nf).apply(null,arguments)},Nh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1=function(){return(Nh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_friction_1=b.asm.Of).apply(null,arguments)},Oh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0= +function(){return(Oh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_rollingFriction_0=b.asm.Pf).apply(null,arguments)},Ph=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1=function(){return(Ph=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_rollingFriction_1=b.asm.Qf).apply(null,arguments)},Qh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0=function(){return(Qh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_restitution_0=b.asm.Rf).apply(null, +arguments)},Rh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1=function(){return(Rh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_restitution_1=b.asm.Sf).apply(null,arguments)},Sh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0=function(){return(Sh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_linearSleepingThreshold_0=b.asm.Tf).apply(null,arguments)},Th=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1=function(){return(Th= +b._emscripten_bind_btRigidBodyConstructionInfo_set_m_linearSleepingThreshold_1=b.asm.Uf).apply(null,arguments)},Uh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0=function(){return(Uh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_angularSleepingThreshold_0=b.asm.Vf).apply(null,arguments)},Vh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1=function(){return(Vh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_angularSleepingThreshold_1= +b.asm.Wf).apply(null,arguments)},Wh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0=function(){return(Wh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDamping_0=b.asm.Xf).apply(null,arguments)},Xh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1=function(){return(Xh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDamping_1=b.asm.Yf).apply(null,arguments)},Yh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0= +function(){return(Yh=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalDampingFactor_0=b.asm.Zf).apply(null,arguments)},Zh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1=function(){return(Zh=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalDampingFactor_1=b.asm._f).apply(null,arguments)},$h=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0=function(){return($h=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalLinearDampingThresholdSqr_0= +b.asm.$f).apply(null,arguments)},ai=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1=function(){return(ai=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalLinearDampingThresholdSqr_1=b.asm.ag).apply(null,arguments)},bi=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0=function(){return(bi=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingThresholdSqr_0=b.asm.bg).apply(null, +arguments)},ci=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1=function(){return(ci=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingThresholdSqr_1=b.asm.cg).apply(null,arguments)},di=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0=function(){return(di=b._emscripten_bind_btRigidBodyConstructionInfo_get_m_additionalAngularDampingFactor_0=b.asm.dg).apply(null,arguments)},ei=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1= +function(){return(ei=b._emscripten_bind_btRigidBodyConstructionInfo_set_m_additionalAngularDampingFactor_1=b.asm.eg).apply(null,arguments)},fi=b._emscripten_bind_btRigidBodyConstructionInfo___destroy___0=function(){return(fi=b._emscripten_bind_btRigidBodyConstructionInfo___destroy___0=b.asm.fg).apply(null,arguments)},gi=b._emscripten_bind_btCollisionConfiguration___destroy___0=function(){return(gi=b._emscripten_bind_btCollisionConfiguration___destroy___0=b.asm.gg).apply(null,arguments)},hi=b._emscripten_bind_btPersistentManifold_btPersistentManifold_0= +function(){return(hi=b._emscripten_bind_btPersistentManifold_btPersistentManifold_0=b.asm.hg).apply(null,arguments)},ii=b._emscripten_bind_btPersistentManifold_getBody0_0=function(){return(ii=b._emscripten_bind_btPersistentManifold_getBody0_0=b.asm.ig).apply(null,arguments)},ji=b._emscripten_bind_btPersistentManifold_getBody1_0=function(){return(ji=b._emscripten_bind_btPersistentManifold_getBody1_0=b.asm.jg).apply(null,arguments)},ki=b._emscripten_bind_btPersistentManifold_getNumContacts_0=function(){return(ki= +b._emscripten_bind_btPersistentManifold_getNumContacts_0=b.asm.kg).apply(null,arguments)},li=b._emscripten_bind_btPersistentManifold_getContactPoint_1=function(){return(li=b._emscripten_bind_btPersistentManifold_getContactPoint_1=b.asm.lg).apply(null,arguments)},mi=b._emscripten_bind_btPersistentManifold___destroy___0=function(){return(mi=b._emscripten_bind_btPersistentManifold___destroy___0=b.asm.mg).apply(null,arguments)},ni=b._emscripten_bind_btCompoundShape_btCompoundShape_0=function(){return(ni= +b._emscripten_bind_btCompoundShape_btCompoundShape_0=b.asm.ng).apply(null,arguments)},oi=b._emscripten_bind_btCompoundShape_btCompoundShape_1=function(){return(oi=b._emscripten_bind_btCompoundShape_btCompoundShape_1=b.asm.og).apply(null,arguments)},pi=b._emscripten_bind_btCompoundShape_addChildShape_2=function(){return(pi=b._emscripten_bind_btCompoundShape_addChildShape_2=b.asm.pg).apply(null,arguments)},qi=b._emscripten_bind_btCompoundShape_removeChildShape_1=function(){return(qi=b._emscripten_bind_btCompoundShape_removeChildShape_1= +b.asm.qg).apply(null,arguments)},ri=b._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1=function(){return(ri=b._emscripten_bind_btCompoundShape_removeChildShapeByIndex_1=b.asm.rg).apply(null,arguments)},si=b._emscripten_bind_btCompoundShape_getNumChildShapes_0=function(){return(si=b._emscripten_bind_btCompoundShape_getNumChildShapes_0=b.asm.sg).apply(null,arguments)},ti=b._emscripten_bind_btCompoundShape_getChildShape_1=function(){return(ti=b._emscripten_bind_btCompoundShape_getChildShape_1= +b.asm.tg).apply(null,arguments)},ui=b._emscripten_bind_btCompoundShape_updateChildTransform_2=function(){return(ui=b._emscripten_bind_btCompoundShape_updateChildTransform_2=b.asm.ug).apply(null,arguments)},vi=b._emscripten_bind_btCompoundShape_updateChildTransform_3=function(){return(vi=b._emscripten_bind_btCompoundShape_updateChildTransform_3=b.asm.vg).apply(null,arguments)},wi=b._emscripten_bind_btCompoundShape_setMargin_1=function(){return(wi=b._emscripten_bind_btCompoundShape_setMargin_1=b.asm.wg).apply(null, +arguments)},xi=b._emscripten_bind_btCompoundShape_getMargin_0=function(){return(xi=b._emscripten_bind_btCompoundShape_getMargin_0=b.asm.xg).apply(null,arguments)},yi=b._emscripten_bind_btCompoundShape_setLocalScaling_1=function(){return(yi=b._emscripten_bind_btCompoundShape_setLocalScaling_1=b.asm.yg).apply(null,arguments)},zi=b._emscripten_bind_btCompoundShape_getLocalScaling_0=function(){return(zi=b._emscripten_bind_btCompoundShape_getLocalScaling_0=b.asm.zg).apply(null,arguments)},Ai=b._emscripten_bind_btCompoundShape_calculateLocalInertia_2= +function(){return(Ai=b._emscripten_bind_btCompoundShape_calculateLocalInertia_2=b.asm.Ag).apply(null,arguments)},Bi=b._emscripten_bind_btCompoundShape___destroy___0=function(){return(Bi=b._emscripten_bind_btCompoundShape___destroy___0=b.asm.Bg).apply(null,arguments)},Ci=b._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2=function(){return(Ci=b._emscripten_bind_ClosestConvexResultCallback_ClosestConvexResultCallback_2=b.asm.Cg).apply(null,arguments)},Di=b._emscripten_bind_ClosestConvexResultCallback_hasHit_0= +function(){return(Di=b._emscripten_bind_ClosestConvexResultCallback_hasHit_0=b.asm.Dg).apply(null,arguments)},Ei=b._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0=function(){return(Ei=b._emscripten_bind_ClosestConvexResultCallback_get_m_convexFromWorld_0=b.asm.Eg).apply(null,arguments)},Fi=b._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1=function(){return(Fi=b._emscripten_bind_ClosestConvexResultCallback_set_m_convexFromWorld_1=b.asm.Fg).apply(null,arguments)}, +Gi=b._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0=function(){return(Gi=b._emscripten_bind_ClosestConvexResultCallback_get_m_convexToWorld_0=b.asm.Gg).apply(null,arguments)},Hi=b._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1=function(){return(Hi=b._emscripten_bind_ClosestConvexResultCallback_set_m_convexToWorld_1=b.asm.Hg).apply(null,arguments)},Ii=b._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0=function(){return(Ii=b._emscripten_bind_ClosestConvexResultCallback_get_m_hitNormalWorld_0= +b.asm.Ig).apply(null,arguments)},Ji=b._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1=function(){return(Ji=b._emscripten_bind_ClosestConvexResultCallback_set_m_hitNormalWorld_1=b.asm.Jg).apply(null,arguments)},Ki=b._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0=function(){return(Ki=b._emscripten_bind_ClosestConvexResultCallback_get_m_hitPointWorld_0=b.asm.Kg).apply(null,arguments)},Li=b._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1=function(){return(Li= +b._emscripten_bind_ClosestConvexResultCallback_set_m_hitPointWorld_1=b.asm.Lg).apply(null,arguments)},Mi=b._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0=function(){return(Mi=b._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterGroup_0=b.asm.Mg).apply(null,arguments)},Ni=b._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1=function(){return(Ni=b._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterGroup_1=b.asm.Ng).apply(null, +arguments)},Oi=b._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0=function(){return(Oi=b._emscripten_bind_ClosestConvexResultCallback_get_m_collisionFilterMask_0=b.asm.Og).apply(null,arguments)},Pi=b._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1=function(){return(Pi=b._emscripten_bind_ClosestConvexResultCallback_set_m_collisionFilterMask_1=b.asm.Pg).apply(null,arguments)},Qi=b._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0= +function(){return(Qi=b._emscripten_bind_ClosestConvexResultCallback_get_m_closestHitFraction_0=b.asm.Qg).apply(null,arguments)},Ri=b._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1=function(){return(Ri=b._emscripten_bind_ClosestConvexResultCallback_set_m_closestHitFraction_1=b.asm.Rg).apply(null,arguments)},Si=b._emscripten_bind_ClosestConvexResultCallback___destroy___0=function(){return(Si=b._emscripten_bind_ClosestConvexResultCallback___destroy___0=b.asm.Sg).apply(null,arguments)}, +Ti=b._emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2=function(){return(Ti=b._emscripten_bind_AllHitsRayResultCallback_AllHitsRayResultCallback_2=b.asm.Tg).apply(null,arguments)},Ui=b._emscripten_bind_AllHitsRayResultCallback_hasHit_0=function(){return(Ui=b._emscripten_bind_AllHitsRayResultCallback_hasHit_0=b.asm.Ug).apply(null,arguments)},Vi=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0=function(){return(Vi=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObjects_0= +b.asm.Vg).apply(null,arguments)},Wi=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1=function(){return(Wi=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObjects_1=b.asm.Wg).apply(null,arguments)},Xi=b._emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0=function(){return(Xi=b._emscripten_bind_AllHitsRayResultCallback_get_m_rayFromWorld_0=b.asm.Xg).apply(null,arguments)},Yi=b._emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1=function(){return(Yi= +b._emscripten_bind_AllHitsRayResultCallback_set_m_rayFromWorld_1=b.asm.Yg).apply(null,arguments)},Zi=b._emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0=function(){return(Zi=b._emscripten_bind_AllHitsRayResultCallback_get_m_rayToWorld_0=b.asm.Zg).apply(null,arguments)},$i=b._emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1=function(){return($i=b._emscripten_bind_AllHitsRayResultCallback_set_m_rayToWorld_1=b.asm._g).apply(null,arguments)},aj=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0= +function(){return(aj=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitNormalWorld_0=b.asm.$g).apply(null,arguments)},bj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1=function(){return(bj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitNormalWorld_1=b.asm.ah).apply(null,arguments)},cj=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0=function(){return(cj=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitPointWorld_0=b.asm.bh).apply(null,arguments)}, +dj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1=function(){return(dj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitPointWorld_1=b.asm.ch).apply(null,arguments)},ej=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0=function(){return(ej=b._emscripten_bind_AllHitsRayResultCallback_get_m_hitFractions_0=b.asm.dh).apply(null,arguments)},fj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1=function(){return(fj=b._emscripten_bind_AllHitsRayResultCallback_set_m_hitFractions_1= +b.asm.eh).apply(null,arguments)},gj=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0=function(){return(gj=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterGroup_0=b.asm.fh).apply(null,arguments)},hj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1=function(){return(hj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterGroup_1=b.asm.gh).apply(null,arguments)},ij=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0= +function(){return(ij=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionFilterMask_0=b.asm.hh).apply(null,arguments)},jj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1=function(){return(jj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionFilterMask_1=b.asm.ih).apply(null,arguments)},kj=b._emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0=function(){return(kj=b._emscripten_bind_AllHitsRayResultCallback_get_m_closestHitFraction_0=b.asm.jh).apply(null, +arguments)},lj=b._emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1=function(){return(lj=b._emscripten_bind_AllHitsRayResultCallback_set_m_closestHitFraction_1=b.asm.kh).apply(null,arguments)},mj=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0=function(){return(mj=b._emscripten_bind_AllHitsRayResultCallback_get_m_collisionObject_0=b.asm.lh).apply(null,arguments)},nj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1=function(){return(nj=b._emscripten_bind_AllHitsRayResultCallback_set_m_collisionObject_1= +b.asm.mh).apply(null,arguments)},oj=b._emscripten_bind_AllHitsRayResultCallback___destroy___0=function(){return(oj=b._emscripten_bind_AllHitsRayResultCallback___destroy___0=b.asm.nh).apply(null,arguments)},pj=b._emscripten_bind_tMaterialArray_size_0=function(){return(pj=b._emscripten_bind_tMaterialArray_size_0=b.asm.oh).apply(null,arguments)},qj=b._emscripten_bind_tMaterialArray_at_1=function(){return(qj=b._emscripten_bind_tMaterialArray_at_1=b.asm.ph).apply(null,arguments)},rj=b._emscripten_bind_tMaterialArray___destroy___0= +function(){return(rj=b._emscripten_bind_tMaterialArray___destroy___0=b.asm.qh).apply(null,arguments)},sj=b._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1=function(){return(sj=b._emscripten_bind_btDefaultVehicleRaycaster_btDefaultVehicleRaycaster_1=b.asm.rh).apply(null,arguments)},tj=b._emscripten_bind_btDefaultVehicleRaycaster_castRay_3=function(){return(tj=b._emscripten_bind_btDefaultVehicleRaycaster_castRay_3=b.asm.sh).apply(null,arguments)},uj=b._emscripten_bind_btDefaultVehicleRaycaster___destroy___0= +function(){return(uj=b._emscripten_bind_btDefaultVehicleRaycaster___destroy___0=b.asm.th).apply(null,arguments)},vj=b._emscripten_bind_btEmptyShape_btEmptyShape_0=function(){return(vj=b._emscripten_bind_btEmptyShape_btEmptyShape_0=b.asm.uh).apply(null,arguments)},wj=b._emscripten_bind_btEmptyShape_setLocalScaling_1=function(){return(wj=b._emscripten_bind_btEmptyShape_setLocalScaling_1=b.asm.vh).apply(null,arguments)},xj=b._emscripten_bind_btEmptyShape_getLocalScaling_0=function(){return(xj=b._emscripten_bind_btEmptyShape_getLocalScaling_0= +b.asm.wh).apply(null,arguments)},yj=b._emscripten_bind_btEmptyShape_calculateLocalInertia_2=function(){return(yj=b._emscripten_bind_btEmptyShape_calculateLocalInertia_2=b.asm.xh).apply(null,arguments)},zj=b._emscripten_bind_btEmptyShape___destroy___0=function(){return(zj=b._emscripten_bind_btEmptyShape___destroy___0=b.asm.yh).apply(null,arguments)},Aj=b._emscripten_bind_btConstraintSetting_btConstraintSetting_0=function(){return(Aj=b._emscripten_bind_btConstraintSetting_btConstraintSetting_0=b.asm.zh).apply(null, +arguments)},Bj=b._emscripten_bind_btConstraintSetting_get_m_tau_0=function(){return(Bj=b._emscripten_bind_btConstraintSetting_get_m_tau_0=b.asm.Ah).apply(null,arguments)},Cj=b._emscripten_bind_btConstraintSetting_set_m_tau_1=function(){return(Cj=b._emscripten_bind_btConstraintSetting_set_m_tau_1=b.asm.Bh).apply(null,arguments)},Dj=b._emscripten_bind_btConstraintSetting_get_m_damping_0=function(){return(Dj=b._emscripten_bind_btConstraintSetting_get_m_damping_0=b.asm.Ch).apply(null,arguments)},Ej=b._emscripten_bind_btConstraintSetting_set_m_damping_1= +function(){return(Ej=b._emscripten_bind_btConstraintSetting_set_m_damping_1=b.asm.Dh).apply(null,arguments)},Fj=b._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0=function(){return(Fj=b._emscripten_bind_btConstraintSetting_get_m_impulseClamp_0=b.asm.Eh).apply(null,arguments)},Gj=b._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1=function(){return(Gj=b._emscripten_bind_btConstraintSetting_set_m_impulseClamp_1=b.asm.Fh).apply(null,arguments)},Hj=b._emscripten_bind_btConstraintSetting___destroy___0= +function(){return(Hj=b._emscripten_bind_btConstraintSetting___destroy___0=b.asm.Gh).apply(null,arguments)},Ij=b._emscripten_bind_LocalShapeInfo_get_m_shapePart_0=function(){return(Ij=b._emscripten_bind_LocalShapeInfo_get_m_shapePart_0=b.asm.Hh).apply(null,arguments)},Jj=b._emscripten_bind_LocalShapeInfo_set_m_shapePart_1=function(){return(Jj=b._emscripten_bind_LocalShapeInfo_set_m_shapePart_1=b.asm.Ih).apply(null,arguments)},Kj=b._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0=function(){return(Kj= +b._emscripten_bind_LocalShapeInfo_get_m_triangleIndex_0=b.asm.Jh).apply(null,arguments)},Lj=b._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1=function(){return(Lj=b._emscripten_bind_LocalShapeInfo_set_m_triangleIndex_1=b.asm.Kh).apply(null,arguments)},Mj=b._emscripten_bind_LocalShapeInfo___destroy___0=function(){return(Mj=b._emscripten_bind_LocalShapeInfo___destroy___0=b.asm.Lh).apply(null,arguments)},Nj=b._emscripten_bind_btRigidBody_btRigidBody_1=function(){return(Nj=b._emscripten_bind_btRigidBody_btRigidBody_1= +b.asm.Mh).apply(null,arguments)},Oj=b._emscripten_bind_btRigidBody_getCenterOfMassTransform_0=function(){return(Oj=b._emscripten_bind_btRigidBody_getCenterOfMassTransform_0=b.asm.Nh).apply(null,arguments)},Pj=b._emscripten_bind_btRigidBody_setCenterOfMassTransform_1=function(){return(Pj=b._emscripten_bind_btRigidBody_setCenterOfMassTransform_1=b.asm.Oh).apply(null,arguments)},Qj=b._emscripten_bind_btRigidBody_setSleepingThresholds_2=function(){return(Qj=b._emscripten_bind_btRigidBody_setSleepingThresholds_2= +b.asm.Ph).apply(null,arguments)},Rj=b._emscripten_bind_btRigidBody_getLinearDamping_0=function(){return(Rj=b._emscripten_bind_btRigidBody_getLinearDamping_0=b.asm.Qh).apply(null,arguments)},Sj=b._emscripten_bind_btRigidBody_getAngularDamping_0=function(){return(Sj=b._emscripten_bind_btRigidBody_getAngularDamping_0=b.asm.Rh).apply(null,arguments)},Tj=b._emscripten_bind_btRigidBody_setDamping_2=function(){return(Tj=b._emscripten_bind_btRigidBody_setDamping_2=b.asm.Sh).apply(null,arguments)},Uj=b._emscripten_bind_btRigidBody_setMassProps_2= +function(){return(Uj=b._emscripten_bind_btRigidBody_setMassProps_2=b.asm.Th).apply(null,arguments)},Vj=b._emscripten_bind_btRigidBody_getLinearFactor_0=function(){return(Vj=b._emscripten_bind_btRigidBody_getLinearFactor_0=b.asm.Uh).apply(null,arguments)},Wj=b._emscripten_bind_btRigidBody_setLinearFactor_1=function(){return(Wj=b._emscripten_bind_btRigidBody_setLinearFactor_1=b.asm.Vh).apply(null,arguments)},Xj=b._emscripten_bind_btRigidBody_applyTorque_1=function(){return(Xj=b._emscripten_bind_btRigidBody_applyTorque_1= +b.asm.Wh).apply(null,arguments)},Yj=b._emscripten_bind_btRigidBody_applyLocalTorque_1=function(){return(Yj=b._emscripten_bind_btRigidBody_applyLocalTorque_1=b.asm.Xh).apply(null,arguments)},Zj=b._emscripten_bind_btRigidBody_applyForce_2=function(){return(Zj=b._emscripten_bind_btRigidBody_applyForce_2=b.asm.Yh).apply(null,arguments)},ak=b._emscripten_bind_btRigidBody_applyCentralForce_1=function(){return(ak=b._emscripten_bind_btRigidBody_applyCentralForce_1=b.asm.Zh).apply(null,arguments)},bk=b._emscripten_bind_btRigidBody_applyCentralLocalForce_1= +function(){return(bk=b._emscripten_bind_btRigidBody_applyCentralLocalForce_1=b.asm._h).apply(null,arguments)},ck=b._emscripten_bind_btRigidBody_applyTorqueImpulse_1=function(){return(ck=b._emscripten_bind_btRigidBody_applyTorqueImpulse_1=b.asm.$h).apply(null,arguments)},dk=b._emscripten_bind_btRigidBody_applyImpulse_2=function(){return(dk=b._emscripten_bind_btRigidBody_applyImpulse_2=b.asm.ai).apply(null,arguments)},ek=b._emscripten_bind_btRigidBody_applyCentralImpulse_1=function(){return(ek=b._emscripten_bind_btRigidBody_applyCentralImpulse_1= +b.asm.bi).apply(null,arguments)},fk=b._emscripten_bind_btRigidBody_updateInertiaTensor_0=function(){return(fk=b._emscripten_bind_btRigidBody_updateInertiaTensor_0=b.asm.ci).apply(null,arguments)},gk=b._emscripten_bind_btRigidBody_getLinearVelocity_0=function(){return(gk=b._emscripten_bind_btRigidBody_getLinearVelocity_0=b.asm.di).apply(null,arguments)},hk=b._emscripten_bind_btRigidBody_getAngularVelocity_0=function(){return(hk=b._emscripten_bind_btRigidBody_getAngularVelocity_0=b.asm.ei).apply(null, +arguments)},ik=b._emscripten_bind_btRigidBody_setLinearVelocity_1=function(){return(ik=b._emscripten_bind_btRigidBody_setLinearVelocity_1=b.asm.fi).apply(null,arguments)},jk=b._emscripten_bind_btRigidBody_setAngularVelocity_1=function(){return(jk=b._emscripten_bind_btRigidBody_setAngularVelocity_1=b.asm.gi).apply(null,arguments)},kk=b._emscripten_bind_btRigidBody_getMotionState_0=function(){return(kk=b._emscripten_bind_btRigidBody_getMotionState_0=b.asm.hi).apply(null,arguments)},lk=b._emscripten_bind_btRigidBody_setMotionState_1= +function(){return(lk=b._emscripten_bind_btRigidBody_setMotionState_1=b.asm.ii).apply(null,arguments)},mk=b._emscripten_bind_btRigidBody_getAngularFactor_0=function(){return(mk=b._emscripten_bind_btRigidBody_getAngularFactor_0=b.asm.ji).apply(null,arguments)},nk=b._emscripten_bind_btRigidBody_setAngularFactor_1=function(){return(nk=b._emscripten_bind_btRigidBody_setAngularFactor_1=b.asm.ki).apply(null,arguments)},ok=b._emscripten_bind_btRigidBody_upcast_1=function(){return(ok=b._emscripten_bind_btRigidBody_upcast_1= +b.asm.li).apply(null,arguments)},pk=b._emscripten_bind_btRigidBody_getAabb_2=function(){return(pk=b._emscripten_bind_btRigidBody_getAabb_2=b.asm.mi).apply(null,arguments)},qk=b._emscripten_bind_btRigidBody_applyGravity_0=function(){return(qk=b._emscripten_bind_btRigidBody_applyGravity_0=b.asm.ni).apply(null,arguments)},rk=b._emscripten_bind_btRigidBody_getGravity_0=function(){return(rk=b._emscripten_bind_btRigidBody_getGravity_0=b.asm.oi).apply(null,arguments)},sk=b._emscripten_bind_btRigidBody_setGravity_1= +function(){return(sk=b._emscripten_bind_btRigidBody_setGravity_1=b.asm.pi).apply(null,arguments)},tk=b._emscripten_bind_btRigidBody_getBroadphaseProxy_0=function(){return(tk=b._emscripten_bind_btRigidBody_getBroadphaseProxy_0=b.asm.qi).apply(null,arguments)},uk=b._emscripten_bind_btRigidBody_clearForces_0=function(){return(uk=b._emscripten_bind_btRigidBody_clearForces_0=b.asm.ri).apply(null,arguments)},vk=b._emscripten_bind_btRigidBody_setAnisotropicFriction_2=function(){return(vk=b._emscripten_bind_btRigidBody_setAnisotropicFriction_2= +b.asm.si).apply(null,arguments)},wk=b._emscripten_bind_btRigidBody_getCollisionShape_0=function(){return(wk=b._emscripten_bind_btRigidBody_getCollisionShape_0=b.asm.ti).apply(null,arguments)},xk=b._emscripten_bind_btRigidBody_setContactProcessingThreshold_1=function(){return(xk=b._emscripten_bind_btRigidBody_setContactProcessingThreshold_1=b.asm.ui).apply(null,arguments)},yk=b._emscripten_bind_btRigidBody_setActivationState_1=function(){return(yk=b._emscripten_bind_btRigidBody_setActivationState_1= +b.asm.vi).apply(null,arguments)},zk=b._emscripten_bind_btRigidBody_forceActivationState_1=function(){return(zk=b._emscripten_bind_btRigidBody_forceActivationState_1=b.asm.wi).apply(null,arguments)},Ak=b._emscripten_bind_btRigidBody_activate_0=function(){return(Ak=b._emscripten_bind_btRigidBody_activate_0=b.asm.xi).apply(null,arguments)},Bk=b._emscripten_bind_btRigidBody_activate_1=function(){return(Bk=b._emscripten_bind_btRigidBody_activate_1=b.asm.yi).apply(null,arguments)},Ck=b._emscripten_bind_btRigidBody_isActive_0= +function(){return(Ck=b._emscripten_bind_btRigidBody_isActive_0=b.asm.zi).apply(null,arguments)},Dk=b._emscripten_bind_btRigidBody_isKinematicObject_0=function(){return(Dk=b._emscripten_bind_btRigidBody_isKinematicObject_0=b.asm.Ai).apply(null,arguments)},Ek=b._emscripten_bind_btRigidBody_isStaticObject_0=function(){return(Ek=b._emscripten_bind_btRigidBody_isStaticObject_0=b.asm.Bi).apply(null,arguments)},Fk=b._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0=function(){return(Fk=b._emscripten_bind_btRigidBody_isStaticOrKinematicObject_0= +b.asm.Ci).apply(null,arguments)},Gk=b._emscripten_bind_btRigidBody_getRestitution_0=function(){return(Gk=b._emscripten_bind_btRigidBody_getRestitution_0=b.asm.Di).apply(null,arguments)},Hk=b._emscripten_bind_btRigidBody_getFriction_0=function(){return(Hk=b._emscripten_bind_btRigidBody_getFriction_0=b.asm.Ei).apply(null,arguments)},Ik=b._emscripten_bind_btRigidBody_getRollingFriction_0=function(){return(Ik=b._emscripten_bind_btRigidBody_getRollingFriction_0=b.asm.Fi).apply(null,arguments)},Jk=b._emscripten_bind_btRigidBody_setRestitution_1= +function(){return(Jk=b._emscripten_bind_btRigidBody_setRestitution_1=b.asm.Gi).apply(null,arguments)},Kk=b._emscripten_bind_btRigidBody_setFriction_1=function(){return(Kk=b._emscripten_bind_btRigidBody_setFriction_1=b.asm.Hi).apply(null,arguments)},Lk=b._emscripten_bind_btRigidBody_setRollingFriction_1=function(){return(Lk=b._emscripten_bind_btRigidBody_setRollingFriction_1=b.asm.Ii).apply(null,arguments)},Mk=b._emscripten_bind_btRigidBody_getWorldTransform_0=function(){return(Mk=b._emscripten_bind_btRigidBody_getWorldTransform_0= +b.asm.Ji).apply(null,arguments)},Nk=b._emscripten_bind_btRigidBody_getCollisionFlags_0=function(){return(Nk=b._emscripten_bind_btRigidBody_getCollisionFlags_0=b.asm.Ki).apply(null,arguments)},Ok=b._emscripten_bind_btRigidBody_setCollisionFlags_1=function(){return(Ok=b._emscripten_bind_btRigidBody_setCollisionFlags_1=b.asm.Li).apply(null,arguments)},Pk=b._emscripten_bind_btRigidBody_setWorldTransform_1=function(){return(Pk=b._emscripten_bind_btRigidBody_setWorldTransform_1=b.asm.Mi).apply(null,arguments)}, +Qk=b._emscripten_bind_btRigidBody_setCollisionShape_1=function(){return(Qk=b._emscripten_bind_btRigidBody_setCollisionShape_1=b.asm.Ni).apply(null,arguments)},Rk=b._emscripten_bind_btRigidBody_setCcdMotionThreshold_1=function(){return(Rk=b._emscripten_bind_btRigidBody_setCcdMotionThreshold_1=b.asm.Oi).apply(null,arguments)},Sk=b._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1=function(){return(Sk=b._emscripten_bind_btRigidBody_setCcdSweptSphereRadius_1=b.asm.Pi).apply(null,arguments)},Tk=b._emscripten_bind_btRigidBody_getUserIndex_0= +function(){return(Tk=b._emscripten_bind_btRigidBody_getUserIndex_0=b.asm.Qi).apply(null,arguments)},Uk=b._emscripten_bind_btRigidBody_setUserIndex_1=function(){return(Uk=b._emscripten_bind_btRigidBody_setUserIndex_1=b.asm.Ri).apply(null,arguments)},Vk=b._emscripten_bind_btRigidBody_getUserPointer_0=function(){return(Vk=b._emscripten_bind_btRigidBody_getUserPointer_0=b.asm.Si).apply(null,arguments)},Wk=b._emscripten_bind_btRigidBody_setUserPointer_1=function(){return(Wk=b._emscripten_bind_btRigidBody_setUserPointer_1= +b.asm.Ti).apply(null,arguments)},Xk=b._emscripten_bind_btRigidBody_getBroadphaseHandle_0=function(){return(Xk=b._emscripten_bind_btRigidBody_getBroadphaseHandle_0=b.asm.Ui).apply(null,arguments)},Yk=b._emscripten_bind_btRigidBody___destroy___0=function(){return(Yk=b._emscripten_bind_btRigidBody___destroy___0=b.asm.Vi).apply(null,arguments)},Zk=b._emscripten_bind_btIndexedMeshArray_size_0=function(){return(Zk=b._emscripten_bind_btIndexedMeshArray_size_0=b.asm.Wi).apply(null,arguments)},$k=b._emscripten_bind_btIndexedMeshArray_at_1= +function(){return($k=b._emscripten_bind_btIndexedMeshArray_at_1=b.asm.Xi).apply(null,arguments)},al=b._emscripten_bind_btIndexedMeshArray___destroy___0=function(){return(al=b._emscripten_bind_btIndexedMeshArray___destroy___0=b.asm.Yi).apply(null,arguments)},bl=b._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0=function(){return(bl=b._emscripten_bind_btDbvtBroadphase_btDbvtBroadphase_0=b.asm.Zi).apply(null,arguments)},cl=b._emscripten_bind_btDbvtBroadphase___destroy___0=function(){return(cl=b._emscripten_bind_btDbvtBroadphase___destroy___0= +b.asm._i).apply(null,arguments)},dl=b._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9=function(){return(dl=b._emscripten_bind_btHeightfieldTerrainShape_btHeightfieldTerrainShape_9=b.asm.$i).apply(null,arguments)},el=b._emscripten_bind_btHeightfieldTerrainShape_setMargin_1=function(){return(el=b._emscripten_bind_btHeightfieldTerrainShape_setMargin_1=b.asm.aj).apply(null,arguments)},fl=b._emscripten_bind_btHeightfieldTerrainShape_getMargin_0=function(){return(fl=b._emscripten_bind_btHeightfieldTerrainShape_getMargin_0= +b.asm.bj).apply(null,arguments)},gl=b._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1=function(){return(gl=b._emscripten_bind_btHeightfieldTerrainShape_setLocalScaling_1=b.asm.cj).apply(null,arguments)},hl=b._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0=function(){return(hl=b._emscripten_bind_btHeightfieldTerrainShape_getLocalScaling_0=b.asm.dj).apply(null,arguments)},il=b._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2=function(){return(il=b._emscripten_bind_btHeightfieldTerrainShape_calculateLocalInertia_2= +b.asm.ej).apply(null,arguments)},jl=b._emscripten_bind_btHeightfieldTerrainShape___destroy___0=function(){return(jl=b._emscripten_bind_btHeightfieldTerrainShape___destroy___0=b.asm.fj).apply(null,arguments)},kl=b._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0=function(){return(kl=b._emscripten_bind_btDefaultSoftBodySolver_btDefaultSoftBodySolver_0=b.asm.gj).apply(null,arguments)},ll=b._emscripten_bind_btDefaultSoftBodySolver___destroy___0=function(){return(ll=b._emscripten_bind_btDefaultSoftBodySolver___destroy___0= +b.asm.hj).apply(null,arguments)},ml=b._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1=function(){return(ml=b._emscripten_bind_btCollisionDispatcher_btCollisionDispatcher_1=b.asm.ij).apply(null,arguments)},nl=b._emscripten_bind_btCollisionDispatcher_getNumManifolds_0=function(){return(nl=b._emscripten_bind_btCollisionDispatcher_getNumManifolds_0=b.asm.jj).apply(null,arguments)},ol=b._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1=function(){return(ol=b._emscripten_bind_btCollisionDispatcher_getManifoldByIndexInternal_1= +b.asm.kj).apply(null,arguments)},pl=b._emscripten_bind_btCollisionDispatcher___destroy___0=function(){return(pl=b._emscripten_bind_btCollisionDispatcher___destroy___0=b.asm.lj).apply(null,arguments)},ql=b._emscripten_bind_btAxisSweep3_btAxisSweep3_2=function(){return(ql=b._emscripten_bind_btAxisSweep3_btAxisSweep3_2=b.asm.mj).apply(null,arguments)},rl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_3=function(){return(rl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_3=b.asm.nj).apply(null,arguments)}, +sl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_4=function(){return(sl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_4=b.asm.oj).apply(null,arguments)},tl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_5=function(){return(tl=b._emscripten_bind_btAxisSweep3_btAxisSweep3_5=b.asm.pj).apply(null,arguments)},ul=b._emscripten_bind_btAxisSweep3___destroy___0=function(){return(ul=b._emscripten_bind_btAxisSweep3___destroy___0=b.asm.qj).apply(null,arguments)},vl=b._emscripten_bind_VoidPtr___destroy___0=function(){return(vl= +b._emscripten_bind_VoidPtr___destroy___0=b.asm.rj).apply(null,arguments)},wl=b._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0=function(){return(wl=b._emscripten_bind_btSoftBodyWorldInfo_btSoftBodyWorldInfo_0=b.asm.sj).apply(null,arguments)},xl=b._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0=function(){return(xl=b._emscripten_bind_btSoftBodyWorldInfo_get_air_density_0=b.asm.tj).apply(null,arguments)},yl=b._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1=function(){return(yl= +b._emscripten_bind_btSoftBodyWorldInfo_set_air_density_1=b.asm.uj).apply(null,arguments)},zl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0=function(){return(zl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_density_0=b.asm.vj).apply(null,arguments)},Al=b._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1=function(){return(Al=b._emscripten_bind_btSoftBodyWorldInfo_set_water_density_1=b.asm.wj).apply(null,arguments)},Bl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0= +function(){return(Bl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_offset_0=b.asm.xj).apply(null,arguments)},Cl=b._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1=function(){return(Cl=b._emscripten_bind_btSoftBodyWorldInfo_set_water_offset_1=b.asm.yj).apply(null,arguments)},Dl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0=function(){return(Dl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_maxDisplacement_0=b.asm.zj).apply(null,arguments)},El=b._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1= +function(){return(El=b._emscripten_bind_btSoftBodyWorldInfo_set_m_maxDisplacement_1=b.asm.Aj).apply(null,arguments)},Fl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0=function(){return(Fl=b._emscripten_bind_btSoftBodyWorldInfo_get_water_normal_0=b.asm.Bj).apply(null,arguments)},Gl=b._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1=function(){return(Gl=b._emscripten_bind_btSoftBodyWorldInfo_set_water_normal_1=b.asm.Cj).apply(null,arguments)},Hl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0= +function(){return(Hl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_broadphase_0=b.asm.Dj).apply(null,arguments)},Il=b._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1=function(){return(Il=b._emscripten_bind_btSoftBodyWorldInfo_set_m_broadphase_1=b.asm.Ej).apply(null,arguments)},Jl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0=function(){return(Jl=b._emscripten_bind_btSoftBodyWorldInfo_get_m_dispatcher_0=b.asm.Fj).apply(null,arguments)},Kl=b._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1= +function(){return(Kl=b._emscripten_bind_btSoftBodyWorldInfo_set_m_dispatcher_1=b.asm.Gj).apply(null,arguments)},Ll=b._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0=function(){return(Ll=b._emscripten_bind_btSoftBodyWorldInfo_get_m_gravity_0=b.asm.Hj).apply(null,arguments)},Ml=b._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1=function(){return(Ml=b._emscripten_bind_btSoftBodyWorldInfo_set_m_gravity_1=b.asm.Ij).apply(null,arguments)},Nl=b._emscripten_bind_btSoftBodyWorldInfo___destroy___0= +function(){return(Nl=b._emscripten_bind_btSoftBodyWorldInfo___destroy___0=b.asm.Jj).apply(null,arguments)},Ol=b._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2=function(){return(Ol=b._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_2=b.asm.Kj).apply(null,arguments)},Pl=b._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4=function(){return(Pl=b._emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_4=b.asm.Lj).apply(null,arguments)},Ql=b._emscripten_bind_btConeTwistConstraint_setLimit_2= +function(){return(Ql=b._emscripten_bind_btConeTwistConstraint_setLimit_2=b.asm.Mj).apply(null,arguments)},Rl=b._emscripten_bind_btConeTwistConstraint_setAngularOnly_1=function(){return(Rl=b._emscripten_bind_btConeTwistConstraint_setAngularOnly_1=b.asm.Nj).apply(null,arguments)},Sl=b._emscripten_bind_btConeTwistConstraint_setDamping_1=function(){return(Sl=b._emscripten_bind_btConeTwistConstraint_setDamping_1=b.asm.Oj).apply(null,arguments)},Tl=b._emscripten_bind_btConeTwistConstraint_enableMotor_1= +function(){return(Tl=b._emscripten_bind_btConeTwistConstraint_enableMotor_1=b.asm.Pj).apply(null,arguments)},Ul=b._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1=function(){return(Ul=b._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulse_1=b.asm.Qj).apply(null,arguments)},Vl=b._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1=function(){return(Vl=b._emscripten_bind_btConeTwistConstraint_setMaxMotorImpulseNormalized_1=b.asm.Rj).apply(null,arguments)},Wl=b._emscripten_bind_btConeTwistConstraint_setMotorTarget_1= +function(){return(Wl=b._emscripten_bind_btConeTwistConstraint_setMotorTarget_1=b.asm.Sj).apply(null,arguments)},Xl=b._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1=function(){return(Xl=b._emscripten_bind_btConeTwistConstraint_setMotorTargetInConstraintSpace_1=b.asm.Tj).apply(null,arguments)},Yl=b._emscripten_bind_btConeTwistConstraint_enableFeedback_1=function(){return(Yl=b._emscripten_bind_btConeTwistConstraint_enableFeedback_1=b.asm.Uj).apply(null,arguments)},Zl=b._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0= +function(){return(Zl=b._emscripten_bind_btConeTwistConstraint_getBreakingImpulseThreshold_0=b.asm.Vj).apply(null,arguments)},$l=b._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1=function(){return($l=b._emscripten_bind_btConeTwistConstraint_setBreakingImpulseThreshold_1=b.asm.Wj).apply(null,arguments)},am=b._emscripten_bind_btConeTwistConstraint_getParam_2=function(){return(am=b._emscripten_bind_btConeTwistConstraint_getParam_2=b.asm.Xj).apply(null,arguments)},bm=b._emscripten_bind_btConeTwistConstraint_setParam_3= +function(){return(bm=b._emscripten_bind_btConeTwistConstraint_setParam_3=b.asm.Yj).apply(null,arguments)},cm=b._emscripten_bind_btConeTwistConstraint___destroy___0=function(){return(cm=b._emscripten_bind_btConeTwistConstraint___destroy___0=b.asm.Zj).apply(null,arguments)},dm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_2=function(){return(dm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_2=b.asm._j).apply(null,arguments)},em=b._emscripten_bind_btHingeConstraint_btHingeConstraint_3= +function(){return(em=b._emscripten_bind_btHingeConstraint_btHingeConstraint_3=b.asm.$j).apply(null,arguments)},fm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_4=function(){return(fm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_4=b.asm.ak).apply(null,arguments)},gm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_5=function(){return(gm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_5=b.asm.bk).apply(null,arguments)},hm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_6= +function(){return(hm=b._emscripten_bind_btHingeConstraint_btHingeConstraint_6=b.asm.ck).apply(null,arguments)},im=b._emscripten_bind_btHingeConstraint_btHingeConstraint_7=function(){return(im=b._emscripten_bind_btHingeConstraint_btHingeConstraint_7=b.asm.dk).apply(null,arguments)},jm=b._emscripten_bind_btHingeConstraint_setLimit_4=function(){return(jm=b._emscripten_bind_btHingeConstraint_setLimit_4=b.asm.ek).apply(null,arguments)},km=b._emscripten_bind_btHingeConstraint_setLimit_5=function(){return(km= +b._emscripten_bind_btHingeConstraint_setLimit_5=b.asm.fk).apply(null,arguments)},lm=b._emscripten_bind_btHingeConstraint_enableAngularMotor_3=function(){return(lm=b._emscripten_bind_btHingeConstraint_enableAngularMotor_3=b.asm.gk).apply(null,arguments)},mm=b._emscripten_bind_btHingeConstraint_setAngularOnly_1=function(){return(mm=b._emscripten_bind_btHingeConstraint_setAngularOnly_1=b.asm.hk).apply(null,arguments)},nm=b._emscripten_bind_btHingeConstraint_enableMotor_1=function(){return(nm=b._emscripten_bind_btHingeConstraint_enableMotor_1= +b.asm.ik).apply(null,arguments)},om=b._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1=function(){return(om=b._emscripten_bind_btHingeConstraint_setMaxMotorImpulse_1=b.asm.jk).apply(null,arguments)},pm=b._emscripten_bind_btHingeConstraint_setMotorTarget_2=function(){return(pm=b._emscripten_bind_btHingeConstraint_setMotorTarget_2=b.asm.kk).apply(null,arguments)},qm=b._emscripten_bind_btHingeConstraint_enableFeedback_1=function(){return(qm=b._emscripten_bind_btHingeConstraint_enableFeedback_1= +b.asm.lk).apply(null,arguments)},rm=b._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0=function(){return(rm=b._emscripten_bind_btHingeConstraint_getBreakingImpulseThreshold_0=b.asm.mk).apply(null,arguments)},sm=b._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1=function(){return(sm=b._emscripten_bind_btHingeConstraint_setBreakingImpulseThreshold_1=b.asm.nk).apply(null,arguments)},tm=b._emscripten_bind_btHingeConstraint_getParam_2=function(){return(tm=b._emscripten_bind_btHingeConstraint_getParam_2= +b.asm.ok).apply(null,arguments)},um=b._emscripten_bind_btHingeConstraint_setParam_3=function(){return(um=b._emscripten_bind_btHingeConstraint_setParam_3=b.asm.pk).apply(null,arguments)},wm=b._emscripten_bind_btHingeConstraint___destroy___0=function(){return(wm=b._emscripten_bind_btHingeConstraint___destroy___0=b.asm.qk).apply(null,arguments)},xm=b._emscripten_bind_btConeShapeZ_btConeShapeZ_2=function(){return(xm=b._emscripten_bind_btConeShapeZ_btConeShapeZ_2=b.asm.rk).apply(null,arguments)},ym=b._emscripten_bind_btConeShapeZ_setLocalScaling_1= +function(){return(ym=b._emscripten_bind_btConeShapeZ_setLocalScaling_1=b.asm.sk).apply(null,arguments)},zm=b._emscripten_bind_btConeShapeZ_getLocalScaling_0=function(){return(zm=b._emscripten_bind_btConeShapeZ_getLocalScaling_0=b.asm.tk).apply(null,arguments)},Am=b._emscripten_bind_btConeShapeZ_calculateLocalInertia_2=function(){return(Am=b._emscripten_bind_btConeShapeZ_calculateLocalInertia_2=b.asm.uk).apply(null,arguments)},Bm=b._emscripten_bind_btConeShapeZ___destroy___0=function(){return(Bm=b._emscripten_bind_btConeShapeZ___destroy___0= +b.asm.vk).apply(null,arguments)},Cm=b._emscripten_bind_btConeShapeX_btConeShapeX_2=function(){return(Cm=b._emscripten_bind_btConeShapeX_btConeShapeX_2=b.asm.wk).apply(null,arguments)},Dm=b._emscripten_bind_btConeShapeX_setLocalScaling_1=function(){return(Dm=b._emscripten_bind_btConeShapeX_setLocalScaling_1=b.asm.xk).apply(null,arguments)},Em=b._emscripten_bind_btConeShapeX_getLocalScaling_0=function(){return(Em=b._emscripten_bind_btConeShapeX_getLocalScaling_0=b.asm.yk).apply(null,arguments)},Fm= +b._emscripten_bind_btConeShapeX_calculateLocalInertia_2=function(){return(Fm=b._emscripten_bind_btConeShapeX_calculateLocalInertia_2=b.asm.zk).apply(null,arguments)},Gm=b._emscripten_bind_btConeShapeX___destroy___0=function(){return(Gm=b._emscripten_bind_btConeShapeX___destroy___0=b.asm.Ak).apply(null,arguments)},Hm=b._emscripten_bind_btTriangleMesh_btTriangleMesh_0=function(){return(Hm=b._emscripten_bind_btTriangleMesh_btTriangleMesh_0=b.asm.Bk).apply(null,arguments)},Im=b._emscripten_bind_btTriangleMesh_btTriangleMesh_1= +function(){return(Im=b._emscripten_bind_btTriangleMesh_btTriangleMesh_1=b.asm.Ck).apply(null,arguments)},Jm=b._emscripten_bind_btTriangleMesh_btTriangleMesh_2=function(){return(Jm=b._emscripten_bind_btTriangleMesh_btTriangleMesh_2=b.asm.Dk).apply(null,arguments)},Km=b._emscripten_bind_btTriangleMesh_addTriangle_3=function(){return(Km=b._emscripten_bind_btTriangleMesh_addTriangle_3=b.asm.Ek).apply(null,arguments)},Lm=b._emscripten_bind_btTriangleMesh_addTriangle_4=function(){return(Lm=b._emscripten_bind_btTriangleMesh_addTriangle_4= +b.asm.Fk).apply(null,arguments)},Mm=b._emscripten_bind_btTriangleMesh_findOrAddVertex_2=function(){return(Mm=b._emscripten_bind_btTriangleMesh_findOrAddVertex_2=b.asm.Gk).apply(null,arguments)},Nm=b._emscripten_bind_btTriangleMesh_addIndex_1=function(){return(Nm=b._emscripten_bind_btTriangleMesh_addIndex_1=b.asm.Hk).apply(null,arguments)},Om=b._emscripten_bind_btTriangleMesh_getIndexedMeshArray_0=function(){return(Om=b._emscripten_bind_btTriangleMesh_getIndexedMeshArray_0=b.asm.Ik).apply(null,arguments)}, +Pm=b._emscripten_bind_btTriangleMesh_setScaling_1=function(){return(Pm=b._emscripten_bind_btTriangleMesh_setScaling_1=b.asm.Jk).apply(null,arguments)},Qm=b._emscripten_bind_btTriangleMesh___destroy___0=function(){return(Qm=b._emscripten_bind_btTriangleMesh___destroy___0=b.asm.Kk).apply(null,arguments)},Rm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_0=function(){return(Rm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_0=b.asm.Lk).apply(null,arguments)},Sm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_1= +function(){return(Sm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_1=b.asm.Mk).apply(null,arguments)},Tm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_2=function(){return(Tm=b._emscripten_bind_btConvexHullShape_btConvexHullShape_2=b.asm.Nk).apply(null,arguments)},Um=b._emscripten_bind_btConvexHullShape_addPoint_1=function(){return(Um=b._emscripten_bind_btConvexHullShape_addPoint_1=b.asm.Ok).apply(null,arguments)},Vm=b._emscripten_bind_btConvexHullShape_addPoint_2=function(){return(Vm= +b._emscripten_bind_btConvexHullShape_addPoint_2=b.asm.Pk).apply(null,arguments)},Wm=b._emscripten_bind_btConvexHullShape_setMargin_1=function(){return(Wm=b._emscripten_bind_btConvexHullShape_setMargin_1=b.asm.Qk).apply(null,arguments)},Xm=b._emscripten_bind_btConvexHullShape_getMargin_0=function(){return(Xm=b._emscripten_bind_btConvexHullShape_getMargin_0=b.asm.Rk).apply(null,arguments)},Ym=b._emscripten_bind_btConvexHullShape_getNumVertices_0=function(){return(Ym=b._emscripten_bind_btConvexHullShape_getNumVertices_0= +b.asm.Sk).apply(null,arguments)},Zm=b._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1=function(){return(Zm=b._emscripten_bind_btConvexHullShape_initializePolyhedralFeatures_1=b.asm.Tk).apply(null,arguments)},$m=b._emscripten_bind_btConvexHullShape_recalcLocalAabb_0=function(){return($m=b._emscripten_bind_btConvexHullShape_recalcLocalAabb_0=b.asm.Uk).apply(null,arguments)},an=b._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0=function(){return(an=b._emscripten_bind_btConvexHullShape_getConvexPolyhedron_0= +b.asm.Vk).apply(null,arguments)},bn=b._emscripten_bind_btConvexHullShape_setLocalScaling_1=function(){return(bn=b._emscripten_bind_btConvexHullShape_setLocalScaling_1=b.asm.Wk).apply(null,arguments)},cn=b._emscripten_bind_btConvexHullShape_getLocalScaling_0=function(){return(cn=b._emscripten_bind_btConvexHullShape_getLocalScaling_0=b.asm.Xk).apply(null,arguments)},dn=b._emscripten_bind_btConvexHullShape_calculateLocalInertia_2=function(){return(dn=b._emscripten_bind_btConvexHullShape_calculateLocalInertia_2= +b.asm.Yk).apply(null,arguments)},en=b._emscripten_bind_btConvexHullShape___destroy___0=function(){return(en=b._emscripten_bind_btConvexHullShape___destroy___0=b.asm.Zk).apply(null,arguments)},fn=b._emscripten_bind_btVehicleTuning_btVehicleTuning_0=function(){return(fn=b._emscripten_bind_btVehicleTuning_btVehicleTuning_0=b.asm._k).apply(null,arguments)},gn=b._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0=function(){return(gn=b._emscripten_bind_btVehicleTuning_get_m_suspensionStiffness_0= +b.asm.$k).apply(null,arguments)},hn=b._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1=function(){return(hn=b._emscripten_bind_btVehicleTuning_set_m_suspensionStiffness_1=b.asm.al).apply(null,arguments)},jn=b._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0=function(){return(jn=b._emscripten_bind_btVehicleTuning_get_m_suspensionCompression_0=b.asm.bl).apply(null,arguments)},kn=b._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1=function(){return(kn=b._emscripten_bind_btVehicleTuning_set_m_suspensionCompression_1= +b.asm.cl).apply(null,arguments)},ln=b._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0=function(){return(ln=b._emscripten_bind_btVehicleTuning_get_m_suspensionDamping_0=b.asm.dl).apply(null,arguments)},mn=b._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1=function(){return(mn=b._emscripten_bind_btVehicleTuning_set_m_suspensionDamping_1=b.asm.el).apply(null,arguments)},nn=b._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0=function(){return(nn=b._emscripten_bind_btVehicleTuning_get_m_maxSuspensionTravelCm_0= +b.asm.fl).apply(null,arguments)},on=b._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1=function(){return(on=b._emscripten_bind_btVehicleTuning_set_m_maxSuspensionTravelCm_1=b.asm.gl).apply(null,arguments)},pn=b._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0=function(){return(pn=b._emscripten_bind_btVehicleTuning_get_m_frictionSlip_0=b.asm.hl).apply(null,arguments)},qn=b._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1=function(){return(qn=b._emscripten_bind_btVehicleTuning_set_m_frictionSlip_1= +b.asm.il).apply(null,arguments)},rn=b._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0=function(){return(rn=b._emscripten_bind_btVehicleTuning_get_m_maxSuspensionForce_0=b.asm.jl).apply(null,arguments)},sn=b._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1=function(){return(sn=b._emscripten_bind_btVehicleTuning_set_m_maxSuspensionForce_1=b.asm.kl).apply(null,arguments)},tn=b._emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0=function(){return(tn=b._emscripten_bind_btCollisionObjectWrapper_getWorldTransform_0= +b.asm.ll).apply(null,arguments)},un=b._emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0=function(){return(un=b._emscripten_bind_btCollisionObjectWrapper_getCollisionObject_0=b.asm.ml).apply(null,arguments)},vn=b._emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0=function(){return(vn=b._emscripten_bind_btCollisionObjectWrapper_getCollisionShape_0=b.asm.nl).apply(null,arguments)},wn=b._emscripten_bind_btShapeHull_btShapeHull_1=function(){return(wn=b._emscripten_bind_btShapeHull_btShapeHull_1= +b.asm.ol).apply(null,arguments)},xn=b._emscripten_bind_btShapeHull_buildHull_1=function(){return(xn=b._emscripten_bind_btShapeHull_buildHull_1=b.asm.pl).apply(null,arguments)},yn=b._emscripten_bind_btShapeHull_numVertices_0=function(){return(yn=b._emscripten_bind_btShapeHull_numVertices_0=b.asm.ql).apply(null,arguments)},zn=b._emscripten_bind_btShapeHull_getVertexPointer_0=function(){return(zn=b._emscripten_bind_btShapeHull_getVertexPointer_0=b.asm.rl).apply(null,arguments)},An=b._emscripten_bind_btShapeHull___destroy___0= +function(){return(An=b._emscripten_bind_btShapeHull___destroy___0=b.asm.sl).apply(null,arguments)},Bn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0=function(){return(Bn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_0=b.asm.tl).apply(null,arguments)},Cn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1=function(){return(Cn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_1=b.asm.ul).apply(null,arguments)},Dn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2= +function(){return(Dn=b._emscripten_bind_btDefaultMotionState_btDefaultMotionState_2=b.asm.vl).apply(null,arguments)},En=b._emscripten_bind_btDefaultMotionState_getWorldTransform_1=function(){return(En=b._emscripten_bind_btDefaultMotionState_getWorldTransform_1=b.asm.wl).apply(null,arguments)},Fn=b._emscripten_bind_btDefaultMotionState_setWorldTransform_1=function(){return(Fn=b._emscripten_bind_btDefaultMotionState_setWorldTransform_1=b.asm.xl).apply(null,arguments)},Gn=b._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0= +function(){return(Gn=b._emscripten_bind_btDefaultMotionState_get_m_graphicsWorldTrans_0=b.asm.yl).apply(null,arguments)},Hn=b._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1=function(){return(Hn=b._emscripten_bind_btDefaultMotionState_set_m_graphicsWorldTrans_1=b.asm.zl).apply(null,arguments)},In=b._emscripten_bind_btDefaultMotionState___destroy___0=function(){return(In=b._emscripten_bind_btDefaultMotionState___destroy___0=b.asm.Al).apply(null,arguments)},Jn=b._emscripten_bind_btWheelInfo_btWheelInfo_1= +function(){return(Jn=b._emscripten_bind_btWheelInfo_btWheelInfo_1=b.asm.Bl).apply(null,arguments)},Kn=b._emscripten_bind_btWheelInfo_getSuspensionRestLength_0=function(){return(Kn=b._emscripten_bind_btWheelInfo_getSuspensionRestLength_0=b.asm.Cl).apply(null,arguments)},Ln=b._emscripten_bind_btWheelInfo_updateWheel_2=function(){return(Ln=b._emscripten_bind_btWheelInfo_updateWheel_2=b.asm.Dl).apply(null,arguments)},Mn=b._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0=function(){return(Mn=b._emscripten_bind_btWheelInfo_get_m_suspensionStiffness_0= +b.asm.El).apply(null,arguments)},Nn=b._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1=function(){return(Nn=b._emscripten_bind_btWheelInfo_set_m_suspensionStiffness_1=b.asm.Fl).apply(null,arguments)},On=b._emscripten_bind_btWheelInfo_get_m_frictionSlip_0=function(){return(On=b._emscripten_bind_btWheelInfo_get_m_frictionSlip_0=b.asm.Gl).apply(null,arguments)},Pn=b._emscripten_bind_btWheelInfo_set_m_frictionSlip_1=function(){return(Pn=b._emscripten_bind_btWheelInfo_set_m_frictionSlip_1=b.asm.Hl).apply(null, +arguments)},Qn=b._emscripten_bind_btWheelInfo_get_m_engineForce_0=function(){return(Qn=b._emscripten_bind_btWheelInfo_get_m_engineForce_0=b.asm.Il).apply(null,arguments)},Rn=b._emscripten_bind_btWheelInfo_set_m_engineForce_1=function(){return(Rn=b._emscripten_bind_btWheelInfo_set_m_engineForce_1=b.asm.Jl).apply(null,arguments)},Sn=b._emscripten_bind_btWheelInfo_get_m_rollInfluence_0=function(){return(Sn=b._emscripten_bind_btWheelInfo_get_m_rollInfluence_0=b.asm.Kl).apply(null,arguments)},Tn=b._emscripten_bind_btWheelInfo_set_m_rollInfluence_1= +function(){return(Tn=b._emscripten_bind_btWheelInfo_set_m_rollInfluence_1=b.asm.Ll).apply(null,arguments)},Un=b._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0=function(){return(Un=b._emscripten_bind_btWheelInfo_get_m_suspensionRestLength1_0=b.asm.Ml).apply(null,arguments)},Vn=b._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1=function(){return(Vn=b._emscripten_bind_btWheelInfo_set_m_suspensionRestLength1_1=b.asm.Nl).apply(null,arguments)},Wn=b._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0= +function(){return(Wn=b._emscripten_bind_btWheelInfo_get_m_wheelsRadius_0=b.asm.Ol).apply(null,arguments)},Xn=b._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1=function(){return(Xn=b._emscripten_bind_btWheelInfo_set_m_wheelsRadius_1=b.asm.Pl).apply(null,arguments)},Yn=b._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0=function(){return(Yn=b._emscripten_bind_btWheelInfo_get_m_wheelsDampingCompression_0=b.asm.Ql).apply(null,arguments)},Zn=b._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1= +function(){return(Zn=b._emscripten_bind_btWheelInfo_set_m_wheelsDampingCompression_1=b.asm.Rl).apply(null,arguments)},$n=b._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0=function(){return($n=b._emscripten_bind_btWheelInfo_get_m_wheelsDampingRelaxation_0=b.asm.Sl).apply(null,arguments)},ao=b._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1=function(){return(ao=b._emscripten_bind_btWheelInfo_set_m_wheelsDampingRelaxation_1=b.asm.Tl).apply(null,arguments)},bo=b._emscripten_bind_btWheelInfo_get_m_steering_0= +function(){return(bo=b._emscripten_bind_btWheelInfo_get_m_steering_0=b.asm.Ul).apply(null,arguments)},co=b._emscripten_bind_btWheelInfo_set_m_steering_1=function(){return(co=b._emscripten_bind_btWheelInfo_set_m_steering_1=b.asm.Vl).apply(null,arguments)},eo=b._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0=function(){return(eo=b._emscripten_bind_btWheelInfo_get_m_maxSuspensionForce_0=b.asm.Wl).apply(null,arguments)},fo=b._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1=function(){return(fo= +b._emscripten_bind_btWheelInfo_set_m_maxSuspensionForce_1=b.asm.Xl).apply(null,arguments)},go=b._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0=function(){return(go=b._emscripten_bind_btWheelInfo_get_m_maxSuspensionTravelCm_0=b.asm.Yl).apply(null,arguments)},ho=b._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1=function(){return(ho=b._emscripten_bind_btWheelInfo_set_m_maxSuspensionTravelCm_1=b.asm.Zl).apply(null,arguments)},io=b._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0= +function(){return(io=b._emscripten_bind_btWheelInfo_get_m_wheelsSuspensionForce_0=b.asm._l).apply(null,arguments)},jo=b._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1=function(){return(jo=b._emscripten_bind_btWheelInfo_set_m_wheelsSuspensionForce_1=b.asm.$l).apply(null,arguments)},ko=b._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0=function(){return(ko=b._emscripten_bind_btWheelInfo_get_m_bIsFrontWheel_0=b.asm.am).apply(null,arguments)},lo=b._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1= +function(){return(lo=b._emscripten_bind_btWheelInfo_set_m_bIsFrontWheel_1=b.asm.bm).apply(null,arguments)},mo=b._emscripten_bind_btWheelInfo_get_m_raycastInfo_0=function(){return(mo=b._emscripten_bind_btWheelInfo_get_m_raycastInfo_0=b.asm.cm).apply(null,arguments)},no=b._emscripten_bind_btWheelInfo_set_m_raycastInfo_1=function(){return(no=b._emscripten_bind_btWheelInfo_set_m_raycastInfo_1=b.asm.dm).apply(null,arguments)},oo=b._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0=function(){return(oo= +b._emscripten_bind_btWheelInfo_get_m_chassisConnectionPointCS_0=b.asm.em).apply(null,arguments)},po=b._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1=function(){return(po=b._emscripten_bind_btWheelInfo_set_m_chassisConnectionPointCS_1=b.asm.fm).apply(null,arguments)},qo=b._emscripten_bind_btWheelInfo_get_m_worldTransform_0=function(){return(qo=b._emscripten_bind_btWheelInfo_get_m_worldTransform_0=b.asm.gm).apply(null,arguments)},ro=b._emscripten_bind_btWheelInfo_set_m_worldTransform_1= +function(){return(ro=b._emscripten_bind_btWheelInfo_set_m_worldTransform_1=b.asm.hm).apply(null,arguments)},so=b._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0=function(){return(so=b._emscripten_bind_btWheelInfo_get_m_wheelDirectionCS_0=b.asm.im).apply(null,arguments)},to=b._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1=function(){return(to=b._emscripten_bind_btWheelInfo_set_m_wheelDirectionCS_1=b.asm.jm).apply(null,arguments)},uo=b._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0=function(){return(uo= +b._emscripten_bind_btWheelInfo_get_m_wheelAxleCS_0=b.asm.km).apply(null,arguments)},vo=b._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1=function(){return(vo=b._emscripten_bind_btWheelInfo_set_m_wheelAxleCS_1=b.asm.lm).apply(null,arguments)},wo=b._emscripten_bind_btWheelInfo_get_m_rotation_0=function(){return(wo=b._emscripten_bind_btWheelInfo_get_m_rotation_0=b.asm.mm).apply(null,arguments)},xo=b._emscripten_bind_btWheelInfo_set_m_rotation_1=function(){return(xo=b._emscripten_bind_btWheelInfo_set_m_rotation_1= +b.asm.nm).apply(null,arguments)},yo=b._emscripten_bind_btWheelInfo_get_m_deltaRotation_0=function(){return(yo=b._emscripten_bind_btWheelInfo_get_m_deltaRotation_0=b.asm.om).apply(null,arguments)},zo=b._emscripten_bind_btWheelInfo_set_m_deltaRotation_1=function(){return(zo=b._emscripten_bind_btWheelInfo_set_m_deltaRotation_1=b.asm.pm).apply(null,arguments)},Ao=b._emscripten_bind_btWheelInfo_get_m_brake_0=function(){return(Ao=b._emscripten_bind_btWheelInfo_get_m_brake_0=b.asm.qm).apply(null,arguments)}, +Bo=b._emscripten_bind_btWheelInfo_set_m_brake_1=function(){return(Bo=b._emscripten_bind_btWheelInfo_set_m_brake_1=b.asm.rm).apply(null,arguments)},Co=b._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0=function(){return(Co=b._emscripten_bind_btWheelInfo_get_m_clippedInvContactDotSuspension_0=b.asm.sm).apply(null,arguments)},Do=b._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1=function(){return(Do=b._emscripten_bind_btWheelInfo_set_m_clippedInvContactDotSuspension_1= +b.asm.tm).apply(null,arguments)},Eo=b._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0=function(){return(Eo=b._emscripten_bind_btWheelInfo_get_m_suspensionRelativeVelocity_0=b.asm.um).apply(null,arguments)},Fo=b._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1=function(){return(Fo=b._emscripten_bind_btWheelInfo_set_m_suspensionRelativeVelocity_1=b.asm.vm).apply(null,arguments)},Go=b._emscripten_bind_btWheelInfo_get_m_skidInfo_0=function(){return(Go=b._emscripten_bind_btWheelInfo_get_m_skidInfo_0= +b.asm.wm).apply(null,arguments)},Ho=b._emscripten_bind_btWheelInfo_set_m_skidInfo_1=function(){return(Ho=b._emscripten_bind_btWheelInfo_set_m_skidInfo_1=b.asm.xm).apply(null,arguments)},Io=b._emscripten_bind_btWheelInfo___destroy___0=function(){return(Io=b._emscripten_bind_btWheelInfo___destroy___0=b.asm.ym).apply(null,arguments)},Jo=b._emscripten_bind_btVector4_btVector4_0=function(){return(Jo=b._emscripten_bind_btVector4_btVector4_0=b.asm.zm).apply(null,arguments)},Ko=b._emscripten_bind_btVector4_btVector4_4= +function(){return(Ko=b._emscripten_bind_btVector4_btVector4_4=b.asm.Am).apply(null,arguments)},Lo=b._emscripten_bind_btVector4_w_0=function(){return(Lo=b._emscripten_bind_btVector4_w_0=b.asm.Bm).apply(null,arguments)},Mo=b._emscripten_bind_btVector4_setValue_4=function(){return(Mo=b._emscripten_bind_btVector4_setValue_4=b.asm.Cm).apply(null,arguments)},No=b._emscripten_bind_btVector4_length_0=function(){return(No=b._emscripten_bind_btVector4_length_0=b.asm.Dm).apply(null,arguments)},Oo=b._emscripten_bind_btVector4_x_0= +function(){return(Oo=b._emscripten_bind_btVector4_x_0=b.asm.Em).apply(null,arguments)},Po=b._emscripten_bind_btVector4_y_0=function(){return(Po=b._emscripten_bind_btVector4_y_0=b.asm.Fm).apply(null,arguments)},Qo=b._emscripten_bind_btVector4_z_0=function(){return(Qo=b._emscripten_bind_btVector4_z_0=b.asm.Gm).apply(null,arguments)},Ro=b._emscripten_bind_btVector4_setX_1=function(){return(Ro=b._emscripten_bind_btVector4_setX_1=b.asm.Hm).apply(null,arguments)},So=b._emscripten_bind_btVector4_setY_1= +function(){return(So=b._emscripten_bind_btVector4_setY_1=b.asm.Im).apply(null,arguments)},To=b._emscripten_bind_btVector4_setZ_1=function(){return(To=b._emscripten_bind_btVector4_setZ_1=b.asm.Jm).apply(null,arguments)},Uo=b._emscripten_bind_btVector4_normalize_0=function(){return(Uo=b._emscripten_bind_btVector4_normalize_0=b.asm.Km).apply(null,arguments)},Vo=b._emscripten_bind_btVector4_rotate_2=function(){return(Vo=b._emscripten_bind_btVector4_rotate_2=b.asm.Lm).apply(null,arguments)},Wo=b._emscripten_bind_btVector4_dot_1= +function(){return(Wo=b._emscripten_bind_btVector4_dot_1=b.asm.Mm).apply(null,arguments)},Xo=b._emscripten_bind_btVector4_op_mul_1=function(){return(Xo=b._emscripten_bind_btVector4_op_mul_1=b.asm.Nm).apply(null,arguments)},Yo=b._emscripten_bind_btVector4_op_add_1=function(){return(Yo=b._emscripten_bind_btVector4_op_add_1=b.asm.Om).apply(null,arguments)},Zo=b._emscripten_bind_btVector4_op_sub_1=function(){return(Zo=b._emscripten_bind_btVector4_op_sub_1=b.asm.Pm).apply(null,arguments)},$o=b._emscripten_bind_btVector4___destroy___0= +function(){return($o=b._emscripten_bind_btVector4___destroy___0=b.asm.Qm).apply(null,arguments)},ap=b._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0=function(){return(ap=b._emscripten_bind_btDefaultCollisionConstructionInfo_btDefaultCollisionConstructionInfo_0=b.asm.Rm).apply(null,arguments)},bp=b._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0=function(){return(bp=b._emscripten_bind_btDefaultCollisionConstructionInfo___destroy___0=b.asm.Sm).apply(null, +arguments)},cp=b._emscripten_bind_Anchor_get_m_node_0=function(){return(cp=b._emscripten_bind_Anchor_get_m_node_0=b.asm.Tm).apply(null,arguments)},dp=b._emscripten_bind_Anchor_set_m_node_1=function(){return(dp=b._emscripten_bind_Anchor_set_m_node_1=b.asm.Um).apply(null,arguments)},ep=b._emscripten_bind_Anchor_get_m_local_0=function(){return(ep=b._emscripten_bind_Anchor_get_m_local_0=b.asm.Vm).apply(null,arguments)},fp=b._emscripten_bind_Anchor_set_m_local_1=function(){return(fp=b._emscripten_bind_Anchor_set_m_local_1= +b.asm.Wm).apply(null,arguments)},gp=b._emscripten_bind_Anchor_get_m_body_0=function(){return(gp=b._emscripten_bind_Anchor_get_m_body_0=b.asm.Xm).apply(null,arguments)},hp=b._emscripten_bind_Anchor_set_m_body_1=function(){return(hp=b._emscripten_bind_Anchor_set_m_body_1=b.asm.Ym).apply(null,arguments)},ip=b._emscripten_bind_Anchor_get_m_influence_0=function(){return(ip=b._emscripten_bind_Anchor_get_m_influence_0=b.asm.Zm).apply(null,arguments)},jp=b._emscripten_bind_Anchor_set_m_influence_1=function(){return(jp= +b._emscripten_bind_Anchor_set_m_influence_1=b.asm._m).apply(null,arguments)},kp=b._emscripten_bind_Anchor_get_m_c0_0=function(){return(kp=b._emscripten_bind_Anchor_get_m_c0_0=b.asm.$m).apply(null,arguments)},lp=b._emscripten_bind_Anchor_set_m_c0_1=function(){return(lp=b._emscripten_bind_Anchor_set_m_c0_1=b.asm.an).apply(null,arguments)},mp=b._emscripten_bind_Anchor_get_m_c1_0=function(){return(mp=b._emscripten_bind_Anchor_get_m_c1_0=b.asm.bn).apply(null,arguments)},np=b._emscripten_bind_Anchor_set_m_c1_1= +function(){return(np=b._emscripten_bind_Anchor_set_m_c1_1=b.asm.cn).apply(null,arguments)},op=b._emscripten_bind_Anchor_get_m_c2_0=function(){return(op=b._emscripten_bind_Anchor_get_m_c2_0=b.asm.dn).apply(null,arguments)},pp=b._emscripten_bind_Anchor_set_m_c2_1=function(){return(pp=b._emscripten_bind_Anchor_set_m_c2_1=b.asm.en).apply(null,arguments)},qp=b._emscripten_bind_Anchor___destroy___0=function(){return(qp=b._emscripten_bind_Anchor___destroy___0=b.asm.fn).apply(null,arguments)},rp=b._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0= +function(){return(rp=b._emscripten_bind_btVehicleRaycasterResult_get_m_hitPointInWorld_0=b.asm.gn).apply(null,arguments)},sp=b._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1=function(){return(sp=b._emscripten_bind_btVehicleRaycasterResult_set_m_hitPointInWorld_1=b.asm.hn).apply(null,arguments)},tp=b._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0=function(){return(tp=b._emscripten_bind_btVehicleRaycasterResult_get_m_hitNormalInWorld_0=b.asm.jn).apply(null,arguments)}, +up=b._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1=function(){return(up=b._emscripten_bind_btVehicleRaycasterResult_set_m_hitNormalInWorld_1=b.asm.kn).apply(null,arguments)},vp=b._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0=function(){return(vp=b._emscripten_bind_btVehicleRaycasterResult_get_m_distFraction_0=b.asm.ln).apply(null,arguments)},wp=b._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1=function(){return(wp=b._emscripten_bind_btVehicleRaycasterResult_set_m_distFraction_1= +b.asm.mn).apply(null,arguments)},xp=b._emscripten_bind_btVehicleRaycasterResult___destroy___0=function(){return(xp=b._emscripten_bind_btVehicleRaycasterResult___destroy___0=b.asm.nn).apply(null,arguments)},yp=b._emscripten_bind_btVector3Array_size_0=function(){return(yp=b._emscripten_bind_btVector3Array_size_0=b.asm.on).apply(null,arguments)},zp=b._emscripten_bind_btVector3Array_at_1=function(){return(zp=b._emscripten_bind_btVector3Array_at_1=b.asm.pn).apply(null,arguments)},Ap=b._emscripten_bind_btVector3Array___destroy___0= +function(){return(Ap=b._emscripten_bind_btVector3Array___destroy___0=b.asm.qn).apply(null,arguments)},Bp=b._emscripten_bind_btConstraintSolver___destroy___0=function(){return(Bp=b._emscripten_bind_btConstraintSolver___destroy___0=b.asm.rn).apply(null,arguments)},Cp=b._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3=function(){return(Cp=b._emscripten_bind_btRaycastVehicle_btRaycastVehicle_3=b.asm.sn).apply(null,arguments)},Dp=b._emscripten_bind_btRaycastVehicle_applyEngineForce_2=function(){return(Dp= +b._emscripten_bind_btRaycastVehicle_applyEngineForce_2=b.asm.tn).apply(null,arguments)},Ep=b._emscripten_bind_btRaycastVehicle_setSteeringValue_2=function(){return(Ep=b._emscripten_bind_btRaycastVehicle_setSteeringValue_2=b.asm.un).apply(null,arguments)},Fp=b._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1=function(){return(Fp=b._emscripten_bind_btRaycastVehicle_getWheelTransformWS_1=b.asm.vn).apply(null,arguments)},Gp=b._emscripten_bind_btRaycastVehicle_updateWheelTransform_2=function(){return(Gp= +b._emscripten_bind_btRaycastVehicle_updateWheelTransform_2=b.asm.wn).apply(null,arguments)},Hp=b._emscripten_bind_btRaycastVehicle_addWheel_7=function(){return(Hp=b._emscripten_bind_btRaycastVehicle_addWheel_7=b.asm.xn).apply(null,arguments)},Ip=b._emscripten_bind_btRaycastVehicle_getNumWheels_0=function(){return(Ip=b._emscripten_bind_btRaycastVehicle_getNumWheels_0=b.asm.yn).apply(null,arguments)},Jp=b._emscripten_bind_btRaycastVehicle_getRigidBody_0=function(){return(Jp=b._emscripten_bind_btRaycastVehicle_getRigidBody_0= +b.asm.zn).apply(null,arguments)},Kp=b._emscripten_bind_btRaycastVehicle_getWheelInfo_1=function(){return(Kp=b._emscripten_bind_btRaycastVehicle_getWheelInfo_1=b.asm.An).apply(null,arguments)},Lp=b._emscripten_bind_btRaycastVehicle_setBrake_2=function(){return(Lp=b._emscripten_bind_btRaycastVehicle_setBrake_2=b.asm.Bn).apply(null,arguments)},Mp=b._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3=function(){return(Mp=b._emscripten_bind_btRaycastVehicle_setCoordinateSystem_3=b.asm.Cn).apply(null, +arguments)},Np=b._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0=function(){return(Np=b._emscripten_bind_btRaycastVehicle_getCurrentSpeedKmHour_0=b.asm.Dn).apply(null,arguments)},Op=b._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0=function(){return(Op=b._emscripten_bind_btRaycastVehicle_getChassisWorldTransform_0=b.asm.En).apply(null,arguments)},Pp=b._emscripten_bind_btRaycastVehicle_rayCast_1=function(){return(Pp=b._emscripten_bind_btRaycastVehicle_rayCast_1=b.asm.Fn).apply(null, +arguments)},Qp=b._emscripten_bind_btRaycastVehicle_updateVehicle_1=function(){return(Qp=b._emscripten_bind_btRaycastVehicle_updateVehicle_1=b.asm.Gn).apply(null,arguments)},Rp=b._emscripten_bind_btRaycastVehicle_resetSuspension_0=function(){return(Rp=b._emscripten_bind_btRaycastVehicle_resetSuspension_0=b.asm.Hn).apply(null,arguments)},Sp=b._emscripten_bind_btRaycastVehicle_getSteeringValue_1=function(){return(Sp=b._emscripten_bind_btRaycastVehicle_getSteeringValue_1=b.asm.In).apply(null,arguments)}, +Tp=b._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1=function(){return(Tp=b._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_1=b.asm.Jn).apply(null,arguments)},Up=b._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2=function(){return(Up=b._emscripten_bind_btRaycastVehicle_updateWheelTransformsWS_2=b.asm.Kn).apply(null,arguments)},Vp=b._emscripten_bind_btRaycastVehicle_setPitchControl_1=function(){return(Vp=b._emscripten_bind_btRaycastVehicle_setPitchControl_1=b.asm.Ln).apply(null, +arguments)},Wp=b._emscripten_bind_btRaycastVehicle_updateSuspension_1=function(){return(Wp=b._emscripten_bind_btRaycastVehicle_updateSuspension_1=b.asm.Mn).apply(null,arguments)},Xp=b._emscripten_bind_btRaycastVehicle_updateFriction_1=function(){return(Xp=b._emscripten_bind_btRaycastVehicle_updateFriction_1=b.asm.Nn).apply(null,arguments)},Yp=b._emscripten_bind_btRaycastVehicle_getRightAxis_0=function(){return(Yp=b._emscripten_bind_btRaycastVehicle_getRightAxis_0=b.asm.On).apply(null,arguments)}, +Zp=b._emscripten_bind_btRaycastVehicle_getUpAxis_0=function(){return(Zp=b._emscripten_bind_btRaycastVehicle_getUpAxis_0=b.asm.Pn).apply(null,arguments)},$p=b._emscripten_bind_btRaycastVehicle_getForwardAxis_0=function(){return($p=b._emscripten_bind_btRaycastVehicle_getForwardAxis_0=b.asm.Qn).apply(null,arguments)},aq=b._emscripten_bind_btRaycastVehicle_getForwardVector_0=function(){return(aq=b._emscripten_bind_btRaycastVehicle_getForwardVector_0=b.asm.Rn).apply(null,arguments)},bq=b._emscripten_bind_btRaycastVehicle_getUserConstraintType_0= +function(){return(bq=b._emscripten_bind_btRaycastVehicle_getUserConstraintType_0=b.asm.Sn).apply(null,arguments)},cq=b._emscripten_bind_btRaycastVehicle_setUserConstraintType_1=function(){return(cq=b._emscripten_bind_btRaycastVehicle_setUserConstraintType_1=b.asm.Tn).apply(null,arguments)},dq=b._emscripten_bind_btRaycastVehicle_setUserConstraintId_1=function(){return(dq=b._emscripten_bind_btRaycastVehicle_setUserConstraintId_1=b.asm.Un).apply(null,arguments)},eq=b._emscripten_bind_btRaycastVehicle_getUserConstraintId_0= +function(){return(eq=b._emscripten_bind_btRaycastVehicle_getUserConstraintId_0=b.asm.Vn).apply(null,arguments)},fq=b._emscripten_bind_btRaycastVehicle_updateAction_2=function(){return(fq=b._emscripten_bind_btRaycastVehicle_updateAction_2=b.asm.Wn).apply(null,arguments)},gq=b._emscripten_bind_btRaycastVehicle___destroy___0=function(){return(gq=b._emscripten_bind_btRaycastVehicle___destroy___0=b.asm.Xn).apply(null,arguments)},hq=b._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1=function(){return(hq= +b._emscripten_bind_btCylinderShapeX_btCylinderShapeX_1=b.asm.Yn).apply(null,arguments)},iq=b._emscripten_bind_btCylinderShapeX_setMargin_1=function(){return(iq=b._emscripten_bind_btCylinderShapeX_setMargin_1=b.asm.Zn).apply(null,arguments)},jq=b._emscripten_bind_btCylinderShapeX_getMargin_0=function(){return(jq=b._emscripten_bind_btCylinderShapeX_getMargin_0=b.asm._n).apply(null,arguments)},kq=b._emscripten_bind_btCylinderShapeX_setLocalScaling_1=function(){return(kq=b._emscripten_bind_btCylinderShapeX_setLocalScaling_1= +b.asm.$n).apply(null,arguments)},lq=b._emscripten_bind_btCylinderShapeX_getLocalScaling_0=function(){return(lq=b._emscripten_bind_btCylinderShapeX_getLocalScaling_0=b.asm.ao).apply(null,arguments)},mq=b._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2=function(){return(mq=b._emscripten_bind_btCylinderShapeX_calculateLocalInertia_2=b.asm.bo).apply(null,arguments)},nq=b._emscripten_bind_btCylinderShapeX___destroy___0=function(){return(nq=b._emscripten_bind_btCylinderShapeX___destroy___0=b.asm.co).apply(null, +arguments)},oq=b._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1=function(){return(oq=b._emscripten_bind_btCylinderShapeZ_btCylinderShapeZ_1=b.asm.eo).apply(null,arguments)},pq=b._emscripten_bind_btCylinderShapeZ_setMargin_1=function(){return(pq=b._emscripten_bind_btCylinderShapeZ_setMargin_1=b.asm.fo).apply(null,arguments)},qq=b._emscripten_bind_btCylinderShapeZ_getMargin_0=function(){return(qq=b._emscripten_bind_btCylinderShapeZ_getMargin_0=b.asm.go).apply(null,arguments)},rq=b._emscripten_bind_btCylinderShapeZ_setLocalScaling_1= +function(){return(rq=b._emscripten_bind_btCylinderShapeZ_setLocalScaling_1=b.asm.ho).apply(null,arguments)},sq=b._emscripten_bind_btCylinderShapeZ_getLocalScaling_0=function(){return(sq=b._emscripten_bind_btCylinderShapeZ_getLocalScaling_0=b.asm.io).apply(null,arguments)},tq=b._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2=function(){return(tq=b._emscripten_bind_btCylinderShapeZ_calculateLocalInertia_2=b.asm.jo).apply(null,arguments)},uq=b._emscripten_bind_btCylinderShapeZ___destroy___0= +function(){return(uq=b._emscripten_bind_btCylinderShapeZ___destroy___0=b.asm.ko).apply(null,arguments)},vq=b._emscripten_bind_btConvexPolyhedron_get_m_vertices_0=function(){return(vq=b._emscripten_bind_btConvexPolyhedron_get_m_vertices_0=b.asm.lo).apply(null,arguments)},wq=b._emscripten_bind_btConvexPolyhedron_set_m_vertices_1=function(){return(wq=b._emscripten_bind_btConvexPolyhedron_set_m_vertices_1=b.asm.mo).apply(null,arguments)},xq=b._emscripten_bind_btConvexPolyhedron_get_m_faces_0=function(){return(xq= +b._emscripten_bind_btConvexPolyhedron_get_m_faces_0=b.asm.no).apply(null,arguments)},yq=b._emscripten_bind_btConvexPolyhedron_set_m_faces_1=function(){return(yq=b._emscripten_bind_btConvexPolyhedron_set_m_faces_1=b.asm.oo).apply(null,arguments)},zq=b._emscripten_bind_btConvexPolyhedron___destroy___0=function(){return(zq=b._emscripten_bind_btConvexPolyhedron___destroy___0=b.asm.po).apply(null,arguments)},Aq=b._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0= +function(){return(Aq=b._emscripten_bind_btSequentialImpulseConstraintSolver_btSequentialImpulseConstraintSolver_0=b.asm.qo).apply(null,arguments)},Bq=b._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0=function(){return(Bq=b._emscripten_bind_btSequentialImpulseConstraintSolver___destroy___0=b.asm.ro).apply(null,arguments)},Cq=b._emscripten_bind_tAnchorArray_size_0=function(){return(Cq=b._emscripten_bind_tAnchorArray_size_0=b.asm.so).apply(null,arguments)},Dq=b._emscripten_bind_tAnchorArray_at_1= +function(){return(Dq=b._emscripten_bind_tAnchorArray_at_1=b.asm.to).apply(null,arguments)},Eq=b._emscripten_bind_tAnchorArray_clear_0=function(){return(Eq=b._emscripten_bind_tAnchorArray_clear_0=b.asm.uo).apply(null,arguments)},Fq=b._emscripten_bind_tAnchorArray_push_back_1=function(){return(Fq=b._emscripten_bind_tAnchorArray_push_back_1=b.asm.vo).apply(null,arguments)},Gq=b._emscripten_bind_tAnchorArray_pop_back_0=function(){return(Gq=b._emscripten_bind_tAnchorArray_pop_back_0=b.asm.wo).apply(null, +arguments)},Hq=b._emscripten_bind_tAnchorArray___destroy___0=function(){return(Hq=b._emscripten_bind_tAnchorArray___destroy___0=b.asm.xo).apply(null,arguments)},Iq=b._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0=function(){return(Iq=b._emscripten_bind_RaycastInfo_get_m_contactNormalWS_0=b.asm.yo).apply(null,arguments)},Jq=b._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1=function(){return(Jq=b._emscripten_bind_RaycastInfo_set_m_contactNormalWS_1=b.asm.zo).apply(null,arguments)},Kq=b._emscripten_bind_RaycastInfo_get_m_contactPointWS_0= +function(){return(Kq=b._emscripten_bind_RaycastInfo_get_m_contactPointWS_0=b.asm.Ao).apply(null,arguments)},Lq=b._emscripten_bind_RaycastInfo_set_m_contactPointWS_1=function(){return(Lq=b._emscripten_bind_RaycastInfo_set_m_contactPointWS_1=b.asm.Bo).apply(null,arguments)},Mq=b._emscripten_bind_RaycastInfo_get_m_suspensionLength_0=function(){return(Mq=b._emscripten_bind_RaycastInfo_get_m_suspensionLength_0=b.asm.Co).apply(null,arguments)},Nq=b._emscripten_bind_RaycastInfo_set_m_suspensionLength_1= +function(){return(Nq=b._emscripten_bind_RaycastInfo_set_m_suspensionLength_1=b.asm.Do).apply(null,arguments)},Oq=b._emscripten_bind_RaycastInfo_get_m_hardPointWS_0=function(){return(Oq=b._emscripten_bind_RaycastInfo_get_m_hardPointWS_0=b.asm.Eo).apply(null,arguments)},Pq=b._emscripten_bind_RaycastInfo_set_m_hardPointWS_1=function(){return(Pq=b._emscripten_bind_RaycastInfo_set_m_hardPointWS_1=b.asm.Fo).apply(null,arguments)},Qq=b._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0=function(){return(Qq= +b._emscripten_bind_RaycastInfo_get_m_wheelDirectionWS_0=b.asm.Go).apply(null,arguments)},Rq=b._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1=function(){return(Rq=b._emscripten_bind_RaycastInfo_set_m_wheelDirectionWS_1=b.asm.Ho).apply(null,arguments)},Sq=b._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0=function(){return(Sq=b._emscripten_bind_RaycastInfo_get_m_wheelAxleWS_0=b.asm.Io).apply(null,arguments)},Tq=b._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1=function(){return(Tq=b._emscripten_bind_RaycastInfo_set_m_wheelAxleWS_1= +b.asm.Jo).apply(null,arguments)},Uq=b._emscripten_bind_RaycastInfo_get_m_isInContact_0=function(){return(Uq=b._emscripten_bind_RaycastInfo_get_m_isInContact_0=b.asm.Ko).apply(null,arguments)},Vq=b._emscripten_bind_RaycastInfo_set_m_isInContact_1=function(){return(Vq=b._emscripten_bind_RaycastInfo_set_m_isInContact_1=b.asm.Lo).apply(null,arguments)},Wq=b._emscripten_bind_RaycastInfo_get_m_groundObject_0=function(){return(Wq=b._emscripten_bind_RaycastInfo_get_m_groundObject_0=b.asm.Mo).apply(null,arguments)}, +Xq=b._emscripten_bind_RaycastInfo_set_m_groundObject_1=function(){return(Xq=b._emscripten_bind_RaycastInfo_set_m_groundObject_1=b.asm.No).apply(null,arguments)},Yq=b._emscripten_bind_RaycastInfo___destroy___0=function(){return(Yq=b._emscripten_bind_RaycastInfo___destroy___0=b.asm.Oo).apply(null,arguments)},Zq=b._emscripten_bind_btMultiSphereShape_btMultiSphereShape_3=function(){return(Zq=b._emscripten_bind_btMultiSphereShape_btMultiSphereShape_3=b.asm.Po).apply(null,arguments)},$q=b._emscripten_bind_btMultiSphereShape_setLocalScaling_1= +function(){return($q=b._emscripten_bind_btMultiSphereShape_setLocalScaling_1=b.asm.Qo).apply(null,arguments)},ar=b._emscripten_bind_btMultiSphereShape_getLocalScaling_0=function(){return(ar=b._emscripten_bind_btMultiSphereShape_getLocalScaling_0=b.asm.Ro).apply(null,arguments)},br=b._emscripten_bind_btMultiSphereShape_calculateLocalInertia_2=function(){return(br=b._emscripten_bind_btMultiSphereShape_calculateLocalInertia_2=b.asm.So).apply(null,arguments)},cr=b._emscripten_bind_btMultiSphereShape___destroy___0= +function(){return(cr=b._emscripten_bind_btMultiSphereShape___destroy___0=b.asm.To).apply(null,arguments)},dr=b._emscripten_bind_btSoftBody_btSoftBody_4=function(){return(dr=b._emscripten_bind_btSoftBody_btSoftBody_4=b.asm.Uo).apply(null,arguments)},er=b._emscripten_bind_btSoftBody_checkLink_2=function(){return(er=b._emscripten_bind_btSoftBody_checkLink_2=b.asm.Vo).apply(null,arguments)},fr=b._emscripten_bind_btSoftBody_checkFace_3=function(){return(fr=b._emscripten_bind_btSoftBody_checkFace_3=b.asm.Wo).apply(null, +arguments)},gr=b._emscripten_bind_btSoftBody_appendMaterial_0=function(){return(gr=b._emscripten_bind_btSoftBody_appendMaterial_0=b.asm.Xo).apply(null,arguments)},hr=b._emscripten_bind_btSoftBody_appendNode_2=function(){return(hr=b._emscripten_bind_btSoftBody_appendNode_2=b.asm.Yo).apply(null,arguments)},ir=b._emscripten_bind_btSoftBody_appendLink_4=function(){return(ir=b._emscripten_bind_btSoftBody_appendLink_4=b.asm.Zo).apply(null,arguments)},jr=b._emscripten_bind_btSoftBody_appendFace_4=function(){return(jr= +b._emscripten_bind_btSoftBody_appendFace_4=b.asm._o).apply(null,arguments)},kr=b._emscripten_bind_btSoftBody_appendTetra_5=function(){return(kr=b._emscripten_bind_btSoftBody_appendTetra_5=b.asm.$o).apply(null,arguments)},lr=b._emscripten_bind_btSoftBody_appendAnchor_4=function(){return(lr=b._emscripten_bind_btSoftBody_appendAnchor_4=b.asm.ap).apply(null,arguments)},mr=b._emscripten_bind_btSoftBody_addForce_1=function(){return(mr=b._emscripten_bind_btSoftBody_addForce_1=b.asm.bp).apply(null,arguments)}, +nr=b._emscripten_bind_btSoftBody_addForce_2=function(){return(nr=b._emscripten_bind_btSoftBody_addForce_2=b.asm.cp).apply(null,arguments)},or=b._emscripten_bind_btSoftBody_addAeroForceToNode_2=function(){return(or=b._emscripten_bind_btSoftBody_addAeroForceToNode_2=b.asm.dp).apply(null,arguments)},pr=b._emscripten_bind_btSoftBody_getTotalMass_0=function(){return(pr=b._emscripten_bind_btSoftBody_getTotalMass_0=b.asm.ep).apply(null,arguments)},qr=b._emscripten_bind_btSoftBody_setTotalMass_2=function(){return(qr= +b._emscripten_bind_btSoftBody_setTotalMass_2=b.asm.fp).apply(null,arguments)},rr=b._emscripten_bind_btSoftBody_setMass_2=function(){return(rr=b._emscripten_bind_btSoftBody_setMass_2=b.asm.gp).apply(null,arguments)},sr=b._emscripten_bind_btSoftBody_transform_1=function(){return(sr=b._emscripten_bind_btSoftBody_transform_1=b.asm.hp).apply(null,arguments)},tr=b._emscripten_bind_btSoftBody_translate_1=function(){return(tr=b._emscripten_bind_btSoftBody_translate_1=b.asm.ip).apply(null,arguments)},ur=b._emscripten_bind_btSoftBody_rotate_1= +function(){return(ur=b._emscripten_bind_btSoftBody_rotate_1=b.asm.jp).apply(null,arguments)},vr=b._emscripten_bind_btSoftBody_scale_1=function(){return(vr=b._emscripten_bind_btSoftBody_scale_1=b.asm.kp).apply(null,arguments)},wr=b._emscripten_bind_btSoftBody_generateClusters_1=function(){return(wr=b._emscripten_bind_btSoftBody_generateClusters_1=b.asm.lp).apply(null,arguments)},xr=b._emscripten_bind_btSoftBody_generateClusters_2=function(){return(xr=b._emscripten_bind_btSoftBody_generateClusters_2= +b.asm.mp).apply(null,arguments)},yr=b._emscripten_bind_btSoftBody_generateBendingConstraints_2=function(){return(yr=b._emscripten_bind_btSoftBody_generateBendingConstraints_2=b.asm.np).apply(null,arguments)},zr=b._emscripten_bind_btSoftBody_upcast_1=function(){return(zr=b._emscripten_bind_btSoftBody_upcast_1=b.asm.op).apply(null,arguments)},Ar=b._emscripten_bind_btSoftBody_setAnisotropicFriction_2=function(){return(Ar=b._emscripten_bind_btSoftBody_setAnisotropicFriction_2=b.asm.pp).apply(null,arguments)}, +Br=b._emscripten_bind_btSoftBody_getCollisionShape_0=function(){return(Br=b._emscripten_bind_btSoftBody_getCollisionShape_0=b.asm.qp).apply(null,arguments)},Cr=b._emscripten_bind_btSoftBody_setContactProcessingThreshold_1=function(){return(Cr=b._emscripten_bind_btSoftBody_setContactProcessingThreshold_1=b.asm.rp).apply(null,arguments)},Dr=b._emscripten_bind_btSoftBody_setActivationState_1=function(){return(Dr=b._emscripten_bind_btSoftBody_setActivationState_1=b.asm.sp).apply(null,arguments)},Er=b._emscripten_bind_btSoftBody_forceActivationState_1= +function(){return(Er=b._emscripten_bind_btSoftBody_forceActivationState_1=b.asm.tp).apply(null,arguments)},Fr=b._emscripten_bind_btSoftBody_activate_0=function(){return(Fr=b._emscripten_bind_btSoftBody_activate_0=b.asm.up).apply(null,arguments)},Gr=b._emscripten_bind_btSoftBody_activate_1=function(){return(Gr=b._emscripten_bind_btSoftBody_activate_1=b.asm.vp).apply(null,arguments)},Hr=b._emscripten_bind_btSoftBody_isActive_0=function(){return(Hr=b._emscripten_bind_btSoftBody_isActive_0=b.asm.wp).apply(null, +arguments)},Ir=b._emscripten_bind_btSoftBody_isKinematicObject_0=function(){return(Ir=b._emscripten_bind_btSoftBody_isKinematicObject_0=b.asm.xp).apply(null,arguments)},Jr=b._emscripten_bind_btSoftBody_isStaticObject_0=function(){return(Jr=b._emscripten_bind_btSoftBody_isStaticObject_0=b.asm.yp).apply(null,arguments)},Kr=b._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0=function(){return(Kr=b._emscripten_bind_btSoftBody_isStaticOrKinematicObject_0=b.asm.zp).apply(null,arguments)},Lr=b._emscripten_bind_btSoftBody_getRestitution_0= +function(){return(Lr=b._emscripten_bind_btSoftBody_getRestitution_0=b.asm.Ap).apply(null,arguments)},Mr=b._emscripten_bind_btSoftBody_getFriction_0=function(){return(Mr=b._emscripten_bind_btSoftBody_getFriction_0=b.asm.Bp).apply(null,arguments)},Nr=b._emscripten_bind_btSoftBody_getRollingFriction_0=function(){return(Nr=b._emscripten_bind_btSoftBody_getRollingFriction_0=b.asm.Cp).apply(null,arguments)},Or=b._emscripten_bind_btSoftBody_setRestitution_1=function(){return(Or=b._emscripten_bind_btSoftBody_setRestitution_1= +b.asm.Dp).apply(null,arguments)},Pr=b._emscripten_bind_btSoftBody_setFriction_1=function(){return(Pr=b._emscripten_bind_btSoftBody_setFriction_1=b.asm.Ep).apply(null,arguments)},Qr=b._emscripten_bind_btSoftBody_setRollingFriction_1=function(){return(Qr=b._emscripten_bind_btSoftBody_setRollingFriction_1=b.asm.Fp).apply(null,arguments)},Rr=b._emscripten_bind_btSoftBody_getWorldTransform_0=function(){return(Rr=b._emscripten_bind_btSoftBody_getWorldTransform_0=b.asm.Gp).apply(null,arguments)},Sr=b._emscripten_bind_btSoftBody_getCollisionFlags_0= +function(){return(Sr=b._emscripten_bind_btSoftBody_getCollisionFlags_0=b.asm.Hp).apply(null,arguments)},Tr=b._emscripten_bind_btSoftBody_setCollisionFlags_1=function(){return(Tr=b._emscripten_bind_btSoftBody_setCollisionFlags_1=b.asm.Ip).apply(null,arguments)},Ur=b._emscripten_bind_btSoftBody_setWorldTransform_1=function(){return(Ur=b._emscripten_bind_btSoftBody_setWorldTransform_1=b.asm.Jp).apply(null,arguments)},Vr=b._emscripten_bind_btSoftBody_setCollisionShape_1=function(){return(Vr=b._emscripten_bind_btSoftBody_setCollisionShape_1= +b.asm.Kp).apply(null,arguments)},Wr=b._emscripten_bind_btSoftBody_setCcdMotionThreshold_1=function(){return(Wr=b._emscripten_bind_btSoftBody_setCcdMotionThreshold_1=b.asm.Lp).apply(null,arguments)},Xr=b._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1=function(){return(Xr=b._emscripten_bind_btSoftBody_setCcdSweptSphereRadius_1=b.asm.Mp).apply(null,arguments)},Yr=b._emscripten_bind_btSoftBody_getUserIndex_0=function(){return(Yr=b._emscripten_bind_btSoftBody_getUserIndex_0=b.asm.Np).apply(null, +arguments)},Zr=b._emscripten_bind_btSoftBody_setUserIndex_1=function(){return(Zr=b._emscripten_bind_btSoftBody_setUserIndex_1=b.asm.Op).apply(null,arguments)},$r=b._emscripten_bind_btSoftBody_getUserPointer_0=function(){return($r=b._emscripten_bind_btSoftBody_getUserPointer_0=b.asm.Pp).apply(null,arguments)},as=b._emscripten_bind_btSoftBody_setUserPointer_1=function(){return(as=b._emscripten_bind_btSoftBody_setUserPointer_1=b.asm.Qp).apply(null,arguments)},bs=b._emscripten_bind_btSoftBody_getBroadphaseHandle_0= +function(){return(bs=b._emscripten_bind_btSoftBody_getBroadphaseHandle_0=b.asm.Rp).apply(null,arguments)},cs=b._emscripten_bind_btSoftBody_get_m_cfg_0=function(){return(cs=b._emscripten_bind_btSoftBody_get_m_cfg_0=b.asm.Sp).apply(null,arguments)},ds=b._emscripten_bind_btSoftBody_set_m_cfg_1=function(){return(ds=b._emscripten_bind_btSoftBody_set_m_cfg_1=b.asm.Tp).apply(null,arguments)},es=b._emscripten_bind_btSoftBody_get_m_nodes_0=function(){return(es=b._emscripten_bind_btSoftBody_get_m_nodes_0=b.asm.Up).apply(null, +arguments)},gs=b._emscripten_bind_btSoftBody_set_m_nodes_1=function(){return(gs=b._emscripten_bind_btSoftBody_set_m_nodes_1=b.asm.Vp).apply(null,arguments)},hs=b._emscripten_bind_btSoftBody_get_m_faces_0=function(){return(hs=b._emscripten_bind_btSoftBody_get_m_faces_0=b.asm.Wp).apply(null,arguments)},is=b._emscripten_bind_btSoftBody_set_m_faces_1=function(){return(is=b._emscripten_bind_btSoftBody_set_m_faces_1=b.asm.Xp).apply(null,arguments)},js=b._emscripten_bind_btSoftBody_get_m_materials_0=function(){return(js= +b._emscripten_bind_btSoftBody_get_m_materials_0=b.asm.Yp).apply(null,arguments)},ks=b._emscripten_bind_btSoftBody_set_m_materials_1=function(){return(ks=b._emscripten_bind_btSoftBody_set_m_materials_1=b.asm.Zp).apply(null,arguments)},ls=b._emscripten_bind_btSoftBody_get_m_anchors_0=function(){return(ls=b._emscripten_bind_btSoftBody_get_m_anchors_0=b.asm._p).apply(null,arguments)},ms=b._emscripten_bind_btSoftBody_set_m_anchors_1=function(){return(ms=b._emscripten_bind_btSoftBody_set_m_anchors_1=b.asm.$p).apply(null, +arguments)},ns=b._emscripten_bind_btSoftBody___destroy___0=function(){return(ns=b._emscripten_bind_btSoftBody___destroy___0=b.asm.aq).apply(null,arguments)},ps=b._emscripten_bind_btIntArray_size_0=function(){return(ps=b._emscripten_bind_btIntArray_size_0=b.asm.bq).apply(null,arguments)},qs=b._emscripten_bind_btIntArray_at_1=function(){return(qs=b._emscripten_bind_btIntArray_at_1=b.asm.cq).apply(null,arguments)},rs=b._emscripten_bind_btIntArray___destroy___0=function(){return(rs=b._emscripten_bind_btIntArray___destroy___0= +b.asm.dq).apply(null,arguments)},ss=b._emscripten_bind_Config_get_kVCF_0=function(){return(ss=b._emscripten_bind_Config_get_kVCF_0=b.asm.eq).apply(null,arguments)},ts=b._emscripten_bind_Config_set_kVCF_1=function(){return(ts=b._emscripten_bind_Config_set_kVCF_1=b.asm.fq).apply(null,arguments)},us=b._emscripten_bind_Config_get_kDP_0=function(){return(us=b._emscripten_bind_Config_get_kDP_0=b.asm.gq).apply(null,arguments)},vs=b._emscripten_bind_Config_set_kDP_1=function(){return(vs=b._emscripten_bind_Config_set_kDP_1= +b.asm.hq).apply(null,arguments)},xs=b._emscripten_bind_Config_get_kDG_0=function(){return(xs=b._emscripten_bind_Config_get_kDG_0=b.asm.iq).apply(null,arguments)},ys=b._emscripten_bind_Config_set_kDG_1=function(){return(ys=b._emscripten_bind_Config_set_kDG_1=b.asm.jq).apply(null,arguments)},zs=b._emscripten_bind_Config_get_kLF_0=function(){return(zs=b._emscripten_bind_Config_get_kLF_0=b.asm.kq).apply(null,arguments)},As=b._emscripten_bind_Config_set_kLF_1=function(){return(As=b._emscripten_bind_Config_set_kLF_1= +b.asm.lq).apply(null,arguments)},Bs=b._emscripten_bind_Config_get_kPR_0=function(){return(Bs=b._emscripten_bind_Config_get_kPR_0=b.asm.mq).apply(null,arguments)},Cs=b._emscripten_bind_Config_set_kPR_1=function(){return(Cs=b._emscripten_bind_Config_set_kPR_1=b.asm.nq).apply(null,arguments)},Ds=b._emscripten_bind_Config_get_kVC_0=function(){return(Ds=b._emscripten_bind_Config_get_kVC_0=b.asm.oq).apply(null,arguments)},Es=b._emscripten_bind_Config_set_kVC_1=function(){return(Es=b._emscripten_bind_Config_set_kVC_1= +b.asm.pq).apply(null,arguments)},Fs=b._emscripten_bind_Config_get_kDF_0=function(){return(Fs=b._emscripten_bind_Config_get_kDF_0=b.asm.qq).apply(null,arguments)},Gs=b._emscripten_bind_Config_set_kDF_1=function(){return(Gs=b._emscripten_bind_Config_set_kDF_1=b.asm.rq).apply(null,arguments)},Hs=b._emscripten_bind_Config_get_kMT_0=function(){return(Hs=b._emscripten_bind_Config_get_kMT_0=b.asm.sq).apply(null,arguments)},Is=b._emscripten_bind_Config_set_kMT_1=function(){return(Is=b._emscripten_bind_Config_set_kMT_1= +b.asm.tq).apply(null,arguments)},Js=b._emscripten_bind_Config_get_kCHR_0=function(){return(Js=b._emscripten_bind_Config_get_kCHR_0=b.asm.uq).apply(null,arguments)},Ks=b._emscripten_bind_Config_set_kCHR_1=function(){return(Ks=b._emscripten_bind_Config_set_kCHR_1=b.asm.vq).apply(null,arguments)},Ls=b._emscripten_bind_Config_get_kKHR_0=function(){return(Ls=b._emscripten_bind_Config_get_kKHR_0=b.asm.wq).apply(null,arguments)},Ms=b._emscripten_bind_Config_set_kKHR_1=function(){return(Ms=b._emscripten_bind_Config_set_kKHR_1= +b.asm.xq).apply(null,arguments)},Ns=b._emscripten_bind_Config_get_kSHR_0=function(){return(Ns=b._emscripten_bind_Config_get_kSHR_0=b.asm.yq).apply(null,arguments)},Os=b._emscripten_bind_Config_set_kSHR_1=function(){return(Os=b._emscripten_bind_Config_set_kSHR_1=b.asm.zq).apply(null,arguments)},Ps=b._emscripten_bind_Config_get_kAHR_0=function(){return(Ps=b._emscripten_bind_Config_get_kAHR_0=b.asm.Aq).apply(null,arguments)},Qs=b._emscripten_bind_Config_set_kAHR_1=function(){return(Qs=b._emscripten_bind_Config_set_kAHR_1= +b.asm.Bq).apply(null,arguments)},Rs=b._emscripten_bind_Config_get_kSRHR_CL_0=function(){return(Rs=b._emscripten_bind_Config_get_kSRHR_CL_0=b.asm.Cq).apply(null,arguments)},Ss=b._emscripten_bind_Config_set_kSRHR_CL_1=function(){return(Ss=b._emscripten_bind_Config_set_kSRHR_CL_1=b.asm.Dq).apply(null,arguments)},Ts=b._emscripten_bind_Config_get_kSKHR_CL_0=function(){return(Ts=b._emscripten_bind_Config_get_kSKHR_CL_0=b.asm.Eq).apply(null,arguments)},Us=b._emscripten_bind_Config_set_kSKHR_CL_1=function(){return(Us= +b._emscripten_bind_Config_set_kSKHR_CL_1=b.asm.Fq).apply(null,arguments)},Vs=b._emscripten_bind_Config_get_kSSHR_CL_0=function(){return(Vs=b._emscripten_bind_Config_get_kSSHR_CL_0=b.asm.Gq).apply(null,arguments)},Ws=b._emscripten_bind_Config_set_kSSHR_CL_1=function(){return(Ws=b._emscripten_bind_Config_set_kSSHR_CL_1=b.asm.Hq).apply(null,arguments)},Xs=b._emscripten_bind_Config_get_kSR_SPLT_CL_0=function(){return(Xs=b._emscripten_bind_Config_get_kSR_SPLT_CL_0=b.asm.Iq).apply(null,arguments)},Ys=b._emscripten_bind_Config_set_kSR_SPLT_CL_1= +function(){return(Ys=b._emscripten_bind_Config_set_kSR_SPLT_CL_1=b.asm.Jq).apply(null,arguments)},Zs=b._emscripten_bind_Config_get_kSK_SPLT_CL_0=function(){return(Zs=b._emscripten_bind_Config_get_kSK_SPLT_CL_0=b.asm.Kq).apply(null,arguments)},$s=b._emscripten_bind_Config_set_kSK_SPLT_CL_1=function(){return($s=b._emscripten_bind_Config_set_kSK_SPLT_CL_1=b.asm.Lq).apply(null,arguments)},at=b._emscripten_bind_Config_get_kSS_SPLT_CL_0=function(){return(at=b._emscripten_bind_Config_get_kSS_SPLT_CL_0=b.asm.Mq).apply(null, +arguments)},bt=b._emscripten_bind_Config_set_kSS_SPLT_CL_1=function(){return(bt=b._emscripten_bind_Config_set_kSS_SPLT_CL_1=b.asm.Nq).apply(null,arguments)},ct=b._emscripten_bind_Config_get_maxvolume_0=function(){return(ct=b._emscripten_bind_Config_get_maxvolume_0=b.asm.Oq).apply(null,arguments)},dt=b._emscripten_bind_Config_set_maxvolume_1=function(){return(dt=b._emscripten_bind_Config_set_maxvolume_1=b.asm.Pq).apply(null,arguments)},et=b._emscripten_bind_Config_get_timescale_0=function(){return(et= +b._emscripten_bind_Config_get_timescale_0=b.asm.Qq).apply(null,arguments)},ft=b._emscripten_bind_Config_set_timescale_1=function(){return(ft=b._emscripten_bind_Config_set_timescale_1=b.asm.Rq).apply(null,arguments)},gt=b._emscripten_bind_Config_get_viterations_0=function(){return(gt=b._emscripten_bind_Config_get_viterations_0=b.asm.Sq).apply(null,arguments)},ht=b._emscripten_bind_Config_set_viterations_1=function(){return(ht=b._emscripten_bind_Config_set_viterations_1=b.asm.Tq).apply(null,arguments)}, +it=b._emscripten_bind_Config_get_piterations_0=function(){return(it=b._emscripten_bind_Config_get_piterations_0=b.asm.Uq).apply(null,arguments)},jt=b._emscripten_bind_Config_set_piterations_1=function(){return(jt=b._emscripten_bind_Config_set_piterations_1=b.asm.Vq).apply(null,arguments)},kt=b._emscripten_bind_Config_get_diterations_0=function(){return(kt=b._emscripten_bind_Config_get_diterations_0=b.asm.Wq).apply(null,arguments)},lt=b._emscripten_bind_Config_set_diterations_1=function(){return(lt= +b._emscripten_bind_Config_set_diterations_1=b.asm.Xq).apply(null,arguments)},mt=b._emscripten_bind_Config_get_citerations_0=function(){return(mt=b._emscripten_bind_Config_get_citerations_0=b.asm.Yq).apply(null,arguments)},nt=b._emscripten_bind_Config_set_citerations_1=function(){return(nt=b._emscripten_bind_Config_set_citerations_1=b.asm.Zq).apply(null,arguments)},ot=b._emscripten_bind_Config_get_collisions_0=function(){return(ot=b._emscripten_bind_Config_get_collisions_0=b.asm._q).apply(null,arguments)}, +pt=b._emscripten_bind_Config_set_collisions_1=function(){return(pt=b._emscripten_bind_Config_set_collisions_1=b.asm.$q).apply(null,arguments)},qt=b._emscripten_bind_Config___destroy___0=function(){return(qt=b._emscripten_bind_Config___destroy___0=b.asm.ar).apply(null,arguments)},rt=b._emscripten_bind_Node_get_m_x_0=function(){return(rt=b._emscripten_bind_Node_get_m_x_0=b.asm.br).apply(null,arguments)},st=b._emscripten_bind_Node_set_m_x_1=function(){return(st=b._emscripten_bind_Node_set_m_x_1=b.asm.cr).apply(null, +arguments)},tt=b._emscripten_bind_Node_get_m_q_0=function(){return(tt=b._emscripten_bind_Node_get_m_q_0=b.asm.dr).apply(null,arguments)},ut=b._emscripten_bind_Node_set_m_q_1=function(){return(ut=b._emscripten_bind_Node_set_m_q_1=b.asm.er).apply(null,arguments)},vt=b._emscripten_bind_Node_get_m_v_0=function(){return(vt=b._emscripten_bind_Node_get_m_v_0=b.asm.fr).apply(null,arguments)},wt=b._emscripten_bind_Node_set_m_v_1=function(){return(wt=b._emscripten_bind_Node_set_m_v_1=b.asm.gr).apply(null,arguments)}, +xt=b._emscripten_bind_Node_get_m_f_0=function(){return(xt=b._emscripten_bind_Node_get_m_f_0=b.asm.hr).apply(null,arguments)},yt=b._emscripten_bind_Node_set_m_f_1=function(){return(yt=b._emscripten_bind_Node_set_m_f_1=b.asm.ir).apply(null,arguments)},zt=b._emscripten_bind_Node_get_m_n_0=function(){return(zt=b._emscripten_bind_Node_get_m_n_0=b.asm.jr).apply(null,arguments)},At=b._emscripten_bind_Node_set_m_n_1=function(){return(At=b._emscripten_bind_Node_set_m_n_1=b.asm.kr).apply(null,arguments)},Bt= +b._emscripten_bind_Node_get_m_im_0=function(){return(Bt=b._emscripten_bind_Node_get_m_im_0=b.asm.lr).apply(null,arguments)},Ct=b._emscripten_bind_Node_set_m_im_1=function(){return(Ct=b._emscripten_bind_Node_set_m_im_1=b.asm.mr).apply(null,arguments)},Dt=b._emscripten_bind_Node_get_m_area_0=function(){return(Dt=b._emscripten_bind_Node_get_m_area_0=b.asm.nr).apply(null,arguments)},Et=b._emscripten_bind_Node_set_m_area_1=function(){return(Et=b._emscripten_bind_Node_set_m_area_1=b.asm.or).apply(null, +arguments)},Ft=b._emscripten_bind_Node___destroy___0=function(){return(Ft=b._emscripten_bind_Node___destroy___0=b.asm.pr).apply(null,arguments)},Gt=b._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0=function(){return(Gt=b._emscripten_bind_btGhostPairCallback_btGhostPairCallback_0=b.asm.qr).apply(null,arguments)},Ht=b._emscripten_bind_btGhostPairCallback___destroy___0=function(){return(Ht=b._emscripten_bind_btGhostPairCallback___destroy___0=b.asm.rr).apply(null,arguments)},It=b._emscripten_bind_btOverlappingPairCallback___destroy___0= +function(){return(It=b._emscripten_bind_btOverlappingPairCallback___destroy___0=b.asm.sr).apply(null,arguments)},Jt=b._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3=function(){return(Jt=b._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_3=b.asm.tr).apply(null,arguments)},Kt=b._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4=function(){return(Kt=b._emscripten_bind_btKinematicCharacterController_btKinematicCharacterController_4= +b.asm.ur).apply(null,arguments)},Lt=b._emscripten_bind_btKinematicCharacterController_setUpAxis_1=function(){return(Lt=b._emscripten_bind_btKinematicCharacterController_setUpAxis_1=b.asm.vr).apply(null,arguments)},Mt=b._emscripten_bind_btKinematicCharacterController_setWalkDirection_1=function(){return(Mt=b._emscripten_bind_btKinematicCharacterController_setWalkDirection_1=b.asm.wr).apply(null,arguments)},Nt=b._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2=function(){return(Nt= +b._emscripten_bind_btKinematicCharacterController_setVelocityForTimeInterval_2=b.asm.xr).apply(null,arguments)},Ot=b._emscripten_bind_btKinematicCharacterController_warp_1=function(){return(Ot=b._emscripten_bind_btKinematicCharacterController_warp_1=b.asm.yr).apply(null,arguments)},Pt=b._emscripten_bind_btKinematicCharacterController_preStep_1=function(){return(Pt=b._emscripten_bind_btKinematicCharacterController_preStep_1=b.asm.zr).apply(null,arguments)},Qt=b._emscripten_bind_btKinematicCharacterController_playerStep_2= +function(){return(Qt=b._emscripten_bind_btKinematicCharacterController_playerStep_2=b.asm.Ar).apply(null,arguments)},Rt=b._emscripten_bind_btKinematicCharacterController_setFallSpeed_1=function(){return(Rt=b._emscripten_bind_btKinematicCharacterController_setFallSpeed_1=b.asm.Br).apply(null,arguments)},St=b._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1=function(){return(St=b._emscripten_bind_btKinematicCharacterController_setJumpSpeed_1=b.asm.Cr).apply(null,arguments)},Tt=b._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1= +function(){return(Tt=b._emscripten_bind_btKinematicCharacterController_setMaxJumpHeight_1=b.asm.Dr).apply(null,arguments)},Ut=b._emscripten_bind_btKinematicCharacterController_canJump_0=function(){return(Ut=b._emscripten_bind_btKinematicCharacterController_canJump_0=b.asm.Er).apply(null,arguments)},Vt=b._emscripten_bind_btKinematicCharacterController_jump_0=function(){return(Vt=b._emscripten_bind_btKinematicCharacterController_jump_0=b.asm.Fr).apply(null,arguments)},Wt=b._emscripten_bind_btKinematicCharacterController_setGravity_1= +function(){return(Wt=b._emscripten_bind_btKinematicCharacterController_setGravity_1=b.asm.Gr).apply(null,arguments)},Xt=b._emscripten_bind_btKinematicCharacterController_getGravity_0=function(){return(Xt=b._emscripten_bind_btKinematicCharacterController_getGravity_0=b.asm.Hr).apply(null,arguments)},Yt=b._emscripten_bind_btKinematicCharacterController_setMaxSlope_1=function(){return(Yt=b._emscripten_bind_btKinematicCharacterController_setMaxSlope_1=b.asm.Ir).apply(null,arguments)},Zt=b._emscripten_bind_btKinematicCharacterController_getMaxSlope_0= +function(){return(Zt=b._emscripten_bind_btKinematicCharacterController_getMaxSlope_0=b.asm.Jr).apply(null,arguments)},$t=b._emscripten_bind_btKinematicCharacterController_getGhostObject_0=function(){return($t=b._emscripten_bind_btKinematicCharacterController_getGhostObject_0=b.asm.Kr).apply(null,arguments)},au=b._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1=function(){return(au=b._emscripten_bind_btKinematicCharacterController_setUseGhostSweepTest_1=b.asm.Lr).apply(null,arguments)}, +bu=b._emscripten_bind_btKinematicCharacterController_onGround_0=function(){return(bu=b._emscripten_bind_btKinematicCharacterController_onGround_0=b.asm.Mr).apply(null,arguments)},cu=b._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1=function(){return(cu=b._emscripten_bind_btKinematicCharacterController_setUpInterpolate_1=b.asm.Nr).apply(null,arguments)},du=b._emscripten_bind_btKinematicCharacterController_updateAction_2=function(){return(du=b._emscripten_bind_btKinematicCharacterController_updateAction_2= +b.asm.Or).apply(null,arguments)},eu=b._emscripten_bind_btKinematicCharacterController___destroy___0=function(){return(eu=b._emscripten_bind_btKinematicCharacterController___destroy___0=b.asm.Pr).apply(null,arguments)},fu=b._emscripten_bind_btSoftBodyArray_size_0=function(){return(fu=b._emscripten_bind_btSoftBodyArray_size_0=b.asm.Qr).apply(null,arguments)},gu=b._emscripten_bind_btSoftBodyArray_at_1=function(){return(gu=b._emscripten_bind_btSoftBodyArray_at_1=b.asm.Rr).apply(null,arguments)},hu=b._emscripten_bind_btSoftBodyArray___destroy___0= +function(){return(hu=b._emscripten_bind_btSoftBodyArray___destroy___0=b.asm.Sr).apply(null,arguments)},iu=b._emscripten_bind_btFaceArray_size_0=function(){return(iu=b._emscripten_bind_btFaceArray_size_0=b.asm.Tr).apply(null,arguments)},ju=b._emscripten_bind_btFaceArray_at_1=function(){return(ju=b._emscripten_bind_btFaceArray_at_1=b.asm.Ur).apply(null,arguments)},ku=b._emscripten_bind_btFaceArray___destroy___0=function(){return(ku=b._emscripten_bind_btFaceArray___destroy___0=b.asm.Vr).apply(null,arguments)}, +lu=b._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2=function(){return(lu=b._emscripten_bind_btStaticPlaneShape_btStaticPlaneShape_2=b.asm.Wr).apply(null,arguments)},mu=b._emscripten_bind_btStaticPlaneShape_setLocalScaling_1=function(){return(mu=b._emscripten_bind_btStaticPlaneShape_setLocalScaling_1=b.asm.Xr).apply(null,arguments)},nu=b._emscripten_bind_btStaticPlaneShape_getLocalScaling_0=function(){return(nu=b._emscripten_bind_btStaticPlaneShape_getLocalScaling_0=b.asm.Yr).apply(null, +arguments)},ou=b._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2=function(){return(ou=b._emscripten_bind_btStaticPlaneShape_calculateLocalInertia_2=b.asm.Zr).apply(null,arguments)},pu=b._emscripten_bind_btStaticPlaneShape___destroy___0=function(){return(pu=b._emscripten_bind_btStaticPlaneShape___destroy___0=b.asm._r).apply(null,arguments)},qu=b._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1=function(){return(qu=b._emscripten_bind_btOverlappingPairCache_setInternalGhostPairCallback_1= +b.asm.$r).apply(null,arguments)},ru=b._emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0=function(){return(ru=b._emscripten_bind_btOverlappingPairCache_getNumOverlappingPairs_0=b.asm.as).apply(null,arguments)},su=b._emscripten_bind_btOverlappingPairCache___destroy___0=function(){return(su=b._emscripten_bind_btOverlappingPairCache___destroy___0=b.asm.bs).apply(null,arguments)},tu=b._emscripten_bind_btIndexedMesh_get_m_numTriangles_0=function(){return(tu=b._emscripten_bind_btIndexedMesh_get_m_numTriangles_0= +b.asm.cs).apply(null,arguments)},uu=b._emscripten_bind_btIndexedMesh_set_m_numTriangles_1=function(){return(uu=b._emscripten_bind_btIndexedMesh_set_m_numTriangles_1=b.asm.ds).apply(null,arguments)},vu=b._emscripten_bind_btIndexedMesh___destroy___0=function(){return(vu=b._emscripten_bind_btIndexedMesh___destroy___0=b.asm.es).apply(null,arguments)},wu=b._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5=function(){return(wu=b._emscripten_bind_btSoftRigidDynamicsWorld_btSoftRigidDynamicsWorld_5= +b.asm.fs).apply(null,arguments)},xu=b._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3=function(){return(xu=b._emscripten_bind_btSoftRigidDynamicsWorld_addSoftBody_3=b.asm.gs).apply(null,arguments)},yu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1=function(){return(yu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeSoftBody_1=b.asm.hs).apply(null,arguments)},zu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1=function(){return(zu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeCollisionObject_1= +b.asm.is).apply(null,arguments)},Au=b._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0=function(){return(Au=b._emscripten_bind_btSoftRigidDynamicsWorld_getWorldInfo_0=b.asm.js).apply(null,arguments)},Bu=b._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0=function(){return(Bu=b._emscripten_bind_btSoftRigidDynamicsWorld_getSoftBodyArray_0=b.asm.ks).apply(null,arguments)},Cu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0=function(){return(Cu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDispatcher_0= +b.asm.ls).apply(null,arguments)},Du=b._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3=function(){return(Du=b._emscripten_bind_btSoftRigidDynamicsWorld_rayTest_3=b.asm.ms).apply(null,arguments)},Eu=b._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0=function(){return(Eu=b._emscripten_bind_btSoftRigidDynamicsWorld_getPairCache_0=b.asm.ns).apply(null,arguments)},Fu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0=function(){return(Fu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDispatchInfo_0= +b.asm.os).apply(null,arguments)},Gu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1=function(){return(Gu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_1=b.asm.ps).apply(null,arguments)},Hu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2=function(){return(Hu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_2=b.asm.qs).apply(null,arguments)},Iu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3=function(){return(Iu=b._emscripten_bind_btSoftRigidDynamicsWorld_addCollisionObject_3= +b.asm.rs).apply(null,arguments)},Ju=b._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0=function(){return(Ju=b._emscripten_bind_btSoftRigidDynamicsWorld_getBroadphase_0=b.asm.ss).apply(null,arguments)},Ku=b._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5=function(){return(Ku=b._emscripten_bind_btSoftRigidDynamicsWorld_convexSweepTest_5=b.asm.ts).apply(null,arguments)},Lu=b._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3=function(){return(Lu=b._emscripten_bind_btSoftRigidDynamicsWorld_contactPairTest_3= +b.asm.us).apply(null,arguments)},Mu=b._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2=function(){return(Mu=b._emscripten_bind_btSoftRigidDynamicsWorld_contactTest_2=b.asm.vs).apply(null,arguments)},Nu=b._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1=function(){return(Nu=b._emscripten_bind_btSoftRigidDynamicsWorld_updateSingleAabb_1=b.asm.ws).apply(null,arguments)},Ou=b._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1=function(){return(Ou=b._emscripten_bind_btSoftRigidDynamicsWorld_setDebugDrawer_1= +b.asm.xs).apply(null,arguments)},Pu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0=function(){return(Pu=b._emscripten_bind_btSoftRigidDynamicsWorld_getDebugDrawer_0=b.asm.ys).apply(null,arguments)},Qu=b._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0=function(){return(Qu=b._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawWorld_0=b.asm.zs).apply(null,arguments)},Ru=b._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3=function(){return(Ru=b._emscripten_bind_btSoftRigidDynamicsWorld_debugDrawObject_3= +b.asm.As).apply(null,arguments)},Su=b._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1=function(){return(Su=b._emscripten_bind_btSoftRigidDynamicsWorld_setGravity_1=b.asm.Bs).apply(null,arguments)},Tu=b._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0=function(){return(Tu=b._emscripten_bind_btSoftRigidDynamicsWorld_getGravity_0=b.asm.Cs).apply(null,arguments)},Uu=b._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1=function(){return(Uu=b._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_1= +b.asm.Ds).apply(null,arguments)},Vu=b._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3=function(){return(Vu=b._emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_3=b.asm.Es).apply(null,arguments)},Wu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1=function(){return(Wu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeRigidBody_1=b.asm.Fs).apply(null,arguments)},Xu=b._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1=function(){return(Xu=b._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_1= +b.asm.Gs).apply(null,arguments)},Yu=b._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2=function(){return(Yu=b._emscripten_bind_btSoftRigidDynamicsWorld_addConstraint_2=b.asm.Hs).apply(null,arguments)},Zu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1=function(){return(Zu=b._emscripten_bind_btSoftRigidDynamicsWorld_removeConstraint_1=b.asm.Is).apply(null,arguments)},$u=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1=function(){return($u=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_1= +b.asm.Js).apply(null,arguments)},av=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2=function(){return(av=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_2=b.asm.Ks).apply(null,arguments)},bv=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3=function(){return(bv=b._emscripten_bind_btSoftRigidDynamicsWorld_stepSimulation_3=b.asm.Ls).apply(null,arguments)},cv=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1=function(){return(cv=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactAddedCallback_1= +b.asm.Ms).apply(null,arguments)},dv=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1=function(){return(dv=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactProcessedCallback_1=b.asm.Ns).apply(null,arguments)},ev=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1=function(){return(ev=b._emscripten_bind_btSoftRigidDynamicsWorld_setContactDestroyedCallback_1=b.asm.Os).apply(null,arguments)},fv=b._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1= +function(){return(fv=b._emscripten_bind_btSoftRigidDynamicsWorld_addAction_1=b.asm.Ps).apply(null,arguments)},gv=b._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1=function(){return(gv=b._emscripten_bind_btSoftRigidDynamicsWorld_removeAction_1=b.asm.Qs).apply(null,arguments)},hv=b._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0=function(){return(hv=b._emscripten_bind_btSoftRigidDynamicsWorld_getSolverInfo_0=b.asm.Rs).apply(null,arguments)},iv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1= +function(){return(iv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_1=b.asm.Ss).apply(null,arguments)},jv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2=function(){return(jv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_2=b.asm.Ts).apply(null,arguments)},kv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3=function(){return(kv=b._emscripten_bind_btSoftRigidDynamicsWorld_setInternalTickCallback_3=b.asm.Us).apply(null, +arguments)},lv=b._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0=function(){return(lv=b._emscripten_bind_btSoftRigidDynamicsWorld___destroy___0=b.asm.Vs).apply(null,arguments)},mv=b._emscripten_bind_btFixedConstraint_btFixedConstraint_4=function(){return(mv=b._emscripten_bind_btFixedConstraint_btFixedConstraint_4=b.asm.Ws).apply(null,arguments)},nv=b._emscripten_bind_btFixedConstraint_enableFeedback_1=function(){return(nv=b._emscripten_bind_btFixedConstraint_enableFeedback_1=b.asm.Xs).apply(null, +arguments)},ov=b._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0=function(){return(ov=b._emscripten_bind_btFixedConstraint_getBreakingImpulseThreshold_0=b.asm.Ys).apply(null,arguments)},pv=b._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1=function(){return(pv=b._emscripten_bind_btFixedConstraint_setBreakingImpulseThreshold_1=b.asm.Zs).apply(null,arguments)},qv=b._emscripten_bind_btFixedConstraint_getParam_2=function(){return(qv=b._emscripten_bind_btFixedConstraint_getParam_2= +b.asm._s).apply(null,arguments)},rv=b._emscripten_bind_btFixedConstraint_setParam_3=function(){return(rv=b._emscripten_bind_btFixedConstraint_setParam_3=b.asm.$s).apply(null,arguments)},sv=b._emscripten_bind_btFixedConstraint___destroy___0=function(){return(sv=b._emscripten_bind_btFixedConstraint___destroy___0=b.asm.at).apply(null,arguments)},tv=b._emscripten_bind_btTransform_btTransform_0=function(){return(tv=b._emscripten_bind_btTransform_btTransform_0=b.asm.bt).apply(null,arguments)},uv=b._emscripten_bind_btTransform_btTransform_2= +function(){return(uv=b._emscripten_bind_btTransform_btTransform_2=b.asm.ct).apply(null,arguments)},vv=b._emscripten_bind_btTransform_setIdentity_0=function(){return(vv=b._emscripten_bind_btTransform_setIdentity_0=b.asm.dt).apply(null,arguments)},wv=b._emscripten_bind_btTransform_setOrigin_1=function(){return(wv=b._emscripten_bind_btTransform_setOrigin_1=b.asm.et).apply(null,arguments)},xv=b._emscripten_bind_btTransform_setRotation_1=function(){return(xv=b._emscripten_bind_btTransform_setRotation_1= +b.asm.ft).apply(null,arguments)},yv=b._emscripten_bind_btTransform_getOrigin_0=function(){return(yv=b._emscripten_bind_btTransform_getOrigin_0=b.asm.gt).apply(null,arguments)},zv=b._emscripten_bind_btTransform_getRotation_0=function(){return(zv=b._emscripten_bind_btTransform_getRotation_0=b.asm.ht).apply(null,arguments)},Av=b._emscripten_bind_btTransform_getBasis_0=function(){return(Av=b._emscripten_bind_btTransform_getBasis_0=b.asm.it).apply(null,arguments)},Bv=b._emscripten_bind_btTransform_setFromOpenGLMatrix_1= +function(){return(Bv=b._emscripten_bind_btTransform_setFromOpenGLMatrix_1=b.asm.jt).apply(null,arguments)},Cv=b._emscripten_bind_btTransform_inverse_0=function(){return(Cv=b._emscripten_bind_btTransform_inverse_0=b.asm.kt).apply(null,arguments)},Dv=b._emscripten_bind_btTransform_op_mul_1=function(){return(Dv=b._emscripten_bind_btTransform_op_mul_1=b.asm.lt).apply(null,arguments)},Ev=b._emscripten_bind_btTransform___destroy___0=function(){return(Ev=b._emscripten_bind_btTransform___destroy___0=b.asm.mt).apply(null, +arguments)},Fv=b._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2=function(){return(Fv=b._emscripten_bind_ClosestRayResultCallback_ClosestRayResultCallback_2=b.asm.nt).apply(null,arguments)},Gv=b._emscripten_bind_ClosestRayResultCallback_hasHit_0=function(){return(Gv=b._emscripten_bind_ClosestRayResultCallback_hasHit_0=b.asm.ot).apply(null,arguments)},Hv=b._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0=function(){return(Hv=b._emscripten_bind_ClosestRayResultCallback_get_m_rayFromWorld_0= +b.asm.pt).apply(null,arguments)},Iv=b._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1=function(){return(Iv=b._emscripten_bind_ClosestRayResultCallback_set_m_rayFromWorld_1=b.asm.qt).apply(null,arguments)},Jv=b._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0=function(){return(Jv=b._emscripten_bind_ClosestRayResultCallback_get_m_rayToWorld_0=b.asm.rt).apply(null,arguments)},Kv=b._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1=function(){return(Kv=b._emscripten_bind_ClosestRayResultCallback_set_m_rayToWorld_1= +b.asm.st).apply(null,arguments)},Lv=b._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0=function(){return(Lv=b._emscripten_bind_ClosestRayResultCallback_get_m_hitNormalWorld_0=b.asm.tt).apply(null,arguments)},Mv=b._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1=function(){return(Mv=b._emscripten_bind_ClosestRayResultCallback_set_m_hitNormalWorld_1=b.asm.ut).apply(null,arguments)},Nv=b._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0=function(){return(Nv= +b._emscripten_bind_ClosestRayResultCallback_get_m_hitPointWorld_0=b.asm.vt).apply(null,arguments)},Ov=b._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1=function(){return(Ov=b._emscripten_bind_ClosestRayResultCallback_set_m_hitPointWorld_1=b.asm.wt).apply(null,arguments)},Pv=b._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0=function(){return(Pv=b._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterGroup_0=b.asm.xt).apply(null,arguments)},Qv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1= +function(){return(Qv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterGroup_1=b.asm.yt).apply(null,arguments)},Rv=b._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0=function(){return(Rv=b._emscripten_bind_ClosestRayResultCallback_get_m_collisionFilterMask_0=b.asm.zt).apply(null,arguments)},Sv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1=function(){return(Sv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionFilterMask_1=b.asm.At).apply(null, +arguments)},Tv=b._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0=function(){return(Tv=b._emscripten_bind_ClosestRayResultCallback_get_m_closestHitFraction_0=b.asm.Bt).apply(null,arguments)},Uv=b._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1=function(){return(Uv=b._emscripten_bind_ClosestRayResultCallback_set_m_closestHitFraction_1=b.asm.Ct).apply(null,arguments)},Vv=b._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0=function(){return(Vv= +b._emscripten_bind_ClosestRayResultCallback_get_m_collisionObject_0=b.asm.Dt).apply(null,arguments)},Wv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1=function(){return(Wv=b._emscripten_bind_ClosestRayResultCallback_set_m_collisionObject_1=b.asm.Et).apply(null,arguments)},Xv=b._emscripten_bind_ClosestRayResultCallback___destroy___0=function(){return(Xv=b._emscripten_bind_ClosestRayResultCallback___destroy___0=b.asm.Ft).apply(null,arguments)},Yv=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0= +function(){return(Yv=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_0=b.asm.Gt).apply(null,arguments)},Zv=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1=function(){return(Zv=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration_btSoftBodyRigidBodyCollisionConfiguration_1=b.asm.Ht).apply(null,arguments)},$v=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0= +function(){return($v=b._emscripten_bind_btSoftBodyRigidBodyCollisionConfiguration___destroy___0=b.asm.It).apply(null,arguments)},aw=b._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0=function(){return(aw=b._emscripten_bind_ConcreteContactResultCallback_ConcreteContactResultCallback_0=b.asm.Jt).apply(null,arguments)},bw=b._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7=function(){return(bw=b._emscripten_bind_ConcreteContactResultCallback_addSingleResult_7= +b.asm.Kt).apply(null,arguments)},cw=b._emscripten_bind_ConcreteContactResultCallback___destroy___0=function(){return(cw=b._emscripten_bind_ConcreteContactResultCallback___destroy___0=b.asm.Lt).apply(null,arguments)},dw=b._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2=function(){return(dw=b._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_2=b.asm.Mt).apply(null,arguments)},ew=b._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3=function(){return(ew=b._emscripten_bind_btBvhTriangleMeshShape_btBvhTriangleMeshShape_3= +b.asm.Nt).apply(null,arguments)},fw=b._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1=function(){return(fw=b._emscripten_bind_btBvhTriangleMeshShape_setLocalScaling_1=b.asm.Ot).apply(null,arguments)},gw=b._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0=function(){return(gw=b._emscripten_bind_btBvhTriangleMeshShape_getLocalScaling_0=b.asm.Pt).apply(null,arguments)},hw=b._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2=function(){return(hw=b._emscripten_bind_btBvhTriangleMeshShape_calculateLocalInertia_2= +b.asm.Qt).apply(null,arguments)},iw=b._emscripten_bind_btBvhTriangleMeshShape___destroy___0=function(){return(iw=b._emscripten_bind_btBvhTriangleMeshShape___destroy___0=b.asm.Rt).apply(null,arguments)},jw=b._emscripten_bind_btConstCollisionObjectArray_size_0=function(){return(jw=b._emscripten_bind_btConstCollisionObjectArray_size_0=b.asm.St).apply(null,arguments)},kw=b._emscripten_bind_btConstCollisionObjectArray_at_1=function(){return(kw=b._emscripten_bind_btConstCollisionObjectArray_at_1=b.asm.Tt).apply(null, +arguments)},lw=b._emscripten_bind_btConstCollisionObjectArray___destroy___0=function(){return(lw=b._emscripten_bind_btConstCollisionObjectArray___destroy___0=b.asm.Ut).apply(null,arguments)},mw=b._emscripten_bind_btSliderConstraint_btSliderConstraint_3=function(){return(mw=b._emscripten_bind_btSliderConstraint_btSliderConstraint_3=b.asm.Vt).apply(null,arguments)},nw=b._emscripten_bind_btSliderConstraint_btSliderConstraint_5=function(){return(nw=b._emscripten_bind_btSliderConstraint_btSliderConstraint_5= +b.asm.Wt).apply(null,arguments)},ow=b._emscripten_bind_btSliderConstraint_setLowerLinLimit_1=function(){return(ow=b._emscripten_bind_btSliderConstraint_setLowerLinLimit_1=b.asm.Xt).apply(null,arguments)},pw=b._emscripten_bind_btSliderConstraint_setUpperLinLimit_1=function(){return(pw=b._emscripten_bind_btSliderConstraint_setUpperLinLimit_1=b.asm.Yt).apply(null,arguments)},qw=b._emscripten_bind_btSliderConstraint_setLowerAngLimit_1=function(){return(qw=b._emscripten_bind_btSliderConstraint_setLowerAngLimit_1= +b.asm.Zt).apply(null,arguments)},rw=b._emscripten_bind_btSliderConstraint_setUpperAngLimit_1=function(){return(rw=b._emscripten_bind_btSliderConstraint_setUpperAngLimit_1=b.asm._t).apply(null,arguments)},sw=b._emscripten_bind_btSliderConstraint_enableFeedback_1=function(){return(sw=b._emscripten_bind_btSliderConstraint_enableFeedback_1=b.asm.$t).apply(null,arguments)},tw=b._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0=function(){return(tw=b._emscripten_bind_btSliderConstraint_getBreakingImpulseThreshold_0= +b.asm.au).apply(null,arguments)},uw=b._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1=function(){return(uw=b._emscripten_bind_btSliderConstraint_setBreakingImpulseThreshold_1=b.asm.bu).apply(null,arguments)},vw=b._emscripten_bind_btSliderConstraint_getParam_2=function(){return(vw=b._emscripten_bind_btSliderConstraint_getParam_2=b.asm.cu).apply(null,arguments)},ww=b._emscripten_bind_btSliderConstraint_setParam_3=function(){return(ww=b._emscripten_bind_btSliderConstraint_setParam_3= +b.asm.du).apply(null,arguments)},xw=b._emscripten_bind_btSliderConstraint___destroy___0=function(){return(xw=b._emscripten_bind_btSliderConstraint___destroy___0=b.asm.eu).apply(null,arguments)},yw=b._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0=function(){return(yw=b._emscripten_bind_btPairCachingGhostObject_btPairCachingGhostObject_0=b.asm.fu).apply(null,arguments)},zw=b._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2=function(){return(zw=b._emscripten_bind_btPairCachingGhostObject_setAnisotropicFriction_2= +b.asm.gu).apply(null,arguments)},Aw=b._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0=function(){return(Aw=b._emscripten_bind_btPairCachingGhostObject_getCollisionShape_0=b.asm.hu).apply(null,arguments)},Bw=b._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1=function(){return(Bw=b._emscripten_bind_btPairCachingGhostObject_setContactProcessingThreshold_1=b.asm.iu).apply(null,arguments)},Cw=b._emscripten_bind_btPairCachingGhostObject_setActivationState_1=function(){return(Cw= +b._emscripten_bind_btPairCachingGhostObject_setActivationState_1=b.asm.ju).apply(null,arguments)},Dw=b._emscripten_bind_btPairCachingGhostObject_forceActivationState_1=function(){return(Dw=b._emscripten_bind_btPairCachingGhostObject_forceActivationState_1=b.asm.ku).apply(null,arguments)},Ew=b._emscripten_bind_btPairCachingGhostObject_activate_0=function(){return(Ew=b._emscripten_bind_btPairCachingGhostObject_activate_0=b.asm.lu).apply(null,arguments)},Fw=b._emscripten_bind_btPairCachingGhostObject_activate_1= +function(){return(Fw=b._emscripten_bind_btPairCachingGhostObject_activate_1=b.asm.mu).apply(null,arguments)},Gw=b._emscripten_bind_btPairCachingGhostObject_isActive_0=function(){return(Gw=b._emscripten_bind_btPairCachingGhostObject_isActive_0=b.asm.nu).apply(null,arguments)},Hw=b._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0=function(){return(Hw=b._emscripten_bind_btPairCachingGhostObject_isKinematicObject_0=b.asm.ou).apply(null,arguments)},Iw=b._emscripten_bind_btPairCachingGhostObject_isStaticObject_0= +function(){return(Iw=b._emscripten_bind_btPairCachingGhostObject_isStaticObject_0=b.asm.pu).apply(null,arguments)},Jw=b._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0=function(){return(Jw=b._emscripten_bind_btPairCachingGhostObject_isStaticOrKinematicObject_0=b.asm.qu).apply(null,arguments)},Kw=b._emscripten_bind_btPairCachingGhostObject_getRestitution_0=function(){return(Kw=b._emscripten_bind_btPairCachingGhostObject_getRestitution_0=b.asm.ru).apply(null,arguments)},Lw=b._emscripten_bind_btPairCachingGhostObject_getFriction_0= +function(){return(Lw=b._emscripten_bind_btPairCachingGhostObject_getFriction_0=b.asm.su).apply(null,arguments)},Mw=b._emscripten_bind_btPairCachingGhostObject_getRollingFriction_0=function(){return(Mw=b._emscripten_bind_btPairCachingGhostObject_getRollingFriction_0=b.asm.tu).apply(null,arguments)},Nw=b._emscripten_bind_btPairCachingGhostObject_setRestitution_1=function(){return(Nw=b._emscripten_bind_btPairCachingGhostObject_setRestitution_1=b.asm.uu).apply(null,arguments)},Ow=b._emscripten_bind_btPairCachingGhostObject_setFriction_1= +function(){return(Ow=b._emscripten_bind_btPairCachingGhostObject_setFriction_1=b.asm.vu).apply(null,arguments)},Pw=b._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1=function(){return(Pw=b._emscripten_bind_btPairCachingGhostObject_setRollingFriction_1=b.asm.wu).apply(null,arguments)},Qw=b._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0=function(){return(Qw=b._emscripten_bind_btPairCachingGhostObject_getWorldTransform_0=b.asm.xu).apply(null,arguments)},Rw=b._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0= +function(){return(Rw=b._emscripten_bind_btPairCachingGhostObject_getCollisionFlags_0=b.asm.yu).apply(null,arguments)},Sw=b._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1=function(){return(Sw=b._emscripten_bind_btPairCachingGhostObject_setCollisionFlags_1=b.asm.zu).apply(null,arguments)},Tw=b._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1=function(){return(Tw=b._emscripten_bind_btPairCachingGhostObject_setWorldTransform_1=b.asm.Au).apply(null,arguments)},Uw=b._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1= +function(){return(Uw=b._emscripten_bind_btPairCachingGhostObject_setCollisionShape_1=b.asm.Bu).apply(null,arguments)},Vw=b._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1=function(){return(Vw=b._emscripten_bind_btPairCachingGhostObject_setCcdMotionThreshold_1=b.asm.Cu).apply(null,arguments)},Ww=b._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1=function(){return(Ww=b._emscripten_bind_btPairCachingGhostObject_setCcdSweptSphereRadius_1=b.asm.Du).apply(null,arguments)}, +Xw=b._emscripten_bind_btPairCachingGhostObject_getUserIndex_0=function(){return(Xw=b._emscripten_bind_btPairCachingGhostObject_getUserIndex_0=b.asm.Eu).apply(null,arguments)},Yw=b._emscripten_bind_btPairCachingGhostObject_setUserIndex_1=function(){return(Yw=b._emscripten_bind_btPairCachingGhostObject_setUserIndex_1=b.asm.Fu).apply(null,arguments)},Zw=b._emscripten_bind_btPairCachingGhostObject_getUserPointer_0=function(){return(Zw=b._emscripten_bind_btPairCachingGhostObject_getUserPointer_0=b.asm.Gu).apply(null, +arguments)},$w=b._emscripten_bind_btPairCachingGhostObject_setUserPointer_1=function(){return($w=b._emscripten_bind_btPairCachingGhostObject_setUserPointer_1=b.asm.Hu).apply(null,arguments)},ax=b._emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0=function(){return(ax=b._emscripten_bind_btPairCachingGhostObject_getBroadphaseHandle_0=b.asm.Iu).apply(null,arguments)},bx=b._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0=function(){return(bx=b._emscripten_bind_btPairCachingGhostObject_getNumOverlappingObjects_0= +b.asm.Ju).apply(null,arguments)},cx=b._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1=function(){return(cx=b._emscripten_bind_btPairCachingGhostObject_getOverlappingObject_1=b.asm.Ku).apply(null,arguments)},dx=b._emscripten_bind_btPairCachingGhostObject___destroy___0=function(){return(dx=b._emscripten_bind_btPairCachingGhostObject___destroy___0=b.asm.Lu).apply(null,arguments)},ex=b._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0=function(){return(ex=b._emscripten_bind_btManifoldPoint_getPositionWorldOnA_0= +b.asm.Mu).apply(null,arguments)},fx=b._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0=function(){return(fx=b._emscripten_bind_btManifoldPoint_getPositionWorldOnB_0=b.asm.Nu).apply(null,arguments)},gx=b._emscripten_bind_btManifoldPoint_getAppliedImpulse_0=function(){return(gx=b._emscripten_bind_btManifoldPoint_getAppliedImpulse_0=b.asm.Ou).apply(null,arguments)},hx=b._emscripten_bind_btManifoldPoint_getDistance_0=function(){return(hx=b._emscripten_bind_btManifoldPoint_getDistance_0=b.asm.Pu).apply(null, +arguments)},ix=b._emscripten_bind_btManifoldPoint_get_m_localPointA_0=function(){return(ix=b._emscripten_bind_btManifoldPoint_get_m_localPointA_0=b.asm.Qu).apply(null,arguments)},jx=b._emscripten_bind_btManifoldPoint_set_m_localPointA_1=function(){return(jx=b._emscripten_bind_btManifoldPoint_set_m_localPointA_1=b.asm.Ru).apply(null,arguments)},kx=b._emscripten_bind_btManifoldPoint_get_m_localPointB_0=function(){return(kx=b._emscripten_bind_btManifoldPoint_get_m_localPointB_0=b.asm.Su).apply(null, +arguments)},lx=b._emscripten_bind_btManifoldPoint_set_m_localPointB_1=function(){return(lx=b._emscripten_bind_btManifoldPoint_set_m_localPointB_1=b.asm.Tu).apply(null,arguments)},mx=b._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0=function(){return(mx=b._emscripten_bind_btManifoldPoint_get_m_positionWorldOnB_0=b.asm.Uu).apply(null,arguments)},nx=b._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1=function(){return(nx=b._emscripten_bind_btManifoldPoint_set_m_positionWorldOnB_1=b.asm.Vu).apply(null, +arguments)},ox=b._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0=function(){return(ox=b._emscripten_bind_btManifoldPoint_get_m_positionWorldOnA_0=b.asm.Wu).apply(null,arguments)},px=b._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1=function(){return(px=b._emscripten_bind_btManifoldPoint_set_m_positionWorldOnA_1=b.asm.Xu).apply(null,arguments)},qx=b._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0=function(){return(qx=b._emscripten_bind_btManifoldPoint_get_m_normalWorldOnB_0= +b.asm.Yu).apply(null,arguments)},rx=b._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1=function(){return(rx=b._emscripten_bind_btManifoldPoint_set_m_normalWorldOnB_1=b.asm.Zu).apply(null,arguments)},sx=b._emscripten_bind_btManifoldPoint_get_m_userPersistentData_0=function(){return(sx=b._emscripten_bind_btManifoldPoint_get_m_userPersistentData_0=b.asm._u).apply(null,arguments)},tx=b._emscripten_bind_btManifoldPoint_set_m_userPersistentData_1=function(){return(tx=b._emscripten_bind_btManifoldPoint_set_m_userPersistentData_1= +b.asm.$u).apply(null,arguments)},ux=b._emscripten_bind_btManifoldPoint___destroy___0=function(){return(ux=b._emscripten_bind_btManifoldPoint___destroy___0=b.asm.av).apply(null,arguments)},vx=b._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2=function(){return(vx=b._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_2=b.asm.bv).apply(null,arguments)},wx=b._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4=function(){return(wx=b._emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_4= +b.asm.cv).apply(null,arguments)},xx=b._emscripten_bind_btPoint2PointConstraint_setPivotA_1=function(){return(xx=b._emscripten_bind_btPoint2PointConstraint_setPivotA_1=b.asm.dv).apply(null,arguments)},yx=b._emscripten_bind_btPoint2PointConstraint_setPivotB_1=function(){return(yx=b._emscripten_bind_btPoint2PointConstraint_setPivotB_1=b.asm.ev).apply(null,arguments)},zx=b._emscripten_bind_btPoint2PointConstraint_getPivotInA_0=function(){return(zx=b._emscripten_bind_btPoint2PointConstraint_getPivotInA_0= +b.asm.fv).apply(null,arguments)},Ax=b._emscripten_bind_btPoint2PointConstraint_getPivotInB_0=function(){return(Ax=b._emscripten_bind_btPoint2PointConstraint_getPivotInB_0=b.asm.gv).apply(null,arguments)},Bx=b._emscripten_bind_btPoint2PointConstraint_enableFeedback_1=function(){return(Bx=b._emscripten_bind_btPoint2PointConstraint_enableFeedback_1=b.asm.hv).apply(null,arguments)},Cx=b._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0=function(){return(Cx=b._emscripten_bind_btPoint2PointConstraint_getBreakingImpulseThreshold_0= +b.asm.iv).apply(null,arguments)},Dx=b._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1=function(){return(Dx=b._emscripten_bind_btPoint2PointConstraint_setBreakingImpulseThreshold_1=b.asm.jv).apply(null,arguments)},Ex=b._emscripten_bind_btPoint2PointConstraint_getParam_2=function(){return(Ex=b._emscripten_bind_btPoint2PointConstraint_getParam_2=b.asm.kv).apply(null,arguments)},Fx=b._emscripten_bind_btPoint2PointConstraint_setParam_3=function(){return(Fx=b._emscripten_bind_btPoint2PointConstraint_setParam_3= +b.asm.lv).apply(null,arguments)},Gx=b._emscripten_bind_btPoint2PointConstraint_get_m_setting_0=function(){return(Gx=b._emscripten_bind_btPoint2PointConstraint_get_m_setting_0=b.asm.mv).apply(null,arguments)},Hx=b._emscripten_bind_btPoint2PointConstraint_set_m_setting_1=function(){return(Hx=b._emscripten_bind_btPoint2PointConstraint_set_m_setting_1=b.asm.nv).apply(null,arguments)},Ix=b._emscripten_bind_btPoint2PointConstraint___destroy___0=function(){return(Ix=b._emscripten_bind_btPoint2PointConstraint___destroy___0= +b.asm.ov).apply(null,arguments)},Jx=b._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0=function(){return(Jx=b._emscripten_bind_btSoftBodyHelpers_btSoftBodyHelpers_0=b.asm.pv).apply(null,arguments)},Kx=b._emscripten_bind_btSoftBodyHelpers_CreateRope_5=function(){return(Kx=b._emscripten_bind_btSoftBodyHelpers_CreateRope_5=b.asm.qv).apply(null,arguments)},Lx=b._emscripten_bind_btSoftBodyHelpers_CreatePatch_9=function(){return(Lx=b._emscripten_bind_btSoftBodyHelpers_CreatePatch_9=b.asm.rv).apply(null, +arguments)},Mx=b._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10=function(){return(Mx=b._emscripten_bind_btSoftBodyHelpers_CreatePatchUV_10=b.asm.sv).apply(null,arguments)},Nx=b._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4=function(){return(Nx=b._emscripten_bind_btSoftBodyHelpers_CreateEllipsoid_4=b.asm.tv).apply(null,arguments)},Ox=b._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5=function(){return(Ox=b._emscripten_bind_btSoftBodyHelpers_CreateFromTriMesh_5=b.asm.uv).apply(null, +arguments)},Px=b._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4=function(){return(Px=b._emscripten_bind_btSoftBodyHelpers_CreateFromConvexHull_4=b.asm.vv).apply(null,arguments)},Qx=b._emscripten_bind_btSoftBodyHelpers___destroy___0=function(){return(Qx=b._emscripten_bind_btSoftBodyHelpers___destroy___0=b.asm.wv).apply(null,arguments)},Rx=b._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0=function(){return(Rx=b._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterGroup_0= +b.asm.xv).apply(null,arguments)},Sx=b._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1=function(){return(Sx=b._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterGroup_1=b.asm.yv).apply(null,arguments)},Tx=b._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0=function(){return(Tx=b._emscripten_bind_btBroadphaseProxy_get_m_collisionFilterMask_0=b.asm.zv).apply(null,arguments)},Ux=b._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1=function(){return(Ux=b._emscripten_bind_btBroadphaseProxy_set_m_collisionFilterMask_1= +b.asm.Av).apply(null,arguments)},Vx=b._emscripten_bind_btBroadphaseProxy___destroy___0=function(){return(Vx=b._emscripten_bind_btBroadphaseProxy___destroy___0=b.asm.Bv).apply(null,arguments)},Wx=b._emscripten_bind_tNodeArray_size_0=function(){return(Wx=b._emscripten_bind_tNodeArray_size_0=b.asm.Cv).apply(null,arguments)},Xx=b._emscripten_bind_tNodeArray_at_1=function(){return(Xx=b._emscripten_bind_tNodeArray_at_1=b.asm.Dv).apply(null,arguments)},Yx=b._emscripten_bind_tNodeArray___destroy___0=function(){return(Yx= +b._emscripten_bind_tNodeArray___destroy___0=b.asm.Ev).apply(null,arguments)},Zx=b._emscripten_bind_btBoxShape_btBoxShape_1=function(){return(Zx=b._emscripten_bind_btBoxShape_btBoxShape_1=b.asm.Fv).apply(null,arguments)},$x=b._emscripten_bind_btBoxShape_setMargin_1=function(){return($x=b._emscripten_bind_btBoxShape_setMargin_1=b.asm.Gv).apply(null,arguments)},ay=b._emscripten_bind_btBoxShape_getMargin_0=function(){return(ay=b._emscripten_bind_btBoxShape_getMargin_0=b.asm.Hv).apply(null,arguments)}, +by=b._emscripten_bind_btBoxShape_setLocalScaling_1=function(){return(by=b._emscripten_bind_btBoxShape_setLocalScaling_1=b.asm.Iv).apply(null,arguments)},cy=b._emscripten_bind_btBoxShape_getLocalScaling_0=function(){return(cy=b._emscripten_bind_btBoxShape_getLocalScaling_0=b.asm.Jv).apply(null,arguments)},dy=b._emscripten_bind_btBoxShape_calculateLocalInertia_2=function(){return(dy=b._emscripten_bind_btBoxShape_calculateLocalInertia_2=b.asm.Kv).apply(null,arguments)},ey=b._emscripten_bind_btBoxShape___destroy___0= +function(){return(ey=b._emscripten_bind_btBoxShape___destroy___0=b.asm.Lv).apply(null,arguments)},fy=b._emscripten_bind_btFace_get_m_indices_0=function(){return(fy=b._emscripten_bind_btFace_get_m_indices_0=b.asm.Mv).apply(null,arguments)},gy=b._emscripten_bind_btFace_set_m_indices_1=function(){return(gy=b._emscripten_bind_btFace_set_m_indices_1=b.asm.Nv).apply(null,arguments)},hy=b._emscripten_bind_btFace_get_m_plane_1=function(){return(hy=b._emscripten_bind_btFace_get_m_plane_1=b.asm.Ov).apply(null, +arguments)},iy=b._emscripten_bind_btFace_set_m_plane_2=function(){return(iy=b._emscripten_bind_btFace_set_m_plane_2=b.asm.Pv).apply(null,arguments)},jy=b._emscripten_bind_btFace___destroy___0=function(){return(jy=b._emscripten_bind_btFace___destroy___0=b.asm.Qv).apply(null,arguments)},ky=b._emscripten_bind_DebugDrawer_DebugDrawer_0=function(){return(ky=b._emscripten_bind_DebugDrawer_DebugDrawer_0=b.asm.Rv).apply(null,arguments)},ly=b._emscripten_bind_DebugDrawer_drawLine_3=function(){return(ly=b._emscripten_bind_DebugDrawer_drawLine_3= +b.asm.Sv).apply(null,arguments)},my=b._emscripten_bind_DebugDrawer_drawContactPoint_5=function(){return(my=b._emscripten_bind_DebugDrawer_drawContactPoint_5=b.asm.Tv).apply(null,arguments)},ny=b._emscripten_bind_DebugDrawer_reportErrorWarning_1=function(){return(ny=b._emscripten_bind_DebugDrawer_reportErrorWarning_1=b.asm.Uv).apply(null,arguments)},oy=b._emscripten_bind_DebugDrawer_draw3dText_2=function(){return(oy=b._emscripten_bind_DebugDrawer_draw3dText_2=b.asm.Vv).apply(null,arguments)},py=b._emscripten_bind_DebugDrawer_setDebugMode_1= +function(){return(py=b._emscripten_bind_DebugDrawer_setDebugMode_1=b.asm.Wv).apply(null,arguments)},qy=b._emscripten_bind_DebugDrawer_getDebugMode_0=function(){return(qy=b._emscripten_bind_DebugDrawer_getDebugMode_0=b.asm.Xv).apply(null,arguments)},ry=b._emscripten_bind_DebugDrawer___destroy___0=function(){return(ry=b._emscripten_bind_DebugDrawer___destroy___0=b.asm.Yv).apply(null,arguments)},sy=b._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2=function(){return(sy=b._emscripten_bind_btCapsuleShapeX_btCapsuleShapeX_2= +b.asm.Zv).apply(null,arguments)},ty=b._emscripten_bind_btCapsuleShapeX_setMargin_1=function(){return(ty=b._emscripten_bind_btCapsuleShapeX_setMargin_1=b.asm._v).apply(null,arguments)},uy=b._emscripten_bind_btCapsuleShapeX_getMargin_0=function(){return(uy=b._emscripten_bind_btCapsuleShapeX_getMargin_0=b.asm.$v).apply(null,arguments)},vy=b._emscripten_bind_btCapsuleShapeX_getUpAxis_0=function(){return(vy=b._emscripten_bind_btCapsuleShapeX_getUpAxis_0=b.asm.aw).apply(null,arguments)},wy=b._emscripten_bind_btCapsuleShapeX_getRadius_0= +function(){return(wy=b._emscripten_bind_btCapsuleShapeX_getRadius_0=b.asm.bw).apply(null,arguments)},xy=b._emscripten_bind_btCapsuleShapeX_getHalfHeight_0=function(){return(xy=b._emscripten_bind_btCapsuleShapeX_getHalfHeight_0=b.asm.cw).apply(null,arguments)},yy=b._emscripten_bind_btCapsuleShapeX_setLocalScaling_1=function(){return(yy=b._emscripten_bind_btCapsuleShapeX_setLocalScaling_1=b.asm.dw).apply(null,arguments)},zy=b._emscripten_bind_btCapsuleShapeX_getLocalScaling_0=function(){return(zy=b._emscripten_bind_btCapsuleShapeX_getLocalScaling_0= +b.asm.ew).apply(null,arguments)},Ay=b._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2=function(){return(Ay=b._emscripten_bind_btCapsuleShapeX_calculateLocalInertia_2=b.asm.fw).apply(null,arguments)},By=b._emscripten_bind_btCapsuleShapeX___destroy___0=function(){return(By=b._emscripten_bind_btCapsuleShapeX___destroy___0=b.asm.gw).apply(null,arguments)},Cy=b._emscripten_bind_btQuaternion_btQuaternion_4=function(){return(Cy=b._emscripten_bind_btQuaternion_btQuaternion_4=b.asm.hw).apply(null, +arguments)},Dy=b._emscripten_bind_btQuaternion_setValue_4=function(){return(Dy=b._emscripten_bind_btQuaternion_setValue_4=b.asm.iw).apply(null,arguments)},Ey=b._emscripten_bind_btQuaternion_setEulerZYX_3=function(){return(Ey=b._emscripten_bind_btQuaternion_setEulerZYX_3=b.asm.jw).apply(null,arguments)},Fy=b._emscripten_bind_btQuaternion_setRotation_2=function(){return(Fy=b._emscripten_bind_btQuaternion_setRotation_2=b.asm.kw).apply(null,arguments)},Gy=b._emscripten_bind_btQuaternion_normalize_0=function(){return(Gy= +b._emscripten_bind_btQuaternion_normalize_0=b.asm.lw).apply(null,arguments)},Hy=b._emscripten_bind_btQuaternion_length2_0=function(){return(Hy=b._emscripten_bind_btQuaternion_length2_0=b.asm.mw).apply(null,arguments)},Iy=b._emscripten_bind_btQuaternion_length_0=function(){return(Iy=b._emscripten_bind_btQuaternion_length_0=b.asm.nw).apply(null,arguments)},Jy=b._emscripten_bind_btQuaternion_dot_1=function(){return(Jy=b._emscripten_bind_btQuaternion_dot_1=b.asm.ow).apply(null,arguments)},Ky=b._emscripten_bind_btQuaternion_normalized_0= +function(){return(Ky=b._emscripten_bind_btQuaternion_normalized_0=b.asm.pw).apply(null,arguments)},Ly=b._emscripten_bind_btQuaternion_getAxis_0=function(){return(Ly=b._emscripten_bind_btQuaternion_getAxis_0=b.asm.qw).apply(null,arguments)},My=b._emscripten_bind_btQuaternion_inverse_0=function(){return(My=b._emscripten_bind_btQuaternion_inverse_0=b.asm.rw).apply(null,arguments)},Ny=b._emscripten_bind_btQuaternion_getAngle_0=function(){return(Ny=b._emscripten_bind_btQuaternion_getAngle_0=b.asm.sw).apply(null, +arguments)},Oy=b._emscripten_bind_btQuaternion_getAngleShortestPath_0=function(){return(Oy=b._emscripten_bind_btQuaternion_getAngleShortestPath_0=b.asm.tw).apply(null,arguments)},Py=b._emscripten_bind_btQuaternion_angle_1=function(){return(Py=b._emscripten_bind_btQuaternion_angle_1=b.asm.uw).apply(null,arguments)},Qy=b._emscripten_bind_btQuaternion_angleShortestPath_1=function(){return(Qy=b._emscripten_bind_btQuaternion_angleShortestPath_1=b.asm.vw).apply(null,arguments)},Ry=b._emscripten_bind_btQuaternion_op_add_1= +function(){return(Ry=b._emscripten_bind_btQuaternion_op_add_1=b.asm.ww).apply(null,arguments)},Sy=b._emscripten_bind_btQuaternion_op_sub_1=function(){return(Sy=b._emscripten_bind_btQuaternion_op_sub_1=b.asm.xw).apply(null,arguments)},Ty=b._emscripten_bind_btQuaternion_op_mul_1=function(){return(Ty=b._emscripten_bind_btQuaternion_op_mul_1=b.asm.yw).apply(null,arguments)},Uy=b._emscripten_bind_btQuaternion_op_mulq_1=function(){return(Uy=b._emscripten_bind_btQuaternion_op_mulq_1=b.asm.zw).apply(null, +arguments)},Vy=b._emscripten_bind_btQuaternion_op_div_1=function(){return(Vy=b._emscripten_bind_btQuaternion_op_div_1=b.asm.Aw).apply(null,arguments)},Wy=b._emscripten_bind_btQuaternion_x_0=function(){return(Wy=b._emscripten_bind_btQuaternion_x_0=b.asm.Bw).apply(null,arguments)},Xy=b._emscripten_bind_btQuaternion_y_0=function(){return(Xy=b._emscripten_bind_btQuaternion_y_0=b.asm.Cw).apply(null,arguments)},Yy=b._emscripten_bind_btQuaternion_z_0=function(){return(Yy=b._emscripten_bind_btQuaternion_z_0= +b.asm.Dw).apply(null,arguments)},Zy=b._emscripten_bind_btQuaternion_w_0=function(){return(Zy=b._emscripten_bind_btQuaternion_w_0=b.asm.Ew).apply(null,arguments)},$y=b._emscripten_bind_btQuaternion_setX_1=function(){return($y=b._emscripten_bind_btQuaternion_setX_1=b.asm.Fw).apply(null,arguments)},az=b._emscripten_bind_btQuaternion_setY_1=function(){return(az=b._emscripten_bind_btQuaternion_setY_1=b.asm.Gw).apply(null,arguments)},bz=b._emscripten_bind_btQuaternion_setZ_1=function(){return(bz=b._emscripten_bind_btQuaternion_setZ_1= +b.asm.Hw).apply(null,arguments)},cz=b._emscripten_bind_btQuaternion_setW_1=function(){return(cz=b._emscripten_bind_btQuaternion_setW_1=b.asm.Iw).apply(null,arguments)},dz=b._emscripten_bind_btQuaternion___destroy___0=function(){return(dz=b._emscripten_bind_btQuaternion___destroy___0=b.asm.Jw).apply(null,arguments)},ez=b._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2=function(){return(ez=b._emscripten_bind_btCapsuleShapeZ_btCapsuleShapeZ_2=b.asm.Kw).apply(null,arguments)},fz=b._emscripten_bind_btCapsuleShapeZ_setMargin_1= +function(){return(fz=b._emscripten_bind_btCapsuleShapeZ_setMargin_1=b.asm.Lw).apply(null,arguments)},gz=b._emscripten_bind_btCapsuleShapeZ_getMargin_0=function(){return(gz=b._emscripten_bind_btCapsuleShapeZ_getMargin_0=b.asm.Mw).apply(null,arguments)},hz=b._emscripten_bind_btCapsuleShapeZ_getUpAxis_0=function(){return(hz=b._emscripten_bind_btCapsuleShapeZ_getUpAxis_0=b.asm.Nw).apply(null,arguments)},iz=b._emscripten_bind_btCapsuleShapeZ_getRadius_0=function(){return(iz=b._emscripten_bind_btCapsuleShapeZ_getRadius_0= +b.asm.Ow).apply(null,arguments)},jz=b._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0=function(){return(jz=b._emscripten_bind_btCapsuleShapeZ_getHalfHeight_0=b.asm.Pw).apply(null,arguments)},kz=b._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1=function(){return(kz=b._emscripten_bind_btCapsuleShapeZ_setLocalScaling_1=b.asm.Qw).apply(null,arguments)},lz=b._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0=function(){return(lz=b._emscripten_bind_btCapsuleShapeZ_getLocalScaling_0=b.asm.Rw).apply(null, +arguments)},mz=b._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2=function(){return(mz=b._emscripten_bind_btCapsuleShapeZ_calculateLocalInertia_2=b.asm.Sw).apply(null,arguments)},nz=b._emscripten_bind_btCapsuleShapeZ___destroy___0=function(){return(nz=b._emscripten_bind_btCapsuleShapeZ___destroy___0=b.asm.Tw).apply(null,arguments)},oz=b._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0=function(){return(oz=b._emscripten_bind_btContactSolverInfo_get_m_splitImpulse_0=b.asm.Uw).apply(null, +arguments)},pz=b._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1=function(){return(pz=b._emscripten_bind_btContactSolverInfo_set_m_splitImpulse_1=b.asm.Vw).apply(null,arguments)},qz=b._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0=function(){return(qz=b._emscripten_bind_btContactSolverInfo_get_m_splitImpulsePenetrationThreshold_0=b.asm.Ww).apply(null,arguments)},rz=b._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1=function(){return(rz= +b._emscripten_bind_btContactSolverInfo_set_m_splitImpulsePenetrationThreshold_1=b.asm.Xw).apply(null,arguments)},sz=b._emscripten_bind_btContactSolverInfo_get_m_numIterations_0=function(){return(sz=b._emscripten_bind_btContactSolverInfo_get_m_numIterations_0=b.asm.Yw).apply(null,arguments)},tz=b._emscripten_bind_btContactSolverInfo_set_m_numIterations_1=function(){return(tz=b._emscripten_bind_btContactSolverInfo_set_m_numIterations_1=b.asm.Zw).apply(null,arguments)},uz=b._emscripten_bind_btContactSolverInfo___destroy___0= +function(){return(uz=b._emscripten_bind_btContactSolverInfo___destroy___0=b.asm._w).apply(null,arguments)},vz=b._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3=function(){return(vz=b._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_3=b.asm.$w).apply(null,arguments)},wz=b._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5=function(){return(wz=b._emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_5= +b.asm.ax).apply(null,arguments)},xz=b._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2=function(){return(xz=b._emscripten_bind_btGeneric6DofSpringConstraint_enableSpring_2=b.asm.bx).apply(null,arguments)},yz=b._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2=function(){return(yz=b._emscripten_bind_btGeneric6DofSpringConstraint_setStiffness_2=b.asm.cx).apply(null,arguments)},zz=b._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2=function(){return(zz=b._emscripten_bind_btGeneric6DofSpringConstraint_setDamping_2= +b.asm.dx).apply(null,arguments)},Az=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0=function(){return(Az=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_0=b.asm.ex).apply(null,arguments)},Bz=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1=function(){return(Bz=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_1=b.asm.fx).apply(null,arguments)},Cz=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2= +function(){return(Cz=b._emscripten_bind_btGeneric6DofSpringConstraint_setEquilibriumPoint_2=b.asm.gx).apply(null,arguments)},Dz=b._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1=function(){return(Dz=b._emscripten_bind_btGeneric6DofSpringConstraint_setLinearLowerLimit_1=b.asm.hx).apply(null,arguments)},Ez=b._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1=function(){return(Ez=b._emscripten_bind_btGeneric6DofSpringConstraint_setLinearUpperLimit_1=b.asm.ix).apply(null, +arguments)},Fz=b._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1=function(){return(Fz=b._emscripten_bind_btGeneric6DofSpringConstraint_setAngularLowerLimit_1=b.asm.jx).apply(null,arguments)},Gz=b._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1=function(){return(Gz=b._emscripten_bind_btGeneric6DofSpringConstraint_setAngularUpperLimit_1=b.asm.kx).apply(null,arguments)},Hz=b._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0=function(){return(Hz= +b._emscripten_bind_btGeneric6DofSpringConstraint_getFrameOffsetA_0=b.asm.lx).apply(null,arguments)},Iz=b._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1=function(){return(Iz=b._emscripten_bind_btGeneric6DofSpringConstraint_enableFeedback_1=b.asm.mx).apply(null,arguments)},Jz=b._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0=function(){return(Jz=b._emscripten_bind_btGeneric6DofSpringConstraint_getBreakingImpulseThreshold_0=b.asm.nx).apply(null,arguments)}, +Kz=b._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1=function(){return(Kz=b._emscripten_bind_btGeneric6DofSpringConstraint_setBreakingImpulseThreshold_1=b.asm.ox).apply(null,arguments)},Lz=b._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2=function(){return(Lz=b._emscripten_bind_btGeneric6DofSpringConstraint_getParam_2=b.asm.px).apply(null,arguments)},Mz=b._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3=function(){return(Mz=b._emscripten_bind_btGeneric6DofSpringConstraint_setParam_3= +b.asm.qx).apply(null,arguments)},Nz=b._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0=function(){return(Nz=b._emscripten_bind_btGeneric6DofSpringConstraint___destroy___0=b.asm.rx).apply(null,arguments)},Oz=b._emscripten_bind_btSphereShape_btSphereShape_1=function(){return(Oz=b._emscripten_bind_btSphereShape_btSphereShape_1=b.asm.sx).apply(null,arguments)},Pz=b._emscripten_bind_btSphereShape_setMargin_1=function(){return(Pz=b._emscripten_bind_btSphereShape_setMargin_1=b.asm.tx).apply(null, +arguments)},Qz=b._emscripten_bind_btSphereShape_getMargin_0=function(){return(Qz=b._emscripten_bind_btSphereShape_getMargin_0=b.asm.ux).apply(null,arguments)},Rz=b._emscripten_bind_btSphereShape_setLocalScaling_1=function(){return(Rz=b._emscripten_bind_btSphereShape_setLocalScaling_1=b.asm.vx).apply(null,arguments)},Sz=b._emscripten_bind_btSphereShape_getLocalScaling_0=function(){return(Sz=b._emscripten_bind_btSphereShape_getLocalScaling_0=b.asm.wx).apply(null,arguments)},Tz=b._emscripten_bind_btSphereShape_calculateLocalInertia_2= +function(){return(Tz=b._emscripten_bind_btSphereShape_calculateLocalInertia_2=b.asm.xx).apply(null,arguments)},Uz=b._emscripten_bind_btSphereShape___destroy___0=function(){return(Uz=b._emscripten_bind_btSphereShape___destroy___0=b.asm.yx).apply(null,arguments)},Vz=b._emscripten_bind_Face_get_m_n_1=function(){return(Vz=b._emscripten_bind_Face_get_m_n_1=b.asm.zx).apply(null,arguments)},Wz=b._emscripten_bind_Face_set_m_n_2=function(){return(Wz=b._emscripten_bind_Face_set_m_n_2=b.asm.Ax).apply(null,arguments)}, +Xz=b._emscripten_bind_Face_get_m_normal_0=function(){return(Xz=b._emscripten_bind_Face_get_m_normal_0=b.asm.Bx).apply(null,arguments)},Yz=b._emscripten_bind_Face_set_m_normal_1=function(){return(Yz=b._emscripten_bind_Face_set_m_normal_1=b.asm.Cx).apply(null,arguments)},Zz=b._emscripten_bind_Face_get_m_ra_0=function(){return(Zz=b._emscripten_bind_Face_get_m_ra_0=b.asm.Dx).apply(null,arguments)},$z=b._emscripten_bind_Face_set_m_ra_1=function(){return($z=b._emscripten_bind_Face_set_m_ra_1=b.asm.Ex).apply(null, +arguments)},aA=b._emscripten_bind_Face___destroy___0=function(){return(aA=b._emscripten_bind_Face___destroy___0=b.asm.Fx).apply(null,arguments)},bA=b._emscripten_bind_tFaceArray_size_0=function(){return(bA=b._emscripten_bind_tFaceArray_size_0=b.asm.Gx).apply(null,arguments)},cA=b._emscripten_bind_tFaceArray_at_1=function(){return(cA=b._emscripten_bind_tFaceArray_at_1=b.asm.Hx).apply(null,arguments)},dA=b._emscripten_bind_tFaceArray___destroy___0=function(){return(dA=b._emscripten_bind_tFaceArray___destroy___0= +b.asm.Ix).apply(null,arguments)},eA=b._emscripten_bind_LocalConvexResult_LocalConvexResult_5=function(){return(eA=b._emscripten_bind_LocalConvexResult_LocalConvexResult_5=b.asm.Jx).apply(null,arguments)},fA=b._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0=function(){return(fA=b._emscripten_bind_LocalConvexResult_get_m_hitCollisionObject_0=b.asm.Kx).apply(null,arguments)},gA=b._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1=function(){return(gA=b._emscripten_bind_LocalConvexResult_set_m_hitCollisionObject_1= +b.asm.Lx).apply(null,arguments)},hA=b._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0=function(){return(hA=b._emscripten_bind_LocalConvexResult_get_m_localShapeInfo_0=b.asm.Mx).apply(null,arguments)},iA=b._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1=function(){return(iA=b._emscripten_bind_LocalConvexResult_set_m_localShapeInfo_1=b.asm.Nx).apply(null,arguments)},jA=b._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0=function(){return(jA=b._emscripten_bind_LocalConvexResult_get_m_hitNormalLocal_0= +b.asm.Ox).apply(null,arguments)},kA=b._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1=function(){return(kA=b._emscripten_bind_LocalConvexResult_set_m_hitNormalLocal_1=b.asm.Px).apply(null,arguments)},lA=b._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0=function(){return(lA=b._emscripten_bind_LocalConvexResult_get_m_hitPointLocal_0=b.asm.Qx).apply(null,arguments)},mA=b._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1=function(){return(mA=b._emscripten_bind_LocalConvexResult_set_m_hitPointLocal_1= +b.asm.Rx).apply(null,arguments)},nA=b._emscripten_bind_LocalConvexResult_get_m_hitFraction_0=function(){return(nA=b._emscripten_bind_LocalConvexResult_get_m_hitFraction_0=b.asm.Sx).apply(null,arguments)},oA=b._emscripten_bind_LocalConvexResult_set_m_hitFraction_1=function(){return(oA=b._emscripten_bind_LocalConvexResult_set_m_hitFraction_1=b.asm.Tx).apply(null,arguments)},pA=b._emscripten_bind_LocalConvexResult___destroy___0=function(){return(pA=b._emscripten_bind_LocalConvexResult___destroy___0= +b.asm.Ux).apply(null,arguments)},qA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP=function(){return(qA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_ERP=b.asm.Vx).apply(null,arguments)},rA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP=function(){return(rA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_ERP=b.asm.Wx).apply(null,arguments)},sA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM=function(){return(sA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_CFM= +b.asm.Xx).apply(null,arguments)},tA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM=function(){return(tA=b._emscripten_enum_btConstraintParams_BT_CONSTRAINT_STOP_CFM=b.asm.Yx).apply(null,arguments)},uA=b._emscripten_enum_PHY_ScalarType_PHY_FLOAT=function(){return(uA=b._emscripten_enum_PHY_ScalarType_PHY_FLOAT=b.asm.Zx).apply(null,arguments)},vA=b._emscripten_enum_PHY_ScalarType_PHY_DOUBLE=function(){return(vA=b._emscripten_enum_PHY_ScalarType_PHY_DOUBLE=b.asm._x).apply(null,arguments)}, +wA=b._emscripten_enum_PHY_ScalarType_PHY_INTEGER=function(){return(wA=b._emscripten_enum_PHY_ScalarType_PHY_INTEGER=b.asm.$x).apply(null,arguments)},xA=b._emscripten_enum_PHY_ScalarType_PHY_SHORT=function(){return(xA=b._emscripten_enum_PHY_ScalarType_PHY_SHORT=b.asm.ay).apply(null,arguments)},yA=b._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88=function(){return(yA=b._emscripten_enum_PHY_ScalarType_PHY_FIXEDPOINT88=b.asm.by).apply(null,arguments)},zA=b._emscripten_enum_PHY_ScalarType_PHY_UCHAR=function(){return(zA= +b._emscripten_enum_PHY_ScalarType_PHY_UCHAR=b.asm.cy).apply(null,arguments)};b._malloc=function(){return(b._malloc=b.asm.dy).apply(null,arguments)};b._free=function(){return(b._free=b.asm.ey).apply(null,arguments)};b.dynCall_vi=function(){return(b.dynCall_vi=b.asm.fy).apply(null,arguments)};b.dynCall_v=function(){return(b.dynCall_v=b.asm.gy).apply(null,arguments)}; +b.UTF8ToString=function(a,c){if(a){var d=a+c;for(c=a;za[c]&&!(c>=d);)++c;if(16e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}a=d}}else a="";return a};var AA; +Oa=function BA(){AA||CA();AA||(Oa=BA)}; +function CA(){function a(){if(!AA&&(AA=!0,b.calledRun=!0,!va)){Ka=!0;Fa(Ha);Fa(Ia);ba(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();Ja.unshift(c)}Fa(Ja)}}if(!(0=EA?(assert(0>>=0;switch(c.BYTES_PER_ELEMENT){case 2:d>>>=1;break;case 4:d>>>=2;break;case 8:d>>>=3}for(var e=0;e=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:c+4}c=Array(c+1);e=c.length;d=0;if(0=n){var F=a.charCodeAt(++g);n=65536+((n&1023)<<10)|F&1023}if(127>=n){if(d>=e)break;c[d++]=n}else{if(2047>=n){if(d+1>=e)break;c[d++]=192|n>>6}else{if(65535>=n){if(d+2>=e)break;c[d++]=224| +n>>12}else{if(d+3>=e)break;c[d++]=240|n>>18;c[d++]=128|n>>12&63}c[d++]=128|n>>6&63}c[d++]=128|n&63}}c[d]=0}a=JA(c,ya);KA(c,ya,a)}return a}function MA(a){if("object"===typeof a){var c=JA(a,Ba);KA(a,Ba,c);return c}return a}function NA(){throw"cannot construct a btCollisionWorld, no constructor in IDL";}NA.prototype=Object.create(f.prototype);NA.prototype.constructor=NA;NA.prototype.iy=NA;NA.jy={};b.btCollisionWorld=NA;NA.prototype.getDispatcher=function(){return k($a(this.hy),OA)}; +NA.prototype.rayTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);ab(e,a,c,d)};NA.prototype.getPairCache=function(){return k(bb(this.hy),PA)};NA.prototype.getDispatchInfo=function(){return k(cb(this.hy),l)}; +NA.prototype.addCollisionObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?db(e,a):void 0===d?eb(e,a,c):fb(e,a,c,d)};NA.prototype.removeCollisionObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gb(c,a)};NA.prototype.getBroadphase=function(){return k(hb(this.hy),QA)}; +NA.prototype.convexSweepTest=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);ib(n,a,c,d,e,g)};NA.prototype.contactPairTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);jb(e,a,c,d)}; +NA.prototype.contactTest=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);kb(d,a,c)};NA.prototype.updateSingleAabb=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lb(c,a)};NA.prototype.setDebugDrawer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mb(c,a)};NA.prototype.getDebugDrawer=function(){return k(nb(this.hy),RA)};NA.prototype.debugDrawWorld=function(){ob(this.hy)}; +NA.prototype.debugDrawObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);pb(e,a,c,d)};NA.prototype.__destroy__=function(){qb(this.hy)};function m(){throw"cannot construct a btCollisionShape, no constructor in IDL";}m.prototype=Object.create(f.prototype);m.prototype.constructor=m;m.prototype.iy=m;m.jy={};b.btCollisionShape=m; +m.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);rb(c,a)};m.prototype.getLocalScaling=function(){return k(sb(this.hy),p)};m.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);tb(d,a,c)};m.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ub(c,a)};m.prototype.getMargin=function(){return vb(this.hy)};m.prototype.__destroy__=function(){wb(this.hy)}; +function q(){throw"cannot construct a btCollisionObject, no constructor in IDL";}q.prototype=Object.create(f.prototype);q.prototype.constructor=q;q.prototype.iy=q;q.jy={};b.btCollisionObject=q;q.prototype.setAnisotropicFriction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);xb(d,a,c)};q.prototype.getCollisionShape=function(){return k(yb(this.hy),m)}; +q.prototype.setContactProcessingThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zb(c,a)};q.prototype.setActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ab(c,a)};q.prototype.forceActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bb(c,a)};q.prototype.activate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);void 0===a?Cb(c):Db(c,a)};q.prototype.isActive=function(){return!!Eb(this.hy)};q.prototype.isKinematicObject=function(){return!!Fb(this.hy)}; +q.prototype.isStaticObject=function(){return!!Gb(this.hy)};q.prototype.isStaticOrKinematicObject=function(){return!!Hb(this.hy)};q.prototype.getRestitution=function(){return Ib(this.hy)};q.prototype.getFriction=function(){return Jb(this.hy)};q.prototype.getRollingFriction=function(){return Kb(this.hy)};q.prototype.setRestitution=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lb(c,a)};q.prototype.setFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Mb(c,a)}; +q.prototype.setRollingFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nb(c,a)};q.prototype.getWorldTransform=function(){return k(Ob(this.hy),r)};q.prototype.getCollisionFlags=function(){return Pb(this.hy)};q.prototype.setCollisionFlags=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qb(c,a)};q.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sb(c,a)}; +q.prototype.setCollisionShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tb(c,a)};q.prototype.setCcdMotionThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ub(c,a)};q.prototype.setCcdSweptSphereRadius=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vb(c,a)};q.prototype.getUserIndex=function(){return Wb(this.hy)};q.prototype.setUserIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xb(c,a)}; +q.prototype.getUserPointer=function(){return k(Yb(this.hy),SA)};q.prototype.setUserPointer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zb(c,a)};q.prototype.getBroadphaseHandle=function(){return k($b(this.hy),t)};q.prototype.__destroy__=function(){ac(this.hy)};function u(){throw"cannot construct a btDynamicsWorld, no constructor in IDL";}u.prototype=Object.create(NA.prototype);u.prototype.constructor=u;u.prototype.iy=u;u.jy={};b.btDynamicsWorld=u; +u.prototype.addAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bc(c,a)};u.prototype.removeAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);cc(c,a)};u.prototype.getSolverInfo=function(){return k(dc(this.hy),v)};u.prototype.setInternalTickCallback=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?ec(e,a):void 0===d?fc(e,a,c):hc(e,a,c,d)}; +u.prototype.getDispatcher=function(){return k(ic(this.hy),OA)};u.prototype.rayTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);jc(e,a,c,d)};u.prototype.getPairCache=function(){return k(kc(this.hy),PA)};u.prototype.getDispatchInfo=function(){return k(lc(this.hy),l)}; +u.prototype.addCollisionObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?mc(e,a):void 0===d?nc(e,a,c):oc(e,a,c,d)};u.prototype.removeCollisionObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pc(c,a)};u.prototype.getBroadphase=function(){return k(qc(this.hy),QA)}; +u.prototype.convexSweepTest=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);rc(n,a,c,d,e,g)};u.prototype.contactPairTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);sc(e,a,c,d)}; +u.prototype.contactTest=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);tc(d,a,c)};u.prototype.updateSingleAabb=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);uc(c,a)};u.prototype.setDebugDrawer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);vc(c,a)};u.prototype.getDebugDrawer=function(){return k(wc(this.hy),RA)};u.prototype.debugDrawWorld=function(){xc(this.hy)}; +u.prototype.debugDrawObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);yc(e,a,c,d)};u.prototype.__destroy__=function(){zc(this.hy)};function TA(){throw"cannot construct a btTypedConstraint, no constructor in IDL";}TA.prototype=Object.create(f.prototype);TA.prototype.constructor=TA;TA.prototype.iy=TA;TA.jy={};b.btTypedConstraint=TA; +TA.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ac(c,a)};TA.prototype.getBreakingImpulseThreshold=function(){return Bc(this.hy)};TA.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cc(c,a)};TA.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return Dc(d,a,c)}; +TA.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Ec(e,a,c,d)};TA.prototype.__destroy__=function(){Fc(this.hy)};function UA(){throw"cannot construct a btConcaveShape, no constructor in IDL";}UA.prototype=Object.create(m.prototype);UA.prototype.constructor=UA;UA.prototype.iy=UA;UA.jy={};b.btConcaveShape=UA; +UA.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gc(c,a)};UA.prototype.getLocalScaling=function(){return k(Hc(this.hy),p)};UA.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ic(d,a,c)};UA.prototype.__destroy__=function(){Jc(this.hy)};function VA(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Kc(a,c);h(VA)[this.hy]=this}VA.prototype=Object.create(m.prototype); +VA.prototype.constructor=VA;VA.prototype.iy=VA;VA.jy={};b.btCapsuleShape=VA;VA.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lc(c,a)};VA.prototype.getMargin=function(){return Mc(this.hy)};VA.prototype.getUpAxis=function(){return Nc(this.hy)};VA.prototype.getRadius=function(){return Oc(this.hy)};VA.prototype.getHalfHeight=function(){return Pc(this.hy)};VA.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qc(c,a)}; +VA.prototype.getLocalScaling=function(){return k(Rc(this.hy),p)};VA.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Sc(d,a,c)};VA.prototype.__destroy__=function(){Tc(this.hy)};function RA(){throw"cannot construct a btIDebugDraw, no constructor in IDL";}RA.prototype=Object.create(f.prototype);RA.prototype.constructor=RA;RA.prototype.iy=RA;RA.jy={};b.btIDebugDraw=RA; +RA.prototype.drawLine=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Uc(e,a,c,d)};RA.prototype.drawContactPoint=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);Vc(n,a,c,d,e,g)}; +RA.prototype.reportErrorWarning=function(a){var c=this.hy;IA();a=a&&"object"===typeof a?a.hy:LA(a);Wc(c,a)};RA.prototype.draw3dText=function(a,c){var d=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);c=c&&"object"===typeof c?c.hy:LA(c);Xc(d,a,c)};RA.prototype.setDebugMode=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yc(c,a)};RA.prototype.getDebugMode=function(){return Zc(this.hy)};RA.prototype.__destroy__=function(){$c(this.hy)}; +function WA(a){a&&"object"===typeof a&&(a=a.hy);this.hy=void 0===a?ad():bd(a);h(WA)[this.hy]=this}WA.prototype=Object.create(f.prototype);WA.prototype.constructor=WA;WA.prototype.iy=WA;WA.jy={};b.btDefaultCollisionConfiguration=WA;WA.prototype.__destroy__=function(){cd(this.hy)};function XA(){throw"cannot construct a btTriangleMeshShape, no constructor in IDL";}XA.prototype=Object.create(UA.prototype);XA.prototype.constructor=XA;XA.prototype.iy=XA;XA.jy={};b.btTriangleMeshShape=XA; +XA.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dd(c,a)};XA.prototype.getLocalScaling=function(){return k(ed(this.hy),p)};XA.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);fd(d,a,c)};XA.prototype.__destroy__=function(){gd(this.hy)};function w(){this.hy=hd();h(w)[this.hy]=this}w.prototype=Object.create(q.prototype);w.prototype.constructor=w;w.prototype.iy=w;w.jy={}; +b.btGhostObject=w;w.prototype.getNumOverlappingObjects=function(){return id(this.hy)};w.prototype.getOverlappingObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(jd(c,a),q)};w.prototype.setAnisotropicFriction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);kd(d,a,c)};w.prototype.getCollisionShape=function(){return k(ld(this.hy),m)}; +w.prototype.setContactProcessingThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);md(c,a)};w.prototype.setActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nd(c,a)};w.prototype.forceActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);od(c,a)};w.prototype.activate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);void 0===a?pd(c):qd(c,a)};w.prototype.isActive=function(){return!!rd(this.hy)};w.prototype.isKinematicObject=function(){return!!sd(this.hy)}; +w.prototype.isStaticObject=function(){return!!td(this.hy)};w.prototype.isStaticOrKinematicObject=function(){return!!ud(this.hy)};w.prototype.getRestitution=function(){return vd(this.hy)};w.prototype.getFriction=function(){return wd(this.hy)};w.prototype.getRollingFriction=function(){return xd(this.hy)};w.prototype.setRestitution=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yd(c,a)};w.prototype.setFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zd(c,a)}; +w.prototype.setRollingFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ad(c,a)};w.prototype.getWorldTransform=function(){return k(Bd(this.hy),r)};w.prototype.getCollisionFlags=function(){return Cd(this.hy)};w.prototype.setCollisionFlags=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dd(c,a)};w.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ed(c,a)}; +w.prototype.setCollisionShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fd(c,a)};w.prototype.setCcdMotionThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gd(c,a)};w.prototype.setCcdSweptSphereRadius=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Hd(c,a)};w.prototype.getUserIndex=function(){return Id(this.hy)};w.prototype.setUserIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Jd(c,a)}; +w.prototype.getUserPointer=function(){return k(Kd(this.hy),SA)};w.prototype.setUserPointer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ld(c,a)};w.prototype.getBroadphaseHandle=function(){return k(Md(this.hy),t)};w.prototype.__destroy__=function(){Nd(this.hy)};function YA(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Od(a,c);h(YA)[this.hy]=this}YA.prototype=Object.create(m.prototype);YA.prototype.constructor=YA;YA.prototype.iy=YA;YA.jy={}; +b.btConeShape=YA;YA.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pd(c,a)};YA.prototype.getLocalScaling=function(){return k(Qd(this.hy),p)};YA.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Rd(d,a,c)};YA.prototype.__destroy__=function(){Sd(this.hy)};function ZA(){throw"cannot construct a btActionInterface, no constructor in IDL";}ZA.prototype=Object.create(f.prototype); +ZA.prototype.constructor=ZA;ZA.prototype.iy=ZA;ZA.jy={};b.btActionInterface=ZA;ZA.prototype.updateAction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Td(d,a,c)};ZA.prototype.__destroy__=function(){Ud(this.hy)}; +function p(a,c,d){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);this.hy=void 0===a?Vd():void 0===c?_emscripten_bind_btVector3_btVector3_1(a):void 0===d?_emscripten_bind_btVector3_btVector3_2(a,c):Wd(a,c,d);h(p)[this.hy]=this}p.prototype=Object.create(f.prototype);p.prototype.constructor=p;p.prototype.iy=p;p.jy={};b.btVector3=p;p.prototype.length=p.prototype.length=function(){return Xd(this.hy)};p.prototype.x=p.prototype.x=function(){return Yd(this.hy)}; +p.prototype.y=p.prototype.y=function(){return Zd(this.hy)};p.prototype.z=p.prototype.z=function(){return $d(this.hy)};p.prototype.setX=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ae(c,a)};p.prototype.setY=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);be(c,a)};p.prototype.setZ=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ce(c,a)}; +p.prototype.setValue=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);de(e,a,c,d)};p.prototype.normalize=p.prototype.normalize=function(){ee(this.hy)};p.prototype.rotate=p.prototype.rotate=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return k(fe(d,a,c),p)};p.prototype.dot=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return ge(c,a)}; +p.prototype.op_mul=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(he(c,a),p)};p.prototype.op_add=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ie(c,a),p)};p.prototype.op_sub=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(je(c,a),p)};p.prototype.__destroy__=function(){ke(this.hy)};function $A(){throw"cannot construct a btVehicleRaycaster, no constructor in IDL";}$A.prototype=Object.create(f.prototype);$A.prototype.constructor=$A; +$A.prototype.iy=$A;$A.jy={};b.btVehicleRaycaster=$A;$A.prototype.castRay=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);le(e,a,c,d)};$A.prototype.__destroy__=function(){me(this.hy)};function aB(){throw"cannot construct a btQuadWord, no constructor in IDL";}aB.prototype=Object.create(f.prototype);aB.prototype.constructor=aB;aB.prototype.iy=aB;aB.jy={};b.btQuadWord=aB;aB.prototype.x=aB.prototype.x=function(){return ne(this.hy)}; +aB.prototype.y=aB.prototype.y=function(){return oe(this.hy)};aB.prototype.z=aB.prototype.z=function(){return pe(this.hy)};aB.prototype.w=function(){return qe(this.hy)};aB.prototype.setX=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);re(c,a)};aB.prototype.setY=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);se(c,a)};aB.prototype.setZ=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);te(c,a)}; +aB.prototype.setW=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ue(c,a)};aB.prototype.__destroy__=function(){ve(this.hy)};function bB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=we(a);h(bB)[this.hy]=this}bB.prototype=Object.create(m.prototype);bB.prototype.constructor=bB;bB.prototype.iy=bB;bB.jy={};b.btCylinderShape=bB;bB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xe(c,a)};bB.prototype.getMargin=function(){return ye(this.hy)}; +bB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ze(c,a)};bB.prototype.getLocalScaling=function(){return k(Ae(this.hy),p)};bB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Be(d,a,c)};bB.prototype.__destroy__=function(){Ce(this.hy)}; +function x(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=De(a,c,d,e);h(x)[this.hy]=this}x.prototype=Object.create(u.prototype);x.prototype.constructor=x;x.prototype.iy=x;x.jy={};b.btDiscreteDynamicsWorld=x;x.prototype.setGravity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ee(c,a)};x.prototype.getGravity=function(){return k(Fe(this.hy),p)}; +x.prototype.addRigidBody=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?Ge(e,a):void 0===d?_emscripten_bind_btDiscreteDynamicsWorld_addRigidBody_2(e,a,c):He(e,a,c,d)};x.prototype.removeRigidBody=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ie(c,a)}; +x.prototype.addConstraint=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===c?Je(d,a):Ke(d,a,c)};x.prototype.removeConstraint=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Le(c,a)};x.prototype.stepSimulation=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);return void 0===c?Me(e,a):void 0===d?Ne(e,a,c):Oe(e,a,c,d)}; +x.prototype.setContactAddedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pe(c,a)};x.prototype.setContactProcessedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qe(c,a)};x.prototype.setContactDestroyedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Re(c,a)};x.prototype.getDispatcher=function(){return k(Se(this.hy),OA)}; +x.prototype.rayTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Te(e,a,c,d)};x.prototype.getPairCache=function(){return k(Ue(this.hy),PA)};x.prototype.getDispatchInfo=function(){return k(Ve(this.hy),l)};x.prototype.addCollisionObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?We(e,a):void 0===d?Xe(e,a,c):Ye(e,a,c,d)}; +x.prototype.removeCollisionObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ze(c,a)};x.prototype.getBroadphase=function(){return k($e(this.hy),QA)};x.prototype.convexSweepTest=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);af(n,a,c,d,e,g)}; +x.prototype.contactPairTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);bf(e,a,c,d)};x.prototype.contactTest=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);cf(d,a,c)};x.prototype.updateSingleAabb=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);df(c,a)};x.prototype.setDebugDrawer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ef(c,a)}; +x.prototype.getDebugDrawer=function(){return k(ff(this.hy),RA)};x.prototype.debugDrawWorld=function(){gf(this.hy)};x.prototype.debugDrawObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);hf(e,a,c,d)};x.prototype.addAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jf(c,a)};x.prototype.removeAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kf(c,a)}; +x.prototype.getSolverInfo=function(){return k(lf(this.hy),v)};x.prototype.setInternalTickCallback=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?mf(e,a):void 0===d?nf(e,a,c):of(e,a,c,d)};x.prototype.__destroy__=function(){pf(this.hy)};function cB(){throw"cannot construct a btConvexShape, no constructor in IDL";}cB.prototype=Object.create(m.prototype);cB.prototype.constructor=cB;cB.prototype.iy=cB;cB.jy={}; +b.btConvexShape=cB;cB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qf(c,a)};cB.prototype.getLocalScaling=function(){return k(rf(this.hy),p)};cB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);sf(d,a,c)};cB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);tf(c,a)};cB.prototype.getMargin=function(){return uf(this.hy)};cB.prototype.__destroy__=function(){vf(this.hy)}; +function OA(){throw"cannot construct a btDispatcher, no constructor in IDL";}OA.prototype=Object.create(f.prototype);OA.prototype.constructor=OA;OA.prototype.iy=OA;OA.jy={};b.btDispatcher=OA;OA.prototype.getNumManifolds=function(){return wf(this.hy)};OA.prototype.getManifoldByIndexInternal=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(xf(c,a),dB)};OA.prototype.__destroy__=function(){yf(this.hy)}; +function eB(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=void 0===e?zf(a,c,d):void 0===g?_emscripten_bind_btGeneric6DofConstraint_btGeneric6DofConstraint_4(a,c,d,e):Af(a,c,d,e,g);h(eB)[this.hy]=this}eB.prototype=Object.create(TA.prototype);eB.prototype.constructor=eB;eB.prototype.iy=eB;eB.jy={};b.btGeneric6DofConstraint=eB; +eB.prototype.setLinearLowerLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bf(c,a)};eB.prototype.setLinearUpperLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cf(c,a)};eB.prototype.setAngularLowerLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Df(c,a)};eB.prototype.setAngularUpperLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ef(c,a)};eB.prototype.getFrameOffsetA=function(){return k(Ff(this.hy),r)}; +eB.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gf(c,a)};eB.prototype.getBreakingImpulseThreshold=function(){return Hf(this.hy)};eB.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);If(c,a)};eB.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return Jf(d,a,c)}; +eB.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Kf(e,a,c,d)};eB.prototype.__destroy__=function(){Lf(this.hy)};function fB(){throw"cannot construct a btStridingMeshInterface, no constructor in IDL";}fB.prototype=Object.create(f.prototype);fB.prototype.constructor=fB;fB.prototype.iy=fB;fB.jy={};b.btStridingMeshInterface=fB; +fB.prototype.setScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Mf(c,a)};fB.prototype.__destroy__=function(){Nf(this.hy)};function gB(){throw"cannot construct a btMotionState, no constructor in IDL";}gB.prototype=Object.create(f.prototype);gB.prototype.constructor=gB;gB.prototype.iy=gB;gB.jy={};b.btMotionState=gB;gB.prototype.getWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Of(c,a)}; +gB.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pf(c,a)};gB.prototype.__destroy__=function(){Qf(this.hy)};function y(){throw"cannot construct a ConvexResultCallback, no constructor in IDL";}y.prototype=Object.create(f.prototype);y.prototype.constructor=y;y.prototype.iy=y;y.jy={};b.ConvexResultCallback=y;y.prototype.hasHit=function(){return!!Rf(this.hy)};y.prototype.get_m_collisionFilterGroup=y.prototype.ky=function(){return Sf(this.hy)}; +y.prototype.set_m_collisionFilterGroup=y.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tf(c,a)};Object.defineProperty(y.prototype,"m_collisionFilterGroup",{get:y.prototype.ky,set:y.prototype.my});y.prototype.get_m_collisionFilterMask=y.prototype.ly=function(){return Uf(this.hy)};y.prototype.set_m_collisionFilterMask=y.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vf(c,a)}; +Object.defineProperty(y.prototype,"m_collisionFilterMask",{get:y.prototype.ly,set:y.prototype.ny});y.prototype.get_m_closestHitFraction=y.prototype.oy=function(){return Wf(this.hy)};y.prototype.set_m_closestHitFraction=y.prototype.py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xf(c,a)};Object.defineProperty(y.prototype,"m_closestHitFraction",{get:y.prototype.oy,set:y.prototype.py});y.prototype.__destroy__=function(){Yf(this.hy)}; +function hB(){throw"cannot construct a ContactResultCallback, no constructor in IDL";}hB.prototype=Object.create(f.prototype);hB.prototype.constructor=hB;hB.prototype.iy=hB;hB.jy={};b.ContactResultCallback=hB; +hB.prototype.addSingleResult=function(a,c,d,e,g,n,F){var aa=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);return Zf(aa,a,c,d,e,g,n,F)};hB.prototype.__destroy__=function(){$f(this.hy)};function iB(){throw"cannot construct a btSoftBodySolver, no constructor in IDL";}iB.prototype=Object.create(f.prototype); +iB.prototype.constructor=iB;iB.prototype.iy=iB;iB.jy={};b.btSoftBodySolver=iB;iB.prototype.__destroy__=function(){ag(this.hy)};function z(){throw"cannot construct a RayResultCallback, no constructor in IDL";}z.prototype=Object.create(f.prototype);z.prototype.constructor=z;z.prototype.iy=z;z.jy={};b.RayResultCallback=z;z.prototype.hasHit=function(){return!!bg(this.hy)};z.prototype.get_m_collisionFilterGroup=z.prototype.ky=function(){return cg(this.hy)}; +z.prototype.set_m_collisionFilterGroup=z.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dg(c,a)};Object.defineProperty(z.prototype,"m_collisionFilterGroup",{get:z.prototype.ky,set:z.prototype.my});z.prototype.get_m_collisionFilterMask=z.prototype.ly=function(){return eg(this.hy)};z.prototype.set_m_collisionFilterMask=z.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fg(c,a)}; +Object.defineProperty(z.prototype,"m_collisionFilterMask",{get:z.prototype.ly,set:z.prototype.ny});z.prototype.get_m_closestHitFraction=z.prototype.oy=function(){return gg(this.hy)};z.prototype.set_m_closestHitFraction=z.prototype.py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);hg(c,a)};Object.defineProperty(z.prototype,"m_closestHitFraction",{get:z.prototype.oy,set:z.prototype.py});z.prototype.get_m_collisionObject=z.prototype.qy=function(){return k(ig(this.hy),q)}; +z.prototype.set_m_collisionObject=z.prototype.xy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jg(c,a)};Object.defineProperty(z.prototype,"m_collisionObject",{get:z.prototype.qy,set:z.prototype.xy});z.prototype.__destroy__=function(){kg(this.hy)};function jB(){throw"cannot construct a btMatrix3x3, no constructor in IDL";}jB.prototype=Object.create(f.prototype);jB.prototype.constructor=jB;jB.prototype.iy=jB;jB.jy={};b.btMatrix3x3=jB; +jB.prototype.setEulerZYX=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);lg(e,a,c,d)};jB.prototype.getRotation=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mg(c,a)};jB.prototype.getRow=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ng(c,a),p)};jB.prototype.__destroy__=function(){og(this.hy)};function kB(){throw"cannot construct a btScalarArray, no constructor in IDL";}kB.prototype=Object.create(f.prototype); +kB.prototype.constructor=kB;kB.prototype.iy=kB;kB.jy={};b.btScalarArray=kB;kB.prototype.size=kB.prototype.size=function(){return pg(this.hy)};kB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return qg(c,a)};kB.prototype.__destroy__=function(){rg(this.hy)};function A(){throw"cannot construct a Material, no constructor in IDL";}A.prototype=Object.create(f.prototype);A.prototype.constructor=A;A.prototype.iy=A;A.jy={};b.Material=A;A.prototype.get_m_kLST=A.prototype.vA=function(){return sg(this.hy)}; +A.prototype.set_m_kLST=A.prototype.bD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);tg(c,a)};Object.defineProperty(A.prototype,"m_kLST",{get:A.prototype.vA,set:A.prototype.bD});A.prototype.get_m_kAST=A.prototype.uA=function(){return ug(this.hy)};A.prototype.set_m_kAST=A.prototype.aD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);vg(c,a)};Object.defineProperty(A.prototype,"m_kAST",{get:A.prototype.uA,set:A.prototype.aD});A.prototype.get_m_kVST=A.prototype.wA=function(){return wg(this.hy)}; +A.prototype.set_m_kVST=A.prototype.cD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xg(c,a)};Object.defineProperty(A.prototype,"m_kVST",{get:A.prototype.wA,set:A.prototype.cD});A.prototype.get_m_flags=A.prototype.cA=function(){return yg(this.hy)};A.prototype.set_m_flags=A.prototype.JC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zg(c,a)};Object.defineProperty(A.prototype,"m_flags",{get:A.prototype.cA,set:A.prototype.JC});A.prototype.__destroy__=function(){Ag(this.hy)}; +function l(){throw"cannot construct a btDispatcherInfo, no constructor in IDL";}l.prototype=Object.create(f.prototype);l.prototype.constructor=l;l.prototype.iy=l;l.jy={};b.btDispatcherInfo=l;l.prototype.get_m_timeStep=l.prototype.jB=function(){return Bg(this.hy)};l.prototype.set_m_timeStep=l.prototype.QD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cg(c,a)};Object.defineProperty(l.prototype,"m_timeStep",{get:l.prototype.jB,set:l.prototype.QD}); +l.prototype.get_m_stepCount=l.prototype.aB=function(){return Dg(this.hy)};l.prototype.set_m_stepCount=l.prototype.HD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Eg(c,a)};Object.defineProperty(l.prototype,"m_stepCount",{get:l.prototype.aB,set:l.prototype.HD});l.prototype.get_m_dispatchFunc=l.prototype.Wz=function(){return Fg(this.hy)};l.prototype.set_m_dispatchFunc=l.prototype.CC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gg(c,a)}; +Object.defineProperty(l.prototype,"m_dispatchFunc",{get:l.prototype.Wz,set:l.prototype.CC});l.prototype.get_m_timeOfImpact=l.prototype.iB=function(){return Hg(this.hy)};l.prototype.set_m_timeOfImpact=l.prototype.PD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ig(c,a)};Object.defineProperty(l.prototype,"m_timeOfImpact",{get:l.prototype.iB,set:l.prototype.PD});l.prototype.get_m_useContinuous=l.prototype.lB=function(){return!!Jg(this.hy)}; +l.prototype.set_m_useContinuous=l.prototype.SD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Kg(c,a)};Object.defineProperty(l.prototype,"m_useContinuous",{get:l.prototype.lB,set:l.prototype.SD});l.prototype.get_m_enableSatConvex=l.prototype.$z=function(){return!!Lg(this.hy)};l.prototype.set_m_enableSatConvex=l.prototype.GC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Mg(c,a)};Object.defineProperty(l.prototype,"m_enableSatConvex",{get:l.prototype.$z,set:l.prototype.GC}); +l.prototype.get_m_enableSPU=l.prototype.Zz=function(){return!!Ng(this.hy)};l.prototype.set_m_enableSPU=l.prototype.FC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Og(c,a)};Object.defineProperty(l.prototype,"m_enableSPU",{get:l.prototype.Zz,set:l.prototype.FC});l.prototype.get_m_useEpa=l.prototype.nB=function(){return!!Pg(this.hy)};l.prototype.set_m_useEpa=l.prototype.UD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qg(c,a)}; +Object.defineProperty(l.prototype,"m_useEpa",{get:l.prototype.nB,set:l.prototype.UD});l.prototype.get_m_allowedCcdPenetration=l.prototype.zz=function(){return Rg(this.hy)};l.prototype.set_m_allowedCcdPenetration=l.prototype.fC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sg(c,a)};Object.defineProperty(l.prototype,"m_allowedCcdPenetration",{get:l.prototype.zz,set:l.prototype.fC});l.prototype.get_m_useConvexConservativeDistanceUtil=l.prototype.mB=function(){return!!Tg(this.hy)}; +l.prototype.set_m_useConvexConservativeDistanceUtil=l.prototype.TD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ug(c,a)};Object.defineProperty(l.prototype,"m_useConvexConservativeDistanceUtil",{get:l.prototype.mB,set:l.prototype.TD});l.prototype.get_m_convexConservativeDistanceThreshold=l.prototype.Rz=function(){return Vg(this.hy)};l.prototype.set_m_convexConservativeDistanceThreshold=l.prototype.xC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wg(c,a)}; +Object.defineProperty(l.prototype,"m_convexConservativeDistanceThreshold",{get:l.prototype.Rz,set:l.prototype.xC});l.prototype.__destroy__=function(){Xg(this.hy)};function B(){throw"cannot construct a btWheelInfoConstructionInfo, no constructor in IDL";}B.prototype=Object.create(f.prototype);B.prototype.constructor=B;B.prototype.iy=B;B.jy={};b.btWheelInfoConstructionInfo=B;B.prototype.get_m_chassisConnectionCS=B.prototype.Lz=function(){return k(Yg(this.hy),p)}; +B.prototype.set_m_chassisConnectionCS=B.prototype.rC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zg(c,a)};Object.defineProperty(B.prototype,"m_chassisConnectionCS",{get:B.prototype.Lz,set:B.prototype.rC});B.prototype.get_m_wheelDirectionCS=B.prototype.Ly=function(){return k($g(this.hy),p)};B.prototype.set_m_wheelDirectionCS=B.prototype.Uy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ah(c,a)};Object.defineProperty(B.prototype,"m_wheelDirectionCS",{get:B.prototype.Ly,set:B.prototype.Uy}); +B.prototype.get_m_wheelAxleCS=B.prototype.Ky=function(){return k(bh(this.hy),p)};B.prototype.set_m_wheelAxleCS=B.prototype.Ty=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ch(c,a)};Object.defineProperty(B.prototype,"m_wheelAxleCS",{get:B.prototype.Ky,set:B.prototype.Ty});B.prototype.get_m_suspensionRestLength=B.prototype.fB=function(){return dh(this.hy)};B.prototype.set_m_suspensionRestLength=B.prototype.MD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);eh(c,a)}; +Object.defineProperty(B.prototype,"m_suspensionRestLength",{get:B.prototype.fB,set:B.prototype.MD});B.prototype.get_m_maxSuspensionTravelCm=B.prototype.vy=function(){return fh(this.hy)};B.prototype.set_m_maxSuspensionTravelCm=B.prototype.Cy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gh(c,a)};Object.defineProperty(B.prototype,"m_maxSuspensionTravelCm",{get:B.prototype.vy,set:B.prototype.Cy});B.prototype.get_m_wheelRadius=B.prototype.tB=function(){return hh(this.hy)}; +B.prototype.set_m_wheelRadius=B.prototype.$D=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ih(c,a)};Object.defineProperty(B.prototype,"m_wheelRadius",{get:B.prototype.tB,set:B.prototype.$D});B.prototype.get_m_suspensionStiffness=B.prototype.wy=function(){return jh(this.hy)};B.prototype.set_m_suspensionStiffness=B.prototype.Dy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kh(c,a)};Object.defineProperty(B.prototype,"m_suspensionStiffness",{get:B.prototype.wy,set:B.prototype.Dy}); +B.prototype.get_m_wheelsDampingCompression=B.prototype.My=function(){return lh(this.hy)};B.prototype.set_m_wheelsDampingCompression=B.prototype.Vy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mh(c,a)};Object.defineProperty(B.prototype,"m_wheelsDampingCompression",{get:B.prototype.My,set:B.prototype.Vy});B.prototype.get_m_wheelsDampingRelaxation=B.prototype.Ny=function(){return nh(this.hy)}; +B.prototype.set_m_wheelsDampingRelaxation=B.prototype.Wy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);oh(c,a)};Object.defineProperty(B.prototype,"m_wheelsDampingRelaxation",{get:B.prototype.Ny,set:B.prototype.Wy});B.prototype.get_m_frictionSlip=B.prototype.ry=function(){return ph(this.hy)};B.prototype.set_m_frictionSlip=B.prototype.yy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qh(c,a)};Object.defineProperty(B.prototype,"m_frictionSlip",{get:B.prototype.ry,set:B.prototype.yy}); +B.prototype.get_m_maxSuspensionForce=B.prototype.uy=function(){return rh(this.hy)};B.prototype.set_m_maxSuspensionForce=B.prototype.By=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sh(c,a)};Object.defineProperty(B.prototype,"m_maxSuspensionForce",{get:B.prototype.uy,set:B.prototype.By});B.prototype.get_m_bIsFrontWheel=B.prototype.Fy=function(){return!!th(this.hy)};B.prototype.set_m_bIsFrontWheel=B.prototype.Oy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);uh(c,a)}; +Object.defineProperty(B.prototype,"m_bIsFrontWheel",{get:B.prototype.Fy,set:B.prototype.Oy});B.prototype.__destroy__=function(){vh(this.hy)};function lB(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=void 0===c?wh(a):xh(a,c);h(lB)[this.hy]=this}lB.prototype=Object.create(cB.prototype);lB.prototype.constructor=lB;lB.prototype.iy=lB;lB.jy={};b.btConvexTriangleMeshShape=lB;lB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yh(c,a)}; +lB.prototype.getLocalScaling=function(){return k(zh(this.hy),p)};lB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ah(d,a,c)};lB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bh(c,a)};lB.prototype.getMargin=function(){return Ch(this.hy)};lB.prototype.__destroy__=function(){Dh(this.hy)};function QA(){throw"cannot construct a btBroadphaseInterface, no constructor in IDL";}QA.prototype=Object.create(f.prototype); +QA.prototype.constructor=QA;QA.prototype.iy=QA;QA.jy={};b.btBroadphaseInterface=QA;QA.prototype.getOverlappingPairCache=function(){return k(Eh(this.hy),PA)};QA.prototype.__destroy__=function(){Fh(this.hy)};function C(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=void 0===e?Gh(a,c,d):Hh(a,c,d,e);h(C)[this.hy]=this}C.prototype=Object.create(f.prototype);C.prototype.constructor=C;C.prototype.iy=C; +C.jy={};b.btRigidBodyConstructionInfo=C;C.prototype.get_m_linearDamping=C.prototype.xA=function(){return Ih(this.hy)};C.prototype.set_m_linearDamping=C.prototype.dD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Jh(c,a)};Object.defineProperty(C.prototype,"m_linearDamping",{get:C.prototype.xA,set:C.prototype.dD});C.prototype.get_m_angularDamping=C.prototype.Bz=function(){return Kh(this.hy)}; +C.prototype.set_m_angularDamping=C.prototype.hC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lh(c,a)};Object.defineProperty(C.prototype,"m_angularDamping",{get:C.prototype.Bz,set:C.prototype.hC});C.prototype.get_m_friction=C.prototype.dA=function(){return Mh(this.hy)};C.prototype.set_m_friction=C.prototype.KC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nh(c,a)};Object.defineProperty(C.prototype,"m_friction",{get:C.prototype.dA,set:C.prototype.KC}); +C.prototype.get_m_rollingFriction=C.prototype.TA=function(){return Oh(this.hy)};C.prototype.set_m_rollingFriction=C.prototype.zD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ph(c,a)};Object.defineProperty(C.prototype,"m_rollingFriction",{get:C.prototype.TA,set:C.prototype.zD});C.prototype.get_m_restitution=C.prototype.RA=function(){return Qh(this.hy)};C.prototype.set_m_restitution=C.prototype.xD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rh(c,a)}; +Object.defineProperty(C.prototype,"m_restitution",{get:C.prototype.RA,set:C.prototype.xD});C.prototype.get_m_linearSleepingThreshold=C.prototype.yA=function(){return Sh(this.hy)};C.prototype.set_m_linearSleepingThreshold=C.prototype.eD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Th(c,a)};Object.defineProperty(C.prototype,"m_linearSleepingThreshold",{get:C.prototype.yA,set:C.prototype.eD});C.prototype.get_m_angularSleepingThreshold=C.prototype.Cz=function(){return Uh(this.hy)}; +C.prototype.set_m_angularSleepingThreshold=C.prototype.iC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vh(c,a)};Object.defineProperty(C.prototype,"m_angularSleepingThreshold",{get:C.prototype.Cz,set:C.prototype.iC});C.prototype.get_m_additionalDamping=C.prototype.wz=function(){return!!Wh(this.hy)};C.prototype.set_m_additionalDamping=C.prototype.cC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xh(c,a)}; +Object.defineProperty(C.prototype,"m_additionalDamping",{get:C.prototype.wz,set:C.prototype.cC});C.prototype.get_m_additionalDampingFactor=C.prototype.xz=function(){return Yh(this.hy)};C.prototype.set_m_additionalDampingFactor=C.prototype.dC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zh(c,a)};Object.defineProperty(C.prototype,"m_additionalDampingFactor",{get:C.prototype.xz,set:C.prototype.dC});C.prototype.get_m_additionalLinearDampingThresholdSqr=C.prototype.yz=function(){return $h(this.hy)}; +C.prototype.set_m_additionalLinearDampingThresholdSqr=C.prototype.eC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ai(c,a)};Object.defineProperty(C.prototype,"m_additionalLinearDampingThresholdSqr",{get:C.prototype.yz,set:C.prototype.eC});C.prototype.get_m_additionalAngularDampingThresholdSqr=C.prototype.vz=function(){return bi(this.hy)};C.prototype.set_m_additionalAngularDampingThresholdSqr=C.prototype.bC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ci(c,a)}; +Object.defineProperty(C.prototype,"m_additionalAngularDampingThresholdSqr",{get:C.prototype.vz,set:C.prototype.bC});C.prototype.get_m_additionalAngularDampingFactor=C.prototype.uz=function(){return di(this.hy)};C.prototype.set_m_additionalAngularDampingFactor=C.prototype.aC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ei(c,a)};Object.defineProperty(C.prototype,"m_additionalAngularDampingFactor",{get:C.prototype.uz,set:C.prototype.aC});C.prototype.__destroy__=function(){fi(this.hy)}; +function mB(){throw"cannot construct a btCollisionConfiguration, no constructor in IDL";}mB.prototype=Object.create(f.prototype);mB.prototype.constructor=mB;mB.prototype.iy=mB;mB.jy={};b.btCollisionConfiguration=mB;mB.prototype.__destroy__=function(){gi(this.hy)};function dB(){this.hy=hi();h(dB)[this.hy]=this}dB.prototype=Object.create(f.prototype);dB.prototype.constructor=dB;dB.prototype.iy=dB;dB.jy={};b.btPersistentManifold=dB;dB.prototype.getBody0=function(){return k(ii(this.hy),q)}; +dB.prototype.getBody1=function(){return k(ji(this.hy),q)};dB.prototype.getNumContacts=function(){return ki(this.hy)};dB.prototype.getContactPoint=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(li(c,a),D)};dB.prototype.__destroy__=function(){mi(this.hy)};function nB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=void 0===a?ni():oi(a);h(nB)[this.hy]=this}nB.prototype=Object.create(m.prototype);nB.prototype.constructor=nB;nB.prototype.iy=nB;nB.jy={};b.btCompoundShape=nB; +nB.prototype.addChildShape=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);pi(d,a,c)};nB.prototype.removeChildShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qi(c,a)};nB.prototype.removeChildShapeByIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ri(c,a)};nB.prototype.getNumChildShapes=function(){return si(this.hy)};nB.prototype.getChildShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ti(c,a),m)}; +nB.prototype.updateChildTransform=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===d?ui(e,a,c):vi(e,a,c,d)};nB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wi(c,a)};nB.prototype.getMargin=function(){return xi(this.hy)};nB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yi(c,a)};nB.prototype.getLocalScaling=function(){return k(zi(this.hy),p)}; +nB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ai(d,a,c)};nB.prototype.__destroy__=function(){Bi(this.hy)};function E(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Ci(a,c);h(E)[this.hy]=this}E.prototype=Object.create(y.prototype);E.prototype.constructor=E;E.prototype.iy=E;E.jy={};b.ClosestConvexResultCallback=E;E.prototype.hasHit=function(){return!!Di(this.hy)}; +E.prototype.get_m_convexFromWorld=E.prototype.Sz=function(){return k(Ei(this.hy),p)};E.prototype.set_m_convexFromWorld=E.prototype.yC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fi(c,a)};Object.defineProperty(E.prototype,"m_convexFromWorld",{get:E.prototype.Sz,set:E.prototype.yC});E.prototype.get_m_convexToWorld=E.prototype.Tz=function(){return k(Gi(this.hy),p)};E.prototype.set_m_convexToWorld=E.prototype.zC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Hi(c,a)}; +Object.defineProperty(E.prototype,"m_convexToWorld",{get:E.prototype.Tz,set:E.prototype.zC});E.prototype.get_m_hitNormalWorld=E.prototype.sy=function(){return k(Ii(this.hy),p)};E.prototype.set_m_hitNormalWorld=E.prototype.zy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ji(c,a)};Object.defineProperty(E.prototype,"m_hitNormalWorld",{get:E.prototype.sy,set:E.prototype.zy});E.prototype.get_m_hitPointWorld=E.prototype.ty=function(){return k(Ki(this.hy),p)}; +E.prototype.set_m_hitPointWorld=E.prototype.Ay=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Li(c,a)};Object.defineProperty(E.prototype,"m_hitPointWorld",{get:E.prototype.ty,set:E.prototype.Ay});E.prototype.get_m_collisionFilterGroup=E.prototype.ky=function(){return Mi(this.hy)};E.prototype.set_m_collisionFilterGroup=E.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ni(c,a)};Object.defineProperty(E.prototype,"m_collisionFilterGroup",{get:E.prototype.ky,set:E.prototype.my}); +E.prototype.get_m_collisionFilterMask=E.prototype.ly=function(){return Oi(this.hy)};E.prototype.set_m_collisionFilterMask=E.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pi(c,a)};Object.defineProperty(E.prototype,"m_collisionFilterMask",{get:E.prototype.ly,set:E.prototype.ny});E.prototype.get_m_closestHitFraction=E.prototype.oy=function(){return Qi(this.hy)}; +E.prototype.set_m_closestHitFraction=E.prototype.py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ri(c,a)};Object.defineProperty(E.prototype,"m_closestHitFraction",{get:E.prototype.oy,set:E.prototype.py});E.prototype.__destroy__=function(){Si(this.hy)};function G(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Ti(a,c);h(G)[this.hy]=this}G.prototype=Object.create(z.prototype);G.prototype.constructor=G;G.prototype.iy=G;G.jy={};b.AllHitsRayResultCallback=G; +G.prototype.hasHit=function(){return!!Ui(this.hy)};G.prototype.get_m_collisionObjects=G.prototype.Oz=function(){return k(Vi(this.hy),oB)};G.prototype.set_m_collisionObjects=G.prototype.uC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wi(c,a)};Object.defineProperty(G.prototype,"m_collisionObjects",{get:G.prototype.Oz,set:G.prototype.uC});G.prototype.get_m_rayFromWorld=G.prototype.Iy=function(){return k(Xi(this.hy),p)}; +G.prototype.set_m_rayFromWorld=G.prototype.Ry=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yi(c,a)};Object.defineProperty(G.prototype,"m_rayFromWorld",{get:G.prototype.Iy,set:G.prototype.Ry});G.prototype.get_m_rayToWorld=G.prototype.Jy=function(){return k(Zi(this.hy),p)};G.prototype.set_m_rayToWorld=G.prototype.Sy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$i(c,a)};Object.defineProperty(G.prototype,"m_rayToWorld",{get:G.prototype.Jy,set:G.prototype.Sy}); +G.prototype.get_m_hitNormalWorld=G.prototype.sy=function(){return k(aj(this.hy),pB)};G.prototype.set_m_hitNormalWorld=G.prototype.zy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bj(c,a)};Object.defineProperty(G.prototype,"m_hitNormalWorld",{get:G.prototype.sy,set:G.prototype.zy});G.prototype.get_m_hitPointWorld=G.prototype.ty=function(){return k(cj(this.hy),pB)};G.prototype.set_m_hitPointWorld=G.prototype.Ay=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dj(c,a)}; +Object.defineProperty(G.prototype,"m_hitPointWorld",{get:G.prototype.ty,set:G.prototype.Ay});G.prototype.get_m_hitFractions=G.prototype.kA=function(){return k(ej(this.hy),kB)};G.prototype.set_m_hitFractions=G.prototype.RC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fj(c,a)};Object.defineProperty(G.prototype,"m_hitFractions",{get:G.prototype.kA,set:G.prototype.RC});G.prototype.get_m_collisionFilterGroup=G.prototype.ky=function(){return gj(this.hy)}; +G.prototype.set_m_collisionFilterGroup=G.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);hj(c,a)};Object.defineProperty(G.prototype,"m_collisionFilterGroup",{get:G.prototype.ky,set:G.prototype.my});G.prototype.get_m_collisionFilterMask=G.prototype.ly=function(){return ij(this.hy)};G.prototype.set_m_collisionFilterMask=G.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jj(c,a)}; +Object.defineProperty(G.prototype,"m_collisionFilterMask",{get:G.prototype.ly,set:G.prototype.ny});G.prototype.get_m_closestHitFraction=G.prototype.oy=function(){return kj(this.hy)};G.prototype.set_m_closestHitFraction=G.prototype.py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lj(c,a)};Object.defineProperty(G.prototype,"m_closestHitFraction",{get:G.prototype.oy,set:G.prototype.py});G.prototype.get_m_collisionObject=G.prototype.qy=function(){return k(mj(this.hy),q)}; +G.prototype.set_m_collisionObject=G.prototype.xy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nj(c,a)};Object.defineProperty(G.prototype,"m_collisionObject",{get:G.prototype.qy,set:G.prototype.xy});G.prototype.__destroy__=function(){oj(this.hy)};function qB(){throw"cannot construct a tMaterialArray, no constructor in IDL";}qB.prototype=Object.create(f.prototype);qB.prototype.constructor=qB;qB.prototype.iy=qB;qB.jy={};b.tMaterialArray=qB;qB.prototype.size=qB.prototype.size=function(){return pj(this.hy)}; +qB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(qj(c,a),A)};qB.prototype.__destroy__=function(){rj(this.hy)};function rB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=sj(a);h(rB)[this.hy]=this}rB.prototype=Object.create($A.prototype);rB.prototype.constructor=rB;rB.prototype.iy=rB;rB.jy={};b.btDefaultVehicleRaycaster=rB; +rB.prototype.castRay=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);tj(e,a,c,d)};rB.prototype.__destroy__=function(){uj(this.hy)};function sB(){this.hy=vj();h(sB)[this.hy]=this}sB.prototype=Object.create(UA.prototype);sB.prototype.constructor=sB;sB.prototype.iy=sB;sB.jy={};b.btEmptyShape=sB;sB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wj(c,a)}; +sB.prototype.getLocalScaling=function(){return k(xj(this.hy),p)};sB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);yj(d,a,c)};sB.prototype.__destroy__=function(){zj(this.hy)};function H(){this.hy=Aj();h(H)[this.hy]=this}H.prototype=Object.create(f.prototype);H.prototype.constructor=H;H.prototype.iy=H;H.jy={};b.btConstraintSetting=H;H.prototype.get_m_tau=H.prototype.hB=function(){return Bj(this.hy)}; +H.prototype.set_m_tau=H.prototype.OD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cj(c,a)};Object.defineProperty(H.prototype,"m_tau",{get:H.prototype.hB,set:H.prototype.OD});H.prototype.get_m_damping=H.prototype.Uz=function(){return Dj(this.hy)};H.prototype.set_m_damping=H.prototype.AC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ej(c,a)};Object.defineProperty(H.prototype,"m_damping",{get:H.prototype.Uz,set:H.prototype.AC}); +H.prototype.get_m_impulseClamp=H.prototype.qA=function(){return Fj(this.hy)};H.prototype.set_m_impulseClamp=H.prototype.XC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gj(c,a)};Object.defineProperty(H.prototype,"m_impulseClamp",{get:H.prototype.qA,set:H.prototype.XC});H.prototype.__destroy__=function(){Hj(this.hy)};function tB(){throw"cannot construct a LocalShapeInfo, no constructor in IDL";}tB.prototype=Object.create(f.prototype);tB.prototype.constructor=tB;tB.prototype.iy=tB; +tB.jy={};b.LocalShapeInfo=tB;tB.prototype.get_m_shapePart=tB.prototype.WA=function(){return Ij(this.hy)};tB.prototype.set_m_shapePart=tB.prototype.CD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Jj(c,a)};Object.defineProperty(tB.prototype,"m_shapePart",{get:tB.prototype.WA,set:tB.prototype.CD});tB.prototype.get_m_triangleIndex=tB.prototype.kB=function(){return Kj(this.hy)}; +tB.prototype.set_m_triangleIndex=tB.prototype.RD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lj(c,a)};Object.defineProperty(tB.prototype,"m_triangleIndex",{get:tB.prototype.kB,set:tB.prototype.RD});tB.prototype.__destroy__=function(){Mj(this.hy)};function I(a){a&&"object"===typeof a&&(a=a.hy);this.hy=Nj(a);h(I)[this.hy]=this}I.prototype=Object.create(q.prototype);I.prototype.constructor=I;I.prototype.iy=I;I.jy={};b.btRigidBody=I; +I.prototype.getCenterOfMassTransform=function(){return k(Oj(this.hy),r)};I.prototype.setCenterOfMassTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pj(c,a)};I.prototype.setSleepingThresholds=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Qj(d,a,c)};I.prototype.getLinearDamping=function(){return Rj(this.hy)};I.prototype.getAngularDamping=function(){return Sj(this.hy)}; +I.prototype.setDamping=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Tj(d,a,c)};I.prototype.setMassProps=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Uj(d,a,c)};I.prototype.getLinearFactor=function(){return k(Vj(this.hy),p)};I.prototype.setLinearFactor=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wj(c,a)}; +I.prototype.applyTorque=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xj(c,a)};I.prototype.applyLocalTorque=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yj(c,a)};I.prototype.applyForce=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Zj(d,a,c)};I.prototype.applyCentralForce=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ak(c,a)}; +I.prototype.applyCentralLocalForce=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bk(c,a)};I.prototype.applyTorqueImpulse=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ck(c,a)};I.prototype.applyImpulse=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);dk(d,a,c)};I.prototype.applyCentralImpulse=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ek(c,a)};I.prototype.updateInertiaTensor=function(){fk(this.hy)}; +I.prototype.getLinearVelocity=function(){return k(gk(this.hy),p)};I.prototype.getAngularVelocity=function(){return k(hk(this.hy),p)};I.prototype.setLinearVelocity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ik(c,a)};I.prototype.setAngularVelocity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jk(c,a)};I.prototype.getMotionState=function(){return k(kk(this.hy),gB)};I.prototype.setMotionState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lk(c,a)}; +I.prototype.getAngularFactor=function(){return k(mk(this.hy),p)};I.prototype.setAngularFactor=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nk(c,a)};I.prototype.upcast=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ok(c,a),I)};I.prototype.getAabb=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);pk(d,a,c)};I.prototype.applyGravity=function(){qk(this.hy)};I.prototype.getGravity=function(){return k(rk(this.hy),p)}; +I.prototype.setGravity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sk(c,a)};I.prototype.getBroadphaseProxy=function(){return k(tk(this.hy),t)};I.prototype.clearForces=function(){uk(this.hy)};I.prototype.setAnisotropicFriction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);vk(d,a,c)};I.prototype.getCollisionShape=function(){return k(wk(this.hy),m)}; +I.prototype.setContactProcessingThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xk(c,a)};I.prototype.setActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yk(c,a)};I.prototype.forceActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zk(c,a)};I.prototype.activate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);void 0===a?Ak(c):Bk(c,a)};I.prototype.isActive=function(){return!!Ck(this.hy)};I.prototype.isKinematicObject=function(){return!!Dk(this.hy)}; +I.prototype.isStaticObject=function(){return!!Ek(this.hy)};I.prototype.isStaticOrKinematicObject=function(){return!!Fk(this.hy)};I.prototype.getRestitution=function(){return Gk(this.hy)};I.prototype.getFriction=function(){return Hk(this.hy)};I.prototype.getRollingFriction=function(){return Ik(this.hy)};I.prototype.setRestitution=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Jk(c,a)};I.prototype.setFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Kk(c,a)}; +I.prototype.setRollingFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lk(c,a)};I.prototype.getWorldTransform=function(){return k(Mk(this.hy),r)};I.prototype.getCollisionFlags=function(){return Nk(this.hy)};I.prototype.setCollisionFlags=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ok(c,a)};I.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pk(c,a)}; +I.prototype.setCollisionShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qk(c,a)};I.prototype.setCcdMotionThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rk(c,a)};I.prototype.setCcdSweptSphereRadius=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sk(c,a)};I.prototype.getUserIndex=function(){return Tk(this.hy)};I.prototype.setUserIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Uk(c,a)}; +I.prototype.getUserPointer=function(){return k(Vk(this.hy),SA)};I.prototype.setUserPointer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wk(c,a)};I.prototype.getBroadphaseHandle=function(){return k(Xk(this.hy),t)};I.prototype.__destroy__=function(){Yk(this.hy)};function uB(){throw"cannot construct a btIndexedMeshArray, no constructor in IDL";}uB.prototype=Object.create(f.prototype);uB.prototype.constructor=uB;uB.prototype.iy=uB;uB.jy={};b.btIndexedMeshArray=uB; +uB.prototype.size=uB.prototype.size=function(){return Zk(this.hy)};uB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k($k(c,a),vB)};uB.prototype.__destroy__=function(){al(this.hy)};function wB(){this.hy=bl();h(wB)[this.hy]=this}wB.prototype=Object.create(f.prototype);wB.prototype.constructor=wB;wB.prototype.iy=wB;wB.jy={};b.btDbvtBroadphase=wB;wB.prototype.__destroy__=function(){cl(this.hy)}; +function xB(a,c,d,e,g,n,F,aa,ta){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);aa&&"object"===typeof aa&&(aa=aa.hy);ta&&"object"===typeof ta&&(ta=ta.hy);this.hy=dl(a,c,d,e,g,n,F,aa,ta);h(xB)[this.hy]=this}xB.prototype=Object.create(UA.prototype);xB.prototype.constructor=xB;xB.prototype.iy=xB;xB.jy={}; +b.btHeightfieldTerrainShape=xB;xB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);el(c,a)};xB.prototype.getMargin=function(){return fl(this.hy)};xB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gl(c,a)};xB.prototype.getLocalScaling=function(){return k(hl(this.hy),p)};xB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);il(d,a,c)}; +xB.prototype.__destroy__=function(){jl(this.hy)};function yB(){this.hy=kl();h(yB)[this.hy]=this}yB.prototype=Object.create(iB.prototype);yB.prototype.constructor=yB;yB.prototype.iy=yB;yB.jy={};b.btDefaultSoftBodySolver=yB;yB.prototype.__destroy__=function(){ll(this.hy)};function zB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=ml(a);h(zB)[this.hy]=this}zB.prototype=Object.create(OA.prototype);zB.prototype.constructor=zB;zB.prototype.iy=zB;zB.jy={};b.btCollisionDispatcher=zB; +zB.prototype.getNumManifolds=function(){return nl(this.hy)};zB.prototype.getManifoldByIndexInternal=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ol(c,a),dB)};zB.prototype.__destroy__=function(){pl(this.hy)}; +function AB(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=void 0===d?ql(a,c):void 0===e?rl(a,c,d):void 0===g?sl(a,c,d,e):tl(a,c,d,e,g);h(AB)[this.hy]=this}AB.prototype=Object.create(f.prototype);AB.prototype.constructor=AB;AB.prototype.iy=AB;AB.jy={};b.btAxisSweep3=AB;AB.prototype.__destroy__=function(){ul(this.hy)}; +function SA(){throw"cannot construct a VoidPtr, no constructor in IDL";}SA.prototype=Object.create(f.prototype);SA.prototype.constructor=SA;SA.prototype.iy=SA;SA.jy={};b.VoidPtr=SA;SA.prototype.__destroy__=function(){vl(this.hy)};function J(){this.hy=wl();h(J)[this.hy]=this}J.prototype=Object.create(f.prototype);J.prototype.constructor=J;J.prototype.iy=J;J.jy={};b.btSoftBodyWorldInfo=J;J.prototype.get_air_density=J.prototype.Yy=function(){return xl(this.hy)}; +J.prototype.set_air_density=J.prototype.FB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yl(c,a)};Object.defineProperty(J.prototype,"air_density",{get:J.prototype.Yy,set:J.prototype.FB});J.prototype.get_water_density=J.prototype.CB=function(){return zl(this.hy)};J.prototype.set_water_density=J.prototype.iE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Al(c,a)};Object.defineProperty(J.prototype,"water_density",{get:J.prototype.CB,set:J.prototype.iE}); +J.prototype.get_water_offset=J.prototype.EB=function(){return Bl(this.hy)};J.prototype.set_water_offset=J.prototype.kE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cl(c,a)};Object.defineProperty(J.prototype,"water_offset",{get:J.prototype.EB,set:J.prototype.kE});J.prototype.get_m_maxDisplacement=J.prototype.EA=function(){return Dl(this.hy)};J.prototype.set_m_maxDisplacement=J.prototype.kD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);El(c,a)}; +Object.defineProperty(J.prototype,"m_maxDisplacement",{get:J.prototype.EA,set:J.prototype.kD});J.prototype.get_water_normal=J.prototype.DB=function(){return k(Fl(this.hy),p)};J.prototype.set_water_normal=J.prototype.jE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gl(c,a)};Object.defineProperty(J.prototype,"water_normal",{get:J.prototype.DB,set:J.prototype.jE});J.prototype.get_m_broadphase=J.prototype.Gz=function(){return k(Hl(this.hy),QA)}; +J.prototype.set_m_broadphase=J.prototype.mC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Il(c,a)};Object.defineProperty(J.prototype,"m_broadphase",{get:J.prototype.Gz,set:J.prototype.mC});J.prototype.get_m_dispatcher=J.prototype.Xz=function(){return k(Jl(this.hy),OA)};J.prototype.set_m_dispatcher=J.prototype.DC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Kl(c,a)};Object.defineProperty(J.prototype,"m_dispatcher",{get:J.prototype.Xz,set:J.prototype.DC}); +J.prototype.get_m_gravity=J.prototype.fA=function(){return k(Ll(this.hy),p)};J.prototype.set_m_gravity=J.prototype.MC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ml(c,a)};Object.defineProperty(J.prototype,"m_gravity",{get:J.prototype.fA,set:J.prototype.MC});J.prototype.__destroy__=function(){Nl(this.hy)}; +function BB(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=void 0===d?Ol(a,c):void 0===e?_emscripten_bind_btConeTwistConstraint_btConeTwistConstraint_3(a,c,d):Pl(a,c,d,e);h(BB)[this.hy]=this}BB.prototype=Object.create(TA.prototype);BB.prototype.constructor=BB;BB.prototype.iy=BB;BB.jy={};b.btConeTwistConstraint=BB; +BB.prototype.setLimit=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ql(d,a,c)};BB.prototype.setAngularOnly=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rl(c,a)};BB.prototype.setDamping=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sl(c,a)};BB.prototype.enableMotor=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tl(c,a)}; +BB.prototype.setMaxMotorImpulse=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ul(c,a)};BB.prototype.setMaxMotorImpulseNormalized=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vl(c,a)};BB.prototype.setMotorTarget=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wl(c,a)};BB.prototype.setMotorTargetInConstraintSpace=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xl(c,a)}; +BB.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yl(c,a)};BB.prototype.getBreakingImpulseThreshold=function(){return Zl(this.hy)};BB.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$l(c,a)};BB.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return am(d,a,c)}; +BB.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);bm(e,a,c,d)};BB.prototype.__destroy__=function(){cm(this.hy)}; +function CB(a,c,d,e,g,n,F){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);this.hy=void 0===d?dm(a,c):void 0===e?em(a,c,d):void 0===g?fm(a,c,d,e):void 0===n?gm(a,c,d,e,g):void 0===F?hm(a,c,d,e,g,n):im(a,c,d,e,g,n,F);h(CB)[this.hy]=this}CB.prototype=Object.create(TA.prototype);CB.prototype.constructor=CB; +CB.prototype.iy=CB;CB.jy={};b.btHingeConstraint=CB;CB.prototype.setLimit=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);void 0===g?jm(n,a,c,d,e):km(n,a,c,d,e,g)};CB.prototype.enableAngularMotor=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);lm(e,a,c,d)}; +CB.prototype.setAngularOnly=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mm(c,a)};CB.prototype.enableMotor=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nm(c,a)};CB.prototype.setMaxMotorImpulse=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);om(c,a)};CB.prototype.setMotorTarget=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);pm(d,a,c)}; +CB.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qm(c,a)};CB.prototype.getBreakingImpulseThreshold=function(){return rm(this.hy)};CB.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sm(c,a)};CB.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return tm(d,a,c)}; +CB.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);um(e,a,c,d)};CB.prototype.__destroy__=function(){wm(this.hy)};function DB(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=xm(a,c);h(DB)[this.hy]=this}DB.prototype=Object.create(YA.prototype);DB.prototype.constructor=DB;DB.prototype.iy=DB;DB.jy={};b.btConeShapeZ=DB; +DB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ym(c,a)};DB.prototype.getLocalScaling=function(){return k(zm(this.hy),p)};DB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Am(d,a,c)};DB.prototype.__destroy__=function(){Bm(this.hy)};function EB(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Cm(a,c);h(EB)[this.hy]=this}EB.prototype=Object.create(YA.prototype); +EB.prototype.constructor=EB;EB.prototype.iy=EB;EB.jy={};b.btConeShapeX=EB;EB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dm(c,a)};EB.prototype.getLocalScaling=function(){return k(Em(this.hy),p)};EB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Fm(d,a,c)};EB.prototype.__destroy__=function(){Gm(this.hy)}; +function FB(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=void 0===a?Hm():void 0===c?Im(a):Jm(a,c);h(FB)[this.hy]=this}FB.prototype=Object.create(fB.prototype);FB.prototype.constructor=FB;FB.prototype.iy=FB;FB.jy={};b.btTriangleMesh=FB;FB.prototype.addTriangle=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);void 0===e?Km(g,a,c,d):Lm(g,a,c,d,e)}; +FB.prototype.findOrAddVertex=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return Mm(d,a,c)};FB.prototype.addIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nm(c,a)};FB.prototype.getIndexedMeshArray=function(){return k(Om(this.hy),uB)};FB.prototype.setScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pm(c,a)};FB.prototype.__destroy__=function(){Qm(this.hy)}; +function GB(a,c){IA();"object"==typeof a&&(a=MA(a));c&&"object"===typeof c&&(c=c.hy);this.hy=void 0===a?Rm():void 0===c?Sm(a):Tm(a,c);h(GB)[this.hy]=this}GB.prototype=Object.create(m.prototype);GB.prototype.constructor=GB;GB.prototype.iy=GB;GB.jy={};b.btConvexHullShape=GB;GB.prototype.addPoint=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===c?Um(d,a):Vm(d,a,c)}; +GB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wm(c,a)};GB.prototype.getMargin=function(){return Xm(this.hy)};GB.prototype.getNumVertices=function(){return Ym(this.hy)};GB.prototype.initializePolyhedralFeatures=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return!!Zm(c,a)};GB.prototype.recalcLocalAabb=function(){$m(this.hy)};GB.prototype.getConvexPolyhedron=function(){return k(an(this.hy),HB)}; +GB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bn(c,a)};GB.prototype.getLocalScaling=function(){return k(cn(this.hy),p)};GB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);dn(d,a,c)};GB.prototype.__destroy__=function(){en(this.hy)};function K(){this.hy=fn();h(K)[this.hy]=this}K.prototype=Object.create(f.prototype);K.prototype.constructor=K;K.prototype.iy=K;K.jy={}; +b.btVehicleTuning=K;K.prototype.get_m_suspensionStiffness=K.prototype.wy=function(){return gn(this.hy)};K.prototype.set_m_suspensionStiffness=K.prototype.Dy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);hn(c,a)};Object.defineProperty(K.prototype,"m_suspensionStiffness",{get:K.prototype.wy,set:K.prototype.Dy});K.prototype.get_m_suspensionCompression=K.prototype.bB=function(){return jn(this.hy)}; +K.prototype.set_m_suspensionCompression=K.prototype.ID=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kn(c,a)};Object.defineProperty(K.prototype,"m_suspensionCompression",{get:K.prototype.bB,set:K.prototype.ID});K.prototype.get_m_suspensionDamping=K.prototype.cB=function(){return ln(this.hy)};K.prototype.set_m_suspensionDamping=K.prototype.JD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mn(c,a)}; +Object.defineProperty(K.prototype,"m_suspensionDamping",{get:K.prototype.cB,set:K.prototype.JD});K.prototype.get_m_maxSuspensionTravelCm=K.prototype.vy=function(){return nn(this.hy)};K.prototype.set_m_maxSuspensionTravelCm=K.prototype.Cy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);on(c,a)};Object.defineProperty(K.prototype,"m_maxSuspensionTravelCm",{get:K.prototype.vy,set:K.prototype.Cy});K.prototype.get_m_frictionSlip=K.prototype.ry=function(){return pn(this.hy)}; +K.prototype.set_m_frictionSlip=K.prototype.yy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qn(c,a)};Object.defineProperty(K.prototype,"m_frictionSlip",{get:K.prototype.ry,set:K.prototype.yy});K.prototype.get_m_maxSuspensionForce=K.prototype.uy=function(){return rn(this.hy)};K.prototype.set_m_maxSuspensionForce=K.prototype.By=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sn(c,a)};Object.defineProperty(K.prototype,"m_maxSuspensionForce",{get:K.prototype.uy,set:K.prototype.By}); +function IB(){throw"cannot construct a btCollisionObjectWrapper, no constructor in IDL";}IB.prototype=Object.create(f.prototype);IB.prototype.constructor=IB;IB.prototype.iy=IB;IB.jy={};b.btCollisionObjectWrapper=IB;IB.prototype.getWorldTransform=function(){return k(tn(this.hy),r)};IB.prototype.getCollisionObject=function(){return k(un(this.hy),q)};IB.prototype.getCollisionShape=function(){return k(vn(this.hy),m)};function JB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=wn(a);h(JB)[this.hy]=this} +JB.prototype=Object.create(f.prototype);JB.prototype.constructor=JB;JB.prototype.iy=JB;JB.jy={};b.btShapeHull=JB;JB.prototype.buildHull=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return!!xn(c,a)};JB.prototype.numVertices=function(){return yn(this.hy)};JB.prototype.getVertexPointer=function(){return k(zn(this.hy),p)};JB.prototype.__destroy__=function(){An(this.hy)}; +function KB(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=void 0===a?Bn():void 0===c?Cn(a):Dn(a,c);h(KB)[this.hy]=this}KB.prototype=Object.create(gB.prototype);KB.prototype.constructor=KB;KB.prototype.iy=KB;KB.jy={};b.btDefaultMotionState=KB;KB.prototype.getWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);En(c,a)};KB.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fn(c,a)}; +KB.prototype.get_m_graphicsWorldTrans=KB.prototype.eA=function(){return k(Gn(this.hy),r)};KB.prototype.set_m_graphicsWorldTrans=KB.prototype.LC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Hn(c,a)};Object.defineProperty(KB.prototype,"m_graphicsWorldTrans",{get:KB.prototype.eA,set:KB.prototype.LC});KB.prototype.__destroy__=function(){In(this.hy)};function L(a){a&&"object"===typeof a&&(a=a.hy);this.hy=Jn(a);h(L)[this.hy]=this}L.prototype=Object.create(f.prototype); +L.prototype.constructor=L;L.prototype.iy=L;L.jy={};b.btWheelInfo=L;L.prototype.getSuspensionRestLength=function(){return Kn(this.hy)};L.prototype.updateWheel=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ln(d,a,c)};L.prototype.get_m_suspensionStiffness=L.prototype.wy=function(){return Mn(this.hy)};L.prototype.set_m_suspensionStiffness=L.prototype.Dy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nn(c,a)}; +Object.defineProperty(L.prototype,"m_suspensionStiffness",{get:L.prototype.wy,set:L.prototype.Dy});L.prototype.get_m_frictionSlip=L.prototype.ry=function(){return On(this.hy)};L.prototype.set_m_frictionSlip=L.prototype.yy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pn(c,a)};Object.defineProperty(L.prototype,"m_frictionSlip",{get:L.prototype.ry,set:L.prototype.yy});L.prototype.get_m_engineForce=L.prototype.aA=function(){return Qn(this.hy)}; +L.prototype.set_m_engineForce=L.prototype.HC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rn(c,a)};Object.defineProperty(L.prototype,"m_engineForce",{get:L.prototype.aA,set:L.prototype.HC});L.prototype.get_m_rollInfluence=L.prototype.SA=function(){return Sn(this.hy)};L.prototype.set_m_rollInfluence=L.prototype.yD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tn(c,a)};Object.defineProperty(L.prototype,"m_rollInfluence",{get:L.prototype.SA,set:L.prototype.yD}); +L.prototype.get_m_suspensionRestLength1=L.prototype.gB=function(){return Un(this.hy)};L.prototype.set_m_suspensionRestLength1=L.prototype.ND=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vn(c,a)};Object.defineProperty(L.prototype,"m_suspensionRestLength1",{get:L.prototype.gB,set:L.prototype.ND});L.prototype.get_m_wheelsRadius=L.prototype.uB=function(){return Wn(this.hy)};L.prototype.set_m_wheelsRadius=L.prototype.aE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xn(c,a)}; +Object.defineProperty(L.prototype,"m_wheelsRadius",{get:L.prototype.uB,set:L.prototype.aE});L.prototype.get_m_wheelsDampingCompression=L.prototype.My=function(){return Yn(this.hy)};L.prototype.set_m_wheelsDampingCompression=L.prototype.Vy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zn(c,a)};Object.defineProperty(L.prototype,"m_wheelsDampingCompression",{get:L.prototype.My,set:L.prototype.Vy});L.prototype.get_m_wheelsDampingRelaxation=L.prototype.Ny=function(){return $n(this.hy)}; +L.prototype.set_m_wheelsDampingRelaxation=L.prototype.Wy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ao(c,a)};Object.defineProperty(L.prototype,"m_wheelsDampingRelaxation",{get:L.prototype.Ny,set:L.prototype.Wy});L.prototype.get_m_steering=L.prototype.$A=function(){return bo(this.hy)};L.prototype.set_m_steering=L.prototype.GD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);co(c,a)};Object.defineProperty(L.prototype,"m_steering",{get:L.prototype.$A,set:L.prototype.GD}); +L.prototype.get_m_maxSuspensionForce=L.prototype.uy=function(){return eo(this.hy)};L.prototype.set_m_maxSuspensionForce=L.prototype.By=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fo(c,a)};Object.defineProperty(L.prototype,"m_maxSuspensionForce",{get:L.prototype.uy,set:L.prototype.By});L.prototype.get_m_maxSuspensionTravelCm=L.prototype.vy=function(){return go(this.hy)}; +L.prototype.set_m_maxSuspensionTravelCm=L.prototype.Cy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ho(c,a)};Object.defineProperty(L.prototype,"m_maxSuspensionTravelCm",{get:L.prototype.vy,set:L.prototype.Cy});L.prototype.get_m_wheelsSuspensionForce=L.prototype.vB=function(){return io(this.hy)};L.prototype.set_m_wheelsSuspensionForce=L.prototype.bE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jo(c,a)}; +Object.defineProperty(L.prototype,"m_wheelsSuspensionForce",{get:L.prototype.vB,set:L.prototype.bE});L.prototype.get_m_bIsFrontWheel=L.prototype.Fy=function(){return!!ko(this.hy)};L.prototype.set_m_bIsFrontWheel=L.prototype.Oy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lo(c,a)};Object.defineProperty(L.prototype,"m_bIsFrontWheel",{get:L.prototype.Fy,set:L.prototype.Oy});L.prototype.get_m_raycastInfo=L.prototype.QA=function(){return k(mo(this.hy),M)}; +L.prototype.set_m_raycastInfo=L.prototype.wD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);no(c,a)};Object.defineProperty(L.prototype,"m_raycastInfo",{get:L.prototype.QA,set:L.prototype.wD});L.prototype.get_m_chassisConnectionPointCS=L.prototype.Mz=function(){return k(oo(this.hy),p)};L.prototype.set_m_chassisConnectionPointCS=L.prototype.sC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);po(c,a)}; +Object.defineProperty(L.prototype,"m_chassisConnectionPointCS",{get:L.prototype.Mz,set:L.prototype.sC});L.prototype.get_m_worldTransform=L.prototype.wB=function(){return k(qo(this.hy),r)};L.prototype.set_m_worldTransform=L.prototype.cE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ro(c,a)};Object.defineProperty(L.prototype,"m_worldTransform",{get:L.prototype.wB,set:L.prototype.cE});L.prototype.get_m_wheelDirectionCS=L.prototype.Ly=function(){return k(so(this.hy),p)}; +L.prototype.set_m_wheelDirectionCS=L.prototype.Uy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);to(c,a)};Object.defineProperty(L.prototype,"m_wheelDirectionCS",{get:L.prototype.Ly,set:L.prototype.Uy});L.prototype.get_m_wheelAxleCS=L.prototype.Ky=function(){return k(uo(this.hy),p)};L.prototype.set_m_wheelAxleCS=L.prototype.Ty=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);vo(c,a)};Object.defineProperty(L.prototype,"m_wheelAxleCS",{get:L.prototype.Ky,set:L.prototype.Ty}); +L.prototype.get_m_rotation=L.prototype.UA=function(){return wo(this.hy)};L.prototype.set_m_rotation=L.prototype.AD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xo(c,a)};Object.defineProperty(L.prototype,"m_rotation",{get:L.prototype.UA,set:L.prototype.AD});L.prototype.get_m_deltaRotation=L.prototype.Vz=function(){return yo(this.hy)};L.prototype.set_m_deltaRotation=L.prototype.BC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zo(c,a)}; +Object.defineProperty(L.prototype,"m_deltaRotation",{get:L.prototype.Vz,set:L.prototype.BC});L.prototype.get_m_brake=L.prototype.Fz=function(){return Ao(this.hy)};L.prototype.set_m_brake=L.prototype.lC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bo(c,a)};Object.defineProperty(L.prototype,"m_brake",{get:L.prototype.Fz,set:L.prototype.lC});L.prototype.get_m_clippedInvContactDotSuspension=L.prototype.Nz=function(){return Co(this.hy)}; +L.prototype.set_m_clippedInvContactDotSuspension=L.prototype.tC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Do(c,a)};Object.defineProperty(L.prototype,"m_clippedInvContactDotSuspension",{get:L.prototype.Nz,set:L.prototype.tC});L.prototype.get_m_suspensionRelativeVelocity=L.prototype.eB=function(){return Eo(this.hy)};L.prototype.set_m_suspensionRelativeVelocity=L.prototype.LD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fo(c,a)}; +Object.defineProperty(L.prototype,"m_suspensionRelativeVelocity",{get:L.prototype.eB,set:L.prototype.LD});L.prototype.get_m_skidInfo=L.prototype.XA=function(){return Go(this.hy)};L.prototype.set_m_skidInfo=L.prototype.DD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ho(c,a)};Object.defineProperty(L.prototype,"m_skidInfo",{get:L.prototype.XA,set:L.prototype.DD});L.prototype.__destroy__=function(){Io(this.hy)}; +function N(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=void 0===a?Jo():void 0===c?_emscripten_bind_btVector4_btVector4_1(a):void 0===d?_emscripten_bind_btVector4_btVector4_2(a,c):void 0===e?_emscripten_bind_btVector4_btVector4_3(a,c,d):Ko(a,c,d,e);h(N)[this.hy]=this}N.prototype=Object.create(p.prototype);N.prototype.constructor=N;N.prototype.iy=N;N.jy={};b.btVector4=N;N.prototype.w=function(){return Lo(this.hy)}; +N.prototype.setValue=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);Mo(g,a,c,d,e)};N.prototype.length=N.prototype.length=function(){return No(this.hy)};N.prototype.x=N.prototype.x=function(){return Oo(this.hy)};N.prototype.y=N.prototype.y=function(){return Po(this.hy)};N.prototype.z=N.prototype.z=function(){return Qo(this.hy)}; +N.prototype.setX=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ro(c,a)};N.prototype.setY=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);So(c,a)};N.prototype.setZ=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);To(c,a)};N.prototype.normalize=N.prototype.normalize=function(){Uo(this.hy)};N.prototype.rotate=N.prototype.rotate=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return k(Vo(d,a,c),p)}; +N.prototype.dot=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Wo(c,a)};N.prototype.op_mul=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Xo(c,a),p)};N.prototype.op_add=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Yo(c,a),p)};N.prototype.op_sub=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Zo(c,a),p)};N.prototype.__destroy__=function(){$o(this.hy)};function LB(){this.hy=ap();h(LB)[this.hy]=this}LB.prototype=Object.create(f.prototype); +LB.prototype.constructor=LB;LB.prototype.iy=LB;LB.jy={};b.btDefaultCollisionConstructionInfo=LB;LB.prototype.__destroy__=function(){bp(this.hy)};function O(){throw"cannot construct a Anchor, no constructor in IDL";}O.prototype=Object.create(f.prototype);O.prototype.constructor=O;O.prototype.iy=O;O.jy={};b.Anchor=O;O.prototype.get_m_node=O.prototype.FA=function(){return k(cp(this.hy),Node)};O.prototype.set_m_node=O.prototype.lD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dp(c,a)}; +Object.defineProperty(O.prototype,"m_node",{get:O.prototype.FA,set:O.prototype.lD});O.prototype.get_m_local=O.prototype.zA=function(){return k(ep(this.hy),p)};O.prototype.set_m_local=O.prototype.fD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fp(c,a)};Object.defineProperty(O.prototype,"m_local",{get:O.prototype.zA,set:O.prototype.fD});O.prototype.get_m_body=O.prototype.Ez=function(){return k(gp(this.hy),I)}; +O.prototype.set_m_body=O.prototype.kC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);hp(c,a)};Object.defineProperty(O.prototype,"m_body",{get:O.prototype.Ez,set:O.prototype.kC});O.prototype.get_m_influence=O.prototype.sA=function(){return ip(this.hy)};O.prototype.set_m_influence=O.prototype.ZC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jp(c,a)};Object.defineProperty(O.prototype,"m_influence",{get:O.prototype.sA,set:O.prototype.ZC}); +O.prototype.get_m_c0=O.prototype.Hz=function(){return k(kp(this.hy),jB)};O.prototype.set_m_c0=O.prototype.nC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lp(c,a)};Object.defineProperty(O.prototype,"m_c0",{get:O.prototype.Hz,set:O.prototype.nC});O.prototype.get_m_c1=O.prototype.Iz=function(){return k(mp(this.hy),p)};O.prototype.set_m_c1=O.prototype.oC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);np(c,a)};Object.defineProperty(O.prototype,"m_c1",{get:O.prototype.Iz,set:O.prototype.oC}); +O.prototype.get_m_c2=O.prototype.Jz=function(){return op(this.hy)};O.prototype.set_m_c2=O.prototype.pC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pp(c,a)};Object.defineProperty(O.prototype,"m_c2",{get:O.prototype.Jz,set:O.prototype.pC});O.prototype.__destroy__=function(){qp(this.hy)};function P(){throw"cannot construct a btVehicleRaycasterResult, no constructor in IDL";}P.prototype=Object.create(f.prototype);P.prototype.constructor=P;P.prototype.iy=P;P.jy={}; +b.btVehicleRaycasterResult=P;P.prototype.get_m_hitPointInWorld=P.prototype.nA=function(){return k(rp(this.hy),p)};P.prototype.set_m_hitPointInWorld=P.prototype.UC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sp(c,a)};Object.defineProperty(P.prototype,"m_hitPointInWorld",{get:P.prototype.nA,set:P.prototype.UC});P.prototype.get_m_hitNormalInWorld=P.prototype.lA=function(){return k(tp(this.hy),p)}; +P.prototype.set_m_hitNormalInWorld=P.prototype.SC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);up(c,a)};Object.defineProperty(P.prototype,"m_hitNormalInWorld",{get:P.prototype.lA,set:P.prototype.SC});P.prototype.get_m_distFraction=P.prototype.Yz=function(){return vp(this.hy)};P.prototype.set_m_distFraction=P.prototype.EC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wp(c,a)};Object.defineProperty(P.prototype,"m_distFraction",{get:P.prototype.Yz,set:P.prototype.EC}); +P.prototype.__destroy__=function(){xp(this.hy)};function pB(){throw"cannot construct a btVector3Array, no constructor in IDL";}pB.prototype=Object.create(f.prototype);pB.prototype.constructor=pB;pB.prototype.iy=pB;pB.jy={};b.btVector3Array=pB;pB.prototype.size=pB.prototype.size=function(){return yp(this.hy)};pB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(zp(c,a),p)};pB.prototype.__destroy__=function(){Ap(this.hy)}; +function MB(){throw"cannot construct a btConstraintSolver, no constructor in IDL";}MB.prototype=Object.create(f.prototype);MB.prototype.constructor=MB;MB.prototype.iy=MB;MB.jy={};b.btConstraintSolver=MB;MB.prototype.__destroy__=function(){Bp(this.hy)};function Q(a,c,d){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);this.hy=Cp(a,c,d);h(Q)[this.hy]=this}Q.prototype=Object.create(ZA.prototype);Q.prototype.constructor=Q;Q.prototype.iy=Q;Q.jy={}; +b.btRaycastVehicle=Q;Q.prototype.applyEngineForce=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Dp(d,a,c)};Q.prototype.setSteeringValue=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ep(d,a,c)};Q.prototype.getWheelTransformWS=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Fp(c,a),r)}; +Q.prototype.updateWheelTransform=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Gp(d,a,c)};Q.prototype.addWheel=function(a,c,d,e,g,n,F){var aa=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);return k(Hp(aa,a,c,d,e,g,n,F),L)};Q.prototype.getNumWheels=function(){return Ip(this.hy)}; +Q.prototype.getRigidBody=function(){return k(Jp(this.hy),I)};Q.prototype.getWheelInfo=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Kp(c,a),L)};Q.prototype.setBrake=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Lp(d,a,c)};Q.prototype.setCoordinateSystem=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Mp(e,a,c,d)};Q.prototype.getCurrentSpeedKmHour=function(){return Np(this.hy)}; +Q.prototype.getChassisWorldTransform=function(){return k(Op(this.hy),r)};Q.prototype.rayCast=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Pp(c,a)};Q.prototype.updateVehicle=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qp(c,a)};Q.prototype.resetSuspension=function(){Rp(this.hy)};Q.prototype.getSteeringValue=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Sp(c,a)}; +Q.prototype.updateWheelTransformsWS=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===c?Tp(d,a):Up(d,a,c)};Q.prototype.setPitchControl=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vp(c,a)};Q.prototype.updateSuspension=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wp(c,a)};Q.prototype.updateFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xp(c,a)};Q.prototype.getRightAxis=function(){return Yp(this.hy)}; +Q.prototype.getUpAxis=function(){return Zp(this.hy)};Q.prototype.getForwardAxis=function(){return $p(this.hy)};Q.prototype.getForwardVector=function(){return k(aq(this.hy),p)};Q.prototype.getUserConstraintType=function(){return bq(this.hy)};Q.prototype.setUserConstraintType=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);cq(c,a)};Q.prototype.setUserConstraintId=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dq(c,a)};Q.prototype.getUserConstraintId=function(){return eq(this.hy)}; +Q.prototype.updateAction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);fq(d,a,c)};Q.prototype.__destroy__=function(){gq(this.hy)};function NB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=hq(a);h(NB)[this.hy]=this}NB.prototype=Object.create(bB.prototype);NB.prototype.constructor=NB;NB.prototype.iy=NB;NB.jy={};b.btCylinderShapeX=NB;NB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);iq(c,a)};NB.prototype.getMargin=function(){return jq(this.hy)}; +NB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kq(c,a)};NB.prototype.getLocalScaling=function(){return k(lq(this.hy),p)};NB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);mq(d,a,c)};NB.prototype.__destroy__=function(){nq(this.hy)};function OB(a){a&&"object"===typeof a&&(a=a.hy);this.hy=oq(a);h(OB)[this.hy]=this}OB.prototype=Object.create(bB.prototype);OB.prototype.constructor=OB; +OB.prototype.iy=OB;OB.jy={};b.btCylinderShapeZ=OB;OB.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pq(c,a)};OB.prototype.getMargin=function(){return qq(this.hy)};OB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);rq(c,a)};OB.prototype.getLocalScaling=function(){return k(sq(this.hy),p)};OB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);tq(d,a,c)}; +OB.prototype.__destroy__=function(){uq(this.hy)};function HB(){throw"cannot construct a btConvexPolyhedron, no constructor in IDL";}HB.prototype=Object.create(f.prototype);HB.prototype.constructor=HB;HB.prototype.iy=HB;HB.jy={};b.btConvexPolyhedron=HB;HB.prototype.get_m_vertices=HB.prototype.qB=function(){return k(vq(this.hy),pB)};HB.prototype.set_m_vertices=HB.prototype.XD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wq(c,a)}; +Object.defineProperty(HB.prototype,"m_vertices",{get:HB.prototype.qB,set:HB.prototype.XD});HB.prototype.get_m_faces=HB.prototype.Gy=function(){return k(xq(this.hy),PB)};HB.prototype.set_m_faces=HB.prototype.Py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yq(c,a)};Object.defineProperty(HB.prototype,"m_faces",{get:HB.prototype.Gy,set:HB.prototype.Py});HB.prototype.__destroy__=function(){zq(this.hy)};function QB(){this.hy=Aq();h(QB)[this.hy]=this}QB.prototype=Object.create(f.prototype); +QB.prototype.constructor=QB;QB.prototype.iy=QB;QB.jy={};b.btSequentialImpulseConstraintSolver=QB;QB.prototype.__destroy__=function(){Bq(this.hy)};function RB(){throw"cannot construct a tAnchorArray, no constructor in IDL";}RB.prototype=Object.create(f.prototype);RB.prototype.constructor=RB;RB.prototype.iy=RB;RB.jy={};b.tAnchorArray=RB;RB.prototype.size=RB.prototype.size=function(){return Cq(this.hy)};RB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Dq(c,a),O)}; +RB.prototype.clear=RB.prototype.clear=function(){Eq(this.hy)};RB.prototype.push_back=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fq(c,a)};RB.prototype.pop_back=function(){Gq(this.hy)};RB.prototype.__destroy__=function(){Hq(this.hy)};function M(){throw"cannot construct a RaycastInfo, no constructor in IDL";}M.prototype=Object.create(f.prototype);M.prototype.constructor=M;M.prototype.iy=M;M.jy={};b.RaycastInfo=M; +M.prototype.get_m_contactNormalWS=M.prototype.Pz=function(){return k(Iq(this.hy),p)};M.prototype.set_m_contactNormalWS=M.prototype.vC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Jq(c,a)};Object.defineProperty(M.prototype,"m_contactNormalWS",{get:M.prototype.Pz,set:M.prototype.vC});M.prototype.get_m_contactPointWS=M.prototype.Qz=function(){return k(Kq(this.hy),p)};M.prototype.set_m_contactPointWS=M.prototype.wC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lq(c,a)}; +Object.defineProperty(M.prototype,"m_contactPointWS",{get:M.prototype.Qz,set:M.prototype.wC});M.prototype.get_m_suspensionLength=M.prototype.dB=function(){return Mq(this.hy)};M.prototype.set_m_suspensionLength=M.prototype.KD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nq(c,a)};Object.defineProperty(M.prototype,"m_suspensionLength",{get:M.prototype.dB,set:M.prototype.KD});M.prototype.get_m_hardPointWS=M.prototype.hA=function(){return k(Oq(this.hy),p)}; +M.prototype.set_m_hardPointWS=M.prototype.OC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pq(c,a)};Object.defineProperty(M.prototype,"m_hardPointWS",{get:M.prototype.hA,set:M.prototype.OC});M.prototype.get_m_wheelDirectionWS=M.prototype.sB=function(){return k(Qq(this.hy),p)};M.prototype.set_m_wheelDirectionWS=M.prototype.ZD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rq(c,a)};Object.defineProperty(M.prototype,"m_wheelDirectionWS",{get:M.prototype.sB,set:M.prototype.ZD}); +M.prototype.get_m_wheelAxleWS=M.prototype.rB=function(){return k(Sq(this.hy),p)};M.prototype.set_m_wheelAxleWS=M.prototype.YD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tq(c,a)};Object.defineProperty(M.prototype,"m_wheelAxleWS",{get:M.prototype.rB,set:M.prototype.YD});M.prototype.get_m_isInContact=M.prototype.tA=function(){return!!Uq(this.hy)};M.prototype.set_m_isInContact=M.prototype.$C=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vq(c,a)}; +Object.defineProperty(M.prototype,"m_isInContact",{get:M.prototype.tA,set:M.prototype.$C});M.prototype.get_m_groundObject=M.prototype.gA=function(){return Wq(this.hy)};M.prototype.set_m_groundObject=M.prototype.NC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xq(c,a)};Object.defineProperty(M.prototype,"m_groundObject",{get:M.prototype.gA,set:M.prototype.NC});M.prototype.__destroy__=function(){Yq(this.hy)}; +function SB(a,c,d){IA();a&&"object"===typeof a&&(a=a.hy);"object"==typeof c&&(c=MA(c));d&&"object"===typeof d&&(d=d.hy);this.hy=Zq(a,c,d);h(SB)[this.hy]=this}SB.prototype=Object.create(m.prototype);SB.prototype.constructor=SB;SB.prototype.iy=SB;SB.jy={};b.btMultiSphereShape=SB;SB.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$q(c,a)};SB.prototype.getLocalScaling=function(){return k(ar(this.hy),p)}; +SB.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);br(d,a,c)};SB.prototype.__destroy__=function(){cr(this.hy)};function R(a,c,d,e){IA();a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);"object"==typeof e&&(e=MA(e));this.hy=dr(a,c,d,e);h(R)[this.hy]=this}R.prototype=Object.create(q.prototype);R.prototype.constructor=R;R.prototype.iy=R;R.jy={};b.btSoftBody=R; +R.prototype.checkLink=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return!!er(d,a,c)};R.prototype.checkFace=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);return!!fr(e,a,c,d)};R.prototype.appendMaterial=function(){return k(gr(this.hy),A)};R.prototype.appendNode=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);hr(d,a,c)}; +R.prototype.appendLink=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);ir(g,a,c,d,e)};R.prototype.appendFace=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);jr(g,a,c,d,e)}; +R.prototype.appendTetra=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);kr(n,a,c,d,e,g)};R.prototype.appendAnchor=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);lr(g,a,c,d,e)}; +R.prototype.addForce=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===c?mr(d,a):nr(d,a,c)};R.prototype.addAeroForceToNode=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);or(d,a,c)};R.prototype.getTotalMass=function(){return pr(this.hy)};R.prototype.setTotalMass=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);qr(d,a,c)}; +R.prototype.setMass=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);rr(d,a,c)};R.prototype.transform=R.prototype.transform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sr(c,a)};R.prototype.translate=R.prototype.translate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);tr(c,a)};R.prototype.rotate=R.prototype.rotate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ur(c,a)}; +R.prototype.scale=R.prototype.scale=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);vr(c,a)};R.prototype.generateClusters=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return void 0===c?wr(d,a):xr(d,a,c)};R.prototype.generateBendingConstraints=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return yr(d,a,c)}; +R.prototype.upcast=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(zr(c,a),R)};R.prototype.setAnisotropicFriction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ar(d,a,c)};R.prototype.getCollisionShape=function(){return k(Br(this.hy),m)};R.prototype.setContactProcessingThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cr(c,a)}; +R.prototype.setActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dr(c,a)};R.prototype.forceActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Er(c,a)};R.prototype.activate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);void 0===a?Fr(c):Gr(c,a)};R.prototype.isActive=function(){return!!Hr(this.hy)};R.prototype.isKinematicObject=function(){return!!Ir(this.hy)};R.prototype.isStaticObject=function(){return!!Jr(this.hy)}; +R.prototype.isStaticOrKinematicObject=function(){return!!Kr(this.hy)};R.prototype.getRestitution=function(){return Lr(this.hy)};R.prototype.getFriction=function(){return Mr(this.hy)};R.prototype.getRollingFriction=function(){return Nr(this.hy)};R.prototype.setRestitution=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Or(c,a)};R.prototype.setFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pr(c,a)}; +R.prototype.setRollingFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qr(c,a)};R.prototype.getWorldTransform=function(){return k(Rr(this.hy),r)};R.prototype.getCollisionFlags=function(){return Sr(this.hy)};R.prototype.setCollisionFlags=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tr(c,a)};R.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ur(c,a)}; +R.prototype.setCollisionShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vr(c,a)};R.prototype.setCcdMotionThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wr(c,a)};R.prototype.setCcdSweptSphereRadius=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Xr(c,a)};R.prototype.getUserIndex=function(){return Yr(this.hy)};R.prototype.setUserIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zr(c,a)}; +R.prototype.getUserPointer=function(){return k($r(this.hy),SA)};R.prototype.setUserPointer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);as(c,a)};R.prototype.getBroadphaseHandle=function(){return k(bs(this.hy),t)};R.prototype.get_m_cfg=R.prototype.Kz=function(){return k(cs(this.hy),S)};R.prototype.set_m_cfg=R.prototype.qC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ds(c,a)};Object.defineProperty(R.prototype,"m_cfg",{get:R.prototype.Kz,set:R.prototype.qC}); +R.prototype.get_m_nodes=R.prototype.GA=function(){return k(es(this.hy),TB)};R.prototype.set_m_nodes=R.prototype.mD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gs(c,a)};Object.defineProperty(R.prototype,"m_nodes",{get:R.prototype.GA,set:R.prototype.mD});R.prototype.get_m_faces=R.prototype.Gy=function(){return k(hs(this.hy),UB)};R.prototype.set_m_faces=R.prototype.Py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);is(c,a)}; +Object.defineProperty(R.prototype,"m_faces",{get:R.prototype.Gy,set:R.prototype.Py});R.prototype.get_m_materials=R.prototype.DA=function(){return k(js(this.hy),qB)};R.prototype.set_m_materials=R.prototype.jD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ks(c,a)};Object.defineProperty(R.prototype,"m_materials",{get:R.prototype.DA,set:R.prototype.jD});R.prototype.get_m_anchors=R.prototype.Az=function(){return k(ls(this.hy),RB)}; +R.prototype.set_m_anchors=R.prototype.gC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ms(c,a)};Object.defineProperty(R.prototype,"m_anchors",{get:R.prototype.Az,set:R.prototype.gC});R.prototype.__destroy__=function(){ns(this.hy)};function VB(){throw"cannot construct a btIntArray, no constructor in IDL";}VB.prototype=Object.create(f.prototype);VB.prototype.constructor=VB;VB.prototype.iy=VB;VB.jy={};b.btIntArray=VB;VB.prototype.size=VB.prototype.size=function(){return ps(this.hy)}; +VB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return qs(c,a)};VB.prototype.__destroy__=function(){rs(this.hy)};function S(){throw"cannot construct a Config, no constructor in IDL";}S.prototype=Object.create(f.prototype);S.prototype.constructor=S;S.prototype.iy=S;S.jy={};b.Config=S;S.prototype.get_kVCF=S.prototype.sz=function(){return ss(this.hy)};S.prototype.set_kVCF=S.prototype.$B=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ts(c,a)}; +Object.defineProperty(S.prototype,"kVCF",{get:S.prototype.sz,set:S.prototype.$B});S.prototype.get_kDP=S.prototype.fz=function(){return us(this.hy)};S.prototype.set_kDP=S.prototype.NB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);vs(c,a)};Object.defineProperty(S.prototype,"kDP",{get:S.prototype.fz,set:S.prototype.NB});S.prototype.get_kDG=S.prototype.ez=function(){return xs(this.hy)};S.prototype.set_kDG=S.prototype.MB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ys(c,a)}; +Object.defineProperty(S.prototype,"kDG",{get:S.prototype.ez,set:S.prototype.MB});S.prototype.get_kLF=S.prototype.hz=function(){return zs(this.hy)};S.prototype.set_kLF=S.prototype.PB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);As(c,a)};Object.defineProperty(S.prototype,"kLF",{get:S.prototype.hz,set:S.prototype.PB});S.prototype.get_kPR=S.prototype.jz=function(){return Bs(this.hy)};S.prototype.set_kPR=S.prototype.RB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cs(c,a)}; +Object.defineProperty(S.prototype,"kPR",{get:S.prototype.jz,set:S.prototype.RB});S.prototype.get_kVC=S.prototype.rz=function(){return Ds(this.hy)};S.prototype.set_kVC=S.prototype.ZB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Es(c,a)};Object.defineProperty(S.prototype,"kVC",{get:S.prototype.rz,set:S.prototype.ZB});S.prototype.get_kDF=S.prototype.dz=function(){return Fs(this.hy)};S.prototype.set_kDF=S.prototype.LB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gs(c,a)}; +Object.defineProperty(S.prototype,"kDF",{get:S.prototype.dz,set:S.prototype.LB});S.prototype.get_kMT=S.prototype.iz=function(){return Hs(this.hy)};S.prototype.set_kMT=S.prototype.QB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Is(c,a)};Object.defineProperty(S.prototype,"kMT",{get:S.prototype.iz,set:S.prototype.QB});S.prototype.get_kCHR=S.prototype.cz=function(){return Js(this.hy)};S.prototype.set_kCHR=S.prototype.KB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ks(c,a)}; +Object.defineProperty(S.prototype,"kCHR",{get:S.prototype.cz,set:S.prototype.KB});S.prototype.get_kKHR=S.prototype.gz=function(){return Ls(this.hy)};S.prototype.set_kKHR=S.prototype.OB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ms(c,a)};Object.defineProperty(S.prototype,"kKHR",{get:S.prototype.gz,set:S.prototype.OB});S.prototype.get_kSHR=S.prototype.kz=function(){return Ns(this.hy)}; +S.prototype.set_kSHR=S.prototype.SB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Os(c,a)};Object.defineProperty(S.prototype,"kSHR",{get:S.prototype.kz,set:S.prototype.SB});S.prototype.get_kAHR=S.prototype.bz=function(){return Ps(this.hy)};S.prototype.set_kAHR=S.prototype.JB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qs(c,a)};Object.defineProperty(S.prototype,"kAHR",{get:S.prototype.bz,set:S.prototype.JB});S.prototype.get_kSRHR_CL=S.prototype.nz=function(){return Rs(this.hy)}; +S.prototype.set_kSRHR_CL=S.prototype.VB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ss(c,a)};Object.defineProperty(S.prototype,"kSRHR_CL",{get:S.prototype.nz,set:S.prototype.VB});S.prototype.get_kSKHR_CL=S.prototype.lz=function(){return Ts(this.hy)};S.prototype.set_kSKHR_CL=S.prototype.TB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Us(c,a)};Object.defineProperty(S.prototype,"kSKHR_CL",{get:S.prototype.lz,set:S.prototype.TB});S.prototype.get_kSSHR_CL=S.prototype.pz=function(){return Vs(this.hy)}; +S.prototype.set_kSSHR_CL=S.prototype.XB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ws(c,a)};Object.defineProperty(S.prototype,"kSSHR_CL",{get:S.prototype.pz,set:S.prototype.XB});S.prototype.get_kSR_SPLT_CL=S.prototype.oz=function(){return Xs(this.hy)};S.prototype.set_kSR_SPLT_CL=S.prototype.WB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ys(c,a)};Object.defineProperty(S.prototype,"kSR_SPLT_CL",{get:S.prototype.oz,set:S.prototype.WB}); +S.prototype.get_kSK_SPLT_CL=S.prototype.mz=function(){return Zs(this.hy)};S.prototype.set_kSK_SPLT_CL=S.prototype.UB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$s(c,a)};Object.defineProperty(S.prototype,"kSK_SPLT_CL",{get:S.prototype.mz,set:S.prototype.UB});S.prototype.get_kSS_SPLT_CL=S.prototype.qz=function(){return at(this.hy)};S.prototype.set_kSS_SPLT_CL=S.prototype.YB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bt(c,a)}; +Object.defineProperty(S.prototype,"kSS_SPLT_CL",{get:S.prototype.qz,set:S.prototype.YB});S.prototype.get_maxvolume=S.prototype.yB=function(){return ct(this.hy)};S.prototype.set_maxvolume=S.prototype.eE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dt(c,a)};Object.defineProperty(S.prototype,"maxvolume",{get:S.prototype.yB,set:S.prototype.eE});S.prototype.get_timescale=S.prototype.AB=function(){return et(this.hy)}; +S.prototype.set_timescale=S.prototype.gE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ft(c,a)};Object.defineProperty(S.prototype,"timescale",{get:S.prototype.AB,set:S.prototype.gE});S.prototype.get_viterations=S.prototype.BB=function(){return gt(this.hy)};S.prototype.set_viterations=S.prototype.hE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ht(c,a)};Object.defineProperty(S.prototype,"viterations",{get:S.prototype.BB,set:S.prototype.hE}); +S.prototype.get_piterations=S.prototype.zB=function(){return it(this.hy)};S.prototype.set_piterations=S.prototype.fE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jt(c,a)};Object.defineProperty(S.prototype,"piterations",{get:S.prototype.zB,set:S.prototype.fE});S.prototype.get_diterations=S.prototype.az=function(){return kt(this.hy)};S.prototype.set_diterations=S.prototype.IB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lt(c,a)}; +Object.defineProperty(S.prototype,"diterations",{get:S.prototype.az,set:S.prototype.IB});S.prototype.get_citerations=S.prototype.Zy=function(){return mt(this.hy)};S.prototype.set_citerations=S.prototype.GB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nt(c,a)};Object.defineProperty(S.prototype,"citerations",{get:S.prototype.Zy,set:S.prototype.GB});S.prototype.get_collisions=S.prototype.$y=function(){return ot(this.hy)}; +S.prototype.set_collisions=S.prototype.HB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pt(c,a)};Object.defineProperty(S.prototype,"collisions",{get:S.prototype.$y,set:S.prototype.HB});S.prototype.__destroy__=function(){qt(this.hy)};function Node(){throw"cannot construct a Node, no constructor in IDL";}Node.prototype=Object.create(f.prototype);Node.prototype.constructor=Node;Node.prototype.iy=Node;Node.jy={};b.Node=Node; +Node.prototype.get_m_x=Node.prototype.xB=function(){return k(rt(this.hy),p)};Node.prototype.set_m_x=Node.prototype.dE=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);st(c,a)};Object.defineProperty(Node.prototype,"m_x",{get:Node.prototype.xB,set:Node.prototype.dE});Node.prototype.get_m_q=Node.prototype.OA=function(){return k(tt(this.hy),p)};Node.prototype.set_m_q=Node.prototype.uD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ut(c,a)}; +Object.defineProperty(Node.prototype,"m_q",{get:Node.prototype.OA,set:Node.prototype.uD});Node.prototype.get_m_v=Node.prototype.pB=function(){return k(vt(this.hy),p)};Node.prototype.set_m_v=Node.prototype.WD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wt(c,a)};Object.defineProperty(Node.prototype,"m_v",{get:Node.prototype.pB,set:Node.prototype.WD});Node.prototype.get_m_f=Node.prototype.bA=function(){return k(xt(this.hy),p)}; +Node.prototype.set_m_f=Node.prototype.IC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yt(c,a)};Object.defineProperty(Node.prototype,"m_f",{get:Node.prototype.bA,set:Node.prototype.IC});Node.prototype.get_m_n=Node.prototype.Hy=function(){return k(zt(this.hy),p)};Node.prototype.set_m_n=Node.prototype.Qy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);At(c,a)};Object.defineProperty(Node.prototype,"m_n",{get:Node.prototype.Hy,set:Node.prototype.Qy}); +Node.prototype.get_m_im=Node.prototype.pA=function(){return Bt(this.hy)};Node.prototype.set_m_im=Node.prototype.WC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ct(c,a)};Object.defineProperty(Node.prototype,"m_im",{get:Node.prototype.pA,set:Node.prototype.WC});Node.prototype.get_m_area=Node.prototype.Dz=function(){return Dt(this.hy)};Node.prototype.set_m_area=Node.prototype.jC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Et(c,a)}; +Object.defineProperty(Node.prototype,"m_area",{get:Node.prototype.Dz,set:Node.prototype.jC});Node.prototype.__destroy__=function(){Ft(this.hy)};function WB(){this.hy=Gt();h(WB)[this.hy]=this}WB.prototype=Object.create(f.prototype);WB.prototype.constructor=WB;WB.prototype.iy=WB;WB.jy={};b.btGhostPairCallback=WB;WB.prototype.__destroy__=function(){Ht(this.hy)};function XB(){throw"cannot construct a btOverlappingPairCallback, no constructor in IDL";}XB.prototype=Object.create(f.prototype); +XB.prototype.constructor=XB;XB.prototype.iy=XB;XB.jy={};b.btOverlappingPairCallback=XB;XB.prototype.__destroy__=function(){It(this.hy)};function T(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=void 0===e?Jt(a,c,d):Kt(a,c,d,e);h(T)[this.hy]=this}T.prototype=Object.create(ZA.prototype);T.prototype.constructor=T;T.prototype.iy=T;T.jy={};b.btKinematicCharacterController=T; +T.prototype.setUpAxis=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Lt(c,a)};T.prototype.setWalkDirection=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Mt(c,a)};T.prototype.setVelocityForTimeInterval=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Nt(d,a,c)};T.prototype.warp=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ot(c,a)};T.prototype.preStep=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pt(c,a)}; +T.prototype.playerStep=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Qt(d,a,c)};T.prototype.setFallSpeed=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rt(c,a)};T.prototype.setJumpSpeed=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);St(c,a)};T.prototype.setMaxJumpHeight=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tt(c,a)};T.prototype.canJump=function(){return!!Ut(this.hy)};T.prototype.jump=function(){Vt(this.hy)}; +T.prototype.setGravity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wt(c,a)};T.prototype.getGravity=function(){return Xt(this.hy)};T.prototype.setMaxSlope=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yt(c,a)};T.prototype.getMaxSlope=function(){return Zt(this.hy)};T.prototype.getGhostObject=function(){return k($t(this.hy),U)};T.prototype.setUseGhostSweepTest=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);au(c,a)};T.prototype.onGround=function(){return!!bu(this.hy)}; +T.prototype.setUpInterpolate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);cu(c,a)};T.prototype.updateAction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);du(d,a,c)};T.prototype.__destroy__=function(){eu(this.hy)};function YB(){throw"cannot construct a btSoftBodyArray, no constructor in IDL";}YB.prototype=Object.create(f.prototype);YB.prototype.constructor=YB;YB.prototype.iy=YB;YB.jy={};b.btSoftBodyArray=YB; +YB.prototype.size=YB.prototype.size=function(){return fu(this.hy)};YB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(gu(c,a),R)};YB.prototype.__destroy__=function(){hu(this.hy)};function PB(){throw"cannot construct a btFaceArray, no constructor in IDL";}PB.prototype=Object.create(f.prototype);PB.prototype.constructor=PB;PB.prototype.iy=PB;PB.jy={};b.btFaceArray=PB;PB.prototype.size=PB.prototype.size=function(){return iu(this.hy)}; +PB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(ju(c,a),ZB)};PB.prototype.__destroy__=function(){ku(this.hy)};function $B(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=lu(a,c);h($B)[this.hy]=this}$B.prototype=Object.create(UA.prototype);$B.prototype.constructor=$B;$B.prototype.iy=$B;$B.jy={};b.btStaticPlaneShape=$B;$B.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mu(c,a)}; +$B.prototype.getLocalScaling=function(){return k(nu(this.hy),p)};$B.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);ou(d,a,c)};$B.prototype.__destroy__=function(){pu(this.hy)};function PA(){throw"cannot construct a btOverlappingPairCache, no constructor in IDL";}PA.prototype=Object.create(f.prototype);PA.prototype.constructor=PA;PA.prototype.iy=PA;PA.jy={};b.btOverlappingPairCache=PA; +PA.prototype.setInternalGhostPairCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qu(c,a)};PA.prototype.getNumOverlappingPairs=function(){return ru(this.hy)};PA.prototype.__destroy__=function(){su(this.hy)};function vB(){throw"cannot construct a btIndexedMesh, no constructor in IDL";}vB.prototype=Object.create(f.prototype);vB.prototype.constructor=vB;vB.prototype.iy=vB;vB.jy={};b.btIndexedMesh=vB;vB.prototype.get_m_numTriangles=vB.prototype.KA=function(){return tu(this.hy)}; +vB.prototype.set_m_numTriangles=vB.prototype.qD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);uu(c,a)};Object.defineProperty(vB.prototype,"m_numTriangles",{get:vB.prototype.KA,set:vB.prototype.qD});vB.prototype.__destroy__=function(){vu(this.hy)};function V(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=wu(a,c,d,e,g);h(V)[this.hy]=this}V.prototype=Object.create(x.prototype); +V.prototype.constructor=V;V.prototype.iy=V;V.jy={};b.btSoftRigidDynamicsWorld=V;V.prototype.addSoftBody=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);xu(e,a,c,d)};V.prototype.removeSoftBody=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yu(c,a)};V.prototype.removeCollisionObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);zu(c,a)};V.prototype.getWorldInfo=function(){return k(Au(this.hy),J)}; +V.prototype.getSoftBodyArray=function(){return k(Bu(this.hy),YB)};V.prototype.getDispatcher=function(){return k(Cu(this.hy),OA)};V.prototype.rayTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Du(e,a,c,d)};V.prototype.getPairCache=function(){return k(Eu(this.hy),PA)};V.prototype.getDispatchInfo=function(){return k(Fu(this.hy),l)}; +V.prototype.addCollisionObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?Gu(e,a):void 0===d?Hu(e,a,c):Iu(e,a,c,d)};V.prototype.getBroadphase=function(){return k(Ju(this.hy),QA)}; +V.prototype.convexSweepTest=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);Ku(n,a,c,d,e,g)};V.prototype.contactPairTest=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Lu(e,a,c,d)}; +V.prototype.contactTest=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Mu(d,a,c)};V.prototype.updateSingleAabb=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nu(c,a)};V.prototype.setDebugDrawer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ou(c,a)};V.prototype.getDebugDrawer=function(){return k(Pu(this.hy),RA)};V.prototype.debugDrawWorld=function(){Qu(this.hy)}; +V.prototype.debugDrawObject=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Ru(e,a,c,d)};V.prototype.setGravity=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Su(c,a)};V.prototype.getGravity=function(){return k(Tu(this.hy),p)}; +V.prototype.addRigidBody=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?Uu(e,a):void 0===d?_emscripten_bind_btSoftRigidDynamicsWorld_addRigidBody_2(e,a,c):Vu(e,a,c,d)};V.prototype.removeRigidBody=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wu(c,a)}; +V.prototype.addConstraint=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===c?Xu(d,a):Yu(d,a,c)};V.prototype.removeConstraint=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Zu(c,a)};V.prototype.stepSimulation=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);return void 0===c?$u(e,a):void 0===d?av(e,a,c):bv(e,a,c,d)}; +V.prototype.setContactAddedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);cv(c,a)};V.prototype.setContactProcessedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);dv(c,a)};V.prototype.setContactDestroyedCallback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ev(c,a)};V.prototype.addAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fv(c,a)};V.prototype.removeAction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gv(c,a)}; +V.prototype.getSolverInfo=function(){return k(hv(this.hy),v)};V.prototype.setInternalTickCallback=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);void 0===c?iv(e,a):void 0===d?jv(e,a,c):kv(e,a,c,d)};V.prototype.__destroy__=function(){lv(this.hy)}; +function aC(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=mv(a,c,d,e);h(aC)[this.hy]=this}aC.prototype=Object.create(TA.prototype);aC.prototype.constructor=aC;aC.prototype.iy=aC;aC.jy={};b.btFixedConstraint=aC;aC.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nv(c,a)};aC.prototype.getBreakingImpulseThreshold=function(){return ov(this.hy)}; +aC.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pv(c,a)};aC.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return qv(d,a,c)};aC.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);rv(e,a,c,d)};aC.prototype.__destroy__=function(){sv(this.hy)}; +function r(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=void 0===a?tv():void 0===c?_emscripten_bind_btTransform_btTransform_1(a):uv(a,c);h(r)[this.hy]=this}r.prototype=Object.create(f.prototype);r.prototype.constructor=r;r.prototype.iy=r;r.jy={};b.btTransform=r;r.prototype.setIdentity=function(){vv(this.hy)};r.prototype.setOrigin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);wv(c,a)}; +r.prototype.setRotation=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xv(c,a)};r.prototype.getOrigin=function(){return k(yv(this.hy),p)};r.prototype.getRotation=function(){return k(zv(this.hy),W)};r.prototype.getBasis=function(){return k(Av(this.hy),jB)};r.prototype.setFromOpenGLMatrix=function(a){var c=this.hy;IA();"object"==typeof a&&(a=MA(a));Bv(c,a)};r.prototype.inverse=r.prototype.inverse=function(){return k(Cv(this.hy),r)}; +r.prototype.op_mul=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Dv(c,a),r)};r.prototype.__destroy__=function(){Ev(this.hy)};function X(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=Fv(a,c);h(X)[this.hy]=this}X.prototype=Object.create(z.prototype);X.prototype.constructor=X;X.prototype.iy=X;X.jy={};b.ClosestRayResultCallback=X;X.prototype.hasHit=function(){return!!Gv(this.hy)}; +X.prototype.get_m_rayFromWorld=X.prototype.Iy=function(){return k(Hv(this.hy),p)};X.prototype.set_m_rayFromWorld=X.prototype.Ry=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Iv(c,a)};Object.defineProperty(X.prototype,"m_rayFromWorld",{get:X.prototype.Iy,set:X.prototype.Ry});X.prototype.get_m_rayToWorld=X.prototype.Jy=function(){return k(Jv(this.hy),p)};X.prototype.set_m_rayToWorld=X.prototype.Sy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Kv(c,a)}; +Object.defineProperty(X.prototype,"m_rayToWorld",{get:X.prototype.Jy,set:X.prototype.Sy});X.prototype.get_m_hitNormalWorld=X.prototype.sy=function(){return k(Lv(this.hy),p)};X.prototype.set_m_hitNormalWorld=X.prototype.zy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Mv(c,a)};Object.defineProperty(X.prototype,"m_hitNormalWorld",{get:X.prototype.sy,set:X.prototype.zy});X.prototype.get_m_hitPointWorld=X.prototype.ty=function(){return k(Nv(this.hy),p)}; +X.prototype.set_m_hitPointWorld=X.prototype.Ay=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ov(c,a)};Object.defineProperty(X.prototype,"m_hitPointWorld",{get:X.prototype.ty,set:X.prototype.Ay});X.prototype.get_m_collisionFilterGroup=X.prototype.ky=function(){return Pv(this.hy)};X.prototype.set_m_collisionFilterGroup=X.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Qv(c,a)};Object.defineProperty(X.prototype,"m_collisionFilterGroup",{get:X.prototype.ky,set:X.prototype.my}); +X.prototype.get_m_collisionFilterMask=X.prototype.ly=function(){return Rv(this.hy)};X.prototype.set_m_collisionFilterMask=X.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sv(c,a)};Object.defineProperty(X.prototype,"m_collisionFilterMask",{get:X.prototype.ly,set:X.prototype.ny});X.prototype.get_m_closestHitFraction=X.prototype.oy=function(){return Tv(this.hy)}; +X.prototype.set_m_closestHitFraction=X.prototype.py=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Uv(c,a)};Object.defineProperty(X.prototype,"m_closestHitFraction",{get:X.prototype.oy,set:X.prototype.py});X.prototype.get_m_collisionObject=X.prototype.qy=function(){return k(Vv(this.hy),q)};X.prototype.set_m_collisionObject=X.prototype.xy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Wv(c,a)};Object.defineProperty(X.prototype,"m_collisionObject",{get:X.prototype.qy,set:X.prototype.xy}); +X.prototype.__destroy__=function(){Xv(this.hy)};function bC(a){a&&"object"===typeof a&&(a=a.hy);this.hy=void 0===a?Yv():Zv(a);h(bC)[this.hy]=this}bC.prototype=Object.create(WA.prototype);bC.prototype.constructor=bC;bC.prototype.iy=bC;bC.jy={};b.btSoftBodyRigidBodyCollisionConfiguration=bC;bC.prototype.__destroy__=function(){$v(this.hy)};function cC(){this.hy=aw();h(cC)[this.hy]=this}cC.prototype=Object.create(hB.prototype);cC.prototype.constructor=cC;cC.prototype.iy=cC;cC.jy={}; +b.ConcreteContactResultCallback=cC;cC.prototype.addSingleResult=function(a,c,d,e,g,n,F){var aa=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);return bw(aa,a,c,d,e,g,n,F)};cC.prototype.__destroy__=function(){cw(this.hy)}; +function dC(a,c,d){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);this.hy=void 0===d?dw(a,c):ew(a,c,d);h(dC)[this.hy]=this}dC.prototype=Object.create(XA.prototype);dC.prototype.constructor=dC;dC.prototype.iy=dC;dC.jy={};b.btBvhTriangleMeshShape=dC;dC.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fw(c,a)};dC.prototype.getLocalScaling=function(){return k(gw(this.hy),p)}; +dC.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);hw(d,a,c)};dC.prototype.__destroy__=function(){iw(this.hy)};function oB(){throw"cannot construct a btConstCollisionObjectArray, no constructor in IDL";}oB.prototype=Object.create(f.prototype);oB.prototype.constructor=oB;oB.prototype.iy=oB;oB.jy={};b.btConstCollisionObjectArray=oB;oB.prototype.size=oB.prototype.size=function(){return jw(this.hy)}; +oB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(kw(c,a),q)};oB.prototype.__destroy__=function(){lw(this.hy)};function eC(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=void 0===e?mw(a,c,d):void 0===g?_emscripten_bind_btSliderConstraint_btSliderConstraint_4(a,c,d,e):nw(a,c,d,e,g);h(eC)[this.hy]=this}eC.prototype=Object.create(TA.prototype); +eC.prototype.constructor=eC;eC.prototype.iy=eC;eC.jy={};b.btSliderConstraint=eC;eC.prototype.setLowerLinLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ow(c,a)};eC.prototype.setUpperLinLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pw(c,a)};eC.prototype.setLowerAngLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);qw(c,a)};eC.prototype.setUpperAngLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);rw(c,a)}; +eC.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);sw(c,a)};eC.prototype.getBreakingImpulseThreshold=function(){return tw(this.hy)};eC.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);uw(c,a)};eC.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return vw(d,a,c)}; +eC.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);ww(e,a,c,d)};eC.prototype.__destroy__=function(){xw(this.hy)};function U(){this.hy=yw();h(U)[this.hy]=this}U.prototype=Object.create(w.prototype);U.prototype.constructor=U;U.prototype.iy=U;U.jy={};b.btPairCachingGhostObject=U; +U.prototype.setAnisotropicFriction=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);zw(d,a,c)};U.prototype.getCollisionShape=function(){return k(Aw(this.hy),m)};U.prototype.setContactProcessingThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bw(c,a)};U.prototype.setActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Cw(c,a)}; +U.prototype.forceActivationState=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dw(c,a)};U.prototype.activate=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);void 0===a?Ew(c):Fw(c,a)};U.prototype.isActive=function(){return!!Gw(this.hy)};U.prototype.isKinematicObject=function(){return!!Hw(this.hy)};U.prototype.isStaticObject=function(){return!!Iw(this.hy)};U.prototype.isStaticOrKinematicObject=function(){return!!Jw(this.hy)};U.prototype.getRestitution=function(){return Kw(this.hy)}; +U.prototype.getFriction=function(){return Lw(this.hy)};U.prototype.getRollingFriction=function(){return Mw(this.hy)};U.prototype.setRestitution=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Nw(c,a)};U.prototype.setFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ow(c,a)};U.prototype.setRollingFriction=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pw(c,a)};U.prototype.getWorldTransform=function(){return k(Qw(this.hy),r)};U.prototype.getCollisionFlags=function(){return Rw(this.hy)}; +U.prototype.setCollisionFlags=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sw(c,a)};U.prototype.setWorldTransform=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Tw(c,a)};U.prototype.setCollisionShape=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Uw(c,a)};U.prototype.setCcdMotionThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Vw(c,a)};U.prototype.setCcdSweptSphereRadius=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ww(c,a)}; +U.prototype.getUserIndex=function(){return Xw(this.hy)};U.prototype.setUserIndex=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yw(c,a)};U.prototype.getUserPointer=function(){return k(Zw(this.hy),SA)};U.prototype.setUserPointer=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$w(c,a)};U.prototype.getBroadphaseHandle=function(){return k(ax(this.hy),t)};U.prototype.getNumOverlappingObjects=function(){return bx(this.hy)}; +U.prototype.getOverlappingObject=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(cx(c,a),q)};U.prototype.__destroy__=function(){dx(this.hy)};function D(){throw"cannot construct a btManifoldPoint, no constructor in IDL";}D.prototype=Object.create(f.prototype);D.prototype.constructor=D;D.prototype.iy=D;D.jy={};b.btManifoldPoint=D;D.prototype.getPositionWorldOnA=function(){return k(ex(this.hy),p)};D.prototype.getPositionWorldOnB=function(){return k(fx(this.hy),p)}; +D.prototype.getAppliedImpulse=function(){return gx(this.hy)};D.prototype.getDistance=function(){return hx(this.hy)};D.prototype.get_m_localPointA=D.prototype.AA=function(){return k(ix(this.hy),p)};D.prototype.set_m_localPointA=D.prototype.gD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);jx(c,a)};Object.defineProperty(D.prototype,"m_localPointA",{get:D.prototype.AA,set:D.prototype.gD});D.prototype.get_m_localPointB=D.prototype.BA=function(){return k(kx(this.hy),p)}; +D.prototype.set_m_localPointB=D.prototype.hD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);lx(c,a)};Object.defineProperty(D.prototype,"m_localPointB",{get:D.prototype.BA,set:D.prototype.hD});D.prototype.get_m_positionWorldOnB=D.prototype.NA=function(){return k(mx(this.hy),p)};D.prototype.set_m_positionWorldOnB=D.prototype.tD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);nx(c,a)};Object.defineProperty(D.prototype,"m_positionWorldOnB",{get:D.prototype.NA,set:D.prototype.tD}); +D.prototype.get_m_positionWorldOnA=D.prototype.MA=function(){return k(ox(this.hy),p)};D.prototype.set_m_positionWorldOnA=D.prototype.sD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);px(c,a)};Object.defineProperty(D.prototype,"m_positionWorldOnA",{get:D.prototype.MA,set:D.prototype.sD});D.prototype.get_m_normalWorldOnB=D.prototype.IA=function(){return k(qx(this.hy),p)};D.prototype.set_m_normalWorldOnB=D.prototype.oD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);rx(c,a)}; +Object.defineProperty(D.prototype,"m_normalWorldOnB",{get:D.prototype.IA,set:D.prototype.oD});D.prototype.get_m_userPersistentData=D.prototype.oB=function(){return sx(this.hy)};D.prototype.set_m_userPersistentData=D.prototype.VD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);tx(c,a)};Object.defineProperty(D.prototype,"m_userPersistentData",{get:D.prototype.oB,set:D.prototype.VD});D.prototype.__destroy__=function(){ux(this.hy)}; +function fC(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=void 0===d?vx(a,c):void 0===e?_emscripten_bind_btPoint2PointConstraint_btPoint2PointConstraint_3(a,c,d):wx(a,c,d,e);h(fC)[this.hy]=this}fC.prototype=Object.create(TA.prototype);fC.prototype.constructor=fC;fC.prototype.iy=fC;fC.jy={};b.btPoint2PointConstraint=fC; +fC.prototype.setPivotA=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);xx(c,a)};fC.prototype.setPivotB=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yx(c,a)};fC.prototype.getPivotInA=function(){return k(zx(this.hy),p)};fC.prototype.getPivotInB=function(){return k(Ax(this.hy),p)};fC.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Bx(c,a)};fC.prototype.getBreakingImpulseThreshold=function(){return Cx(this.hy)}; +fC.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dx(c,a)};fC.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return Ex(d,a,c)};fC.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Fx(e,a,c,d)};fC.prototype.get_m_setting=fC.prototype.VA=function(){return k(Gx(this.hy),H)}; +fC.prototype.set_m_setting=fC.prototype.BD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Hx(c,a)};Object.defineProperty(fC.prototype,"m_setting",{get:fC.prototype.VA,set:fC.prototype.BD});fC.prototype.__destroy__=function(){Ix(this.hy)};function gC(){this.hy=Jx();h(gC)[this.hy]=this}gC.prototype=Object.create(f.prototype);gC.prototype.constructor=gC;gC.prototype.iy=gC;gC.jy={};b.btSoftBodyHelpers=gC; +gC.prototype.CreateRope=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);return k(Kx(n,a,c,d,e,g),R)}; +gC.prototype.CreatePatch=function(a,c,d,e,g,n,F,aa,ta){var Rb=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);aa&&"object"===typeof aa&&(aa=aa.hy);ta&&"object"===typeof ta&&(ta=ta.hy);return k(Lx(Rb,a,c,d,e,g,n,F,aa,ta),R)}; +gC.prototype.CreatePatchUV=function(a,c,d,e,g,n,F,aa,ta,Rb){var nC=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);n&&"object"===typeof n&&(n=n.hy);F&&"object"===typeof F&&(F=F.hy);aa&&"object"===typeof aa&&(aa=aa.hy);ta&&"object"===typeof ta&&(ta=ta.hy);"object"==typeof Rb&&(Rb=MA(Rb));return k(Mx(nC,a,c,d,e,g,n,F,aa,ta,Rb),R)}; +gC.prototype.CreateEllipsoid=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);return k(Nx(g,a,c,d,e),R)}; +gC.prototype.CreateFromTriMesh=function(a,c,d,e,g){var n=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);"object"==typeof c&&(c=MA(c));if("object"==typeof d&&"object"===typeof d){var F=JA(d,Aa);KA(d,Aa,F);d=F}e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);return k(Ox(n,a,c,d,e,g),R)}; +gC.prototype.CreateFromConvexHull=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);return k(Px(g,a,c,d,e),R)};gC.prototype.__destroy__=function(){Qx(this.hy)};function t(){throw"cannot construct a btBroadphaseProxy, no constructor in IDL";}t.prototype=Object.create(f.prototype);t.prototype.constructor=t;t.prototype.iy=t;t.jy={};b.btBroadphaseProxy=t; +t.prototype.get_m_collisionFilterGroup=t.prototype.ky=function(){return Rx(this.hy)};t.prototype.set_m_collisionFilterGroup=t.prototype.my=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Sx(c,a)};Object.defineProperty(t.prototype,"m_collisionFilterGroup",{get:t.prototype.ky,set:t.prototype.my});t.prototype.get_m_collisionFilterMask=t.prototype.ly=function(){return Tx(this.hy)}; +t.prototype.set_m_collisionFilterMask=t.prototype.ny=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ux(c,a)};Object.defineProperty(t.prototype,"m_collisionFilterMask",{get:t.prototype.ly,set:t.prototype.ny});t.prototype.__destroy__=function(){Vx(this.hy)};function TB(){throw"cannot construct a tNodeArray, no constructor in IDL";}TB.prototype=Object.create(f.prototype);TB.prototype.constructor=TB;TB.prototype.iy=TB;TB.jy={};b.tNodeArray=TB;TB.prototype.size=TB.prototype.size=function(){return Wx(this.hy)}; +TB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Xx(c,a),Node)};TB.prototype.__destroy__=function(){Yx(this.hy)};function hC(a){a&&"object"===typeof a&&(a=a.hy);this.hy=Zx(a);h(hC)[this.hy]=this}hC.prototype=Object.create(m.prototype);hC.prototype.constructor=hC;hC.prototype.iy=hC;hC.jy={};b.btBoxShape=hC;hC.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$x(c,a)};hC.prototype.getMargin=function(){return ay(this.hy)}; +hC.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);by(c,a)};hC.prototype.getLocalScaling=function(){return k(cy(this.hy),p)};hC.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);dy(d,a,c)};hC.prototype.__destroy__=function(){ey(this.hy)};function ZB(){throw"cannot construct a btFace, no constructor in IDL";}ZB.prototype=Object.create(f.prototype);ZB.prototype.constructor=ZB; +ZB.prototype.iy=ZB;ZB.jy={};b.btFace=ZB;ZB.prototype.get_m_indices=ZB.prototype.rA=function(){return k(fy(this.hy),VB)};ZB.prototype.set_m_indices=ZB.prototype.YC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gy(c,a)};Object.defineProperty(ZB.prototype,"m_indices",{get:ZB.prototype.rA,set:ZB.prototype.YC});ZB.prototype.get_m_plane=ZB.prototype.LA=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return hy(c,a)}; +ZB.prototype.set_m_plane=ZB.prototype.rD=function(a,c){var d=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);iy(d,a,c)};Object.defineProperty(ZB.prototype,"m_plane",{get:ZB.prototype.LA,set:ZB.prototype.rD});ZB.prototype.__destroy__=function(){jy(this.hy)};function iC(){this.hy=ky();h(iC)[this.hy]=this}iC.prototype=Object.create(RA.prototype);iC.prototype.constructor=iC;iC.prototype.iy=iC;iC.jy={};b.DebugDrawer=iC; +iC.prototype.drawLine=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);ly(e,a,c,d)};iC.prototype.drawContactPoint=function(a,c,d,e,g){var n=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);my(n,a,c,d,e,g)}; +iC.prototype.reportErrorWarning=function(a){var c=this.hy;IA();a=a&&"object"===typeof a?a.hy:LA(a);ny(c,a)};iC.prototype.draw3dText=function(a,c){var d=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);c=c&&"object"===typeof c?c.hy:LA(c);oy(d,a,c)};iC.prototype.setDebugMode=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);py(c,a)};iC.prototype.getDebugMode=function(){return qy(this.hy)};iC.prototype.__destroy__=function(){ry(this.hy)}; +function jC(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=sy(a,c);h(jC)[this.hy]=this}jC.prototype=Object.create(VA.prototype);jC.prototype.constructor=jC;jC.prototype.iy=jC;jC.jy={};b.btCapsuleShapeX=jC;jC.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);ty(c,a)};jC.prototype.getMargin=function(){return uy(this.hy)};jC.prototype.getUpAxis=function(){return vy(this.hy)};jC.prototype.getRadius=function(){return wy(this.hy)}; +jC.prototype.getHalfHeight=function(){return xy(this.hy)};jC.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);yy(c,a)};jC.prototype.getLocalScaling=function(){return k(zy(this.hy),p)};jC.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Ay(d,a,c)};jC.prototype.__destroy__=function(){By(this.hy)}; +function W(a,c,d,e){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);this.hy=Cy(a,c,d,e);h(W)[this.hy]=this}W.prototype=Object.create(aB.prototype);W.prototype.constructor=W;W.prototype.iy=W;W.jy={};b.btQuaternion=W;W.prototype.setValue=function(a,c,d,e){var g=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);Dy(g,a,c,d,e)}; +W.prototype.setEulerZYX=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Ey(e,a,c,d)};W.prototype.setRotation=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Fy(d,a,c)};W.prototype.normalize=W.prototype.normalize=function(){Gy(this.hy)};W.prototype.length2=function(){return Hy(this.hy)};W.prototype.length=W.prototype.length=function(){return Iy(this.hy)}; +W.prototype.dot=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Jy(c,a)};W.prototype.normalized=function(){return k(Ky(this.hy),W)};W.prototype.getAxis=function(){return k(Ly(this.hy),p)};W.prototype.inverse=W.prototype.inverse=function(){return k(My(this.hy),W)};W.prototype.getAngle=function(){return Ny(this.hy)};W.prototype.getAngleShortestPath=function(){return Oy(this.hy)}; +W.prototype.angle=W.prototype.angle=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Py(c,a)};W.prototype.angleShortestPath=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return Qy(c,a)};W.prototype.op_add=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Ry(c,a),W)};W.prototype.op_sub=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Sy(c,a),W)}; +W.prototype.op_mul=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Ty(c,a),W)};W.prototype.op_mulq=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Uy(c,a),W)};W.prototype.op_div=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Vy(c,a),W)};W.prototype.x=W.prototype.x=function(){return Wy(this.hy)};W.prototype.y=W.prototype.y=function(){return Xy(this.hy)};W.prototype.z=W.prototype.z=function(){return Yy(this.hy)};W.prototype.w=function(){return Zy(this.hy)}; +W.prototype.setX=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$y(c,a)};W.prototype.setY=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);az(c,a)};W.prototype.setZ=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);bz(c,a)};W.prototype.setW=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);cz(c,a)};W.prototype.__destroy__=function(){dz(this.hy)}; +function kC(a,c){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);this.hy=ez(a,c);h(kC)[this.hy]=this}kC.prototype=Object.create(VA.prototype);kC.prototype.constructor=kC;kC.prototype.iy=kC;kC.jy={};b.btCapsuleShapeZ=kC;kC.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);fz(c,a)};kC.prototype.getMargin=function(){return gz(this.hy)};kC.prototype.getUpAxis=function(){return hz(this.hy)};kC.prototype.getRadius=function(){return iz(this.hy)}; +kC.prototype.getHalfHeight=function(){return jz(this.hy)};kC.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kz(c,a)};kC.prototype.getLocalScaling=function(){return k(lz(this.hy),p)};kC.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);mz(d,a,c)};kC.prototype.__destroy__=function(){nz(this.hy)};function v(){throw"cannot construct a btContactSolverInfo, no constructor in IDL";} +v.prototype=Object.create(f.prototype);v.prototype.constructor=v;v.prototype.iy=v;v.jy={};b.btContactSolverInfo=v;v.prototype.get_m_splitImpulse=v.prototype.YA=function(){return!!oz(this.hy)};v.prototype.set_m_splitImpulse=v.prototype.ED=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);pz(c,a)};Object.defineProperty(v.prototype,"m_splitImpulse",{get:v.prototype.YA,set:v.prototype.ED});v.prototype.get_m_splitImpulsePenetrationThreshold=v.prototype.ZA=function(){return qz(this.hy)}; +v.prototype.set_m_splitImpulsePenetrationThreshold=v.prototype.FD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);rz(c,a)};Object.defineProperty(v.prototype,"m_splitImpulsePenetrationThreshold",{get:v.prototype.ZA,set:v.prototype.FD});v.prototype.get_m_numIterations=v.prototype.JA=function(){return sz(this.hy)};v.prototype.set_m_numIterations=v.prototype.pD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);tz(c,a)}; +Object.defineProperty(v.prototype,"m_numIterations",{get:v.prototype.JA,set:v.prototype.pD});v.prototype.__destroy__=function(){uz(this.hy)};function lC(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=void 0===e?vz(a,c,d):void 0===g?_emscripten_bind_btGeneric6DofSpringConstraint_btGeneric6DofSpringConstraint_4(a,c,d,e):wz(a,c,d,e,g);h(lC)[this.hy]=this} +lC.prototype=Object.create(eB.prototype);lC.prototype.constructor=lC;lC.prototype.iy=lC;lC.jy={};b.btGeneric6DofSpringConstraint=lC;lC.prototype.enableSpring=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);xz(d,a,c)};lC.prototype.setStiffness=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);yz(d,a,c)}; +lC.prototype.setDamping=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);zz(d,a,c)};lC.prototype.setEquilibriumPoint=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);void 0===a?Az(d):void 0===c?Bz(d,a):Cz(d,a,c)};lC.prototype.setLinearLowerLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Dz(c,a)}; +lC.prototype.setLinearUpperLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Ez(c,a)};lC.prototype.setAngularLowerLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Fz(c,a)};lC.prototype.setAngularUpperLimit=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Gz(c,a)};lC.prototype.getFrameOffsetA=function(){return k(Hz(this.hy),r)};lC.prototype.enableFeedback=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Iz(c,a)}; +lC.prototype.getBreakingImpulseThreshold=function(){return Jz(this.hy)};lC.prototype.setBreakingImpulseThreshold=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Kz(c,a)};lC.prototype.getParam=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);return Lz(d,a,c)};lC.prototype.setParam=function(a,c,d){var e=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);Mz(e,a,c,d)}; +lC.prototype.__destroy__=function(){Nz(this.hy)};function mC(a){a&&"object"===typeof a&&(a=a.hy);this.hy=Oz(a);h(mC)[this.hy]=this}mC.prototype=Object.create(m.prototype);mC.prototype.constructor=mC;mC.prototype.iy=mC;mC.jy={};b.btSphereShape=mC;mC.prototype.setMargin=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Pz(c,a)};mC.prototype.getMargin=function(){return Qz(this.hy)};mC.prototype.setLocalScaling=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Rz(c,a)}; +mC.prototype.getLocalScaling=function(){return k(Sz(this.hy),p)};mC.prototype.calculateLocalInertia=function(a,c){var d=this.hy;a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Tz(d,a,c)};mC.prototype.__destroy__=function(){Uz(this.hy)};function Y(){throw"cannot construct a Face, no constructor in IDL";}Y.prototype=Object.create(f.prototype);Y.prototype.constructor=Y;Y.prototype.iy=Y;Y.jy={};b.Face=Y; +Y.prototype.get_m_n=Y.prototype.Hy=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(Vz(c,a),Node)};Y.prototype.set_m_n=Y.prototype.Qy=function(a,c){var d=this.hy;IA();a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);Wz(d,a,c)};Object.defineProperty(Y.prototype,"m_n",{get:Y.prototype.Hy,set:Y.prototype.Qy});Y.prototype.get_m_normal=Y.prototype.HA=function(){return k(Xz(this.hy),p)}; +Y.prototype.set_m_normal=Y.prototype.nD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);Yz(c,a)};Object.defineProperty(Y.prototype,"m_normal",{get:Y.prototype.HA,set:Y.prototype.nD});Y.prototype.get_m_ra=Y.prototype.PA=function(){return Zz(this.hy)};Y.prototype.set_m_ra=Y.prototype.vD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);$z(c,a)};Object.defineProperty(Y.prototype,"m_ra",{get:Y.prototype.PA,set:Y.prototype.vD});Y.prototype.__destroy__=function(){aA(this.hy)}; +function UB(){throw"cannot construct a tFaceArray, no constructor in IDL";}UB.prototype=Object.create(f.prototype);UB.prototype.constructor=UB;UB.prototype.iy=UB;UB.jy={};b.tFaceArray=UB;UB.prototype.size=UB.prototype.size=function(){return bA(this.hy)};UB.prototype.at=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);return k(cA(c,a),Y)};UB.prototype.__destroy__=function(){dA(this.hy)}; +function Z(a,c,d,e,g){a&&"object"===typeof a&&(a=a.hy);c&&"object"===typeof c&&(c=c.hy);d&&"object"===typeof d&&(d=d.hy);e&&"object"===typeof e&&(e=e.hy);g&&"object"===typeof g&&(g=g.hy);this.hy=eA(a,c,d,e,g);h(Z)[this.hy]=this}Z.prototype=Object.create(f.prototype);Z.prototype.constructor=Z;Z.prototype.iy=Z;Z.jy={};b.LocalConvexResult=Z;Z.prototype.get_m_hitCollisionObject=Z.prototype.iA=function(){return k(fA(this.hy),q)}; +Z.prototype.set_m_hitCollisionObject=Z.prototype.PC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);gA(c,a)};Object.defineProperty(Z.prototype,"m_hitCollisionObject",{get:Z.prototype.iA,set:Z.prototype.PC});Z.prototype.get_m_localShapeInfo=Z.prototype.CA=function(){return k(hA(this.hy),tB)};Z.prototype.set_m_localShapeInfo=Z.prototype.iD=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);iA(c,a)};Object.defineProperty(Z.prototype,"m_localShapeInfo",{get:Z.prototype.CA,set:Z.prototype.iD}); +Z.prototype.get_m_hitNormalLocal=Z.prototype.mA=function(){return k(jA(this.hy),p)};Z.prototype.set_m_hitNormalLocal=Z.prototype.TC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);kA(c,a)};Object.defineProperty(Z.prototype,"m_hitNormalLocal",{get:Z.prototype.mA,set:Z.prototype.TC});Z.prototype.get_m_hitPointLocal=Z.prototype.oA=function(){return k(lA(this.hy),p)};Z.prototype.set_m_hitPointLocal=Z.prototype.VC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);mA(c,a)}; +Object.defineProperty(Z.prototype,"m_hitPointLocal",{get:Z.prototype.oA,set:Z.prototype.VC});Z.prototype.get_m_hitFraction=Z.prototype.jA=function(){return nA(this.hy)};Z.prototype.set_m_hitFraction=Z.prototype.QC=function(a){var c=this.hy;a&&"object"===typeof a&&(a=a.hy);oA(c,a)};Object.defineProperty(Z.prototype,"m_hitFraction",{get:Z.prototype.jA,set:Z.prototype.QC});Z.prototype.__destroy__=function(){pA(this.hy)}; +(function(){function a(){b.BT_CONSTRAINT_ERP=qA();b.BT_CONSTRAINT_STOP_ERP=rA();b.BT_CONSTRAINT_CFM=sA();b.BT_CONSTRAINT_STOP_CFM=tA();b.PHY_FLOAT=uA();b.PHY_DOUBLE=vA();b.PHY_INTEGER=wA();b.PHY_SHORT=xA();b.PHY_FIXEDPOINT88=yA();b.PHY_UCHAR=zA()}Ka?a():Ia.unshift(a)})();this.Ammo=b; + + + return Ammo.ready +} +); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = Ammo; + else if (typeof define === 'function' && define['amd']) + define([], function() { return Ammo; }); + else if (typeof exports === 'object') + exports["Ammo"] = Ammo; + diff --git a/examples/js/libs/ammo.wasm.wasm b/examples/js/libs/ammo.wasm.wasm new file mode 100644 index 00000000000000..fb4eff284d1f8b Binary files /dev/null and b/examples/js/libs/ammo.wasm.wasm differ diff --git a/examples/js/libs/cannon.js b/examples/js/libs/cannon.js deleted file mode 100644 index 331ecc5fec8adc..00000000000000 --- a/examples/js/libs/cannon.js +++ /dev/null @@ -1,13687 +0,0 @@ -/* - * Copyright (c) 2015 cannon.js Authors - * - * 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. - */ - -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&false)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.CANNON=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o (http://steffe.se)", - "keywords": [ - "cannon.js", - "cannon", - "physics", - "engine", - "3d" - ], - "main": "./build/cannon.js", - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/schteppe/cannon.js.git" - }, - "bugs": { - "url": "https://github.com/schteppe/cannon.js/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "devDependencies": { - "jshint": "latest", - "uglify-js": "latest", - "nodeunit": "^0.9.0", - "grunt": "~0.4.0", - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "^0.4.1", - "grunt-contrib-concat": "~0.1.3", - "grunt-contrib-uglify": "^0.5.1", - "grunt-browserify": "^2.1.4", - "grunt-contrib-yuidoc": "^0.5.2", - "browserify": "*" - }, - "dependencies": {} -} - -},{}],2:[function(_dereq_,module,exports){ -// Export classes -module.exports = { - version : _dereq_('../package.json').version, - - AABB : _dereq_('./collision/AABB'), - ArrayCollisionMatrix : _dereq_('./collision/ArrayCollisionMatrix'), - Body : _dereq_('./objects/Body'), - Box : _dereq_('./shapes/Box'), - Broadphase : _dereq_('./collision/Broadphase'), - Constraint : _dereq_('./constraints/Constraint'), - ContactEquation : _dereq_('./equations/ContactEquation'), - Narrowphase : _dereq_('./world/Narrowphase'), - ConeTwistConstraint : _dereq_('./constraints/ConeTwistConstraint'), - ContactMaterial : _dereq_('./material/ContactMaterial'), - ConvexPolyhedron : _dereq_('./shapes/ConvexPolyhedron'), - Cylinder : _dereq_('./shapes/Cylinder'), - DistanceConstraint : _dereq_('./constraints/DistanceConstraint'), - Equation : _dereq_('./equations/Equation'), - EventTarget : _dereq_('./utils/EventTarget'), - FrictionEquation : _dereq_('./equations/FrictionEquation'), - GSSolver : _dereq_('./solver/GSSolver'), - GridBroadphase : _dereq_('./collision/GridBroadphase'), - Heightfield : _dereq_('./shapes/Heightfield'), - HingeConstraint : _dereq_('./constraints/HingeConstraint'), - LockConstraint : _dereq_('./constraints/LockConstraint'), - Mat3 : _dereq_('./math/Mat3'), - Material : _dereq_('./material/Material'), - NaiveBroadphase : _dereq_('./collision/NaiveBroadphase'), - ObjectCollisionMatrix : _dereq_('./collision/ObjectCollisionMatrix'), - Pool : _dereq_('./utils/Pool'), - Particle : _dereq_('./shapes/Particle'), - Plane : _dereq_('./shapes/Plane'), - PointToPointConstraint : _dereq_('./constraints/PointToPointConstraint'), - Quaternion : _dereq_('./math/Quaternion'), - Ray : _dereq_('./collision/Ray'), - RaycastVehicle : _dereq_('./objects/RaycastVehicle'), - RaycastResult : _dereq_('./collision/RaycastResult'), - RigidVehicle : _dereq_('./objects/RigidVehicle'), - RotationalEquation : _dereq_('./equations/RotationalEquation'), - RotationalMotorEquation : _dereq_('./equations/RotationalMotorEquation'), - SAPBroadphase : _dereq_('./collision/SAPBroadphase'), - SPHSystem : _dereq_('./objects/SPHSystem'), - Shape : _dereq_('./shapes/Shape'), - Solver : _dereq_('./solver/Solver'), - Sphere : _dereq_('./shapes/Sphere'), - SplitSolver : _dereq_('./solver/SplitSolver'), - Spring : _dereq_('./objects/Spring'), - Trimesh : _dereq_('./shapes/Trimesh'), - Vec3 : _dereq_('./math/Vec3'), - Vec3Pool : _dereq_('./utils/Vec3Pool'), - World : _dereq_('./world/World'), -}; - -},{"../package.json":1,"./collision/AABB":3,"./collision/ArrayCollisionMatrix":4,"./collision/Broadphase":5,"./collision/GridBroadphase":6,"./collision/NaiveBroadphase":7,"./collision/ObjectCollisionMatrix":8,"./collision/Ray":9,"./collision/RaycastResult":10,"./collision/SAPBroadphase":11,"./constraints/ConeTwistConstraint":12,"./constraints/Constraint":13,"./constraints/DistanceConstraint":14,"./constraints/HingeConstraint":15,"./constraints/LockConstraint":16,"./constraints/PointToPointConstraint":17,"./equations/ContactEquation":19,"./equations/Equation":20,"./equations/FrictionEquation":21,"./equations/RotationalEquation":22,"./equations/RotationalMotorEquation":23,"./material/ContactMaterial":24,"./material/Material":25,"./math/Mat3":27,"./math/Quaternion":28,"./math/Vec3":30,"./objects/Body":31,"./objects/RaycastVehicle":32,"./objects/RigidVehicle":33,"./objects/SPHSystem":34,"./objects/Spring":35,"./shapes/Box":37,"./shapes/ConvexPolyhedron":38,"./shapes/Cylinder":39,"./shapes/Heightfield":40,"./shapes/Particle":41,"./shapes/Plane":42,"./shapes/Shape":43,"./shapes/Sphere":44,"./shapes/Trimesh":45,"./solver/GSSolver":46,"./solver/Solver":47,"./solver/SplitSolver":48,"./utils/EventTarget":49,"./utils/Pool":51,"./utils/Vec3Pool":54,"./world/Narrowphase":55,"./world/World":56}],3:[function(_dereq_,module,exports){ -var Vec3 = _dereq_('../math/Vec3'); -var Utils = _dereq_('../utils/Utils'); - -module.exports = AABB; - -/** - * Axis aligned bounding box class. - * @class AABB - * @constructor - * @param {Object} [options] - * @param {Vec3} [options.upperBound] - * @param {Vec3} [options.lowerBound] - */ -function AABB(options){ - options = options || {}; - - /** - * The lower bound of the bounding box. - * @property lowerBound - * @type {Vec3} - */ - this.lowerBound = new Vec3(); - if(options.lowerBound){ - this.lowerBound.copy(options.lowerBound); - } - - /** - * The upper bound of the bounding box. - * @property upperBound - * @type {Vec3} - */ - this.upperBound = new Vec3(); - if(options.upperBound){ - this.upperBound.copy(options.upperBound); - } -} - -var tmp = new Vec3(); - -/** - * Set the AABB bounds from a set of points. - * @method setFromPoints - * @param {Array} points An array of Vec3's. - * @param {Vec3} position - * @param {Quaternion} quaternion - * @param {number} skinSize - * @return {AABB} The self object - */ -AABB.prototype.setFromPoints = function(points, position, quaternion, skinSize){ - var l = this.lowerBound, - u = this.upperBound, - q = quaternion; - - // Set to the first point - l.copy(points[0]); - if(q){ - q.vmult(l, l); - } - u.copy(l); - - for(var i = 1; i u.x){ u.x = p.x; } - if(p.x < l.x){ l.x = p.x; } - if(p.y > u.y){ u.y = p.y; } - if(p.y < l.y){ l.y = p.y; } - if(p.z > u.z){ u.z = p.z; } - if(p.z < l.z){ l.z = p.z; } - } - - // Add offset - if (position) { - position.vadd(l, l); - position.vadd(u, u); - } - - if(skinSize){ - l.x -= skinSize; - l.y -= skinSize; - l.z -= skinSize; - u.x += skinSize; - u.y += skinSize; - u.z += skinSize; - } - - return this; -}; - -/** - * Copy bounds from an AABB to this AABB - * @method copy - * @param {AABB} aabb Source to copy from - * @return {AABB} The this object, for chainability - */ -AABB.prototype.copy = function(aabb){ - this.lowerBound.copy(aabb.lowerBound); - this.upperBound.copy(aabb.upperBound); - return this; -}; - -/** - * Clone an AABB - * @method clone - */ -AABB.prototype.clone = function(){ - return new AABB().copy(this); -}; - -/** - * Extend this AABB so that it covers the given AABB too. - * @method extend - * @param {AABB} aabb - */ -AABB.prototype.extend = function(aabb){ - // Extend lower bound - var l = aabb.lowerBound.x; - if(this.lowerBound.x > l){ - this.lowerBound.x = l; - } - - // Upper - var u = aabb.upperBound.x; - if(this.upperBound.x < u){ - this.upperBound.x = u; - } - - // Extend lower bound - var l = aabb.lowerBound.y; - if(this.lowerBound.y > l){ - this.lowerBound.y = l; - } - - // Upper - var u = aabb.upperBound.y; - if(this.upperBound.y < u){ - this.upperBound.y = u; - } - - // Extend lower bound - var l = aabb.lowerBound.z; - if(this.lowerBound.z > l){ - this.lowerBound.z = l; - } - - // Upper - var u = aabb.upperBound.z; - if(this.upperBound.z < u){ - this.upperBound.z = u; - } -}; - -/** - * Returns true if the given AABB overlaps this AABB. - * @method overlaps - * @param {AABB} aabb - * @return {Boolean} - */ -AABB.prototype.overlaps = function(aabb){ - var l1 = this.lowerBound, - u1 = this.upperBound, - l2 = aabb.lowerBound, - u2 = aabb.upperBound; - - // l2 u2 - // |---------| - // |--------| - // l1 u1 - - return ((l2.x <= u1.x && u1.x <= u2.x) || (l1.x <= u2.x && u2.x <= u1.x)) && - ((l2.y <= u1.y && u1.y <= u2.y) || (l1.y <= u2.y && u2.y <= u1.y)) && - ((l2.z <= u1.z && u1.z <= u2.z) || (l1.z <= u2.z && u2.z <= u1.z)); -}; - -/** - * Returns true if the given AABB is fully contained in this AABB. - * @method contains - * @param {AABB} aabb - * @return {Boolean} - */ -AABB.prototype.contains = function(aabb){ - var l1 = this.lowerBound, - u1 = this.upperBound, - l2 = aabb.lowerBound, - u2 = aabb.upperBound; - - // l2 u2 - // |---------| - // |---------------| - // l1 u1 - - return ( - (l1.x <= l2.x && u1.x >= u2.x) && - (l1.y <= l2.y && u1.y >= u2.y) && - (l1.z <= l2.z && u1.z >= u2.z) - ); -}; - -/** - * @method getCorners - * @param {Vec3} a - * @param {Vec3} b - * @param {Vec3} c - * @param {Vec3} d - * @param {Vec3} e - * @param {Vec3} f - * @param {Vec3} g - * @param {Vec3} h - */ -AABB.prototype.getCorners = function(a, b, c, d, e, f, g, h){ - var l = this.lowerBound, - u = this.upperBound; - - a.copy(l); - b.set( u.x, l.y, l.z ); - c.set( u.x, u.y, l.z ); - d.set( l.x, u.y, u.z ); - e.set( u.x, l.y, l.z ); - f.set( l.x, u.y, l.z ); - g.set( l.x, l.y, u.z ); - h.copy(u); -}; - -var transformIntoFrame_corners = [ - new Vec3(), - new Vec3(), - new Vec3(), - new Vec3(), - new Vec3(), - new Vec3(), - new Vec3(), - new Vec3() -]; - -/** - * Get the representation of an AABB in another frame. - * @method toLocalFrame - * @param {Transform} frame - * @param {AABB} target - * @return {AABB} The "target" AABB object. - */ -AABB.prototype.toLocalFrame = function(frame, target){ - - var corners = transformIntoFrame_corners; - var a = corners[0]; - var b = corners[1]; - var c = corners[2]; - var d = corners[3]; - var e = corners[4]; - var f = corners[5]; - var g = corners[6]; - var h = corners[7]; - - // Get corners in current frame - this.getCorners(a, b, c, d, e, f, g, h); - - // Transform them to new local frame - for(var i=0; i !== 8; i++){ - var corner = corners[i]; - frame.pointToLocal(corner, corner); - } - - return target.setFromPoints(corners); -}; - -/** - * Get the representation of an AABB in the global frame. - * @method toWorldFrame - * @param {Transform} frame - * @param {AABB} target - * @return {AABB} The "target" AABB object. - */ -AABB.prototype.toWorldFrame = function(frame, target){ - - var corners = transformIntoFrame_corners; - var a = corners[0]; - var b = corners[1]; - var c = corners[2]; - var d = corners[3]; - var e = corners[4]; - var f = corners[5]; - var g = corners[6]; - var h = corners[7]; - - // Get corners in current frame - this.getCorners(a, b, c, d, e, f, g, h); - - // Transform them to new local frame - for(var i=0; i !== 8; i++){ - var corner = corners[i]; - frame.pointToWorld(corner, corner); - } - - return target.setFromPoints(corners); -}; - -},{"../math/Vec3":30,"../utils/Utils":53}],4:[function(_dereq_,module,exports){ -module.exports = ArrayCollisionMatrix; - -/** - * Collision "matrix". It's actually a triangular-shaped array of whether two bodies are touching this step, for reference next step - * @class ArrayCollisionMatrix - * @constructor - */ -function ArrayCollisionMatrix() { - - /** - * The matrix storage - * @property matrix - * @type {Array} - */ - this.matrix = []; -} - -/** - * Get an element - * @method get - * @param {Number} i - * @param {Number} j - * @return {Number} - */ -ArrayCollisionMatrix.prototype.get = function(i, j) { - i = i.index; - j = j.index; - if (j > i) { - var temp = j; - j = i; - i = temp; - } - return this.matrix[(i*(i + 1)>>1) + j-1]; -}; - -/** - * Set an element - * @method set - * @param {Number} i - * @param {Number} j - * @param {Number} value - */ -ArrayCollisionMatrix.prototype.set = function(i, j, value) { - i = i.index; - j = j.index; - if (j > i) { - var temp = j; - j = i; - i = temp; - } - this.matrix[(i*(i + 1)>>1) + j-1] = value ? 1 : 0; -}; - -/** - * Sets all elements to zero - * @method reset - */ -ArrayCollisionMatrix.prototype.reset = function() { - for (var i=0, l=this.matrix.length; i!==l; i++) { - this.matrix[i]=0; - } -}; - -/** - * Sets the max number of objects - * @method setNumObjects - * @param {Number} n - */ -ArrayCollisionMatrix.prototype.setNumObjects = function(n) { - this.matrix.length = n*(n-1)>>1; -}; - -},{}],5:[function(_dereq_,module,exports){ -var Body = _dereq_('../objects/Body'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Shape = _dereq_('../shapes/Shape'); -var Plane = _dereq_('../shapes/Plane'); - -module.exports = Broadphase; - -/** - * Base class for broadphase implementations - * @class Broadphase - * @constructor - * @author schteppe - */ -function Broadphase(){ - /** - * The world to search for collisions in. - * @property world - * @type {World} - */ - this.world = null; - - /** - * If set to true, the broadphase uses bounding boxes for intersection test, else it uses bounding spheres. - * @property useBoundingBoxes - * @type {Boolean} - */ - this.useBoundingBoxes = false; - - /** - * Set to true if the objects in the world moved. - * @property {Boolean} dirty - */ - this.dirty = true; -} - -/** - * Get the collision pairs from the world - * @method collisionPairs - * @param {World} world The world to search in - * @param {Array} p1 Empty array to be filled with body objects - * @param {Array} p2 Empty array to be filled with body objects - */ -Broadphase.prototype.collisionPairs = function(world,p1,p2){ - throw new Error("collisionPairs not implemented for this BroadPhase class!"); -}; - -/** - * Check if a body pair needs to be intersection tested at all. - * @method needBroadphaseCollision - * @param {Body} bodyA - * @param {Body} bodyB - * @return {bool} - */ -var Broadphase_needBroadphaseCollision_STATIC_OR_KINEMATIC = Body.STATIC | Body.KINEMATIC; -Broadphase.prototype.needBroadphaseCollision = function(bodyA,bodyB){ - - // Check collision filter masks - if( (bodyA.collisionFilterGroup & bodyB.collisionFilterMask)===0 || (bodyB.collisionFilterGroup & bodyA.collisionFilterMask)===0){ - return false; - } - - // Check types - if(((bodyA.type & Broadphase_needBroadphaseCollision_STATIC_OR_KINEMATIC)!==0 || bodyA.sleepState === Body.SLEEPING) && - ((bodyB.type & Broadphase_needBroadphaseCollision_STATIC_OR_KINEMATIC)!==0 || bodyB.sleepState === Body.SLEEPING)) { - // Both bodies are static, kinematic or sleeping. Skip. - return false; - } - - return true; -}; - -/** - * Check if the bounding volumes of two bodies intersect. - * @method intersectionTest - * @param {Body} bodyA - * @param {Body} bodyB - * @param {array} pairs1 - * @param {array} pairs2 - */ -Broadphase.prototype.intersectionTest = function(bodyA, bodyB, pairs1, pairs2){ - if(this.useBoundingBoxes){ - this.doBoundingBoxBroadphase(bodyA,bodyB,pairs1,pairs2); - } else { - this.doBoundingSphereBroadphase(bodyA,bodyB,pairs1,pairs2); - } -}; - -/** - * Check if the bounding spheres of two bodies are intersecting. - * @method doBoundingSphereBroadphase - * @param {Body} bodyA - * @param {Body} bodyB - * @param {Array} pairs1 bodyA is appended to this array if intersection - * @param {Array} pairs2 bodyB is appended to this array if intersection - */ -var Broadphase_collisionPairs_r = new Vec3(), // Temp objects - Broadphase_collisionPairs_normal = new Vec3(), - Broadphase_collisionPairs_quat = new Quaternion(), - Broadphase_collisionPairs_relpos = new Vec3(); -Broadphase.prototype.doBoundingSphereBroadphase = function(bodyA,bodyB,pairs1,pairs2){ - var r = Broadphase_collisionPairs_r; - bodyB.position.vsub(bodyA.position,r); - var boundingRadiusSum2 = Math.pow(bodyA.boundingRadius + bodyB.boundingRadius, 2); - var norm2 = r.norm2(); - if(norm2 < boundingRadiusSum2){ - pairs1.push(bodyA); - pairs2.push(bodyB); - } -}; - -/** - * Check if the bounding boxes of two bodies are intersecting. - * @method doBoundingBoxBroadphase - * @param {Body} bodyA - * @param {Body} bodyB - * @param {Array} pairs1 - * @param {Array} pairs2 - */ -Broadphase.prototype.doBoundingBoxBroadphase = function(bodyA,bodyB,pairs1,pairs2){ - if(bodyA.aabbNeedsUpdate){ - bodyA.computeAABB(); - } - if(bodyB.aabbNeedsUpdate){ - bodyB.computeAABB(); - } - - // Check AABB / AABB - if(bodyA.aabb.overlaps(bodyB.aabb)){ - pairs1.push(bodyA); - pairs2.push(bodyB); - } -}; - -/** - * Removes duplicate pairs from the pair arrays. - * @method makePairsUnique - * @param {Array} pairs1 - * @param {Array} pairs2 - */ -var Broadphase_makePairsUnique_temp = { keys:[] }, - Broadphase_makePairsUnique_p1 = [], - Broadphase_makePairsUnique_p2 = []; -Broadphase.prototype.makePairsUnique = function(pairs1,pairs2){ - var t = Broadphase_makePairsUnique_temp, - p1 = Broadphase_makePairsUnique_p1, - p2 = Broadphase_makePairsUnique_p2, - N = pairs1.length; - - for(var i=0; i!==N; i++){ - p1[i] = pairs1[i]; - p2[i] = pairs2[i]; - } - - pairs1.length = 0; - pairs2.length = 0; - - for(var i=0; i!==N; i++){ - var id1 = p1[i].id, - id2 = p2[i].id; - var key = id1 < id2 ? id1+","+id2 : id2+","+id1; - t[key] = i; - t.keys.push(key); - } - - for(var i=0; i!==t.keys.length; i++){ - var key = t.keys.pop(), - pairIndex = t[key]; - pairs1.push(p1[pairIndex]); - pairs2.push(p2[pairIndex]); - delete t[key]; - } -}; - -/** - * To be implemented by subcasses - * @method setWorld - * @param {World} world - */ -Broadphase.prototype.setWorld = function(world){ -}; - -/** - * Check if the bounding spheres of two bodies overlap. - * @method boundingSphereCheck - * @param {Body} bodyA - * @param {Body} bodyB - * @return {boolean} - */ -var bsc_dist = new Vec3(); -Broadphase.boundingSphereCheck = function(bodyA,bodyB){ - var dist = bsc_dist; - bodyA.position.vsub(bodyB.position,dist); - return Math.pow(bodyA.shape.boundingSphereRadius + bodyB.shape.boundingSphereRadius,2) > dist.norm2(); -}; - -/** - * Returns all the bodies within the AABB. - * @method aabbQuery - * @param {World} world - * @param {AABB} aabb - * @param {array} result An array to store resulting bodies in. - * @return {array} - */ -Broadphase.prototype.aabbQuery = function(world, aabb, result){ - console.warn('.aabbQuery is not implemented in this Broadphase subclass.'); - return []; -}; -},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Plane":42,"../shapes/Shape":43}],6:[function(_dereq_,module,exports){ -module.exports = GridBroadphase; - -var Broadphase = _dereq_('./Broadphase'); -var Vec3 = _dereq_('../math/Vec3'); -var Shape = _dereq_('../shapes/Shape'); - -/** - * Axis aligned uniform grid broadphase. - * @class GridBroadphase - * @constructor - * @extends Broadphase - * @todo Needs support for more than just planes and spheres. - * @param {Vec3} aabbMin - * @param {Vec3} aabbMax - * @param {Number} nx Number of boxes along x - * @param {Number} ny Number of boxes along y - * @param {Number} nz Number of boxes along z - */ -function GridBroadphase(aabbMin,aabbMax,nx,ny,nz){ - Broadphase.apply(this); - this.nx = nx || 10; - this.ny = ny || 10; - this.nz = nz || 10; - this.aabbMin = aabbMin || new Vec3(100,100,100); - this.aabbMax = aabbMax || new Vec3(-100,-100,-100); - var nbins = this.nx * this.ny * this.nz; - if (nbins <= 0) { - throw "GridBroadphase: Each dimension's n must be >0"; - } - this.bins = []; - this.binLengths = []; //Rather than continually resizing arrays (thrashing the memory), just record length and allow them to grow - this.bins.length = nbins; - this.binLengths.length = nbins; - for (var i=0;i= nx) { xoff0 = nx - 1; } - if (yoff0 < 0) { yoff0 = 0; } else if (yoff0 >= ny) { yoff0 = ny - 1; } - if (zoff0 < 0) { zoff0 = 0; } else if (zoff0 >= nz) { zoff0 = nz - 1; } - if (xoff1 < 0) { xoff1 = 0; } else if (xoff1 >= nx) { xoff1 = nx - 1; } - if (yoff1 < 0) { yoff1 = 0; } else if (yoff1 >= ny) { yoff1 = ny - 1; } - if (zoff1 < 0) { zoff1 = 0; } else if (zoff1 >= nz) { zoff1 = nz - 1; } - - xoff0 *= xstep; - yoff0 *= ystep; - zoff0 *= zstep; - xoff1 *= xstep; - yoff1 *= ystep; - zoff1 *= zstep; - - for (var xoff = xoff0; xoff <= xoff1; xoff += xstep) { - for (var yoff = yoff0; yoff <= yoff1; yoff += ystep) { - for (var zoff = zoff0; zoff <= zoff1; zoff += zstep) { - var idx = xoff+yoff+zoff; - bins[idx][binLengths[idx]++] = bi; - } - } - } - } - - // Put all bodies into the bins - for(var i=0; i!==N; i++){ - var bi = bodies[i]; - var si = bi.shape; - - switch(si.type){ - case SPHERE: - // Put in bin - // check if overlap with other bins - var x = bi.position.x, - y = bi.position.y, - z = bi.position.z; - var r = si.radius; - - addBoxToBins(x-r, y-r, z-r, x+r, y+r, z+r, bi); - break; - - case PLANE: - if(si.worldNormalNeedsUpdate){ - si.computeWorldNormal(bi.quaternion); - } - var planeNormal = si.worldNormal; - - //Relative position from origin of plane object to the first bin - //Incremented as we iterate through the bins - var xreset = xmin + binsizeX*0.5 - bi.position.x, - yreset = ymin + binsizeY*0.5 - bi.position.y, - zreset = zmin + binsizeZ*0.5 - bi.position.z; - - var d = GridBroadphase_collisionPairs_d; - d.set(xreset, yreset, zreset); - - for (var xi = 0, xoff = 0; xi !== nx; xi++, xoff += xstep, d.y = yreset, d.x += binsizeX) { - for (var yi = 0, yoff = 0; yi !== ny; yi++, yoff += ystep, d.z = zreset, d.y += binsizeY) { - for (var zi = 0, zoff = 0; zi !== nz; zi++, zoff += zstep, d.z += binsizeZ) { - if (d.dot(planeNormal) < binRadius) { - var idx = xoff + yoff + zoff; - bins[idx][binLengths[idx]++] = bi; - } - } - } - } - break; - - default: - if (bi.aabbNeedsUpdate) { - bi.computeAABB(); - } - - addBoxToBins( - bi.aabb.lowerBound.x, - bi.aabb.lowerBound.y, - bi.aabb.lowerBound.z, - bi.aabb.upperBound.x, - bi.aabb.upperBound.y, - bi.aabb.upperBound.z, - bi); - break; - } - } - - // Check each bin - for(var i=0; i!==Nbins; i++){ - var binLength = binLengths[i]; - //Skip bins with no potential collisions - if (binLength > 1) { - var bin = bins[i]; - - // Do N^2 broadphase inside - for(var xi=0; xi!==binLength; xi++){ - var bi = bin[xi]; - for(var yi=0; yi!==xi; yi++){ - var bj = bin[yi]; - if(this.needBroadphaseCollision(bi,bj)){ - this.intersectionTest(bi,bj,pairs1,pairs2); - } - } - } - } - } - -// for (var zi = 0, zoff=0; zi < nz; zi++, zoff+= zstep) { -// console.log("layer "+zi); -// for (var yi = 0, yoff=0; yi < ny; yi++, yoff += ystep) { -// var row = ''; -// for (var xi = 0, xoff=0; xi < nx; xi++, xoff += xstep) { -// var idx = xoff + yoff + zoff; -// row += ' ' + binLengths[idx]; -// } -// console.log(row); -// } -// } - - this.makePairsUnique(pairs1,pairs2); -}; - -},{"../math/Vec3":30,"../shapes/Shape":43,"./Broadphase":5}],7:[function(_dereq_,module,exports){ -module.exports = NaiveBroadphase; - -var Broadphase = _dereq_('./Broadphase'); -var AABB = _dereq_('./AABB'); - -/** - * Naive broadphase implementation, used in lack of better ones. - * @class NaiveBroadphase - * @constructor - * @description The naive broadphase looks at all possible pairs without restriction, therefore it has complexity N^2 (which is bad) - * @extends Broadphase - */ -function NaiveBroadphase(){ - Broadphase.apply(this); -} -NaiveBroadphase.prototype = new Broadphase(); -NaiveBroadphase.prototype.constructor = NaiveBroadphase; - -/** - * Get all the collision pairs in the physics world - * @method collisionPairs - * @param {World} world - * @param {Array} pairs1 - * @param {Array} pairs2 - */ -NaiveBroadphase.prototype.collisionPairs = function(world,pairs1,pairs2){ - var bodies = world.bodies, - n = bodies.length, - i,j,bi,bj; - - // Naive N^2 ftw! - for(i=0; i!==n; i++){ - for(j=0; j!==i; j++){ - - bi = bodies[i]; - bj = bodies[j]; - - if(!this.needBroadphaseCollision(bi,bj)){ - continue; - } - - this.intersectionTest(bi,bj,pairs1,pairs2); - } - } -}; - -var tmpAABB = new AABB(); - -/** - * Returns all the bodies within an AABB. - * @method aabbQuery - * @param {World} world - * @param {AABB} aabb - * @param {array} result An array to store resulting bodies in. - * @return {array} - */ -NaiveBroadphase.prototype.aabbQuery = function(world, aabb, result){ - result = result || []; - - for(var i = 0; i < world.bodies.length; i++){ - var b = world.bodies[i]; - - if(b.aabbNeedsUpdate){ - b.computeAABB(); - } - - // Ugly hack until Body gets aabb - if(b.aabb.overlaps(aabb)){ - result.push(b); - } - } - - return result; -}; -},{"./AABB":3,"./Broadphase":5}],8:[function(_dereq_,module,exports){ -module.exports = ObjectCollisionMatrix; - -/** - * Records what objects are colliding with each other - * @class ObjectCollisionMatrix - * @constructor - */ -function ObjectCollisionMatrix() { - - /** - * The matrix storage - * @property matrix - * @type {Object} - */ - this.matrix = {}; -} - -/** - * @method get - * @param {Number} i - * @param {Number} j - * @return {Number} - */ -ObjectCollisionMatrix.prototype.get = function(i, j) { - i = i.id; - j = j.id; - if (j > i) { - var temp = j; - j = i; - i = temp; - } - return i+'-'+j in this.matrix; -}; - -/** - * @method set - * @param {Number} i - * @param {Number} j - * @param {Number} value - */ -ObjectCollisionMatrix.prototype.set = function(i, j, value) { - i = i.id; - j = j.id; - if (j > i) { - var temp = j; - j = i; - i = temp; - } - if (value) { - this.matrix[i+'-'+j] = true; - } - else { - delete this.matrix[i+'-'+j]; - } -}; - -/** - * Empty the matrix - * @method reset - */ -ObjectCollisionMatrix.prototype.reset = function() { - this.matrix = {}; -}; - -/** - * Set max number of objects - * @method setNumObjects - * @param {Number} n - */ -ObjectCollisionMatrix.prototype.setNumObjects = function(n) { -}; - -},{}],9:[function(_dereq_,module,exports){ -module.exports = Ray; - -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Transform = _dereq_('../math/Transform'); -var ConvexPolyhedron = _dereq_('../shapes/ConvexPolyhedron'); -var Box = _dereq_('../shapes/Box'); -var RaycastResult = _dereq_('../collision/RaycastResult'); -var Shape = _dereq_('../shapes/Shape'); -var AABB = _dereq_('../collision/AABB'); - -/** - * A line in 3D space that intersects bodies and return points. - * @class Ray - * @constructor - * @param {Vec3} from - * @param {Vec3} to - */ -function Ray(from, to){ - /** - * @property {Vec3} from - */ - this.from = from ? from.clone() : new Vec3(); - - /** - * @property {Vec3} to - */ - this.to = to ? to.clone() : new Vec3(); - - /** - * @private - * @property {Vec3} _direction - */ - this._direction = new Vec3(); - - /** - * The precision of the ray. Used when checking parallelity etc. - * @property {Number} precision - */ - this.precision = 0.0001; - - /** - * Set to true if you want the Ray to take .collisionResponse flags into account on bodies and shapes. - * @property {Boolean} checkCollisionResponse - */ - this.checkCollisionResponse = true; - - /** - * If set to true, the ray skips any hits with normal.dot(rayDirection) < 0. - * @property {Boolean} skipBackfaces - */ - this.skipBackfaces = false; - - /** - * @property {number} collisionFilterMask - * @default -1 - */ - this.collisionFilterMask = -1; - - /** - * @property {number} collisionFilterGroup - * @default -1 - */ - this.collisionFilterGroup = -1; - - /** - * The intersection mode. Should be Ray.ANY, Ray.ALL or Ray.CLOSEST. - * @property {number} mode - */ - this.mode = Ray.ANY; - - /** - * Current result object. - * @property {RaycastResult} result - */ - this.result = new RaycastResult(); - - /** - * Will be set to true during intersectWorld() if the ray hit anything. - * @property {Boolean} hasHit - */ - this.hasHit = false; - - /** - * Current, user-provided result callback. Will be used if mode is Ray.ALL. - * @property {Function} callback - */ - this.callback = function(result){}; -} -Ray.prototype.constructor = Ray; - -Ray.CLOSEST = 1; -Ray.ANY = 2; -Ray.ALL = 4; - -var tmpAABB = new AABB(); -var tmpArray = []; - -/** - * Do itersection against all bodies in the given World. - * @method intersectWorld - * @param {World} world - * @param {object} options - * @return {Boolean} True if the ray hit anything, otherwise false. - */ -Ray.prototype.intersectWorld = function (world, options) { - this.mode = options.mode || Ray.ANY; - this.result = options.result || new RaycastResult(); - this.skipBackfaces = !!options.skipBackfaces; - this.collisionFilterMask = typeof(options.collisionFilterMask) !== 'undefined' ? options.collisionFilterMask : -1; - this.collisionFilterGroup = typeof(options.collisionFilterGroup) !== 'undefined' ? options.collisionFilterGroup : -1; - if(options.from){ - this.from.copy(options.from); - } - if(options.to){ - this.to.copy(options.to); - } - this.callback = options.callback || function(){}; - this.hasHit = false; - - this.result.reset(); - this._updateDirection(); - - this.getAABB(tmpAABB); - tmpArray.length = 0; - world.broadphase.aabbQuery(world, tmpAABB, tmpArray); - this.intersectBodies(tmpArray); - - return this.hasHit; -}; - -var v1 = new Vec3(), - v2 = new Vec3(); - -/* - * As per "Barycentric Technique" as named here http://www.blackpawn.com/texts/pointinpoly/default.html But without the division - */ -Ray.pointInTriangle = pointInTriangle; -function pointInTriangle(p, a, b, c) { - c.vsub(a,v0); - b.vsub(a,v1); - p.vsub(a,v2); - - var dot00 = v0.dot( v0 ); - var dot01 = v0.dot( v1 ); - var dot02 = v0.dot( v2 ); - var dot11 = v1.dot( v1 ); - var dot12 = v1.dot( v2 ); - - var u,v; - - return ( (u = dot11 * dot02 - dot01 * dot12) >= 0 ) && - ( (v = dot00 * dot12 - dot01 * dot02) >= 0 ) && - ( u + v < ( dot00 * dot11 - dot01 * dot01 ) ); -} - -/** - * Shoot a ray at a body, get back information about the hit. - * @method intersectBody - * @private - * @param {Body} body - * @param {RaycastResult} [result] Deprecated - set the result property of the Ray instead. - */ -var intersectBody_xi = new Vec3(); -var intersectBody_qi = new Quaternion(); -Ray.prototype.intersectBody = function (body, result) { - if(result){ - this.result = result; - this._updateDirection(); - } - var checkCollisionResponse = this.checkCollisionResponse; - - if(checkCollisionResponse && !body.collisionResponse){ - return; - } - - if((this.collisionFilterGroup & body.collisionFilterMask)===0 || (body.collisionFilterGroup & this.collisionFilterMask)===0){ - return; - } - - var xi = intersectBody_xi; - var qi = intersectBody_qi; - - for (var i = 0, N = body.shapes.length; i < N; i++) { - var shape = body.shapes[i]; - - if(checkCollisionResponse && !shape.collisionResponse){ - continue; // Skip - } - - body.quaternion.mult(body.shapeOrientations[i], qi); - body.quaternion.vmult(body.shapeOffsets[i], xi); - xi.vadd(body.position, xi); - - this.intersectShape( - shape, - qi, - xi, - body - ); - - if(this.result._shouldStop){ - break; - } - } -}; - -/** - * @method intersectBodies - * @param {Array} bodies An array of Body objects. - * @param {RaycastResult} [result] Deprecated - */ -Ray.prototype.intersectBodies = function (bodies, result) { - if(result){ - this.result = result; - this._updateDirection(); - } - - for ( var i = 0, l = bodies.length; !this.result._shouldStop && i < l; i ++ ) { - this.intersectBody(bodies[i]); - } -}; - -/** - * Updates the _direction vector. - * @private - * @method _updateDirection - */ -Ray.prototype._updateDirection = function(){ - this.to.vsub(this.from, this._direction); - this._direction.normalize(); -}; - -/** - * @method intersectShape - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - */ -Ray.prototype.intersectShape = function(shape, quat, position, body){ - var from = this.from; - - - // Checking boundingSphere - var distance = distanceFromIntersection(from, this._direction, position); - if ( distance > shape.boundingSphereRadius ) { - return; - } - - var intersectMethod = this[shape.type]; - if(intersectMethod){ - intersectMethod.call(this, shape, quat, position, body); - } -}; - -var vector = new Vec3(); -var normal = new Vec3(); -var intersectPoint = new Vec3(); - -var a = new Vec3(); -var b = new Vec3(); -var c = new Vec3(); -var d = new Vec3(); - -var tmpRaycastResult = new RaycastResult(); - -/** - * @method intersectBox - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - */ -Ray.prototype.intersectBox = function(shape, quat, position, body){ - return this.intersectConvex(shape.convexPolyhedronRepresentation, quat, position, body); -}; -Ray.prototype[Shape.types.BOX] = Ray.prototype.intersectBox; - -/** - * @method intersectPlane - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - */ -Ray.prototype.intersectPlane = function(shape, quat, position, body){ - var from = this.from; - var to = this.to; - var direction = this._direction; - - // Get plane normal - var worldNormal = new Vec3(0, 0, 1); - quat.vmult(worldNormal, worldNormal); - - var len = new Vec3(); - from.vsub(position, len); - var planeToFrom = len.dot(worldNormal); - to.vsub(position, len); - var planeToTo = len.dot(worldNormal); - - if(planeToFrom * planeToTo > 0){ - // "from" and "to" are on the same side of the plane... bail out - return; - } - - if(from.distanceTo(to) < planeToFrom){ - return; - } - - var n_dot_dir = worldNormal.dot(direction); - - if (Math.abs(n_dot_dir) < this.precision) { - // No intersection - return; - } - - var planePointToFrom = new Vec3(); - var dir_scaled_with_t = new Vec3(); - var hitPointWorld = new Vec3(); - - from.vsub(position, planePointToFrom); - var t = -worldNormal.dot(planePointToFrom) / n_dot_dir; - direction.scale(t, dir_scaled_with_t); - from.vadd(dir_scaled_with_t, hitPointWorld); - - this.reportIntersection(worldNormal, hitPointWorld, shape, body, -1); -}; -Ray.prototype[Shape.types.PLANE] = Ray.prototype.intersectPlane; - -/** - * Get the world AABB of the ray. - * @method getAABB - * @param {AABB} aabb - */ -Ray.prototype.getAABB = function(result){ - var to = this.to; - var from = this.from; - result.lowerBound.x = Math.min(to.x, from.x); - result.lowerBound.y = Math.min(to.y, from.y); - result.lowerBound.z = Math.min(to.z, from.z); - result.upperBound.x = Math.max(to.x, from.x); - result.upperBound.y = Math.max(to.y, from.y); - result.upperBound.z = Math.max(to.z, from.z); -}; - -var intersectConvexOptions = { - faceList: [0] -}; - -/** - * @method intersectHeightfield - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - */ -Ray.prototype.intersectHeightfield = function(shape, quat, position, body){ - var data = shape.data, - w = shape.elementSize, - worldPillarOffset = new Vec3(); - - // Convert the ray to local heightfield coordinates - var localRay = new Ray(this.from, this.to); - Transform.pointToLocalFrame(position, quat, localRay.from, localRay.from); - Transform.pointToLocalFrame(position, quat, localRay.to, localRay.to); - - // Get the index of the data points to test against - var index = []; - var iMinX = null; - var iMinY = null; - var iMaxX = null; - var iMaxY = null; - - var inside = shape.getIndexOfPosition(localRay.from.x, localRay.from.y, index, false); - if(inside){ - iMinX = index[0]; - iMinY = index[1]; - iMaxX = index[0]; - iMaxY = index[1]; - } - inside = shape.getIndexOfPosition(localRay.to.x, localRay.to.y, index, false); - if(inside){ - if (iMinX === null || index[0] < iMinX) { iMinX = index[0]; } - if (iMaxX === null || index[0] > iMaxX) { iMaxX = index[0]; } - if (iMinY === null || index[1] < iMinY) { iMinY = index[1]; } - if (iMaxY === null || index[1] > iMaxY) { iMaxY = index[1]; } - } - - if(iMinX === null){ - return; - } - - var minMax = []; - shape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); - var min = minMax[0]; - var max = minMax[1]; - - // // Bail out if the ray can't touch the bounding box - // // TODO - // var aabb = new AABB(); - // this.getAABB(aabb); - // if(aabb.intersects()){ - // return; - // } - - for(var i = iMinX; i <= iMaxX; i++){ - for(var j = iMinY; j <= iMaxY; j++){ - - if(this.result._shouldStop){ - return; - } - - // Lower triangle - shape.getConvexTrianglePillar(i, j, false); - Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); - this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, intersectConvexOptions); - - if(this.result._shouldStop){ - return; - } - - // Upper triangle - shape.getConvexTrianglePillar(i, j, true); - Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); - this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, intersectConvexOptions); - } - } -}; -Ray.prototype[Shape.types.HEIGHTFIELD] = Ray.prototype.intersectHeightfield; - -var Ray_intersectSphere_intersectionPoint = new Vec3(); -var Ray_intersectSphere_normal = new Vec3(); - -/** - * @method intersectSphere - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - */ -Ray.prototype.intersectSphere = function(shape, quat, position, body){ - var from = this.from, - to = this.to, - r = shape.radius; - - var a = Math.pow(to.x - from.x, 2) + Math.pow(to.y - from.y, 2) + Math.pow(to.z - from.z, 2); - var b = 2 * ((to.x - from.x) * (from.x - position.x) + (to.y - from.y) * (from.y - position.y) + (to.z - from.z) * (from.z - position.z)); - var c = Math.pow(from.x - position.x, 2) + Math.pow(from.y - position.y, 2) + Math.pow(from.z - position.z, 2) - Math.pow(r, 2); - - var delta = Math.pow(b, 2) - 4 * a * c; - - var intersectionPoint = Ray_intersectSphere_intersectionPoint; - var normal = Ray_intersectSphere_normal; - - if(delta < 0){ - // No intersection - return; - - } else if(delta === 0){ - // single intersection point - from.lerp(to, delta, intersectionPoint); - - intersectionPoint.vsub(position, normal); - normal.normalize(); - - this.reportIntersection(normal, intersectionPoint, shape, body, -1); - - } else { - var d1 = (- b - Math.sqrt(delta)) / (2 * a); - var d2 = (- b + Math.sqrt(delta)) / (2 * a); - - if(d1 >= 0 && d1 <= 1){ - from.lerp(to, d1, intersectionPoint); - intersectionPoint.vsub(position, normal); - normal.normalize(); - this.reportIntersection(normal, intersectionPoint, shape, body, -1); - } - - if(this.result._shouldStop){ - return; - } - - if(d2 >= 0 && d2 <= 1){ - from.lerp(to, d2, intersectionPoint); - intersectionPoint.vsub(position, normal); - normal.normalize(); - this.reportIntersection(normal, intersectionPoint, shape, body, -1); - } - } -}; -Ray.prototype[Shape.types.SPHERE] = Ray.prototype.intersectSphere; - - -var intersectConvex_normal = new Vec3(); -var intersectConvex_minDistNormal = new Vec3(); -var intersectConvex_minDistIntersect = new Vec3(); -var intersectConvex_vector = new Vec3(); - -/** - * @method intersectConvex - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - * @param {object} [options] - * @param {array} [options.faceList] - */ -Ray.prototype.intersectConvex = function intersectConvex( - shape, - quat, - position, - body, - options -){ - var minDistNormal = intersectConvex_minDistNormal; - var normal = intersectConvex_normal; - var vector = intersectConvex_vector; - var minDistIntersect = intersectConvex_minDistIntersect; - var faceList = (options && options.faceList) || null; - - // Checking faces - var faces = shape.faces, - vertices = shape.vertices, - normals = shape.faceNormals; - var direction = this._direction; - - var from = this.from; - var to = this.to; - var fromToDistance = from.distanceTo(to); - - var minDist = -1; - var Nfaces = faceList ? faceList.length : faces.length; - var result = this.result; - - for (var j = 0; !result._shouldStop && j < Nfaces; j++) { - var fi = faceList ? faceList[j] : j; - - var face = faces[fi]; - var faceNormal = normals[fi]; - var q = quat; - var x = position; - - // determine if ray intersects the plane of the face - // note: this works regardless of the direction of the face normal - - // Get plane point in world coordinates... - vector.copy(vertices[face[0]]); - q.vmult(vector,vector); - vector.vadd(x,vector); - - // ...but make it relative to the ray from. We'll fix this later. - vector.vsub(from,vector); - - // Get plane normal - q.vmult(faceNormal,normal); - - // If this dot product is negative, we have something interesting - var dot = direction.dot(normal); - - // Bail out if ray and plane are parallel - if ( Math.abs( dot ) < this.precision ){ - continue; - } - - // calc distance to plane - var scalar = normal.dot(vector) / dot; - - // if negative distance, then plane is behind ray - if (scalar < 0){ - continue; - } - - // if (dot < 0) { - - // Intersection point is from + direction * scalar - direction.mult(scalar,intersectPoint); - intersectPoint.vadd(from,intersectPoint); - - // a is the point we compare points b and c with. - a.copy(vertices[face[0]]); - q.vmult(a,a); - x.vadd(a,a); - - for(var i = 1; !result._shouldStop && i < face.length - 1; i++){ - // Transform 3 vertices to world coords - b.copy(vertices[face[i]]); - c.copy(vertices[face[i+1]]); - q.vmult(b,b); - q.vmult(c,c); - x.vadd(b,b); - x.vadd(c,c); - - var distance = intersectPoint.distanceTo(from); - - if(!(pointInTriangle(intersectPoint, a, b, c) || pointInTriangle(intersectPoint, b, a, c)) || distance > fromToDistance){ - continue; - } - - this.reportIntersection(normal, intersectPoint, shape, body, fi); - } - // } - } -}; -Ray.prototype[Shape.types.CONVEXPOLYHEDRON] = Ray.prototype.intersectConvex; - -var intersectTrimesh_normal = new Vec3(); -var intersectTrimesh_localDirection = new Vec3(); -var intersectTrimesh_localFrom = new Vec3(); -var intersectTrimesh_localTo = new Vec3(); -var intersectTrimesh_worldNormal = new Vec3(); -var intersectTrimesh_worldIntersectPoint = new Vec3(); -var intersectTrimesh_localAABB = new AABB(); -var intersectTrimesh_triangles = []; -var intersectTrimesh_treeTransform = new Transform(); - -/** - * @method intersectTrimesh - * @private - * @param {Shape} shape - * @param {Quaternion} quat - * @param {Vec3} position - * @param {Body} body - * @param {object} [options] - * @todo Optimize by transforming the world to local space first. - * @todo Use Octree lookup - */ -Ray.prototype.intersectTrimesh = function intersectTrimesh( - mesh, - quat, - position, - body, - options -){ - var normal = intersectTrimesh_normal; - var triangles = intersectTrimesh_triangles; - var treeTransform = intersectTrimesh_treeTransform; - var minDistNormal = intersectConvex_minDistNormal; - var vector = intersectConvex_vector; - var minDistIntersect = intersectConvex_minDistIntersect; - var localAABB = intersectTrimesh_localAABB; - var localDirection = intersectTrimesh_localDirection; - var localFrom = intersectTrimesh_localFrom; - var localTo = intersectTrimesh_localTo; - var worldIntersectPoint = intersectTrimesh_worldIntersectPoint; - var worldNormal = intersectTrimesh_worldNormal; - var faceList = (options && options.faceList) || null; - - // Checking faces - var indices = mesh.indices, - vertices = mesh.vertices, - normals = mesh.faceNormals; - - var from = this.from; - var to = this.to; - var direction = this._direction; - - var minDist = -1; - treeTransform.position.copy(position); - treeTransform.quaternion.copy(quat); - - // Transform ray to local space! - Transform.vectorToLocalFrame(position, quat, direction, localDirection); - //body.vectorToLocalFrame(direction, localDirection); - Transform.pointToLocalFrame(position, quat, from, localFrom); - //body.pointToLocalFrame(from, localFrom); - Transform.pointToLocalFrame(position, quat, to, localTo); - //body.pointToLocalFrame(to, localTo); - var fromToDistanceSquared = localFrom.distanceSquared(localTo); - - mesh.tree.rayQuery(this, treeTransform, triangles); - - for (var i = 0, N = triangles.length; !this.result._shouldStop && i !== N; i++) { - var trianglesIndex = triangles[i]; - - mesh.getNormal(trianglesIndex, normal); - - // determine if ray intersects the plane of the face - // note: this works regardless of the direction of the face normal - - // Get plane point in world coordinates... - mesh.getVertex(indices[trianglesIndex * 3], a); - - // ...but make it relative to the ray from. We'll fix this later. - a.vsub(localFrom,vector); - - // Get plane normal - // quat.vmult(normal, normal); - - // If this dot product is negative, we have something interesting - var dot = localDirection.dot(normal); - - // Bail out if ray and plane are parallel - // if (Math.abs( dot ) < this.precision){ - // continue; - // } - - // calc distance to plane - var scalar = normal.dot(vector) / dot; - - // if negative distance, then plane is behind ray - if (scalar < 0){ - continue; - } - - // Intersection point is from + direction * scalar - localDirection.scale(scalar,intersectPoint); - intersectPoint.vadd(localFrom,intersectPoint); - - // Get triangle vertices - mesh.getVertex(indices[trianglesIndex * 3 + 1], b); - mesh.getVertex(indices[trianglesIndex * 3 + 2], c); - - var squaredDistance = intersectPoint.distanceSquared(localFrom); - - if(!(pointInTriangle(intersectPoint, b, a, c) || pointInTriangle(intersectPoint, a, b, c)) || squaredDistance > fromToDistanceSquared){ - continue; - } - - // transform intersectpoint and normal to world - Transform.vectorToWorldFrame(quat, normal, worldNormal); - //body.vectorToWorldFrame(normal, worldNormal); - Transform.pointToWorldFrame(position, quat, intersectPoint, worldIntersectPoint); - //body.pointToWorldFrame(intersectPoint, worldIntersectPoint); - this.reportIntersection(worldNormal, worldIntersectPoint, mesh, body, trianglesIndex); - } - triangles.length = 0; -}; -Ray.prototype[Shape.types.TRIMESH] = Ray.prototype.intersectTrimesh; - - -/** - * @method reportIntersection - * @private - * @param {Vec3} normal - * @param {Vec3} hitPointWorld - * @param {Shape} shape - * @param {Body} body - * @return {boolean} True if the intersections should continue - */ -Ray.prototype.reportIntersection = function(normal, hitPointWorld, shape, body, hitFaceIndex){ - var from = this.from; - var to = this.to; - var distance = from.distanceTo(hitPointWorld); - var result = this.result; - - // Skip back faces? - if(this.skipBackfaces && normal.dot(this._direction) > 0){ - return; - } - - result.hitFaceIndex = typeof(hitFaceIndex) !== 'undefined' ? hitFaceIndex : -1; - - switch(this.mode){ - case Ray.ALL: - this.hasHit = true; - result.set( - from, - to, - normal, - hitPointWorld, - shape, - body, - distance - ); - result.hasHit = true; - this.callback(result); - break; - - case Ray.CLOSEST: - - // Store if closer than current closest - if(distance < result.distance || !result.hasHit){ - this.hasHit = true; - result.hasHit = true; - result.set( - from, - to, - normal, - hitPointWorld, - shape, - body, - distance - ); - } - break; - - case Ray.ANY: - - // Report and stop. - this.hasHit = true; - result.hasHit = true; - result.set( - from, - to, - normal, - hitPointWorld, - shape, - body, - distance - ); - result._shouldStop = true; - break; - } -}; - -var v0 = new Vec3(), - intersect = new Vec3(); -function distanceFromIntersection(from, direction, position) { - - // v0 is vector from from to position - position.vsub(from,v0); - var dot = v0.dot(direction); - - // intersect = direction*dot + from - direction.mult(dot,intersect); - intersect.vadd(from,intersect); - - var distance = position.distanceTo(intersect); - - return distance; -} - - -},{"../collision/AABB":3,"../collision/RaycastResult":10,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../shapes/Box":37,"../shapes/ConvexPolyhedron":38,"../shapes/Shape":43}],10:[function(_dereq_,module,exports){ -var Vec3 = _dereq_('../math/Vec3'); - -module.exports = RaycastResult; - -/** - * Storage for Ray casting data. - * @class RaycastResult - * @constructor - */ -function RaycastResult(){ - - /** - * @property {Vec3} rayFromWorld - */ - this.rayFromWorld = new Vec3(); - - /** - * @property {Vec3} rayToWorld - */ - this.rayToWorld = new Vec3(); - - /** - * @property {Vec3} hitNormalWorld - */ - this.hitNormalWorld = new Vec3(); - - /** - * @property {Vec3} hitPointWorld - */ - this.hitPointWorld = new Vec3(); - - /** - * @property {boolean} hasHit - */ - this.hasHit = false; - - /** - * The hit shape, or null. - * @property {Shape} shape - */ - this.shape = null; - - /** - * The hit body, or null. - * @property {Body} body - */ - this.body = null; - - /** - * The index of the hit triangle, if the hit shape was a trimesh. - * @property {number} hitFaceIndex - * @default -1 - */ - this.hitFaceIndex = -1; - - /** - * Distance to the hit. Will be set to -1 if there was no hit. - * @property {number} distance - * @default -1 - */ - this.distance = -1; - - /** - * If the ray should stop traversing the bodies. - * @private - * @property {Boolean} _shouldStop - * @default false - */ - this._shouldStop = false; -} - -/** - * Reset all result data. - * @method reset - */ -RaycastResult.prototype.reset = function () { - this.rayFromWorld.setZero(); - this.rayToWorld.setZero(); - this.hitNormalWorld.setZero(); - this.hitPointWorld.setZero(); - this.hasHit = false; - this.shape = null; - this.body = null; - this.hitFaceIndex = -1; - this.distance = -1; - this._shouldStop = false; -}; - -/** - * @method abort - */ -RaycastResult.prototype.abort = function(){ - this._shouldStop = true; -}; - -/** - * @method set - * @param {Vec3} rayFromWorld - * @param {Vec3} rayToWorld - * @param {Vec3} hitNormalWorld - * @param {Vec3} hitPointWorld - * @param {Shape} shape - * @param {Body} body - * @param {number} distance - */ -RaycastResult.prototype.set = function( - rayFromWorld, - rayToWorld, - hitNormalWorld, - hitPointWorld, - shape, - body, - distance -){ - this.rayFromWorld.copy(rayFromWorld); - this.rayToWorld.copy(rayToWorld); - this.hitNormalWorld.copy(hitNormalWorld); - this.hitPointWorld.copy(hitPointWorld); - this.shape = shape; - this.body = body; - this.distance = distance; -}; -},{"../math/Vec3":30}],11:[function(_dereq_,module,exports){ -var Shape = _dereq_('../shapes/Shape'); -var Broadphase = _dereq_('../collision/Broadphase'); - -module.exports = SAPBroadphase; - -/** - * Sweep and prune broadphase along one axis. - * - * @class SAPBroadphase - * @constructor - * @param {World} [world] - * @extends Broadphase - */ -function SAPBroadphase(world){ - Broadphase.apply(this); - - /** - * List of bodies currently in the broadphase. - * @property axisList - * @type {Array} - */ - this.axisList = []; - - /** - * The world to search in. - * @property world - * @type {World} - */ - this.world = null; - - /** - * Axis to sort the bodies along. Set to 0 for x axis, and 1 for y axis. For best performance, choose an axis that the bodies are spread out more on. - * @property axisIndex - * @type {Number} - */ - this.axisIndex = 0; - - var axisList = this.axisList; - - this._addBodyHandler = function(e){ - axisList.push(e.body); - }; - - this._removeBodyHandler = function(e){ - var idx = axisList.indexOf(e.body); - if(idx !== -1){ - axisList.splice(idx,1); - } - }; - - if(world){ - this.setWorld(world); - } -} -SAPBroadphase.prototype = new Broadphase(); - -/** - * Change the world - * @method setWorld - * @param {World} world - */ -SAPBroadphase.prototype.setWorld = function(world){ - // Clear the old axis array - this.axisList.length = 0; - - // Add all bodies from the new world - for(var i=0; i=0;j--) { - if(a[j].aabb.lowerBound.x <= v.aabb.lowerBound.x){ - break; - } - a[j+1] = a[j]; - } - a[j+1] = v; - } - return a; -}; - -/** - * @static - * @method insertionSortY - * @param {Array} a - * @return {Array} - */ -SAPBroadphase.insertionSortY = function(a) { - for(var i=1,l=a.length;i=0;j--) { - if(a[j].aabb.lowerBound.y <= v.aabb.lowerBound.y){ - break; - } - a[j+1] = a[j]; - } - a[j+1] = v; - } - return a; -}; - -/** - * @static - * @method insertionSortZ - * @param {Array} a - * @return {Array} - */ -SAPBroadphase.insertionSortZ = function(a) { - for(var i=1,l=a.length;i=0;j--) { - if(a[j].aabb.lowerBound.z <= v.aabb.lowerBound.z){ - break; - } - a[j+1] = a[j]; - } - a[j+1] = v; - } - return a; -}; - -/** - * Collect all collision pairs - * @method collisionPairs - * @param {World} world - * @param {Array} p1 - * @param {Array} p2 - */ -SAPBroadphase.prototype.collisionPairs = function(world,p1,p2){ - var bodies = this.axisList, - N = bodies.length, - axisIndex = this.axisIndex, - i, j; - - if(this.dirty){ - this.sortList(); - this.dirty = false; - } - - // Look through the list - for(i=0; i !== N; i++){ - var bi = bodies[i]; - - for(j=i+1; j < N; j++){ - var bj = bodies[j]; - - if(!this.needBroadphaseCollision(bi,bj)){ - continue; - } - - if(!SAPBroadphase.checkBounds(bi,bj,axisIndex)){ - break; - } - - this.intersectionTest(bi,bj,p1,p2); - } - } -}; - -SAPBroadphase.prototype.sortList = function(){ - var axisList = this.axisList; - var axisIndex = this.axisIndex; - var N = axisList.length; - - // Update AABBs - for(var i = 0; i!==N; i++){ - var bi = axisList[i]; - if(bi.aabbNeedsUpdate){ - bi.computeAABB(); - } - } - - // Sort the list - if(axisIndex === 0){ - SAPBroadphase.insertionSortX(axisList); - } else if(axisIndex === 1){ - SAPBroadphase.insertionSortY(axisList); - } else if(axisIndex === 2){ - SAPBroadphase.insertionSortZ(axisList); - } -}; - -/** - * Check if the bounds of two bodies overlap, along the given SAP axis. - * @static - * @method checkBounds - * @param {Body} bi - * @param {Body} bj - * @param {Number} axisIndex - * @return {Boolean} - */ -SAPBroadphase.checkBounds = function(bi, bj, axisIndex){ - var biPos; - var bjPos; - - if(axisIndex === 0){ - biPos = bi.position.x; - bjPos = bj.position.x; - } else if(axisIndex === 1){ - biPos = bi.position.y; - bjPos = bj.position.y; - } else if(axisIndex === 2){ - biPos = bi.position.z; - bjPos = bj.position.z; - } - - var ri = bi.boundingRadius, - rj = bj.boundingRadius, - boundA1 = biPos - ri, - boundA2 = biPos + ri, - boundB1 = bjPos - rj, - boundB2 = bjPos + rj; - - return boundB1 < boundA2; -}; - -/** - * Computes the variance of the body positions and estimates the best - * axis to use. Will automatically set property .axisIndex. - * @method autoDetectAxis - */ -SAPBroadphase.prototype.autoDetectAxis = function(){ - var sumX=0, - sumX2=0, - sumY=0, - sumY2=0, - sumZ=0, - sumZ2=0, - bodies = this.axisList, - N = bodies.length, - invN=1/N; - - for(var i=0; i!==N; i++){ - var b = bodies[i]; - - var centerX = b.position.x; - sumX += centerX; - sumX2 += centerX*centerX; - - var centerY = b.position.y; - sumY += centerY; - sumY2 += centerY*centerY; - - var centerZ = b.position.z; - sumZ += centerZ; - sumZ2 += centerZ*centerZ; - } - - var varianceX = sumX2 - sumX*sumX*invN, - varianceY = sumY2 - sumY*sumY*invN, - varianceZ = sumZ2 - sumZ*sumZ*invN; - - if(varianceX > varianceY){ - if(varianceX > varianceZ){ - this.axisIndex = 0; - } else{ - this.axisIndex = 2; - } - } else if(varianceY > varianceZ){ - this.axisIndex = 1; - } else{ - this.axisIndex = 2; - } -}; - -/** - * Returns all the bodies within an AABB. - * @method aabbQuery - * @param {World} world - * @param {AABB} aabb - * @param {array} result An array to store resulting bodies in. - * @return {array} - */ -SAPBroadphase.prototype.aabbQuery = function(world, aabb, result){ - result = result || []; - - if(this.dirty){ - this.sortList(); - this.dirty = false; - } - - var axisIndex = this.axisIndex, axis = 'x'; - if(axisIndex === 1){ axis = 'y'; } - if(axisIndex === 2){ axis = 'z'; } - - var axisList = this.axisList; - var lower = aabb.lowerBound[axis]; - var upper = aabb.upperBound[axis]; - for(var i = 0; i < axisList.length; i++){ - var b = axisList[i]; - - if(b.aabbNeedsUpdate){ - b.computeAABB(); - } - - if(b.aabb.overlaps(aabb)){ - result.push(b); - } - } - - return result; -}; -},{"../collision/Broadphase":5,"../shapes/Shape":43}],12:[function(_dereq_,module,exports){ -module.exports = ConeTwistConstraint; - -var Constraint = _dereq_('./Constraint'); -var PointToPointConstraint = _dereq_('./PointToPointConstraint'); -var ConeEquation = _dereq_('../equations/ConeEquation'); -var RotationalEquation = _dereq_('../equations/RotationalEquation'); -var ContactEquation = _dereq_('../equations/ContactEquation'); -var Vec3 = _dereq_('../math/Vec3'); - -/** - * @class ConeTwistConstraint - * @constructor - * @author schteppe - * @param {Body} bodyA - * @param {Body} bodyB - * @param {object} [options] - * @param {Vec3} [options.pivotA] - * @param {Vec3} [options.pivotB] - * @param {Vec3} [options.axisA] - * @param {Vec3} [options.axisB] - * @param {Number} [options.maxForce=1e6] - * @extends PointToPointConstraint - */ -function ConeTwistConstraint(bodyA, bodyB, options){ - options = options || {}; - var maxForce = typeof(options.maxForce) !== 'undefined' ? options.maxForce : 1e6; - - // Set pivot point in between - var pivotA = options.pivotA ? options.pivotA.clone() : new Vec3(); - var pivotB = options.pivotB ? options.pivotB.clone() : new Vec3(); - this.axisA = options.axisA ? options.axisA.clone() : new Vec3(); - this.axisB = options.axisB ? options.axisB.clone() : new Vec3(); - - PointToPointConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); - - this.collideConnected = !!options.collideConnected; - - this.angle = typeof(options.angle) !== 'undefined' ? options.angle : 0; - - /** - * @property {ConeEquation} coneEquation - */ - var c = this.coneEquation = new ConeEquation(bodyA,bodyB,options); - - /** - * @property {RotationalEquation} twistEquation - */ - var t = this.twistEquation = new RotationalEquation(bodyA,bodyB,options); - this.twistAngle = typeof(options.twistAngle) !== 'undefined' ? options.twistAngle : 0; - - // Make the cone equation push the bodies toward the cone axis, not outward - c.maxForce = 0; - c.minForce = -maxForce; - - // Make the twist equation add torque toward the initial position - t.maxForce = 0; - t.minForce = -maxForce; - - this.equations.push(c, t); -} -ConeTwistConstraint.prototype = new PointToPointConstraint(); -ConeTwistConstraint.constructor = ConeTwistConstraint; - -var ConeTwistConstraint_update_tmpVec1 = new Vec3(); -var ConeTwistConstraint_update_tmpVec2 = new Vec3(); - -ConeTwistConstraint.prototype.update = function(){ - var bodyA = this.bodyA, - bodyB = this.bodyB, - cone = this.coneEquation, - twist = this.twistEquation; - - PointToPointConstraint.prototype.update.call(this); - - // Update the axes to the cone constraint - bodyA.vectorToWorldFrame(this.axisA, cone.axisA); - bodyB.vectorToWorldFrame(this.axisB, cone.axisB); - - // Update the world axes in the twist constraint - this.axisA.tangents(twist.axisA, twist.axisA); - bodyA.vectorToWorldFrame(twist.axisA, twist.axisA); - - this.axisB.tangents(twist.axisB, twist.axisB); - bodyB.vectorToWorldFrame(twist.axisB, twist.axisB); - - cone.angle = this.angle; - twist.maxAngle = this.twistAngle; -}; - - -},{"../equations/ConeEquation":18,"../equations/ContactEquation":19,"../equations/RotationalEquation":22,"../math/Vec3":30,"./Constraint":13,"./PointToPointConstraint":17}],13:[function(_dereq_,module,exports){ -module.exports = Constraint; - -var Utils = _dereq_('../utils/Utils'); - -/** - * Constraint base class - * @class Constraint - * @author schteppe - * @constructor - * @param {Body} bodyA - * @param {Body} bodyB - * @param {object} [options] - * @param {boolean} [options.collideConnected=true] - * @param {boolean} [options.wakeUpBodies=true] - */ -function Constraint(bodyA, bodyB, options){ - options = Utils.defaults(options,{ - collideConnected : true, - wakeUpBodies : true, - }); - - /** - * Equations to be solved in this constraint - * @property equations - * @type {Array} - */ - this.equations = []; - - /** - * @property {Body} bodyA - */ - this.bodyA = bodyA; - - /** - * @property {Body} bodyB - */ - this.bodyB = bodyB; - - /** - * @property {Number} id - */ - this.id = Constraint.idCounter++; - - /** - * Set to true if you want the bodies to collide when they are connected. - * @property collideConnected - * @type {boolean} - */ - this.collideConnected = options.collideConnected; - - if(options.wakeUpBodies){ - if(bodyA){ - bodyA.wakeUp(); - } - if(bodyB){ - bodyB.wakeUp(); - } - } -} - -/** - * Update all the equations with data. - * @method update - */ -Constraint.prototype.update = function(){ - throw new Error("method update() not implmemented in this Constraint subclass!"); -}; - -/** - * Enables all equations in the constraint. - * @method enable - */ -Constraint.prototype.enable = function(){ - var eqs = this.equations; - for(var i=0; i - // G = [0 axisA 0 -axisB] - - GA.rotational.copy(axisA); - axisB.negate(GB.rotational); - - var GW = this.computeGW() - this.targetVelocity, - GiMf = this.computeGiMf(); - - var B = - GW * b - h * GiMf; - - return B; -}; - -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],24:[function(_dereq_,module,exports){ -var Utils = _dereq_('../utils/Utils'); - -module.exports = ContactMaterial; - -/** - * Defines what happens when two materials meet. - * @class ContactMaterial - * @constructor - * @param {Material} m1 - * @param {Material} m2 - * @param {object} [options] - * @param {Number} [options.friction=0.3] - * @param {Number} [options.restitution=0.3] - * @param {number} [options.contactEquationStiffness=1e7] - * @param {number} [options.contactEquationRelaxation=3] - * @param {number} [options.frictionEquationStiffness=1e7] - * @param {Number} [options.frictionEquationRelaxation=3] - */ -function ContactMaterial(m1, m2, options){ - options = Utils.defaults(options, { - friction: 0.3, - restitution: 0.3, - contactEquationStiffness: 1e7, - contactEquationRelaxation: 3, - frictionEquationStiffness: 1e7, - frictionEquationRelaxation: 3 - }); - - /** - * Identifier of this material - * @property {Number} id - */ - this.id = ContactMaterial.idCounter++; - - /** - * Participating materials - * @property {Array} materials - * @todo Should be .materialA and .materialB instead - */ - this.materials = [m1, m2]; - - /** - * Friction coefficient - * @property {Number} friction - */ - this.friction = options.friction; - - /** - * Restitution coefficient - * @property {Number} restitution - */ - this.restitution = options.restitution; - - /** - * Stiffness of the produced contact equations - * @property {Number} contactEquationStiffness - */ - this.contactEquationStiffness = options.contactEquationStiffness; - - /** - * Relaxation time of the produced contact equations - * @property {Number} contactEquationRelaxation - */ - this.contactEquationRelaxation = options.contactEquationRelaxation; - - /** - * Stiffness of the produced friction equations - * @property {Number} frictionEquationStiffness - */ - this.frictionEquationStiffness = options.frictionEquationStiffness; - - /** - * Relaxation time of the produced friction equations - * @property {Number} frictionEquationRelaxation - */ - this.frictionEquationRelaxation = options.frictionEquationRelaxation; -} - -ContactMaterial.idCounter = 0; - -},{"../utils/Utils":53}],25:[function(_dereq_,module,exports){ -module.exports = Material; - -/** - * Defines a physics material. - * @class Material - * @constructor - * @param {object} [options] - * @author schteppe - */ -function Material(options){ - var name = ''; - options = options || {}; - - // Backwards compatibility fix - if(typeof(options) === 'string'){ - name = options; - options = {}; - } else if(typeof(options) === 'object') { - name = ''; - } - - /** - * @property name - * @type {String} - */ - this.name = name; - - /** - * material id. - * @property id - * @type {number} - */ - this.id = Material.idCounter++; - - /** - * Friction for this material. If non-negative, it will be used instead of the friction given by ContactMaterials. If there's no matching ContactMaterial, the value from .defaultContactMaterial in the World will be used. - * @property {number} friction - */ - this.friction = typeof(options.friction) !== 'undefined' ? options.friction : -1; - - /** - * Restitution for this material. If non-negative, it will be used instead of the restitution given by ContactMaterials. If there's no matching ContactMaterial, the value from .defaultContactMaterial in the World will be used. - * @property {number} restitution - */ - this.restitution = typeof(options.restitution) !== 'undefined' ? options.restitution : -1; -} - -Material.idCounter = 0; - -},{}],26:[function(_dereq_,module,exports){ -module.exports = JacobianElement; - -var Vec3 = _dereq_('./Vec3'); - -/** - * An element containing 6 entries, 3 spatial and 3 rotational degrees of freedom. - * @class JacobianElement - * @constructor - */ -function JacobianElement(){ - - /** - * @property {Vec3} spatial - */ - this.spatial = new Vec3(); - - /** - * @property {Vec3} rotational - */ - this.rotational = new Vec3(); -} - -/** - * Multiply with other JacobianElement - * @method multiplyElement - * @param {JacobianElement} element - * @return {Number} - */ -JacobianElement.prototype.multiplyElement = function(element){ - return element.spatial.dot(this.spatial) + element.rotational.dot(this.rotational); -}; - -/** - * Multiply with two vectors - * @method multiplyVectors - * @param {Vec3} spatial - * @param {Vec3} rotational - * @return {Number} - */ -JacobianElement.prototype.multiplyVectors = function(spatial,rotational){ - return spatial.dot(this.spatial) + rotational.dot(this.rotational); -}; - -},{"./Vec3":30}],27:[function(_dereq_,module,exports){ -module.exports = Mat3; - -var Vec3 = _dereq_('./Vec3'); - -/** - * A 3x3 matrix. - * @class Mat3 - * @constructor - * @param array elements Array of nine elements. Optional. - * @author schteppe / http://github.com/schteppe - */ -function Mat3(elements){ - /** - * A vector of length 9, containing all matrix elements - * @property {Array} elements - */ - if(elements){ - this.elements = elements; - } else { - this.elements = [0,0,0,0,0,0,0,0,0]; - } -} - -/** - * Sets the matrix to identity - * @method identity - * @todo Should perhaps be renamed to setIdentity() to be more clear. - * @todo Create another function that immediately creates an identity matrix eg. eye() - */ -Mat3.prototype.identity = function(){ - var e = this.elements; - e[0] = 1; - e[1] = 0; - e[2] = 0; - - e[3] = 0; - e[4] = 1; - e[5] = 0; - - e[6] = 0; - e[7] = 0; - e[8] = 1; -}; - -/** - * Set all elements to zero - * @method setZero - */ -Mat3.prototype.setZero = function(){ - var e = this.elements; - e[0] = 0; - e[1] = 0; - e[2] = 0; - e[3] = 0; - e[4] = 0; - e[5] = 0; - e[6] = 0; - e[7] = 0; - e[8] = 0; -}; - -/** - * Sets the matrix diagonal elements from a Vec3 - * @method setTrace - * @param {Vec3} vec3 - */ -Mat3.prototype.setTrace = function(vec3){ - var e = this.elements; - e[0] = vec3.x; - e[4] = vec3.y; - e[8] = vec3.z; -}; - -/** - * Gets the matrix diagonal elements - * @method getTrace - * @return {Vec3} - */ -Mat3.prototype.getTrace = function(target){ - var target = target || new Vec3(); - var e = this.elements; - target.x = e[0]; - target.y = e[4]; - target.z = e[8]; -}; - -/** - * Matrix-Vector multiplication - * @method vmult - * @param {Vec3} v The vector to multiply with - * @param {Vec3} target Optional, target to save the result in. - */ -Mat3.prototype.vmult = function(v,target){ - target = target || new Vec3(); - - var e = this.elements, - x = v.x, - y = v.y, - z = v.z; - target.x = e[0]*x + e[1]*y + e[2]*z; - target.y = e[3]*x + e[4]*y + e[5]*z; - target.z = e[6]*x + e[7]*y + e[8]*z; - - return target; -}; - -/** - * Matrix-scalar multiplication - * @method smult - * @param {Number} s - */ -Mat3.prototype.smult = function(s){ - for(var i=0; i1 acos and sqrt will produce errors, this cant happen if quaternion is normalised - var angle = 2 * Math.acos(this.w); - var s = Math.sqrt(1-this.w*this.w); // assuming quaternion normalised then w is less than 1, so term always positive. - if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt - // if s close to zero then direction of axis not important - targetAxis.x = this.x; // if it is important that axis is normalised then replace with x=1; y=z=0; - targetAxis.y = this.y; - targetAxis.z = this.z; - } else { - targetAxis.x = this.x / s; // normalise axis - targetAxis.y = this.y / s; - targetAxis.z = this.z / s; - } - return [targetAxis,angle]; -}; - -var sfv_t1 = new Vec3(), - sfv_t2 = new Vec3(); - -/** - * Set the quaternion value given two vectors. The resulting rotation will be the needed rotation to rotate u to v. - * @method setFromVectors - * @param {Vec3} u - * @param {Vec3} v - */ -Quaternion.prototype.setFromVectors = function(u,v){ - if(u.isAntiparallelTo(v)){ - var t1 = sfv_t1; - var t2 = sfv_t2; - - u.tangents(t1,t2); - this.setFromAxisAngle(t1,Math.PI); - } else { - var a = u.cross(v); - this.x = a.x; - this.y = a.y; - this.z = a.z; - this.w = Math.sqrt(Math.pow(u.norm(),2) * Math.pow(v.norm(),2)) + u.dot(v); - this.normalize(); - } -}; - -/** - * Quaternion multiplication - * @method mult - * @param {Quaternion} q - * @param {Quaternion} target Optional. - * @return {Quaternion} - */ -var Quaternion_mult_va = new Vec3(); -var Quaternion_mult_vb = new Vec3(); -var Quaternion_mult_vaxvb = new Vec3(); -Quaternion.prototype.mult = function(q,target){ - target = target || new Quaternion(); - var w = this.w, - va = Quaternion_mult_va, - vb = Quaternion_mult_vb, - vaxvb = Quaternion_mult_vaxvb; - - va.set(this.x,this.y,this.z); - vb.set(q.x,q.y,q.z); - target.w = w*q.w - va.dot(vb); - va.cross(vb,vaxvb); - - target.x = w * vb.x + q.w*va.x + vaxvb.x; - target.y = w * vb.y + q.w*va.y + vaxvb.y; - target.z = w * vb.z + q.w*va.z + vaxvb.z; - - return target; -}; - -/** - * Get the inverse quaternion rotation. - * @method inverse - * @param {Quaternion} target - * @return {Quaternion} - */ -Quaternion.prototype.inverse = function(target){ - var x = this.x, y = this.y, z = this.z, w = this.w; - target = target || new Quaternion(); - - this.conjugate(target); - var inorm2 = 1/(x*x + y*y + z*z + w*w); - target.x *= inorm2; - target.y *= inorm2; - target.z *= inorm2; - target.w *= inorm2; - - return target; -}; - -/** - * Get the quaternion conjugate - * @method conjugate - * @param {Quaternion} target - * @return {Quaternion} - */ -Quaternion.prototype.conjugate = function(target){ - target = target || new Quaternion(); - - target.x = -this.x; - target.y = -this.y; - target.z = -this.z; - target.w = this.w; - - return target; -}; - -/** - * Normalize the quaternion. Note that this changes the values of the quaternion. - * @method normalize - */ -Quaternion.prototype.normalize = function(){ - var l = Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w); - if ( l === 0 ) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - } else { - l = 1 / l; - this.x *= l; - this.y *= l; - this.z *= l; - this.w *= l; - } -}; - -/** - * Approximation of quaternion normalization. Works best when quat is already almost-normalized. - * @method normalizeFast - * @see http://jsperf.com/fast-quaternion-normalization - * @author unphased, https://github.com/unphased - */ -Quaternion.prototype.normalizeFast = function () { - var f = (3.0-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2.0; - if ( f === 0 ) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - } else { - this.x *= f; - this.y *= f; - this.z *= f; - this.w *= f; - } -}; - -/** - * Multiply the quaternion by a vector - * @method vmult - * @param {Vec3} v - * @param {Vec3} target Optional - * @return {Vec3} - */ -Quaternion.prototype.vmult = function(v,target){ - target = target || new Vec3(); - - var x = v.x, - y = v.y, - z = v.z; - - var qx = this.x, - qy = this.y, - qz = this.z, - qw = this.w; - - // q*v - var ix = qw * x + qy * z - qz * y, - iy = qw * y + qz * x - qx * z, - iz = qw * z + qx * y - qy * x, - iw = -qx * x - qy * y - qz * z; - - target.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - target.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - target.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return target; -}; - -/** - * Copies value of source to this quaternion. - * @method copy - * @param {Quaternion} source - * @return {Quaternion} this - */ -Quaternion.prototype.copy = function(source){ - this.x = source.x; - this.y = source.y; - this.z = source.z; - this.w = source.w; - return this; -}; - -/** - * Convert the quaternion to euler angle representation. Order: YZX, as this page describes: http://www.euclideanspace.com/maths/standards/index.htm - * @method toEuler - * @param {Vec3} target - * @param string order Three-character string e.g. "YZX", which also is default. - */ -Quaternion.prototype.toEuler = function(target,order){ - order = order || "YZX"; - - var heading, attitude, bank; - var x = this.x, y = this.y, z = this.z, w = this.w; - - switch(order){ - case "YZX": - var test = x*y + z*w; - if (test > 0.499) { // singularity at north pole - heading = 2 * Math.atan2(x,w); - attitude = Math.PI/2; - bank = 0; - } - if (test < -0.499) { // singularity at south pole - heading = -2 * Math.atan2(x,w); - attitude = - Math.PI/2; - bank = 0; - } - if(isNaN(heading)){ - var sqx = x*x; - var sqy = y*y; - var sqz = z*z; - heading = Math.atan2(2*y*w - 2*x*z , 1 - 2*sqy - 2*sqz); // Heading - attitude = Math.asin(2*test); // attitude - bank = Math.atan2(2*x*w - 2*y*z , 1 - 2*sqx - 2*sqz); // bank - } - break; - default: - throw new Error("Euler order "+order+" not supported yet."); - } - - target.y = heading; - target.z = attitude; - target.x = bank; -}; - -/** - * See http://www.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/content/SpinCalc.m - * @method setFromEuler - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @param {String} order The order to apply angles: 'XYZ' or 'YXZ' or any other combination - */ -Quaternion.prototype.setFromEuler = function ( x, y, z, order ) { - order = order || "XYZ"; - - var c1 = Math.cos( x / 2 ); - var c2 = Math.cos( y / 2 ); - var c3 = Math.cos( z / 2 ); - var s1 = Math.sin( x / 2 ); - var s2 = Math.sin( y / 2 ); - var s3 = Math.sin( z / 2 ); - - if ( order === 'XYZ' ) { - - this.x = s1 * c2 * c3 + c1 * s2 * s3; - this.y = c1 * s2 * c3 - s1 * c2 * s3; - this.z = c1 * c2 * s3 + s1 * s2 * c3; - this.w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'YXZ' ) { - - this.x = s1 * c2 * c3 + c1 * s2 * s3; - this.y = c1 * s2 * c3 - s1 * c2 * s3; - this.z = c1 * c2 * s3 - s1 * s2 * c3; - this.w = c1 * c2 * c3 + s1 * s2 * s3; - - } else if ( order === 'ZXY' ) { - - this.x = s1 * c2 * c3 - c1 * s2 * s3; - this.y = c1 * s2 * c3 + s1 * c2 * s3; - this.z = c1 * c2 * s3 + s1 * s2 * c3; - this.w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'ZYX' ) { - - this.x = s1 * c2 * c3 - c1 * s2 * s3; - this.y = c1 * s2 * c3 + s1 * c2 * s3; - this.z = c1 * c2 * s3 - s1 * s2 * c3; - this.w = c1 * c2 * c3 + s1 * s2 * s3; - - } else if ( order === 'YZX' ) { - - this.x = s1 * c2 * c3 + c1 * s2 * s3; - this.y = c1 * s2 * c3 + s1 * c2 * s3; - this.z = c1 * c2 * s3 - s1 * s2 * c3; - this.w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'XZY' ) { - - this.x = s1 * c2 * c3 - c1 * s2 * s3; - this.y = c1 * s2 * c3 - s1 * c2 * s3; - this.z = c1 * c2 * s3 + s1 * s2 * c3; - this.w = c1 * c2 * c3 + s1 * s2 * s3; - - } - - return this; - -}; - -Quaternion.prototype.clone = function(){ - return new Quaternion(this.x, this.y, this.z, this.w); -}; -},{"./Vec3":30}],29:[function(_dereq_,module,exports){ -var Vec3 = _dereq_('./Vec3'); -var Quaternion = _dereq_('./Quaternion'); - -module.exports = Transform; - -/** - * @class Transform - * @constructor - */ -function Transform(options) { - options = options || {}; - - /** - * @property {Vec3} position - */ - this.position = new Vec3(); - if(options.position){ - this.position.copy(options.position); - } - - /** - * @property {Quaternion} quaternion - */ - this.quaternion = new Quaternion(); - if(options.quaternion){ - this.quaternion.copy(options.quaternion); - } -} - -var tmpQuat = new Quaternion(); - -/** - * @static - * @method pointToLocaFrame - * @param {Vec3} position - * @param {Quaternion} quaternion - * @param {Vec3} worldPoint - * @param {Vec3} result - */ -Transform.pointToLocalFrame = function(position, quaternion, worldPoint, result){ - var result = result || new Vec3(); - worldPoint.vsub(position, result); - quaternion.conjugate(tmpQuat); - tmpQuat.vmult(result, result); - return result; -}; - -/** - * Get a global point in local transform coordinates. - * @method pointToLocal - * @param {Vec3} point - * @param {Vec3} result - * @return {Vec3} The "result" vector object - */ -Transform.prototype.pointToLocal = function(worldPoint, result){ - return Transform.pointToLocalFrame(this.position, this.quaternion, worldPoint, result); -}; - -/** - * @static - * @method pointToWorldFrame - * @param {Vec3} position - * @param {Vec3} quaternion - * @param {Vec3} localPoint - * @param {Vec3} result - */ -Transform.pointToWorldFrame = function(position, quaternion, localPoint, result){ - var result = result || new Vec3(); - quaternion.vmult(localPoint, result); - result.vadd(position, result); - return result; -}; - -/** - * Get a local point in global transform coordinates. - * @method pointToWorld - * @param {Vec3} point - * @param {Vec3} result - * @return {Vec3} The "result" vector object - */ -Transform.prototype.pointToWorld = function(localPoint, result){ - return Transform.pointToWorldFrame(this.position, this.quaternion, localPoint, result); -}; - - -Transform.prototype.vectorToWorldFrame = function(localVector, result){ - var result = result || new Vec3(); - this.quaternion.vmult(localVector, result); - return result; -}; - -Transform.vectorToWorldFrame = function(quaternion, localVector, result){ - quaternion.vmult(localVector, result); - return result; -}; - -Transform.vectorToLocalFrame = function(position, quaternion, worldVector, result){ - var result = result || new Vec3(); - quaternion.w *= -1; - quaternion.vmult(worldVector, result); - quaternion.w *= -1; - return result; -}; - -},{"./Quaternion":28,"./Vec3":30}],30:[function(_dereq_,module,exports){ -module.exports = Vec3; - -var Mat3 = _dereq_('./Mat3'); - -/** - * 3-dimensional vector - * @class Vec3 - * @constructor - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @author schteppe - * @example - * var v = new Vec3(1, 2, 3); - * console.log('x=' + v.x); // x=1 - */ -function Vec3(x,y,z){ - /** - * @property x - * @type {Number} - */ - this.x = x||0.0; - - /** - * @property y - * @type {Number} - */ - this.y = y||0.0; - - /** - * @property z - * @type {Number} - */ - this.z = z||0.0; -} - -/** - * @static - * @property {Vec3} ZERO - */ -Vec3.ZERO = new Vec3(0, 0, 0); - -/** - * @static - * @property {Vec3} UNIT_X - */ -Vec3.UNIT_X = new Vec3(1, 0, 0); - -/** - * @static - * @property {Vec3} UNIT_Y - */ -Vec3.UNIT_Y = new Vec3(0, 1, 0); - -/** - * @static - * @property {Vec3} UNIT_Z - */ -Vec3.UNIT_Z = new Vec3(0, 0, 1); - -/** - * Vector cross product - * @method cross - * @param {Vec3} v - * @param {Vec3} target Optional. Target to save in. - * @return {Vec3} - */ -Vec3.prototype.cross = function(v,target){ - var vx=v.x, vy=v.y, vz=v.z, x=this.x, y=this.y, z=this.z; - target = target || new Vec3(); - - target.x = (y * vz) - (z * vy); - target.y = (z * vx) - (x * vz); - target.z = (x * vy) - (y * vx); - - return target; -}; - -/** - * Set the vectors' 3 elements - * @method set - * @param {Number} x - * @param {Number} y - * @param {Number} z - * @return Vec3 - */ -Vec3.prototype.set = function(x,y,z){ - this.x = x; - this.y = y; - this.z = z; - return this; -}; - -/** - * Set all components of the vector to zero. - * @method setZero - */ -Vec3.prototype.setZero = function(){ - this.x = this.y = this.z = 0; -}; - -/** - * Vector addition - * @method vadd - * @param {Vec3} v - * @param {Vec3} target Optional. - * @return {Vec3} - */ -Vec3.prototype.vadd = function(v,target){ - if(target){ - target.x = v.x + this.x; - target.y = v.y + this.y; - target.z = v.z + this.z; - } else { - return new Vec3(this.x + v.x, - this.y + v.y, - this.z + v.z); - } -}; - -/** - * Vector subtraction - * @method vsub - * @param {Vec3} v - * @param {Vec3} target Optional. Target to save in. - * @return {Vec3} - */ -Vec3.prototype.vsub = function(v,target){ - if(target){ - target.x = this.x - v.x; - target.y = this.y - v.y; - target.z = this.z - v.z; - } else { - return new Vec3(this.x-v.x, - this.y-v.y, - this.z-v.z); - } -}; - -/** - * Get the cross product matrix a_cross from a vector, such that a x b = a_cross * b = c - * @method crossmat - * @see http://www8.cs.umu.se/kurser/TDBD24/VT06/lectures/Lecture6.pdf - * @return {Mat3} - */ -Vec3.prototype.crossmat = function(){ - return new Mat3([ 0, -this.z, this.y, - this.z, 0, -this.x, - -this.y, this.x, 0]); -}; - -/** - * Normalize the vector. Note that this changes the values in the vector. - * @method normalize - * @return {Number} Returns the norm of the vector - */ -Vec3.prototype.normalize = function(){ - var x=this.x, y=this.y, z=this.z; - var n = Math.sqrt(x*x + y*y + z*z); - if(n>0.0){ - var invN = 1/n; - this.x *= invN; - this.y *= invN; - this.z *= invN; - } else { - // Make something up - this.x = 0; - this.y = 0; - this.z = 0; - } - return n; -}; - -/** - * Get the version of this vector that is of length 1. - * @method unit - * @param {Vec3} target Optional target to save in - * @return {Vec3} Returns the unit vector - */ -Vec3.prototype.unit = function(target){ - target = target || new Vec3(); - var x=this.x, y=this.y, z=this.z; - var ninv = Math.sqrt(x*x + y*y + z*z); - if(ninv>0.0){ - ninv = 1.0/ninv; - target.x = x * ninv; - target.y = y * ninv; - target.z = z * ninv; - } else { - target.x = 1; - target.y = 0; - target.z = 0; - } - return target; -}; - -/** - * Get the length of the vector - * @method norm - * @return {Number} - * @deprecated Use .length() instead - */ -Vec3.prototype.norm = function(){ - var x=this.x, y=this.y, z=this.z; - return Math.sqrt(x*x + y*y + z*z); -}; - -/** - * Get the length of the vector - * @method length - * @return {Number} - */ -Vec3.prototype.length = Vec3.prototype.norm; - -/** - * Get the squared length of the vector - * @method norm2 - * @return {Number} - * @deprecated Use .lengthSquared() instead. - */ -Vec3.prototype.norm2 = function(){ - return this.dot(this); -}; - -/** - * Get the squared length of the vector. - * @method lengthSquared - * @return {Number} - */ -Vec3.prototype.lengthSquared = Vec3.prototype.norm2; - -/** - * Get distance from this point to another point - * @method distanceTo - * @param {Vec3} p - * @return {Number} - */ -Vec3.prototype.distanceTo = function(p){ - var x=this.x, y=this.y, z=this.z; - var px=p.x, py=p.y, pz=p.z; - return Math.sqrt((px-x)*(px-x)+ - (py-y)*(py-y)+ - (pz-z)*(pz-z)); -}; - -/** - * Get squared distance from this point to another point - * @method distanceSquared - * @param {Vec3} p - * @return {Number} - */ -Vec3.prototype.distanceSquared = function(p){ - var x=this.x, y=this.y, z=this.z; - var px=p.x, py=p.y, pz=p.z; - return (px-x)*(px-x) + (py-y)*(py-y) + (pz-z)*(pz-z); -}; - -/** - * Multiply all the components of the vector with a scalar. - * @deprecated Use .scale instead - * @method mult - * @param {Number} scalar - * @param {Vec3} target The vector to save the result in. - * @return {Vec3} - * @deprecated Use .scale() instead - */ -Vec3.prototype.mult = function(scalar,target){ - target = target || new Vec3(); - var x = this.x, - y = this.y, - z = this.z; - target.x = scalar * x; - target.y = scalar * y; - target.z = scalar * z; - return target; -}; - -/** - * Multiply the vector with a scalar. - * @method scale - * @param {Number} scalar - * @param {Vec3} target - * @return {Vec3} - */ -Vec3.prototype.scale = Vec3.prototype.mult; - -/** - * Calculate dot product - * @method dot - * @param {Vec3} v - * @return {Number} - */ -Vec3.prototype.dot = function(v){ - return this.x * v.x + this.y * v.y + this.z * v.z; -}; - -/** - * @method isZero - * @return bool - */ -Vec3.prototype.isZero = function(){ - return this.x===0 && this.y===0 && this.z===0; -}; - -/** - * Make the vector point in the opposite direction. - * @method negate - * @param {Vec3} target Optional target to save in - * @return {Vec3} - */ -Vec3.prototype.negate = function(target){ - target = target || new Vec3(); - target.x = -this.x; - target.y = -this.y; - target.z = -this.z; - return target; -}; - -/** - * Compute two artificial tangents to the vector - * @method tangents - * @param {Vec3} t1 Vector object to save the first tangent in - * @param {Vec3} t2 Vector object to save the second tangent in - */ -var Vec3_tangents_n = new Vec3(); -var Vec3_tangents_randVec = new Vec3(); -Vec3.prototype.tangents = function(t1,t2){ - var norm = this.norm(); - if(norm>0.0){ - var n = Vec3_tangents_n; - var inorm = 1/norm; - n.set(this.x*inorm,this.y*inorm,this.z*inorm); - var randVec = Vec3_tangents_randVec; - if(Math.abs(n.x) < 0.9){ - randVec.set(1,0,0); - n.cross(randVec,t1); - } else { - randVec.set(0,1,0); - n.cross(randVec,t1); - } - n.cross(t1,t2); - } else { - // The normal length is zero, make something up - t1.set(1, 0, 0); - t2.set(0, 1, 0); - } -}; - -/** - * Converts to a more readable format - * @method toString - * @return string - */ -Vec3.prototype.toString = function(){ - return this.x+","+this.y+","+this.z; -}; - -/** - * Converts to an array - * @method toArray - * @return Array - */ -Vec3.prototype.toArray = function(){ - return [this.x, this.y, this.z]; -}; - -/** - * Copies value of source to this vector. - * @method copy - * @param {Vec3} source - * @return {Vec3} this - */ -Vec3.prototype.copy = function(source){ - this.x = source.x; - this.y = source.y; - this.z = source.z; - return this; -}; - - -/** - * Do a linear interpolation between two vectors - * @method lerp - * @param {Vec3} v - * @param {Number} t A number between 0 and 1. 0 will make this function return u, and 1 will make it return v. Numbers in between will generate a vector in between them. - * @param {Vec3} target - */ -Vec3.prototype.lerp = function(v,t,target){ - var x=this.x, y=this.y, z=this.z; - target.x = x + (v.x-x)*t; - target.y = y + (v.y-y)*t; - target.z = z + (v.z-z)*t; -}; - -/** - * Check if a vector equals is almost equal to another one. - * @method almostEquals - * @param {Vec3} v - * @param {Number} precision - * @return bool - */ -Vec3.prototype.almostEquals = function(v,precision){ - if(precision===undefined){ - precision = 1e-6; - } - if( Math.abs(this.x-v.x)>precision || - Math.abs(this.y-v.y)>precision || - Math.abs(this.z-v.z)>precision){ - return false; - } - return true; -}; - -/** - * Check if a vector is almost zero - * @method almostZero - * @param {Number} precision - */ -Vec3.prototype.almostZero = function(precision){ - if(precision===undefined){ - precision = 1e-6; - } - if( Math.abs(this.x)>precision || - Math.abs(this.y)>precision || - Math.abs(this.z)>precision){ - return false; - } - return true; -}; - -var antip_neg = new Vec3(); - -/** - * Check if the vector is anti-parallel to another vector. - * @method isAntiparallelTo - * @param {Vec3} v - * @param {Number} precision Set to zero for exact comparisons - * @return {Boolean} - */ -Vec3.prototype.isAntiparallelTo = function(v,precision){ - this.negate(antip_neg); - return antip_neg.almostEquals(v,precision); -}; - -/** - * Clone the vector - * @method clone - * @return {Vec3} - */ -Vec3.prototype.clone = function(){ - return new Vec3(this.x, this.y, this.z); -}; -},{"./Mat3":27}],31:[function(_dereq_,module,exports){ -module.exports = Body; - -var EventTarget = _dereq_('../utils/EventTarget'); -var Shape = _dereq_('../shapes/Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Mat3 = _dereq_('../math/Mat3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Material = _dereq_('../material/Material'); -var AABB = _dereq_('../collision/AABB'); -var Box = _dereq_('../shapes/Box'); - -/** - * Base class for all body types. - * @class Body - * @constructor - * @extends EventTarget - * @param {object} [options] - * @param {Vec3} [options.position] - * @param {Vec3} [options.velocity] - * @param {Vec3} [options.angularVelocity] - * @param {Quaternion} [options.quaternion] - * @param {number} [options.mass] - * @param {Material} [options.material] - * @param {number} [options.type] - * @param {number} [options.linearDamping=0.01] - * @param {number} [options.angularDamping=0.01] - * @param {boolean} [options.allowSleep=true] - * @param {number} [options.sleepSpeedLimit=0.1] - * @param {number} [options.sleepTimeLimit=1] - * @param {number} [options.collisionFilterGroup=1] - * @param {number} [options.collisionFilterMask=1] - * @param {boolean} [options.fixedRotation=false] - * @param {Body} [options.shape] - * @example - * var body = new Body({ - * mass: 1 - * }); - * var shape = new Sphere(1); - * body.addShape(shape); - * world.add(body); - */ -function Body(options){ - options = options || {}; - - EventTarget.apply(this); - - this.id = Body.idCounter++; - - /** - * Reference to the world the body is living in - * @property world - * @type {World} - */ - this.world = null; - - /** - * Callback function that is used BEFORE stepping the system. Use it to apply forces, for example. Inside the function, "this" will refer to this Body object. - * @property preStep - * @type {Function} - * @deprecated Use World events instead - */ - this.preStep = null; - - /** - * Callback function that is used AFTER stepping the system. Inside the function, "this" will refer to this Body object. - * @property postStep - * @type {Function} - * @deprecated Use World events instead - */ - this.postStep = null; - - this.vlambda = new Vec3(); - - /** - * @property {Number} collisionFilterGroup - */ - this.collisionFilterGroup = typeof(options.collisionFilterGroup) === 'number' ? options.collisionFilterGroup : 1; - - /** - * @property {Number} collisionFilterMask - */ - this.collisionFilterMask = typeof(options.collisionFilterMask) === 'number' ? options.collisionFilterMask : 1; - - /** - * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. - * @property {Number} collisionResponse - */ - this.collisionResponse = true; - - /** - * @property position - * @type {Vec3} - */ - this.position = new Vec3(); - - if(options.position){ - this.position.copy(options.position); - } - - /** - * @property {Vec3} previousPosition - */ - this.previousPosition = new Vec3(); - - /** - * Initial position of the body - * @property initPosition - * @type {Vec3} - */ - this.initPosition = new Vec3(); - - /** - * @property velocity - * @type {Vec3} - */ - this.velocity = new Vec3(); - - if(options.velocity){ - this.velocity.copy(options.velocity); - } - - /** - * @property initVelocity - * @type {Vec3} - */ - this.initVelocity = new Vec3(); - - /** - * Linear force on the body - * @property force - * @type {Vec3} - */ - this.force = new Vec3(); - - var mass = typeof(options.mass) === 'number' ? options.mass : 0; - - /** - * @property mass - * @type {Number} - * @default 0 - */ - this.mass = mass; - - /** - * @property invMass - * @type {Number} - */ - this.invMass = mass > 0 ? 1.0 / mass : 0; - - /** - * @property material - * @type {Material} - */ - this.material = options.material || null; - - /** - * @property linearDamping - * @type {Number} - */ - this.linearDamping = typeof(options.linearDamping) === 'number' ? options.linearDamping : 0.01; - - /** - * One of: Body.DYNAMIC, Body.STATIC and Body.KINEMATIC. - * @property type - * @type {Number} - */ - this.type = (mass <= 0.0 ? Body.STATIC : Body.DYNAMIC); - if(typeof(options.type) === typeof(Body.STATIC)){ - this.type = options.type; - } - - /** - * If true, the body will automatically fall to sleep. - * @property allowSleep - * @type {Boolean} - * @default true - */ - this.allowSleep = typeof(options.allowSleep) !== 'undefined' ? options.allowSleep : true; - - /** - * Current sleep state. - * @property sleepState - * @type {Number} - */ - this.sleepState = 0; - - /** - * If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy. - * @property sleepSpeedLimit - * @type {Number} - * @default 0.1 - */ - this.sleepSpeedLimit = typeof(options.sleepSpeedLimit) !== 'undefined' ? options.sleepSpeedLimit : 0.1; - - /** - * If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping. - * @property sleepTimeLimit - * @type {Number} - * @default 1 - */ - this.sleepTimeLimit = typeof(options.sleepTimeLimit) !== 'undefined' ? options.sleepTimeLimit : 1; - - this.timeLastSleepy = 0; - - this._wakeUpAfterNarrowphase = false; - - - /** - * Rotational force on the body, around center of mass - * @property {Vec3} torque - */ - this.torque = new Vec3(); - - /** - * Orientation of the body - * @property quaternion - * @type {Quaternion} - */ - this.quaternion = new Quaternion(); - - if(options.quaternion){ - this.quaternion.copy(options.quaternion); - } - - /** - * @property initQuaternion - * @type {Quaternion} - */ - this.initQuaternion = new Quaternion(); - - /** - * @property angularVelocity - * @type {Vec3} - */ - this.angularVelocity = new Vec3(); - - if(options.angularVelocity){ - this.angularVelocity.copy(options.angularVelocity); - } - - /** - * @property initAngularVelocity - * @type {Vec3} - */ - this.initAngularVelocity = new Vec3(); - - this.interpolatedPosition = new Vec3(); - this.interpolatedQuaternion = new Quaternion(); - - /** - * @property shapes - * @type {array} - */ - this.shapes = []; - - /** - * @property shapeOffsets - * @type {array} - */ - this.shapeOffsets = []; - - /** - * @property shapeOrientations - * @type {array} - */ - this.shapeOrientations = []; - - /** - * @property inertia - * @type {Vec3} - */ - this.inertia = new Vec3(); - - /** - * @property {Vec3} invInertia - */ - this.invInertia = new Vec3(); - - /** - * @property {Mat3} invInertiaWorld - */ - this.invInertiaWorld = new Mat3(); - - this.invMassSolve = 0; - - /** - * @property {Vec3} invInertiaSolve - */ - this.invInertiaSolve = new Vec3(); - - /** - * @property {Mat3} invInertiaWorldSolve - */ - this.invInertiaWorldSolve = new Mat3(); - - /** - * Set to true if you don't want the body to rotate. Make sure to run .updateMassProperties() after changing this. - * @property {Boolean} fixedRotation - * @default false - */ - this.fixedRotation = typeof(options.fixedRotation) !== "undefined" ? options.fixedRotation : false; - - /** - * @property {Number} angularDamping - */ - this.angularDamping = typeof(options.angularDamping) !== 'undefined' ? options.angularDamping : 0.01; - - /** - * @property aabb - * @type {AABB} - */ - this.aabb = new AABB(); - - /** - * Indicates if the AABB needs to be updated before use. - * @property aabbNeedsUpdate - * @type {Boolean} - */ - this.aabbNeedsUpdate = true; - - this.wlambda = new Vec3(); - - if(options.shape){ - this.addShape(options.shape); - } - - this.updateMassProperties(); -} -Body.prototype = new EventTarget(); -Body.prototype.constructor = Body; - -/** - * A dynamic body is fully simulated. Can be moved manually by the user, but normally they move according to forces. A dynamic body can collide with all body types. A dynamic body always has finite, non-zero mass. - * @static - * @property DYNAMIC - * @type {Number} - */ -Body.DYNAMIC = 1; - -/** - * A static body does not move during simulation and behaves as if it has infinite mass. Static bodies can be moved manually by setting the position of the body. The velocity of a static body is always zero. Static bodies do not collide with other static or kinematic bodies. - * @static - * @property STATIC - * @type {Number} - */ -Body.STATIC = 2; - -/** - * A kinematic body moves under simulation according to its velocity. They do not respond to forces. They can be moved manually, but normally a kinematic body is moved by setting its velocity. A kinematic body behaves as if it has infinite mass. Kinematic bodies do not collide with other static or kinematic bodies. - * @static - * @property KINEMATIC - * @type {Number} - */ -Body.KINEMATIC = 4; - - - -/** - * @static - * @property AWAKE - * @type {number} - */ -Body.AWAKE = 0; - -/** - * @static - * @property SLEEPY - * @type {number} - */ -Body.SLEEPY = 1; - -/** - * @static - * @property SLEEPING - * @type {number} - */ -Body.SLEEPING = 2; - -Body.idCounter = 0; - -/** - * Wake the body up. - * @method wakeUp - */ -Body.prototype.wakeUp = function(){ - var s = this.sleepState; - this.sleepState = 0; - if(s === Body.SLEEPING){ - this.dispatchEvent({type:"wakeup"}); - } -}; - -/** - * Force body sleep - * @method sleep - */ -Body.prototype.sleep = function(){ - this.sleepState = Body.SLEEPING; - this.velocity.set(0,0,0); - this.angularVelocity.set(0,0,0); -}; - -Body.sleepyEvent = { - type: "sleepy" -}; - -Body.sleepEvent = { - type: "sleep" -}; - -/** - * Called every timestep to update internal sleep timer and change sleep state if needed. - * @method sleepTick - * @param {Number} time The world time in seconds - */ -Body.prototype.sleepTick = function(time){ - if(this.allowSleep){ - var sleepState = this.sleepState; - var speedSquared = this.velocity.norm2() + this.angularVelocity.norm2(); - var speedLimitSquared = Math.pow(this.sleepSpeedLimit,2); - if(sleepState===Body.AWAKE && speedSquared < speedLimitSquared){ - this.sleepState = Body.SLEEPY; // Sleepy - this.timeLastSleepy = time; - this.dispatchEvent(Body.sleepyEvent); - } else if(sleepState===Body.SLEEPY && speedSquared > speedLimitSquared){ - this.wakeUp(); // Wake up - } else if(sleepState===Body.SLEEPY && (time - this.timeLastSleepy ) > this.sleepTimeLimit){ - this.sleep(); // Sleeping - this.dispatchEvent(Body.sleepEvent); - } - } -}; - -/** - * If the body is sleeping, it should be immovable / have infinite mass during solve. We solve it by having a separate "solve mass". - * @method updateSolveMassProperties - */ -Body.prototype.updateSolveMassProperties = function(){ - if(this.sleepState === Body.SLEEPING || this.type === Body.KINEMATIC){ - this.invMassSolve = 0; - this.invInertiaSolve.setZero(); - this.invInertiaWorldSolve.setZero(); - } else { - this.invMassSolve = this.invMass; - this.invInertiaSolve.copy(this.invInertia); - this.invInertiaWorldSolve.copy(this.invInertiaWorld); - } -}; - -/** - * Convert a world point to local body frame. - * @method pointToLocalFrame - * @param {Vec3} worldPoint - * @param {Vec3} result - * @return {Vec3} - */ -Body.prototype.pointToLocalFrame = function(worldPoint,result){ - var result = result || new Vec3(); - worldPoint.vsub(this.position,result); - this.quaternion.conjugate().vmult(result,result); - return result; -}; - -/** - * Convert a world vector to local body frame. - * @method vectorToLocalFrame - * @param {Vec3} worldPoint - * @param {Vec3} result - * @return {Vec3} - */ -Body.prototype.vectorToLocalFrame = function(worldVector, result){ - var result = result || new Vec3(); - this.quaternion.conjugate().vmult(worldVector,result); - return result; -}; - -/** - * Convert a local body point to world frame. - * @method pointToWorldFrame - * @param {Vec3} localPoint - * @param {Vec3} result - * @return {Vec3} - */ -Body.prototype.pointToWorldFrame = function(localPoint,result){ - var result = result || new Vec3(); - this.quaternion.vmult(localPoint,result); - result.vadd(this.position,result); - return result; -}; - -/** - * Convert a local body point to world frame. - * @method vectorToWorldFrame - * @param {Vec3} localVector - * @param {Vec3} result - * @return {Vec3} - */ -Body.prototype.vectorToWorldFrame = function(localVector, result){ - var result = result || new Vec3(); - this.quaternion.vmult(localVector, result); - return result; -}; - -var tmpVec = new Vec3(); -var tmpQuat = new Quaternion(); - -/** - * Add a shape to the body with a local offset and orientation. - * @method addShape - * @param {Shape} shape - * @param {Vec3} offset - * @param {Quaternion} quaternion - * @return {Body} The body object, for chainability. - */ -Body.prototype.addShape = function(shape, _offset, _orientation){ - var offset = new Vec3(); - var orientation = new Quaternion(); - - if(_offset){ - offset.copy(_offset); - } - if(_orientation){ - orientation.copy(_orientation); - } - - this.shapes.push(shape); - this.shapeOffsets.push(offset); - this.shapeOrientations.push(orientation); - this.updateMassProperties(); - this.updateBoundingRadius(); - - this.aabbNeedsUpdate = true; - - return this; -}; - -/** - * Update the bounding radius of the body. Should be done if any of the shapes are changed. - * @method updateBoundingRadius - */ -Body.prototype.updateBoundingRadius = function(){ - var shapes = this.shapes, - shapeOffsets = this.shapeOffsets, - N = shapes.length, - radius = 0; - - for(var i=0; i!==N; i++){ - var shape = shapes[i]; - shape.updateBoundingSphereRadius(); - var offset = shapeOffsets[i].norm(), - r = shape.boundingSphereRadius; - if(offset + r > radius){ - radius = offset + r; - } - } - - this.boundingRadius = radius; -}; - -var computeAABB_shapeAABB = new AABB(); - -/** - * Updates the .aabb - * @method computeAABB - * @todo rename to updateAABB() - */ -Body.prototype.computeAABB = function(){ - var shapes = this.shapes, - shapeOffsets = this.shapeOffsets, - shapeOrientations = this.shapeOrientations, - N = shapes.length, - offset = tmpVec, - orientation = tmpQuat, - bodyQuat = this.quaternion, - aabb = this.aabb, - shapeAABB = computeAABB_shapeAABB; - - for(var i=0; i!==N; i++){ - var shape = shapes[i]; - - // Get shape world quaternion - shapeOrientations[i].mult(bodyQuat, orientation); - - // Get shape world position - orientation.vmult(shapeOffsets[i], offset); - offset.vadd(this.position, offset); - - // vec2.rotate(offset, shapeOffsets[i], bodyAngle); - // vec2.add(offset, offset, this.position); - - // Get shape AABB - shape.calculateWorldAABB(offset, orientation, shapeAABB.lowerBound, shapeAABB.upperBound); - - if(i === 0){ - aabb.copy(shapeAABB); - } else { - aabb.extend(shapeAABB); - } - } - - this.aabbNeedsUpdate = false; -}; - -var uiw_m1 = new Mat3(), - uiw_m2 = new Mat3(), - uiw_m3 = new Mat3(); - -/** - * Update .inertiaWorld and .invInertiaWorld - * @method updateInertiaWorld - */ -Body.prototype.updateInertiaWorld = function(force){ - var I = this.invInertia; - if (I.x === I.y && I.y === I.z && !force) { - // If inertia M = s*I, where I is identity and s a scalar, then - // R*M*R' = R*(s*I)*R' = s*R*I*R' = s*R*R' = s*I = M - // where R is the rotation matrix. - // In other words, we don't have to transform the inertia if all - // inertia diagonal entries are equal. - } else { - var m1 = uiw_m1, - m2 = uiw_m2, - m3 = uiw_m3; - m1.setRotationFromQuaternion(this.quaternion); - m1.transpose(m2); - m1.scale(I,m1); - m1.mmult(m2,this.invInertiaWorld); - //m3.getTrace(this.invInertiaWorld); - } - - /* - this.quaternion.vmult(this.inertia,this.inertiaWorld); - this.quaternion.vmult(this.invInertia,this.invInertiaWorld); - */ -}; - -/** - * Apply force to a world point. This could for example be a point on the Body surface. Applying force this way will add to Body.force and Body.torque. - * @method applyForce - * @param {Vec3} force The amount of force to add. - * @param {Vec3} worldPoint A world point to apply the force on. - */ -var Body_applyForce_r = new Vec3(); -var Body_applyForce_rotForce = new Vec3(); -Body.prototype.applyForce = function(force,worldPoint){ - if(this.type !== Body.DYNAMIC){ - return; - } - - // Compute point position relative to the body center - var r = Body_applyForce_r; - worldPoint.vsub(this.position,r); - - // Compute produced rotational force - var rotForce = Body_applyForce_rotForce; - r.cross(force,rotForce); - - // Add linear force - this.force.vadd(force,this.force); - - // Add rotational force - this.torque.vadd(rotForce,this.torque); -}; - -/** - * Apply force to a local point in the body. - * @method applyLocalForce - * @param {Vec3} force The force vector to apply, defined locally in the body frame. - * @param {Vec3} localPoint A local point in the body to apply the force on. - */ -var Body_applyLocalForce_worldForce = new Vec3(); -var Body_applyLocalForce_worldPoint = new Vec3(); -Body.prototype.applyLocalForce = function(localForce, localPoint){ - if(this.type !== Body.DYNAMIC){ - return; - } - - var worldForce = Body_applyLocalForce_worldForce; - var worldPoint = Body_applyLocalForce_worldPoint; - - // Transform the force vector to world space - this.vectorToWorldFrame(localForce, worldForce); - this.pointToWorldFrame(localPoint, worldPoint); - - this.applyForce(worldForce, worldPoint); -}; - -/** - * Apply impulse to a world point. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity. - * @method applyImpulse - * @param {Vec3} impulse The amount of impulse to add. - * @param {Vec3} worldPoint A world point to apply the force on. - */ -var Body_applyImpulse_r = new Vec3(); -var Body_applyImpulse_velo = new Vec3(); -var Body_applyImpulse_rotVelo = new Vec3(); -Body.prototype.applyImpulse = function(impulse, worldPoint){ - if(this.type !== Body.DYNAMIC){ - return; - } - - // Compute point position relative to the body center - var r = Body_applyImpulse_r; - worldPoint.vsub(this.position,r); - - // Compute produced central impulse velocity - var velo = Body_applyImpulse_velo; - velo.copy(impulse); - velo.mult(this.invMass,velo); - - // Add linear impulse - this.velocity.vadd(velo, this.velocity); - - // Compute produced rotational impulse velocity - var rotVelo = Body_applyImpulse_rotVelo; - r.cross(impulse,rotVelo); - - /* - rotVelo.x *= this.invInertia.x; - rotVelo.y *= this.invInertia.y; - rotVelo.z *= this.invInertia.z; - */ - this.invInertiaWorld.vmult(rotVelo,rotVelo); - - // Add rotational Impulse - this.angularVelocity.vadd(rotVelo, this.angularVelocity); -}; - -/** - * Apply locally-defined impulse to a local point in the body. - * @method applyLocalImpulse - * @param {Vec3} force The force vector to apply, defined locally in the body frame. - * @param {Vec3} localPoint A local point in the body to apply the force on. - */ -var Body_applyLocalImpulse_worldImpulse = new Vec3(); -var Body_applyLocalImpulse_worldPoint = new Vec3(); -Body.prototype.applyLocalImpulse = function(localImpulse, localPoint){ - if(this.type !== Body.DYNAMIC){ - return; - } - - var worldImpulse = Body_applyLocalImpulse_worldImpulse; - var worldPoint = Body_applyLocalImpulse_worldPoint; - - // Transform the force vector to world space - this.vectorToWorldFrame(localImpulse, worldImpulse); - this.pointToWorldFrame(localPoint, worldPoint); - - this.applyImpulse(worldImpulse, worldPoint); -}; - -var Body_updateMassProperties_halfExtents = new Vec3(); - -/** - * Should be called whenever you change the body shape or mass. - * @method updateMassProperties - */ -Body.prototype.updateMassProperties = function(){ - var halfExtents = Body_updateMassProperties_halfExtents; - - this.invMass = this.mass > 0 ? 1.0 / this.mass : 0; - var I = this.inertia; - var fixed = this.fixedRotation; - - // Approximate with AABB box - this.computeAABB(); - halfExtents.set( - (this.aabb.upperBound.x-this.aabb.lowerBound.x) / 2, - (this.aabb.upperBound.y-this.aabb.lowerBound.y) / 2, - (this.aabb.upperBound.z-this.aabb.lowerBound.z) / 2 - ); - Box.calculateInertia(halfExtents, this.mass, I); - - this.invInertia.set( - I.x > 0 && !fixed ? 1.0 / I.x : 0, - I.y > 0 && !fixed ? 1.0 / I.y : 0, - I.z > 0 && !fixed ? 1.0 / I.z : 0 - ); - this.updateInertiaWorld(true); -}; - -/** - * Get world velocity of a point in the body. - * @method getVelocityAtWorldPoint - * @param {Vec3} worldPoint - * @param {Vec3} result - * @return {Vec3} The result vector. - */ -Body.prototype.getVelocityAtWorldPoint = function(worldPoint, result){ - var r = new Vec3(); - worldPoint.vsub(this.position, r); - this.angularVelocity.cross(r, result); - this.velocity.vadd(result, result); - return result; -}; - -},{"../collision/AABB":3,"../material/Material":25,"../math/Mat3":27,"../math/Quaternion":28,"../math/Vec3":30,"../shapes/Box":37,"../shapes/Shape":43,"../utils/EventTarget":49}],32:[function(_dereq_,module,exports){ -var Body = _dereq_('./Body'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var RaycastResult = _dereq_('../collision/RaycastResult'); -var Ray = _dereq_('../collision/Ray'); -var WheelInfo = _dereq_('../objects/WheelInfo'); - -module.exports = RaycastVehicle; - -/** - * Vehicle helper class that casts rays from the wheel positions towards the ground and applies forces. - * @class RaycastVehicle - * @constructor - * @param {object} [options] - * @param {Body} [options.chassisBody] The car chassis body. - * @param {integer} [options.indexRightAxis] Axis to use for right. x=0, y=1, z=2 - * @param {integer} [options.indexLeftAxis] - * @param {integer} [options.indexUpAxis] - */ -function RaycastVehicle(options){ - - /** - * @property {Body} chassisBody - */ - this.chassisBody = options.chassisBody; - - /** - * An array of WheelInfo objects. - * @property {array} wheelInfos - */ - this.wheelInfos = []; - - /** - * Will be set to true if the car is sliding. - * @property {boolean} sliding - */ - this.sliding = false; - - /** - * @property {World} world - */ - this.world = null; - - /** - * Index of the right axis, 0=x, 1=y, 2=z - * @property {integer} indexRightAxis - * @default 1 - */ - this.indexRightAxis = typeof(options.indexRightAxis) !== 'undefined' ? options.indexRightAxis : 1; - - /** - * Index of the forward axis, 0=x, 1=y, 2=z - * @property {integer} indexForwardAxis - * @default 0 - */ - this.indexForwardAxis = typeof(options.indexForwardAxis) !== 'undefined' ? options.indexForwardAxis : 0; - - /** - * Index of the up axis, 0=x, 1=y, 2=z - * @property {integer} indexUpAxis - * @default 2 - */ - this.indexUpAxis = typeof(options.indexUpAxis) !== 'undefined' ? options.indexUpAxis : 2; -} - -var tmpVec1 = new Vec3(); -var tmpVec2 = new Vec3(); -var tmpVec3 = new Vec3(); -var tmpVec4 = new Vec3(); -var tmpVec5 = new Vec3(); -var tmpVec6 = new Vec3(); -var tmpRay = new Ray(); - -/** - * Add a wheel. For information about the options, see WheelInfo. - * @method addWheel - * @param {object} [options] - */ -RaycastVehicle.prototype.addWheel = function(options){ - options = options || {}; - - var info = new WheelInfo(options); - var index = this.wheelInfos.length; - this.wheelInfos.push(info); - - return index; -}; - -/** - * Set the steering value of a wheel. - * @method setSteeringValue - * @param {number} value - * @param {integer} wheelIndex - */ -RaycastVehicle.prototype.setSteeringValue = function(value, wheelIndex){ - var wheel = this.wheelInfos[wheelIndex]; - wheel.steering = value; -}; - -var torque = new Vec3(); - -/** - * Set the wheel force to apply on one of the wheels each time step - * @method applyEngineForce - * @param {number} value - * @param {integer} wheelIndex - */ -RaycastVehicle.prototype.applyEngineForce = function(value, wheelIndex){ - this.wheelInfos[wheelIndex].engineForce = value; -}; - -/** - * Set the braking force of a wheel - * @method setBrake - * @param {number} brake - * @param {integer} wheelIndex - */ -RaycastVehicle.prototype.setBrake = function(brake, wheelIndex){ - this.wheelInfos[wheelIndex].brake = brake; -}; - -/** - * Add the vehicle including its constraints to the world. - * @method addToWorld - * @param {World} world - */ -RaycastVehicle.prototype.addToWorld = function(world){ - var constraints = this.constraints; - world.add(this.chassisBody); - var that = this; - this.preStepCallback = function(){ - that.updateVehicle(world.dt); - }; - world.addEventListener('preStep', this.preStepCallback); - this.world = world; -}; - -/** - * Get one of the wheel axles, world-oriented. - * @private - * @method getVehicleAxisWorld - * @param {integer} axisIndex - * @param {Vec3} result - */ -RaycastVehicle.prototype.getVehicleAxisWorld = function(axisIndex, result){ - result.set( - axisIndex === 0 ? 1 : 0, - axisIndex === 1 ? 1 : 0, - axisIndex === 2 ? 1 : 0 - ); - this.chassisBody.vectorToWorldFrame(result, result); -}; - -RaycastVehicle.prototype.updateVehicle = function(timeStep){ - var wheelInfos = this.wheelInfos; - var numWheels = wheelInfos.length; - var chassisBody = this.chassisBody; - - for (var i = 0; i < numWheels; i++) { - this.updateWheelTransform(i); - } - - this.currentVehicleSpeedKmHour = 3.6 * chassisBody.velocity.norm(); - - var forwardWorld = new Vec3(); - this.getVehicleAxisWorld(this.indexForwardAxis, forwardWorld); - - if (forwardWorld.dot(chassisBody.velocity) < 0){ - this.currentVehicleSpeedKmHour *= -1; - } - - // simulate suspension - for (var i = 0; i < numWheels; i++) { - this.castRay(wheelInfos[i]); - } - - this.updateSuspension(timeStep); - - var impulse = new Vec3(); - var relpos = new Vec3(); - for (var i = 0; i < numWheels; i++) { - //apply suspension force - var wheel = wheelInfos[i]; - var suspensionForce = wheel.suspensionForce; - if (suspensionForce > wheel.maxSuspensionForce) { - suspensionForce = wheel.maxSuspensionForce; - } - wheel.raycastResult.hitNormalWorld.scale(suspensionForce * timeStep, impulse); - - wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, relpos); - chassisBody.applyImpulse(impulse, wheel.raycastResult.hitPointWorld/*relpos*/); - } - - this.updateFriction(timeStep); - - var hitNormalWorldScaledWithProj = new Vec3(); - var fwd = new Vec3(); - var vel = new Vec3(); - for (i = 0; i < numWheels; i++) { - var wheel = wheelInfos[i]; - //var relpos = new Vec3(); - //wheel.chassisConnectionPointWorld.vsub(chassisBody.position, relpos); - chassisBody.getVelocityAtWorldPoint(wheel.chassisConnectionPointWorld, vel); - - // Hack to get the rotation in the correct direction - var m = 1; - switch(this.indexUpAxis){ - case 1: - m = -1; - break; - } - - if (wheel.isInContact) { - - this.getVehicleAxisWorld(this.indexForwardAxis, fwd); - var proj = fwd.dot(wheel.raycastResult.hitNormalWorld); - wheel.raycastResult.hitNormalWorld.scale(proj, hitNormalWorldScaledWithProj); - - fwd.vsub(hitNormalWorldScaledWithProj, fwd); - - var proj2 = fwd.dot(vel); - wheel.deltaRotation = m * proj2 * timeStep / wheel.radius; - } - - if((wheel.sliding || !wheel.isInContact) && wheel.engineForce !== 0 && wheel.useCustomSlidingRotationalSpeed){ - // Apply custom rotation when accelerating and sliding - wheel.deltaRotation = (wheel.engineForce > 0 ? 1 : -1) * wheel.customSlidingRotationalSpeed * timeStep; - } - - // Lock wheels - if(Math.abs(wheel.brake) > Math.abs(wheel.engineForce)){ - wheel.deltaRotation = 0; - } - - wheel.rotation += wheel.deltaRotation; // Use the old value - wheel.deltaRotation *= 0.99; // damping of rotation when not in contact - } -}; - -RaycastVehicle.prototype.updateSuspension = function(deltaTime) { - var chassisBody = this.chassisBody; - var chassisMass = chassisBody.mass; - var wheelInfos = this.wheelInfos; - var numWheels = wheelInfos.length; - - for (var w_it = 0; w_it < numWheels; w_it++){ - var wheel = wheelInfos[w_it]; - - if (wheel.isInContact){ - var force; - - // Spring - var susp_length = wheel.suspensionRestLength; - var current_length = wheel.suspensionLength; - var length_diff = (susp_length - current_length); - - force = wheel.suspensionStiffness * length_diff * wheel.clippedInvContactDotSuspension; - - // Damper - var projected_rel_vel = wheel.suspensionRelativeVelocity; - var susp_damping; - if (projected_rel_vel < 0) { - susp_damping = wheel.dampingCompression; - } else { - susp_damping = wheel.dampingRelaxation; - } - force -= susp_damping * projected_rel_vel; - - wheel.suspensionForce = force * chassisMass; - if (wheel.suspensionForce < 0) { - wheel.suspensionForce = 0; - } - } else { - wheel.suspensionForce = 0; - } - } -}; - -/** - * Remove the vehicle including its constraints from the world. - * @method removeFromWorld - * @param {World} world - */ -RaycastVehicle.prototype.removeFromWorld = function(world){ - var constraints = this.constraints; - world.remove(this.chassisBody); - world.removeEventListener('preStep', this.preStepCallback); - this.world = null; -}; - -var castRay_rayvector = new Vec3(); -var castRay_target = new Vec3(); -RaycastVehicle.prototype.castRay = function(wheel) { - var rayvector = castRay_rayvector; - var target = castRay_target; - - this.updateWheelTransformWorld(wheel); - var chassisBody = this.chassisBody; - - var depth = -1; - - var raylen = wheel.suspensionRestLength + wheel.radius; - - wheel.directionWorld.scale(raylen, rayvector); - var source = wheel.chassisConnectionPointWorld; - source.vadd(rayvector, target); - var raycastResult = wheel.raycastResult; - - var param = 0; - - raycastResult.reset(); - // Turn off ray collision with the chassis temporarily - var oldState = chassisBody.collisionResponse; - chassisBody.collisionResponse = false; - - // Cast ray against world - this.world.rayTest(source, target, raycastResult); - chassisBody.collisionResponse = oldState; - - var object = raycastResult.body; - - wheel.raycastResult.groundObject = 0; - - if (object) { - depth = raycastResult.distance; - wheel.raycastResult.hitNormalWorld = raycastResult.hitNormalWorld; - wheel.isInContact = true; - - var hitDistance = raycastResult.distance; - wheel.suspensionLength = hitDistance - wheel.radius; - - // clamp on max suspension travel - var minSuspensionLength = wheel.suspensionRestLength - wheel.maxSuspensionTravel; - var maxSuspensionLength = wheel.suspensionRestLength + wheel.maxSuspensionTravel; - if (wheel.suspensionLength < minSuspensionLength) { - wheel.suspensionLength = minSuspensionLength; - } - if (wheel.suspensionLength > maxSuspensionLength) { - wheel.suspensionLength = maxSuspensionLength; - wheel.raycastResult.reset(); - } - - var denominator = wheel.raycastResult.hitNormalWorld.dot(wheel.directionWorld); - - var chassis_velocity_at_contactPoint = new Vec3(); - chassisBody.getVelocityAtWorldPoint(wheel.raycastResult.hitPointWorld, chassis_velocity_at_contactPoint); - - var projVel = wheel.raycastResult.hitNormalWorld.dot( chassis_velocity_at_contactPoint ); - - if (denominator >= -0.1) { - wheel.suspensionRelativeVelocity = 0; - wheel.clippedInvContactDotSuspension = 1 / 0.1; - } else { - var inv = -1 / denominator; - wheel.suspensionRelativeVelocity = projVel * inv; - wheel.clippedInvContactDotSuspension = inv; - } - - } else { - - //put wheel info as in rest position - wheel.suspensionLength = wheel.suspensionRestLength + 0 * wheel.maxSuspensionTravel; - wheel.suspensionRelativeVelocity = 0.0; - wheel.directionWorld.scale(-1, wheel.raycastResult.hitNormalWorld); - wheel.clippedInvContactDotSuspension = 1.0; - } - - return depth; -}; - -RaycastVehicle.prototype.updateWheelTransformWorld = function(wheel){ - wheel.isInContact = false; - var chassisBody = this.chassisBody; - chassisBody.pointToWorldFrame(wheel.chassisConnectionPointLocal, wheel.chassisConnectionPointWorld); - chassisBody.vectorToWorldFrame(wheel.directionLocal, wheel.directionWorld); - chassisBody.vectorToWorldFrame(wheel.axleLocal, wheel.axleWorld); -}; - - -/** - * Update one of the wheel transform. - * Note when rendering wheels: during each step, wheel transforms are updated BEFORE the chassis; ie. their position becomes invalid after the step. Thus when you render wheels, you must update wheel transforms before rendering them. See raycastVehicle demo for an example. - * @method updateWheelTransform - * @param {integer} wheelIndex The wheel index to update. - */ -RaycastVehicle.prototype.updateWheelTransform = function(wheelIndex){ - var up = tmpVec4; - var right = tmpVec5; - var fwd = tmpVec6; - - var wheel = this.wheelInfos[wheelIndex]; - this.updateWheelTransformWorld(wheel); - - wheel.directionLocal.scale(-1, up); - right.copy(wheel.axleLocal); - up.cross(right, fwd); - fwd.normalize(); - right.normalize(); - - // Rotate around steering over the wheelAxle - var steering = wheel.steering; - var steeringOrn = new Quaternion(); - steeringOrn.setFromAxisAngle(up, steering); - - var rotatingOrn = new Quaternion(); - rotatingOrn.setFromAxisAngle(right, wheel.rotation); - - // World rotation of the wheel - var q = wheel.worldTransform.quaternion; - this.chassisBody.quaternion.mult(steeringOrn, q); - q.mult(rotatingOrn, q); - - q.normalize(); - - // world position of the wheel - var p = wheel.worldTransform.position; - p.copy(wheel.directionWorld); - p.scale(wheel.suspensionLength, p); - p.vadd(wheel.chassisConnectionPointWorld, p); -}; - -var directions = [ - new Vec3(1, 0, 0), - new Vec3(0, 1, 0), - new Vec3(0, 0, 1) -]; - -/** - * Get the world transform of one of the wheels - * @method getWheelTransformWorld - * @param {integer} wheelIndex - * @return {Transform} - */ -RaycastVehicle.prototype.getWheelTransformWorld = function(wheelIndex) { - return this.wheelInfos[wheelIndex].worldTransform; -}; - - -var updateFriction_surfNormalWS_scaled_proj = new Vec3(); -var updateFriction_axle = []; -var updateFriction_forwardWS = []; -var sideFrictionStiffness2 = 1; -RaycastVehicle.prototype.updateFriction = function(timeStep) { - var surfNormalWS_scaled_proj = updateFriction_surfNormalWS_scaled_proj; - - //calculate the impulse, so that the wheels don't move sidewards - var wheelInfos = this.wheelInfos; - var numWheels = wheelInfos.length; - var chassisBody = this.chassisBody; - var forwardWS = updateFriction_forwardWS; - var axle = updateFriction_axle; - - var numWheelsOnGround = 0; - - for (var i = 0; i < numWheels; i++) { - var wheel = wheelInfos[i]; - - var groundObject = wheel.raycastResult.body; - if (groundObject){ - numWheelsOnGround++; - } - - wheel.sideImpulse = 0; - wheel.forwardImpulse = 0; - if(!forwardWS[i]){ - forwardWS[i] = new Vec3(); - } - if(!axle[i]){ - axle[i] = new Vec3(); - } - } - - for (var i = 0; i < numWheels; i++){ - var wheel = wheelInfos[i]; - - var groundObject = wheel.raycastResult.body; - - if (groundObject) { - var axlei = axle[i]; - var wheelTrans = this.getWheelTransformWorld(i); - - // Get world axle - wheelTrans.vectorToWorldFrame(directions[this.indexRightAxis], axlei); - - var surfNormalWS = wheel.raycastResult.hitNormalWorld; - var proj = axlei.dot(surfNormalWS); - surfNormalWS.scale(proj, surfNormalWS_scaled_proj); - axlei.vsub(surfNormalWS_scaled_proj, axlei); - axlei.normalize(); - - surfNormalWS.cross(axlei, forwardWS[i]); - forwardWS[i].normalize(); - - wheel.sideImpulse = resolveSingleBilateral( - chassisBody, - wheel.raycastResult.hitPointWorld, - groundObject, - wheel.raycastResult.hitPointWorld, - axlei - ); - - wheel.sideImpulse *= sideFrictionStiffness2; - } - } - - var sideFactor = 1; - var fwdFactor = 0.5; - - this.sliding = false; - for (var i = 0; i < numWheels; i++) { - var wheel = wheelInfos[i]; - var groundObject = wheel.raycastResult.body; - - var rollingFriction = 0; - - wheel.slipInfo = 1; - if (groundObject) { - var defaultRollingFrictionImpulse = 0; - var maxImpulse = wheel.brake ? wheel.brake : defaultRollingFrictionImpulse; - - // btWheelContactPoint contactPt(chassisBody,groundObject,wheelInfraycastInfo.hitPointWorld,forwardWS[wheel],maxImpulse); - // rollingFriction = calcRollingFriction(contactPt); - rollingFriction = calcRollingFriction(chassisBody, groundObject, wheel.raycastResult.hitPointWorld, forwardWS[i], maxImpulse); - - rollingFriction += wheel.engineForce * timeStep; - - // rollingFriction = 0; - var factor = maxImpulse / rollingFriction; - wheel.slipInfo *= factor; - } - - //switch between active rolling (throttle), braking and non-active rolling friction (nthrottle/break) - - wheel.forwardImpulse = 0; - wheel.skidInfo = 1; - - if (groundObject) { - wheel.skidInfo = 1; - - var maximp = wheel.suspensionForce * timeStep * wheel.frictionSlip; - var maximpSide = maximp; - - var maximpSquared = maximp * maximpSide; - - wheel.forwardImpulse = rollingFriction;//wheelInfo.engineForce* timeStep; - - var x = wheel.forwardImpulse * fwdFactor; - var y = wheel.sideImpulse * sideFactor; - - var impulseSquared = x * x + y * y; - - wheel.sliding = false; - if (impulseSquared > maximpSquared) { - this.sliding = true; - wheel.sliding = true; - - var factor = maximp / Math.sqrt(impulseSquared); - - wheel.skidInfo *= factor; - } - } - } - - if (this.sliding) { - for (var i = 0; i < numWheels; i++) { - var wheel = wheelInfos[i]; - if (wheel.sideImpulse !== 0) { - if (wheel.skidInfo < 1){ - wheel.forwardImpulse *= wheel.skidInfo; - wheel.sideImpulse *= wheel.skidInfo; - } - } - } - } - - // apply the impulses - for (var i = 0; i < numWheels; i++) { - var wheel = wheelInfos[i]; - - var rel_pos = new Vec3(); - //wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, rel_pos); - // cannons applyimpulse is using world coord for the position - rel_pos.copy(wheel.raycastResult.hitPointWorld); - - if (wheel.forwardImpulse !== 0) { - var impulse = new Vec3(); - forwardWS[i].scale(wheel.forwardImpulse, impulse); - chassisBody.applyImpulse(impulse, rel_pos); - } - - if (wheel.sideImpulse !== 0){ - var groundObject = wheel.raycastResult.body; - - var rel_pos2 = new Vec3(); - //wheel.raycastResult.hitPointWorld.vsub(groundObject.position, rel_pos2); - rel_pos2.copy(wheel.raycastResult.hitPointWorld); - var sideImp = new Vec3(); - axle[i].scale(wheel.sideImpulse, sideImp); - - // Scale the relative position in the up direction with rollInfluence. - // If rollInfluence is 1, the impulse will be applied on the hitPoint (easy to roll over), if it is zero it will be applied in the same plane as the center of mass (not easy to roll over). - chassisBody.pointToLocalFrame(rel_pos, rel_pos); - rel_pos['xyz'[this.indexUpAxis]] *= wheel.rollInfluence; - chassisBody.pointToWorldFrame(rel_pos, rel_pos); - chassisBody.applyImpulse(sideImp, rel_pos); - - //apply friction impulse on the ground - sideImp.scale(-1, sideImp); - groundObject.applyImpulse(sideImp, rel_pos2); - } - } -}; - -var calcRollingFriction_vel1 = new Vec3(); -var calcRollingFriction_vel2 = new Vec3(); -var calcRollingFriction_vel = new Vec3(); - -function calcRollingFriction(body0, body1, frictionPosWorld, frictionDirectionWorld, maxImpulse) { - var j1 = 0; - var contactPosWorld = frictionPosWorld; - - // var rel_pos1 = new Vec3(); - // var rel_pos2 = new Vec3(); - var vel1 = calcRollingFriction_vel1; - var vel2 = calcRollingFriction_vel2; - var vel = calcRollingFriction_vel; - // contactPosWorld.vsub(body0.position, rel_pos1); - // contactPosWorld.vsub(body1.position, rel_pos2); - - body0.getVelocityAtWorldPoint(contactPosWorld, vel1); - body1.getVelocityAtWorldPoint(contactPosWorld, vel2); - vel1.vsub(vel2, vel); - - var vrel = frictionDirectionWorld.dot(vel); - - var denom0 = computeImpulseDenominator(body0, frictionPosWorld, frictionDirectionWorld); - var denom1 = computeImpulseDenominator(body1, frictionPosWorld, frictionDirectionWorld); - var relaxation = 1; - var jacDiagABInv = relaxation / (denom0 + denom1); - - // calculate j that moves us to zero relative velocity - j1 = -vrel * jacDiagABInv; - - if (maxImpulse < j1) { - j1 = maxImpulse; - } - if (j1 < -maxImpulse) { - j1 = -maxImpulse; - } - - return j1; -} - -var computeImpulseDenominator_r0 = new Vec3(); -var computeImpulseDenominator_c0 = new Vec3(); -var computeImpulseDenominator_vec = new Vec3(); -var computeImpulseDenominator_m = new Vec3(); -function computeImpulseDenominator(body, pos, normal) { - var r0 = computeImpulseDenominator_r0; - var c0 = computeImpulseDenominator_c0; - var vec = computeImpulseDenominator_vec; - var m = computeImpulseDenominator_m; - - pos.vsub(body.position, r0); - r0.cross(normal, c0); - body.invInertiaWorld.vmult(c0, m); - m.cross(r0, vec); - - return body.invMass + normal.dot(vec); -} - - -var resolveSingleBilateral_vel1 = new Vec3(); -var resolveSingleBilateral_vel2 = new Vec3(); -var resolveSingleBilateral_vel = new Vec3(); - -//bilateral constraint between two dynamic objects -function resolveSingleBilateral(body1, pos1, body2, pos2, normal, impulse){ - var normalLenSqr = normal.norm2(); - if (normalLenSqr > 1.1){ - return 0; // no impulse - } - // var rel_pos1 = new Vec3(); - // var rel_pos2 = new Vec3(); - // pos1.vsub(body1.position, rel_pos1); - // pos2.vsub(body2.position, rel_pos2); - - var vel1 = resolveSingleBilateral_vel1; - var vel2 = resolveSingleBilateral_vel2; - var vel = resolveSingleBilateral_vel; - body1.getVelocityAtWorldPoint(pos1, vel1); - body2.getVelocityAtWorldPoint(pos2, vel2); - - vel1.vsub(vel2, vel); - - var rel_vel = normal.dot(vel); - - var contactDamping = 0.2; - var massTerm = 1 / (body1.invMass + body2.invMass); - var impulse = - contactDamping * rel_vel * massTerm; - - return impulse; -} -},{"../collision/Ray":9,"../collision/RaycastResult":10,"../math/Quaternion":28,"../math/Vec3":30,"../objects/WheelInfo":36,"./Body":31}],33:[function(_dereq_,module,exports){ -var Body = _dereq_('./Body'); -var Sphere = _dereq_('../shapes/Sphere'); -var Box = _dereq_('../shapes/Box'); -var Vec3 = _dereq_('../math/Vec3'); -var HingeConstraint = _dereq_('../constraints/HingeConstraint'); - -module.exports = RigidVehicle; - -/** - * Simple vehicle helper class with spherical rigid body wheels. - * @class RigidVehicle - * @constructor - * @param {Body} [options.chassisBody] - */ -function RigidVehicle(options){ - this.wheelBodies = []; - - /** - * @property coordinateSystem - * @type {Vec3} - */ - this.coordinateSystem = typeof(options.coordinateSystem)==='undefined' ? new Vec3(1, 2, 3) : options.coordinateSystem.clone(); - - /** - * @property {Body} chassisBody - */ - this.chassisBody = options.chassisBody; - - if(!this.chassisBody){ - // No chassis body given. Create it! - var chassisShape = new Box(new Vec3(5, 2, 0.5)); - this.chassisBody = new Body(1, chassisShape); - } - - /** - * @property constraints - * @type {Array} - */ - this.constraints = []; - - this.wheelAxes = []; - this.wheelForces = []; -} - -/** - * Add a wheel - * @method addWheel - * @param {object} options - * @param {boolean} [options.isFrontWheel] - * @param {Vec3} [options.position] Position of the wheel, locally in the chassis body. - * @param {Vec3} [options.direction] Slide direction of the wheel along the suspension. - * @param {Vec3} [options.axis] Axis of rotation of the wheel, locally defined in the chassis. - * @param {Body} [options.body] The wheel body. - */ -RigidVehicle.prototype.addWheel = function(options){ - options = options || {}; - var wheelBody = options.body; - if(!wheelBody){ - wheelBody = new Body(1, new Sphere(1.2)); - } - this.wheelBodies.push(wheelBody); - this.wheelForces.push(0); - - // Position constrain wheels - var zero = new Vec3(); - var position = typeof(options.position) !== 'undefined' ? options.position.clone() : new Vec3(); - - // Set position locally to the chassis - var worldPosition = new Vec3(); - this.chassisBody.pointToWorldFrame(position, worldPosition); - wheelBody.position.set(worldPosition.x, worldPosition.y, worldPosition.z); - - // Constrain wheel - var axis = typeof(options.axis) !== 'undefined' ? options.axis.clone() : new Vec3(0, 1, 0); - this.wheelAxes.push(axis); - - var hingeConstraint = new HingeConstraint(this.chassisBody, wheelBody, { - pivotA: position, - axisA: axis, - pivotB: Vec3.ZERO, - axisB: axis, - collideConnected: false - }); - this.constraints.push(hingeConstraint); - - return this.wheelBodies.length - 1; -}; - -/** - * Set the steering value of a wheel. - * @method setSteeringValue - * @param {number} value - * @param {integer} wheelIndex - * @todo check coordinateSystem - */ -RigidVehicle.prototype.setSteeringValue = function(value, wheelIndex){ - // Set angle of the hinge axis - var axis = this.wheelAxes[wheelIndex]; - - var c = Math.cos(value), - s = Math.sin(value), - x = axis.x, - y = axis.y; - this.constraints[wheelIndex].axisA.set( - c*x -s*y, - s*x +c*y, - 0 - ); -}; - -/** - * Set the target rotational speed of the hinge constraint. - * @method setMotorSpeed - * @param {number} value - * @param {integer} wheelIndex - */ -RigidVehicle.prototype.setMotorSpeed = function(value, wheelIndex){ - var hingeConstraint = this.constraints[wheelIndex]; - hingeConstraint.enableMotor(); - hingeConstraint.motorTargetVelocity = value; -}; - -/** - * Set the target rotational speed of the hinge constraint. - * @method disableMotor - * @param {number} value - * @param {integer} wheelIndex - */ -RigidVehicle.prototype.disableMotor = function(wheelIndex){ - var hingeConstraint = this.constraints[wheelIndex]; - hingeConstraint.disableMotor(); -}; - -var torque = new Vec3(); - -/** - * Set the wheel force to apply on one of the wheels each time step - * @method setWheelForce - * @param {number} value - * @param {integer} wheelIndex - */ -RigidVehicle.prototype.setWheelForce = function(value, wheelIndex){ - this.wheelForces[wheelIndex] = value; -}; - -/** - * Apply a torque on one of the wheels. - * @method applyWheelForce - * @param {number} value - * @param {integer} wheelIndex - */ -RigidVehicle.prototype.applyWheelForce = function(value, wheelIndex){ - var axis = this.wheelAxes[wheelIndex]; - var wheelBody = this.wheelBodies[wheelIndex]; - var bodyTorque = wheelBody.torque; - - axis.scale(value, torque); - wheelBody.vectorToWorldFrame(torque, torque); - bodyTorque.vadd(torque, bodyTorque); -}; - -/** - * Add the vehicle including its constraints to the world. - * @method addToWorld - * @param {World} world - */ -RigidVehicle.prototype.addToWorld = function(world){ - var constraints = this.constraints; - var bodies = this.wheelBodies.concat([this.chassisBody]); - - for (var i = 0; i < bodies.length; i++) { - world.add(bodies[i]); - } - - for (var i = 0; i < constraints.length; i++) { - world.addConstraint(constraints[i]); - } - - world.addEventListener('preStep', this._update.bind(this)); -}; - -RigidVehicle.prototype._update = function(){ - var wheelForces = this.wheelForces; - for (var i = 0; i < wheelForces.length; i++) { - this.applyWheelForce(wheelForces[i], i); - } -}; - -/** - * Remove the vehicle including its constraints from the world. - * @method removeFromWorld - * @param {World} world - */ -RigidVehicle.prototype.removeFromWorld = function(world){ - var constraints = this.constraints; - var bodies = this.wheelBodies.concat([this.chassisBody]); - - for (var i = 0; i < bodies.length; i++) { - world.remove(bodies[i]); - } - - for (var i = 0; i < constraints.length; i++) { - world.removeConstraint(constraints[i]); - } -}; - -var worldAxis = new Vec3(); - -/** - * Get current rotational velocity of a wheel - * @method getWheelSpeed - * @param {integer} wheelIndex - */ -RigidVehicle.prototype.getWheelSpeed = function(wheelIndex){ - var axis = this.wheelAxes[wheelIndex]; - var wheelBody = this.wheelBodies[wheelIndex]; - var w = wheelBody.angularVelocity; - this.chassisBody.vectorToWorldFrame(axis, worldAxis); - return w.dot(worldAxis); -}; - -},{"../constraints/HingeConstraint":15,"../math/Vec3":30,"../shapes/Box":37,"../shapes/Sphere":44,"./Body":31}],34:[function(_dereq_,module,exports){ -module.exports = SPHSystem; - -var Shape = _dereq_('../shapes/Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Particle = _dereq_('../shapes/Particle'); -var Body = _dereq_('../objects/Body'); -var Material = _dereq_('../material/Material'); - -/** - * Smoothed-particle hydrodynamics system - * @class SPHSystem - * @constructor - */ -function SPHSystem(){ - this.particles = []; - - /** - * Density of the system (kg/m3). - * @property {number} density - */ - this.density = 1; - - /** - * Distance below which two particles are considered to be neighbors. - * It should be adjusted so there are about 15-20 neighbor particles within this radius. - * @property {number} smoothingRadius - */ - this.smoothingRadius = 1; - this.speedOfSound = 1; - - /** - * Viscosity of the system. - * @property {number} viscosity - */ - this.viscosity = 0.01; - this.eps = 0.000001; - - // Stuff Computed per particle - this.pressures = []; - this.densities = []; - this.neighbors = []; -} - -/** - * Add a particle to the system. - * @method add - * @param {Body} particle - */ -SPHSystem.prototype.add = function(particle){ - this.particles.push(particle); - if(this.neighbors.length < this.particles.length){ - this.neighbors.push([]); - } -}; - -/** - * Remove a particle from the system. - * @method remove - * @param {Body} particle - */ -SPHSystem.prototype.remove = function(particle){ - var idx = this.particles.indexOf(particle); - if(idx !== -1){ - this.particles.splice(idx,1); - if(this.neighbors.length > this.particles.length){ - this.neighbors.pop(); - } - } -}; - -/** - * Get neighbors within smoothing volume, save in the array neighbors - * @method getNeighbors - * @param {Body} particle - * @param {Array} neighbors - */ -var SPHSystem_getNeighbors_dist = new Vec3(); -SPHSystem.prototype.getNeighbors = function(particle,neighbors){ - var N = this.particles.length, - id = particle.id, - R2 = this.smoothingRadius * this.smoothingRadius, - dist = SPHSystem_getNeighbors_dist; - for(var i=0; i!==N; i++){ - var p = this.particles[i]; - p.position.vsub(particle.position,dist); - if(id!==p.id && dist.norm2() < R2){ - neighbors.push(p); - } - } -}; - -// Temp vectors for calculation -var SPHSystem_update_dist = new Vec3(), - SPHSystem_update_a_pressure = new Vec3(), - SPHSystem_update_a_visc = new Vec3(), - SPHSystem_update_gradW = new Vec3(), - SPHSystem_update_r_vec = new Vec3(), - SPHSystem_update_u = new Vec3(); // Relative velocity -SPHSystem.prototype.update = function(){ - var N = this.particles.length, - dist = SPHSystem_update_dist, - cs = this.speedOfSound, - eps = this.eps; - - for(var i=0; i!==N; i++){ - var p = this.particles[i]; // Current particle - var neighbors = this.neighbors[i]; - - // Get neighbors - neighbors.length = 0; - this.getNeighbors(p,neighbors); - neighbors.push(this.particles[i]); // Add current too - var numNeighbors = neighbors.length; - - // Accumulate density for the particle - var sum = 0.0; - for(var j=0; j!==numNeighbors; j++){ - - //printf("Current particle has position %f %f %f\n",objects[id].pos.x(),objects[id].pos.y(),objects[id].pos.z()); - p.position.vsub(neighbors[j].position, dist); - var len = dist.norm(); - - var weight = this.w(len); - sum += neighbors[j].mass * weight; - } - - // Save - this.densities[i] = sum; - this.pressures[i] = cs * cs * (this.densities[i] - this.density); - } - - // Add forces - - // Sum to these accelerations - var a_pressure= SPHSystem_update_a_pressure; - var a_visc = SPHSystem_update_a_visc; - var gradW = SPHSystem_update_gradW; - var r_vec = SPHSystem_update_r_vec; - var u = SPHSystem_update_u; - - for(var i=0; i!==N; i++){ - - var particle = this.particles[i]; - - a_pressure.set(0,0,0); - a_visc.set(0,0,0); - - // Init vars - var Pij; - var nabla; - var Vij; - - // Sum up for all other neighbors - var neighbors = this.neighbors[i]; - var numNeighbors = neighbors.length; - - //printf("Neighbors: "); - for(var j=0; j!==numNeighbors; j++){ - - var neighbor = neighbors[j]; - //printf("%d ",nj); - - // Get r once for all.. - particle.position.vsub(neighbor.position,r_vec); - var r = r_vec.norm(); - - // Pressure contribution - Pij = -neighbor.mass * (this.pressures[i] / (this.densities[i]*this.densities[i] + eps) + this.pressures[j] / (this.densities[j]*this.densities[j] + eps)); - this.gradw(r_vec, gradW); - // Add to pressure acceleration - gradW.mult(Pij , gradW); - a_pressure.vadd(gradW, a_pressure); - - // Viscosity contribution - neighbor.velocity.vsub(particle.velocity, u); - u.mult( 1.0 / (0.0001+this.densities[i] * this.densities[j]) * this.viscosity * neighbor.mass , u ); - nabla = this.nablaw(r); - u.mult(nabla,u); - // Add to viscosity acceleration - a_visc.vadd( u, a_visc ); - } - - // Calculate force - a_visc.mult(particle.mass, a_visc); - a_pressure.mult(particle.mass, a_pressure); - - // Add force to particles - particle.force.vadd(a_visc, particle.force); - particle.force.vadd(a_pressure, particle.force); - } -}; - -// Calculate the weight using the W(r) weightfunction -SPHSystem.prototype.w = function(r){ - // 315 - var h = this.smoothingRadius; - return 315.0/(64.0*Math.PI*Math.pow(h,9)) * Math.pow(h*h-r*r,3); -}; - -// calculate gradient of the weight function -SPHSystem.prototype.gradw = function(rVec,resultVec){ - var r = rVec.norm(), - h = this.smoothingRadius; - rVec.mult(945.0/(32.0*Math.PI*Math.pow(h,9)) * Math.pow((h*h-r*r),2) , resultVec); -}; - -// Calculate nabla(W) -SPHSystem.prototype.nablaw = function(r){ - var h = this.smoothingRadius; - var nabla = 945.0/(32.0*Math.PI*Math.pow(h,9)) * (h*h-r*r)*(7*r*r - 3*h*h); - return nabla; -}; - -},{"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Particle":41,"../shapes/Shape":43}],35:[function(_dereq_,module,exports){ -var Vec3 = _dereq_('../math/Vec3'); - -module.exports = Spring; - -/** - * A spring, connecting two bodies. - * - * @class Spring - * @constructor - * @param {Body} bodyA - * @param {Body} bodyB - * @param {Object} [options] - * @param {number} [options.restLength] A number > 0. Default: 1 - * @param {number} [options.stiffness] A number >= 0. Default: 100 - * @param {number} [options.damping] A number >= 0. Default: 1 - * @param {Vec3} [options.worldAnchorA] Where to hook the spring to body A, in world coordinates. - * @param {Vec3} [options.worldAnchorB] - * @param {Vec3} [options.localAnchorA] Where to hook the spring to body A, in local body coordinates. - * @param {Vec3} [options.localAnchorB] - */ -function Spring(bodyA,bodyB,options){ - options = options || {}; - - /** - * Rest length of the spring. - * @property restLength - * @type {number} - */ - this.restLength = typeof(options.restLength) === "number" ? options.restLength : 1; - - /** - * Stiffness of the spring. - * @property stiffness - * @type {number} - */ - this.stiffness = options.stiffness || 100; - - /** - * Damping of the spring. - * @property damping - * @type {number} - */ - this.damping = options.damping || 1; - - /** - * First connected body. - * @property bodyA - * @type {Body} - */ - this.bodyA = bodyA; - - /** - * Second connected body. - * @property bodyB - * @type {Body} - */ - this.bodyB = bodyB; - - /** - * Anchor for bodyA in local bodyA coordinates. - * @property localAnchorA - * @type {Vec3} - */ - this.localAnchorA = new Vec3(); - - /** - * Anchor for bodyB in local bodyB coordinates. - * @property localAnchorB - * @type {Vec3} - */ - this.localAnchorB = new Vec3(); - - if(options.localAnchorA){ - this.localAnchorA.copy(options.localAnchorA); - } - if(options.localAnchorB){ - this.localAnchorB.copy(options.localAnchorB); - } - if(options.worldAnchorA){ - this.setWorldAnchorA(options.worldAnchorA); - } - if(options.worldAnchorB){ - this.setWorldAnchorB(options.worldAnchorB); - } -} - -/** - * Set the anchor point on body A, using world coordinates. - * @method setWorldAnchorA - * @param {Vec3} worldAnchorA - */ -Spring.prototype.setWorldAnchorA = function(worldAnchorA){ - this.bodyA.pointToLocalFrame(worldAnchorA,this.localAnchorA); -}; - -/** - * Set the anchor point on body B, using world coordinates. - * @method setWorldAnchorB - * @param {Vec3} worldAnchorB - */ -Spring.prototype.setWorldAnchorB = function(worldAnchorB){ - this.bodyB.pointToLocalFrame(worldAnchorB,this.localAnchorB); -}; - -/** - * Get the anchor point on body A, in world coordinates. - * @method getWorldAnchorA - * @param {Vec3} result The vector to store the result in. - */ -Spring.prototype.getWorldAnchorA = function(result){ - this.bodyA.pointToWorldFrame(this.localAnchorA,result); -}; - -/** - * Get the anchor point on body B, in world coordinates. - * @method getWorldAnchorB - * @param {Vec3} result The vector to store the result in. - */ -Spring.prototype.getWorldAnchorB = function(result){ - this.bodyB.pointToWorldFrame(this.localAnchorB,result); -}; - -var applyForce_r = new Vec3(), - applyForce_r_unit = new Vec3(), - applyForce_u = new Vec3(), - applyForce_f = new Vec3(), - applyForce_worldAnchorA = new Vec3(), - applyForce_worldAnchorB = new Vec3(), - applyForce_ri = new Vec3(), - applyForce_rj = new Vec3(), - applyForce_ri_x_f = new Vec3(), - applyForce_rj_x_f = new Vec3(), - applyForce_tmp = new Vec3(); - -/** - * Apply the spring force to the connected bodies. - * @method applyForce - */ -Spring.prototype.applyForce = function(){ - var k = this.stiffness, - d = this.damping, - l = this.restLength, - bodyA = this.bodyA, - bodyB = this.bodyB, - r = applyForce_r, - r_unit = applyForce_r_unit, - u = applyForce_u, - f = applyForce_f, - tmp = applyForce_tmp; - - var worldAnchorA = applyForce_worldAnchorA, - worldAnchorB = applyForce_worldAnchorB, - ri = applyForce_ri, - rj = applyForce_rj, - ri_x_f = applyForce_ri_x_f, - rj_x_f = applyForce_rj_x_f; - - // Get world anchors - this.getWorldAnchorA(worldAnchorA); - this.getWorldAnchorB(worldAnchorB); - - // Get offset points - worldAnchorA.vsub(bodyA.position,ri); - worldAnchorB.vsub(bodyB.position,rj); - - // Compute distance vector between world anchor points - worldAnchorB.vsub(worldAnchorA,r); - var rlen = r.norm(); - r_unit.copy(r); - r_unit.normalize(); - - // Compute relative velocity of the anchor points, u - bodyB.velocity.vsub(bodyA.velocity,u); - // Add rotational velocity - - bodyB.angularVelocity.cross(rj,tmp); - u.vadd(tmp,u); - bodyA.angularVelocity.cross(ri,tmp); - u.vsub(tmp,u); - - // F = - k * ( x - L ) - D * ( u ) - r_unit.mult(-k*(rlen-l) - d*u.dot(r_unit), f); - - // Add forces to bodies - bodyA.force.vsub(f,bodyA.force); - bodyB.force.vadd(f,bodyB.force); - - // Angular force - ri.cross(f,ri_x_f); - rj.cross(f,rj_x_f); - bodyA.torque.vsub(ri_x_f,bodyA.torque); - bodyB.torque.vadd(rj_x_f,bodyB.torque); -}; - -},{"../math/Vec3":30}],36:[function(_dereq_,module,exports){ -var Vec3 = _dereq_('../math/Vec3'); -var Transform = _dereq_('../math/Transform'); -var RaycastResult = _dereq_('../collision/RaycastResult'); -var Utils = _dereq_('../utils/Utils'); - -module.exports = WheelInfo; - -/** - * @class WheelInfo - * @constructor - * @param {Object} [options] - * - * @param {Vec3} [options.chassisConnectionPointLocal] - * @param {Vec3} [options.chassisConnectionPointWorld] - * @param {Vec3} [options.directionLocal] - * @param {Vec3} [options.directionWorld] - * @param {Vec3} [options.axleLocal] - * @param {Vec3} [options.axleWorld] - * @param {number} [options.suspensionRestLength=1] - * @param {number} [options.suspensionMaxLength=2] - * @param {number} [options.radius=1] - * @param {number} [options.suspensionStiffness=100] - * @param {number} [options.dampingCompression=10] - * @param {number} [options.dampingRelaxation=10] - * @param {number} [options.frictionSlip=10000] - * @param {number} [options.steering=0] - * @param {number} [options.rotation=0] - * @param {number} [options.deltaRotation=0] - * @param {number} [options.rollInfluence=0.01] - * @param {number} [options.maxSuspensionForce] - * @param {boolean} [options.isFrontWheel=true] - * @param {number} [options.clippedInvContactDotSuspension=1] - * @param {number} [options.suspensionRelativeVelocity=0] - * @param {number} [options.suspensionForce=0] - * @param {number} [options.skidInfo=0] - * @param {number} [options.suspensionLength=0] - * @param {number} [options.maxSuspensionTravel=1] - * @param {boolean} [options.useCustomSlidingRotationalSpeed=false] - * @param {number} [options.customSlidingRotationalSpeed=-0.1] - */ -function WheelInfo(options){ - options = Utils.defaults(options, { - chassisConnectionPointLocal: new Vec3(), - chassisConnectionPointWorld: new Vec3(), - directionLocal: new Vec3(), - directionWorld: new Vec3(), - axleLocal: new Vec3(), - axleWorld: new Vec3(), - suspensionRestLength: 1, - suspensionMaxLength: 2, - radius: 1, - suspensionStiffness: 100, - dampingCompression: 10, - dampingRelaxation: 10, - frictionSlip: 10000, - steering: 0, - rotation: 0, - deltaRotation: 0, - rollInfluence: 0.01, - maxSuspensionForce: Number.MAX_VALUE, - isFrontWheel: true, - clippedInvContactDotSuspension: 1, - suspensionRelativeVelocity: 0, - suspensionForce: 0, - skidInfo: 0, - suspensionLength: 0, - maxSuspensionTravel: 1, - useCustomSlidingRotationalSpeed: false, - customSlidingRotationalSpeed: -0.1 - }); - - /** - * Max travel distance of the suspension, in meters. - * @property {number} maxSuspensionTravel - */ - this.maxSuspensionTravel = options.maxSuspensionTravel; - - /** - * Speed to apply to the wheel rotation when the wheel is sliding. - * @property {number} customSlidingRotationalSpeed - */ - this.customSlidingRotationalSpeed = options.customSlidingRotationalSpeed; - - /** - * If the customSlidingRotationalSpeed should be used. - * @property {Boolean} useCustomSlidingRotationalSpeed - */ - this.useCustomSlidingRotationalSpeed = options.useCustomSlidingRotationalSpeed; - - /** - * @property {Boolean} sliding - */ - this.sliding = false; - - /** - * Connection point, defined locally in the chassis body frame. - * @property {Vec3} chassisConnectionPointLocal - */ - this.chassisConnectionPointLocal = options.chassisConnectionPointLocal.clone(); - - /** - * @property {Vec3} chassisConnectionPointWorld - */ - this.chassisConnectionPointWorld = options.chassisConnectionPointWorld.clone(); - - /** - * @property {Vec3} directionLocal - */ - this.directionLocal = options.directionLocal.clone(); - - /** - * @property {Vec3} directionWorld - */ - this.directionWorld = options.directionWorld.clone(); - - /** - * @property {Vec3} axleLocal - */ - this.axleLocal = options.axleLocal.clone(); - - /** - * @property {Vec3} axleWorld - */ - this.axleWorld = options.axleWorld.clone(); - - /** - * @property {number} suspensionRestLength - */ - this.suspensionRestLength = options.suspensionRestLength; - - /** - * @property {number} suspensionMaxLength - */ - this.suspensionMaxLength = options.suspensionMaxLength; - - /** - * @property {number} radius - */ - this.radius = options.radius; - - /** - * @property {number} suspensionStiffness - */ - this.suspensionStiffness = options.suspensionStiffness; - - /** - * @property {number} dampingCompression - */ - this.dampingCompression = options.dampingCompression; - - /** - * @property {number} dampingRelaxation - */ - this.dampingRelaxation = options.dampingRelaxation; - - /** - * @property {number} frictionSlip - */ - this.frictionSlip = options.frictionSlip; - - /** - * @property {number} steering - */ - this.steering = 0; - - /** - * Rotation value, in radians. - * @property {number} rotation - */ - this.rotation = 0; - - /** - * @property {number} deltaRotation - */ - this.deltaRotation = 0; - - /** - * @property {number} rollInfluence - */ - this.rollInfluence = options.rollInfluence; - - /** - * @property {number} maxSuspensionForce - */ - this.maxSuspensionForce = options.maxSuspensionForce; - - /** - * @property {number} engineForce - */ - this.engineForce = 0; - - /** - * @property {number} brake - */ - this.brake = 0; - - /** - * @property {number} isFrontWheel - */ - this.isFrontWheel = options.isFrontWheel; - - /** - * @property {number} clippedInvContactDotSuspension - */ - this.clippedInvContactDotSuspension = 1; - - /** - * @property {number} suspensionRelativeVelocity - */ - this.suspensionRelativeVelocity = 0; - - /** - * @property {number} suspensionForce - */ - this.suspensionForce = 0; - - /** - * @property {number} skidInfo - */ - this.skidInfo = 0; - - /** - * @property {number} suspensionLength - */ - this.suspensionLength = 0; - - /** - * @property {number} sideImpulse - */ - this.sideImpulse = 0; - - /** - * @property {number} forwardImpulse - */ - this.forwardImpulse = 0; - - /** - * The result from raycasting - * @property {RaycastResult} raycastResult - */ - this.raycastResult = new RaycastResult(); - - /** - * Wheel world transform - * @property {Transform} worldTransform - */ - this.worldTransform = new Transform(); - - /** - * @property {boolean} isInContact - */ - this.isInContact = false; -} - -var chassis_velocity_at_contactPoint = new Vec3(); -var relpos = new Vec3(); -var chassis_velocity_at_contactPoint = new Vec3(); -WheelInfo.prototype.updateWheel = function(chassis){ - var raycastResult = this.raycastResult; - - if (this.isInContact){ - var project= raycastResult.hitNormalWorld.dot(raycastResult.directionWorld); - raycastResult.hitPointWorld.vsub(chassis.position, relpos); - chassis.getVelocityAtWorldPoint(relpos, chassis_velocity_at_contactPoint); - var projVel = raycastResult.hitNormalWorld.dot( chassis_velocity_at_contactPoint ); - if (project >= -0.1) { - this.suspensionRelativeVelocity = 0.0; - this.clippedInvContactDotSuspension = 1.0 / 0.1; - } else { - var inv = -1 / project; - this.suspensionRelativeVelocity = projVel * inv; - this.clippedInvContactDotSuspension = inv; - } - - } else { - // Not in contact : position wheel in a nice (rest length) position - raycastResult.suspensionLength = this.suspensionRestLength; - this.suspensionRelativeVelocity = 0.0; - raycastResult.directionWorld.scale(-1, raycastResult.hitNormalWorld); - this.clippedInvContactDotSuspension = 1.0; - } -}; -},{"../collision/RaycastResult":10,"../math/Transform":29,"../math/Vec3":30,"../utils/Utils":53}],37:[function(_dereq_,module,exports){ -module.exports = Box; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); - -/** - * A 3d box shape. - * @class Box - * @constructor - * @param {Vec3} halfExtents - * @author schteppe - * @extends Shape - */ -function Box(halfExtents){ - Shape.call(this); - - this.type = Shape.types.BOX; - - /** - * @property halfExtents - * @type {Vec3} - */ - this.halfExtents = halfExtents; - - /** - * Used by the contact generator to make contacts with other convex polyhedra for example - * @property convexPolyhedronRepresentation - * @type {ConvexPolyhedron} - */ - this.convexPolyhedronRepresentation = null; - - this.updateConvexPolyhedronRepresentation(); - this.updateBoundingSphereRadius(); -} -Box.prototype = new Shape(); -Box.prototype.constructor = Box; - -/** - * Updates the local convex polyhedron representation used for some collisions. - * @method updateConvexPolyhedronRepresentation - */ -Box.prototype.updateConvexPolyhedronRepresentation = function(){ - var sx = this.halfExtents.x; - var sy = this.halfExtents.y; - var sz = this.halfExtents.z; - var V = Vec3; - - var vertices = [ - new V(-sx,-sy,-sz), - new V( sx,-sy,-sz), - new V( sx, sy,-sz), - new V(-sx, sy,-sz), - new V(-sx,-sy, sz), - new V( sx,-sy, sz), - new V( sx, sy, sz), - new V(-sx, sy, sz) - ]; - - var indices = [ - [3,2,1,0], // -z - [4,5,6,7], // +z - [5,4,0,1], // -y - [2,3,7,6], // +y - [0,4,7,3], // -x - [1,2,6,5], // +x - ]; - - var axes = [ - new V(0, 0, 1), - new V(0, 1, 0), - new V(1, 0, 0) - ]; - - var h = new ConvexPolyhedron(vertices, indices); - this.convexPolyhedronRepresentation = h; - h.material = this.material; -}; - -/** - * @method calculateLocalInertia - * @param {Number} mass - * @param {Vec3} target - * @return {Vec3} - */ -Box.prototype.calculateLocalInertia = function(mass,target){ - target = target || new Vec3(); - Box.calculateInertia(this.halfExtents, mass, target); - return target; -}; - -Box.calculateInertia = function(halfExtents,mass,target){ - var e = halfExtents; - target.x = 1.0 / 12.0 * mass * ( 2*e.y*2*e.y + 2*e.z*2*e.z ); - target.y = 1.0 / 12.0 * mass * ( 2*e.x*2*e.x + 2*e.z*2*e.z ); - target.z = 1.0 / 12.0 * mass * ( 2*e.y*2*e.y + 2*e.x*2*e.x ); -}; - -/** - * Get the box 6 side normals - * @method getSideNormals - * @param {array} sixTargetVectors An array of 6 vectors, to store the resulting side normals in. - * @param {Quaternion} quat Orientation to apply to the normal vectors. If not provided, the vectors will be in respect to the local frame. - * @return {array} - */ -Box.prototype.getSideNormals = function(sixTargetVectors,quat){ - var sides = sixTargetVectors; - var ex = this.halfExtents; - sides[0].set( ex.x, 0, 0); - sides[1].set( 0, ex.y, 0); - sides[2].set( 0, 0, ex.z); - sides[3].set( -ex.x, 0, 0); - sides[4].set( 0, -ex.y, 0); - sides[5].set( 0, 0, -ex.z); - - if(quat!==undefined){ - for(var i=0; i!==sides.length; i++){ - quat.vmult(sides[i],sides[i]); - } - } - - return sides; -}; - -Box.prototype.volume = function(){ - return 8.0 * this.halfExtents.x * this.halfExtents.y * this.halfExtents.z; -}; - -Box.prototype.updateBoundingSphereRadius = function(){ - this.boundingSphereRadius = this.halfExtents.norm(); -}; - -var worldCornerTempPos = new Vec3(); -var worldCornerTempNeg = new Vec3(); -Box.prototype.forEachWorldCorner = function(pos,quat,callback){ - - var e = this.halfExtents; - var corners = [[ e.x, e.y, e.z], - [ -e.x, e.y, e.z], - [ -e.x, -e.y, e.z], - [ -e.x, -e.y, -e.z], - [ e.x, -e.y, -e.z], - [ e.x, e.y, -e.z], - [ -e.x, e.y, -e.z], - [ e.x, -e.y, e.z]]; - for(var i=0; i max.x){ - max.x = x; - } - if(y > max.y){ - max.y = y; - } - if(z > max.z){ - max.z = z; - } - - if(x < min.x){ - min.x = x; - } - if(y < min.y){ - min.y = y; - } - if(z < min.z){ - min.z = z; - } - } - - // Get each axis max - // min.set(Infinity,Infinity,Infinity); - // max.set(-Infinity,-Infinity,-Infinity); - // this.forEachWorldCorner(pos,quat,function(x,y,z){ - // if(x > max.x){ - // max.x = x; - // } - // if(y > max.y){ - // max.y = y; - // } - // if(z > max.z){ - // max.z = z; - // } - - // if(x < min.x){ - // min.x = x; - // } - // if(y < min.y){ - // min.y = y; - // } - // if(z < min.z){ - // min.z = z; - // } - // }); -}; - -},{"../math/Vec3":30,"./ConvexPolyhedron":38,"./Shape":43}],38:[function(_dereq_,module,exports){ -module.exports = ConvexPolyhedron; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Transform = _dereq_('../math/Transform'); - -/** - * A set of polygons describing a convex shape. - * @class ConvexPolyhedron - * @constructor - * @extends Shape - * @description The shape MUST be convex for the code to work properly. No polygons may be coplanar (contained - * in the same 3D plane), instead these should be merged into one polygon. - * - * @param {array} points An array of Vec3's - * @param {array} faces Array of integer arrays, describing which vertices that is included in each face. - * - * @author qiao / https://github.com/qiao (original author, see https://github.com/qiao/three.js/commit/85026f0c769e4000148a67d45a9e9b9c5108836f) - * @author schteppe / https://github.com/schteppe - * @see http://www.altdevblogaday.com/2011/05/13/contact-generation-between-3d-convex-meshes/ - * @see http://bullet.googlecode.com/svn/trunk/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp - * - * @todo Move the clipping functions to ContactGenerator? - * @todo Automatically merge coplanar polygons in constructor. - */ -function ConvexPolyhedron(points, faces, uniqueAxes) { - var that = this; - Shape.call(this); - this.type = Shape.types.CONVEXPOLYHEDRON; - - /** - * Array of Vec3 - * @property vertices - * @type {Array} - */ - this.vertices = points||[]; - - this.worldVertices = []; // World transformed version of .vertices - this.worldVerticesNeedsUpdate = true; - - /** - * Array of integer arrays, indicating which vertices each face consists of - * @property faces - * @type {Array} - */ - this.faces = faces||[]; - - /** - * Array of Vec3 - * @property faceNormals - * @type {Array} - */ - this.faceNormals = []; - this.computeNormals(); - - this.worldFaceNormalsNeedsUpdate = true; - this.worldFaceNormals = []; // World transformed version of .faceNormals - - /** - * Array of Vec3 - * @property uniqueEdges - * @type {Array} - */ - this.uniqueEdges = []; - - /** - * If given, these locally defined, normalized axes are the only ones being checked when doing separating axis check. - * @property {Array} uniqueAxes - */ - this.uniqueAxes = uniqueAxes ? uniqueAxes.slice() : null; - - this.computeEdges(); - this.updateBoundingSphereRadius(); -} -ConvexPolyhedron.prototype = new Shape(); -ConvexPolyhedron.prototype.constructor = ConvexPolyhedron; - -var computeEdges_tmpEdge = new Vec3(); -/** - * Computes uniqueEdges - * @method computeEdges - */ -ConvexPolyhedron.prototype.computeEdges = function(){ - var faces = this.faces; - var vertices = this.vertices; - var nv = vertices.length; - var edges = this.uniqueEdges; - - edges.length = 0; - - var edge = computeEdges_tmpEdge; - - for(var i=0; i !== faces.length; i++){ - var face = faces[i]; - var numVertices = face.length; - for(var j = 0; j !== numVertices; j++){ - var k = ( j+1 ) % numVertices; - vertices[face[j]].vsub(vertices[face[k]], edge); - edge.normalize(); - var found = false; - for(var p=0; p !== edges.length; p++){ - if (edges[p].almostEquals(edge) || edges[p].almostEquals(edge)){ - found = true; - break; - } - } - - if (!found){ - edges.push(edge.clone()); - } - } - } -}; - -/** - * Compute the normals of the faces. Will reuse existing Vec3 objects in the .faceNormals array if they exist. - * @method computeNormals - */ -ConvexPolyhedron.prototype.computeNormals = function(){ - this.faceNormals.length = this.faces.length; - - // Generate normals - for(var i=0; i dmax){ - dmax = d; - closestFaceB = face; - } - } - var worldVertsB1 = []; - var polyB = hullB.faces[closestFaceB]; - var numVertices = polyB.length; - for(var e0=0; e0=0){ - this.clipFaceAgainstHull(separatingNormal, - posA, - quatA, - worldVertsB1, - minDist, - maxDist, - result); - } -}; - -/** - * Find the separating axis between this hull and another - * @method findSeparatingAxis - * @param {ConvexPolyhedron} hullB - * @param {Vec3} posA - * @param {Quaternion} quatA - * @param {Vec3} posB - * @param {Quaternion} quatB - * @param {Vec3} target The target vector to save the axis in - * @return {bool} Returns false if a separation is found, else true - */ -var fsa_faceANormalWS3 = new Vec3(), - fsa_Worldnormal1 = new Vec3(), - fsa_deltaC = new Vec3(), - fsa_worldEdge0 = new Vec3(), - fsa_worldEdge1 = new Vec3(), - fsa_Cross = new Vec3(); -ConvexPolyhedron.prototype.findSeparatingAxis = function(hullB,posA,quatA,posB,quatB,target, faceListA, faceListB){ - var faceANormalWS3 = fsa_faceANormalWS3, - Worldnormal1 = fsa_Worldnormal1, - deltaC = fsa_deltaC, - worldEdge0 = fsa_worldEdge0, - worldEdge1 = fsa_worldEdge1, - Cross = fsa_Cross; - - var dmin = Number.MAX_VALUE; - var hullA = this; - var curPlaneTests=0; - - if(!hullA.uniqueAxes){ - - var numFacesA = faceListA ? faceListA.length : hullA.faces.length; - - // Test face normals from hullA - for(var i=0; i0.0){ - target.negate(target); - } - - return true; -}; - -var maxminA=[], maxminB=[]; - -/** - * Test separating axis against two hulls. Both hulls are projected onto the axis and the overlap size is returned if there is one. - * @method testSepAxis - * @param {Vec3} axis - * @param {ConvexPolyhedron} hullB - * @param {Vec3} posA - * @param {Quaternion} quatA - * @param {Vec3} posB - * @param {Quaternion} quatB - * @return {number} The overlap depth, or FALSE if no penetration. - */ -ConvexPolyhedron.prototype.testSepAxis = function(axis, hullB, posA, quatA, posB, quatB){ - var hullA=this; - ConvexPolyhedron.project(hullA, axis, posA, quatA, maxminA); - ConvexPolyhedron.project(hullB, axis, posB, quatB, maxminB); - var maxA = maxminA[0]; - var minA = maxminA[1]; - var maxB = maxminB[0]; - var minB = maxminB[1]; - if(maxA= 0, so output intersection - var newv = new Vec3(); - firstVertex.lerp(lastVertex, - n_dot_first / (n_dot_first - n_dot_last), - newv); - outVertices.push(newv); - } - } else { - if(n_dot_last<0){ - // Start >= 0, end < 0 so output intersection and end - var newv = new Vec3(); - firstVertex.lerp(lastVertex, - n_dot_first / (n_dot_first - n_dot_last), - newv); - outVertices.push(newv); - outVertices.push(lastVertex); - } - } - firstVertex = lastVertex; - n_dot_first = n_dot_last; - } - return outVertices; -}; - -// Updates .worldVertices and sets .worldVerticesNeedsUpdate to false. -ConvexPolyhedron.prototype.computeWorldVertices = function(position,quat){ - var N = this.vertices.length; - while(this.worldVertices.length < N){ - this.worldVertices.push( new Vec3() ); - } - - var verts = this.vertices, - worldVerts = this.worldVertices; - for(var i=0; i!==N; i++){ - quat.vmult( verts[i] , worldVerts[i] ); - position.vadd( worldVerts[i] , worldVerts[i] ); - } - - this.worldVerticesNeedsUpdate = false; -}; - -var computeLocalAABB_worldVert = new Vec3(); -ConvexPolyhedron.prototype.computeLocalAABB = function(aabbmin,aabbmax){ - var n = this.vertices.length, - vertices = this.vertices, - worldVert = computeLocalAABB_worldVert; - - aabbmin.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); - aabbmax.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); - - for(var i=0; i aabbmax.x){ - aabbmax.x = v.x; - } - if (v.y < aabbmin.y){ - aabbmin.y = v.y; - } else if(v.y > aabbmax.y){ - aabbmax.y = v.y; - } - if (v.z < aabbmin.z){ - aabbmin.z = v.z; - } else if(v.z > aabbmax.z){ - aabbmax.z = v.z; - } - } -}; - -/** - * Updates .worldVertices and sets .worldVerticesNeedsUpdate to false. - * @method computeWorldFaceNormals - * @param {Quaternion} quat - */ -ConvexPolyhedron.prototype.computeWorldFaceNormals = function(quat){ - var N = this.faceNormals.length; - while(this.worldFaceNormals.length < N){ - this.worldFaceNormals.push( new Vec3() ); - } - - var normals = this.faceNormals, - worldNormals = this.worldFaceNormals; - for(var i=0; i!==N; i++){ - quat.vmult( normals[i] , worldNormals[i] ); - } - - this.worldFaceNormalsNeedsUpdate = false; -}; - -/** - * @method updateBoundingSphereRadius - */ -ConvexPolyhedron.prototype.updateBoundingSphereRadius = function(){ - // Assume points are distributed with local (0,0,0) as center - var max2 = 0; - var verts = this.vertices; - for(var i=0, N=verts.length; i!==N; i++) { - var norm2 = verts[i].norm2(); - if(norm2 > max2){ - max2 = norm2; - } - } - this.boundingSphereRadius = Math.sqrt(max2); -}; - -var tempWorldVertex = new Vec3(); - -/** - * @method calculateWorldAABB - * @param {Vec3} pos - * @param {Quaternion} quat - * @param {Vec3} min - * @param {Vec3} max - */ -ConvexPolyhedron.prototype.calculateWorldAABB = function(pos,quat,min,max){ - var n = this.vertices.length, verts = this.vertices; - var minx,miny,minz,maxx,maxy,maxz; - for(var i=0; i maxx || maxx===undefined){ - maxx = v.x; - } - - if (v.y < miny || miny===undefined){ - miny = v.y; - } else if(v.y > maxy || maxy===undefined){ - maxy = v.y; - } - - if (v.z < minz || minz===undefined){ - minz = v.z; - } else if(v.z > maxz || maxz===undefined){ - maxz = v.z; - } - } - min.set(minx,miny,minz); - max.set(maxx,maxy,maxz); -}; - -/** - * Get approximate convex volume - * @method volume - * @return {Number} - */ -ConvexPolyhedron.prototype.volume = function(){ - return 4.0 * Math.PI * this.boundingSphereRadius / 3.0; -}; - -/** - * Get an average of all the vertices positions - * @method getAveragePointLocal - * @param {Vec3} target - * @return {Vec3} - */ -ConvexPolyhedron.prototype.getAveragePointLocal = function(target){ - target = target || new Vec3(); - var n = this.vertices.length, - verts = this.vertices; - for(var i=0; i0) || (r1>0 && r2<0)){ - return false; // Encountered some other sign. Exit. - } else { - } - } - - // If we got here, all dot products were of the same sign. - return positiveResult ? 1 : -1; -}; - -/** - * Get max and min dot product of a convex hull at position (pos,quat) projected onto an axis. Results are saved in the array maxmin. - * @static - * @method project - * @param {ConvexPolyhedron} hull - * @param {Vec3} axis - * @param {Vec3} pos - * @param {Quaternion} quat - * @param {array} result result[0] and result[1] will be set to maximum and minimum, respectively. - */ -var project_worldVertex = new Vec3(); -var project_localAxis = new Vec3(); -var project_localOrigin = new Vec3(); -ConvexPolyhedron.project = function(hull, axis, pos, quat, result){ - var n = hull.vertices.length, - worldVertex = project_worldVertex, - localAxis = project_localAxis, - max = 0, - min = 0, - localOrigin = project_localOrigin, - vs = hull.vertices; - - localOrigin.setZero(); - - // Transform the axis to local - Transform.vectorToLocalFrame(pos, quat, axis, localAxis); - Transform.pointToLocalFrame(pos, quat, localOrigin, localOrigin); - var add = localOrigin.dot(localAxis); - - min = max = vs[0].dot(localAxis); - - for(var i = 1; i < n; i++){ - var val = vs[i].dot(localAxis); - - if(val > max){ - max = val; - } - - if(val < min){ - min = val; - } - } - - min -= add; - max -= add; - - if(min > max){ - // Inconsistent - swap - var temp = min; - min = max; - max = temp; - } - // Output - result[0] = max; - result[1] = min; -}; - -},{"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"./Shape":43}],39:[function(_dereq_,module,exports){ -module.exports = Cylinder; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); - -/** - * @class Cylinder - * @constructor - * @extends ConvexPolyhedron - * @author schteppe / https://github.com/schteppe - * @param {Number} radiusTop - * @param {Number} radiusBottom - * @param {Number} height - * @param {Number} numSegments The number of segments to build the cylinder out of - */ -function Cylinder( radiusTop, radiusBottom, height , numSegments ) { - var N = numSegments, - verts = [], - axes = [], - faces = [], - bottomface = [], - topface = [], - cos = Math.cos, - sin = Math.sin; - - // First bottom point - verts.push(new Vec3(radiusBottom*cos(0), - radiusBottom*sin(0), - -height*0.5)); - bottomface.push(0); - - // First top point - verts.push(new Vec3(radiusTop*cos(0), - radiusTop*sin(0), - height*0.5)); - topface.push(1); - - for(var i=0; i { convex: ..., offset: ... } - // for example: - // _cachedPillars["0_2_1"] - this._cachedPillars = {}; -} -Heightfield.prototype = new Shape(); - -/** - * Call whenever you change the data array. - * @method update - */ -Heightfield.prototype.update = function(){ - this._cachedPillars = {}; -}; - -/** - * Update the .minValue property - * @method updateMinValue - */ -Heightfield.prototype.updateMinValue = function(){ - var data = this.data; - var minValue = data[0][0]; - for(var i=0; i !== data.length; i++){ - for(var j=0; j !== data[i].length; j++){ - var v = data[i][j]; - if(v < minValue){ - minValue = v; - } - } - } - this.minValue = minValue; -}; - -/** - * Update the .maxValue property - * @method updateMaxValue - */ -Heightfield.prototype.updateMaxValue = function(){ - var data = this.data; - var maxValue = data[0][0]; - for(var i=0; i !== data.length; i++){ - for(var j=0; j !== data[i].length; j++){ - var v = data[i][j]; - if(v > maxValue){ - maxValue = v; - } - } - } - this.maxValue = maxValue; -}; - -/** - * Set the height value at an index. Don't forget to update maxValue and minValue after you're done. - * @method setHeightValueAtIndex - * @param {integer} xi - * @param {integer} yi - * @param {number} value - */ -Heightfield.prototype.setHeightValueAtIndex = function(xi, yi, value){ - var data = this.data; - data[xi][yi] = value; - - // Invalidate cache - this.clearCachedConvexTrianglePillar(xi, yi, false); - if(xi > 0){ - this.clearCachedConvexTrianglePillar(xi - 1, yi, true); - this.clearCachedConvexTrianglePillar(xi - 1, yi, false); - } - if(yi > 0){ - this.clearCachedConvexTrianglePillar(xi, yi - 1, true); - this.clearCachedConvexTrianglePillar(xi, yi - 1, false); - } - if(yi > 0 && xi > 0){ - this.clearCachedConvexTrianglePillar(xi - 1, yi - 1, true); - } -}; - -/** - * Get max/min in a rectangle in the matrix data - * @method getRectMinMax - * @param {integer} iMinX - * @param {integer} iMinY - * @param {integer} iMaxX - * @param {integer} iMaxY - * @param {array} [result] An array to store the results in. - * @return {array} The result array, if it was passed in. Minimum will be at position 0 and max at 1. - */ -Heightfield.prototype.getRectMinMax = function (iMinX, iMinY, iMaxX, iMaxY, result) { - result = result || []; - - // Get max and min of the data - var data = this.data, - max = this.minValue; // Set first value - for(var i = iMinX; i <= iMaxX; i++){ - for(var j = iMinY; j <= iMaxY; j++){ - var height = data[i][j]; - if(height > max){ - max = height; - } - } - } - - result[0] = this.minValue; - result[1] = max; -}; - -/** - * Get the index of a local position on the heightfield. The indexes indicate the rectangles, so if your terrain is made of N x N height data points, you will have rectangle indexes ranging from 0 to N-1. - * @method getIndexOfPosition - * @param {number} x - * @param {number} y - * @param {array} result Two-element array - * @param {boolean} clamp If the position should be clamped to the heightfield edge. - * @return {boolean} - */ -Heightfield.prototype.getIndexOfPosition = function (x, y, result, clamp) { - - // Get the index of the data points to test against - var w = this.elementSize; - var data = this.data; - var xi = Math.floor(x / w); - var yi = Math.floor(y / w); - - result[0] = xi; - result[1] = yi; - - if(clamp){ - // Clamp index to edges - if(xi < 0){ xi = 0; } - if(yi < 0){ yi = 0; } - if(xi >= data.length - 1){ xi = data.length - 1; } - if(yi >= data[0].length - 1){ yi = data[0].length - 1; } - } - - // Bail out if we are out of the terrain - if(xi < 0 || yi < 0 || xi >= data.length-1 || yi >= data[0].length-1){ - return false; - } - - return true; -}; - -Heightfield.prototype.getHeightAt = function(x, y, edgeClamp){ - var idx = []; - this.getIndexOfPosition(x, y, idx, edgeClamp); - - // TODO: get upper or lower triangle, then use barycentric interpolation to get the height in the triangle. - var minmax = []; - this.getRectMinMax(idx[0], idx[1] + 1, idx[0], idx[1] + 1, minmax); - - return (minmax[0] + minmax[1]) / 2; // average -}; - -Heightfield.prototype.getCacheConvexTrianglePillarKey = function(xi, yi, getUpperTriangle){ - return xi + '_' + yi + '_' + (getUpperTriangle ? 1 : 0); -}; - -Heightfield.prototype.getCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle){ - return this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)]; -}; - -Heightfield.prototype.setCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle, convex, offset){ - this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)] = { - convex: convex, - offset: offset - }; -}; - -Heightfield.prototype.clearCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle){ - delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)]; -}; - -/** - * Get a triangle in the terrain in the form of a triangular convex shape. - * @method getConvexTrianglePillar - * @param {integer} i - * @param {integer} j - * @param {boolean} getUpperTriangle - */ -Heightfield.prototype.getConvexTrianglePillar = function(xi, yi, getUpperTriangle){ - var result = this.pillarConvex; - var offsetResult = this.pillarOffset; - - if(this.cacheEnabled){ - var data = this.getCachedConvexTrianglePillar(xi, yi, getUpperTriangle); - if(data){ - this.pillarConvex = data.convex; - this.pillarOffset = data.offset; - return; - } - - result = new ConvexPolyhedron(); - offsetResult = new Vec3(); - - this.pillarConvex = result; - this.pillarOffset = offsetResult; - } - - var data = this.data; - var elementSize = this.elementSize; - var faces = result.faces; - - // Reuse verts if possible - result.vertices.length = 6; - for (var i = 0; i < 6; i++) { - if(!result.vertices[i]){ - result.vertices[i] = new Vec3(); - } - } - - // Reuse faces if possible - faces.length = 5; - for (var i = 0; i < 5; i++) { - if(!faces[i]){ - faces[i] = []; - } - } - - var verts = result.vertices; - - var h = (Math.min( - data[xi][yi], - data[xi+1][yi], - data[xi][yi+1], - data[xi+1][yi+1] - ) - this.minValue ) / 2 + this.minValue; - - if (!getUpperTriangle) { - - // Center of the triangle pillar - all polygons are given relative to this one - offsetResult.set( - (xi + 0.25) * elementSize, // sort of center of a triangle - (yi + 0.25) * elementSize, - h // vertical center - ); - - // Top triangle verts - verts[0].set( - -0.25 * elementSize, - -0.25 * elementSize, - data[xi][yi] - h - ); - verts[1].set( - 0.75 * elementSize, - -0.25 * elementSize, - data[xi + 1][yi] - h - ); - verts[2].set( - -0.25 * elementSize, - 0.75 * elementSize, - data[xi][yi + 1] - h - ); - - // bottom triangle verts - verts[3].set( - -0.25 * elementSize, - -0.25 * elementSize, - -h-1 - ); - verts[4].set( - 0.75 * elementSize, - -0.25 * elementSize, - -h-1 - ); - verts[5].set( - -0.25 * elementSize, - 0.75 * elementSize, - -h-1 - ); - - // top triangle - faces[0][0] = 0; - faces[0][1] = 1; - faces[0][2] = 2; - - // bottom triangle - faces[1][0] = 5; - faces[1][1] = 4; - faces[1][2] = 3; - - // -x facing quad - faces[2][0] = 0; - faces[2][1] = 2; - faces[2][2] = 5; - faces[2][3] = 3; - - // -y facing quad - faces[3][0] = 1; - faces[3][1] = 0; - faces[3][2] = 3; - faces[3][3] = 4; - - // +xy facing quad - faces[4][0] = 4; - faces[4][1] = 5; - faces[4][2] = 2; - faces[4][3] = 1; - - - } else { - - // Center of the triangle pillar - all polygons are given relative to this one - offsetResult.set( - (xi + 0.75) * elementSize, // sort of center of a triangle - (yi + 0.75) * elementSize, - h // vertical center - ); - - // Top triangle verts - verts[0].set( - 0.25 * elementSize, - 0.25 * elementSize, - data[xi + 1][yi + 1] - h - ); - verts[1].set( - -0.75 * elementSize, - 0.25 * elementSize, - data[xi][yi + 1] - h - ); - verts[2].set( - 0.25 * elementSize, - -0.75 * elementSize, - data[xi + 1][yi] - h - ); - - // bottom triangle verts - verts[3].set( - 0.25 * elementSize, - 0.25 * elementSize, - - h-1 - ); - verts[4].set( - -0.75 * elementSize, - 0.25 * elementSize, - - h-1 - ); - verts[5].set( - 0.25 * elementSize, - -0.75 * elementSize, - - h-1 - ); - - // Top triangle - faces[0][0] = 0; - faces[0][1] = 1; - faces[0][2] = 2; - - // bottom triangle - faces[1][0] = 5; - faces[1][1] = 4; - faces[1][2] = 3; - - // +x facing quad - faces[2][0] = 2; - faces[2][1] = 5; - faces[2][2] = 3; - faces[2][3] = 0; - - // +y facing quad - faces[3][0] = 3; - faces[3][1] = 4; - faces[3][2] = 1; - faces[3][3] = 0; - - // -xy facing quad - faces[4][0] = 1; - faces[4][1] = 4; - faces[4][2] = 5; - faces[4][3] = 2; - } - - result.computeNormals(); - result.computeEdges(); - result.updateBoundingSphereRadius(); - - this.setCachedConvexTrianglePillar(xi, yi, getUpperTriangle, result, offsetResult); -}; - -Heightfield.prototype.calculateLocalInertia = function(mass, target){ - target = target || new Vec3(); - target.set(0, 0, 0); - return target; -}; - -Heightfield.prototype.volume = function(){ - return Number.MAX_VALUE; // The terrain is infinite -}; - -Heightfield.prototype.calculateWorldAABB = function(pos, quat, min, max){ - // TODO: do it properly - min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); - max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); -}; - -Heightfield.prototype.updateBoundingSphereRadius = function(){ - // Use the bounding box of the min/max values - var data = this.data, - s = this.elementSize; - this.boundingSphereRadius = new Vec3(data.length * s, data[0].length * s, Math.max(Math.abs(this.maxValue), Math.abs(this.minValue))).norm(); -}; - -},{"../math/Vec3":30,"../utils/Utils":53,"./ConvexPolyhedron":38,"./Shape":43}],41:[function(_dereq_,module,exports){ -module.exports = Particle; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); - -/** - * Particle shape. - * @class Particle - * @constructor - * @author schteppe - * @extends Shape - */ -function Particle(){ - Shape.call(this); - - this.type = Shape.types.PARTICLE; -} -Particle.prototype = new Shape(); -Particle.prototype.constructor = Particle; - -/** - * @method calculateLocalInertia - * @param {Number} mass - * @param {Vec3} target - * @return {Vec3} - */ -Particle.prototype.calculateLocalInertia = function(mass,target){ - target = target || new Vec3(); - target.set(0, 0, 0); - return target; -}; - -Particle.prototype.volume = function(){ - return 0; -}; - -Particle.prototype.updateBoundingSphereRadius = function(){ - this.boundingSphereRadius = 0; -}; - -Particle.prototype.calculateWorldAABB = function(pos,quat,min,max){ - // Get each axis max - min.copy(pos); - max.copy(pos); -}; - -},{"../math/Vec3":30,"./Shape":43}],42:[function(_dereq_,module,exports){ -module.exports = Plane; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); - -/** - * A plane, facing in the Z direction. The plane has its surface at z=0 and everything below z=0 is assumed to be solid plane. To make the plane face in some other direction than z, you must put it inside a RigidBody and rotate that body. See the demos. - * @class Plane - * @constructor - * @extends Shape - * @author schteppe - */ -function Plane(){ - Shape.call(this); - this.type = Shape.types.PLANE; - - // World oriented normal - this.worldNormal = new Vec3(); - this.worldNormalNeedsUpdate = true; - - this.boundingSphereRadius = Number.MAX_VALUE; -} -Plane.prototype = new Shape(); -Plane.prototype.constructor = Plane; - -Plane.prototype.computeWorldNormal = function(quat){ - var n = this.worldNormal; - n.set(0,0,1); - quat.vmult(n,n); - this.worldNormalNeedsUpdate = false; -}; - -Plane.prototype.calculateLocalInertia = function(mass,target){ - target = target || new Vec3(); - return target; -}; - -Plane.prototype.volume = function(){ - return Number.MAX_VALUE; // The plane is infinite... -}; - -var tempNormal = new Vec3(); -Plane.prototype.calculateWorldAABB = function(pos, quat, min, max){ - // The plane AABB is infinite, except if the normal is pointing along any axis - tempNormal.set(0,0,1); // Default plane normal is z - quat.vmult(tempNormal,tempNormal); - var maxVal = Number.MAX_VALUE; - min.set(-maxVal, -maxVal, -maxVal); - max.set(maxVal, maxVal, maxVal); - - if(tempNormal.x === 1){ max.x = pos.x; } - if(tempNormal.y === 1){ max.y = pos.y; } - if(tempNormal.z === 1){ max.z = pos.z; } - - if(tempNormal.x === -1){ min.x = pos.x; } - if(tempNormal.y === -1){ min.y = pos.y; } - if(tempNormal.z === -1){ min.z = pos.z; } -}; - -Plane.prototype.updateBoundingSphereRadius = function(){ - this.boundingSphereRadius = Number.MAX_VALUE; -}; -},{"../math/Vec3":30,"./Shape":43}],43:[function(_dereq_,module,exports){ -module.exports = Shape; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Material = _dereq_('../material/Material'); - -/** - * Base class for shapes - * @class Shape - * @constructor - * @author schteppe - * @todo Should have a mechanism for caching bounding sphere radius instead of calculating it each time - */ -function Shape(){ - - /** - * Identifyer of the Shape. - * @property {number} id - */ - this.id = Shape.idCounter++; - - /** - * The type of this shape. Must be set to an int > 0 by subclasses. - * @property type - * @type {Number} - * @see Shape.types - */ - this.type = 0; - - /** - * The local bounding sphere radius of this shape. - * @property {Number} boundingSphereRadius - */ - this.boundingSphereRadius = 0; - - /** - * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. - * @property {boolean} collisionResponse - */ - this.collisionResponse = true; - - /** - * @property {Material} material - */ - this.material = null; -} -Shape.prototype.constructor = Shape; - -/** - * Computes the bounding sphere radius. The result is stored in the property .boundingSphereRadius - * @method updateBoundingSphereRadius - * @return {Number} - */ -Shape.prototype.updateBoundingSphereRadius = function(){ - throw "computeBoundingSphereRadius() not implemented for shape type "+this.type; -}; - -/** - * Get the volume of this shape - * @method volume - * @return {Number} - */ -Shape.prototype.volume = function(){ - throw "volume() not implemented for shape type "+this.type; -}; - -/** - * Calculates the inertia in the local frame for this shape. - * @method calculateLocalInertia - * @return {Vec3} - * @see http://en.wikipedia.org/wiki/List_of_moments_of_inertia - */ -Shape.prototype.calculateLocalInertia = function(mass,target){ - throw "calculateLocalInertia() not implemented for shape type "+this.type; -}; - -Shape.idCounter = 0; - -/** - * The available shape types. - * @static - * @property types - * @type {Object} - */ -Shape.types = { - SPHERE:1, - PLANE:2, - BOX:4, - COMPOUND:8, - CONVEXPOLYHEDRON:16, - HEIGHTFIELD:32, - PARTICLE:64, - CYLINDER:128, - TRIMESH:256 -}; - - -},{"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"./Shape":43}],44:[function(_dereq_,module,exports){ -module.exports = Sphere; - -var Shape = _dereq_('./Shape'); -var Vec3 = _dereq_('../math/Vec3'); - -/** - * Spherical shape - * @class Sphere - * @constructor - * @extends Shape - * @param {Number} radius The radius of the sphere, a non-negative number. - * @author schteppe / http://github.com/schteppe - */ -function Sphere(radius){ - Shape.call(this); - - /** - * @property {Number} radius - */ - this.radius = radius!==undefined ? Number(radius) : 1.0; - this.type = Shape.types.SPHERE; - - if(this.radius < 0){ - throw new Error('The sphere radius cannot be negative.'); - } - - this.updateBoundingSphereRadius(); -} -Sphere.prototype = new Shape(); -Sphere.prototype.constructor = Sphere; - -Sphere.prototype.calculateLocalInertia = function(mass,target){ - target = target || new Vec3(); - var I = 2.0*mass*this.radius*this.radius/5.0; - target.x = I; - target.y = I; - target.z = I; - return target; -}; - -Sphere.prototype.volume = function(){ - return 4.0 * Math.PI * this.radius / 3.0; -}; - -Sphere.prototype.updateBoundingSphereRadius = function(){ - this.boundingSphereRadius = this.radius; -}; - -Sphere.prototype.calculateWorldAABB = function(pos,quat,min,max){ - var r = this.radius; - var axes = ['x','y','z']; - for(var i=0; i u.x){ - u.x = v.x; - } - - if(v.y < l.y){ - l.y = v.y; - } else if(v.y > u.y){ - u.y = v.y; - } - - if(v.z < l.z){ - l.z = v.z; - } else if(v.z > u.z){ - u.z = v.z; - } - } -}; - - -/** - * Update the .aabb property - * @method updateAABB - */ -Trimesh.prototype.updateAABB = function(){ - this.computeLocalAABB(this.aabb); -}; - -/** - * Will update the .boundingSphereRadius property - * @method updateBoundingSphereRadius - */ -Trimesh.prototype.updateBoundingSphereRadius = function(){ - // Assume points are distributed with local (0,0,0) as center - var max2 = 0; - var vertices = this.vertices; - var v = new Vec3(); - for(var i=0, N=vertices.length / 3; i !== N; i++) { - this.getVertex(i, v); - var norm2 = v.norm2(); - if(norm2 > max2){ - max2 = norm2; - } - } - this.boundingSphereRadius = Math.sqrt(max2); -}; - -var tempWorldVertex = new Vec3(); -var calculateWorldAABB_frame = new Transform(); -var calculateWorldAABB_aabb = new AABB(); - -/** - * @method calculateWorldAABB - * @param {Vec3} pos - * @param {Quaternion} quat - * @param {Vec3} min - * @param {Vec3} max - */ -Trimesh.prototype.calculateWorldAABB = function(pos,quat,min,max){ - /* - var n = this.vertices.length / 3, - verts = this.vertices; - var minx,miny,minz,maxx,maxy,maxz; - - var v = tempWorldVertex; - for(var i=0; i maxx || maxx===undefined){ - maxx = v.x; - } - - if (v.y < miny || miny===undefined){ - miny = v.y; - } else if(v.y > maxy || maxy===undefined){ - maxy = v.y; - } - - if (v.z < minz || minz===undefined){ - minz = v.z; - } else if(v.z > maxz || maxz===undefined){ - maxz = v.z; - } - } - min.set(minx,miny,minz); - max.set(maxx,maxy,maxz); - */ - - // Faster approximation using local AABB - var frame = calculateWorldAABB_frame; - var result = calculateWorldAABB_aabb; - frame.position = pos; - frame.quaternion = quat; - this.aabb.toWorldFrame(frame, result); - min.copy(result.lowerBound); - max.copy(result.upperBound); -}; - -/** - * Get approximate volume - * @method volume - * @return {Number} - */ -Trimesh.prototype.volume = function(){ - return 4.0 * Math.PI * this.boundingSphereRadius / 3.0; -}; - -/** - * Create a Trimesh instance, shaped as a torus. - * @static - * @method createTorus - * @param {number} [radius=1] - * @param {number} [tube=0.5] - * @param {number} [radialSegments=8] - * @param {number} [tubularSegments=6] - * @param {number} [arc=6.283185307179586] - * @return {Trimesh} A torus - */ -Trimesh.createTorus = function (radius, tube, radialSegments, tubularSegments, arc) { - radius = radius || 1; - tube = tube || 0.5; - radialSegments = radialSegments || 8; - tubularSegments = tubularSegments || 6; - arc = arc || Math.PI * 2; - - var vertices = []; - var indices = []; - - for ( var j = 0; j <= radialSegments; j ++ ) { - for ( var i = 0; i <= tubularSegments; i ++ ) { - var u = i / tubularSegments * arc; - var v = j / radialSegments * Math.PI * 2; - - var x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); - var y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); - var z = tube * Math.sin( v ); - - vertices.push( x, y, z ); - } - } - - for ( var j = 1; j <= radialSegments; j ++ ) { - for ( var i = 1; i <= tubularSegments; i ++ ) { - var a = ( tubularSegments + 1 ) * j + i - 1; - var b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; - var c = ( tubularSegments + 1 ) * ( j - 1 ) + i; - var d = ( tubularSegments + 1 ) * j + i; - - indices.push(a, b, d); - indices.push(b, c, d); - } - } - - return new Trimesh(vertices, indices); -}; - -},{"../collision/AABB":3,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../utils/Octree":50,"./Shape":43}],46:[function(_dereq_,module,exports){ -module.exports = GSSolver; - -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Solver = _dereq_('./Solver'); - -/** - * Constraint equation Gauss-Seidel solver. - * @class GSSolver - * @constructor - * @todo The spook parameters should be specified for each constraint, not globally. - * @author schteppe / https://github.com/schteppe - * @see https://www8.cs.umu.se/kurser/5DV058/VT09/lectures/spooknotes.pdf - * @extends Solver - */ -function GSSolver(){ - Solver.call(this); - - /** - * The number of solver iterations determines quality of the constraints in the world. The more iterations, the more correct simulation. More iterations need more computations though. If you have a large gravity force in your world, you will need more iterations. - * @property iterations - * @type {Number} - * @todo write more about solver and iterations in the wiki - */ - this.iterations = 10; - - /** - * When tolerance is reached, the system is assumed to be converged. - * @property tolerance - * @type {Number} - */ - this.tolerance = 1e-7; -} -GSSolver.prototype = new Solver(); - -var GSSolver_solve_lambda = []; // Just temporary number holders that we want to reuse each solve. -var GSSolver_solve_invCs = []; -var GSSolver_solve_Bs = []; -GSSolver.prototype.solve = function(dt,world){ - var iter = 0, - maxIter = this.iterations, - tolSquared = this.tolerance*this.tolerance, - equations = this.equations, - Neq = equations.length, - bodies = world.bodies, - Nbodies = bodies.length, - h = dt, - q, B, invC, deltalambda, deltalambdaTot, GWlambda, lambdaj; - - // Update solve mass - if(Neq !== 0){ - for(var i=0; i!==Nbodies; i++){ - bodies[i].updateSolveMassProperties(); - } - } - - // Things that does not change during iteration can be computed once - var invCs = GSSolver_solve_invCs, - Bs = GSSolver_solve_Bs, - lambda = GSSolver_solve_lambda; - invCs.length = Neq; - Bs.length = Neq; - lambda.length = Neq; - for(var i=0; i!==Neq; i++){ - var c = equations[i]; - lambda[i] = 0.0; - Bs[i] = c.computeB(h); - invCs[i] = 1.0 / c.computeC(); - } - - if(Neq !== 0){ - - // Reset vlambda - for(var i=0; i!==Nbodies; i++){ - var b=bodies[i], - vlambda=b.vlambda, - wlambda=b.wlambda; - vlambda.set(0,0,0); - if(wlambda){ - wlambda.set(0,0,0); - } - } - - // Iterate over equations - for(iter=0; iter!==maxIter; iter++){ - - // Accumulate the total error for each iteration. - deltalambdaTot = 0.0; - - for(var j=0; j!==Neq; j++){ - - var c = equations[j]; - - // Compute iteration - B = Bs[j]; - invC = invCs[j]; - lambdaj = lambda[j]; - GWlambda = c.computeGWlambda(); - deltalambda = invC * ( B - GWlambda - c.eps * lambdaj ); - - // Clamp if we are not within the min/max interval - if(lambdaj + deltalambda < c.minForce){ - deltalambda = c.minForce - lambdaj; - } else if(lambdaj + deltalambda > c.maxForce){ - deltalambda = c.maxForce - lambdaj; - } - lambda[j] += deltalambda; - - deltalambdaTot += deltalambda > 0.0 ? deltalambda : -deltalambda; // abs(deltalambda) - - c.addToWlambda(deltalambda); - } - - // If the total error is small enough - stop iterate - if(deltalambdaTot*deltalambdaTot < tolSquared){ - break; - } - } - - // Add result to velocity - for(var i=0; i!==Nbodies; i++){ - var b=bodies[i], - v=b.velocity, - w=b.angularVelocity; - v.vadd(b.vlambda, v); - if(w){ - w.vadd(b.wlambda, w); - } - } - } - - return iter; -}; - -},{"../math/Quaternion":28,"../math/Vec3":30,"./Solver":47}],47:[function(_dereq_,module,exports){ -module.exports = Solver; - -/** - * Constraint equation solver base class. - * @class Solver - * @constructor - * @author schteppe / https://github.com/schteppe - */ -function Solver(){ - /** - * All equations to be solved - * @property {Array} equations - */ - this.equations = []; -} - -/** - * Should be implemented in subclasses! - * @method solve - * @param {Number} dt - * @param {World} world - */ -Solver.prototype.solve = function(dt,world){ - // Should return the number of iterations done! - return 0; -}; - -/** - * Add an equation - * @method addEquation - * @param {Equation} eq - */ -Solver.prototype.addEquation = function(eq){ - if (eq.enabled) { - this.equations.push(eq); - } -}; - -/** - * Remove an equation - * @method removeEquation - * @param {Equation} eq - */ -Solver.prototype.removeEquation = function(eq){ - var eqs = this.equations; - var i = eqs.indexOf(eq); - if(i !== -1){ - eqs.splice(i,1); - } -}; - -/** - * Add all equations - * @method removeAllEquations - */ -Solver.prototype.removeAllEquations = function(){ - this.equations.length = 0; -}; - - -},{}],48:[function(_dereq_,module,exports){ -module.exports = SplitSolver; - -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var Solver = _dereq_('./Solver'); -var Body = _dereq_('../objects/Body'); - -/** - * Splits the equations into islands and solves them independently. Can improve performance. - * @class SplitSolver - * @constructor - * @extends Solver - * @param {Solver} subsolver - */ -function SplitSolver(subsolver){ - Solver.call(this); - this.iterations = 10; - this.tolerance = 1e-7; - this.subsolver = subsolver; - this.nodes = []; - this.nodePool = []; - - // Create needed nodes, reuse if possible - while(this.nodePool.length < 128){ - this.nodePool.push(this.createNode()); - } -} -SplitSolver.prototype = new Solver(); - -// Returns the number of subsystems -var SplitSolver_solve_nodes = []; // All allocated node objects -var SplitSolver_solve_nodePool = []; // All allocated node objects -var SplitSolver_solve_eqs = []; // Temp array -var SplitSolver_solve_bds = []; // Temp array -var SplitSolver_solve_dummyWorld = {bodies:[]}; // Temp object - -var STATIC = Body.STATIC; -function getUnvisitedNode(nodes){ - var Nnodes = nodes.length; - for(var i=0; i!==Nnodes; i++){ - var node = nodes[i]; - if(!node.visited && !(node.body.type & STATIC)){ - return node; - } - } - return false; -} - -var queue = []; -function bfs(root,visitFunc,bds,eqs){ - queue.push(root); - root.visited = true; - visitFunc(root,bds,eqs); - while(queue.length) { - var node = queue.pop(); - // Loop over unvisited child nodes - var child; - while((child = getUnvisitedNode(node.children))) { - child.visited = true; - visitFunc(child,bds,eqs); - queue.push(child); - } - } -} - -function visitFunc(node,bds,eqs){ - bds.push(node.body); - var Neqs = node.eqs.length; - for(var i=0; i!==Neqs; i++){ - var eq = node.eqs[i]; - if(eqs.indexOf(eq) === -1){ - eqs.push(eq); - } - } -} - -SplitSolver.prototype.createNode = function(){ - return { body:null, children:[], eqs:[], visited:false }; -}; - -/** - * Solve the subsystems - * @method solve - * @param {Number} dt - * @param {World} world - */ -SplitSolver.prototype.solve = function(dt,world){ - var nodes=SplitSolver_solve_nodes, - nodePool=this.nodePool, - bodies=world.bodies, - equations=this.equations, - Neq=equations.length, - Nbodies=bodies.length, - subsolver=this.subsolver; - - // Create needed nodes, reuse if possible - while(nodePool.length < Nbodies){ - nodePool.push(this.createNode()); - } - nodes.length = Nbodies; - for (var i = 0; i < Nbodies; i++) { - nodes[i] = nodePool[i]; - } - - // Reset node values - for(var i=0; i!==Nbodies; i++){ - var node = nodes[i]; - node.body = bodies[i]; - node.children.length = 0; - node.eqs.length = 0; - node.visited = false; - } - for(var k=0; k!==Neq; k++){ - var eq=equations[k], - i=bodies.indexOf(eq.bi), - j=bodies.indexOf(eq.bj), - ni=nodes[i], - nj=nodes[j]; - ni.children.push(nj); - ni.eqs.push(eq); - nj.children.push(ni); - nj.eqs.push(eq); - } - - var child, n=0, eqs=SplitSolver_solve_eqs; - - subsolver.tolerance = this.tolerance; - subsolver.iterations = this.iterations; - - var dummyWorld = SplitSolver_solve_dummyWorld; - while((child = getUnvisitedNode(nodes))){ - eqs.length = 0; - dummyWorld.bodies.length = 0; - bfs(child, visitFunc, dummyWorld.bodies, eqs); - - var Neqs = eqs.length; - - eqs = eqs.sort(sortById); - - for(var i=0; i!==Neqs; i++){ - subsolver.addEquation(eqs[i]); - } - - var iter = subsolver.solve(dt,dummyWorld); - subsolver.removeAllEquations(); - n++; - } - - return n; -}; - -function sortById(a, b){ - return b.id - a.id; -} -},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"./Solver":47}],49:[function(_dereq_,module,exports){ -/** - * Base class for objects that dispatches events. - * @class EventTarget - * @constructor - */ -var EventTarget = function () { - -}; - -module.exports = EventTarget; - -EventTarget.prototype = { - constructor: EventTarget, - - /** - * Add an event listener - * @method addEventListener - * @param {String} type - * @param {Function} listener - * @return {EventTarget} The self object, for chainability. - */ - addEventListener: function ( type, listener ) { - if ( this._listeners === undefined ){ this._listeners = {}; } - var listeners = this._listeners; - if ( listeners[ type ] === undefined ) { - listeners[ type ] = []; - } - if ( listeners[ type ].indexOf( listener ) === - 1 ) { - listeners[ type ].push( listener ); - } - return this; - }, - - /** - * Check if an event listener is added - * @method hasEventListener - * @param {String} type - * @param {Function} listener - * @return {Boolean} - */ - hasEventListener: function ( type, listener ) { - if ( this._listeners === undefined ){ return false; } - var listeners = this._listeners; - if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) { - return true; - } - return false; - }, - - /** - * Remove an event listener - * @method removeEventListener - * @param {String} type - * @param {Function} listener - * @return {EventTarget} The self object, for chainability. - */ - removeEventListener: function ( type, listener ) { - if ( this._listeners === undefined ){ return this; } - var listeners = this._listeners; - if ( listeners[type] === undefined ){ return this; } - var index = listeners[ type ].indexOf( listener ); - if ( index !== - 1 ) { - listeners[ type ].splice( index, 1 ); - } - return this; - }, - - /** - * Emit an event. - * @method dispatchEvent - * @param {Object} event - * @param {String} event.type - * @return {EventTarget} The self object, for chainability. - */ - dispatchEvent: function ( event ) { - if ( this._listeners === undefined ){ return this; } - var listeners = this._listeners; - var listenerArray = listeners[ event.type ]; - if ( listenerArray !== undefined ) { - event.target = this; - for ( var i = 0, l = listenerArray.length; i < l; i ++ ) { - listenerArray[ i ].call( this, event ); - } - } - return this; - } -}; - -},{}],50:[function(_dereq_,module,exports){ -var AABB = _dereq_('../collision/AABB'); -var Vec3 = _dereq_('../math/Vec3'); - -module.exports = Octree; - -/** - * @class OctreeNode - * @param {object} [options] - * @param {Octree} [options.root] - * @param {AABB} [options.aabb] - */ -function OctreeNode(options){ - options = options || {}; - - /** - * The root node - * @property {OctreeNode} root - */ - this.root = options.root || null; - - /** - * Boundary of this node - * @property {AABB} aabb - */ - this.aabb = options.aabb ? options.aabb.clone() : new AABB(); - - /** - * Contained data at the current node level. - * @property {Array} data - */ - this.data = []; - - /** - * Children to this node - * @property {Array} children - */ - this.children = []; -} - -/** - * @class Octree - * @param {AABB} aabb The total AABB of the tree - * @param {object} [options] - * @param {number} [options.maxDepth=8] - * @extends OctreeNode - */ -function Octree(aabb, options){ - options = options || {}; - options.root = null; - options.aabb = aabb; - OctreeNode.call(this, options); - - /** - * Maximum subdivision depth - * @property {number} maxDepth - */ - this.maxDepth = typeof(options.maxDepth) !== 'undefined' ? options.maxDepth : 8; -} -Octree.prototype = new OctreeNode(); - -OctreeNode.prototype.reset = function(aabb, options){ - this.children.length = this.data.length = 0; -}; - -/** - * Insert data into this node - * @method insert - * @param {AABB} aabb - * @param {object} elementData - * @return {boolean} True if successful, otherwise false - */ -OctreeNode.prototype.insert = function(aabb, elementData, level){ - var nodeData = this.data; - level = level || 0; - - // Ignore objects that do not belong in this node - if (!this.aabb.contains(aabb)){ - return false; // object cannot be added - } - - var children = this.children; - - if(level < (this.maxDepth || this.root.maxDepth)){ - // Subdivide if there are no children yet - var subdivided = false; - if (!children.length){ - this.subdivide(); - subdivided = true; - } - - // add to whichever node will accept it - for (var i = 0; i !== 8; i++) { - if (children[i].insert(aabb, elementData, level + 1)){ - return true; - } - } - - if(subdivided){ - // No children accepted! Might as well just remove em since they contain none - children.length = 0; - } - } - - // Too deep, or children didnt want it. add it in current node - nodeData.push(elementData); - - return true; -}; - -var halfDiagonal = new Vec3(); - -/** - * Create 8 equally sized children nodes and put them in the .children array. - * @method subdivide - */ -OctreeNode.prototype.subdivide = function() { - var aabb = this.aabb; - var l = aabb.lowerBound; - var u = aabb.upperBound; - - var children = this.children; - - children.push( - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,0,0) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,0,0) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,1,0) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,1,1) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,1,1) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,0,1) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,0,1) }) }), - new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,1,0) }) }) - ); - - u.vsub(l, halfDiagonal); - halfDiagonal.scale(0.5, halfDiagonal); - - var root = this.root || this; - - for (var i = 0; i !== 8; i++) { - var child = children[i]; - - // Set current node as root - child.root = root; - - // Compute bounds - var lowerBound = child.aabb.lowerBound; - lowerBound.x *= halfDiagonal.x; - lowerBound.y *= halfDiagonal.y; - lowerBound.z *= halfDiagonal.z; - - lowerBound.vadd(l, lowerBound); - - // Upper bound is always lower bound + halfDiagonal - lowerBound.vadd(halfDiagonal, child.aabb.upperBound); - } -}; - -/** - * Get all data, potentially within an AABB - * @method aabbQuery - * @param {AABB} aabb - * @param {array} result - * @return {array} The "result" object - */ -OctreeNode.prototype.aabbQuery = function(aabb, result) { - - var nodeData = this.data; - - // abort if the range does not intersect this node - // if (!this.aabb.overlaps(aabb)){ - // return result; - // } - - // Add objects at this level - // Array.prototype.push.apply(result, nodeData); - - // Add child data - // @todo unwrap recursion into a queue / loop, that's faster in JS - var children = this.children; - - - // for (var i = 0, N = this.children.length; i !== N; i++) { - // children[i].aabbQuery(aabb, result); - // } - - var queue = [this]; - while (queue.length) { - var node = queue.pop(); - if (node.aabb.overlaps(aabb)){ - Array.prototype.push.apply(result, node.data); - } - Array.prototype.push.apply(queue, node.children); - } - - return result; -}; - -var tmpAABB = new AABB(); - -/** - * Get all data, potentially intersected by a ray. - * @method rayQuery - * @param {Ray} ray - * @param {Transform} treeTransform - * @param {array} result - * @return {array} The "result" object - */ -OctreeNode.prototype.rayQuery = function(ray, treeTransform, result) { - - // Use aabb query for now. - // @todo implement real ray query which needs less lookups - ray.getAABB(tmpAABB); - tmpAABB.toLocalFrame(treeTransform, tmpAABB); - this.aabbQuery(tmpAABB, result); - - return result; -}; - -/** - * @method removeEmptyNodes - */ -OctreeNode.prototype.removeEmptyNodes = function() { - var queue = [this]; - while (queue.length) { - var node = queue.pop(); - for (var i = node.children.length - 1; i >= 0; i--) { - if(!node.children[i].data.length){ - node.children.splice(i, 1); - } - } - Array.prototype.push.apply(queue, node.children); - } -}; - -},{"../collision/AABB":3,"../math/Vec3":30}],51:[function(_dereq_,module,exports){ -module.exports = Pool; - -/** - * For pooling objects that can be reused. - * @class Pool - * @constructor - */ -function Pool(){ - /** - * The pooled objects - * @property {Array} objects - */ - this.objects = []; - - /** - * Constructor of the objects - * @property {mixed} type - */ - this.type = Object; -} - -/** - * Release an object after use - * @method release - * @param {Object} obj - */ -Pool.prototype.release = function(){ - var Nargs = arguments.length; - for(var i=0; i!==Nargs; i++){ - this.objects.push(arguments[i]); - } -}; - -/** - * Get an object - * @method get - * @return {mixed} - */ -Pool.prototype.get = function(){ - if(this.objects.length===0){ - return this.constructObject(); - } else { - return this.objects.pop(); - } -}; - -/** - * Construct an object. Should be implmented in each subclass. - * @method constructObject - * @return {mixed} - */ -Pool.prototype.constructObject = function(){ - throw new Error("constructObject() not implemented in this Pool subclass yet!"); -}; - -},{}],52:[function(_dereq_,module,exports){ -module.exports = TupleDictionary; - -/** - * @class TupleDictionary - * @constructor - */ -function TupleDictionary() { - - /** - * The data storage - * @property data - * @type {Object} - */ - this.data = { keys:[] }; -} - -/** - * @method get - * @param {Number} i - * @param {Number} j - * @return {Number} - */ -TupleDictionary.prototype.get = function(i, j) { - if (i > j) { - // swap - var temp = j; - j = i; - i = temp; - } - return this.data[i+'-'+j]; -}; - -/** - * @method set - * @param {Number} i - * @param {Number} j - * @param {Number} value - */ -TupleDictionary.prototype.set = function(i, j, value) { - if (i > j) { - var temp = j; - j = i; - i = temp; - } - var key = i+'-'+j; - - // Check if key already exists - if(!this.get(i,j)){ - this.data.keys.push(key); - } - - this.data[key] = value; -}; - -/** - * @method reset - */ -TupleDictionary.prototype.reset = function() { - var data = this.data, - keys = data.keys; - while(keys.length > 0){ - var key = keys.pop(); - delete data[key]; - } -}; - -},{}],53:[function(_dereq_,module,exports){ -function Utils(){} - -module.exports = Utils; - -/** - * Extend an options object with default values. - * @static - * @method defaults - * @param {object} options The options object. May be falsy: in this case, a new object is created and returned. - * @param {object} defaults An object containing default values. - * @return {object} The modified options object. - */ -Utils.defaults = function(options, defaults){ - options = options || {}; - - for(var key in defaults){ - if(!(key in options)){ - options[key] = defaults[key]; - } - } - - return options; -}; - -},{}],54:[function(_dereq_,module,exports){ -module.exports = Vec3Pool; - -var Vec3 = _dereq_('../math/Vec3'); -var Pool = _dereq_('./Pool'); - -/** - * @class Vec3Pool - * @constructor - * @extends Pool - */ -function Vec3Pool(){ - Pool.call(this); - this.type = Vec3; -} -Vec3Pool.prototype = new Pool(); - -/** - * Construct a vector - * @method constructObject - * @return {Vec3} - */ -Vec3Pool.prototype.constructObject = function(){ - return new Vec3(); -}; - -},{"../math/Vec3":30,"./Pool":51}],55:[function(_dereq_,module,exports){ -module.exports = Narrowphase; - -var AABB = _dereq_('../collision/AABB'); -var Shape = _dereq_('../shapes/Shape'); -var Ray = _dereq_('../collision/Ray'); -var Vec3 = _dereq_('../math/Vec3'); -var Transform = _dereq_('../math/Transform'); -var ConvexPolyhedron = _dereq_('../shapes/ConvexPolyhedron'); -var Quaternion = _dereq_('../math/Quaternion'); -var Solver = _dereq_('../solver/Solver'); -var Vec3Pool = _dereq_('../utils/Vec3Pool'); -var ContactEquation = _dereq_('../equations/ContactEquation'); -var FrictionEquation = _dereq_('../equations/FrictionEquation'); - -/** - * Helper class for the World. Generates ContactEquations. - * @class Narrowphase - * @constructor - * @todo Sphere-ConvexPolyhedron contacts - * @todo Contact reduction - * @todo should move methods to prototype - */ -function Narrowphase(world){ - - /** - * Internal storage of pooled contact points. - * @property {Array} contactPointPool - */ - this.contactPointPool = []; - - this.frictionEquationPool = []; - - this.result = []; - this.frictionResult = []; - - /** - * Pooled vectors. - * @property {Vec3Pool} v3pool - */ - this.v3pool = new Vec3Pool(); - - this.world = world; - this.currentContactMaterial = null; - - /** - * @property {Boolean} enableFrictionReduction - */ - this.enableFrictionReduction = false; -} - -/** - * Make a contact object, by using the internal pool or creating a new one. - * @method createContactEquation - * @return {ContactEquation} - */ -Narrowphase.prototype.createContactEquation = function(bi, bj, si, sj, rsi, rsj){ - var c; - if(this.contactPointPool.length){ - c = this.contactPointPool.pop(); - c.bi = bi; - c.bj = bj; - } else { - c = new ContactEquation(bi, bj); - } - - c.enabled = bi.collisionResponse && bj.collisionResponse && si.collisionResponse && sj.collisionResponse; - - var cm = this.currentContactMaterial; - - c.restitution = cm.restitution; - - c.setSpookParams( - cm.contactEquationStiffness, - cm.contactEquationRelaxation, - this.world.dt - ); - - var matA = si.material || bi.material; - var matB = sj.material || bj.material; - if(matA && matB && matA.restitution >= 0 && matB.restitution >= 0){ - c.restitution = matA.restitution * matB.restitution; - } - - c.si = rsi || si; - c.sj = rsj || sj; - - return c; -}; - -Narrowphase.prototype.createFrictionEquationsFromContact = function(contactEquation, outArray){ - var bodyA = contactEquation.bi; - var bodyB = contactEquation.bj; - var shapeA = contactEquation.si; - var shapeB = contactEquation.sj; - - var world = this.world; - var cm = this.currentContactMaterial; - - // If friction or restitution were specified in the material, use them - var friction = cm.friction; - var matA = shapeA.material || bodyA.material; - var matB = shapeB.material || bodyB.material; - if(matA && matB && matA.friction >= 0 && matB.friction >= 0){ - friction = matA.friction * matB.friction; - } - - if(friction > 0){ - - // Create 2 tangent equations - var mug = friction * world.gravity.length(); - var reducedMass = (bodyA.invMass + bodyB.invMass); - if(reducedMass > 0){ - reducedMass = 1/reducedMass; - } - var pool = this.frictionEquationPool; - var c1 = pool.length ? pool.pop() : new FrictionEquation(bodyA,bodyB,mug*reducedMass); - var c2 = pool.length ? pool.pop() : new FrictionEquation(bodyA,bodyB,mug*reducedMass); - - c1.bi = c2.bi = bodyA; - c1.bj = c2.bj = bodyB; - c1.minForce = c2.minForce = -mug*reducedMass; - c1.maxForce = c2.maxForce = mug*reducedMass; - - // Copy over the relative vectors - c1.ri.copy(contactEquation.ri); - c1.rj.copy(contactEquation.rj); - c2.ri.copy(contactEquation.ri); - c2.rj.copy(contactEquation.rj); - - // Construct tangents - contactEquation.ni.tangents(c1.t, c2.t); - - // Set spook params - c1.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, world.dt); - c2.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, world.dt); - - c1.enabled = c2.enabled = contactEquation.enabled; - - outArray.push(c1, c2); - - return true; - } - - return false; -}; - -var averageNormal = new Vec3(); -var averageContactPointA = new Vec3(); -var averageContactPointB = new Vec3(); - -// Take the average N latest contact point on the plane. -Narrowphase.prototype.createFrictionFromAverage = function(numContacts){ - // The last contactEquation - var c = this.result[this.result.length - 1]; - - // Create the result: two "average" friction equations - if (!this.createFrictionEquationsFromContact(c, this.frictionResult) || numContacts === 1) { - return; - } - - var f1 = this.frictionResult[this.frictionResult.length - 2]; - var f2 = this.frictionResult[this.frictionResult.length - 1]; - - averageNormal.setZero(); - averageContactPointA.setZero(); - averageContactPointB.setZero(); - - var bodyA = c.bi; - var bodyB = c.bj; - for(var i=0; i!==numContacts; i++){ - c = this.result[this.result.length - 1 - i]; - if(c.bodyA !== bodyA){ - averageNormal.vadd(c.ni, averageNormal); // vec2.add(eq.t, eq.t, c.normalA); - averageContactPointA.vadd(c.ri, averageContactPointA); // vec2.add(eq.contactPointA, eq.contactPointA, c.contactPointA); - averageContactPointB.vadd(c.rj, averageContactPointB); - } else { - averageNormal.vsub(c.ni, averageNormal); // vec2.sub(eq.t, eq.t, c.normalA); - averageContactPointA.vadd(c.rj, averageContactPointA); // vec2.add(eq.contactPointA, eq.contactPointA, c.contactPointA); - averageContactPointB.vadd(c.ri, averageContactPointB); - } - } - - var invNumContacts = 1 / numContacts; - averageContactPointA.scale(invNumContacts, f1.ri); // vec2.scale(eq.contactPointA, eq.contactPointA, invNumContacts); - averageContactPointB.scale(invNumContacts, f1.rj); // vec2.scale(eq.contactPointB, eq.contactPointB, invNumContacts); - f2.ri.copy(f1.ri); // Should be the same - f2.rj.copy(f1.rj); - averageNormal.normalize(); - averageNormal.tangents(f1.t, f2.t); - // return eq; -}; - - -var tmpVec1 = new Vec3(); -var tmpVec2 = new Vec3(); -var tmpQuat1 = new Quaternion(); -var tmpQuat2 = new Quaternion(); - -/** - * Generate all contacts between a list of body pairs - * @method getContacts - * @param {array} p1 Array of body indices - * @param {array} p2 Array of body indices - * @param {World} world - * @param {array} result Array to store generated contacts - * @param {array} oldcontacts Optional. Array of reusable contact objects - */ -Narrowphase.prototype.getContacts = function(p1, p2, world, result, oldcontacts, frictionResult, frictionPool){ - // Save old contact objects - this.contactPointPool = oldcontacts; - this.frictionEquationPool = frictionPool; - this.result = result; - this.frictionResult = frictionResult; - - var qi = tmpQuat1; - var qj = tmpQuat2; - var xi = tmpVec1; - var xj = tmpVec2; - - for(var k=0, N=p1.length; k!==N; k++){ - - // Get current collision bodies - var bi = p1[k], - bj = p2[k]; - - // Get contact material - var bodyContactMaterial = null; - if(bi.material && bj.material){ - bodyContactMaterial = world.getContactMaterial(bi.material,bj.material) || null; - } - - for (var i = 0; i < bi.shapes.length; i++) { - bi.quaternion.mult(bi.shapeOrientations[i], qi); - bi.quaternion.vmult(bi.shapeOffsets[i], xi); - xi.vadd(bi.position, xi); - var si = bi.shapes[i]; - - for (var j = 0; j < bj.shapes.length; j++) { - - // Compute world transform of shapes - bj.quaternion.mult(bj.shapeOrientations[j], qj); - bj.quaternion.vmult(bj.shapeOffsets[j], xj); - xj.vadd(bj.position, xj); - var sj = bj.shapes[j]; - - if(xi.distanceTo(xj) > si.boundingSphereRadius + sj.boundingSphereRadius){ - continue; - } - - // Get collision material - var shapeContactMaterial = null; - if(si.material && sj.material){ - shapeContactMaterial = world.getContactMaterial(si.material,sj.material) || null; - } - - this.currentContactMaterial = shapeContactMaterial || bodyContactMaterial || world.defaultContactMaterial; - - // Get contacts - var resolver = this[si.type | sj.type]; - if(resolver){ - if (si.type < sj.type) { - resolver.call(this, si, sj, xi, xj, qi, qj, bi, bj, si, sj); - } else { - resolver.call(this, sj, si, xj, xi, qj, qi, bj, bi, si, sj); - } - } - } - } - } -}; - -var numWarnings = 0; -var maxWarnings = 10; - -function warn(msg){ - if(numWarnings > maxWarnings){ - return; - } - - numWarnings++; - - console.warn(msg); -} - -Narrowphase.prototype[Shape.types.BOX | Shape.types.BOX] = -Narrowphase.prototype.boxBox = function(si,sj,xi,xj,qi,qj,bi,bj){ - si.convexPolyhedronRepresentation.material = si.material; - sj.convexPolyhedronRepresentation.material = sj.material; - si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; - sj.convexPolyhedronRepresentation.collisionResponse = sj.collisionResponse; - this.convexConvex(si.convexPolyhedronRepresentation,sj.convexPolyhedronRepresentation,xi,xj,qi,qj,bi,bj,si,sj); -}; - -Narrowphase.prototype[Shape.types.BOX | Shape.types.CONVEXPOLYHEDRON] = -Narrowphase.prototype.boxConvex = function(si,sj,xi,xj,qi,qj,bi,bj){ - si.convexPolyhedronRepresentation.material = si.material; - si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; - this.convexConvex(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj); -}; - -Narrowphase.prototype[Shape.types.BOX | Shape.types.PARTICLE] = -Narrowphase.prototype.boxParticle = function(si,sj,xi,xj,qi,qj,bi,bj){ - si.convexPolyhedronRepresentation.material = si.material; - si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; - this.convexParticle(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj); -}; - -/** - * @method sphereSphere - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.SPHERE] = -Narrowphase.prototype.sphereSphere = function(si,sj,xi,xj,qi,qj,bi,bj){ - // We will have only one contact in this case - var r = this.createContactEquation(bi,bj,si,sj); - - // Contact normal - xj.vsub(xi, r.ni); - r.ni.normalize(); - - // Contact point locations - r.ri.copy(r.ni); - r.rj.copy(r.ni); - r.ri.mult(si.radius, r.ri); - r.rj.mult(-sj.radius, r.rj); - - r.ri.vadd(xi, r.ri); - r.ri.vsub(bi.position, r.ri); - - r.rj.vadd(xj, r.rj); - r.rj.vsub(bj.position, r.rj); - - this.result.push(r); - - this.createFrictionEquationsFromContact(r, this.frictionResult); -}; - -/** - * @method planeTrimesh - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -var planeTrimesh_normal = new Vec3(); -var planeTrimesh_relpos = new Vec3(); -var planeTrimesh_projected = new Vec3(); -Narrowphase.prototype[Shape.types.PLANE | Shape.types.TRIMESH] = -Narrowphase.prototype.planeTrimesh = function( - planeShape, - trimeshShape, - planePos, - trimeshPos, - planeQuat, - trimeshQuat, - planeBody, - trimeshBody -){ - // Make contacts! - var v = new Vec3(); - - var normal = planeTrimesh_normal; - normal.set(0,0,1); - planeQuat.vmult(normal,normal); // Turn normal according to plane - - for(var i=0; i 0 && positionAlongEdgeB < 0){ - - // Now check the orthogonal distance from edge to sphere center - localSpherePos.vsub(edgeVertexA, tmp); - - edgeVectorUnit.copy(edgeVector); - edgeVectorUnit.normalize(); - positionAlongEdgeA = tmp.dot(edgeVectorUnit); - - edgeVectorUnit.scale(positionAlongEdgeA, tmp); - tmp.vadd(edgeVertexA, tmp); - - // tmp is now the sphere center position projected to the edge, defined locally in the trimesh frame - var dist = tmp.distanceTo(localSpherePos); - if(dist < sphereShape.radius){ - var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape); - - tmp.vsub(localSpherePos, r.ni); - r.ni.normalize(); - r.ni.scale(sphereShape.radius, r.ri); - - Transform.pointToWorldFrame(trimeshPos, trimeshQuat, tmp, tmp); - tmp.vsub(trimeshBody.position, r.rj); - - Transform.vectorToWorldFrame(trimeshQuat, r.ni, r.ni); - Transform.vectorToWorldFrame(trimeshQuat, r.ri, r.ri); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } - } - } - } - - // Triangle faces - var va = sphereTrimesh_va; - var vb = sphereTrimesh_vb; - var vc = sphereTrimesh_vc; - var normal = sphereTrimesh_normal; - for(var i=0, N = triangles.length; i !== N; i++){ - trimeshShape.getTriangleVertices(triangles[i], va, vb, vc); - trimeshShape.getNormal(triangles[i], normal); - localSpherePos.vsub(va, tmp); - var dist = tmp.dot(normal); - normal.scale(dist, tmp); - localSpherePos.vsub(tmp, tmp); - - // tmp is now the sphere position projected to the triangle plane - dist = tmp.distanceTo(localSpherePos); - if(Ray.pointInTriangle(tmp, va, vb, vc) && dist < sphereShape.radius){ - var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape); - - tmp.vsub(localSpherePos, r.ni); - r.ni.normalize(); - r.ni.scale(sphereShape.radius, r.ri); - - Transform.pointToWorldFrame(trimeshPos, trimeshQuat, tmp, tmp); - tmp.vsub(trimeshBody.position, r.rj); - - Transform.vectorToWorldFrame(trimeshQuat, r.ni, r.ni); - Transform.vectorToWorldFrame(trimeshQuat, r.ri, r.ri); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } - } - - triangles.length = 0; -}; - -var point_on_plane_to_sphere = new Vec3(); -var plane_to_sphere_ortho = new Vec3(); - -/** - * @method spherePlane - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.SPHERE | Shape.types.PLANE] = -Narrowphase.prototype.spherePlane = function(si,sj,xi,xj,qi,qj,bi,bj){ - // We will have one contact in this case - var r = this.createContactEquation(bi,bj,si,sj); - - // Contact normal - r.ni.set(0,0,1); - qj.vmult(r.ni, r.ni); - r.ni.negate(r.ni); // body i is the sphere, flip normal - r.ni.normalize(); // Needed? - - // Vector from sphere center to contact point - r.ni.mult(si.radius, r.ri); - - // Project down sphere on plane - xi.vsub(xj, point_on_plane_to_sphere); - r.ni.mult(r.ni.dot(point_on_plane_to_sphere), plane_to_sphere_ortho); - point_on_plane_to_sphere.vsub(plane_to_sphere_ortho,r.rj); // The sphere position projected to plane - - if(-point_on_plane_to_sphere.dot(r.ni) <= si.radius){ - - // Make it relative to the body - var ri = r.ri; - var rj = r.rj; - ri.vadd(xi, ri); - ri.vsub(bi.position, ri); - rj.vadd(xj, rj); - rj.vsub(bj.position, rj); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } -}; - -// See http://bulletphysics.com/Bullet/BulletFull/SphereTriangleDetector_8cpp_source.html -var pointInPolygon_edge = new Vec3(); -var pointInPolygon_edge_x_normal = new Vec3(); -var pointInPolygon_vtp = new Vec3(); -function pointInPolygon(verts, normal, p){ - var positiveResult = null; - var N = verts.length; - for(var i=0; i!==N; i++){ - var v = verts[i]; - - // Get edge to the next vertex - var edge = pointInPolygon_edge; - verts[(i+1) % (N)].vsub(v,edge); - - // Get cross product between polygon normal and the edge - var edge_x_normal = pointInPolygon_edge_x_normal; - //var edge_x_normal = new Vec3(); - edge.cross(normal,edge_x_normal); - - // Get vector between point and current vertex - var vertex_to_p = pointInPolygon_vtp; - p.vsub(v,vertex_to_p); - - // This dot product determines which side of the edge the point is - var r = edge_x_normal.dot(vertex_to_p); - - // If all such dot products have same sign, we are inside the polygon. - if(positiveResult===null || (r>0 && positiveResult===true) || (r<=0 && positiveResult===false)){ - if(positiveResult===null){ - positiveResult = r>0; - } - continue; - } else { - return false; // Encountered some other sign. Exit. - } - } - - // If we got here, all dot products were of the same sign. - return true; -} - -var box_to_sphere = new Vec3(); -var sphereBox_ns = new Vec3(); -var sphereBox_ns1 = new Vec3(); -var sphereBox_ns2 = new Vec3(); -var sphereBox_sides = [new Vec3(),new Vec3(),new Vec3(),new Vec3(),new Vec3(),new Vec3()]; -var sphereBox_sphere_to_corner = new Vec3(); -var sphereBox_side_ns = new Vec3(); -var sphereBox_side_ns1 = new Vec3(); -var sphereBox_side_ns2 = new Vec3(); - -/** - * @method sphereBox - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.SPHERE | Shape.types.BOX] = -Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj){ - var v3pool = this.v3pool; - - // we refer to the box as body j - var sides = sphereBox_sides; - xi.vsub(xj,box_to_sphere); - sj.getSideNormals(sides,qj); - var R = si.radius; - var penetrating_sides = []; - - // Check side (plane) intersections - var found = false; - - // Store the resulting side penetration info - var side_ns = sphereBox_side_ns; - var side_ns1 = sphereBox_side_ns1; - var side_ns2 = sphereBox_side_ns2; - var side_h = null; - var side_penetrations = 0; - var side_dot1 = 0; - var side_dot2 = 0; - var side_distance = null; - for(var idx=0,nsides=sides.length; idx!==nsides && found===false; idx++){ - // Get the plane side normal (ns) - var ns = sphereBox_ns; - ns.copy(sides[idx]); - - var h = ns.norm(); - ns.normalize(); - - // The normal/distance dot product tells which side of the plane we are - var dot = box_to_sphere.dot(ns); - - if(dot0){ - // Intersects plane. Now check the other two dimensions - var ns1 = sphereBox_ns1; - var ns2 = sphereBox_ns2; - ns1.copy(sides[(idx+1)%3]); - ns2.copy(sides[(idx+2)%3]); - var h1 = ns1.norm(); - var h2 = ns2.norm(); - ns1.normalize(); - ns2.normalize(); - var dot1 = box_to_sphere.dot(ns1); - var dot2 = box_to_sphere.dot(ns2); - if(dot1

-h1 && dot2

-h2){ - var dist = Math.abs(dot-h-R); - if(side_distance===null || dist < side_distance){ - side_distance = dist; - side_dot1 = dot1; - side_dot2 = dot2; - side_h = h; - side_ns.copy(ns); - side_ns1.copy(ns1); - side_ns2.copy(ns2); - side_penetrations++; - } - } - } - } - if(side_penetrations){ - found = true; - var r = this.createContactEquation(bi,bj,si,sj); - side_ns.mult(-R,r.ri); // Sphere r - r.ni.copy(side_ns); - r.ni.negate(r.ni); // Normal should be out of sphere - side_ns.mult(side_h,side_ns); - side_ns1.mult(side_dot1,side_ns1); - side_ns.vadd(side_ns1,side_ns); - side_ns2.mult(side_dot2,side_ns2); - side_ns.vadd(side_ns2,r.rj); - - // Make relative to bodies - r.ri.vadd(xi, r.ri); - r.ri.vsub(bi.position, r.ri); - r.rj.vadd(xj, r.rj); - r.rj.vsub(bj.position, r.rj); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } - - // Check corners - var rj = v3pool.get(); - var sphere_to_corner = sphereBox_sphere_to_corner; - for(var j=0; j!==2 && !found; j++){ - for(var k=0; k!==2 && !found; k++){ - for(var l=0; l!==2 && !found; l++){ - rj.set(0,0,0); - if(j){ - rj.vadd(sides[0],rj); - } else { - rj.vsub(sides[0],rj); - } - if(k){ - rj.vadd(sides[1],rj); - } else { - rj.vsub(sides[1],rj); - } - if(l){ - rj.vadd(sides[2],rj); - } else { - rj.vsub(sides[2],rj); - } - - // World position of corner - xj.vadd(rj,sphere_to_corner); - sphere_to_corner.vsub(xi,sphere_to_corner); - - if(sphere_to_corner.norm2() < R*R){ - found = true; - var r = this.createContactEquation(bi,bj,si,sj); - r.ri.copy(sphere_to_corner); - r.ri.normalize(); - r.ni.copy(r.ri); - r.ri.mult(R,r.ri); - r.rj.copy(rj); - - // Make relative to bodies - r.ri.vadd(xi, r.ri); - r.ri.vsub(bi.position, r.ri); - r.rj.vadd(xj, r.rj); - r.rj.vsub(bj.position, r.rj); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } - } - } - } - v3pool.release(rj); - rj = null; - - // Check edges - var edgeTangent = v3pool.get(); - var edgeCenter = v3pool.get(); - var r = v3pool.get(); // r = edge center to sphere center - var orthogonal = v3pool.get(); - var dist = v3pool.get(); - var Nsides = sides.length; - for(var j=0; j!==Nsides && !found; j++){ - for(var k=0; k!==Nsides && !found; k++){ - if(j%3 !== k%3){ - // Get edge tangent - sides[k].cross(sides[j],edgeTangent); - edgeTangent.normalize(); - sides[j].vadd(sides[k], edgeCenter); - r.copy(xi); - r.vsub(edgeCenter,r); - r.vsub(xj,r); - var orthonorm = r.dot(edgeTangent); // distance from edge center to sphere center in the tangent direction - edgeTangent.mult(orthonorm,orthogonal); // Vector from edge center to sphere center in the tangent direction - - // Find the third side orthogonal to this one - var l = 0; - while(l===j%3 || l===k%3){ - l++; - } - - // vec from edge center to sphere projected to the plane orthogonal to the edge tangent - dist.copy(xi); - dist.vsub(orthogonal,dist); - dist.vsub(edgeCenter,dist); - dist.vsub(xj,dist); - - // Distances in tangent direction and distance in the plane orthogonal to it - var tdist = Math.abs(orthonorm); - var ndist = dist.norm(); - - if(tdist < sides[l].norm() && ndist si.boundingSphereRadius + sj.boundingSphereRadius){ - // return; - // } - - // Check corners - for(var i=0; i!==verts.length; i++){ - var v = verts[i]; - - // World position of corner - var worldCorner = sphereConvex_worldCorner; - qj.vmult(v,worldCorner); - xj.vadd(worldCorner,worldCorner); - var sphere_to_corner = sphereConvex_sphereToCorner; - worldCorner.vsub(xi, sphere_to_corner); - if(sphere_to_corner.norm2() < R * R){ - found = true; - var r = this.createContactEquation(bi,bj,si,sj); - r.ri.copy(sphere_to_corner); - r.ri.normalize(); - r.ni.copy(r.ri); - r.ri.mult(R,r.ri); - worldCorner.vsub(xj,r.rj); - - // Should be relative to the body. - r.ri.vadd(xi, r.ri); - r.ri.vsub(bi.position, r.ri); - - // Should be relative to the body. - r.rj.vadd(xj, r.rj); - r.rj.vsub(bj.position, r.rj); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - return; - } - } - - // Check side (plane) intersections - var found = false; - for(var i=0, nfaces=faces.length; i!==nfaces && found===false; i++){ - var normal = normals[i]; - var face = faces[i]; - - // Get world-transformed normal of the face - var worldNormal = sphereConvex_worldNormal; - qj.vmult(normal,worldNormal); - - // Get a world vertex from the face - var worldPoint = sphereConvex_worldPoint; - qj.vmult(verts[face[0]],worldPoint); - worldPoint.vadd(xj,worldPoint); - - // Get a point on the sphere, closest to the face normal - var worldSpherePointClosestToPlane = sphereConvex_worldSpherePointClosestToPlane; - worldNormal.mult(-R, worldSpherePointClosestToPlane); - xi.vadd(worldSpherePointClosestToPlane, worldSpherePointClosestToPlane); - - // Vector from a face point to the closest point on the sphere - var penetrationVec = sphereConvex_penetrationVec; - worldSpherePointClosestToPlane.vsub(worldPoint,penetrationVec); - - // The penetration. Negative value means overlap. - var penetration = penetrationVec.dot(worldNormal); - - var worldPointToSphere = sphereConvex_sphereToWorldPoint; - xi.vsub(worldPoint, worldPointToSphere); - - if(penetration < 0 && worldPointToSphere.dot(worldNormal)>0){ - // Intersects plane. Now check if the sphere is inside the face polygon - var faceVerts = []; // Face vertices, in world coords - for(var j=0, Nverts=face.length; j!==Nverts; j++){ - var worldVertex = v3pool.get(); - qj.vmult(verts[face[j]], worldVertex); - xj.vadd(worldVertex,worldVertex); - faceVerts.push(worldVertex); - } - - if(pointInPolygon(faceVerts,worldNormal,xi)){ // Is the sphere center in the face polygon? - found = true; - var r = this.createContactEquation(bi,bj,si,sj); - - worldNormal.mult(-R, r.ri); // Contact offset, from sphere center to contact - worldNormal.negate(r.ni); // Normal pointing out of sphere - - var penetrationVec2 = v3pool.get(); - worldNormal.mult(-penetration, penetrationVec2); - var penetrationSpherePoint = v3pool.get(); - worldNormal.mult(-R, penetrationSpherePoint); - - //xi.vsub(xj).vadd(penetrationSpherePoint).vadd(penetrationVec2 , r.rj); - xi.vsub(xj,r.rj); - r.rj.vadd(penetrationSpherePoint,r.rj); - r.rj.vadd(penetrationVec2 , r.rj); - - // Should be relative to the body. - r.rj.vadd(xj, r.rj); - r.rj.vsub(bj.position, r.rj); - - // Should be relative to the body. - r.ri.vadd(xi, r.ri); - r.ri.vsub(bi.position, r.ri); - - v3pool.release(penetrationVec2); - v3pool.release(penetrationSpherePoint); - - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - - // Release world vertices - for(var j=0, Nfaceverts=faceVerts.length; j!==Nfaceverts; j++){ - v3pool.release(faceVerts[j]); - } - - return; // We only expect *one* face contact - } else { - // Edge? - for(var j=0; j!==face.length; j++){ - - // Get two world transformed vertices - var v1 = v3pool.get(); - var v2 = v3pool.get(); - qj.vmult(verts[face[(j+1)%face.length]], v1); - qj.vmult(verts[face[(j+2)%face.length]], v2); - xj.vadd(v1, v1); - xj.vadd(v2, v2); - - // Construct edge vector - var edge = sphereConvex_edge; - v2.vsub(v1,edge); - - // Construct the same vector, but normalized - var edgeUnit = sphereConvex_edgeUnit; - edge.unit(edgeUnit); - - // p is xi projected onto the edge - var p = v3pool.get(); - var v1_to_xi = v3pool.get(); - xi.vsub(v1, v1_to_xi); - var dot = v1_to_xi.dot(edgeUnit); - edgeUnit.mult(dot, p); - p.vadd(v1, p); - - // Compute a vector from p to the center of the sphere - var xi_to_p = v3pool.get(); - p.vsub(xi, xi_to_p); - - // Collision if the edge-sphere distance is less than the radius - // AND if p is in between v1 and v2 - if(dot > 0 && dot*dot si.boundingSphereRadius + sj.boundingSphereRadius){ - return; - } - - if(si.findSeparatingAxis(sj,xi,qi,xj,qj,sepAxis,faceListA,faceListB)){ - var res = []; - var q = convexConvex_q; - si.clipAgainstHull(xi,qi,sj,xj,qj,sepAxis,-100,100,res); - var numContacts = 0; - for(var j = 0; j !== res.length; j++){ - var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj), - ri = r.ri, - rj = r.rj; - sepAxis.negate(r.ni); - res[j].normal.negate(q); - q.mult(res[j].depth, q); - res[j].point.vadd(q, ri); - rj.copy(res[j].point); - - // Contact points are in world coordinates. Transform back to relative - ri.vsub(xi,ri); - rj.vsub(xj,rj); - - // Make relative to bodies - ri.vadd(xi, ri); - ri.vsub(bi.position, ri); - rj.vadd(xj, rj); - rj.vsub(bj.position, rj); - - this.result.push(r); - numContacts++; - if(!this.enableFrictionReduction){ - this.createFrictionEquationsFromContact(r, this.frictionResult); - } - } - if(this.enableFrictionReduction && numContacts){ - this.createFrictionFromAverage(numContacts); - } - } -}; - - -/** - * @method convexTrimesh - * @param {Array} result - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -// Narrowphase.prototype[Shape.types.CONVEXPOLYHEDRON | Shape.types.TRIMESH] = -// Narrowphase.prototype.convexTrimesh = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,faceListA,faceListB){ -// var sepAxis = convexConvex_sepAxis; - -// if(xi.distanceTo(xj) > si.boundingSphereRadius + sj.boundingSphereRadius){ -// return; -// } - -// // Construct a temp hull for each triangle -// var hullB = new ConvexPolyhedron(); - -// hullB.faces = [[0,1,2]]; -// var va = new Vec3(); -// var vb = new Vec3(); -// var vc = new Vec3(); -// hullB.vertices = [ -// va, -// vb, -// vc -// ]; - -// for (var i = 0; i < sj.indices.length / 3; i++) { - -// var triangleNormal = new Vec3(); -// sj.getNormal(i, triangleNormal); -// hullB.faceNormals = [triangleNormal]; - -// sj.getTriangleVertices(i, va, vb, vc); - -// var d = si.testSepAxis(triangleNormal, hullB, xi, qi, xj, qj); -// if(!d){ -// triangleNormal.scale(-1, triangleNormal); -// d = si.testSepAxis(triangleNormal, hullB, xi, qi, xj, qj); - -// if(!d){ -// continue; -// } -// } - -// var res = []; -// var q = convexConvex_q; -// si.clipAgainstHull(xi,qi,hullB,xj,qj,triangleNormal,-100,100,res); -// for(var j = 0; j !== res.length; j++){ -// var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj), -// ri = r.ri, -// rj = r.rj; -// r.ni.copy(triangleNormal); -// r.ni.negate(r.ni); -// res[j].normal.negate(q); -// q.mult(res[j].depth, q); -// res[j].point.vadd(q, ri); -// rj.copy(res[j].point); - -// // Contact points are in world coordinates. Transform back to relative -// ri.vsub(xi,ri); -// rj.vsub(xj,rj); - -// // Make relative to bodies -// ri.vadd(xi, ri); -// ri.vsub(bi.position, ri); -// rj.vadd(xj, rj); -// rj.vsub(bj.position, rj); - -// result.push(r); -// } -// } -// }; - -var particlePlane_normal = new Vec3(); -var particlePlane_relpos = new Vec3(); -var particlePlane_projected = new Vec3(); - -/** - * @method particlePlane - * @param {Array} result - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.PLANE | Shape.types.PARTICLE] = -Narrowphase.prototype.planeParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ - var normal = particlePlane_normal; - normal.set(0,0,1); - bj.quaternion.vmult(normal,normal); // Turn normal according to plane orientation - var relpos = particlePlane_relpos; - xi.vsub(bj.position,relpos); - var dot = normal.dot(relpos); - if(dot <= 0.0){ - var r = this.createContactEquation(bi,bj,si,sj); - r.ni.copy(normal); // Contact normal is the plane normal - r.ni.negate(r.ni); - r.ri.set(0,0,0); // Center of particle - - // Get particle position projected on plane - var projected = particlePlane_projected; - normal.mult(normal.dot(xi),projected); - xi.vsub(projected,projected); - //projected.vadd(bj.position,projected); - - // rj is now the projected world position minus plane position - r.rj.copy(projected); - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } -}; - -var particleSphere_normal = new Vec3(); - -/** - * @method particleSphere - * @param {Array} result - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.SPHERE] = -Narrowphase.prototype.sphereParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ - // The normal is the unit vector from sphere center to particle center - var normal = particleSphere_normal; - normal.set(0,0,1); - xi.vsub(xj,normal); - var lengthSquared = normal.norm2(); - - if(lengthSquared <= sj.radius * sj.radius){ - var r = this.createContactEquation(bi,bj,si,sj); - normal.normalize(); - r.rj.copy(normal); - r.rj.mult(sj.radius,r.rj); - r.ni.copy(normal); // Contact normal - r.ni.negate(r.ni); - r.ri.set(0,0,0); // Center of particle - this.result.push(r); - this.createFrictionEquationsFromContact(r, this.frictionResult); - } -}; - -// WIP -var cqj = new Quaternion(); -var convexParticle_local = new Vec3(); -var convexParticle_normal = new Vec3(); -var convexParticle_penetratedFaceNormal = new Vec3(); -var convexParticle_vertexToParticle = new Vec3(); -var convexParticle_worldPenetrationVec = new Vec3(); - -/** - * @method convexParticle - * @param {Array} result - * @param {Shape} si - * @param {Shape} sj - * @param {Vec3} xi - * @param {Vec3} xj - * @param {Quaternion} qi - * @param {Quaternion} qj - * @param {Body} bi - * @param {Body} bj - */ -Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.CONVEXPOLYHEDRON] = -Narrowphase.prototype.convexParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ - var penetratedFaceIndex = -1; - var penetratedFaceNormal = convexParticle_penetratedFaceNormal; - var worldPenetrationVec = convexParticle_worldPenetrationVec; - var minPenetration = null; - var numDetectedFaces = 0; - - // Convert particle position xi to local coords in the convex - var local = convexParticle_local; - local.copy(xi); - local.vsub(xj,local); // Convert position to relative the convex origin - qj.conjugate(cqj); - cqj.vmult(local,local); - - if(sj.pointIsInside(local)){ - - if(sj.worldVerticesNeedsUpdate){ - sj.computeWorldVertices(xj,qj); - } - if(sj.worldFaceNormalsNeedsUpdate){ - sj.computeWorldFaceNormals(qj); - } - - // For each world polygon in the polyhedra - for(var i=0,nfaces=sj.faces.length; i!==nfaces; i++){ - - // Construct world face vertices - var verts = [ sj.worldVertices[ sj.faces[i][0] ] ]; - var normal = sj.worldFaceNormals[i]; - - // Check how much the particle penetrates the polygon plane. - xi.vsub(verts[0],convexParticle_vertexToParticle); - var penetration = -normal.dot(convexParticle_vertexToParticle); - if(minPenetration===null || Math.abs(penetration) data.length || iMinY > data[0].length){ - return; - } - - // Clamp index to edges - if(iMinX < 0){ iMinX = 0; } - if(iMaxX < 0){ iMaxX = 0; } - if(iMinY < 0){ iMinY = 0; } - if(iMaxY < 0){ iMaxY = 0; } - if(iMinX >= data.length){ iMinX = data.length - 1; } - if(iMaxX >= data.length){ iMaxX = data.length - 1; } - if(iMaxY >= data[0].length){ iMaxY = data[0].length - 1; } - if(iMinY >= data[0].length){ iMinY = data[0].length - 1; } - - var minMax = []; - hfShape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); - var min = minMax[0]; - var max = minMax[1]; - - // Bail out if we're cant touch the bounding height box - if(localConvexPos.z - radius > max || localConvexPos.z + radius < min){ - return; - } - - for(var i = iMinX; i < iMaxX; i++){ - for(var j = iMinY; j < iMaxY; j++){ - - // Lower triangle - hfShape.getConvexTrianglePillar(i, j, false); - Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); - if (convexPos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + convexShape.boundingSphereRadius) { - this.convexConvex(convexShape, hfShape.pillarConvex, convexPos, worldPillarOffset, convexQuat, hfQuat, convexBody, hfBody, null, null, faceList, null); - } - - // Upper triangle - hfShape.getConvexTrianglePillar(i, j, true); - Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); - if (convexPos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + convexShape.boundingSphereRadius) { - this.convexConvex(convexShape, hfShape.pillarConvex, convexPos, worldPillarOffset, convexQuat, hfQuat, convexBody, hfBody, null, null, faceList, null); - } - } - } -}; - -var sphereHeightfield_tmp1 = new Vec3(); -var sphereHeightfield_tmp2 = new Vec3(); - -/** - * @method sphereHeightfield - */ -Narrowphase.prototype[Shape.types.SPHERE | Shape.types.HEIGHTFIELD] = -Narrowphase.prototype.sphereHeightfield = function ( - sphereShape, - hfShape, - spherePos, - hfPos, - sphereQuat, - hfQuat, - sphereBody, - hfBody -){ - var data = hfShape.data, - radius = sphereShape.radius, - w = hfShape.elementSize, - worldPillarOffset = sphereHeightfield_tmp2; - - // Get sphere position to heightfield local! - var localSpherePos = sphereHeightfield_tmp1; - Transform.pointToLocalFrame(hfPos, hfQuat, spherePos, localSpherePos); - - // Get the index of the data points to test against - var iMinX = Math.floor((localSpherePos.x - radius) / w) - 1, - iMaxX = Math.ceil((localSpherePos.x + radius) / w) + 1, - iMinY = Math.floor((localSpherePos.y - radius) / w) - 1, - iMaxY = Math.ceil((localSpherePos.y + radius) / w) + 1; - - // Bail out if we are out of the terrain - if(iMaxX < 0 || iMaxY < 0 || iMinX > data.length || iMaxY > data[0].length){ - return; - } - - // Clamp index to edges - if(iMinX < 0){ iMinX = 0; } - if(iMaxX < 0){ iMaxX = 0; } - if(iMinY < 0){ iMinY = 0; } - if(iMaxY < 0){ iMaxY = 0; } - if(iMinX >= data.length){ iMinX = data.length - 1; } - if(iMaxX >= data.length){ iMaxX = data.length - 1; } - if(iMaxY >= data[0].length){ iMaxY = data[0].length - 1; } - if(iMinY >= data[0].length){ iMinY = data[0].length - 1; } - - var minMax = []; - hfShape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); - var min = minMax[0]; - var max = minMax[1]; - - // Bail out if we're cant touch the bounding height box - if(localSpherePos.z - radius > max || localSpherePos.z + radius < min){ - return; - } - - var result = this.result; - for(var i = iMinX; i < iMaxX; i++){ - for(var j = iMinY; j < iMaxY; j++){ - - var numContactsBefore = result.length; - - // Lower triangle - hfShape.getConvexTrianglePillar(i, j, false); - Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); - if (spherePos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + sphereShape.boundingSphereRadius) { - this.sphereConvex(sphereShape, hfShape.pillarConvex, spherePos, worldPillarOffset, sphereQuat, hfQuat, sphereBody, hfBody); - } - - // Upper triangle - hfShape.getConvexTrianglePillar(i, j, true); - Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); - if (spherePos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + sphereShape.boundingSphereRadius) { - this.sphereConvex(sphereShape, hfShape.pillarConvex, spherePos, worldPillarOffset, sphereQuat, hfQuat, sphereBody, hfBody); - } - - var numContacts = result.length - numContactsBefore; - - if(numContacts > 2){ - return; - } - /* - // Skip all but 1 - for (var k = 0; k < numContacts - 1; k++) { - result.pop(); - } - */ - } - } -}; - -},{"../collision/AABB":3,"../collision/Ray":9,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../shapes/ConvexPolyhedron":38,"../shapes/Shape":43,"../solver/Solver":47,"../utils/Vec3Pool":54}],56:[function(_dereq_,module,exports){ -/* global performance */ - -module.exports = World; - -var Shape = _dereq_('../shapes/Shape'); -var Vec3 = _dereq_('../math/Vec3'); -var Quaternion = _dereq_('../math/Quaternion'); -var GSSolver = _dereq_('../solver/GSSolver'); -var Vec3Pool = _dereq_('../utils/Vec3Pool'); -var ContactEquation = _dereq_('../equations/ContactEquation'); -var FrictionEquation = _dereq_('../equations/FrictionEquation'); -var Narrowphase = _dereq_('./Narrowphase'); -var EventTarget = _dereq_('../utils/EventTarget'); -var ArrayCollisionMatrix = _dereq_('../collision/ArrayCollisionMatrix'); -var Material = _dereq_('../material/Material'); -var ContactMaterial = _dereq_('../material/ContactMaterial'); -var Body = _dereq_('../objects/Body'); -var TupleDictionary = _dereq_('../utils/TupleDictionary'); -var RaycastResult = _dereq_('../collision/RaycastResult'); -var AABB = _dereq_('../collision/AABB'); -var Ray = _dereq_('../collision/Ray'); -var NaiveBroadphase = _dereq_('../collision/NaiveBroadphase'); - -/** - * The physics world - * @class World - * @constructor - * @extends EventTarget - */ -function World(){ - EventTarget.apply(this); - - /** - * Currently / last used timestep. Is set to -1 if not available. This value is updated before each internal step, which means that it is "fresh" inside event callbacks. - * @property {Number} dt - */ - this.dt = -1; - - /** - * Makes bodies go to sleep when they've been inactive - * @property allowSleep - * @type {Boolean} - */ - this.allowSleep = false; - - /** - * All the current contacts (instances of ContactEquation) in the world. - * @property contacts - * @type {Array} - */ - this.contacts = []; - this.frictionEquations = []; - - /** - * How often to normalize quaternions. Set to 0 for every step, 1 for every second etc.. A larger value increases performance. If bodies tend to explode, set to a smaller value (zero to be sure nothing can go wrong). - * @property quatNormalizeSkip - * @type {Number} - */ - this.quatNormalizeSkip = 0; - - /** - * Set to true to use fast quaternion normalization. It is often enough accurate to use. If bodies tend to explode, set to false. - * @property quatNormalizeFast - * @type {Boolean} - * @see Quaternion.normalizeFast - * @see Quaternion.normalize - */ - this.quatNormalizeFast = false; - - /** - * The wall-clock time since simulation start - * @property time - * @type {Number} - */ - this.time = 0.0; - - /** - * Number of timesteps taken since start - * @property stepnumber - * @type {Number} - */ - this.stepnumber = 0; - - /// Default and last timestep sizes - this.default_dt = 1/60; - - this.nextId = 0; - /** - * @property gravity - * @type {Vec3} - */ - this.gravity = new Vec3(); - - /** - * @property broadphase - * @type {Broadphase} - */ - this.broadphase = new NaiveBroadphase(); - - /** - * @property bodies - * @type {Array} - */ - this.bodies = []; - - /** - * @property solver - * @type {Solver} - */ - this.solver = new GSSolver(); - - /** - * @property constraints - * @type {Array} - */ - this.constraints = []; - - /** - * @property narrowphase - * @type {Narrowphase} - */ - this.narrowphase = new Narrowphase(this); - - /** - * @property {ArrayCollisionMatrix} collisionMatrix - * @type {ArrayCollisionMatrix} - */ - this.collisionMatrix = new ArrayCollisionMatrix(); - - /** - * CollisionMatrix from the previous step. - * @property {ArrayCollisionMatrix} collisionMatrixPrevious - * @type {ArrayCollisionMatrix} - */ - this.collisionMatrixPrevious = new ArrayCollisionMatrix(); - - /** - * All added materials - * @property materials - * @type {Array} - */ - this.materials = []; - - /** - * @property contactmaterials - * @type {Array} - */ - this.contactmaterials = []; - - /** - * Used to look up a ContactMaterial given two instances of Material. - * @property {TupleDictionary} contactMaterialTable - */ - this.contactMaterialTable = new TupleDictionary(); - - this.defaultMaterial = new Material("default"); - - /** - * This contact material is used if no suitable contactmaterial is found for a contact. - * @property defaultContactMaterial - * @type {ContactMaterial} - */ - this.defaultContactMaterial = new ContactMaterial(this.defaultMaterial, this.defaultMaterial, { friction: 0.3, restitution: 0.0 }); - - /** - * @property doProfiling - * @type {Boolean} - */ - this.doProfiling = false; - - /** - * @property profile - * @type {Object} - */ - this.profile = { - solve:0, - makeContactConstraints:0, - broadphase:0, - integrate:0, - narrowphase:0, - }; - - /** - * @property subsystems - * @type {Array} - */ - this.subsystems = []; - - this.addBodyEvent = { - type:"addBody", - body : null, - }; - - this.removeBodyEvent = { - type:"removeBody", - body : null, - }; -} -World.prototype = new EventTarget(); - -// Temp stuff -var tmpAABB1 = new AABB(); -var tmpArray1 = []; -var tmpRay = new Ray(); - -/** - * Get the contact material between materials m1 and m2 - * @method getContactMaterial - * @param {Material} m1 - * @param {Material} m2 - * @return {ContactMaterial} The contact material if it was found. - */ -World.prototype.getContactMaterial = function(m1,m2){ - return this.contactMaterialTable.get(m1.id,m2.id); //this.contactmaterials[this.mats2cmat[i+j*this.materials.length]]; -}; - -/** - * Get number of objects in the world. - * @method numObjects - * @return {Number} - * @deprecated - */ -World.prototype.numObjects = function(){ - return this.bodies.length; -}; - -/** - * Store old collision state info - * @method collisionMatrixTick - */ -World.prototype.collisionMatrixTick = function(){ - var temp = this.collisionMatrixPrevious; - this.collisionMatrixPrevious = this.collisionMatrix; - this.collisionMatrix = temp; - this.collisionMatrix.reset(); -}; - -/** - * Add a rigid body to the simulation. - * @method add - * @param {Body} body - * @todo If the simulation has not yet started, why recrete and copy arrays for each body? Accumulate in dynamic arrays in this case. - * @todo Adding an array of bodies should be possible. This would save some loops too - * @deprecated Use .addBody instead - */ -World.prototype.add = World.prototype.addBody = function(body){ - if(this.bodies.indexOf(body) !== -1){ - return; - } - body.index = this.bodies.length; - this.bodies.push(body); - body.world = this; - body.initPosition.copy(body.position); - body.initVelocity.copy(body.velocity); - body.timeLastSleepy = this.time; - if(body instanceof Body){ - body.initAngularVelocity.copy(body.angularVelocity); - body.initQuaternion.copy(body.quaternion); - } - this.collisionMatrix.setNumObjects(this.bodies.length); - this.addBodyEvent.body = body; - this.dispatchEvent(this.addBodyEvent); -}; - -/** - * Add a constraint to the simulation. - * @method addConstraint - * @param {Constraint} c - */ -World.prototype.addConstraint = function(c){ - this.constraints.push(c); -}; - -/** - * Removes a constraint - * @method removeConstraint - * @param {Constraint} c - */ -World.prototype.removeConstraint = function(c){ - var idx = this.constraints.indexOf(c); - if(idx!==-1){ - this.constraints.splice(idx,1); - } -}; - -/** - * Raycast test - * @method rayTest - * @param {Vec3} from - * @param {Vec3} to - * @param {Function|RaycastResult} result - * @deprecated Use .raycastAll, .raycastClosest or .raycastAny instead. - */ -World.prototype.rayTest = function(from, to, result){ - if(result instanceof RaycastResult){ - // Do raycastclosest - this.raycastClosest(from, to, { - skipBackfaces: true - }, result); - } else { - // Do raycastAll - this.raycastAll(from, to, { - skipBackfaces: true - }, result); - } -}; - -/** - * Ray cast against all bodies. The provided callback will be executed for each hit with a RaycastResult as single argument. - * @method raycastAll - * @param {Vec3} from - * @param {Vec3} to - * @param {Object} options - * @param {number} [options.collisionFilterMask=-1] - * @param {number} [options.collisionFilterGroup=-1] - * @param {boolean} [options.skipBackfaces=false] - * @param {boolean} [options.checkCollisionResponse=true] - * @param {Function} callback - * @return {boolean} True if any body was hit. - */ -World.prototype.raycastAll = function(from, to, options, callback){ - options.mode = Ray.ALL; - options.from = from; - options.to = to; - options.callback = callback; - return tmpRay.intersectWorld(this, options); -}; - -/** - * Ray cast, and stop at the first result. Note that the order is random - but the method is fast. - * @method raycastAny - * @param {Vec3} from - * @param {Vec3} to - * @param {Object} options - * @param {number} [options.collisionFilterMask=-1] - * @param {number} [options.collisionFilterGroup=-1] - * @param {boolean} [options.skipBackfaces=false] - * @param {boolean} [options.checkCollisionResponse=true] - * @param {RaycastResult} result - * @return {boolean} True if any body was hit. - */ -World.prototype.raycastAny = function(from, to, options, result){ - options.mode = Ray.ANY; - options.from = from; - options.to = to; - options.result = result; - return tmpRay.intersectWorld(this, options); -}; - -/** - * Ray cast, and return information of the closest hit. - * @method raycastClosest - * @param {Vec3} from - * @param {Vec3} to - * @param {Object} options - * @param {number} [options.collisionFilterMask=-1] - * @param {number} [options.collisionFilterGroup=-1] - * @param {boolean} [options.skipBackfaces=false] - * @param {boolean} [options.checkCollisionResponse=true] - * @param {RaycastResult} result - * @return {boolean} True if any body was hit. - */ -World.prototype.raycastClosest = function(from, to, options, result){ - options.mode = Ray.CLOSEST; - options.from = from; - options.to = to; - options.result = result; - return tmpRay.intersectWorld(this, options); -}; - -/** - * Remove a rigid body from the simulation. - * @method remove - * @param {Body} body - * @deprecated Use .removeBody instead - */ -World.prototype.remove = function(body){ - body.world = null; - var n = this.bodies.length-1, - bodies = this.bodies, - idx = bodies.indexOf(body); - if(idx !== -1){ - bodies.splice(idx, 1); // Todo: should use a garbage free method - - // Recompute index - for(var i=0; i!==bodies.length; i++){ - bodies[i].index = i; - } - - this.collisionMatrix.setNumObjects(n); - this.removeBodyEvent.body = body; - this.dispatchEvent(this.removeBodyEvent); - } -}; - -/** - * Remove a rigid body from the simulation. - * @method removeBody - * @param {Body} body - */ -World.prototype.removeBody = World.prototype.remove; - -/** - * Adds a material to the World. - * @method addMaterial - * @param {Material} m - * @todo Necessary? - */ -World.prototype.addMaterial = function(m){ - this.materials.push(m); -}; - -/** - * Adds a contact material to the World - * @method addContactMaterial - * @param {ContactMaterial} cmat - */ -World.prototype.addContactMaterial = function(cmat) { - - // Add contact material - this.contactmaterials.push(cmat); - - // Add current contact material to the material table - this.contactMaterialTable.set(cmat.materials[0].id,cmat.materials[1].id,cmat); -}; - -// performance.now() -if(typeof performance === 'undefined'){ - performance = {}; -} -if(!performance.now){ - var nowOffset = Date.now(); - if (performance.timing && performance.timing.navigationStart){ - nowOffset = performance.timing.navigationStart; - } - performance.now = function(){ - return Date.now() - nowOffset; - }; -} - -var step_tmp1 = new Vec3(); - -/** - * Step the physics world forward in time. - * - * There are two modes. The simple mode is fixed timestepping without interpolation. In this case you only use the first argument. The second case uses interpolation. In that you also provide the time since the function was last used, as well as the maximum fixed timesteps to take. - * - * @method step - * @param {Number} dt The fixed time step size to use. - * @param {Number} [timeSinceLastCalled] The time elapsed since the function was last called. - * @param {Number} [maxSubSteps=10] Maximum number of fixed steps to take per function call. - * - * @example - * // fixed timestepping without interpolation - * world.step(1/60); - * - * @see http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World - */ -World.prototype.step = function(dt, timeSinceLastCalled, maxSubSteps){ - maxSubSteps = maxSubSteps || 10; - timeSinceLastCalled = timeSinceLastCalled || 0; - - if(timeSinceLastCalled === 0){ // Fixed, simple stepping - - this.internalStep(dt); - - // Increment time - this.time += dt; - - } else { - - // Compute the number of fixed steps we should have taken since the last step - var internalSteps = Math.floor((this.time + timeSinceLastCalled) / dt) - Math.floor(this.time / dt); - internalSteps = Math.min(internalSteps,maxSubSteps); - - // Do some fixed steps to catch up - var t0 = performance.now(); - for(var i=0; i!==internalSteps; i++){ - this.internalStep(dt); - if(performance.now() - t0 > dt * 1000){ - // We are slower than real-time. Better bail out. - break; - } - } - - // Increment internal clock - this.time += timeSinceLastCalled; - - // Compute "Left over" time step - var h = this.time % dt; - var h_div_dt = h / dt; - var interpvelo = step_tmp1; - var bodies = this.bodies; - - for(var j=0; j !== bodies.length; j++){ - var b = bodies[j]; - if(b.type !== Body.STATIC && b.sleepState !== Body.SLEEPING){ - - // Interpolate - b.position.vsub(b.previousPosition, interpvelo); - interpvelo.scale(h_div_dt, interpvelo); - b.position.vadd(interpvelo, b.interpolatedPosition); - - // TODO: interpolate quaternion - // b.interpolatedAngle = b.angle + (b.angle - b.previousAngle) * h_div_dt; - - } else { - - // For static bodies, just copy. Who else will do it? - b.interpolatedPosition.copy(b.position); - b.interpolatedQuaternion.copy(b.quaternion); - } - } - } -}; - -/** - * Step the simulation - * @method step - * @param {Number} dt - */ -var World_step_postStepEvent = {type:"postStep"}, // Reusable event objects to save memory - World_step_preStepEvent = {type:"preStep"}, - World_step_collideEvent = {type:"collide", body:null, contact:null }, - World_step_oldContacts = [], // Pools for unused objects - World_step_frictionEquationPool = [], - World_step_p1 = [], // Reusable arrays for collision pairs - World_step_p2 = [], - World_step_gvec = new Vec3(), // Temporary vectors and quats - World_step_vi = new Vec3(), - World_step_vj = new Vec3(), - World_step_wi = new Vec3(), - World_step_wj = new Vec3(), - World_step_t1 = new Vec3(), - World_step_t2 = new Vec3(), - World_step_rixn = new Vec3(), - World_step_rjxn = new Vec3(), - World_step_step_q = new Quaternion(), - World_step_step_w = new Quaternion(), - World_step_step_wq = new Quaternion(), - invI_tau_dt = new Vec3(); -World.prototype.internalStep = function(dt){ - this.dt = dt; - - var world = this, - that = this, - contacts = this.contacts, - p1 = World_step_p1, - p2 = World_step_p2, - N = this.numObjects(), - bodies = this.bodies, - solver = this.solver, - gravity = this.gravity, - doProfiling = this.doProfiling, - profile = this.profile, - DYNAMIC = Body.DYNAMIC, - profilingStart, - constraints = this.constraints, - frictionEquationPool = World_step_frictionEquationPool, - gnorm = gravity.norm(), - gx = gravity.x, - gy = gravity.y, - gz = gravity.z, - i=0; - - if(doProfiling){ - profilingStart = performance.now(); - } - - // Add gravity to all objects - for(i=0; i!==N; i++){ - var bi = bodies[i]; - if(bi.type & DYNAMIC){ // Only for dynamic bodies - var f = bi.force, m = bi.mass; - f.x += m*gx; - f.y += m*gy; - f.z += m*gz; - } - } - - // Update subsystems - for(var i=0, Nsubsystems=this.subsystems.length; i!==Nsubsystems; i++){ - this.subsystems[i].update(); - } - - // Collision detection - if(doProfiling){ profilingStart = performance.now(); } - p1.length = 0; // Clean up pair arrays from last step - p2.length = 0; - this.broadphase.collisionPairs(this,p1,p2); - if(doProfiling){ profile.broadphase = performance.now() - profilingStart; } - - // Remove constrained pairs with collideConnected == false - var Nconstraints = constraints.length; - for(i=0; i!==Nconstraints; i++){ - var c = constraints[i]; - if(!c.collideConnected){ - for(var j = p1.length-1; j>=0; j-=1){ - if( (c.bodyA === p1[j] && c.bodyB === p2[j]) || - (c.bodyB === p1[j] && c.bodyA === p2[j])){ - p1.splice(j, 1); - p2.splice(j, 1); - } - } - } - } - - this.collisionMatrixTick(); - - // Generate contacts - if(doProfiling){ profilingStart = performance.now(); } - var oldcontacts = World_step_oldContacts; - var NoldContacts = contacts.length; - - for(i=0; i!==NoldContacts; i++){ - oldcontacts.push(contacts[i]); - } - contacts.length = 0; - - // Transfer FrictionEquation from current list to the pool for reuse - var NoldFrictionEquations = this.frictionEquations.length; - for(i=0; i!==NoldFrictionEquations; i++){ - frictionEquationPool.push(this.frictionEquations[i]); - } - this.frictionEquations.length = 0; - - this.narrowphase.getContacts( - p1, - p2, - this, - contacts, - oldcontacts, // To be reused - this.frictionEquations, - frictionEquationPool - ); - - if(doProfiling){ - profile.narrowphase = performance.now() - profilingStart; - } - - // Loop over all collisions - if(doProfiling){ - profilingStart = performance.now(); - } - - // Add all friction eqs - for (var i = 0; i < this.frictionEquations.length; i++) { - solver.addEquation(this.frictionEquations[i]); - } - - var ncontacts = contacts.length; - for(var k=0; k!==ncontacts; k++){ - - // Current contact - var c = contacts[k]; - - // Get current collision indeces - var bi = c.bi, - bj = c.bj, - si = c.si, - sj = c.sj; - - // Get collision properties - var cm; - if(bi.material && bj.material){ - cm = this.getContactMaterial(bi.material,bj.material) || this.defaultContactMaterial; - } else { - cm = this.defaultContactMaterial; - } - - // c.enabled = bi.collisionResponse && bj.collisionResponse && si.collisionResponse && sj.collisionResponse; - - var mu = cm.friction; - // c.restitution = cm.restitution; - - // If friction or restitution were specified in the material, use them - if(bi.material && bj.material){ - if(bi.material.friction >= 0 && bj.material.friction >= 0){ - mu = bi.material.friction * bj.material.friction; - } - - if(bi.material.restitution >= 0 && bj.material.restitution >= 0){ - c.restitution = bi.material.restitution * bj.material.restitution; - } - } - - // c.setSpookParams( - // cm.contactEquationStiffness, - // cm.contactEquationRelaxation, - // dt - // ); - - solver.addEquation(c); - - // // Add friction constraint equation - // if(mu > 0){ - - // // Create 2 tangent equations - // var mug = mu * gnorm; - // var reducedMass = (bi.invMass + bj.invMass); - // if(reducedMass > 0){ - // reducedMass = 1/reducedMass; - // } - // var pool = frictionEquationPool; - // var c1 = pool.length ? pool.pop() : new FrictionEquation(bi,bj,mug*reducedMass); - // var c2 = pool.length ? pool.pop() : new FrictionEquation(bi,bj,mug*reducedMass); - // this.frictionEquations.push(c1, c2); - - // c1.bi = c2.bi = bi; - // c1.bj = c2.bj = bj; - // c1.minForce = c2.minForce = -mug*reducedMass; - // c1.maxForce = c2.maxForce = mug*reducedMass; - - // // Copy over the relative vectors - // c1.ri.copy(c.ri); - // c1.rj.copy(c.rj); - // c2.ri.copy(c.ri); - // c2.rj.copy(c.rj); - - // // Construct tangents - // c.ni.tangents(c1.t, c2.t); - - // // Set spook params - // c1.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, dt); - // c2.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, dt); - - // c1.enabled = c2.enabled = c.enabled; - - // // Add equations to solver - // solver.addEquation(c1); - // solver.addEquation(c2); - // } - - if( bi.allowSleep && - bi.type === Body.DYNAMIC && - bi.sleepState === Body.SLEEPING && - bj.sleepState === Body.AWAKE && - bj.type !== Body.STATIC - ){ - var speedSquaredB = bj.velocity.norm2() + bj.angularVelocity.norm2(); - var speedLimitSquaredB = Math.pow(bj.sleepSpeedLimit,2); - if(speedSquaredB >= speedLimitSquaredB*2){ - bi._wakeUpAfterNarrowphase = true; - } - } - - if( bj.allowSleep && - bj.type === Body.DYNAMIC && - bj.sleepState === Body.SLEEPING && - bi.sleepState === Body.AWAKE && - bi.type !== Body.STATIC - ){ - var speedSquaredA = bi.velocity.norm2() + bi.angularVelocity.norm2(); - var speedLimitSquaredA = Math.pow(bi.sleepSpeedLimit,2); - if(speedSquaredA >= speedLimitSquaredA*2){ - bj._wakeUpAfterNarrowphase = true; - } - } - - // Now we know that i and j are in contact. Set collision matrix state - this.collisionMatrix.set(bi, bj, true); - - if (!this.collisionMatrixPrevious.get(bi, bj)) { - // First contact! - // We reuse the collideEvent object, otherwise we will end up creating new objects for each new contact, even if there's no event listener attached. - World_step_collideEvent.body = bj; - World_step_collideEvent.contact = c; - bi.dispatchEvent(World_step_collideEvent); - - World_step_collideEvent.body = bi; - bj.dispatchEvent(World_step_collideEvent); - } - } - if(doProfiling){ - profile.makeContactConstraints = performance.now() - profilingStart; - profilingStart = performance.now(); - } - - // Wake up bodies - for(i=0; i!==N; i++){ - var bi = bodies[i]; - if(bi._wakeUpAfterNarrowphase){ - bi.wakeUp(); - bi._wakeUpAfterNarrowphase = false; - } - } - - // Add user-added constraints - var Nconstraints = constraints.length; - for(i=0; i!==Nconstraints; i++){ - var c = constraints[i]; - c.update(); - for(var j=0, Neq=c.equations.length; j!==Neq; j++){ - var eq = c.equations[j]; - solver.addEquation(eq); - } - } - - // Solve the constrained system - solver.solve(dt,this); - - if(doProfiling){ - profile.solve = performance.now() - profilingStart; - } - - // Remove all contacts from solver - solver.removeAllEquations(); - - // Apply damping, see http://code.google.com/p/bullet/issues/detail?id=74 for details - var pow = Math.pow; - for(i=0; i!==N; i++){ - var bi = bodies[i]; - if(bi.type & DYNAMIC){ // Only for dynamic bodies - var ld = pow(1.0 - bi.linearDamping,dt); - var v = bi.velocity; - v.mult(ld,v); - var av = bi.angularVelocity; - if(av){ - var ad = pow(1.0 - bi.angularDamping,dt); - av.mult(ad,av); - } - } - } - - this.dispatchEvent(World_step_preStepEvent); - - // Invoke pre-step callbacks - for(i=0; i!==N; i++){ - var bi = bodies[i]; - if(bi.preStep){ - bi.preStep.call(bi); - } - } - - // Leap frog - // vnew = v + h*f/m - // xnew = x + h*vnew - if(doProfiling){ - profilingStart = performance.now(); - } - var q = World_step_step_q; - var w = World_step_step_w; - var wq = World_step_step_wq; - var stepnumber = this.stepnumber; - var DYNAMIC_OR_KINEMATIC = Body.DYNAMIC | Body.KINEMATIC; - var quatNormalize = stepnumber % (this.quatNormalizeSkip+1) === 0; - var quatNormalizeFast = this.quatNormalizeFast; - var half_dt = dt * 0.5; - var PLANE = Shape.types.PLANE, - CONVEX = Shape.types.CONVEXPOLYHEDRON; - - for(i=0; i!==N; i++){ - var b = bodies[i], - force = b.force, - tau = b.torque; - if((b.type & DYNAMIC_OR_KINEMATIC) && b.sleepState !== Body.SLEEPING){ // Only for dynamic - var velo = b.velocity, - angularVelo = b.angularVelocity, - pos = b.position, - quat = b.quaternion, - invMass = b.invMass, - invInertia = b.invInertiaWorld; - - velo.x += force.x * invMass * dt; - velo.y += force.y * invMass * dt; - velo.z += force.z * invMass * dt; - - if(b.angularVelocity){ - invInertia.vmult(tau,invI_tau_dt); - invI_tau_dt.mult(dt,invI_tau_dt); - invI_tau_dt.vadd(angularVelo,angularVelo); - } - - // Use new velocity - leap frog - pos.x += velo.x * dt; - pos.y += velo.y * dt; - pos.z += velo.z * dt; - - if(b.angularVelocity){ - w.set(angularVelo.x, angularVelo.y, angularVelo.z, 0); - w.mult(quat,wq); - quat.x += half_dt * wq.x; - quat.y += half_dt * wq.y; - quat.z += half_dt * wq.z; - quat.w += half_dt * wq.w; - if(quatNormalize){ - if(quatNormalizeFast){ - quat.normalizeFast(); - } else { - quat.normalize(); - } - } - } - - if(b.aabb){ - b.aabbNeedsUpdate = true; - } - - // Update world inertia - if(b.updateInertiaWorld){ - b.updateInertiaWorld(); - } - } - } - this.clearForces(); - - this.broadphase.dirty = true; - - if(doProfiling){ - profile.integrate = performance.now() - profilingStart; - } - - // Update world time - this.time += dt; - this.stepnumber += 1; - - this.dispatchEvent(World_step_postStepEvent); - - // Invoke post-step callbacks - for(i=0; i!==N; i++){ - var bi = bodies[i]; - var postStep = bi.postStep; - if(postStep){ - postStep.call(bi); - } - } - - // Sleeping update - if(this.allowSleep){ - for(i=0; i!==N; i++){ - bodies[i].sleepTick(this.time); - } - } -}; - -/** - * Sets all body forces in the world to zero. - * @method clearForces - */ -World.prototype.clearForces = function(){ - var bodies = this.bodies; - var N = bodies.length; - for(var i=0; i !== N; i++){ - var b = bodies[i], - force = b.force, - tau = b.torque; - - b.force.set(0,0,0); - b.torque.set(0,0,0); - } -}; - -},{"../collision/AABB":3,"../collision/ArrayCollisionMatrix":4,"../collision/NaiveBroadphase":7,"../collision/Ray":9,"../collision/RaycastResult":10,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../material/ContactMaterial":24,"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Shape":43,"../solver/GSSolver":46,"../utils/EventTarget":49,"../utils/TupleDictionary":52,"../utils/Vec3Pool":54,"./Narrowphase":55}]},{},[2]) -(2) -}); \ No newline at end of file diff --git a/examples/js/lights/RectAreaLightUniformsLib.js b/examples/js/lights/RectAreaLightUniformsLib.js index 078806bb31fc1a..c00fb2d308e11d 100644 --- a/examples/js/lights/RectAreaLightUniformsLib.js +++ b/examples/js/lights/RectAreaLightUniformsLib.js @@ -34,13 +34,6 @@ THREE.RectAreaLightUniformsLib = { THREE.UniformsLib.LTC_1 = ltc_1; THREE.UniformsLib.LTC_2 = ltc_2; - // add ltc data textures to material uniforms - - var ltc = { ltc_1: { value: null }, ltc_2: { value: null } }; - - Object.assign( THREE.ShaderLib.standard.uniforms, ltc ); - Object.assign( THREE.ShaderLib.physical.uniforms, ltc ); - } }; diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index 170854499697dc..8ade0d6b51b524 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -488,7 +488,12 @@ THREE.GLTFLoader = ( function () { } - GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( /* materialIndex */ ) { + GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) { + + var parser = this.parser; + var materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; return THREE.MeshPhysicalMaterial; @@ -564,7 +569,12 @@ THREE.GLTFLoader = ( function () { } - GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( /* materialIndex */ ) { + GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( materialIndex ) { + + var parser = this.parser; + var materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; return THREE.MeshPhysicalMaterial; diff --git a/examples/jsm/exporters/ColladaExporter.js b/examples/jsm/exporters/ColladaExporter.js index 3638f100f40810..df0d7cf71e8071 100644 --- a/examples/jsm/exporters/ColladaExporter.js +++ b/examples/jsm/exporters/ColladaExporter.js @@ -109,8 +109,8 @@ ColladaExporter.prototype = { canvas = canvas || document.createElement( 'canvas' ); ctx = ctx || canvas.getContext( '2d' ); - canvas.width = image.naturalWidth; - canvas.height = image.naturalHeight; + canvas.width = image.width; + canvas.height = image.height; ctx.drawImage( image, 0, 0 ); diff --git a/examples/jsm/libs/cannon.module.min.js b/examples/jsm/libs/cannon.module.min.js deleted file mode 100644 index 91e141ca159188..00000000000000 --- a/examples/jsm/libs/cannon.module.min.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2015 cannon.js Authors - * - * 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. - */ - -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&false)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.CANNON=e()}}(function(){return function e(f,n,o){function d(t,l){if(!n[t]){if(!f[t]){var u="function"==typeof require&&require;if(!l&&u)return u(t,!0);if(i)return i(t,!0);throw new Error("Cannot find module '"+t+"'")}var p=n[t]={exports:{}};f[t][0].call(p.exports,function(e){var n=f[t][1][e];return d(n?n:e)},p,p.exports,e,f,n,o)}return n[t].exports}for(var i="function"==typeof require&&require,t=0;t (http://steffe.se)",keywords:["cannon.js","cannon","physics","engine","3d"],main:"./build/cannon.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/cannon.js.git"},bugs:{url:"https://github.com/schteppe/cannon.js/issues"},licenses:[{type:"MIT"}],devDependencies:{jshint:"latest","uglify-js":"latest",nodeunit:"^0.9.0",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"^0.5.1","grunt-browserify":"^2.1.4","grunt-contrib-yuidoc":"^0.5.2",browserify:"*"},dependencies:{}}},{}],2:[function(e,f){f.exports={version:e("../package.json").version,AABB:e("./collision/AABB"),ArrayCollisionMatrix:e("./collision/ArrayCollisionMatrix"),Body:e("./objects/Body"),Box:e("./shapes/Box"),Broadphase:e("./collision/Broadphase"),Constraint:e("./constraints/Constraint"),ContactEquation:e("./equations/ContactEquation"),Narrowphase:e("./world/Narrowphase"),ConeTwistConstraint:e("./constraints/ConeTwistConstraint"),ContactMaterial:e("./material/ContactMaterial"),ConvexPolyhedron:e("./shapes/ConvexPolyhedron"),Cylinder:e("./shapes/Cylinder"),DistanceConstraint:e("./constraints/DistanceConstraint"),Equation:e("./equations/Equation"),EventTarget:e("./utils/EventTarget"),FrictionEquation:e("./equations/FrictionEquation"),GSSolver:e("./solver/GSSolver"),GridBroadphase:e("./collision/GridBroadphase"),Heightfield:e("./shapes/Heightfield"),HingeConstraint:e("./constraints/HingeConstraint"),LockConstraint:e("./constraints/LockConstraint"),Mat3:e("./math/Mat3"),Material:e("./material/Material"),NaiveBroadphase:e("./collision/NaiveBroadphase"),ObjectCollisionMatrix:e("./collision/ObjectCollisionMatrix"),Pool:e("./utils/Pool"),Particle:e("./shapes/Particle"),Plane:e("./shapes/Plane"),PointToPointConstraint:e("./constraints/PointToPointConstraint"),Quaternion:e("./math/Quaternion"),Ray:e("./collision/Ray"),RaycastVehicle:e("./objects/RaycastVehicle"),RaycastResult:e("./collision/RaycastResult"),RigidVehicle:e("./objects/RigidVehicle"),RotationalEquation:e("./equations/RotationalEquation"),RotationalMotorEquation:e("./equations/RotationalMotorEquation"),SAPBroadphase:e("./collision/SAPBroadphase"),SPHSystem:e("./objects/SPHSystem"),Shape:e("./shapes/Shape"),Solver:e("./solver/Solver"),Sphere:e("./shapes/Sphere"),SplitSolver:e("./solver/SplitSolver"),Spring:e("./objects/Spring"),Trimesh:e("./shapes/Trimesh"),Vec3:e("./math/Vec3"),Vec3Pool:e("./utils/Vec3Pool"),World:e("./world/World")}},{"../package.json":1,"./collision/AABB":3,"./collision/ArrayCollisionMatrix":4,"./collision/Broadphase":5,"./collision/GridBroadphase":6,"./collision/NaiveBroadphase":7,"./collision/ObjectCollisionMatrix":8,"./collision/Ray":9,"./collision/RaycastResult":10,"./collision/SAPBroadphase":11,"./constraints/ConeTwistConstraint":12,"./constraints/Constraint":13,"./constraints/DistanceConstraint":14,"./constraints/HingeConstraint":15,"./constraints/LockConstraint":16,"./constraints/PointToPointConstraint":17,"./equations/ContactEquation":19,"./equations/Equation":20,"./equations/FrictionEquation":21,"./equations/RotationalEquation":22,"./equations/RotationalMotorEquation":23,"./material/ContactMaterial":24,"./material/Material":25,"./math/Mat3":27,"./math/Quaternion":28,"./math/Vec3":30,"./objects/Body":31,"./objects/RaycastVehicle":32,"./objects/RigidVehicle":33,"./objects/SPHSystem":34,"./objects/Spring":35,"./shapes/Box":37,"./shapes/ConvexPolyhedron":38,"./shapes/Cylinder":39,"./shapes/Heightfield":40,"./shapes/Particle":41,"./shapes/Plane":42,"./shapes/Shape":43,"./shapes/Sphere":44,"./shapes/Trimesh":45,"./solver/GSSolver":46,"./solver/Solver":47,"./solver/SplitSolver":48,"./utils/EventTarget":49,"./utils/Pool":51,"./utils/Vec3Pool":54,"./world/Narrowphase":55,"./world/World":56}],3:[function(e,f){function n(e){e=e||{},this.lowerBound=new o,e.lowerBound&&this.lowerBound.copy(e.lowerBound),this.upperBound=new o,e.upperBound&&this.upperBound.copy(e.upperBound)}{var o=e("../math/Vec3");e("../utils/Utils")}f.exports=n;var d=new o;n.prototype.setFromPoints=function(e,f,n,o){var i=this.lowerBound,t=this.upperBound,l=n;i.copy(e[0]),l&&l.vmult(i,i),t.copy(i);for(var u=1;ut.x&&(t.x=p.x),p.xt.y&&(t.y=p.y),p.yt.z&&(t.z=p.z),p.zf&&(this.lowerBound.x=f);var n=e.upperBound.x;this.upperBound.xf&&(this.lowerBound.y=f);var n=e.upperBound.y;this.upperBound.yf&&(this.lowerBound.z=f);var n=e.upperBound.z;this.upperBound.z=d.x&&f.y<=o.y&&n.y>=d.y&&f.z<=o.z&&n.z>=d.z},n.prototype.getCorners=function(e,f,n,o,d,i,t,l){var u=this.lowerBound,p=this.upperBound;e.copy(u),f.set(p.x,u.y,u.z),n.set(p.x,p.y,u.z),o.set(u.x,p.y,p.z),d.set(p.x,u.y,u.z),i.set(u.x,p.y,u.z),t.set(u.x,u.y,p.z),l.copy(p)};var i=[new o,new o,new o,new o,new o,new o,new o,new o];n.prototype.toLocalFrame=function(e,f){var n=i,o=n[0],d=n[1],t=n[2],l=n[3],u=n[4],p=n[5],s=n[6],y=n[7];this.getCorners(o,d,t,l,u,p,s,y);for(var c=0;8!==c;c++){var a=n[c];e.pointToLocal(a,a)}return f.setFromPoints(n)},n.prototype.toWorldFrame=function(e,f){var n=i,o=n[0],d=n[1],t=n[2],l=n[3],u=n[4],p=n[5],s=n[6],y=n[7];this.getCorners(o,d,t,l,u,p,s,y);for(var c=0;8!==c;c++){var a=n[c];e.pointToWorld(a,a)}return f.setFromPoints(n)}},{"../math/Vec3":30,"../utils/Utils":53}],4:[function(e,f){function n(){this.matrix=[]}f.exports=n,n.prototype.get=function(e,f){if(e=e.index,f=f.index,f>e){var n=f;f=e,e=n}return this.matrix[(e*(e+1)>>1)+f-1]},n.prototype.set=function(e,f,n){if(e=e.index,f=f.index,f>e){var o=f;f=e,e=o}this.matrix[(e*(e+1)>>1)+f-1]=n?1:0},n.prototype.reset=function(){for(var e=0,f=this.matrix.length;e!==f;e++)this.matrix[e]=0},n.prototype.setNumObjects=function(e){this.matrix.length=e*(e-1)>>1}},{}],5:[function(e,f){function n(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}{var o=e("../objects/Body"),d=e("../math/Vec3"),i=e("../math/Quaternion");e("../shapes/Shape"),e("../shapes/Plane")}f.exports=n,n.prototype.collisionPairs=function(){throw new Error("collisionPairs not implemented for this BroadPhase class!")};var t=o.STATIC|o.KINEMATIC;n.prototype.needBroadphaseCollision=function(e,f){return 0===(e.collisionFilterGroup&f.collisionFilterMask)||0===(f.collisionFilterGroup&e.collisionFilterMask)?!1:0===(e.type&t)&&e.sleepState!==o.SLEEPING||0===(f.type&t)&&f.sleepState!==o.SLEEPING?!0:!1},n.prototype.intersectionTest=function(e,f,n,o){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,f,n,o):this.doBoundingSphereBroadphase(e,f,n,o)};{var l=new d;new d,new i,new d}n.prototype.doBoundingSphereBroadphase=function(e,f,n,o){var d=l;f.position.vsub(e.position,d);var i=Math.pow(e.boundingRadius+f.boundingRadius,2),t=d.norm2();i>t&&(n.push(e),o.push(f))},n.prototype.doBoundingBoxBroadphase=function(e,f,n,o){e.aabbNeedsUpdate&&e.computeAABB(),f.aabbNeedsUpdate&&f.computeAABB(),e.aabb.overlaps(f.aabb)&&(n.push(e),o.push(f))};var u={keys:[]},p=[],s=[];n.prototype.makePairsUnique=function(e,f){for(var n=u,o=p,d=s,i=e.length,t=0;t!==i;t++)o[t]=e[t],d[t]=f[t];e.length=0,f.length=0;for(var t=0;t!==i;t++){var l=o[t].id,y=d[t].id,c=y>l?l+","+y:y+","+l;n[c]=t,n.keys.push(c)}for(var t=0;t!==n.keys.length;t++){var c=n.keys.pop(),a=n[c];e.push(o[a]),f.push(d[a]),delete n[c]}},n.prototype.setWorld=function(){};var y=new d;n.boundingSphereCheck=function(e,f){var n=y;return e.position.vsub(f.position,n),Math.pow(e.shape.boundingSphereRadius+f.shape.boundingSphereRadius,2)>n.norm2()},n.prototype.aabbQuery=function(){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Plane":42,"../shapes/Shape":43}],6:[function(e,f){function n(e,f,n,i,t){o.apply(this),this.nx=n||10,this.ny=i||10,this.nz=t||10,this.aabbMin=e||new d(100,100,100),this.aabbMax=f||new d(-100,-100,-100);var l=this.nx*this.ny*this.nz;if(0>=l)throw"GridBroadphase: Each dimension's n must be >0";this.bins=[],this.binLengths=[],this.bins.length=l,this.binLengths.length=l;for(var u=0;l>u;u++)this.bins[u]=[],this.binLengths[u]=0}f.exports=n;var o=e("./Broadphase"),d=e("../math/Vec3"),i=e("../shapes/Shape");n.prototype=new o,n.prototype.constructor=n;{var t=new d;new d}n.prototype.collisionPairs=function(e,f,n){function o(e,f,n,o,d,i,t){var l=(e-g)*v|0,u=(f-x)*A|0,p=(n-j)*C|0,b=I((o-g)*v),m=I((d-x)*A),N=I((i-j)*C);0>l?l=0:l>=s&&(l=s-1),0>u?u=0:u>=y&&(u=y-1),0>p?p=0:p>=c&&(p=c-1),0>b?b=0:b>=s&&(b=s-1),0>m?m=0:m>=y&&(m=y-1),0>N?N=0:N>=c&&(N=c-1),l*=a,u*=r,p*=w,b*=a,m*=r,N*=w;for(var O=l;b>=O;O+=a)for(var h=u;m>=h;h+=r)for(var k=p;N>=k;k+=w){var q=O+h+k;E[q][F[q]++]=t}}for(var d=e.numObjects(),l=e.bodies,u=this.aabbMax,p=this.aabbMin,s=this.nx,y=this.ny,c=this.nz,a=y*c,r=c,w=1,b=u.x,m=u.y,N=u.z,g=p.x,x=p.y,j=p.z,v=s/(b-g),A=y/(m-x),C=c/(N-j),O=(b-g)/s,h=(m-x)/y,k=(N-j)/c,q=.5*Math.sqrt(O*O+h*h+k*k),z=i.types,B=z.SPHERE,D=z.PLANE,E=(z.BOX,z.COMPOUND,z.CONVEXPOLYHEDRON,this.bins),F=this.binLengths,G=this.bins.length,H=0;H!==G;H++)F[H]=0;for(var I=Math.ceil,p=Math.min,u=Math.max,H=0;H!==d;H++){var J=l[H],K=J.shape;switch(K.type){case B:var L=J.position.x,M=J.position.y,P=J.position.z,Q=K.radius;o(L-Q,M-Q,P-Q,L+Q,M+Q,P+Q,J);break;case D:K.worldNormalNeedsUpdate&&K.computeWorldNormal(J.quaternion);var R=K.worldNormal,S=g+.5*O-J.position.x,T=x+.5*h-J.position.y,U=j+.5*k-J.position.z,V=t;V.set(S,T,U);for(var W=0,X=0;W!==s;W++,X+=a,V.y=T,V.x+=O)for(var Y=0,Z=0;Y!==y;Y++,Z+=r,V.z=U,V.y+=h)for(var $=0,_=0;$!==c;$++,_+=w,V.z+=k)if(V.dot(R)1)for(var nf=E[H],W=0;W!==ff;W++)for(var J=nf[W],Y=0;Y!==W;Y++){var of=nf[Y];this.needBroadphaseCollision(J,of)&&this.intersectionTest(J,of,f,n)}}this.makePairsUnique(f,n)}},{"../math/Vec3":30,"../shapes/Shape":43,"./Broadphase":5}],7:[function(e,f){function n(){o.apply(this)}f.exports=n;var o=e("./Broadphase"),d=e("./AABB");n.prototype=new o,n.prototype.constructor=n,n.prototype.collisionPairs=function(e,f,n){var o,d,i,t,l=e.bodies,u=l.length;for(o=0;o!==u;o++)for(d=0;d!==o;d++)i=l[o],t=l[d],this.needBroadphaseCollision(i,t)&&this.intersectionTest(i,t,f,n)};new d;n.prototype.aabbQuery=function(e,f,n){n=n||[];for(var o=0;oe){var n=f;f=e,e=n}return e+"-"+f in this.matrix},n.prototype.set=function(e,f,n){if(e=e.id,f=f.id,f>e){var o=f;f=e,e=o}n?this.matrix[e+"-"+f]=!0:delete this.matrix[e+"-"+f]},n.prototype.reset=function(){this.matrix={}},n.prototype.setNumObjects=function(){}},{}],9:[function(e,f){function n(e,f){this.from=e?e.clone():new i,this.to=f?f.clone():new i,this._direction=new i,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=n.ANY,this.result=new u,this.hasHit=!1,this.callback=function(){}}function o(e,f,n,o){o.vsub(f,G),n.vsub(f,a),e.vsub(f,r);var d,i,t=G.dot(G),l=G.dot(a),u=G.dot(r),p=a.dot(a),s=a.dot(r);return(d=p*u-l*s)>=0&&(i=t*s-l*u)>=0&&t*p-l*l>d+i}function d(e,f,n){n.vsub(e,G);var o=G.dot(f);f.mult(o,H),H.vadd(e,H);var d=n.distanceTo(H);return d}f.exports=n;var i=e("../math/Vec3"),t=e("../math/Quaternion"),l=e("../math/Transform"),u=(e("../shapes/ConvexPolyhedron"),e("../shapes/Box"),e("../collision/RaycastResult")),p=e("../shapes/Shape"),s=e("../collision/AABB");n.prototype.constructor=n,n.CLOSEST=1,n.ANY=2,n.ALL=4;var y=new s,c=[];n.prototype.intersectWorld=function(e,f){return this.mode=f.mode||n.ANY,this.result=f.result||new u,this.skipBackfaces=!!f.skipBackfaces,this.collisionFilterMask="undefined"!=typeof f.collisionFilterMask?f.collisionFilterMask:-1,this.collisionFilterGroup="undefined"!=typeof f.collisionFilterGroup?f.collisionFilterGroup:-1,f.from&&this.from.copy(f.from),f.to&&this.to.copy(f.to),this.callback=f.callback||function(){},this.hasHit=!1,this.result.reset(),this._updateDirection(),this.getAABB(y),c.length=0,e.broadphase.aabbQuery(e,y,c),this.intersectBodies(c),this.hasHit};var a=new i,r=new i;n.pointInTriangle=o;var w=new i,b=new t;n.prototype.intersectBody=function(e,f){f&&(this.result=f,this._updateDirection());var n=this.checkCollisionResponse;if((!n||e.collisionResponse)&&0!==(this.collisionFilterGroup&e.collisionFilterMask)&&0!==(e.collisionFilterGroup&this.collisionFilterMask))for(var o=w,d=b,i=0,t=e.shapes.length;t>i;i++){var l=e.shapes[i];if((!n||l.collisionResponse)&&(e.quaternion.mult(e.shapeOrientations[i],d),e.quaternion.vmult(e.shapeOffsets[i],o),o.vadd(e.position,o),this.intersectShape(l,d,o,e),this.result._shouldStop))break}},n.prototype.intersectBodies=function(e,f){f&&(this.result=f,this._updateDirection());for(var n=0,o=e.length;!this.result._shouldStop&&o>n;n++)this.intersectBody(e[n])},n.prototype._updateDirection=function(){this.to.vsub(this.from,this._direction),this._direction.normalize()},n.prototype.intersectShape=function(e,f,n,o){var i=this.from,t=d(i,this._direction,n);if(!(t>e.boundingSphereRadius)){var l=this[e.type];l&&l.call(this,e,f,n,o)}};{var m=(new i,new i,new i),N=new i,g=new i,x=new i;new i,new u}n.prototype.intersectBox=function(e,f,n,o){return this.intersectConvex(e.convexPolyhedronRepresentation,f,n,o)},n.prototype[p.types.BOX]=n.prototype.intersectBox,n.prototype.intersectPlane=function(e,f,n,o){var d=this.from,t=this.to,l=this._direction,u=new i(0,0,1);f.vmult(u,u);var p=new i;d.vsub(n,p);var s=p.dot(u);t.vsub(n,p);var y=p.dot(u);if(!(s*y>0||d.distanceTo(t)c)&&(c=p[0]),(null===y||p[1]a)&&(a=p[1])),null!==s){var w=[];e.getRectMinMax(s,y,c,a,w);for(var b=(w[0],w[1],s);c>=b;b++)for(var m=y;a>=m;m++){if(this.result._shouldStop)return;if(e.getConvexTrianglePillar(b,m,!1),l.pointToWorldFrame(o,f,e.pillarOffset,t),this.intersectConvex(e.pillarConvex,f,t,d,j),this.result._shouldStop)return;e.getConvexTrianglePillar(b,m,!0),l.pointToWorldFrame(o,f,e.pillarOffset,t),this.intersectConvex(e.pillarConvex,f,t,d,j)}}},n.prototype[p.types.HEIGHTFIELD]=n.prototype.intersectHeightfield;var v=new i,A=new i;n.prototype.intersectSphere=function(e,f,n,o){var d=this.from,i=this.to,t=e.radius,l=Math.pow(i.x-d.x,2)+Math.pow(i.y-d.y,2)+Math.pow(i.z-d.z,2),u=2*((i.x-d.x)*(d.x-n.x)+(i.y-d.y)*(d.y-n.y)+(i.z-d.z)*(d.z-n.z)),p=Math.pow(d.x-n.x,2)+Math.pow(d.y-n.y,2)+Math.pow(d.z-n.z,2)-Math.pow(t,2),s=Math.pow(u,2)-4*l*p,y=v,c=A;if(!(0>s))if(0===s)d.lerp(i,s,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1);else{var a=(-u-Math.sqrt(s))/(2*l),r=(-u+Math.sqrt(s))/(2*l);if(a>=0&&1>=a&&(d.lerp(i,a,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1)),this.result._shouldStop)return;r>=0&&1>=r&&(d.lerp(i,r,y),y.vsub(n,c),c.normalize(),this.reportIntersection(c,y,e,o,-1))}},n.prototype[p.types.SPHERE]=n.prototype.intersectSphere;var C=new i,O=(new i,new i,new i);n.prototype.intersectConvex=function(e,f,n,d,i){for(var t=C,l=O,u=i&&i.faceList||null,p=e.faces,s=e.vertices,y=e.faceNormals,c=this._direction,a=this.from,r=this.to,w=a.distanceTo(r),b=u?u.length:p.length,j=this.result,v=0;!j._shouldStop&&b>v;v++){var A=u?u[v]:v,h=p[A],k=y[A],q=f,z=n;l.copy(s[h[0]]),q.vmult(l,l),l.vadd(z,l),l.vsub(a,l),q.vmult(k,t);var B=c.dot(t);if(!(Math.abs(B)D)){c.mult(D,m),m.vadd(a,m),N.copy(s[h[0]]),q.vmult(N,N),z.vadd(N,N);for(var E=1;!j._shouldStop&&Ew||this.reportIntersection(t,m,e,d,A)}}}}},n.prototype[p.types.CONVEXPOLYHEDRON]=n.prototype.intersectConvex;var h=new i,k=new i,q=new i,z=new i,B=new i,D=new i,E=(new s,[]),F=new l;n.prototype.intersectTrimesh=function(e,f,n,d,i){var t=h,u=E,p=F,s=O,y=k,c=q,a=z,r=D,w=B,b=(i&&i.faceList||null,e.indices),j=(e.vertices,e.faceNormals,this.from),v=this.to,A=this._direction;p.position.copy(n),p.quaternion.copy(f),l.vectorToLocalFrame(n,f,A,y),l.pointToLocalFrame(n,f,j,c),l.pointToLocalFrame(n,f,v,a);var C=c.distanceSquared(a);e.tree.rayQuery(this,p,u);for(var G=0,H=u.length;!this.result._shouldStop&&G!==H;G++){var I=u[G];e.getNormal(I,t),e.getVertex(b[3*I],N),N.vsub(c,s);var J=y.dot(t),K=t.dot(s)/J;if(!(0>K)){y.scale(K,m),m.vadd(c,m),e.getVertex(b[3*I+1],g),e.getVertex(b[3*I+2],x);var L=m.distanceSquared(c);!o(m,g,N,x)&&!o(m,N,g,x)||L>C||(l.vectorToWorldFrame(f,t,w),l.pointToWorldFrame(n,f,m,r),this.reportIntersection(w,r,e,d,I))}}u.length=0},n.prototype[p.types.TRIMESH]=n.prototype.intersectTrimesh,n.prototype.reportIntersection=function(e,f,o,d,i){var t=this.from,l=this.to,u=t.distanceTo(f),p=this.result;if(!(this.skipBackfaces&&e.dot(this._direction)>0))switch(p.hitFaceIndex="undefined"!=typeof i?i:-1,this.mode){case n.ALL:this.hasHit=!0,p.set(t,l,e,f,o,d,u),p.hasHit=!0,this.callback(p);break;case n.CLOSEST:(uf;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.x<=o.aabb.lowerBound.x);d--)e[d+1]=e[d];e[d+1]=o}return e},n.insertionSortY=function(e){for(var f=1,n=e.length;n>f;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.y<=o.aabb.lowerBound.y);d--)e[d+1]=e[d];e[d+1]=o}return e},n.insertionSortZ=function(e){for(var f=1,n=e.length;n>f;f++){for(var o=e[f],d=f-1;d>=0&&!(e[d].aabb.lowerBound.z<=o.aabb.lowerBound.z);d--)e[d+1]=e[d];e[d+1]=o}return e},n.prototype.collisionPairs=function(e,f,o){var d,i,t=this.axisList,l=t.length,u=this.axisIndex;for(this.dirty&&(this.sortList(),this.dirty=!1),d=0;d!==l;d++){var p=t[d];for(i=d+1;l>i;i++){var s=t[i];if(this.needBroadphaseCollision(p,s)){if(!n.checkBounds(p,s,u))break;this.intersectionTest(p,s,f,o)}}}},n.prototype.sortList=function(){for(var e=this.axisList,f=this.axisIndex,o=e.length,d=0;d!==o;d++){var i=e[d];i.aabbNeedsUpdate&&i.computeAABB()}0===f?n.insertionSortX(e):1===f?n.insertionSortY(e):2===f&&n.insertionSortZ(e)},n.checkBounds=function(e,f,n){var o,d;0===n?(o=e.position.x,d=f.position.x):1===n?(o=e.position.y,d=f.position.y):2===n&&(o=e.position.z,d=f.position.z);var i=e.boundingRadius,t=f.boundingRadius,l=o+i,u=d-t;return l>u},n.prototype.autoDetectAxis=function(){for(var e=0,f=0,n=0,o=0,d=0,i=0,t=this.axisList,l=t.length,u=1/l,p=0;p!==l;p++){var s=t[p],y=s.position.x;e+=y,f+=y*y;var c=s.position.y;n+=c,o+=c*c;var a=s.position.z;d+=a,i+=a*a}var r=f-e*e*u,w=o-n*n*u,b=i-d*d*u;this.axisIndex=r>w?r>b?0:2:w>b?1:2},n.prototype.aabbQuery=function(e,f,n){n=n||[],this.dirty&&(this.sortList(),this.dirty=!1);var o=this.axisIndex,d="x";1===o&&(d="y"),2===o&&(d="z");for(var i=this.axisList,t=(f.lowerBound[d],f.upperBound[d],0);td;d++)for(var i=0;3>i;i++){for(var t=0,l=0;3>l;l++)t+=e.elements[d+3*l]*this.elements[l+3*i];o.elements[d+3*i]=t}return o},n.prototype.scale=function(e,f){f=f||new n;for(var o=this.elements,d=f.elements,i=0;3!==i;i++)d[3*i+0]=e.x*o[3*i+0],d[3*i+1]=e.y*o[3*i+1],d[3*i+2]=e.z*o[3*i+2];return f},n.prototype.solve=function(e,f){f=f||new o;for(var n=3,d=4,i=[],t=0;n*d>t;t++)i.push(0);var t,l;for(t=0;3>t;t++)for(l=0;3>l;l++)i[t+d*l]=this.elements[t+3*l];i[3]=e.x,i[7]=e.y,i[11]=e.z;var u,p,s=3,y=s,c=4;do{if(t=y-s,0===i[t+d*t])for(l=t+1;y>l;l++)if(0!==i[t+d*l]){u=c;do p=c-u,i[p+d*t]+=i[p+d*l];while(--u);break}if(0!==i[t+d*t])for(l=t+1;y>l;l++){var a=i[t+d*l]/i[t+d*t];u=c;do p=c-u,i[p+d*l]=t>=p?0:i[p+d*l]-i[p+d*t]*a;while(--u)}}while(--s);if(f.z=i[2*d+3]/i[2*d+2],f.y=(i[1*d+3]-i[1*d+2]*f.z)/i[1*d+1],f.x=(i[0*d+3]-i[0*d+2]*f.z-i[0*d+1]*f.y)/i[0*d+0],isNaN(f.x)||isNaN(f.y)||isNaN(f.z)||1/0===f.x||1/0===f.y||1/0===f.z)throw"Could not solve equation! Got x=["+f.toString()+"], b=["+e.toString()+"], A=["+this.toString()+"]";return f},n.prototype.e=function(e,f,n){return void 0===n?this.elements[f+3*e]:void(this.elements[f+3*e]=n)},n.prototype.copy=function(e){for(var f=0;fn;n++)e+=this.elements[n]+f;return e},n.prototype.reverse=function(e){e=e||new n;for(var f=3,o=6,d=[],i=0;f*o>i;i++)d.push(0);var i,t;for(i=0;3>i;i++)for(t=0;3>t;t++)d[i+o*t]=this.elements[i+3*t];d[3]=1,d[9]=0,d[15]=0,d[4]=0,d[10]=1,d[16]=0,d[5]=0,d[11]=0,d[17]=1;var l,u,p=3,s=p,y=o;do{if(i=s-p,0===d[i+o*i])for(t=i+1;s>t;t++)if(0!==d[i+o*t]){l=y;do u=y-l,d[u+o*i]+=d[u+o*t];while(--l);break}if(0!==d[i+o*i])for(t=i+1;s>t;t++){var c=d[i+o*t]/d[i+o*i];l=y;do u=y-l,d[u+o*t]=i>=u?0:d[u+o*t]-d[u+o*i]*c;while(--l)}}while(--p);i=2;do{t=i-1;do{var c=d[i+o*t]/d[i+o*i];l=o;do u=o-l,d[u+o*t]=d[u+o*t]-d[u+o*i]*c;while(--l)}while(t--)}while(--i);i=2;do{var c=1/d[i+o*i];l=o;do u=o-l,d[u+o*i]=d[u+o*i]*c;while(--l)}while(i--);i=2;do{t=2;do{if(u=d[f+t+o*i],isNaN(u)||1/0===u)throw"Could not reverse! A=["+this.toString()+"]";e.e(i,t,u)}while(t--)}while(i--);return e},n.prototype.setRotationFromQuaternion=function(e){var f=e.x,n=e.y,o=e.z,d=e.w,i=f+f,t=n+n,l=o+o,u=f*i,p=f*t,s=f*l,y=n*t,c=n*l,a=o*l,r=d*i,w=d*t,b=d*l,m=this.elements;return m[0]=1-(y+a),m[1]=p-b,m[2]=s+w,m[3]=p+b,m[4]=1-(u+a),m[5]=c-r,m[6]=s-w,m[7]=c+r,m[8]=1-(u+y),this},n.prototype.transpose=function(e){e=e||new n;for(var f=e.elements,o=this.elements,d=0;3!==d;d++)for(var i=0;3!==i;i++)f[3*d+i]=o[3*i+d];return e}},{"./Vec3":30}],28:[function(e,f){function n(e,f,n,o){this.x=void 0!==e?e:0,this.y=void 0!==f?f:0,this.z=void 0!==n?n:0,this.w=void 0!==o?o:1}f.exports=n;var o=e("./Vec3");n.prototype.set=function(e,f,n,o){this.x=e,this.y=f,this.z=n,this.w=o},n.prototype.toString=function(){return this.x+","+this.y+","+this.z+","+this.w},n.prototype.toArray=function(){return[this.x,this.y,this.z,this.w]},n.prototype.setFromAxisAngle=function(e,f){var n=Math.sin(.5*f);this.x=e.x*n,this.y=e.y*n,this.z=e.z*n,this.w=Math.cos(.5*f)},n.prototype.toAxisAngle=function(e){e=e||new o,this.normalize();var f=2*Math.acos(this.w),n=Math.sqrt(1-this.w*this.w);return.001>n?(e.x=this.x,e.y=this.y,e.z=this.z):(e.x=this.x/n,e.y=this.y/n,e.z=this.z/n),[e,f]};var d=new o,i=new o;n.prototype.setFromVectors=function(e,f){if(e.isAntiparallelTo(f)){var n=d,o=i;e.tangents(n,o),this.setFromAxisAngle(n,Math.PI)}else{var t=e.cross(f);this.x=t.x,this.y=t.y,this.z=t.z,this.w=Math.sqrt(Math.pow(e.norm(),2)*Math.pow(f.norm(),2))+e.dot(f),this.normalize()}};var t=new o,l=new o,u=new o;n.prototype.mult=function(e,f){f=f||new n;var o=this.w,d=t,i=l,p=u;return d.set(this.x,this.y,this.z),i.set(e.x,e.y,e.z),f.w=o*e.w-d.dot(i),d.cross(i,p),f.x=o*i.x+e.w*d.x+p.x,f.y=o*i.y+e.w*d.y+p.y,f.z=o*i.z+e.w*d.z+p.z,f},n.prototype.inverse=function(e){var f=this.x,o=this.y,d=this.z,i=this.w;e=e||new n,this.conjugate(e);var t=1/(f*f+o*o+d*d+i*i);return e.x*=t,e.y*=t,e.z*=t,e.w*=t,e},n.prototype.conjugate=function(e){return e=e||new n,e.x=-this.x,e.y=-this.y,e.z=-this.z,e.w=this.w,e},n.prototype.normalize=function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e)},n.prototype.normalizeFast=function(){var e=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;0===e?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=e,this.y*=e,this.z*=e,this.w*=e)},n.prototype.vmult=function(e,f){f=f||new o;var n=e.x,d=e.y,i=e.z,t=this.x,l=this.y,u=this.z,p=this.w,s=p*n+l*i-u*d,y=p*d+u*n-t*i,c=p*i+t*d-l*n,a=-t*n-l*d-u*i;return f.x=s*p+a*-t+y*-u-c*-l,f.y=y*p+a*-l+c*-t-s*-u,f.z=c*p+a*-u+s*-l-y*-t,f},n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},n.prototype.toEuler=function(e,f){f=f||"YZX";var n,o,d,i=this.x,t=this.y,l=this.z,u=this.w;switch(f){case"YZX":var p=i*t+l*u;if(p>.499&&(n=2*Math.atan2(i,u),o=Math.PI/2,d=0),-.499>p&&(n=-2*Math.atan2(i,u),o=-Math.PI/2,d=0),isNaN(n)){var s=i*i,y=t*t,c=l*l;n=Math.atan2(2*t*u-2*i*l,1-2*y-2*c),o=Math.asin(2*p),d=Math.atan2(2*i*u-2*t*l,1-2*s-2*c)}break;default:throw new Error("Euler order "+f+" not supported yet.")}e.y=n,e.z=o,e.x=d},n.prototype.setFromEuler=function(e,f,n,o){o=o||"XYZ";var d=Math.cos(e/2),i=Math.cos(f/2),t=Math.cos(n/2),l=Math.sin(e/2),u=Math.sin(f/2),p=Math.sin(n/2);return"XYZ"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t-l*u*p):"YXZ"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t+l*u*p):"ZXY"===o?(this.x=l*i*t-d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t-l*u*p):"ZYX"===o?(this.x=l*i*t-d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t+l*u*p):"YZX"===o?(this.x=l*i*t+d*u*p,this.y=d*u*t+l*i*p,this.z=d*i*p-l*u*t,this.w=d*i*t-l*u*p):"XZY"===o&&(this.x=l*i*t-d*u*p,this.y=d*u*t-l*i*p,this.z=d*i*p+l*u*t,this.w=d*i*t+l*u*p),this},n.prototype.clone=function(){return new n(this.x,this.y,this.z,this.w)}},{"./Vec3":30}],29:[function(e,f){function n(e){e=e||{},this.position=new o,e.position&&this.position.copy(e.position),this.quaternion=new d,e.quaternion&&this.quaternion.copy(e.quaternion)}var o=e("./Vec3"),d=e("./Quaternion");f.exports=n;var i=new d;n.pointToLocalFrame=function(e,f,n,d){var d=d||new o;return n.vsub(e,d),f.conjugate(i),i.vmult(d,d),d},n.prototype.pointToLocal=function(e,f){return n.pointToLocalFrame(this.position,this.quaternion,e,f)},n.pointToWorldFrame=function(e,f,n,d){var d=d||new o;return f.vmult(n,d),d.vadd(e,d),d},n.prototype.pointToWorld=function(e,f){return n.pointToWorldFrame(this.position,this.quaternion,e,f)},n.prototype.vectorToWorldFrame=function(e,f){var f=f||new o;return this.quaternion.vmult(e,f),f},n.vectorToWorldFrame=function(e,f,n){return e.vmult(f,n),n},n.vectorToLocalFrame=function(e,f,n,d){var d=d||new o;return f.w*=-1,f.vmult(n,d),f.w*=-1,d}},{"./Quaternion":28,"./Vec3":30}],30:[function(e,f){function n(e,f,n){this.x=e||0,this.y=f||0,this.z=n||0}f.exports=n;var o=e("./Mat3");n.ZERO=new n(0,0,0),n.UNIT_X=new n(1,0,0),n.UNIT_Y=new n(0,1,0),n.UNIT_Z=new n(0,0,1),n.prototype.cross=function(e,f){var o=e.x,d=e.y,i=e.z,t=this.x,l=this.y,u=this.z;return f=f||new n,f.x=l*i-u*d,f.y=u*o-t*i,f.z=t*d-l*o,f},n.prototype.set=function(e,f,n){return this.x=e,this.y=f,this.z=n,this},n.prototype.setZero=function(){this.x=this.y=this.z=0},n.prototype.vadd=function(e,f){return f?(f.x=e.x+this.x,f.y=e.y+this.y,f.z=e.z+this.z,void 0):new n(this.x+e.x,this.y+e.y,this.z+e.z)},n.prototype.vsub=function(e,f){return f?(f.x=this.x-e.x,f.y=this.y-e.y,f.z=this.z-e.z,void 0):new n(this.x-e.x,this.y-e.y,this.z-e.z)},n.prototype.crossmat=function(){return new o([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])},n.prototype.normalize=function(){var e=this.x,f=this.y,n=this.z,o=Math.sqrt(e*e+f*f+n*n);if(o>0){var d=1/o;this.x*=d,this.y*=d,this.z*=d}else this.x=0,this.y=0,this.z=0;return o},n.prototype.unit=function(e){e=e||new n;var f=this.x,o=this.y,d=this.z,i=Math.sqrt(f*f+o*o+d*d);return i>0?(i=1/i,e.x=f*i,e.y=o*i,e.z=d*i):(e.x=1,e.y=0,e.z=0),e},n.prototype.norm=function(){var e=this.x,f=this.y,n=this.z;return Math.sqrt(e*e+f*f+n*n)},n.prototype.length=n.prototype.norm,n.prototype.norm2=function(){return this.dot(this)},n.prototype.lengthSquared=n.prototype.norm2,n.prototype.distanceTo=function(e){var f=this.x,n=this.y,o=this.z,d=e.x,i=e.y,t=e.z;return Math.sqrt((d-f)*(d-f)+(i-n)*(i-n)+(t-o)*(t-o))},n.prototype.distanceSquared=function(e){var f=this.x,n=this.y,o=this.z,d=e.x,i=e.y,t=e.z;return(d-f)*(d-f)+(i-n)*(i-n)+(t-o)*(t-o)},n.prototype.mult=function(e,f){f=f||new n;var o=this.x,d=this.y,i=this.z;return f.x=e*o,f.y=e*d,f.z=e*i,f},n.prototype.scale=n.prototype.mult,n.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},n.prototype.isZero=function(){return 0===this.x&&0===this.y&&0===this.z},n.prototype.negate=function(e){return e=e||new n,e.x=-this.x,e.y=-this.y,e.z=-this.z,e};var d=new n,i=new n;n.prototype.tangents=function(e,f){var n=this.norm();if(n>0){var o=d,t=1/n;o.set(this.x*t,this.y*t,this.z*t);var l=i;Math.abs(o.x)<.9?(l.set(1,0,0),o.cross(l,e)):(l.set(0,1,0),o.cross(l,e)),o.cross(e,f)}else e.set(1,0,0),f.set(0,1,0)},n.prototype.toString=function(){return this.x+","+this.y+","+this.z},n.prototype.toArray=function(){return[this.x,this.y,this.z]},n.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},n.prototype.lerp=function(e,f,n){var o=this.x,d=this.y,i=this.z;n.x=o+(e.x-o)*f,n.y=d+(e.y-d)*f,n.z=i+(e.z-i)*f},n.prototype.almostEquals=function(e,f){return void 0===f&&(f=1e-6),Math.abs(this.x-e.x)>f||Math.abs(this.y-e.y)>f||Math.abs(this.z-e.z)>f?!1:!0},n.prototype.almostZero=function(e){return void 0===e&&(e=1e-6),Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e?!1:!0};var t=new n;n.prototype.isAntiparallelTo=function(e,f){return this.negate(t),t.almostEquals(e,f)},n.prototype.clone=function(){return new n(this.x,this.y,this.z)}},{"./Mat3":27}],31:[function(e,f){function n(e){e=e||{},o.apply(this),this.id=n.idCounter++,this.world=null,this.preStep=null,this.postStep=null,this.vlambda=new d,this.collisionFilterGroup="number"==typeof e.collisionFilterGroup?e.collisionFilterGroup:1,this.collisionFilterMask="number"==typeof e.collisionFilterMask?e.collisionFilterMask:1,this.collisionResponse=!0,this.position=new d,e.position&&this.position.copy(e.position),this.previousPosition=new d,this.initPosition=new d,this.velocity=new d,e.velocity&&this.velocity.copy(e.velocity),this.initVelocity=new d,this.force=new d;var f="number"==typeof e.mass?e.mass:0;this.mass=f,this.invMass=f>0?1/f:0,this.material=e.material||null,this.linearDamping="number"==typeof e.linearDamping?e.linearDamping:.01,this.type=0>=f?n.STATIC:n.DYNAMIC,typeof e.type==typeof n.STATIC&&(this.type=e.type),this.allowSleep="undefined"!=typeof e.allowSleep?e.allowSleep:!0,this.sleepState=0,this.sleepSpeedLimit="undefined"!=typeof e.sleepSpeedLimit?e.sleepSpeedLimit:.1,this.sleepTimeLimit="undefined"!=typeof e.sleepTimeLimit?e.sleepTimeLimit:1,this.timeLastSleepy=0,this._wakeUpAfterNarrowphase=!1,this.torque=new d,this.quaternion=new t,e.quaternion&&this.quaternion.copy(e.quaternion),this.initQuaternion=new t,this.angularVelocity=new d,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new d,this.interpolatedPosition=new d,this.interpolatedQuaternion=new t,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new d,this.invInertia=new d,this.invInertiaWorld=new i,this.invMassSolve=0,this.invInertiaSolve=new d,this.invInertiaWorldSolve=new i,this.fixedRotation="undefined"!=typeof e.fixedRotation?e.fixedRotation:!1,this.angularDamping="undefined"!=typeof e.angularDamping?e.angularDamping:.01,this.aabb=new l,this.aabbNeedsUpdate=!0,this.wlambda=new d,e.shape&&this.addShape(e.shape),this.updateMassProperties()}f.exports=n;var o=e("../utils/EventTarget"),d=(e("../shapes/Shape"),e("../math/Vec3")),i=e("../math/Mat3"),t=e("../math/Quaternion"),l=(e("../material/Material"),e("../collision/AABB")),u=e("../shapes/Box");n.prototype=new o,n.prototype.constructor=n,n.DYNAMIC=1,n.STATIC=2,n.KINEMATIC=4,n.AWAKE=0,n.SLEEPY=1,n.SLEEPING=2,n.idCounter=0,n.prototype.wakeUp=function(){var e=this.sleepState;this.sleepState=0,e===n.SLEEPING&&this.dispatchEvent({type:"wakeup"})},n.prototype.sleep=function(){this.sleepState=n.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0)},n.sleepyEvent={type:"sleepy"},n.sleepEvent={type:"sleep"},n.prototype.sleepTick=function(e){if(this.allowSleep){var f=this.sleepState,o=this.velocity.norm2()+this.angularVelocity.norm2(),d=Math.pow(this.sleepSpeedLimit,2);f===n.AWAKE&&d>o?(this.sleepState=n.SLEEPY,this.timeLastSleepy=e,this.dispatchEvent(n.sleepyEvent)):f===n.SLEEPY&&o>d?this.wakeUp():f===n.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(n.sleepEvent))}},n.prototype.updateSolveMassProperties=function(){this.sleepState===n.SLEEPING||this.type===n.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))},n.prototype.pointToLocalFrame=function(e,f){var f=f||new d;return e.vsub(this.position,f),this.quaternion.conjugate().vmult(f,f),f},n.prototype.vectorToLocalFrame=function(e,f){var f=f||new d;return this.quaternion.conjugate().vmult(e,f),f},n.prototype.pointToWorldFrame=function(e,f){var f=f||new d;return this.quaternion.vmult(e,f),f.vadd(this.position,f),f},n.prototype.vectorToWorldFrame=function(e,f){var f=f||new d;return this.quaternion.vmult(e,f),f};var p=new d,s=new t;n.prototype.addShape=function(e,f,n){var o=new d,i=new t;return f&&o.copy(f),n&&i.copy(n),this.shapes.push(e),this.shapeOffsets.push(o),this.shapeOrientations.push(i),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,this},n.prototype.updateBoundingRadius=function(){for(var e=this.shapes,f=this.shapeOffsets,n=e.length,o=0,d=0;d!==n;d++){var i=e[d];i.updateBoundingSphereRadius();var t=f[d].norm(),l=i.boundingSphereRadius;t+l>o&&(o=t+l)}this.boundingRadius=o};var y=new l;n.prototype.computeAABB=function(){for(var e=this.shapes,f=this.shapeOffsets,n=this.shapeOrientations,o=e.length,d=p,i=s,t=this.quaternion,l=this.aabb,u=y,c=0;c!==o;c++){var a=e[c];n[c].mult(t,i),i.vmult(f[c],d),d.vadd(this.position,d),a.calculateWorldAABB(d,i,u.lowerBound,u.upperBound),0===c?l.copy(u):l.extend(u)}this.aabbNeedsUpdate=!1};{var c=new i,a=new i;new i}n.prototype.updateInertiaWorld=function(e){var f=this.invInertia;if(f.x!==f.y||f.y!==f.z||e){var n=c,o=a;n.setRotationFromQuaternion(this.quaternion),n.transpose(o),n.scale(f,n),n.mmult(o,this.invInertiaWorld)}else;};var r=new d,w=new d;n.prototype.applyForce=function(e,f){if(this.type===n.DYNAMIC){var o=r;f.vsub(this.position,o);var d=w;o.cross(e,d),this.force.vadd(e,this.force),this.torque.vadd(d,this.torque)}};var b=new d,m=new d;n.prototype.applyLocalForce=function(e,f){if(this.type===n.DYNAMIC){var o=b,d=m;this.vectorToWorldFrame(e,o),this.pointToWorldFrame(f,d),this.applyForce(o,d)}};var N=new d,g=new d,x=new d;n.prototype.applyImpulse=function(e,f){if(this.type===n.DYNAMIC){var o=N;f.vsub(this.position,o);var d=g;d.copy(e),d.mult(this.invMass,d),this.velocity.vadd(d,this.velocity);var i=x;o.cross(e,i),this.invInertiaWorld.vmult(i,i),this.angularVelocity.vadd(i,this.angularVelocity)}};var j=new d,v=new d;n.prototype.applyLocalImpulse=function(e,f){if(this.type===n.DYNAMIC){var o=j,d=v;this.vectorToWorldFrame(e,o),this.pointToWorldFrame(f,d),this.applyImpulse(o,d)}};var A=new d;n.prototype.updateMassProperties=function(){var e=A;this.invMass=this.mass>0?1/this.mass:0;var f=this.inertia,n=this.fixedRotation;this.computeAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),u.calculateInertia(e,this.mass,f),this.invInertia.set(f.x>0&&!n?1/f.x:0,f.y>0&&!n?1/f.y:0,f.z>0&&!n?1/f.z:0),this.updateInertiaWorld(!0)},n.prototype.getVelocityAtWorldPoint=function(e,f){var n=new d;return e.vsub(this.position,n),this.angularVelocity.cross(n,f),this.velocity.vadd(f,f),f}},{"../collision/AABB":3,"../material/Material":25,"../math/Mat3":27,"../math/Quaternion":28,"../math/Vec3":30,"../shapes/Box":37,"../shapes/Shape":43,"../utils/EventTarget":49}],32:[function(e,f){function n(e){this.chassisBody=e.chassisBody,this.wheelInfos=[],this.sliding=!1,this.world=null,this.indexRightAxis="undefined"!=typeof e.indexRightAxis?e.indexRightAxis:1,this.indexForwardAxis="undefined"!=typeof e.indexForwardAxis?e.indexForwardAxis:0,this.indexUpAxis="undefined"!=typeof e.indexUpAxis?e.indexUpAxis:2}function o(e,f,n,o,i){var t=0,l=n,u=x,p=j,s=v;e.getVelocityAtWorldPoint(l,u),f.getVelocityAtWorldPoint(l,p),u.vsub(p,s);var y=o.dot(s),c=d(e,n,o),a=d(f,n,o),r=1,w=r/(c+a);return t=-y*w,t>i&&(t=i),-i>t&&(t=-i),t}function d(e,f,n){var o=A,d=C,i=O,t=h;return f.vsub(e.position,o),o.cross(n,d),e.invInertiaWorld.vmult(d,t),t.cross(o,i),e.invMass+n.dot(i)}function i(e,f,n,o,d,i){var t=d.norm2();if(t>1.1)return 0;var l=k,u=q,p=z;e.getVelocityAtWorldPoint(f,l),n.getVelocityAtWorldPoint(o,u),l.vsub(u,p);var s=d.dot(p),y=.2,c=1/(e.invMass+n.invMass),i=-y*s*c;return i}var t=(e("./Body"),e("../math/Vec3")),l=e("../math/Quaternion"),u=(e("../collision/RaycastResult"),e("../collision/Ray")),p=e("../objects/WheelInfo");f.exports=n;{var s=(new t,new t,new t,new t),y=new t,c=new t;new u}n.prototype.addWheel=function(e){e=e||{};var f=new p(e),n=this.wheelInfos.length;return this.wheelInfos.push(f),n},n.prototype.setSteeringValue=function(e,f){var n=this.wheelInfos[f];n.steering=e};new t;n.prototype.applyEngineForce=function(e,f){this.wheelInfos[f].engineForce=e},n.prototype.setBrake=function(e,f){this.wheelInfos[f].brake=e},n.prototype.addToWorld=function(e){this.constraints;e.add(this.chassisBody);var f=this;this.preStepCallback=function(){f.updateVehicle(e.dt)},e.addEventListener("preStep",this.preStepCallback),this.world=e},n.prototype.getVehicleAxisWorld=function(e,f){f.set(0===e?1:0,1===e?1:0,2===e?1:0),this.chassisBody.vectorToWorldFrame(f,f)},n.prototype.updateVehicle=function(e){for(var f=this.wheelInfos,n=f.length,o=this.chassisBody,d=0;n>d;d++)this.updateWheelTransform(d);this.currentVehicleSpeedKmHour=3.6*o.velocity.norm();var i=new t;this.getVehicleAxisWorld(this.indexForwardAxis,i),i.dot(o.velocity)<0&&(this.currentVehicleSpeedKmHour*=-1);for(var d=0;n>d;d++)this.castRay(f[d]);this.updateSuspension(e);for(var l=new t,u=new t,d=0;n>d;d++){var p=f[d],s=p.suspensionForce;s>p.maxSuspensionForce&&(s=p.maxSuspensionForce),p.raycastResult.hitNormalWorld.scale(s*e,l),p.raycastResult.hitPointWorld.vsub(o.position,u),o.applyImpulse(l,p.raycastResult.hitPointWorld)}this.updateFriction(e);var y=new t,c=new t,a=new t;for(d=0;n>d;d++){var p=f[d];o.getVelocityAtWorldPoint(p.chassisConnectionPointWorld,a);var r=1;switch(this.indexUpAxis){case 1:r=-1}if(p.isInContact){this.getVehicleAxisWorld(this.indexForwardAxis,c);var w=c.dot(p.raycastResult.hitNormalWorld);p.raycastResult.hitNormalWorld.scale(w,y),c.vsub(y,c);var b=c.dot(a);p.deltaRotation=r*b*e/p.radius}!p.sliding&&p.isInContact||0===p.engineForce||!p.useCustomSlidingRotationalSpeed||(p.deltaRotation=(p.engineForce>0?1:-1)*p.customSlidingRotationalSpeed*e),Math.abs(p.brake)>Math.abs(p.engineForce)&&(p.deltaRotation=0),p.rotation+=p.deltaRotation,p.deltaRotation*=.99}},n.prototype.updateSuspension=function(){for(var e=this.chassisBody,f=e.mass,n=this.wheelInfos,o=n.length,d=0;o>d;d++){var i=n[d];if(i.isInContact){var t,l=i.suspensionRestLength,u=i.suspensionLength,p=l-u;t=i.suspensionStiffness*p*i.clippedInvContactDotSuspension;var s,y=i.suspensionRelativeVelocity;s=0>y?i.dampingCompression:i.dampingRelaxation,t-=s*y,i.suspensionForce=t*f,i.suspensionForce<0&&(i.suspensionForce=0)}else i.suspensionForce=0}},n.prototype.removeFromWorld=function(e){this.constraints;e.remove(this.chassisBody),e.removeEventListener("preStep",this.preStepCallback),this.world=null};var a=new t,r=new t;n.prototype.castRay=function(e){var f=a,n=r;this.updateWheelTransformWorld(e);var o=this.chassisBody,d=-1,i=e.suspensionRestLength+e.radius;e.directionWorld.scale(i,f);var l=e.chassisConnectionPointWorld;l.vadd(f,n);var u=e.raycastResult;u.reset();var p=o.collisionResponse;o.collisionResponse=!1,this.world.rayTest(l,n,u),o.collisionResponse=p;var s=u.body;if(e.raycastResult.groundObject=0,s){d=u.distance,e.raycastResult.hitNormalWorld=u.hitNormalWorld,e.isInContact=!0;var y=u.distance;e.suspensionLength=y-e.radius;var c=e.suspensionRestLength-e.maxSuspensionTravel,w=e.suspensionRestLength+e.maxSuspensionTravel;e.suspensionLengthw&&(e.suspensionLength=w,e.raycastResult.reset());var b=e.raycastResult.hitNormalWorld.dot(e.directionWorld),m=new t;o.getVelocityAtWorldPoint(e.raycastResult.hitPointWorld,m);var N=e.raycastResult.hitNormalWorld.dot(m);if(b>=-.1)e.suspensionRelativeVelocity=0,e.clippedInvContactDotSuspension=10;else{var g=-1/b;e.suspensionRelativeVelocity=N*g,e.clippedInvContactDotSuspension=g}}else e.suspensionLength=e.suspensionRestLength+0*e.maxSuspensionTravel,e.suspensionRelativeVelocity=0,e.directionWorld.scale(-1,e.raycastResult.hitNormalWorld),e.clippedInvContactDotSuspension=1;return d},n.prototype.updateWheelTransformWorld=function(e){e.isInContact=!1;var f=this.chassisBody;f.pointToWorldFrame(e.chassisConnectionPointLocal,e.chassisConnectionPointWorld),f.vectorToWorldFrame(e.directionLocal,e.directionWorld),f.vectorToWorldFrame(e.axleLocal,e.axleWorld)},n.prototype.updateWheelTransform=function(e){var f=s,n=y,o=c,d=this.wheelInfos[e];this.updateWheelTransformWorld(d),d.directionLocal.scale(-1,f),n.copy(d.axleLocal),f.cross(n,o),o.normalize(),n.normalize();var i=d.steering,t=new l;t.setFromAxisAngle(f,i);var u=new l;u.setFromAxisAngle(n,d.rotation);var p=d.worldTransform.quaternion;this.chassisBody.quaternion.mult(t,p),p.mult(u,p),p.normalize();var a=d.worldTransform.position;a.copy(d.directionWorld),a.scale(d.suspensionLength,a),a.vadd(d.chassisConnectionPointWorld,a)};var w=[new t(1,0,0),new t(0,1,0),new t(0,0,1)];n.prototype.getWheelTransformWorld=function(e){return this.wheelInfos[e].worldTransform};var b=new t,m=[],N=[],g=1;n.prototype.updateFriction=function(e){for(var f=b,n=this.wheelInfos,d=n.length,l=this.chassisBody,u=N,p=m,s=0,y=0;d>y;y++){var c=n[y],a=c.raycastResult.body;a&&s++,c.sideImpulse=0,c.forwardImpulse=0,u[y]||(u[y]=new t),p[y]||(p[y]=new t)}for(var y=0;d>y;y++){var c=n[y],a=c.raycastResult.body;if(a){var r=p[y],x=this.getWheelTransformWorld(y);x.vectorToWorldFrame(w[this.indexRightAxis],r);var j=c.raycastResult.hitNormalWorld,v=r.dot(j);j.scale(v,f),r.vsub(f,r),r.normalize(),j.cross(r,u[y]),u[y].normalize(),c.sideImpulse=i(l,c.raycastResult.hitPointWorld,a,c.raycastResult.hitPointWorld,r),c.sideImpulse*=g}}var A=1,C=.5;this.sliding=!1;for(var y=0;d>y;y++){var c=n[y],a=c.raycastResult.body,O=0;if(c.slipInfo=1,a){var h=0,k=c.brake?c.brake:h;O=o(l,a,c.raycastResult.hitPointWorld,u[y],k),O+=c.engineForce*e;var q=k/O;c.slipInfo*=q}if(c.forwardImpulse=0,c.skidInfo=1,a){c.skidInfo=1;var z=c.suspensionForce*e*c.frictionSlip,B=z,D=z*B;c.forwardImpulse=O;var E=c.forwardImpulse*C,F=c.sideImpulse*A,G=E*E+F*F;if(c.sliding=!1,G>D){this.sliding=!0,c.sliding=!0;var q=z/Math.sqrt(G);c.skidInfo*=q}}}if(this.sliding)for(var y=0;d>y;y++){var c=n[y];0!==c.sideImpulse&&c.skidInfo<1&&(c.forwardImpulse*=c.skidInfo,c.sideImpulse*=c.skidInfo)}for(var y=0;d>y;y++){var c=n[y],H=new t;if(H.copy(c.raycastResult.hitPointWorld),0!==c.forwardImpulse){var I=new t;u[y].scale(c.forwardImpulse,I),l.applyImpulse(I,H)}if(0!==c.sideImpulse){var a=c.raycastResult.body,J=new t;J.copy(c.raycastResult.hitPointWorld);var K=new t;p[y].scale(c.sideImpulse,K),l.pointToLocalFrame(H,H),H["xyz"[this.indexUpAxis]]*=c.rollInfluence,l.pointToWorldFrame(H,H),l.applyImpulse(K,H),K.scale(-1,K),a.applyImpulse(K,J)}}};var x=new t,j=new t,v=new t,A=new t,C=new t,O=new t,h=new t,k=new t,q=new t,z=new t},{"../collision/Ray":9,"../collision/RaycastResult":10,"../math/Quaternion":28,"../math/Vec3":30,"../objects/WheelInfo":36,"./Body":31}],33:[function(e,f){function n(e){if(this.wheelBodies=[],this.coordinateSystem="undefined"==typeof e.coordinateSystem?new t(1,2,3):e.coordinateSystem.clone(),this.chassisBody=e.chassisBody,!this.chassisBody){var f=new i(new t(5,2,.5));this.chassisBody=new o(1,f)}this.constraints=[],this.wheelAxes=[],this.wheelForces=[]}var o=e("./Body"),d=e("../shapes/Sphere"),i=e("../shapes/Box"),t=e("../math/Vec3"),l=e("../constraints/HingeConstraint");f.exports=n,n.prototype.addWheel=function(e){e=e||{};var f=e.body;f||(f=new o(1,new d(1.2))),this.wheelBodies.push(f),this.wheelForces.push(0);var n=(new t,"undefined"!=typeof e.position?e.position.clone():new t),i=new t;this.chassisBody.pointToWorldFrame(n,i),f.position.set(i.x,i.y,i.z);var u="undefined"!=typeof e.axis?e.axis.clone():new t(0,1,0);this.wheelAxes.push(u);var p=new l(this.chassisBody,f,{pivotA:n,axisA:u,pivotB:t.ZERO,axisB:u,collideConnected:!1});return this.constraints.push(p),this.wheelBodies.length-1},n.prototype.setSteeringValue=function(e,f){var n=this.wheelAxes[f],o=Math.cos(e),d=Math.sin(e),i=n.x,t=n.y;this.constraints[f].axisA.set(o*i-d*t,d*i+o*t,0)},n.prototype.setMotorSpeed=function(e,f){var n=this.constraints[f];n.enableMotor(),n.motorTargetVelocity=e},n.prototype.disableMotor=function(e){var f=this.constraints[e]; -f.disableMotor()};var u=new t;n.prototype.setWheelForce=function(e,f){this.wheelForces[f]=e},n.prototype.applyWheelForce=function(e,f){var n=this.wheelAxes[f],o=this.wheelBodies[f],d=o.torque;n.scale(e,u),o.vectorToWorldFrame(u,u),d.vadd(u,d)},n.prototype.addToWorld=function(e){for(var f=this.constraints,n=this.wheelBodies.concat([this.chassisBody]),o=0;othis.particles.length&&this.neighbors.pop())};var d=new o;n.prototype.getNeighbors=function(e,f){for(var n=this.particles.length,o=e.id,i=this.smoothingRadius*this.smoothingRadius,t=d,l=0;l!==n;l++){var u=this.particles[l];u.position.vsub(e.position,t),o!==u.id&&t.norm2()=-.1)this.suspensionRelativeVelocity=0,this.clippedInvContactDotSuspension=10;else{var d=-1/n;this.suspensionRelativeVelocity=o*d,this.clippedInvContactDotSuspension=d}}else f.suspensionLength=this.suspensionRestLength,this.suspensionRelativeVelocity=0,f.directionWorld.scale(-1,f.hitNormalWorld),this.clippedInvContactDotSuspension=1}},{"../collision/RaycastResult":10,"../math/Transform":29,"../math/Vec3":30,"../utils/Utils":53}],37:[function(e,f){function n(e){o.call(this),this.type=o.types.BOX,this.halfExtents=e,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3"),i=e("./ConvexPolyhedron");n.prototype=new o,n.prototype.constructor=n,n.prototype.updateConvexPolyhedronRepresentation=function(){var e=this.halfExtents.x,f=this.halfExtents.y,n=this.halfExtents.z,o=d,t=[new o(-e,-f,-n),new o(e,-f,-n),new o(e,f,-n),new o(-e,f,-n),new o(-e,-f,n),new o(e,-f,n),new o(e,f,n),new o(-e,f,n)],l=[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],u=([new o(0,0,1),new o(0,1,0),new o(1,0,0)],new i(t,l));this.convexPolyhedronRepresentation=u,u.material=this.material},n.prototype.calculateLocalInertia=function(e,f){return f=f||new d,n.calculateInertia(this.halfExtents,e,f),f},n.calculateInertia=function(e,f,n){var o=e;n.x=1/12*f*(2*o.y*2*o.y+2*o.z*2*o.z),n.y=1/12*f*(2*o.x*2*o.x+2*o.z*2*o.z),n.z=1/12*f*(2*o.y*2*o.y+2*o.x*2*o.x)},n.prototype.getSideNormals=function(e,f){var n=e,o=this.halfExtents;if(n[0].set(o.x,0,0),n[1].set(0,o.y,0),n[2].set(0,0,o.z),n[3].set(-o.x,0,0),n[4].set(0,-o.y,0),n[5].set(0,0,-o.z),void 0!==f)for(var d=0;d!==n.length;d++)f.vmult(n[d],n[d]);return n},n.prototype.volume=function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.halfExtents.norm()};{var t=new d;new d}n.prototype.forEachWorldCorner=function(e,f,n){for(var o=this.halfExtents,d=[[o.x,o.y,o.z],[-o.x,o.y,o.z],[-o.x,-o.y,o.z],[-o.x,-o.y,-o.z],[o.x,-o.y,-o.z],[o.x,o.y,-o.z],[-o.x,o.y,-o.z],[o.x,-o.y,o.z]],i=0;it;t++){var i=l[t];f.vmult(i,i),e.vadd(i,i);var u=i.x,p=i.y,s=i.z;u>o.x&&(o.x=u),p>o.y&&(o.y=p),s>o.z&&(o.z=s),ua&&(a=w,c=r)}for(var b=[],m=n.faces[c],N=m.length,g=0;N>g;g++){var x=n.vertices[m[g]],j=new d;j.copy(x),i.vmult(j,j),o.vadd(j,j),b.push(j)}c>=0&&this.clipFaceAgainstHull(t,e,f,b,l,u,s)};var s=new d,y=new d,c=new d,a=new d,r=new d,w=new d;n.prototype.findSeparatingAxis=function(e,f,n,o,d,i,t,l){var u=s,p=y,b=c,m=a,N=r,g=w,x=Number.MAX_VALUE,j=this,v=0;if(j.uniqueAxes)for(var A=0;A!==j.uniqueAxes.length;A++){n.vmult(j.uniqueAxes[A],u);var C=j.testSepAxis(u,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(u))}else for(var O=t?t.length:j.faces.length,A=0;O>A;A++){var h=t?t[A]:A;u.copy(j.faceNormals[h]),n.vmult(u,u);var C=j.testSepAxis(u,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(u))}if(e.uniqueAxes)for(var A=0;A!==e.uniqueAxes.length;A++){d.vmult(e.uniqueAxes[A],p),v++;var C=j.testSepAxis(p,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(p))}else for(var k=l?l.length:e.faces.length,A=0;k>A;A++){var h=l?l[A]:A;p.copy(e.faceNormals[h]),d.vmult(p,p),v++;var C=j.testSepAxis(p,e,f,n,o,d);if(C===!1)return!1;x>C&&(x=C,i.copy(p))}for(var q=0;q!==j.uniqueEdges.length;q++){n.vmult(j.uniqueEdges[q],m);for(var z=0;z!==e.uniqueEdges.length;z++)if(d.vmult(e.uniqueEdges[z],N),m.cross(N,g),!g.almostZero()){g.normalize();var B=j.testSepAxis(g,e,f,n,o,d);if(B===!1)return!1;x>B&&(x=B,i.copy(g))}}return o.vsub(f,b),b.dot(i)>0&&i.negate(i),!0};var b=[],m=[];n.prototype.testSepAxis=function(e,f,o,d,i,t){var l=this;n.project(l,e,o,d,b),n.project(f,e,i,t,m);var u=b[0],p=b[1],s=m[0],y=m[1];if(y>u||p>s)return!1;var c=u-y,a=s-p,r=a>c?c:a;return r};var N=new d,g=new d;n.prototype.calculateLocalInertia=function(e,f){this.computeLocalAABB(N,g);var n=g.x-N.x,o=g.y-N.y,d=g.z-N.z;f.x=1/12*e*(2*o*2*o+2*d*2*d),f.y=1/12*e*(2*n*2*n+2*d*2*d),f.z=1/12*e*(2*o*2*o+2*n*2*n)},n.prototype.getPlaneConstantOfFace=function(e){var f=this.faces[e],n=this.faceNormals[e],o=this.vertices[f[0]],d=-n.dot(o);return d};var x=new d,j=new d,v=new d,A=new d,C=new d,O=new d,h=new d,k=new d;n.prototype.clipFaceAgainstHull=function(e,f,n,o,d,i,t){for(var l=x,u=j,p=v,s=A,y=C,c=O,a=h,r=k,w=this,b=[],m=o,N=b,g=-1,q=Number.MAX_VALUE,z=0;zB&&(q=B,g=z)}if(!(0>g)){var D=w.faces[g];D.connectedFaces=[];for(var E=0;EH;H++){var I=w.vertices[D[H]],J=w.vertices[D[(H+1)%G]];I.vsub(J,u),p.copy(u),n.vmult(p,p),f.vadd(p,p),s.copy(this.faceNormals[g]),n.vmult(s,s),f.vadd(s,s),p.cross(s,y),y.negate(y),c.copy(I),n.vmult(c,c),f.vadd(c,c);var K,L=(-c.dot(y),D.connectedFaces[H]);a.copy(this.faceNormals[L]);var M=this.getPlaneConstantOfFace(L);r.copy(a),n.vmult(r,r);var K=M-r.dot(f);for(this.clipFaceAgainstPlane(m,N,r,K);m.length;)m.shift();for(;N.length;)m.push(N.shift())}a.copy(this.faceNormals[g]);var M=this.getPlaneConstantOfFace(g);r.copy(a),n.vmult(r,r);for(var K=M-r.dot(f),E=0;E=P&&(console.log("clamped: depth="+P+" to minDist="+(d+"")),P=d),i>=P){var Q=m[E];if(0>=P){var R={point:Q,normal:r,depth:P};t.push(R)}}}}},n.prototype.clipFaceAgainstPlane=function(e,f,n,o){var i,t,l=e.length;if(2>l)return f;var u=e[e.length-1],p=e[0];i=n.dot(u)+o;for(var s=0;l>s;s++){if(p=e[s],t=n.dot(p)+o,0>i)if(0>t){var y=new d;y.copy(p),f.push(y)}else{var y=new d;u.lerp(p,i/(i-t),y),f.push(y)}else if(0>t){var y=new d;u.lerp(p,i/(i-t),y),f.push(y),f.push(p)}u=p,i=t}return f},n.prototype.computeWorldVertices=function(e,f){for(var n=this.vertices.length;this.worldVertices.lengthd;d++){var i=o[d];i.xf.x&&(f.x=i.x),i.yf.y&&(f.y=i.y),i.zf.z&&(f.z=i.z)}},n.prototype.computeWorldFaceNormals=function(e){for(var f=this.faceNormals.length;this.worldFaceNormals.lengthe&&(e=d)}this.boundingSphereRadius=Math.sqrt(e)};var q=new d;n.prototype.calculateWorldAABB=function(e,f,n,o){for(var d,i,t,l,u,p,s=this.vertices.length,y=this.vertices,c=0;s>c;c++){q.copy(y[c]),f.vmult(q,q),e.vadd(q,q);var a=q;a.xl||void 0===l)&&(l=a.x),a.yu||void 0===u)&&(u=a.y),a.zp||void 0===p)&&(p=a.z)}n.set(d,i,t),o.set(l,u,p)},n.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},n.prototype.getAveragePointLocal=function(e){e=e||new d;for(var f=this.vertices.length,n=this.vertices,o=0;f>o;o++)e.vadd(n[o],e);return e.mult(1/f,e),e},n.prototype.transformAllPoints=function(e,f){var n=this.vertices.length,o=this.vertices;if(f){for(var d=0;n>d;d++){var i=o[d];f.vmult(i,i)}for(var d=0;dd;d++){var i=o[d];i.vadd(e,i)}};var z=new d,B=new d,D=new d;n.prototype.pointIsInside=function(e){var f=this.vertices.length,n=this.vertices,o=this.faces,d=this.faceNormals,i=null,t=this.faces.length,l=z;this.getAveragePointLocal(l);for(var u=0;t>u;u++){var f=(this.faces[u].length,d[u]),p=n[o[u][0]],s=B;e.vsub(p,s);var y=f.dot(s),c=D;l.vsub(p,c);var a=f.dot(c);if(0>y&&a>0||y>0&&0>a)return!1}return i?1:-1};var E=(new d,new d),F=new d;n.project=function(e,f,n,o,d){var t=e.vertices.length,l=E,u=0,p=0,s=F,y=e.vertices;s.setZero(),i.vectorToLocalFrame(n,o,f,l),i.pointToLocalFrame(n,o,s,s);var c=s.dot(l);p=u=y[0].dot(l);for(var a=1;t>a;a++){var r=y[a].dot(l);r>u&&(u=r),p>r&&(p=r)}if(p-=c,u-=c,p>u){var w=p;p=u,u=w}d[0]=u,d[1]=p}},{"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"./Shape":43}],39:[function(e,f){function n(e,f,n,t){var l=t,u=[],p=[],s=[],y=[],c=[],a=Math.cos,r=Math.sin;u.push(new d(f*a(0),f*r(0),.5*-n)),y.push(0),u.push(new d(e*a(0),e*r(0),.5*n)),c.push(1);for(var w=0;l>w;w++){var b=2*Math.PI/l*(w+1),m=2*Math.PI/l*(w+.5);l-1>w?(u.push(new d(f*a(b),f*r(b),.5*-n)),y.push(2*w+2),u.push(new d(e*a(b),e*r(b),.5*n)),c.push(2*w+3),s.push([2*w+2,2*w+3,2*w+1,2*w])):s.push([0,1,2*w+1,2*w]),(l%2===1||l/2>w)&&p.push(new d(a(m),r(m),0))}s.push(c),p.push(new d(0,0,1));for(var N=[],w=0;wd&&(f=d)}this.minValue=f},n.prototype.updateMaxValue=function(){for(var e=this.data,f=e[0][0],n=0;n!==e.length;n++)for(var o=0;o!==e[n].length;o++){var d=e[n][o];d>f&&(f=d)}this.maxValue=f},n.prototype.setHeightValueAtIndex=function(e,f,n){var o=this.data;o[e][f]=n,this.clearCachedConvexTrianglePillar(e,f,!1),e>0&&(this.clearCachedConvexTrianglePillar(e-1,f,!0),this.clearCachedConvexTrianglePillar(e-1,f,!1)),f>0&&(this.clearCachedConvexTrianglePillar(e,f-1,!0),this.clearCachedConvexTrianglePillar(e,f-1,!1)),f>0&&e>0&&this.clearCachedConvexTrianglePillar(e-1,f-1,!0)},n.prototype.getRectMinMax=function(e,f,n,o,d){d=d||[];for(var i=this.data,t=this.minValue,l=e;n>=l;l++)for(var u=f;o>=u;u++){var p=i[l][u];p>t&&(t=p)}d[0]=this.minValue,d[1]=t},n.prototype.getIndexOfPosition=function(e,f,n,o){var d=this.elementSize,i=this.data,t=Math.floor(e/d),l=Math.floor(f/d);return n[0]=t,n[1]=l,o&&(0>t&&(t=0),0>l&&(l=0),t>=i.length-1&&(t=i.length-1),l>=i[0].length-1&&(l=i[0].length-1)),0>t||0>l||t>=i.length-1||l>=i[0].length-1?!1:!0},n.prototype.getHeightAt=function(e,f,n){var o=[];this.getIndexOfPosition(e,f,o,n);var d=[];return this.getRectMinMax(o[0],o[1]+1,o[0],o[1]+1,d),(d[0]+d[1])/2},n.prototype.getCacheConvexTrianglePillarKey=function(e,f,n){return e+"_"+f+"_"+(n?1:0)},n.prototype.getCachedConvexTrianglePillar=function(e,f,n){return this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]},n.prototype.setCachedConvexTrianglePillar=function(e,f,n,o,d){this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]={convex:o,offset:d}},n.prototype.clearCachedConvexTrianglePillar=function(e,f,n){delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(e,f,n)]},n.prototype.getConvexTrianglePillar=function(e,f,n){var o=this.pillarConvex,t=this.pillarOffset;if(this.cacheEnabled){var l=this.getCachedConvexTrianglePillar(e,f,n);if(l)return this.pillarConvex=l.convex,void(this.pillarOffset=l.offset);o=new d,t=new i,this.pillarConvex=o,this.pillarOffset=t}var l=this.data,u=this.elementSize,p=o.faces;o.vertices.length=6;for(var s=0;6>s;s++)o.vertices[s]||(o.vertices[s]=new i);p.length=5;for(var s=0;5>s;s++)p[s]||(p[s]=[]);var y=o.vertices,c=(Math.min(l[e][f],l[e+1][f],l[e][f+1],l[e+1][f+1])-this.minValue)/2+this.minValue;n?(t.set((e+.75)*u,(f+.75)*u,c),y[0].set(.25*u,.25*u,l[e+1][f+1]-c),y[1].set(-.75*u,.25*u,l[e][f+1]-c),y[2].set(.25*u,-.75*u,l[e+1][f]-c),y[3].set(.25*u,.25*u,-c-1),y[4].set(-.75*u,.25*u,-c-1),y[5].set(.25*u,-.75*u,-c-1),p[0][0]=0,p[0][1]=1,p[0][2]=2,p[1][0]=5,p[1][1]=4,p[1][2]=3,p[2][0]=2,p[2][1]=5,p[2][2]=3,p[2][3]=0,p[3][0]=3,p[3][1]=4,p[3][2]=1,p[3][3]=0,p[4][0]=1,p[4][1]=4,p[4][2]=5,p[4][3]=2):(t.set((e+.25)*u,(f+.25)*u,c),y[0].set(-.25*u,-.25*u,l[e][f]-c),y[1].set(.75*u,-.25*u,l[e+1][f]-c),y[2].set(-.25*u,.75*u,l[e][f+1]-c),y[3].set(-.25*u,-.25*u,-c-1),y[4].set(.75*u,-.25*u,-c-1),y[5].set(-.25*u,.75*u,-c-1),p[0][0]=0,p[0][1]=1,p[0][2]=2,p[1][0]=5,p[1][1]=4,p[1][2]=3,p[2][0]=0,p[2][1]=2,p[2][2]=5,p[2][3]=3,p[3][0]=1,p[3][1]=0,p[3][2]=3,p[3][3]=4,p[4][0]=4,p[4][1]=5,p[4][2]=2,p[4][3]=1),o.computeNormals(),o.computeEdges(),o.updateBoundingSphereRadius(),this.setCachedConvexTrianglePillar(e,f,n,o,t)},n.prototype.calculateLocalInertia=function(e,f){return f=f||new i,f.set(0,0,0),f},n.prototype.volume=function(){return Number.MAX_VALUE},n.prototype.calculateWorldAABB=function(e,f,n,o){n.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),o.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},n.prototype.updateBoundingSphereRadius=function(){var e=this.data,f=this.elementSize;this.boundingSphereRadius=new i(e.length*f,e[0].length*f,Math.max(Math.abs(this.maxValue),Math.abs(this.minValue))).norm()}},{"../math/Vec3":30,"../utils/Utils":53,"./ConvexPolyhedron":38,"./Shape":43}],41:[function(e,f){function n(){o.call(this),this.type=o.types.PARTICLE}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.calculateLocalInertia=function(e,f){return f=f||new d,f.set(0,0,0),f},n.prototype.volume=function(){return 0},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=0},n.prototype.calculateWorldAABB=function(e,f,n,o){n.copy(e),o.copy(e)}},{"../math/Vec3":30,"./Shape":43}],42:[function(e,f){function n(){o.call(this),this.type=o.types.PLANE,this.worldNormal=new d,this.worldNormalNeedsUpdate=!0,this.boundingSphereRadius=Number.MAX_VALUE}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.computeWorldNormal=function(e){var f=this.worldNormal;f.set(0,0,1),e.vmult(f,f),this.worldNormalNeedsUpdate=!1},n.prototype.calculateLocalInertia=function(e,f){return f=f||new d},n.prototype.volume=function(){return Number.MAX_VALUE};var i=new d;n.prototype.calculateWorldAABB=function(e,f,n,o){i.set(0,0,1),f.vmult(i,i);var d=Number.MAX_VALUE;n.set(-d,-d,-d),o.set(d,d,d),1===i.x&&(o.x=e.x),1===i.y&&(o.y=e.y),1===i.z&&(o.z=e.z),-1===i.x&&(n.x=e.x),-1===i.y&&(n.y=e.y),-1===i.z&&(n.z=e.z)},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=Number.MAX_VALUE}},{"../math/Vec3":30,"./Shape":43}],43:[function(e,f){function n(){this.id=n.idCounter++,this.type=0,this.boundingSphereRadius=0,this.collisionResponse=!0,this.material=null}f.exports=n;{var n=e("./Shape");e("../math/Vec3"),e("../math/Quaternion"),e("../material/Material")}n.prototype.constructor=n,n.prototype.updateBoundingSphereRadius=function(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type},n.prototype.volume=function(){throw"volume() not implemented for shape type "+this.type},n.prototype.calculateLocalInertia=function(){throw"calculateLocalInertia() not implemented for shape type "+this.type},n.idCounter=0,n.types={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256}},{"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"./Shape":43}],44:[function(e,f){function n(e){if(o.call(this),this.radius=void 0!==e?Number(e):1,this.type=o.types.SPHERE,this.radius<0)throw new Error("The sphere radius cannot be negative.");this.updateBoundingSphereRadius()}f.exports=n;var o=e("./Shape"),d=e("../math/Vec3");n.prototype=new o,n.prototype.constructor=n,n.prototype.calculateLocalInertia=function(e,f){f=f||new d;var n=2*e*this.radius*this.radius/5;return f.x=n,f.y=n,f.z=n,f},n.prototype.volume=function(){return 4*Math.PI*this.radius/3},n.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.radius},n.prototype.calculateWorldAABB=function(e,f,n,o){for(var d=this.radius,i=["x","y","z"],t=0;td?d+"_"+i:i+"_"+d;e[f]=!0},n=0;nn.x&&(n.x=d.x),d.yn.y&&(n.y=d.y),d.zn.z&&(n.z=d.z)},n.prototype.updateAABB=function(){this.computeLocalAABB(this.aabb)},n.prototype.updateBoundingSphereRadius=function(){for(var e=0,f=this.vertices,n=new d,o=0,i=f.length/3;o!==i;o++){this.getVertex(o,n);var t=n.norm2();t>e&&(e=t)}this.boundingSphereRadius=Math.sqrt(e)};var g=(new d,new i),x=new t;n.prototype.calculateWorldAABB=function(e,f,n,o){var d=g,i=x;d.position=e,d.quaternion=f,this.aabb.toWorldFrame(d,i),n.copy(i.lowerBound),o.copy(i.upperBound)},n.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},n.createTorus=function(e,f,o,d,i){e=e||1,f=f||.5,o=o||8,d=d||6,i=i||2*Math.PI;for(var t=[],l=[],u=0;o>=u;u++)for(var p=0;d>=p;p++){var s=p/d*i,y=u/o*Math.PI*2,c=(e+f*Math.cos(y))*Math.cos(s),a=(e+f*Math.cos(y))*Math.sin(s),r=f*Math.sin(y);t.push(c,a,r)}for(var u=1;o>=u;u++)for(var p=1;d>=p;p++){var w=(d+1)*u+p-1,b=(d+1)*(u-1)+p-1,m=(d+1)*(u-1)+p,N=(d+1)*u+p;l.push(w,b,N),l.push(b,m,N)}return new n(t,l)}},{"../collision/AABB":3,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../utils/Octree":50,"./Shape":43}],46:[function(e,f){function n(){o.call(this),this.iterations=10,this.tolerance=1e-7}f.exports=n;var o=(e("../math/Vec3"),e("../math/Quaternion"),e("./Solver"));n.prototype=new o;var d=[],i=[],t=[];n.prototype.solve=function(e,f){var n,o,l,u,p,s,y=0,c=this.iterations,a=this.tolerance*this.tolerance,r=this.equations,w=r.length,b=f.bodies,m=b.length,N=e;if(0!==w)for(var g=0;g!==m;g++)b[g].updateSolveMassProperties();var x=i,j=t,v=d; -x.length=w,j.length=w,v.length=w;for(var g=0;g!==w;g++){var A=r[g];v[g]=0,j[g]=A.computeB(N),x[g]=1/A.computeC()}if(0!==w){for(var g=0;g!==m;g++){var C=b[g],O=C.vlambda,h=C.wlambda;O.set(0,0,0),h&&h.set(0,0,0)}for(y=0;y!==c;y++){u=0;for(var k=0;k!==w;k++){var A=r[k];n=j[k],o=x[k],s=v[k],p=A.computeGWlambda(),l=o*(n-p-A.eps*s),s+lA.maxForce&&(l=A.maxForce-s),v[k]+=l,u+=l>0?l:-l,A.addToWlambda(l)}if(a>u*u)break}for(var g=0;g!==m;g++){var C=b[g],q=C.velocity,z=C.angularVelocity;q.vadd(C.vlambda,q),z&&z.vadd(C.wlambda,z)}}return y}},{"../math/Quaternion":28,"../math/Vec3":30,"./Solver":47}],47:[function(e,f){function n(){this.equations=[]}f.exports=n,n.prototype.solve=function(){return 0},n.prototype.addEquation=function(e){e.enabled&&this.equations.push(e)},n.prototype.removeEquation=function(e){var f=this.equations,n=f.indexOf(e);-1!==n&&f.splice(n,1)},n.prototype.removeAllEquations=function(){this.equations.length=0}},{}],48:[function(e,f){function n(e){for(l.call(this),this.iterations=10,this.tolerance=1e-7,this.subsolver=e,this.nodes=[],this.nodePool=[];this.nodePool.length<128;)this.nodePool.push(this.createNode())}function o(e){for(var f=e.length,n=0;n!==f;n++){var o=e[n];if(!(o.visited||o.body.type&c))return o}return!1}function d(e,f,n,d){for(a.push(e),e.visited=!0,f(e,n,d);a.length;)for(var i,t=a.pop();i=o(t.children);)i.visited=!0,f(i,n,d),a.push(i)}function i(e,f,n){f.push(e.body);for(var o=e.eqs.length,d=0;d!==o;d++){var i=e.eqs[d];-1===n.indexOf(i)&&n.push(i)}}function t(e,f){return f.id-e.id}f.exports=n;var l=(e("../math/Vec3"),e("../math/Quaternion"),e("./Solver")),u=e("../objects/Body");n.prototype=new l;var p=[],s=[],y={bodies:[]},c=u.STATIC,a=[];n.prototype.createNode=function(){return{body:null,children:[],eqs:[],visited:!1}},n.prototype.solve=function(e,f){for(var n=p,l=this.nodePool,u=f.bodies,c=this.equations,a=c.length,r=u.length,w=this.subsolver;l.lengthb;b++)n[b]=l[b];for(var b=0;b!==r;b++){var m=n[b];m.body=u[b],m.children.length=0,m.eqs.length=0,m.visited=!1}for(var N=0;N!==a;N++){var g=c[N],b=u.indexOf(g.bi),x=u.indexOf(g.bj),j=n[b],v=n[x];j.children.push(v),j.eqs.push(g),v.children.push(j),v.eqs.push(g)}var A,C=0,O=s;w.tolerance=this.tolerance,w.iterations=this.iterations;for(var h=y;A=o(n);){O.length=0,h.bodies.length=0,d(A,i,h.bodies,O);var k=O.length;O=O.sort(t);for(var b=0;b!==k;b++)w.addEquation(O[b]);{w.solve(e,h)}w.removeAllEquations(),C++}return C}},{"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"./Solver":47}],49:[function(e,f){var n=function(){};f.exports=n,n.prototype={constructor:n,addEventListener:function(e,f){void 0===this._listeners&&(this._listeners={});var n=this._listeners;return void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(f)&&n[e].push(f),this},hasEventListener:function(e,f){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(f)?!0:!1},removeEventListener:function(e,f){if(void 0===this._listeners)return this;var n=this._listeners;if(void 0===n[e])return this;var o=n[e].indexOf(f);return-1!==o&&n[e].splice(o,1),this},dispatchEvent:function(e){if(void 0===this._listeners)return this;var f=this._listeners,n=f[e.type];if(void 0!==n){e.target=this;for(var o=0,d=n.length;d>o;o++)n[o].call(this,e)}return this}}},{}],50:[function(e,f){function n(e){e=e||{},this.root=e.root||null,this.aabb=e.aabb?e.aabb.clone():new d,this.data=[],this.children=[]}function o(e,f){f=f||{},f.root=null,f.aabb=e,n.call(this,f),this.maxDepth="undefined"!=typeof f.maxDepth?f.maxDepth:8}var d=e("../collision/AABB"),i=e("../math/Vec3");f.exports=o,o.prototype=new n,n.prototype.reset=function(){this.children.length=this.data.length=0},n.prototype.insert=function(e,f,n){var o=this.data;if(n=n||0,!this.aabb.contains(e))return!1;var d=this.children;if(n<(this.maxDepth||this.root.maxDepth)){var i=!1;d.length||(this.subdivide(),i=!0);for(var t=0;8!==t;t++)if(d[t].insert(e,f,n+1))return!0;i&&(d.length=0)}return o.push(f),!0};var t=new i;n.prototype.subdivide=function(){var e=this.aabb,f=e.lowerBound,o=e.upperBound,l=this.children;l.push(new n({aabb:new d({lowerBound:new i(0,0,0)})}),new n({aabb:new d({lowerBound:new i(1,0,0)})}),new n({aabb:new d({lowerBound:new i(1,1,0)})}),new n({aabb:new d({lowerBound:new i(1,1,1)})}),new n({aabb:new d({lowerBound:new i(0,1,1)})}),new n({aabb:new d({lowerBound:new i(0,0,1)})}),new n({aabb:new d({lowerBound:new i(1,0,1)})}),new n({aabb:new d({lowerBound:new i(0,1,0)})})),o.vsub(f,t),t.scale(.5,t);for(var u=this.root||this,p=0;8!==p;p++){var s=l[p];s.root=u;var y=s.aabb.lowerBound;y.x*=t.x,y.y*=t.y,y.z*=t.z,y.vadd(f,y),y.vadd(t,s.aabb.upperBound)}},n.prototype.aabbQuery=function(e,f){for(var n=(this.data,this.children,[this]);n.length;){var o=n.pop();o.aabb.overlaps(e)&&Array.prototype.push.apply(f,o.data),Array.prototype.push.apply(n,o.children)}return f};var l=new d;n.prototype.rayQuery=function(e,f,n){return e.getAABB(l),l.toLocalFrame(f,l),this.aabbQuery(l,n),n},n.prototype.removeEmptyNodes=function(){for(var e=[this];e.length;){for(var f=e.pop(),n=f.children.length-1;n>=0;n--)f.children[n].data.length||f.children.splice(n,1);Array.prototype.push.apply(e,f.children)}}},{"../collision/AABB":3,"../math/Vec3":30}],51:[function(e,f){function n(){this.objects=[],this.type=Object}f.exports=n,n.prototype.release=function(){for(var e=arguments.length,f=0;f!==e;f++)this.objects.push(arguments[f])},n.prototype.get=function(){return 0===this.objects.length?this.constructObject():this.objects.pop()},n.prototype.constructObject=function(){throw new Error("constructObject() not implemented in this Pool subclass yet!")}},{}],52:[function(e,f){function n(){this.data={keys:[]}}f.exports=n,n.prototype.get=function(e,f){if(e>f){var n=f;f=e,e=n}return this.data[e+"-"+f]},n.prototype.set=function(e,f,n){if(e>f){var o=f;f=e,e=o}var d=e+"-"+f;this.get(e,f)||this.data.keys.push(d),this.data[d]=n},n.prototype.reset=function(){for(var e=this.data,f=e.keys;f.length>0;){var n=f.pop();delete e[n]}}},{}],53:[function(e,f){function n(){}f.exports=n,n.defaults=function(e,f){e=e||{};for(var n in f)n in e||(e[n]=f[n]);return e}},{}],54:[function(e,f){function n(){d.call(this),this.type=o}f.exports=n;var o=e("../math/Vec3"),d=e("./Pool");n.prototype=new d,n.prototype.constructObject=function(){return new o}},{"../math/Vec3":30,"./Pool":51}],55:[function(e,f){function n(e){this.contactPointPool=[],this.frictionEquationPool=[],this.result=[],this.frictionResult=[],this.v3pool=new s,this.world=e,this.currentContactMaterial=null,this.enableFrictionReduction=!1}function o(e,f,n){for(var o=null,d=e.length,i=0;i!==d;i++){var t=e[i],l=M;e[(i+1)%d].vsub(t,l);var u=P;l.cross(f,u);var p=Q;n.vsub(t,p);var s=u.dot(p);if(!(null===o||s>0&&o===!0||0>=s&&o===!1))return!1;null===o&&(o=s>0)}return!0}f.exports=n;var d=e("../collision/AABB"),i=e("../shapes/Shape"),t=e("../collision/Ray"),l=e("../math/Vec3"),u=e("../math/Transform"),p=(e("../shapes/ConvexPolyhedron"),e("../math/Quaternion")),s=(e("../solver/Solver"),e("../utils/Vec3Pool")),y=e("../equations/ContactEquation"),c=e("../equations/FrictionEquation");n.prototype.createContactEquation=function(e,f,n,o,d,i){var t;this.contactPointPool.length?(t=this.contactPointPool.pop(),t.bi=e,t.bj=f):t=new y(e,f),t.enabled=e.collisionResponse&&f.collisionResponse&&n.collisionResponse&&o.collisionResponse;var l=this.currentContactMaterial;t.restitution=l.restitution,t.setSpookParams(l.contactEquationStiffness,l.contactEquationRelaxation,this.world.dt);var u=n.material||e.material,p=o.material||f.material;return u&&p&&u.restitution>=0&&p.restitution>=0&&(t.restitution=u.restitution*p.restitution),t.si=d||n,t.sj=i||o,t},n.prototype.createFrictionEquationsFromContact=function(e,f){var n=e.bi,o=e.bj,d=e.si,i=e.sj,t=this.world,l=this.currentContactMaterial,u=l.friction,p=d.material||n.material,s=i.material||o.material;if(p&&s&&p.friction>=0&&s.friction>=0&&(u=p.friction*s.friction),u>0){var y=u*t.gravity.length(),a=n.invMass+o.invMass;a>0&&(a=1/a);var r=this.frictionEquationPool,w=r.length?r.pop():new c(n,o,y*a),b=r.length?r.pop():new c(n,o,y*a);return w.bi=b.bi=n,w.bj=b.bj=o,w.minForce=b.minForce=-y*a,w.maxForce=b.maxForce=y*a,w.ri.copy(e.ri),w.rj.copy(e.rj),b.ri.copy(e.ri),b.rj.copy(e.rj),e.ni.tangents(w.t,b.t),w.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,t.dt),b.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,t.dt),w.enabled=b.enabled=e.enabled,f.push(w,b),!0}return!1};var a=new l,r=new l,w=new l;n.prototype.createFrictionFromAverage=function(e){var f=this.result[this.result.length-1];if(this.createFrictionEquationsFromContact(f,this.frictionResult)&&1!==e){var n=this.frictionResult[this.frictionResult.length-2],o=this.frictionResult[this.frictionResult.length-1];a.setZero(),r.setZero(),w.setZero();for(var d=f.bi,i=(f.bj,0);i!==e;i++)f=this.result[this.result.length-1-i],f.bodyA!==d?(a.vadd(f.ni,a),r.vadd(f.ri,r),w.vadd(f.rj,w)):(a.vsub(f.ni,a),r.vadd(f.rj,r),w.vadd(f.ri,w));var t=1/e;r.scale(t,n.ri),w.scale(t,n.rj),o.ri.copy(n.ri),o.rj.copy(n.rj),a.normalize(),a.tangents(n.t,o.t)}};var b=new l,m=new l,N=new p,g=new p;n.prototype.getContacts=function(e,f,n,o,d,i,t){this.contactPointPool=d,this.frictionEquationPool=t,this.result=o,this.frictionResult=i;for(var l=N,u=g,p=b,s=m,y=0,c=e.length;y!==c;y++){var a=e[y],r=f[y],w=null;a.material&&r.material&&(w=n.getContactMaterial(a.material,r.material)||null);for(var x=0;xj.boundingSphereRadius+A.boundingSphereRadius)){var C=null;j.material&&A.material&&(C=n.getContactMaterial(j.material,A.material)||null),this.currentContactMaterial=C||w||n.defaultContactMaterial;var O=this[j.type|A.type];O&&(j.type=w){var b=this.createContactEquation(t,p,e,f);b.ni.copy(y);var m=v;y.scale(r.dot(y),m),s.vsub(m,m),b.ri.copy(m),b.ri.vsub(t.position,b.ri),b.rj.copy(s),b.rj.vsub(p.position,b.rj),this.result.push(b),this.createFrictionEquationsFromContact(b,this.frictionResult)}}};var A=new l,C=new l,O=(new l,new l),h=new l,k=new l,q=new l,z=new l,B=new l,D=new l,E=new l,F=new l,G=new l,H=new l,I=new d,J=[];n.prototype[i.types.SPHERE|i.types.TRIMESH]=n.prototype.sphereTrimesh=function(e,f,n,o,d,i,l,p){var s=k,y=q,c=z,a=B,r=D,w=E,b=I,m=h,N=C,g=J;u.pointToLocalFrame(o,i,n,r);var x=e.radius;b.lowerBound.set(r.x-x,r.y-x,r.z-x),b.upperBound.set(r.x+x,r.y+x,r.z+x),f.getTrianglesInAABB(b,g);for(var j=O,v=e.radius*e.radius,K=0;KL;L++)if(f.getVertex(f.indices[3*g[K]+L],j),j.vsub(r,N),N.norm2()<=v){m.copy(j),u.pointToWorldFrame(o,i,m,j),j.vsub(n,N);var M=this.createContactEquation(l,p,e,f);M.ni.copy(N),M.ni.normalize(),M.ri.copy(M.ni),M.ri.scale(e.radius,M.ri),M.ri.vadd(n,M.ri),M.ri.vsub(l.position,M.ri),M.rj.copy(j),M.rj.vsub(p.position,M.rj),this.result.push(M),this.createFrictionEquationsFromContact(M,this.frictionResult)}for(var K=0;KL;L++){f.getVertex(f.indices[3*g[K]+L],s),f.getVertex(f.indices[3*g[K]+(L+1)%3],y),y.vsub(s,c),r.vsub(y,w);var P=w.dot(c);r.vsub(s,w);var Q=w.dot(c);if(Q>0&&0>P){r.vsub(s,w),a.copy(c),a.normalize(),Q=w.dot(a),a.scale(Q,w),w.vadd(s,w);var R=w.distanceTo(r);if(RC&&C>0){var O=T,h=U;O.copy(p[(x+1)%3]),h.copy(p[(x+2)%3]);var k=O.norm(),q=h.norm();O.normalize(),h.normalize();var z=R.dot(O),B=R.dot(h);if(k>z&&z>-k&&q>B&&B>-q){var D=Math.abs(C-A-s);(null===g||g>D)&&(g=D,m=z,N=B,w=A,c.copy(v),a.copy(O),r.copy(h),b++)}}}if(b){y=!0;var E=this.createContactEquation(t,l,e,f);c.mult(-s,E.ri),E.ni.copy(c),E.ni.negate(E.ni),c.mult(w,c),a.mult(m,a),c.vadd(a,c),r.mult(N,r),c.vadd(r,E.rj),E.ri.vadd(n,E.ri),E.ri.vsub(t.position,E.ri),E.rj.vadd(o,E.rj),E.rj.vsub(l.position,E.rj),this.result.push(E),this.createFrictionEquationsFromContact(E,this.frictionResult)}for(var F=u.get(),G=W,H=0;2!==H&&!y;H++)for(var I=0;2!==I&&!y;I++)for(var J=0;2!==J&&!y;J++)if(F.set(0,0,0),H?F.vadd(p[0],F):F.vsub(p[0],F),I?F.vadd(p[1],F):F.vsub(p[1],F),J?F.vadd(p[2],F):F.vsub(p[2],F),o.vadd(F,G),G.vsub(n,G),G.norm2()_){y=!0;var ef=this.createContactEquation(t,l,e,f);L.vadd(M,ef.rj),ef.rj.copy(ef.rj),D.negate(ef.ni),ef.ni.normalize(),ef.ri.copy(ef.rj),ef.ri.vadd(o,ef.ri),ef.ri.vsub(n,ef.ri),ef.ri.normalize(),ef.ri.mult(s,ef.ri),ef.ri.vadd(n,ef.ri),ef.ri.vsub(t.position,ef.ri),ef.rj.vadd(o,ef.rj),ef.rj.vsub(l.position,ef.rj),this.result.push(ef),this.createFrictionEquationsFromContact(ef,this.frictionResult)}}u.release(K,L,E,M,D)};var $=new l,_=new l,ef=new l,ff=new l,nf=new l,of=new l,df=new l,tf=new l,lf=new l,uf=new l;n.prototype[i.types.SPHERE|i.types.CONVEXPOLYHEDRON]=n.prototype.sphereConvex=function(e,f,n,d,i,t,l,u){var p=this.v3pool;n.vsub(d,$);for(var s=f.faceNormals,y=f.faces,c=f.vertices,a=e.radius,r=0;r!==c.length;r++){var w=c[r],b=nf;t.vmult(w,b),d.vadd(b,b);var m=ff;if(b.vsub(n,m),m.norm2()k&&q.dot(A)>0){for(var z=[],B=0,D=v.length;B!==D;B++){var E=p.get();t.vmult(c[v[B]],E),d.vadd(E,E),z.push(E)}if(o(z,A,n)){g=!0;var N=this.createContactEquation(l,u,e,f);A.mult(-a,N.ri),A.negate(N.ni);var F=p.get();A.mult(-k,F);var G=p.get();A.mult(-a,G),n.vsub(d,N.rj),N.rj.vadd(G,N.rj),N.rj.vadd(F,N.rj),N.rj.vadd(d,N.rj),N.rj.vsub(u.position,N.rj),N.ri.vadd(n,N.ri),N.ri.vsub(l.position,N.ri),p.release(F),p.release(G),this.result.push(N),this.createFrictionEquationsFromContact(N,this.frictionResult);for(var B=0,H=z.length;B!==H;B++)p.release(z[B]);return}for(var B=0;B!==v.length;B++){var I=p.get(),J=p.get();t.vmult(c[v[(B+1)%v.length]],I),t.vmult(c[v[(B+2)%v.length]],J),d.vadd(I,I),d.vadd(J,J);var K=_;J.vsub(I,K);var L=ef;K.unit(L);var M=p.get(),P=p.get();n.vsub(I,P);var Q=P.dot(L);L.mult(Q,M),M.vadd(I,M);var R=p.get();if(M.vsub(n,R),Q>0&&Q*Q=a){var r=this.createContactEquation(t,l,e,f),w=cf;p.mult(p.dot(y),w),u.vsub(w,w),w.vsub(n,r.ri),r.ni.copy(p),u.vsub(o,r.rj),r.ri.vadd(n,r.ri),r.ri.vsub(t.position,r.ri),r.rj.vadd(o,r.rj),r.rj.vsub(l.position,r.rj),this.result.push(r),s++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(r,this.frictionResult)}}this.enableFrictionReduction&&s&&this.createFrictionFromAverage(s)};var af=new l,rf=new l;n.prototype[i.types.CONVEXPOLYHEDRON]=n.prototype.convexConvex=function(e,f,n,o,d,i,t,l,u,p,s,y){var c=af;if(!(n.distanceTo(o)>e.boundingSphereRadius+f.boundingSphereRadius)&&e.findSeparatingAxis(f,n,d,o,i,c,s,y)){var a=[],r=rf;e.clipAgainstHull(n,d,f,o,i,c,-100,100,a);for(var w=0,b=0;b!==a.length;b++){var m=this.createContactEquation(t,l,e,f,u,p),N=m.ri,g=m.rj;c.negate(m.ni),a[b].normal.negate(r),r.mult(a[b].depth,r),a[b].point.vadd(r,N),g.copy(a[b].point),N.vsub(n,N),g.vsub(o,g),N.vadd(n,N),N.vsub(t.position,N),g.vadd(o,g),g.vsub(l.position,g),this.result.push(m),w++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(m,this.frictionResult)}this.enableFrictionReduction&&w&&this.createFrictionFromAverage(w)}};var wf=new l,bf=new l,mf=new l;n.prototype[i.types.PLANE|i.types.PARTICLE]=n.prototype.planeParticle=function(e,f,n,o,d,i,t,l){var u=wf;u.set(0,0,1),t.quaternion.vmult(u,u);var p=bf;o.vsub(t.position,p);var s=u.dot(p);if(0>=s){var y=this.createContactEquation(l,t,f,e);y.ni.copy(u),y.ni.negate(y.ni),y.ri.set(0,0,0);var c=mf;u.mult(u.dot(o),c),o.vsub(c,c),y.rj.copy(c),this.result.push(y),this.createFrictionEquationsFromContact(y,this.frictionResult)}};var Nf=new l;n.prototype[i.types.PARTICLE|i.types.SPHERE]=n.prototype.sphereParticle=function(e,f,n,o,d,i,t,l){var u=Nf;u.set(0,0,1),o.vsub(n,u);var p=u.norm2();if(p<=e.radius*e.radius){var s=this.createContactEquation(l,t,f,e);u.normalize(),s.rj.copy(u),s.rj.mult(e.radius,s.rj),s.ni.copy(u),s.ni.negate(s.ni),s.ri.set(0,0,0),this.result.push(s),this.createFrictionEquationsFromContact(s,this.frictionResult)}};var gf=new p,xf=new l,jf=(new l,new l),vf=new l,Af=new l;n.prototype[i.types.PARTICLE|i.types.CONVEXPOLYHEDRON]=n.prototype.convexParticle=function(e,f,n,o,d,i,t,l){var u=-1,p=jf,s=Af,y=null,c=0,a=xf;if(a.copy(o),a.vsub(n,a),d.conjugate(gf),gf.vmult(a,a),e.pointIsInside(a)){e.worldVerticesNeedsUpdate&&e.computeWorldVertices(n,d),e.worldFaceNormalsNeedsUpdate&&e.computeWorldFaceNormals(d);for(var r=0,w=e.faces.length;r!==w;r++){var b=[e.worldVertices[e.faces[r][0]]],m=e.worldFaceNormals[r];o.vsub(b[0],vf);var N=-m.dot(vf);(null===y||Math.abs(N)b||0>N||w>p.length||m>p[0].length)){0>w&&(w=0),0>b&&(b=0),0>m&&(m=0),0>N&&(N=0),w>=p.length&&(w=p.length-1),b>=p.length&&(b=p.length-1),N>=p[0].length&&(N=p[0].length-1),m>=p[0].length&&(m=p[0].length-1);var g=[];f.getRectMinMax(w,m,b,N,g);var x=g[0],j=g[1];if(!(r.z-y>j||r.z+yv;v++)for(var A=m;N>A;A++)f.getConvexTrianglePillar(v,A,!1),u.pointToWorldFrame(o,i,f.pillarOffset,c),n.distanceTo(c)w||0>m||r>p.length||m>p[0].length)){0>r&&(r=0),0>w&&(w=0),0>b&&(b=0),0>m&&(m=0),r>=p.length&&(r=p.length-1),w>=p.length&&(w=p.length-1),m>=p[0].length&&(m=p[0].length-1),b>=p[0].length&&(b=p[0].length-1);var N=[];f.getRectMinMax(r,b,w,m,N);var g=N[0],x=N[1];if(!(a.z-s>x||a.z+sv;v++)for(var A=b;m>A;A++){var C=j.length;f.getConvexTrianglePillar(v,A,!1),u.pointToWorldFrame(o,i,f.pillarOffset,c),n.distanceTo(c)2)return}}}},{"../collision/AABB":3,"../collision/Ray":9,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"../shapes/ConvexPolyhedron":38,"../shapes/Shape":43,"../solver/Solver":47,"../utils/Vec3Pool":54}],56:[function(e,f){function n(){u.apply(this),this.dt=-1,this.allowSleep=!1,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=0,this.quatNormalizeFast=!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new d,this.broadphase=new m,this.bodies=[],this.solver=new t,this.constraints=[],this.narrowphase=new l(this),this.collisionMatrix=new p,this.collisionMatrixPrevious=new p,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new a,this.defaultMaterial=new s("default"),this.defaultContactMaterial=new y(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null}}f.exports=n;var o=e("../shapes/Shape"),d=e("../math/Vec3"),i=e("../math/Quaternion"),t=e("../solver/GSSolver"),l=(e("../utils/Vec3Pool"),e("../equations/ContactEquation"),e("../equations/FrictionEquation"),e("./Narrowphase")),u=e("../utils/EventTarget"),p=e("../collision/ArrayCollisionMatrix"),s=e("../material/Material"),y=e("../material/ContactMaterial"),c=e("../objects/Body"),a=e("../utils/TupleDictionary"),r=e("../collision/RaycastResult"),w=e("../collision/AABB"),b=e("../collision/Ray"),m=e("../collision/NaiveBroadphase");n.prototype=new u;var N=(new w,new b);if(n.prototype.getContactMaterial=function(e,f){return this.contactMaterialTable.get(e.id,f.id)},n.prototype.numObjects=function(){return this.bodies.length},n.prototype.collisionMatrixTick=function(){var e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset()},n.prototype.add=n.prototype.addBody=function(e){-1===this.bodies.indexOf(e)&&(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof c&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.dispatchEvent(this.addBodyEvent))},n.prototype.addConstraint=function(e){this.constraints.push(e)},n.prototype.removeConstraint=function(e){var f=this.constraints.indexOf(e);-1!==f&&this.constraints.splice(f,1)},n.prototype.rayTest=function(e,f,n){n instanceof r?this.raycastClosest(e,f,{skipBackfaces:!0},n):this.raycastAll(e,f,{skipBackfaces:!0},n)},n.prototype.raycastAll=function(e,f,n,o){return n.mode=b.ALL,n.from=e,n.to=f,n.callback=o,N.intersectWorld(this,n)},n.prototype.raycastAny=function(e,f,n,o){return n.mode=b.ANY,n.from=e,n.to=f,n.result=o,N.intersectWorld(this,n)},n.prototype.raycastClosest=function(e,f,n,o){return n.mode=b.CLOSEST,n.from=e,n.to=f,n.result=o,N.intersectWorld(this,n)},n.prototype.remove=function(e){e.world=null;var f=this.bodies.length-1,n=this.bodies,o=n.indexOf(e);if(-1!==o){n.splice(o,1);for(var d=0;d!==n.length;d++)n[d].index=d;this.collisionMatrix.setNumObjects(f),this.removeBodyEvent.body=e,this.dispatchEvent(this.removeBodyEvent)}},n.prototype.removeBody=n.prototype.remove,n.prototype.addMaterial=function(e){this.materials.push(e)},n.prototype.addContactMaterial=function(e){this.contactmaterials.push(e),this.contactMaterialTable.set(e.materials[0].id,e.materials[1].id,e)},"undefined"==typeof performance&&(performance={}),!performance.now){var g=Date.now();performance.timing&&performance.timing.navigationStart&&(g=performance.timing.navigationStart),performance.now=function(){return Date.now()-g}}var x=new d;n.prototype.step=function(e,f,n){if(n=n||10,f=f||0,0===f)this.internalStep(e),this.time+=e;else{var o=Math.floor((this.time+f)/e)-Math.floor(this.time/e);o=Math.min(o,n);for(var d=performance.now(),i=0;i!==o&&(this.internalStep(e),!(performance.now()-d>1e3*e));i++);this.time+=f;for(var t=this.time%e,l=t/e,u=x,p=this.bodies,s=0;s!==p.length;s++){var y=p[s];y.type!==c.STATIC&&y.sleepState!==c.SLEEPING?(y.position.vsub(y.previousPosition,u),u.scale(l,u),y.position.vadd(u,y.interpolatedPosition)):(y.interpolatedPosition.copy(y.position),y.interpolatedQuaternion.copy(y.quaternion))}}};var j={type:"postStep"},v={type:"preStep"},A={type:"collide",body:null,contact:null},C=[],O=[],h=[],k=[],q=(new d,new d,new d,new d,new d,new d,new d,new d,new d,new i,new i),z=new i,B=new d;n.prototype.internalStep=function(e){this.dt=e;var f,n=this.contacts,d=h,i=k,t=this.numObjects(),l=this.bodies,u=this.solver,p=this.gravity,s=this.doProfiling,y=this.profile,a=c.DYNAMIC,r=this.constraints,w=O,b=(p.norm(),p.x),m=p.y,N=p.z,g=0;for(s&&(f=performance.now()),g=0;g!==t;g++){var x=l[g];if(x.type&a){var D=x.force,E=x.mass;D.x+=E*b,D.y+=E*m,D.z+=E*N}}for(var g=0,F=this.subsystems.length;g!==F;g++)this.subsystems[g].update();s&&(f=performance.now()),d.length=0,i.length=0,this.broadphase.collisionPairs(this,d,i),s&&(y.broadphase=performance.now()-f);var G=r.length;for(g=0;g!==G;g++){var H=r[g];if(!H.collideConnected)for(var I=d.length-1;I>=0;I-=1)(H.bodyA===d[I]&&H.bodyB===i[I]||H.bodyB===d[I]&&H.bodyA===i[I])&&(d.splice(I,1),i.splice(I,1))}this.collisionMatrixTick(),s&&(f=performance.now());var J=C,K=n.length;for(g=0;g!==K;g++)J.push(n[g]);n.length=0;var L=this.frictionEquations.length;for(g=0;g!==L;g++)w.push(this.frictionEquations[g]);this.frictionEquations.length=0,this.narrowphase.getContacts(d,i,this,n,J,this.frictionEquations,w),s&&(y.narrowphase=performance.now()-f),s&&(f=performance.now());for(var g=0;g=0&&R.material.friction>=0&&(S=x.material.friction*R.material.friction),x.material.restitution>=0&&R.material.restitution>=0&&(H.restitution=x.material.restitution*R.material.restitution)),u.addEquation(H),x.allowSleep&&x.type===c.DYNAMIC&&x.sleepState===c.SLEEPING&&R.sleepState===c.AWAKE&&R.type!==c.STATIC){var T=R.velocity.norm2()+R.angularVelocity.norm2(),U=Math.pow(R.sleepSpeedLimit,2); -T>=2*U&&(x._wakeUpAfterNarrowphase=!0)}if(R.allowSleep&&R.type===c.DYNAMIC&&R.sleepState===c.SLEEPING&&x.sleepState===c.AWAKE&&x.type!==c.STATIC){var V=x.velocity.norm2()+x.angularVelocity.norm2(),W=Math.pow(x.sleepSpeedLimit,2);V>=2*W&&(R._wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(x,R,!0),this.collisionMatrixPrevious.get(x,R)||(A.body=R,A.contact=H,x.dispatchEvent(A),A.body=x,R.dispatchEvent(A))}for(s&&(y.makeContactConstraints=performance.now()-f,f=performance.now()),g=0;g!==t;g++){var x=l[g];x._wakeUpAfterNarrowphase&&(x.wakeUp(),x._wakeUpAfterNarrowphase=!1)}var G=r.length;for(g=0;g!==G;g++){var H=r[g];H.update();for(var I=0,X=H.equations.length;I!==X;I++){var Y=H.equations[I];u.addEquation(Y)}}u.solve(e,this),s&&(y.solve=performance.now()-f),u.removeAllEquations();var Z=Math.pow;for(g=0;g!==t;g++){var x=l[g];if(x.type&a){var $=Z(1-x.linearDamping,e),_=x.velocity;_.mult($,_);var ef=x.angularVelocity;if(ef){var ff=Z(1-x.angularDamping,e);ef.mult(ff,ef)}}}for(this.dispatchEvent(v),g=0;g!==t;g++){var x=l[g];x.preStep&&x.preStep.call(x)}s&&(f=performance.now());{var nf=q,of=z,df=this.stepnumber,tf=c.DYNAMIC|c.KINEMATIC,lf=df%(this.quatNormalizeSkip+1)===0,uf=this.quatNormalizeFast,pf=.5*e;o.types.PLANE,o.types.CONVEXPOLYHEDRON}for(g=0;g!==t;g++){var sf=l[g],yf=sf.force,cf=sf.torque;if(sf.type&tf&&sf.sleepState!==c.SLEEPING){var af=sf.velocity,rf=sf.angularVelocity,wf=sf.position,bf=sf.quaternion,mf=sf.invMass,Nf=sf.invInertiaWorld;af.x+=yf.x*mf*e,af.y+=yf.y*mf*e,af.z+=yf.z*mf*e,sf.angularVelocity&&(Nf.vmult(cf,B),B.mult(e,B),B.vadd(rf,rf)),wf.x+=af.x*e,wf.y+=af.y*e,wf.z+=af.z*e,sf.angularVelocity&&(nf.set(rf.x,rf.y,rf.z,0),nf.mult(bf,of),bf.x+=pf*of.x,bf.y+=pf*of.y,bf.z+=pf*of.z,bf.w+=pf*of.w,lf&&(uf?bf.normalizeFast():bf.normalize())),sf.aabb&&(sf.aabbNeedsUpdate=!0),sf.updateInertiaWorld&&sf.updateInertiaWorld()}}for(this.clearForces(),this.broadphase.dirty=!0,s&&(y.integrate=performance.now()-f),this.time+=e,this.stepnumber+=1,this.dispatchEvent(j),g=0;g!==t;g++){var x=l[g],gf=x.postStep;gf&&gf.call(x)}if(this.allowSleep)for(g=0;g!==t;g++)l[g].sleepTick(this.time)},n.prototype.clearForces=function(){for(var e=this.bodies,f=e.length,n=0;n!==f;n++){{var o=e[n];o.force,o.torque}o.force.set(0,0,0),o.torque.set(0,0,0)}}},{"../collision/AABB":3,"../collision/ArrayCollisionMatrix":4,"../collision/NaiveBroadphase":7,"../collision/Ray":9,"../collision/RaycastResult":10,"../equations/ContactEquation":19,"../equations/FrictionEquation":21,"../material/ContactMaterial":24,"../material/Material":25,"../math/Quaternion":28,"../math/Vec3":30,"../objects/Body":31,"../shapes/Shape":43,"../solver/GSSolver":46,"../utils/EventTarget":49,"../utils/TupleDictionary":52,"../utils/Vec3Pool":54,"./Narrowphase":55}]},{},[2])(2)}); -export default CANNON = window.CANNON; diff --git a/examples/jsm/libs/chevrotain.module.min.js b/examples/jsm/libs/chevrotain.module.min.js index fd41d3b680c28e..db9feb4ca54eb3 100644 --- a/examples/jsm/libs/chevrotain.module.min.js +++ b/examples/jsm/libs/chevrotain.module.min.js @@ -1,3 +1,3 @@ /*! chevrotain - v4.6.0 */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("chevrotain",[],e):"object"==typeof exports?exports.chevrotain=e():t.chevrotain=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=18)}([function(t,e,n){"use strict";function r(t){return t&&0===t.length}function i(t){return null==t?[]:Object.keys(t)}function o(t){for(var e=[],n=Object.keys(t),r=0;r0})},e.expandCategories=a,e.assignTokenDefaultProps=s,e.assignCategoriesTokensProp=u,e.assignCategoriesMapProp=c,e.singleAssignCategoriesToksMap=p,e.hasShortKeyProperty=l,e.hasCategoriesProperty=h,e.hasExtendingTokensTypesProperty=f,e.hasExtendingTokensTypesMapProperty=d,e.hasTokenNameProperty=E,e.isTokenType=function(t){return r.has(t,"tokenTypeIdx")}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(1),s=n(5),u=n(2);e.isSequenceProd=function(t){return t instanceof a.Flat||t instanceof a.Option||t instanceof a.Repetition||t instanceof a.RepetitionMandatory||t instanceof a.RepetitionMandatoryWithSeparator||t instanceof a.RepetitionWithSeparator||t instanceof a.Terminal||t instanceof a.Rule},e.isOptionalProd=function t(e,n){return void 0===n&&(n=[]),!!(e instanceof a.Option||e instanceof a.Repetition||e instanceof a.RepetitionWithSeparator)||(e instanceof a.Alternation?o.some(e.definition,function(e){return t(e,n)}):!(e instanceof a.NonTerminal&&o.contains(n,e))&&e instanceof a.AbstractProduction&&(e instanceof a.NonTerminal&&n.push(e),o.every(e.definition,function(e){return t(e,n)})))},e.isBranchingProd=function(t){return t instanceof a.Alternation},e.getProductionDslName=function(t){if(t instanceof a.NonTerminal)return"SUBRULE";if(t instanceof a.Option)return"OPTION";if(t instanceof a.Alternation)return"OR";if(t instanceof a.RepetitionMandatory)return"AT_LEAST_ONE";if(t instanceof a.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(t instanceof a.RepetitionWithSeparator)return"MANY_SEP";if(t instanceof a.Repetition)return"MANY";if(t instanceof a.Terminal)return"CONSUME";throw Error("non exhaustive match")};var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.separator="-",e.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},e}return i(e,t),e.prototype.visitTerminal=function(t){var e=u.tokenName(t.terminalType)+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitNonTerminal=function(t){var e=t.nonTerminalName+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(s.GAstVisitor);e.DslMethodsCollectorVisitor=c},function(t,e,n){"use strict";function r(t,e,n){return n|e|t}Object.defineProperty(e,"__esModule",{value:!0}),e.BITS_FOR_METHOD_IDX=4,e.BITS_FOR_OCCURRENCE_IDX=4,e.BITS_FOR_RULE_IDX=24,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1<")+a}},Object.freeze(e.defaultParserErrorProvider),e.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"}},e.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(t,e){var n,i=t.name,u=o.first(e),c=u.idx,p=s.getProductionDslName(u),l=(n=u)instanceof a.Terminal?r.tokenName(n.terminalType):n instanceof a.NonTerminal?n.nonTerminalName:"",h="->"+p+"<- with numerical suffix: ->"+c+"<-\n "+(l?"and argument: ->"+l+"<-":"")+"\n appears more than once ("+e.length+" times) in the top level rule: ->"+i+"<-.\n "+(0===c?"Also note that numerical suffix 0 means "+p+" without any suffix.":"")+"\n To fix this make sure each usage of "+p+" "+(l?"with the argument: ->"+l+"<-":"")+"\n in the rule ->"+i+"<- has a different occurrence index (0-5), as that combination acts as a unique\n position key in the grammar, which is needed by the parsing engine.\n \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return h=(h=h.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(t,e){return"Invalid nested rule name: ->"+e.name+"<- inside rule: ->"+t.name+"<-\nit must match the pattern: ->"+u.validNestedRuleName.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(t,e){return"Duplicate nested rule name: ->"+o.first(e).name+"<- inside rule: ->"+t.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(t){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;return"Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\nhttps://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx,i="Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+"> in inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\n",a=c.VERSION.replace(/\./g,"_");return i=i+"To Resolve this, try one of of the following: \n1. Refactor your grammar to be LL(K) for the current value of k (by default k="+p.DEFAULT_PARSER_CONFIG.maxLookahead+"})\n2. Increase the value of K for your grammar by providing a larger 'maxLookahead' value in the parser's config\n3. This issue can be ignored (if you know what you are doing...), see https://sap.github.io/chevrotain/documentation/"+a+"/interfaces/iparserconfig.html#ignoredissues for more details\n"},buildEmptyRepetitionError:function(t){var e=s.getProductionDslName(t.repetition);return 0!==t.repetition.idx&&(e+=t.repetition.idx),"The repetition <"+e+"> within Rule <"+t.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(t){return"Invalid Grammar Token name: ->"+r.tokenName(t.tokenType)+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(t){return"Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+"> in inside <"+t.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(t){return"An Alternation cannot have more than 256 alternatives:\n inside <"+t.topLevelRule.name+"> Rule.\n has "+(t.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(t){var e=t.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+e+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(e+" --\x3e "+i.map(t.leftRecursionPath,function(t){return t.name}).concat([e]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(t){return"Invalid grammar rule name: ->"+t.topLevelRule.name+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(t){return"Duplicate definition, rule: ->"+(t.topLevelRule instanceof a.Rule?t.topLevelRule.name:t.topLevelRule)+"<- is already defined in the grammar: ->"+t.grammarName+"<-"}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(0),s=n(3),u=n(8),c=n(2),p=n(12),l=n(16),h=n(13),f=n(1),d=n(5);function E(t){return u.getProductionDslName(t)+"_#_"+t.idx+"_#_"+m(t)}function m(t){return t instanceof f.Terminal?c.tokenName(t.terminalType):t instanceof f.NonTerminal?t.nonTerminalName:""}e.validateGrammar=function(t,e,n,r,i,p){var h=o.map(t,function(t){return function(t,e){var n=new y;t.accept(n);var r=n.allProductions,i=o.groupBy(r,E),a=o.pick(i,function(t){return t.length>1});return o.map(o.values(a),function(n){var r=o.first(n),i=e.buildDuplicateFoundError(t,n),a=u.getProductionDslName(r),c={message:i,type:s.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:r.idx},p=m(r);return p&&(c.parameter=p),c})}(t,i)}),f=o.map(t,function(t){return R(t,t,i)}),d=[],A=[],N=[];a.every(f,a.isEmpty)&&(d=a.map(t,function(t){return O(t,i)}),A=a.map(t,function(t){return S(t,e,r,i)}),N=k(t,e,i));var I=function(t,e,n){var r=[],i=a.map(e,function(t){return c.tokenName(t)});return a.forEach(t,function(t){var e=t.name;if(a.contains(i,e)){var o=n.buildNamespaceConflictError(t);r.push({message:o,type:s.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}}),r}(t,n,i),P=o.map(n,function(t){return g(t,i)}),x=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.map(r.result,function(t){return t.orgProd});n.push(a.map(i,function(n){return v(t,n,e)}))}),a.flatten(n)}(t,i),C=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.groupBy(r.result,function(t){return t.name}),o=a.pick(i,function(t){return t.length>1});a.forEach(a.values(o),function(r){var i=a.map(r,function(t){return t.orgProd}),o=e.buildDuplicateNestedRuleNameError(t,i);n.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:t.name})})}),n}(t,i),M=a.map(t,function(t){return L(t,i)}),F=a.map(t,function(t){return T(t,i)}),b=a.map(t,function(e){return _(e,t,p,i)});return o.flatten(h.concat(P,x,C,N,f,d,A,I,M,F,b))},e.identifyProductionForDuplicates=E;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(d.GAstVisitor);function T(t,n){var r=[],i=t.name;return i.match(e.validTermsPattern)||r.push({message:n.buildInvalidRuleNameError({topLevelRule:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:i}),r}function v(t,n,r){var i,o=[];return n.name.match(e.validNestedRuleName)||(i=r.buildInvalidNestedRuleNameError(t,n),o.push({message:i,type:s.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:t.name})),o}function g(t,n){var r=[];return c.tokenName(t).match(e.validTermsPattern)||r.push({message:n.buildTokenNameError({tokenType:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function _(t,e,n,r){var i=[];if(a.reduce(e,function(e,n){return n.name===t.name?e+1:e},0)>1){var o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function R(t,e,n,r){void 0===r&&(r=[]);var i=[],a=A(e.definition);if(o.isEmpty(a))return[];var u=t.name;o.contains(a,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:s.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:u});var c=o.difference(a,r.concat([t])),p=o.map(c,function(e){var i=o.cloneArr(r);return i.push(e),R(t,e,n,i)});return i.concat(o.flatten(p))}function A(t){var e=[];if(o.isEmpty(t))return e;var n=o.first(t);if(n instanceof f.NonTerminal)e.push(n.referencedRule);else if(n instanceof f.Flat||n instanceof f.Option||n instanceof f.RepetitionMandatory||n instanceof f.RepetitionMandatoryWithSeparator||n instanceof f.RepetitionWithSeparator||n instanceof f.Repetition)e=e.concat(A(n.definition));else if(n instanceof f.Alternation)e=o.flatten(o.map(n.definition,function(t){return A(t.definition)}));else if(!(n instanceof f.Terminal))throw Error("non exhaustive match");var r=u.isOptionalProd(n),i=t.length>1;if(r&&i){var a=o.drop(t);return e.concat(A(a))}return e}e.OccurrenceValidationCollector=y,e.validTermsPattern=/^[a-zA-Z_]\w*$/,e.validNestedRuleName=new RegExp(e.validTermsPattern.source.replace("^","^\\$")),e.validateRuleName=T,e.validateNestedRuleName=v,e.validateTokenName=g,e.validateRuleDoesNotAlreadyExist=_,e.validateRuleIsOverridden=function(t,e,n){var r,i=[];return o.contains(e,t)||(r="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+n+"<-as it is not defined in any of the super grammars ",i.push({message:r,type:s.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),i},e.validateNoLeftRecursion=R,e.getFirstNoneTerminal=A;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.alternations=[],e}return i(e,t),e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(d.GAstVisitor);function O(t,e){var n=new N;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){var i=o.dropRight(r.definition),a=o.map(i,function(n,i){var a=h.nextPossibleTokensAfter([n],[],null,1);return o.isEmpty(a)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:r,emptyChoiceIdx:i}),type:s.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:r.idx,alternative:i+1}:null});return n.concat(o.compact(a))},[])}function S(t,e,n,r){var i=new N;t.accept(i);var c=i.alternations,l=n[t.name];return l&&(c=a.reject(c,function(t){return l[u.getProductionDslName(t)+(0===t.idx?"":t.idx)]})),o.reduce(c,function(n,i){var u=i.idx,c=p.getLookaheadPathsForOr(u,t,e),l=function(t,e,n,r){var i=[],u=a.reduce(t,function(e,n,r){return a.forEach(n,function(n){var o=[r];a.forEach(t,function(t,e){r!==e&&p.containsPath(t,n)&&o.push(e)}),o.length>1&&!p.containsPath(i,n)&&(i.push(n),e.push({alts:o,path:n}))}),e},[]);return o.map(u,function(t){var i=a.map(t.alts,function(t){return t+1}),o=r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path});return{message:o,type:s.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:[t.alts]}})}(c,i,t,r),h=P(c,i,t,r);return n.concat(l,h)},[])}e.validateEmptyOrAlternative=O,e.validateAmbiguousAlternationAlternatives=S;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(d.GAstVisitor);function L(t,e){var n=new N;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){return r.definition.length>255&&n.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:s.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}),n},[])}function k(t,e,n){var r=[];return a.forEach(t,function(t){var i=new I;t.accept(i);var o=i.allProductions;a.forEach(o,function(i){var o=p.getProdType(i),u=i.idx,c=p.getLookaheadPathsForOptionalProd(u,t,o,e)[0];if(a.isEmpty(a.flatten(c))){var l=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:l,type:s.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}})}),r}function P(t,e,n,r){var i=[],o=a.reduce(t,function(t,e,n){var r=a.map(e,function(t){return{idx:n,path:t}});return t.concat(r)},[]);return a.forEach(o,function(t){var u=t.idx,c=t.path,l=a.findAll(o,function(t){return t.idx=0;L--){var k={idx:d,def:T.definition[L].definition.concat(a.drop(f)),ruleStack:E,occurrenceStack:m};l.push(k),l.push("EXIT_ALTERNATIVE")}else if(T instanceof c.Flat)l.push({idx:d,def:T.definition.concat(a.drop(f)),ruleStack:E,occurrenceStack:m});else{if(!(T instanceof c.Rule))throw Error("non exhaustive match");l.push(y(T,d,E,m))}}}else o&&a.last(l).idx<=u&&l.pop()}return p}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=function(){function t(){}return t.prototype.walk=function(t,e){var n=this;void 0===e&&(e=[]),r.forEach(t.definition,function(o,a){var s=r.drop(t.definition,a+1);if(o instanceof i.NonTerminal)n.walkProdRef(o,s,e);else if(o instanceof i.Terminal)n.walkTerminal(o,s,e);else if(o instanceof i.Flat)n.walkFlat(o,s,e);else if(o instanceof i.Option)n.walkOption(o,s,e);else if(o instanceof i.RepetitionMandatory)n.walkAtLeastOne(o,s,e);else if(o instanceof i.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(o,s,e);else if(o instanceof i.RepetitionWithSeparator)n.walkManySep(o,s,e);else if(o instanceof i.Repetition)n.walkMany(o,s,e);else{if(!(o instanceof i.Alternation))throw Error("non exhaustive match");n.walkOr(o,s,e)}})},t.prototype.walkTerminal=function(t,e,n){},t.prototype.walkProdRef=function(t,e,n){},t.prototype.walkFlat=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkOption=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkAtLeastOne=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkAtLeastOneSep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkMany=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkManySep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkOr=function(t,e,n){var o=this,a=e.concat(n);r.forEach(t.definition,function(t){var e=new i.Flat({definition:[t]});o.walk(e,a)})},t}();function a(t,e,n){return[new i.Option({definition:[new i.Terminal({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}e.RestWalker=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(27),i=n(0),o=n(7),a=n(20);!function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(e.LexerDefinitionErrorType||(e.LexerDefinitionErrorType={}));var s={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:a.defaultLexerErrorProvider};Object.freeze(s);var u=function(){function t(t,e){var n=this;if(void 0===e&&(e=s),this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof e)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");if(this.config=i.merge(s,e),this.config.lineTerminatorsPattern===s.lineTerminatorsPattern)this.config.lineTerminatorsPattern=r.LineTerminatorOptimizedTester;else if(this.config.lineTerminatorCharacters===s.lineTerminatorCharacters)throw Error("Error: Missing property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking);var a,u=!0;i.isArray(t)?((a={modes:{}}).modes[r.DEFAULT_MODE]=i.cloneArr(t),a[r.DEFAULT_MODE]=r.DEFAULT_MODE):(u=!1,a=i.cloneObj(t)),this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(r.performRuntimeChecks(a,this.trackStartLines,this.config.lineTerminatorCharacters)),this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(r.performWarningRuntimeChecks(a,this.trackStartLines,this.config.lineTerminatorCharacters)),a.modes=a.modes?a.modes:{},i.forEach(a.modes,function(t,e){a.modes[e]=i.reject(t,function(t){return i.isUndefined(t)})});var c=i.keys(a.modes);if(i.forEach(a.modes,function(t,a){if(n.modes.push(a),n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.validatePatterns(t,c)),i.isEmpty(n.lexerDefinitionErrors)){o.augmentTokenTypes(t);var s=r.analyzeTokenTypes(t,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode});n.patternIdxToConfig[a]=s.patternIdxToConfig,n.charCodeToPatternIdxToConfig[a]=s.charCodeToPatternIdxToConfig,n.emptyGroups=i.merge(n.emptyGroups,s.emptyGroups),n.hasCustom=s.hasCustom||n.hasCustom,n.canModeBeOptimized[a]=s.canBeOptimized}}),this.defaultMode=a.defaultMode,!i.isEmpty(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){var p=i.map(this.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+p)}if(i.forEach(this.lexerDefinitionWarning,function(t){i.PRINT_WARNING(t.message)}),r.SUPPORT_STICKY?(this.chopInput=i.IDENTITY,this.match=this.matchWithTest):(this.updateLastIndex=i.NOOP,this.match=this.matchWithExec),u&&(this.handleModes=i.NOOP),!1===this.trackStartLines&&(this.computeNewColumn=i.IDENTITY),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=i.NOOP),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error('Invalid config option: "'+this.config.positionTracking+'"');this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?this.addToken=this.addTokenUsingPush:this.addToken=this.addTokenUsingMemberAccess;var l=i.reduce(this.canModeBeOptimized,function(t,e,n){return!1===e&&t.push(n),t},[]);if(e.ensureOptimizations&&!i.isEmpty(l))throw Error("Lexer Modes: < "+l.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')}return t.prototype.tokenize=function(t,e){if(void 0===e&&(e=this.defaultMode),!i.isEmpty(this.lexerDefinitionErrors)){var n=i.map(this.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(t,e)},t.prototype.tokenizeInternal=function(t,e){var n,o,a,s,u,c,p,l,h,f,d,E,m=this,y=t,T=y.length,v=0,g=0,_=this.hasCustom?0:Math.floor(t.length/10),R=new Array(_),A=[],N=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,S=r.cloneEmptyGroups(this.emptyGroups),I=this.trackStartLines,L=this.config.lineTerminatorsPattern,k=0,P=[],x=[],C=[],M=[];Object.freeze(M);var F,b=void 0,D=function(t){if(1===C.length&&void 0===t.tokenType.PUSH_MODE){var e=m.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);A.push({offset:t.startOffset,line:void 0!==t.startLine?t.startLine:void 0,column:void 0!==t.startColumn?t.startColumn:void 0,length:t.image.length,message:e})}else{C.pop();var n=i.last(C);P=m.patternIdxToConfig[n],x=m.charCodeToPatternIdxToConfig[n],k=P.length;var r=m.canModeBeOptimized[n]&&!1===m.config.safeMode;b=x&&r?function(t){var e=x[t];return void 0===e?M:e}:function(){return P}}};function w(t){C.push(t),x=this.charCodeToPatternIdxToConfig[t],P=this.patternIdxToConfig[t],k=P.length,k=P.length;var e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;b=x&&e?function(t){var e=x[t];return void 0===e?M:e}:function(){return P}}for(w.call(this,e);vu.length&&(u=a,F=W)}break}}if(null!==u){if(c=u.length,void 0!==(p=F.group)&&(l=F.tokenTypeIdx,h=this.createTokenInstance(u,v,l,F.tokenType,N,O,c),!1===p?g=this.addToken(R,g,h):S[p].push(h)),t=this.chopInput(t,c),v+=c,O=this.computeNewColumn(O,c),!0===I&&!0===F.canLineTerminator){var V=0,Y=void 0,H=void 0;L.lastIndex=0;do{!0===(Y=L.test(u))&&(H=L.lastIndex-1,V++)}while(Y);0!==V&&(N+=V,O=c-H,this.updateTokenEndLineColumnLocation(h,p,H,V,N,O,c))}this.handleModes(F,D,w,h)}else{for(var X=v,z=N,q=O,$=!1;!$&&v1;o.forEach(t.definition,function(r,i){if(!o.isUndefined(r.name)){var a=r.definition;a=n?[new u.Option({definition:r.definition})]:r.definition;var c=s.getKeyForAltIndex(e.ruleIdx,s.OR_IDX,t.idx,i);e.result.push({def:a,key:c,name:r.name,orgProd:r})}})},e}(c.GAstVisitor);e.NamedDSLMethodsCollectorVisitor=p,e.analyzeCst=function(t,e){var n={dictDef:new a.HashTable,allRuleNames:[]};return o.forEach(t,function(t){var r=e.get(t.name);n.allRuleNames.push(t.name);var i=new p(r);t.accept(i),o.forEach(i.result,function(e){e.def,e.key;var r=e.name;n.allRuleNames.push(t.name+r)})}),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION="4.6.0"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(15),o=n(2),a=n(6),s=n(17),u=n(10),c=n(39),p=n(5),l=n(1),h=n(24),f=n(40),d=n(20),E={};E.VERSION=s.VERSION,E.Parser=r.Parser,E.CstParser=r.CstParser,E.EmbeddedActionsParser=r.EmbeddedActionsParser;E.ParserDefinitionErrorType=r.ParserDefinitionErrorType,E.Lexer=i.Lexer,E.LexerDefinitionErrorType=i.LexerDefinitionErrorType,E.EOF=o.EOF,E.tokenName=o.tokenName,E.tokenLabel=o.tokenLabel,E.tokenMatcher=o.tokenMatcher,E.createToken=o.createToken,E.createTokenInstance=o.createTokenInstance,E.EMPTY_ALT=r.EMPTY_ALT,E.defaultParserErrorProvider=u.defaultParserErrorProvider,E.isRecognitionException=a.isRecognitionException,E.EarlyExitException=a.EarlyExitException,E.MismatchedTokenException=a.MismatchedTokenException,E.NotAllInputParsedException=a.NotAllInputParsedException,E.NoViableAltException=a.NoViableAltException,E.defaultLexerErrorProvider=d.defaultLexerErrorProvider,E.Flat=l.Flat,E.Repetition=l.Repetition,E.RepetitionWithSeparator=l.RepetitionWithSeparator,E.RepetitionMandatory=l.RepetitionMandatory,E.RepetitionMandatoryWithSeparator=l.RepetitionMandatoryWithSeparator,E.Option=l.Option,E.Alternation=l.Alternation,E.NonTerminal=l.NonTerminal,E.Terminal=l.Terminal,E.Rule=l.Rule,E.GAstVisitor=p.GAstVisitor,E.serializeGrammar=l.serializeGrammar,E.serializeProduction=l.serializeProduction,E.resolveGrammar=h.resolveGrammar,E.defaultGrammarResolverErrorProvider=u.defaultGrammarResolverErrorProvider,E.validateGrammar=h.validateGrammar,E.defaultGrammarValidatorErrorProvider=u.defaultGrammarValidatorErrorProvider,E.assignOccurrenceIndices=h.assignOccurrenceIndices,E.clearCache=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")},E.createSyntaxDiagramsCode=c.createSyntaxDiagramsCode,E.generateParserFactory=f.generateParserFactory,E.generateParserModule=f.generateParserModule,t.exports=E},function(t,e,n){var r,i,o;"undefined"!=typeof self&&self,i=[],void 0===(o="function"==typeof(r=function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx},t.prototype.pattern=function(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");var e=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(n,"global");break;case"i":s(n,"ignoreCase");break;case"m":s(n,"multiLine");break;case"u":s(n,"unicode");break;case"y":s(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e}},t.prototype.disjunction=function(){var t=[];for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t}},t.prototype.alternative=function(){for(var t=[];this.isTerm();)t.push(this.term());return{type:"Alternative",value:t}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}u(t);var e=this.disjunction();return this.consumeChar(")"),{type:t,value:e}}!function(){throw Error("Internal Error - Should never get here!")}()},t.prototype.quantifier=function(t){var e;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:n,atMost:n};break;case",":var r;this.isDigit()?(r=this.integerIncludingZero(),e={atLeast:n,atMost:r}):e={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;u(e)}if(!0!==t||void 0!==e)return u(e),"?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e},t.prototype.atom=function(){var t;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}return void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),u(t),this.isQuantifier()&&(t.quantifier=this.quantifier()),t},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},t.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.decimalEscapeAtom=function(){var t=this.positiveInteger();return{type:"GroupBackReference",value:t}},t.prototype.characterClassEscape=function(){var t,e=!1;switch(this.popChar()){case"d":t=c;break;case"D":t=c,e=!0;break;case"s":t=l;break;case"S":t=l,e=!0;break;case"w":t=p;break;case"W":t=p,e=!0}return u(t),{type:"Set",value:t,complement:e}},t.prototype.controlEscapeAtom=function(){var t;switch(this.popChar()){case"f":t=o("\f");break;case"n":t=o("\n");break;case"r":t=o("\r");break;case"t":t=o("\t");break;case"v":t=o("\v")}return u(t),{type:"Character",value:t}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");var e=t.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:e}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var t=this.popChar();return{type:"Character",value:o(t)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var t=this.popChar();return{type:"Character",value:o(t)}}},t.prototype.characterClass=function(){var t=[],e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){var n=this.classAtom(),r="Character"===n.type;if(r&&this.isRangeDash()){this.consumeChar("-");var i=this.classAtom(),s="Character"===i.type;if(s){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++};var e,n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function o(t){return t.charCodeAt(0)}function a(t,e){void 0!==t.length?t.forEach(function(t){e.push(t)}):e.push(t)}function s(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e]=!0}function u(t){if(void 0===t)throw Error("Internal Error - Should never get here!")}var c=[];for(e=o("0");e<=o("9");e++)c.push(e);var p=[o("_")].concat(c);for(e=o("a");e<=o("z");e++)p.push(e);for(e=o("A");e<=o("Z");e++)p.push(e);var l=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function h(){}return h.prototype.visitChildren=function(t){for(var e in t){var n=t[e];t.hasOwnProperty(e)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(function(t){this.visit(t)},this))}},h.prototype.visit=function(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)},h.prototype.visitPattern=function(t){},h.prototype.visitFlags=function(t){},h.prototype.visitDisjunction=function(t){},h.prototype.visitAlternative=function(t){},h.prototype.visitStartAnchor=function(t){},h.prototype.visitEndAnchor=function(t){},h.prototype.visitWordBoundary=function(t){},h.prototype.visitNonWordBoundary=function(t){},h.prototype.visitLookahead=function(t){},h.prototype.visitNegativeLookahead=function(t){},h.prototype.visitCharacter=function(t){},h.prototype.visitSet=function(t){},h.prototype.visitGroup=function(t){},h.prototype.visitGroupBackReference=function(t){},h.prototype.visitQuantifier=function(t){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.4.0"}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,n,r,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+", skipped "+n+" characters."}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(8);function a(t){if(t instanceof i.NonTerminal)return a(t.referencedRule);if(t instanceof i.Terminal)return c(t);if(o.isSequenceProd(t))return s(t);if(o.isBranchingProd(t))return u(t);throw Error("non exhaustive match")}function s(t){for(var e,n=[],i=t.definition,s=0,u=i.length>s,c=!0;u&&c;)e=i[s],c=o.isOptionalProd(e),n=n.concat(a(e)),s+=1,u=i.length>s;return r.uniq(n)}function u(t){var e=r.map(t.definition,function(t){return a(t)});return r.uniq(r.flatten(e))}function c(t){return[t.terminalType]}e.first=a,e.firstForSequence=s,e.firstForBranching=u,e.firstForTerminal=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IN="_~IN~_"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(29),o=n(0),a=n(1);!function(t){t[t.OPTION=0]="OPTION",t[t.OR=1]="OR",t[t.MANY=2]="MANY",t[t.MANY_SEP=3]="MANY_SEP",t[t.AT_LEAST_ONE=4]="AT_LEAST_ONE",t[t.AT_LEAST_ONE_SEP=5]="AT_LEAST_ONE_SEP",t[t.REF=6]="REF",t[t.TERMINAL=7]="TERMINAL",t[t.FLAT=8]="FLAT"}(r=e.ProdType||(e.ProdType={}));var s=/(?:\s*{\s*NAME\s*:\s*["'`]([\w$]*)["'`])?/,u=new RegExp(s.source.replace("{","").replace(")?","\\s*,)?")),c=/\.\s*CONSUME(\d+)?\s*\(\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,p=new RegExp(c.source,"g"),l=/\.\s*SUBRULE(\d+)?\s*\(\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,h=new RegExp(l.source,"g"),f=/\.\s*OPTION(\d+)?\s*\(/,d=new RegExp(f.source+s.source),E=new RegExp(f.source,"g"),m=/\.\s*MANY(\d+)?\s*\(/,y=new RegExp(m.source+s.source),T=new RegExp(m.source,"g"),v=/\s*SEP\s*:\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,g=new RegExp(/\.\s*MANY_SEP(\d+)?\s*\(\s*{/.source+u.source+v.source),_=new RegExp(g.source,"g"),R=new RegExp(/\.\s*AT_LEAST_ONE_SEP(\d+)?\s*\(\s*{/.source+u.source+v.source),A=new RegExp(R.source,"g"),N=/\.\s*AT_LEAST_ONE(\d+)?\s*\(/,O=new RegExp(N.source+s.source),S=new RegExp(N.source,"g"),I=/\.\s*OR(\d+)?\s*\(/,L=new RegExp(I.source+s.source),k=new RegExp(I.source,"g"),P=new RegExp(u.source+/\s*(ALT)\s*:/.source),x=new RegExp(P.source,"g");function C(t,n,i){switch(t.type){case r.AT_LEAST_ONE:return function(t,e,n){return M(O,new a.RepetitionMandatory({definition:[]}),t,e,n)}(t,n,i);case r.AT_LEAST_ONE_SEP:return function(t,e,n){return F(t,e,a.RepetitionMandatoryWithSeparator,R,n)}(t,n,i);case r.MANY_SEP:return function(t,e,n){return F(t,e,a.RepetitionWithSeparator,g,n)}(t,n,i);case r.MANY:return function(t,e,n){return M(y,new a.Repetition({definition:[]}),t,e,n)}(t,n,i);case r.OPTION:return function(t,e,n){return M(d,new a.Option({definition:[]}),t,e,n)}(t,n,i);case r.OR:return function(t,e,n){return M(L,new a.Alternation({definition:[]}),t,e,n)}(t,n,i);case r.FLAT:return function(t,e,n){var r=new a.Flat({definition:[]}),i=P.exec(t.text)[1];o.isUndefined(i)||(r.name=i);return b(r,t.range,e,n)}(t,n,i);case r.REF:return function(t){var e=l.exec(t.text),n=void 0===e[1]?0:parseInt(e[1],10),r=e[2];return new a.NonTerminal({nonTerminalName:r,idx:n})}(t);case r.TERMINAL:return function(t,n){var r=c.exec(t.text),i=void 0===r[1]?0:parseInt(r[1],10),o=r[2],s=e.terminalNameToConstructor[o];if(!s)throw Error("Terminal Token name: <"+o+"> not found in rule: <"+n+"> \n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#TERMINAL_NAME_NOT_FOUND\n\tFor Further details.");return new a.Terminal({terminalType:s,idx:i})}(t,i);default:throw Error("non exhaustive match")}}function M(t,e,n,r,i){var a=t.exec(n.text),s=void 0===a[1];e.idx=s?0:parseInt(a[1],10);var u=a[2];return o.isUndefined(u)||(e.name=u),b(e,n.range,r,i)}function F(t,n,r,i,a){var s=i.exec(t.text),u=void 0===s[1]?0:parseInt(s[1],10),c=s[3],p=e.terminalNameToConstructor[c];if(!p)throw Error("Separator Terminal Token name: "+c+" not found");var l=new r({definition:[],separator:p,idx:u}),h=s[2];return o.isUndefined(h)||(l.name=h),b(l,t.range,n,a)}function b(t,e,n,r){var i=D(e,n),a=o.sortBy(i,function(t){return t.range.start}),s=[];return o.forEach(a,function(t){s.push(C(t,n,r))}),t.definition=s,t}function D(t,e){return o.filter(e,function(n){var r=t.strictlyContainsRange(n.range),i=o.every(e,function(e){var r=e.range.strictlyContainsRange(n.range),i=e.range.isStrictlyContainedInRange(t);return!(r&&i)});return r&&i})}e.terminalNameToConstructor={},e.buildTopProduction=function(t,n,r){e.terminalNameToConstructor=r;var o=V(j(K(" "+t)));return function(t,e,n,r){return b(new a.Rule({name:t,definition:[],orgText:r}),e,n,t)}(n,new i.Range(0,t.length+2),o,t)},e.buildProdGast=C,e.getDirectlyContainedRanges=D;var w=/\/\/.*/g,U=/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\//g,G=/(NAME\s*:\s*)?"([^\\"]|\\([bfnrtv"\\\/]|u[0-9a-fA-F]{4}))*"/g,B=/(NAME\s*:\s*)?'([^\\']|\\([bfnrtv'\\\/]|u[0-9a-fA-F]{4}))*'/g;function K(t){return t.replace(w,"").replace(U,"")}function W(t,e){return void 0!==e?t:""}function j(t){return t.replace(G,W).replace(B,W)}function V(t){var e=Y(t),n=H(t),r=X(t),i=z(t),o=q(t),a=$(t),s=Z(t),u=Q(t);return[].concat(e,n,r,i,o,a,s,u)}function Y(t){return nt(t,r.TERMINAL,p)}function H(t){return nt(t,r.REF,h)}function X(t){return rt(t,r.AT_LEAST_ONE,S)}function z(t){return rt(t,r.AT_LEAST_ONE_SEP,A)}function q(t){return rt(t,r.MANY,T)}function $(t){return rt(t,r.MANY_SEP,_)}function Z(t){return rt(t,r.OPTION,E)}function Q(t){var e=rt(t,r.OR,k),n=et(e);return e.concat(n)}e.removeComments=K,e.removeStringLiterals=j,e.createRanges=V,e.createTerminalRanges=Y,e.createRefsRanges=H,e.createAtLeastOneRanges=X,e.createAtLeastOneSepRanges=z,e.createManyRanges=q,e.createManySepRanges=$,e.createOptionRanges=Z,e.createOrRanges=Q;var J=o.partial(ot,"{","}"),tt=o.partial(ot,"(",")");function et(t){var e=[];return o.forEach(t,function(t){var n=it(t.text,r.FLAT,x,J),i=t.range.start;o.forEach(n,function(t){t.range.start+=i,t.range.end+=i}),e=e.concat(n)}),o.uniq(e,function(t){return t.type+"~"+t.range.start+"~"+t.range.end+"~"+t.text})}function nt(t,e,n){for(var r,o=[];r=n.exec(t);){var a=r.index,s=n.lastIndex,u=new i.Range(a,s),c=r[0];o.push({range:u,text:c,type:e})}return o}function rt(t,e,n){return it(t,e,n,tt)}function it(t,e,n,r){for(var o,a=[];o=n.exec(t);){var s=o.index,u=r(s+o[0].length,t),c=new i.Range(s,u),p=t.substr(s,u-s+1);a.push({range:c,text:p,type:e})}return a}function ot(t,e,n,r){for(var i=[1],a=-1;!o.isEmpty(i)&&a+n"+a.tokenName(t)+"<- missing static 'PATTERN' property",type:s.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[t]}}),valid:u.difference(t,e)}}function f(t){var e=u.filter(t,function(t){var e=t[l];return!(u.isRegExp(e)||u.isFunction(e)||u.has(e,"exec")||u.isString(e))});return{errors:u.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:s.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[t]}}),valid:u.difference(t,e)}}e.DEFAULT_MODE="defaultMode",e.MODES="modes",e.SUPPORT_STICKY="boolean"==typeof new RegExp("(?:)").sticky,e.disableSticky=function(){e.SUPPORT_STICKY=!1},e.enableSticky=function(){e.SUPPORT_STICKY=!0},e.analyzeTokenTypes=function(t,n){n=u.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"]});var r=u.reject(t,function(t){return t[l]===s.Lexer.NA}),i=!1,o=u.map(r,function(t){var e=t[l];if(u.isRegExp(e)){var r=e.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||u.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?n.useSticky?O(e):N(e):r[1]}if(u.isFunction(e))return i=!0,{exec:e};if(u.has(e,"exec"))return i=!0,e;if("string"==typeof e){if(1===e.length)return e;var o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(o);return n.useSticky?O(a):N(a)}throw Error("non exhaustive match")}),p=u.map(r,function(t){return t.tokenTypeIdx}),h=u.map(r,function(t){var e=t.GROUP;if(e!==s.Lexer.SKIPPED){if(u.isString(e))return e;if(u.isUndefined(e))return!1;throw Error("non exhaustive match")}}),f=u.map(r,function(t){var e=t.LONGER_ALT;if(e)return u.indexOf(r,e)}),d=u.map(r,function(t){return t.PUSH_MODE}),E=u.map(r,function(t){return u.has(t,"POP_MODE")}),m=P(n.lineTerminatorCharacters),y=u.map(r,function(t){return!1});"onlyOffset"!==n.positionTracking&&(y=u.map(r,function(t){return u.has(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===L(t,m)?c.canMatchCharCode(m,t.PATTERN):void 0}));var T=u.map(r,S),v=u.map(o,I),g=u.reduce(r,function(t,e){var n=e.GROUP;return u.isString(n)&&n!==s.Lexer.SKIPPED&&(t[n]=[]),t},{}),_=u.map(o,function(t,e){return{pattern:o[e],longerAlt:f[e],canLineTerminator:y[e],isCustom:T[e],short:v[e],group:h[e],push:d[e],pop:E[e],tokenTypeIdx:p[e],tokenType:r[e]}});function R(t,e,n){void 0===t[e]&&(t[e]=[]),t[e].push(n)}var A=!0,k=[];return n.safeMode||(k=u.reduce(r,function(t,e,r){if("string"==typeof e.PATTERN){var i=e.PATTERN.charCodeAt(0);R(t,i,_[r])}else if(u.isArray(e.START_CHARS_HINT))u.forEach(e.START_CHARS_HINT,function(e){var n="string"==typeof e?e.charCodeAt(0):e;R(t,n,_[r])});else if(u.isRegExp(e.PATTERN))if(e.PATTERN.unicode)A=!1,n.ensureOptimizations&&u.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tUnable to analyze < "+e.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var o=c.getStartCodes(e.PATTERN,n.ensureOptimizations);u.isEmpty(o)&&(A=!1),u.forEach(o,function(e){R(t,e,_[r])})}else n.ensureOptimizations&&u.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tTokenType: <"+a.tokenName(e)+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),A=!1;return t},[])),A&&k.length<65536&&(k=u.packArray(k)),{emptyGroups:g,patternIdxToConfig:_,charCodeToPatternIdxToConfig:k,hasCustom:i,canBeOptimized:A}},e.validatePatterns=function(t,e){var n=[],r=h(t);n=n.concat(r.errors);var i=f(r.valid),o=i.valid;return n=(n=(n=(n=(n=n.concat(i.errors)).concat(function(t){var e=[],n=u.filter(t,function(t){return u.isRegExp(t[l])});return e=(e=(e=(e=(e=e.concat(E(n))).concat(T(n))).concat(v(n))).concat(g(n))).concat(m(n))}(o))).concat(_(o))).concat(R(o,e))).concat(A(o))},e.findMissingPatterns=h,e.findInvalidPatterns=f;var d=/[^\\][\$]/;function E(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitEndAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=u.filter(t,function(t){var n=t[l];try{var r=p.pattern(n.toString()),i=new e;return i.visit(r),i.found}catch(t){return d.test(n.source)}});return u.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+a.tokenName(t)+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:s.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[t]}})}function m(t){var e=u.filter(t,function(t){return t[l].test("")});return u.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' must not match an empty string",type:s.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[t]}})}e.findEndOfInputAnchor=E,e.findEmptyMatchRegExps=m;var y=/[^\\[][\^]|^\^/;function T(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitStartAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=u.filter(t,function(t){var n=t[l];try{var r=p.pattern(n.toString()),i=new e;return i.visit(r),i.found}catch(t){return y.test(n.source)}});return u.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+a.tokenName(t)+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:s.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[t]}})}function v(t){var e=u.filter(t,function(t){var e=t[l];return e instanceof RegExp&&(e.multiline||e.global)});return u.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:s.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]}})}function g(t){var e=[],n=u.map(t,function(n){return u.reduce(t,function(t,r){return n.PATTERN.source!==r.PATTERN.source||u.contains(e,r)||r.PATTERN===s.Lexer.NA?t:(e.push(r),t.push(r),t)},[])});n=u.compact(n);var r=u.filter(n,function(t){return t.length>1});return u.map(r,function(t){var e=u.map(t,function(t){return a.tokenName(t)});return{message:"The same RegExp pattern ->"+u.first(t).PATTERN+"<-has been used in all of the following Token Types: "+e.join(", ")+" <-",type:s.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}})}function _(t){var e=u.filter(t,function(t){if(!u.has(t,"GROUP"))return!1;var e=t.GROUP;return e!==s.Lexer.SKIPPED&&e!==s.Lexer.NA&&!u.isString(e)});return u.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:s.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]}})}function R(t,e){var n=u.filter(t,function(t){return void 0!==t.PUSH_MODE&&!u.contains(e,t.PUSH_MODE)});return u.map(n,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+t.PUSH_MODE+"<-which does not exist",type:s.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]}})}function A(t){var e=[],n=u.reduce(t,function(t,e,n){var r,i=e.PATTERN;return i===s.Lexer.NA?t:(u.isString(i)?t.push({str:i,idx:n,tokenType:e}):u.isRegExp(i)&&(r=i,void 0===u.find([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(t){return-1!==r.source.indexOf(t)}))&&t.push({str:i.source,idx:n,tokenType:e}),t)},[]);return u.forEach(t,function(t,r){u.forEach(n,function(n){var i=n.str,o=n.idx,c=n.tokenType;if(r"+a.tokenName(t)+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";e.push({message:p,type:s.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[t,c]})}})}),e}function N(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function O(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function S(t){var e=t.PATTERN;if(u.isRegExp(e))return!1;if(u.isFunction(e))return!0;if(u.has(e,"exec"))return!0;if(u.isString(e))return!1;throw Error("non exhaustive match")}function I(t){return!(!u.isString(t)||1!==t.length)&&t.charCodeAt(0)}function L(t,e){if(u.has(t,"LINE_BREAKS"))return!1;if(u.isRegExp(t.PATTERN)){try{c.canMatchCharCode(e,t.PATTERN)}catch(t){return{issue:s.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(u.isString(t.PATTERN))return!1;if(S(t))return{issue:s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function k(t,e){if(e.issue===s.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+t.name+"> Token Type\n\t Root cause: "+e.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+t.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function P(t){return u.map(t,function(t){return u.isString(t)&&t.length>0?t.charCodeAt(0):t})}e.findStartOfInputAnchor=T,e.findUnsupportedFlags=v,e.findDuplicatePatterns=g,e.findInvalidGroupType=_,e.findModesThatDoNotExist=R,e.findUnreachablePatterns=A,e.addStartOfInput=N,e.addStickyFlag=O,e.performRuntimeChecks=function(t,n,r){var i=[];return u.has(t,e.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.DEFAULT_MODE+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),u.has(t,e.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.MODES+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),u.has(t,e.MODES)&&u.has(t,e.DEFAULT_MODE)&&!u.has(t.modes,t.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+e.DEFAULT_MODE+": <"+t.defaultMode+">which does not exist\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),u.has(t,e.MODES)&&u.forEach(t.modes,function(t,e){u.forEach(t,function(t,n){u.isUndefined(t)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+e+"> at index: <"+n+">\n",type:s.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i},e.performWarningRuntimeChecks=function(t,e,n){var r=[],i=!1,o=u.compact(u.flatten(u.mapValues(t.modes,function(t){return t}))),a=u.reject(o,function(t){return t[l]===s.Lexer.NA}),p=P(n);return e&&u.forEach(a,function(t){var e=L(t,p);if(!1!==e){var n={message:k(t,e),type:e.issue,tokenType:t};r.push(n)}else u.has(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):c.canMatchCharCode(p,t.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:s.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),r},e.cloneEmptyGroups=function(t){var e={},n=u.keys(t);return u.forEach(n,function(n){var r=t[n];if(!u.isArray(r))throw Error("non exhaustive match");e[n]=[]}),e},e.isCustomPattern=S,e.isShortPattern=I,e.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,n=this.lastIndex;n\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var l="";n&&(l="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),a.PRINT_ERROR(e.failedOptimizationPrefixMsg+"\n\tFailed parsing: < "+t.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+l)}}return[]},e.firstChar=c,e.applyIgnoreCase=p;var f=function(t){function e(e){var n=t.call(this)||this;return n.targetCharCodes=e,n.found=!1,n}return i(e,t),e.prototype.visitChildren=function(e){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}t.prototype.visitChildren.call(this,e)},e.prototype.visitCharacter=function(t){a.contains(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?void 0===l(t,this.targetCharCodes)&&(this.found=!0):void 0!==l(t,this.targetCharCodes)&&(this.found=!0)},e}(o.BaseRegExpVisitor);e.canMatchCharCode=function(t,e){if(e instanceof RegExp){var n=s.pattern(e.toString()),r=new f(t);return r.visit(n),r.found}return void 0!==a.find(e,function(e){return a.contains(t,e.charCodeAt(0))})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){if(this.start=t,this.end=e,!i(t,e))throw new Error("INVALID RANGE")}return t.prototype.contains=function(t){return this.start<=t&&this.end>=t},t.prototype.containsRange=function(t){return this.start<=t.start&&this.end>=t.end},t.prototype.isContainedInRange=function(t){return t.containsRange(this)},t.prototype.strictlyContainsRange=function(t){return this.startt.end},t.prototype.isStrictlyContainedInRange=function(t){return t.strictlyContainsRange(this)},t}();function i(t,e){return!(t<0||e on "+o.functionName(t.constructor)+" CST Visitor.",type:r.MISSING_METHOD,methodName:e}});return i.compact(n)}e.defaultVisit=s,e.createBaseSemanticVisitorConstructor=function(t,e){var n=function(){};return o.defineNameProp(n,t+"BaseSemantics"),(n.prototype={visit:function(t,e){if(i.isArray(t)&&(t=t[0]),!i.isUndefined(t))return void 0!==t.fullName?this[t.fullName](t.children,e):this[t.name](t.children,e)},validateVisitor:function(){var t=u(this,e);if(!i.isEmpty(t)){var n=i.map(t,function(t){return t.msg});throw Error("Errors Detected in CST Visitor <"+o.functionName(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=n,n._RULE_NAMES=e,n},e.createBaseVisitorConstructorWithDefaults=function(t,e,n){var r=function(){};o.defineNameProp(r,t+"BaseSemanticsWithDefaults");var a=Object.create(n.prototype);return i.forEach(e,function(t){a[t]=s}),(r.prototype=a).constructor=r,r},function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"}(r=e.CstVisitorDefinitionError||(e.CstVisitorDefinitionError={})),e.validateVisitor=u,e.validateMissingCstMethods=c;var p=["constructor","visit","validateVisitor"];function l(t,e){var n=[];for(var s in t)a.validTermsPattern.test(s)&&i.isFunction(t[s])&&!i.contains(p,s)&&!i.contains(e,s)&&n.push({msg:"Redundant visitor method: <"+s+"> on "+o.functionName(t.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+a.validTermsPattern.source+"/.",type:r.REDUNDANT_METHOD,methodName:s});return n}e.validateRedundantMethods=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(t){this.reset(),this.tokVector=t,this.tokVectorLength=t.length},enumerable:!0,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):r.END_OF_FILE},t.prototype.LA=function(t){return this.currIdx+t<0||this.tokVectorLength<=this.currIdx+t?r.END_OF_FILE:this.tokVector[this.currIdx+t]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(t){this.currIdx=t},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t}();e.LexerAdapter=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(6),o=n(3),a=n(10),s=n(23),u=n(11),c=n(1),p=function(){function t(){}return t.prototype.CONSUME=function(t,e){return this.consumeInternal(t,0,e)},t.prototype.CONSUME1=function(t,e){return this.consumeInternal(t,1,e)},t.prototype.CONSUME2=function(t,e){return this.consumeInternal(t,2,e)},t.prototype.CONSUME3=function(t,e){return this.consumeInternal(t,3,e)},t.prototype.CONSUME4=function(t,e){return this.consumeInternal(t,4,e)},t.prototype.CONSUME5=function(t,e){return this.consumeInternal(t,5,e)},t.prototype.CONSUME6=function(t,e){return this.consumeInternal(t,6,e)},t.prototype.CONSUME7=function(t,e){return this.consumeInternal(t,7,e)},t.prototype.CONSUME8=function(t,e){return this.consumeInternal(t,8,e)},t.prototype.CONSUME9=function(t,e){return this.consumeInternal(t,9,e)},t.prototype.SUBRULE=function(t,e){return this.subruleInternal(t,0,e)},t.prototype.SUBRULE1=function(t,e){return this.subruleInternal(t,1,e)},t.prototype.SUBRULE2=function(t,e){return this.subruleInternal(t,2,e)},t.prototype.SUBRULE3=function(t,e){return this.subruleInternal(t,3,e)},t.prototype.SUBRULE4=function(t,e){return this.subruleInternal(t,4,e)},t.prototype.SUBRULE5=function(t,e){return this.subruleInternal(t,5,e)},t.prototype.SUBRULE6=function(t,e){return this.subruleInternal(t,6,e)},t.prototype.SUBRULE7=function(t,e){return this.subruleInternal(t,7,e)},t.prototype.SUBRULE8=function(t,e){return this.subruleInternal(t,8,e)},t.prototype.SUBRULE9=function(t,e){return this.subruleInternal(t,9,e)},t.prototype.OPTION=function(t){return this.optionInternal(t,0)},t.prototype.OPTION1=function(t){return this.optionInternal(t,1)},t.prototype.OPTION2=function(t){return this.optionInternal(t,2)},t.prototype.OPTION3=function(t){return this.optionInternal(t,3)},t.prototype.OPTION4=function(t){return this.optionInternal(t,4)},t.prototype.OPTION5=function(t){return this.optionInternal(t,5)},t.prototype.OPTION6=function(t){return this.optionInternal(t,6)},t.prototype.OPTION7=function(t){return this.optionInternal(t,7)},t.prototype.OPTION8=function(t){return this.optionInternal(t,8)},t.prototype.OPTION9=function(t){return this.optionInternal(t,9)},t.prototype.OR=function(t){return this.orInternal(t,0)},t.prototype.OR1=function(t){return this.orInternal(t,1)},t.prototype.OR2=function(t){return this.orInternal(t,2)},t.prototype.OR3=function(t){return this.orInternal(t,3)},t.prototype.OR4=function(t){return this.orInternal(t,4)},t.prototype.OR5=function(t){return this.orInternal(t,5)},t.prototype.OR6=function(t){return this.orInternal(t,6)},t.prototype.OR7=function(t){return this.orInternal(t,7)},t.prototype.OR8=function(t){return this.orInternal(t,8)},t.prototype.OR9=function(t){return this.orInternal(t,9)},t.prototype.MANY=function(t){this.manyInternal(0,t)},t.prototype.MANY1=function(t){this.manyInternal(1,t)},t.prototype.MANY2=function(t){this.manyInternal(2,t)},t.prototype.MANY3=function(t){this.manyInternal(3,t)},t.prototype.MANY4=function(t){this.manyInternal(4,t)},t.prototype.MANY5=function(t){this.manyInternal(5,t)},t.prototype.MANY6=function(t){this.manyInternal(6,t)},t.prototype.MANY7=function(t){this.manyInternal(7,t)},t.prototype.MANY8=function(t){this.manyInternal(8,t)},t.prototype.MANY9=function(t){this.manyInternal(9,t)},t.prototype.MANY_SEP=function(t){this.manySepFirstInternal(0,t)},t.prototype.MANY_SEP1=function(t){this.manySepFirstInternal(1,t)},t.prototype.MANY_SEP2=function(t){this.manySepFirstInternal(2,t)},t.prototype.MANY_SEP3=function(t){this.manySepFirstInternal(3,t)},t.prototype.MANY_SEP4=function(t){this.manySepFirstInternal(4,t)},t.prototype.MANY_SEP5=function(t){this.manySepFirstInternal(5,t)},t.prototype.MANY_SEP6=function(t){this.manySepFirstInternal(6,t)},t.prototype.MANY_SEP7=function(t){this.manySepFirstInternal(7,t)},t.prototype.MANY_SEP8=function(t){this.manySepFirstInternal(8,t)},t.prototype.MANY_SEP9=function(t){this.manySepFirstInternal(9,t)},t.prototype.AT_LEAST_ONE=function(t){this.atLeastOneInternal(0,t)},t.prototype.AT_LEAST_ONE1=function(t){return this.atLeastOneInternal(1,t)},t.prototype.AT_LEAST_ONE2=function(t){this.atLeastOneInternal(2,t)},t.prototype.AT_LEAST_ONE3=function(t){this.atLeastOneInternal(3,t)},t.prototype.AT_LEAST_ONE4=function(t){this.atLeastOneInternal(4,t)},t.prototype.AT_LEAST_ONE5=function(t){this.atLeastOneInternal(5,t)},t.prototype.AT_LEAST_ONE6=function(t){this.atLeastOneInternal(6,t)},t.prototype.AT_LEAST_ONE7=function(t){this.atLeastOneInternal(7,t)},t.prototype.AT_LEAST_ONE8=function(t){this.atLeastOneInternal(8,t)},t.prototype.AT_LEAST_ONE9=function(t){this.atLeastOneInternal(9,t)},t.prototype.AT_LEAST_ONE_SEP=function(t){this.atLeastOneSepFirstInternal(0,t)},t.prototype.AT_LEAST_ONE_SEP1=function(t){this.atLeastOneSepFirstInternal(1,t)},t.prototype.AT_LEAST_ONE_SEP2=function(t){this.atLeastOneSepFirstInternal(2,t)},t.prototype.AT_LEAST_ONE_SEP3=function(t){this.atLeastOneSepFirstInternal(3,t)},t.prototype.AT_LEAST_ONE_SEP4=function(t){this.atLeastOneSepFirstInternal(4,t)},t.prototype.AT_LEAST_ONE_SEP5=function(t){this.atLeastOneSepFirstInternal(5,t)},t.prototype.AT_LEAST_ONE_SEP6=function(t){this.atLeastOneSepFirstInternal(6,t)},t.prototype.AT_LEAST_ONE_SEP7=function(t){this.atLeastOneSepFirstInternal(7,t)},t.prototype.AT_LEAST_ONE_SEP8=function(t){this.atLeastOneSepFirstInternal(8,t)},t.prototype.AT_LEAST_ONE_SEP9=function(t){this.atLeastOneSepFirstInternal(9,t)},t.prototype.RULE=function(t,e,n){if(void 0===n&&(n=o.DEFAULT_RULE_CONFIG),r.contains(this.definedRulesNames,t)){var i={message:a.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(i)}if(this.definedRulesNames.push(t),!this.gastProductionsCache.containsKey(t)&&!this.serializedGrammar){var u=s.buildTopProduction(e.toString(),t,this.tokensMap);this.gastProductionsCache.put(t,u)}var c=this.defineRule(t,e,n);return this[t]=c,c},t.prototype.OVERRIDE_RULE=function(t,e,n){void 0===n&&(n=o.DEFAULT_RULE_CONFIG);var r=[];if(r=r.concat(u.validateRuleIsOverridden(t,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r),!this.serializedGrammar){var i=s.buildTopProduction(e.toString(),t,this.tokensMap);this.gastProductionsCache.put(t,i)}var a=this.defineRule(t,e,n);return this[t]=a,a},t.prototype.BACKTRACK=function(t,e){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(i.isRecognitionException(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return c.serializeGrammar(this.gastProductionsCache.values())},t}();e.RecognizerApi=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(6),a=n(12),s=n(13),u=n(3),c=n(25),p=n(2),l=n(7),h=n(4),f=function(){function t(){}return t.prototype.initRecognizerEngine=function(t,e){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull=new h.HashTable,this.fullRuleNameToShort=new h.HashTable,this.ruleShortNameIdx=256,this.tokenMatcher=l.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache=new h.HashTable,this.serializedGrammar=r.has(e,"serializedGrammar")?e.serializedGrammar:u.DEFAULT_PARSER_CONFIG.serializedGrammar,r.isArray(t)){if(r.isEmpty(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(r.isArray(t))this.tokensMap=r.reduce(t,function(t,e){return t[p.tokenName(e)]=e,t},{});else if(r.has(t,"modes")&&r.every(r.flatten(r.values(t.modes)),l.isTokenType)){var n=r.flatten(r.values(t.modes)),i=r.uniq(n);this.tokensMap=r.reduce(i,function(t,e){return t[p.tokenName(e)]=e,t},{})}else{if(!r.isObject(t))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=r.cloneObj(t)}this.tokensMap.EOF=p.EOF;var o=r.every(r.values(t),function(t){return r.isEmpty(t.categoryMatches)});this.tokenMatcher=o?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher,l.augmentTokenTypes(r.values(this.tokensMap))},t.prototype.defineRule=function(t,e,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+t+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var a,s=r.has(n,"resyncEnabled")?n.resyncEnabled:u.DEFAULT_RULE_CONFIG.resyncEnabled,c=r.has(n,"recoveryValueFunc")?n.recoveryValueFunc:u.DEFAULT_RULE_CONFIG.recoveryValueFunc,p=this.ruleShortNameIdx<e},t.prototype.orInternalNoCst=function(t,e){var n=r.isArray(t)?t:t.DEF,i=this.getLookaheadFuncForOr(e,n).call(this,n);if(void 0!==i)return n[i].ALT.call(this);this.raiseNoAltException(e,t.ERR_MSG)},t.prototype.orInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.OR_IDX,e),o=this.nestedRuleBeforeClause(t,n);try{var a=r.isArray(t)?t:t.DEF,s=this.getLookaheadFuncForOr(e,a).call(this,a);if(void 0!==s){var u=a[s],c=this.nestedAltBeforeClause(u,e,i.OR_IDX,s);try{return u.ALT.call(this)}finally{void 0!==c&&this.nestedRuleFinallyClause(c.shortName,c.nestedName)}}this.raiseNoAltException(e,t.ERR_MSG)}finally{void 0!==o&&this.nestedRuleFinallyClause(n,o)}},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!this.isAtEndOfInput()){var t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new o.NotAllInputParsedException(e,t))}},t.prototype.subruleInternal=function(t,e,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=t.call(this,e,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),r}catch(e){throw o.isRecognitionException(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),delete e.partialCstResult),e}},t.prototype.consumeInternal=function(t,e,n){var r;try{var i=this.LA(1);if(!0!==this.tokenMatcher(i,t)){var a=void 0,s=this.LA(0);throw a=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:i,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o.MismatchedTokenException(a,i,s))}this.consumeToken(),r=i}catch(n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var u=this.getFollowsForInRuleRecovery(t,e);try{r=this.tryInRuleRecovery(t,u)}catch(t){throw t.name===c.IN_RULE_RECOVERY_EXCEPTION?n:t}}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.tokenName,r),r},t.prototype.saveRecogState=function(){var t=this.errors,e=r.cloneArr(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},t.prototype.reloadRecogState=function(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e,t)},t.prototype.isBackTracking=function(){return!r.isEmpty(this.isBackTrackingStack)},t.prototype.getCurrRuleFullName=function(){var t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull.get(t)},t.prototype.shortRuleNameToFullName=function(t){return this.shortRuleNameToFull.get(t)},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),p.EOF)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t}();e.RecognizerEngine=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),i=n(0),o=n(12),a=n(3),s=function(){function t(){}return t.prototype.initErrorHandler=function(t){this._errors=[],this.errorMessageProvider=i.defaults(t.errorMessageProvider,a.DEFAULT_PARSER_CONFIG.errorMessageProvider)},t.prototype.SAVE_ERROR=function(t){if(r.isRecognitionException(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:i.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return i.cloneArr(this._errors)},set:function(t){this._errors=t},enumerable:!0,configurable:!0}),t.prototype.raiseEarlyExitException=function(t,e,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions().get(i),s=o.getLookaheadPathsForOptionalProd(t,a,e,this.maxLookahead)[0],u=[],c=1;c"+t+"<- does not exist in this grammar.");return r.nextPossibleTokensAfter([n],e,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(t){var e=i.first(t.ruleStack),n=this.getGAstProductions().get(e);return new r.NextAfterTokenWalker(n,t).startWalking()},t}();e.ContentAssist=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17);e.createSyntaxDiagramsCode=function(t,e){var n=void 0===e?{}:e,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r.VERSION+"/diagrams/":i,a=n.css;return"\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n\n\n\n + + + + + + + + + diff --git a/examples/webgl_loader_3dm.html b/examples/webgl_loader_3dm.html new file mode 100644 index 00000000000000..335ea160df96ee --- /dev/null +++ b/examples/webgl_loader_3dm.html @@ -0,0 +1,146 @@ + + + + three.js webgl - loaders - Rhino 3DM loader + + + + + + +
+ three.js - Rhino 3DM loader +
+ + + + + diff --git a/examples/webgl_loader_mmd.html b/examples/webgl_loader_mmd.html index 1c4aa204b1ab1c..7eb478dcf0661a 100644 --- a/examples/webgl_loader_mmd.html +++ b/examples/webgl_loader_mmd.html @@ -25,7 +25,7 @@ Dance Data - + + + -