diff --git a/build/cannon.demo.js b/build/cannon.demo.js index 16a8f7e3e..d3adff410 100644 --- a/build/cannon.demo.js +++ b/build/cannon.demo.js @@ -44,7 +44,7 @@ CANNON.Demo = function(options){ shadows: false, aabbs: false, profiling: false, - maxSubSteps:3 + maxSubSteps: 20 }; // Extend settings with options @@ -262,10 +262,20 @@ CANNON.Demo = function(options){ // Read position data into visuals for(var i=0; i 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; - } + this.lowerBound.x = Math.min(this.lowerBound.x, aabb.lowerBound.x); + this.upperBound.x = Math.max(this.upperBound.x, aabb.upperBound.x); + this.lowerBound.y = Math.min(this.lowerBound.y, aabb.lowerBound.y); + this.upperBound.y = Math.max(this.upperBound.y, aabb.upperBound.y); + this.lowerBound.z = Math.min(this.lowerBound.z, aabb.lowerBound.z); + this.upperBound.z = Math.max(this.upperBound.z, aabb.upperBound.z); }; /** @@ -296,11 +270,21 @@ AABB.prototype.overlaps = function(aabb){ // |--------| // 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)); + var overlapsX = ((l2.x <= u1.x && u1.x <= u2.x) || (l1.x <= u2.x && u2.x <= u1.x)); + var overlapsY = ((l2.y <= u1.y && u1.y <= u2.y) || (l1.y <= u2.y && u2.y <= u1.y)); + var overlapsZ = ((l2.z <= u1.z && u1.z <= u2.z) || (l1.z <= u2.z && u2.z <= u1.z)); + + return overlapsX && overlapsY && overlapsZ; +}; + +// Mostly for debugging +AABB.prototype.volume = function(){ + var l = this.lowerBound, + u = this.upperBound; + return (u.x - l.x) * (u.y - l.y) * (u.z - l.z); }; + /** * Returns true if the given AABB is fully contained in this AABB. * @method contains @@ -423,7 +407,47 @@ AABB.prototype.toWorldFrame = function(frame, target){ return target.setFromPoints(corners); }; -},{"../math/Vec3":30,"../utils/Utils":53}],4:[function(_dereq_,module,exports){ +/** + * Check if the AABB is hit by a ray. + * @param {Ray} ray + * @return {number} + */ +AABB.prototype.overlapsRay = function(ray){ + var t = 0; + + // ray.direction is unit direction vector of ray + var dirFracX = 1 / ray._direction.x; + var dirFracY = 1 / ray._direction.y; + var dirFracZ = 1 / ray._direction.z; + + // this.lowerBound is the corner of AABB with minimal coordinates - left bottom, rt is maximal corner + var t1 = (this.lowerBound.x - ray.from.x) * dirFracX; + var t2 = (this.upperBound.x - ray.from.x) * dirFracX; + var t3 = (this.lowerBound.y - ray.from.y) * dirFracY; + var t4 = (this.upperBound.y - ray.from.y) * dirFracY; + var t5 = (this.lowerBound.z - ray.from.z) * dirFracZ; + var t6 = (this.upperBound.z - ray.from.z) * dirFracZ; + + // var tmin = Math.max(Math.max(Math.min(t1, t2), Math.min(t3, t4))); + // var tmax = Math.min(Math.min(Math.max(t1, t2), Math.max(t3, t4))); + var tmin = Math.max(Math.max(Math.min(t1, t2), Math.min(t3, t4)), Math.min(t5, t6)); + var tmax = Math.min(Math.min(Math.max(t1, t2), Math.max(t3, t4)), Math.max(t5, t6)); + + // if tmax < 0, ray (line) is intersecting AABB, but whole AABB is behing us + if (tmax < 0){ + //t = tmax; + return false; + } + + // if tmin > tmax, ray doesn't intersect AABB + if (tmin > tmax){ + //t = tmax; + return false; + } + + return true; +}; +},{"../math/Vec3":31,"../utils/Utils":54}],4:[function(_dereq_,module,exports){ module.exports = ArrayCollisionMatrix; /** @@ -438,7 +462,7 @@ function ArrayCollisionMatrix() { * @property matrix * @type {Array} */ - this.matrix = []; + this.matrix = []; } /** @@ -449,14 +473,14 @@ function ArrayCollisionMatrix() { * @return {Number} */ ArrayCollisionMatrix.prototype.get = function(i, j) { - i = i.index; - j = j.index; + 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]; + return this.matrix[(i*(i + 1)>>1) + j-1]; }; /** @@ -467,14 +491,14 @@ ArrayCollisionMatrix.prototype.get = function(i, j) { * @param {Number} value */ ArrayCollisionMatrix.prototype.set = function(i, j, value) { - i = i.index; - j = j.index; + 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; + this.matrix[(i*(i + 1)>>1) + j-1] = value ? 1 : 0; }; /** @@ -482,9 +506,9 @@ ArrayCollisionMatrix.prototype.set = function(i, j, value) { * @method reset */ ArrayCollisionMatrix.prototype.reset = function() { - for (var i=0, l=this.matrix.length; i!==l; i++) { - this.matrix[i]=0; - } + for (var i=0, l=this.matrix.length; i!==l; i++) { + this.matrix[i]=0; + } }; /** @@ -493,7 +517,7 @@ ArrayCollisionMatrix.prototype.reset = function() { * @param {Number} n */ ArrayCollisionMatrix.prototype.setNumObjects = function(n) { - this.matrix.length = n*(n-1)>>1; + this.matrix.length = n*(n-1)>>1; }; },{}],5:[function(_dereq_,module,exports){ @@ -551,7 +575,6 @@ Broadphase.prototype.collisionPairs = function(world,p1,p2){ * @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 @@ -560,9 +583,9 @@ Broadphase.prototype.needBroadphaseCollision = function(bodyA,bodyB){ } // 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. + if(((bodyA.type & Body.STATIC)!==0 || bodyA.sleepState === Body.SLEEPING) && + ((bodyB.type & Body.STATIC)!==0 || bodyB.sleepState === Body.SLEEPING)) { + // Both bodies are static or sleeping. Skip. return false; } @@ -705,7 +728,7 @@ 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){ +},{"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Plane":43,"../shapes/Shape":44}],6:[function(_dereq_,module,exports){ module.exports = GridBroadphase; var Broadphase = _dereq_('./Broadphase'); @@ -935,7 +958,7 @@ GridBroadphase.prototype.collisionPairs = function(world,pairs1,pairs2){ this.makePairsUnique(pairs1,pairs2); }; -},{"../math/Vec3":30,"../shapes/Shape":43,"./Broadphase":5}],7:[function(_dereq_,module,exports){ +},{"../math/Vec3":31,"../shapes/Shape":44,"./Broadphase":5}],7:[function(_dereq_,module,exports){ module.exports = NaiveBroadphase; var Broadphase = _dereq_('./Broadphase'); @@ -1084,6 +1107,102 @@ ObjectCollisionMatrix.prototype.setNumObjects = function(n) { }; },{}],9:[function(_dereq_,module,exports){ +module.exports = OverlapKeeper; + +/** + * @class OverlapKeeper + * @constructor + */ +function OverlapKeeper() { + this.current = []; + this.previous = []; +} + +OverlapKeeper.prototype.getKey = function(i, j) { + if (j < i) { + var temp = j; + j = i; + i = temp; + } + return (i << 16) | j; +}; + + +/** + * @method set + * @param {Number} i + * @param {Number} j + */ +OverlapKeeper.prototype.set = function(i, j) { + // Insertion sort. This way the diff will have linear complexity. + var key = this.getKey(i, j); + var current = this.current; + var index = 0; + while(key > current[index]){ + index++; + } + if(key === current[index]){ + return; // Pair was already added + } + for(var j=current.length-1; j>=index; j--){ + current[j + 1] = current[j]; + } + current[index] = key; +}; + +/** + * @method tick + */ +OverlapKeeper.prototype.tick = function() { + var tmp = this.current; + this.current = this.previous; + this.previous = tmp; + this.current.length = 0; +}; + +function unpackAndPush(array, key){ + array.push((key & 0xFFFF0000) >> 16, key & 0x0000FFFF); +} + +/** + * @method getDiff + * @param {array} additions + * @param {array} removals + */ +OverlapKeeper.prototype.getDiff = function(additions, removals) { + var a = this.current; + var b = this.previous; + var al = a.length; + var bl = b.length; + + var j=0; + for (var i = 0; i < al; i++) { + var found = false; + var keyA = a[i]; + while(keyA > b[j]){ + j++; + } + found = keyA === b[j]; + + if(!found){ + unpackAndPush(additions, keyA); + } + } + j = 0; + for (var i = 0; i < bl; i++) { + var found = false; + var keyB = b[i]; + while(keyB > a[j]){ + j++; + } + found = a[j] === keyB; + + if(!found){ + unpackAndPush(removals, keyB); + } + } +}; +},{}],10:[function(_dereq_,module,exports){ module.exports = Ray; var Vec3 = _dereq_('../math/Vec3'); @@ -1337,7 +1456,7 @@ Ray.prototype.intersectShape = function(shape, quat, position, body){ var intersectMethod = this[shape.type]; if(intersectMethod){ - intersectMethod.call(this, shape, quat, position, body); + intersectMethod.call(this, shape, quat, position, body, shape); } }; @@ -1360,8 +1479,8 @@ var tmpRaycastResult = new RaycastResult(); * @param {Vec3} position * @param {Body} body */ -Ray.prototype.intersectBox = function(shape, quat, position, body){ - return this.intersectConvex(shape.convexPolyhedronRepresentation, quat, position, body); +Ray.prototype.intersectBox = function(shape, quat, position, body, reportedShape){ + return this.intersectConvex(shape.convexPolyhedronRepresentation, quat, position, body, reportedShape); }; Ray.prototype[Shape.types.BOX] = Ray.prototype.intersectBox; @@ -1373,7 +1492,7 @@ Ray.prototype[Shape.types.BOX] = Ray.prototype.intersectBox; * @param {Vec3} position * @param {Body} body */ -Ray.prototype.intersectPlane = function(shape, quat, position, body){ +Ray.prototype.intersectPlane = function(shape, quat, position, body, reportedShape){ var from = this.from; var to = this.to; var direction = this._direction; @@ -1413,7 +1532,7 @@ Ray.prototype.intersectPlane = function(shape, quat, position, body){ direction.scale(t, dir_scaled_with_t); from.vadd(dir_scaled_with_t, hitPointWorld); - this.reportIntersection(worldNormal, hitPointWorld, shape, body, -1); + this.reportIntersection(worldNormal, hitPointWorld, reportedShape, body, -1); }; Ray.prototype[Shape.types.PLANE] = Ray.prototype.intersectPlane; @@ -1436,6 +1555,10 @@ Ray.prototype.getAABB = function(result){ var intersectConvexOptions = { faceList: [0] }; +var worldPillarOffset = new Vec3(); +var intersectHeightfield_localRay = new Ray(); +var intersectHeightfield_index = []; +var intersectHeightfield_minMax = []; /** * @method intersectHeightfield @@ -1445,66 +1568,52 @@ var intersectConvexOptions = { * @param {Vec3} position * @param {Body} body */ -Ray.prototype.intersectHeightfield = function(shape, quat, position, body){ +Ray.prototype.intersectHeightfield = function(shape, quat, position, body, reportedShape){ var data = shape.data, - w = shape.elementSize, - worldPillarOffset = new Vec3(); + w = shape.elementSize; // Convert the ray to local heightfield coordinates - var localRay = new Ray(this.from, this.to); + var localRay = intersectHeightfield_localRay; //new Ray(this.from, this.to); + localRay.from.copy(this.from); + localRay.to.copy(this.to); Transform.pointToLocalFrame(position, quat, localRay.from, localRay.from); Transform.pointToLocalFrame(position, quat, localRay.to, localRay.to); + localRay._updateDirection(); // 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 index = intersectHeightfield_index; + var iMinX, iMinY, iMaxX, iMaxY; - var minMax = []; - shape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); - var min = minMax[0]; - var max = minMax[1]; + // Set to max + iMinX = iMinY = 0; + iMaxX = iMaxY = shape.data.length - 1; - // // Bail out if the ray can't touch the bounding box - // // TODO - // var aabb = new AABB(); - // this.getAABB(aabb); - // if(aabb.intersects()){ - // return; - // } + var aabb = new AABB(); + localRay.getAABB(aabb); - for(var i = iMinX; i <= iMaxX; i++){ - for(var j = iMinY; j <= iMaxY; j++){ + shape.getIndexOfPosition(aabb.lowerBound.x, aabb.lowerBound.y, index, true); + iMinX = Math.max(iMinX, index[0]); + iMinY = Math.max(iMinY, index[1]); + shape.getIndexOfPosition(aabb.upperBound.x, aabb.upperBound.y, index, true); + iMaxX = Math.min(iMaxX, index[0] + 1); + iMaxY = Math.min(iMaxY, index[1] + 1); + + for(var i = iMinX; i < iMaxX; i++){ + for(var j = iMinY; j < iMaxY; j++){ if(this.result._shouldStop){ return; } + shape.getAabbAtIndex(i, j, aabb); + if(!aabb.overlapsRay(localRay)){ + continue; + } + // Lower triangle shape.getConvexTrianglePillar(i, j, false); Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); - this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, intersectConvexOptions); + this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, reportedShape, intersectConvexOptions); if(this.result._shouldStop){ return; @@ -1513,7 +1622,7 @@ Ray.prototype.intersectHeightfield = function(shape, quat, position, body){ // Upper triangle shape.getConvexTrianglePillar(i, j, true); Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); - this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, intersectConvexOptions); + this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, reportedShape, intersectConvexOptions); } } }; @@ -1530,7 +1639,7 @@ var Ray_intersectSphere_normal = new Vec3(); * @param {Vec3} position * @param {Body} body */ -Ray.prototype.intersectSphere = function(shape, quat, position, body){ +Ray.prototype.intersectSphere = function(shape, quat, position, body, reportedShape){ var from = this.from, to = this.to, r = shape.radius; @@ -1555,7 +1664,7 @@ Ray.prototype.intersectSphere = function(shape, quat, position, body){ intersectionPoint.vsub(position, normal); normal.normalize(); - this.reportIntersection(normal, intersectionPoint, shape, body, -1); + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); } else { var d1 = (- b - Math.sqrt(delta)) / (2 * a); @@ -1565,7 +1674,7 @@ Ray.prototype.intersectSphere = function(shape, quat, position, body){ from.lerp(to, d1, intersectionPoint); intersectionPoint.vsub(position, normal); normal.normalize(); - this.reportIntersection(normal, intersectionPoint, shape, body, -1); + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); } if(this.result._shouldStop){ @@ -1576,7 +1685,7 @@ Ray.prototype.intersectSphere = function(shape, quat, position, body){ from.lerp(to, d2, intersectionPoint); intersectionPoint.vsub(position, normal); normal.normalize(); - this.reportIntersection(normal, intersectionPoint, shape, body, -1); + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); } } }; @@ -1603,6 +1712,7 @@ Ray.prototype.intersectConvex = function intersectConvex( quat, position, body, + reportedShape, options ){ var minDistNormal = intersectConvex_minDistNormal; @@ -1689,7 +1799,7 @@ Ray.prototype.intersectConvex = function intersectConvex( continue; } - this.reportIntersection(normal, intersectPoint, shape, body, fi); + this.reportIntersection(normal, intersectPoint, reportedShape, body, fi); } // } } @@ -1722,6 +1832,7 @@ Ray.prototype.intersectTrimesh = function intersectTrimesh( quat, position, body, + reportedShape, options ){ var normal = intersectTrimesh_normal; @@ -1753,11 +1864,19 @@ Ray.prototype.intersectTrimesh = function intersectTrimesh( // 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); + + localTo.x *= mesh.scale.x; + localTo.y *= mesh.scale.y; + localTo.z *= mesh.scale.z; + localFrom.x *= mesh.scale.x; + localFrom.y *= mesh.scale.y; + localFrom.z *= mesh.scale.z; + + localTo.vsub(localFrom, localDirection); + localDirection.normalize(); + var fromToDistanceSquared = localFrom.distanceSquared(localTo); mesh.tree.rayQuery(this, treeTransform, triangles); @@ -1776,9 +1895,6 @@ Ray.prototype.intersectTrimesh = function intersectTrimesh( // ...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); @@ -1811,10 +1927,8 @@ Ray.prototype.intersectTrimesh = function intersectTrimesh( // 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); + this.reportIntersection(worldNormal, worldIntersectPoint, reportedShape, body, trianglesIndex); } triangles.length = 0; }; @@ -1914,7 +2028,7 @@ function distanceFromIntersection(from, direction, position) { } -},{"../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){ +},{"../collision/AABB":3,"../collision/RaycastResult":11,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../shapes/Box":38,"../shapes/ConvexPolyhedron":39,"../shapes/Shape":44}],11:[function(_dereq_,module,exports){ var Vec3 = _dereq_('../math/Vec3'); module.exports = RaycastResult; @@ -2037,7 +2151,7 @@ RaycastResult.prototype.set = function( this.body = body; this.distance = distance; }; -},{"../math/Vec3":30}],11:[function(_dereq_,module,exports){ +},{"../math/Vec3":31}],12:[function(_dereq_,module,exports){ var Shape = _dereq_('../shapes/Shape'); var Broadphase = _dereq_('../collision/Broadphase'); @@ -2361,7 +2475,7 @@ SAPBroadphase.prototype.aabbQuery = function(world, aabb, result){ return result; }; -},{"../collision/Broadphase":5,"../shapes/Shape":43}],12:[function(_dereq_,module,exports){ +},{"../collision/Broadphase":5,"../shapes/Shape":44}],13:[function(_dereq_,module,exports){ module.exports = ConeTwistConstraint; var Constraint = _dereq_('./Constraint'); @@ -2452,7 +2566,7 @@ ConeTwistConstraint.prototype.update = function(){ }; -},{"../equations/ConeEquation":18,"../equations/ContactEquation":19,"../equations/RotationalEquation":22,"../math/Vec3":30,"./Constraint":13,"./PointToPointConstraint":17}],13:[function(_dereq_,module,exports){ +},{"../equations/ConeEquation":19,"../equations/ContactEquation":20,"../equations/RotationalEquation":23,"../math/Vec3":31,"./Constraint":14,"./PointToPointConstraint":18}],14:[function(_dereq_,module,exports){ module.exports = Constraint; var Utils = _dereq_('../utils/Utils'); @@ -2545,7 +2659,7 @@ Constraint.prototype.disable = function(){ Constraint.idCounter = 0; -},{"../utils/Utils":53}],14:[function(_dereq_,module,exports){ +},{"../utils/Utils":54}],15:[function(_dereq_,module,exports){ module.exports = DistanceConstraint; var Constraint = _dereq_('./Constraint'); @@ -2602,7 +2716,7 @@ DistanceConstraint.prototype.update = function(){ normal.mult(halfDist, eq.ri); normal.mult(-halfDist, eq.rj); }; -},{"../equations/ContactEquation":19,"./Constraint":13}],15:[function(_dereq_,module,exports){ +},{"../equations/ContactEquation":20,"./Constraint":14}],16:[function(_dereq_,module,exports){ module.exports = HingeConstraint; var Constraint = _dereq_('./Constraint'); @@ -2738,7 +2852,7 @@ HingeConstraint.prototype.update = function(){ }; -},{"../equations/ContactEquation":19,"../equations/RotationalEquation":22,"../equations/RotationalMotorEquation":23,"../math/Vec3":30,"./Constraint":13,"./PointToPointConstraint":17}],16:[function(_dereq_,module,exports){ +},{"../equations/ContactEquation":20,"../equations/RotationalEquation":23,"../equations/RotationalMotorEquation":24,"../math/Vec3":31,"./Constraint":14,"./PointToPointConstraint":18}],17:[function(_dereq_,module,exports){ module.exports = LockConstraint; var Constraint = _dereq_('./Constraint'); @@ -2771,8 +2885,20 @@ function LockConstraint(bodyA, bodyB, options){ halfWay.scale(0.5, halfWay); bodyB.pointToLocalFrame(halfWay, pivotB); bodyA.pointToLocalFrame(halfWay, pivotA); + + // The point-to-point constraint will keep a point shared between the bodies PointToPointConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); + // Store initial rotation of the bodies as unit vectors in the local body spaces + this.xA = bodyA.vectorToLocalFrame(Vec3.UNIT_X); + this.xB = bodyB.vectorToLocalFrame(Vec3.UNIT_X); + this.yA = bodyA.vectorToLocalFrame(Vec3.UNIT_Y); + this.yB = bodyB.vectorToLocalFrame(Vec3.UNIT_Y); + this.zA = bodyA.vectorToLocalFrame(Vec3.UNIT_Z); + this.zB = bodyB.vectorToLocalFrame(Vec3.UNIT_Z); + + // ...and the following rotational equations will keep all rotational DOF's in place + /** * @property {RotationalEquation} rotationalEquation1 */ @@ -2808,18 +2934,19 @@ LockConstraint.prototype.update = function(){ PointToPointConstraint.prototype.update.call(this); - bodyA.vectorToWorldFrame(Vec3.UNIT_X, r1.axisA); - bodyB.vectorToWorldFrame(Vec3.UNIT_Y, r1.axisB); + // These vector pairs must be orthogonal + bodyA.vectorToWorldFrame(this.xA, r1.axisA); + bodyB.vectorToWorldFrame(this.yB, r1.axisB); - bodyA.vectorToWorldFrame(Vec3.UNIT_Y, r2.axisA); - bodyB.vectorToWorldFrame(Vec3.UNIT_Z, r2.axisB); + bodyA.vectorToWorldFrame(this.yA, r2.axisA); + bodyB.vectorToWorldFrame(this.zB, r2.axisB); - bodyA.vectorToWorldFrame(Vec3.UNIT_Z, r3.axisA); - bodyB.vectorToWorldFrame(Vec3.UNIT_X, r3.axisB); + bodyA.vectorToWorldFrame(this.zA, r3.axisA); + bodyB.vectorToWorldFrame(this.xB, r3.axisB); }; -},{"../equations/ContactEquation":19,"../equations/RotationalEquation":22,"../equations/RotationalMotorEquation":23,"../math/Vec3":30,"./Constraint":13,"./PointToPointConstraint":17}],17:[function(_dereq_,module,exports){ +},{"../equations/ContactEquation":20,"../equations/RotationalEquation":23,"../equations/RotationalMotorEquation":24,"../math/Vec3":31,"./Constraint":14,"./PointToPointConstraint":18}],18:[function(_dereq_,module,exports){ module.exports = PointToPointConstraint; var Constraint = _dereq_('./Constraint'); @@ -2912,7 +3039,7 @@ PointToPointConstraint.prototype.update = function(){ z.ri.copy(x.ri); z.rj.copy(x.rj); }; -},{"../equations/ContactEquation":19,"../math/Vec3":30,"./Constraint":13}],18:[function(_dereq_,module,exports){ +},{"../equations/ContactEquation":20,"../math/Vec3":31,"./Constraint":14}],19:[function(_dereq_,module,exports){ module.exports = ConeEquation; var Vec3 = _dereq_('../math/Vec3'); @@ -2991,7 +3118,7 @@ ConeEquation.prototype.computeB = function(h){ }; -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],19:[function(_dereq_,module,exports){ +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],20:[function(_dereq_,module,exports){ module.exports = ContactEquation; var Equation = _dereq_('./Equation'); @@ -3128,7 +3255,7 @@ ContactEquation.prototype.getImpactVelocityAlongNormal = function(){ }; -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],20:[function(_dereq_,module,exports){ +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],21:[function(_dereq_,module,exports){ module.exports = Equation; var JacobianElement = _dereq_('../math/JacobianElement'), @@ -3203,6 +3330,13 @@ function Equation(bi,bj,minForce,maxForce){ */ this.enabled = true; + /** + * A number, proportional to the force added to the bodies. + * @property {number} multiplier + * @readonly + */ + this.multiplier = 0; + // Set typical spook params this.setSpookParams(1e7,4,1/60); } @@ -3264,8 +3398,8 @@ Equation.prototype.computeGW = function(){ bj = this.bj, vi = bi.velocity, vj = bj.velocity, - wi = bi.angularVelocity || zero, - wj = bj.angularVelocity || zero; + wi = bi.angularVelocity, + wj = bj.angularVelocity; return GA.multiplyVectors(vi,wi) + GB.multiplyVectors(vj,wj); }; @@ -3282,8 +3416,8 @@ Equation.prototype.computeGWlambda = function(){ bj = this.bj, vi = bi.vlambda, vj = bj.vlambda, - wi = bi.wlambda || zero, - wj = bj.wlambda || zero; + wi = bi.wlambda, + wj = bj.wlambda; return GA.multiplyVectors(vi,wi) + GB.multiplyVectors(vj,wj); }; @@ -3308,13 +3442,11 @@ Equation.prototype.computeGiMf = function(){ invMassi = bi.invMassSolve, invMassj = bj.invMassSolve; - if(bi.invInertiaWorldSolve){ bi.invInertiaWorldSolve.vmult(ti,invIi_vmult_taui); } - else { invIi_vmult_taui.set(0,0,0); } - if(bj.invInertiaWorldSolve){ bj.invInertiaWorldSolve.vmult(tj,invIj_vmult_tauj); } - else { invIj_vmult_tauj.set(0,0,0); } + fi.scale(invMassi,iMfi); + fj.scale(invMassj,iMfj); - fi.mult(invMassi,iMfi); - fj.mult(invMassj,iMfj); + bi.invInertiaWorldSolve.vmult(ti,invIi_vmult_taui); + bj.invInertiaWorldSolve.vmult(tj,invIj_vmult_tauj); return GA.multiplyVectors(iMfi,invIi_vmult_taui) + GB.multiplyVectors(iMfj,invIj_vmult_tauj); }; @@ -3336,15 +3468,11 @@ Equation.prototype.computeGiMGt = function(){ invIj = bj.invInertiaWorldSolve, result = invMassi + invMassj; - if(invIi){ - invIi.vmult(GA.rotational,tmp); - result += tmp.dot(GA.rotational); - } + invIi.vmult(GA.rotational,tmp); + result += tmp.dot(GA.rotational); - if(invIj){ - invIj.vmult(GB.rotational,tmp); - result += tmp.dot(GB.rotational); - } + invIj.vmult(GB.rotational,tmp); + result += tmp.dot(GB.rotational); return result; }; @@ -3370,24 +3498,15 @@ Equation.prototype.addToWlambda = function(deltalambda){ // Add to linear velocity // v_lambda += inv(M) * delta_lamba * G - GA.spatial.mult(bi.invMassSolve * deltalambda,temp); - bi.vlambda.vadd(temp, bi.vlambda); - - GB.spatial.mult(bj.invMassSolve * deltalambda,temp); - bj.vlambda.vadd(temp, bj.vlambda); + bi.vlambda.addScaledVector(bi.invMassSolve * deltalambda, GA.spatial, bi.vlambda); + bj.vlambda.addScaledVector(bj.invMassSolve * deltalambda, GB.spatial, bj.vlambda); // Add to angular velocity - if(bi.invInertiaWorldSolve){ - bi.invInertiaWorldSolve.vmult(GA.rotational,temp); - temp.mult(deltalambda,temp); - bi.wlambda.vadd(temp,bi.wlambda); - } + bi.invInertiaWorldSolve.vmult(GA.rotational,temp); + bi.wlambda.addScaledVector(deltalambda, temp, bi.wlambda); - if(bj.invInertiaWorldSolve){ - bj.invInertiaWorldSolve.vmult(GB.rotational,temp); - temp.mult(deltalambda,temp); - bj.wlambda.vadd(temp,bj.wlambda); - } + bj.invInertiaWorldSolve.vmult(GB.rotational,temp); + bj.wlambda.addScaledVector(deltalambda, temp, bj.wlambda); }; /** @@ -3400,7 +3519,7 @@ Equation.prototype.computeC = function(){ return this.computeGiMGt() + this.eps; }; -},{"../math/JacobianElement":26,"../math/Vec3":30}],21:[function(_dereq_,module,exports){ +},{"../math/JacobianElement":27,"../math/Vec3":31}],22:[function(_dereq_,module,exports){ module.exports = FrictionEquation; var Equation = _dereq_('./Equation'); @@ -3461,7 +3580,7 @@ FrictionEquation.prototype.computeB = function(h){ return B; }; -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],22:[function(_dereq_,module,exports){ +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],23:[function(_dereq_,module,exports){ module.exports = RotationalEquation; var Vec3 = _dereq_('../math/Vec3'); @@ -3532,7 +3651,7 @@ RotationalEquation.prototype.computeB = function(h){ }; -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],23:[function(_dereq_,module,exports){ +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],24:[function(_dereq_,module,exports){ module.exports = RotationalMotorEquation; var Vec3 = _dereq_('../math/Vec3'); @@ -3604,7 +3723,7 @@ RotationalMotorEquation.prototype.computeB = function(h){ return B; }; -},{"../math/Mat3":27,"../math/Vec3":30,"./Equation":20}],24:[function(_dereq_,module,exports){ +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],25:[function(_dereq_,module,exports){ var Utils = _dereq_('../utils/Utils'); module.exports = ContactMaterial; @@ -3685,7 +3804,7 @@ function ContactMaterial(m1, m2, options){ ContactMaterial.idCounter = 0; -},{"../utils/Utils":53}],25:[function(_dereq_,module,exports){ +},{"../utils/Utils":54}],26:[function(_dereq_,module,exports){ module.exports = Material; /** @@ -3735,7 +3854,7 @@ function Material(options){ Material.idCounter = 0; -},{}],26:[function(_dereq_,module,exports){ +},{}],27:[function(_dereq_,module,exports){ module.exports = JacobianElement; var Vec3 = _dereq_('./Vec3'); @@ -3779,7 +3898,7 @@ JacobianElement.prototype.multiplyVectors = function(spatial,rotational){ return spatial.dot(this.spatial) + rotational.dot(this.rotational); }; -},{"./Vec3":30}],27:[function(_dereq_,module,exports){ +},{"./Vec3":31}],28:[function(_dereq_,module,exports){ module.exports = Mat3; var Vec3 = _dereq_('./Vec3'); @@ -4203,7 +4322,7 @@ Mat3.prototype.transpose = function( target ) { return target; }; -},{"./Vec3":30}],28:[function(_dereq_,module,exports){ +},{"./Vec3":31}],29:[function(_dereq_,module,exports){ module.exports = Quaternion; var Vec3 = _dereq_('./Vec3'); @@ -4254,6 +4373,7 @@ Quaternion.prototype.set = function(x,y,z,w){ this.y = y; this.z = z; this.w = w; + return this; }; /** @@ -4286,13 +4406,14 @@ Quaternion.prototype.setFromAxisAngle = function(axis,angle){ this.y = axis.y * s; this.z = axis.z * s; this.w = Math.cos(angle*0.5); + return this; }; /** * Converts the quaternion to axis/angle representation. * @method toAxisAngle - * @param {Vec3} targetAxis Optional. A vector object to reuse for storing the axis. - * @return Array An array, first elemnt is the axis and the second is the angle in radians. + * @param {Vec3} [targetAxis] A vector object to reuse for storing the axis. + * @return {Array} An array, first elemnt is the axis and the second is the angle in radians. */ Quaternion.prototype.toAxisAngle = function(targetAxis){ targetAxis = targetAxis || new Vec3(); @@ -4336,6 +4457,7 @@ Quaternion.prototype.setFromVectors = function(u,v){ this.w = Math.sqrt(Math.pow(u.norm(),2) * Math.pow(v.norm(),2)) + u.dot(v); this.normalize(); } + return this; }; /** @@ -4350,19 +4472,14 @@ 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); + var ax = this.x, ay = this.y, az = this.z, aw = this.w, + bx = q.x, by = q.y, bz = q.z, bw = q.w; - 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; + target.x = ax * bw + aw * bx + ay * bz - az * by; + target.y = ay * bw + aw * by + az * bx - ax * bz; + target.z = az * bw + aw * bz + ax * by - ay * bx; + target.w = aw * bw - ax * bx - ay * by - az * bz; return target; }; @@ -4422,6 +4539,7 @@ Quaternion.prototype.normalize = function(){ this.z *= l; this.w *= l; } + return this; }; /** @@ -4443,6 +4561,7 @@ Quaternion.prototype.normalizeFast = function () { this.z *= f; this.w *= f; } + return this; }; /** @@ -4597,13 +4716,103 @@ Quaternion.prototype.setFromEuler = function ( x, y, z, order ) { } return this; - }; +/** + * @method clone + * @return {Quaternion} + */ Quaternion.prototype.clone = function(){ return new Quaternion(this.x, this.y, this.z, this.w); }; -},{"./Vec3":30}],29:[function(_dereq_,module,exports){ + +/** + * Performs a spherical linear interpolation between two quat + * + * @method slerp + * @param {Quaternion} toQuat second operand + * @param {Number} t interpolation amount between the self quaternion and toQuat + * @param {Quaternion} [target] A quaternion to store the result in. If not provided, a new one will be created. + * @returns {Quaternion} The "target" object + */ +Quaternion.prototype.slerp = function (toQuat, t, target) { + target = target || new Quaternion(); + + var ax = this.x, + ay = this.y, + az = this.z, + aw = this.w, + bx = toQuat.x, + by = toQuat.y, + bz = toQuat.z, + bw = toQuat.w; + + var omega, cosom, sinom, scale0, scale1; + + // calc cosine + cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if ( cosom < 0.0 ) { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // calculate coefficients + if ( (1.0 - cosom) > 0.000001 ) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } + + // calculate final values + target.x = scale0 * ax + scale1 * bx; + target.y = scale0 * ay + scale1 * by; + target.z = scale0 * az + scale1 * bz; + target.w = scale0 * aw + scale1 * bw; + + return target; +}; + +/** + * Rotate an absolute orientation quaternion given an angular velocity and a time step. + * @param {Vec3} angularVelocity + * @param {number} dt + * @param {Vec3} angularFactor + * @param {Quaternion} target + * @return {Quaternion} The "target" object + */ +Quaternion.prototype.integrate = function(angularVelocity, dt, angularFactor, target){ + target = target || new Quaternion(); + + var ax = angularVelocity.x * angularFactor.x, + ay = angularVelocity.y * angularFactor.y, + az = angularVelocity.z * angularFactor.z, + bx = this.x, + by = this.y, + bz = this.z, + bw = this.w; + + var half_dt = dt * 0.5; + + target.x += half_dt * (ax * bw + ay * bz - az * by); + target.y += half_dt * (ay * bw + az * bx - ax * bz); + target.z += half_dt * (az * bw + ax * by - ay * bx); + target.w += half_dt * (- ax * bx - ay * by - az * bz); + + return target; +}; +},{"./Vec3":31}],30:[function(_dereq_,module,exports){ var Vec3 = _dereq_('./Vec3'); var Quaternion = _dereq_('./Quaternion'); @@ -4708,7 +4917,7 @@ Transform.vectorToLocalFrame = function(position, quaternion, worldVector, resul return result; }; -},{"./Quaternion":28,"./Vec3":30}],30:[function(_dereq_,module,exports){ +},{"./Quaternion":29,"./Vec3":31}],31:[function(_dereq_,module,exports){ module.exports = Vec3; var Mat3 = _dereq_('./Mat3'); @@ -4986,6 +5195,21 @@ Vec3.prototype.mult = function(scalar,target){ return target; }; +/** + * Multiply the vector with an other vector, component-wise. + * @method mult + * @param {Number} vector + * @param {Vec3} target The vector to save the result in. + * @return {Vec3} + */ +Vec3.prototype.vmul = function(vector, target){ + target = target || new Vec3(); + target.x = vector.x * this.x; + target.y = vector.y * this.y; + target.z = vector.z * this.z; + return target; +}; + /** * Multiply the vector with a scalar. * @method scale @@ -4995,6 +5219,22 @@ Vec3.prototype.mult = function(scalar,target){ */ Vec3.prototype.scale = Vec3.prototype.mult; +/** + * Scale a vector and add it to this vector. Save the result in "target". (target = this + vector * scalar) + * @method addScaledVector + * @param {Number} scalar + * @param {Vec3} vector + * @param {Vec3} target The vector to save the result in. + * @return {Vec3} + */ +Vec3.prototype.addScaledVector = function(scalar, vector, target){ + target = target || new Vec3(); + target.x = this.x + scalar * vector.x; + target.y = this.y + scalar * vector.y; + target.z = this.z + scalar * vector.z; + return target; +}; + /** * Calculate dot product * @method dot @@ -5161,7 +5401,7 @@ Vec3.prototype.isAntiparallelTo = function(v,precision){ Vec3.prototype.clone = function(){ return new Vec3(this.x, this.y, this.z); }; -},{"./Mat3":27}],31:[function(_dereq_,module,exports){ +},{"./Mat3":28}],32:[function(_dereq_,module,exports){ module.exports = Body; var EventTarget = _dereq_('../utils/EventTarget'); @@ -5192,16 +5432,18 @@ var Box = _dereq_('../shapes/Box'); * @param {number} [options.sleepSpeedLimit=0.1] * @param {number} [options.sleepTimeLimit=1] * @param {number} [options.collisionFilterGroup=1] - * @param {number} [options.collisionFilterMask=1] + * @param {number} [options.collisionFilterMask=-1] * @param {boolean} [options.fixedRotation=false] - * @param {Body} [options.shape] + * @param {Vec3} [options.linearFactor] + * @param {Vec3} [options.angularFactor] + * @param {Shape} [options.shape] * @example * var body = new Body({ * mass: 1 * }); * var shape = new Sphere(1); * body.addShape(shape); - * world.add(body); + * world.addBody(body); */ function Body(options){ options = options || {}; @@ -5243,7 +5485,7 @@ function Body(options){ /** * @property {Number} collisionFilterMask */ - this.collisionFilterMask = typeof(options.collisionFilterMask) === 'number' ? options.collisionFilterMask : 1; + 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. @@ -5252,20 +5494,23 @@ function Body(options){ this.collisionResponse = true; /** + * World space position of the body. * @property position * @type {Vec3} */ this.position = new Vec3(); - if(options.position){ - this.position.copy(options.position); - } - /** * @property {Vec3} previousPosition */ this.previousPosition = new Vec3(); + /** + * Interpolated position of the body. + * @property {Vec3} interpolatedPosition + */ + this.interpolatedPosition = new Vec3(); + /** * Initial position of the body * @property initPosition @@ -5273,7 +5518,15 @@ function Body(options){ */ this.initPosition = new Vec3(); + if(options.position){ + this.position.copy(options.position); + this.previousPosition.copy(options.position); + this.interpolatedPosition.copy(options.position); + this.initPosition.copy(options.position); + } + /** + * World space velocity of the body. * @property velocity * @type {Vec3} */ @@ -5290,7 +5543,7 @@ function Body(options){ this.initVelocity = new Vec3(); /** - * Linear force on the body + * Linear force on the body in world space. * @property force * @type {Vec3} */ @@ -5368,24 +5621,19 @@ function Body(options){ this._wakeUpAfterNarrowphase = false; - /** - * Rotational force on the body, around center of mass + * World space rotational force on the body, around center of mass. * @property {Vec3} torque */ this.torque = new Vec3(); /** - * Orientation of the body + * World space orientation of the body. * @property quaternion * @type {Quaternion} */ this.quaternion = new Quaternion(); - if(options.quaternion){ - this.quaternion.copy(options.quaternion); - } - /** * @property initQuaternion * @type {Quaternion} @@ -5393,6 +5641,25 @@ function Body(options){ this.initQuaternion = new Quaternion(); /** + * @property {Quaternion} previousQuaternion + */ + this.previousQuaternion = new Quaternion(); + + /** + * Interpolated orientation of the body. + * @property {Quaternion} interpolatedQuaternion + */ + this.interpolatedQuaternion = new Quaternion(); + + if(options.quaternion){ + this.quaternion.copy(options.quaternion); + this.initQuaternion.copy(options.quaternion); + this.previousQuaternion.copy(options.quaternion); + this.interpolatedQuaternion.copy(options.quaternion); + } + + /** + * Angular velocity of the body, in world space. Think of the angular velocity as a vector, which the body rotates around. The length of this vector determines how fast (in radians per second) the body rotates. * @property angularVelocity * @type {Vec3} */ @@ -5408,9 +5675,6 @@ function Body(options){ */ this.initAngularVelocity = new Vec3(); - this.interpolatedPosition = new Vec3(); - this.interpolatedQuaternion = new Quaternion(); - /** * @property shapes * @type {array} @@ -5418,12 +5682,14 @@ function Body(options){ this.shapes = []; /** + * Position of each Shape in the body, given in local Body space. * @property shapeOffsets * @type {array} */ this.shapeOffsets = []; /** + * Orientation of each Shape, given in local Body space. * @property shapeOrientations * @type {array} */ @@ -5470,6 +5736,25 @@ function Body(options){ this.angularDamping = typeof(options.angularDamping) !== 'undefined' ? options.angularDamping : 0.01; /** + * Use this property to limit the motion along any world axis. (1,1,1) will allow motion along all axes while (0,0,0) allows none. + * @property {Vec3} linearFactor + */ + this.linearFactor = new Vec3(1,1,1); + if(options.linearFactor){ + this.linearFactor.copy(options.linearFactor); + } + + /** + * Use this property to limit the rotational motion along any world axis. (1,1,1) will allow rotation along all axes while (0,0,0) allows none. + * @property {Vec3} angularFactor + */ + this.angularFactor = new Vec3(1,1,1); + if(options.angularFactor){ + this.angularFactor.copy(options.angularFactor); + } + + /** + * World space bounding box of the body and its shapes. * @property aabb * @type {AABB} */ @@ -5482,6 +5767,23 @@ function Body(options){ */ this.aabbNeedsUpdate = true; + /** + * Total bounding radius of the Body including its shapes, relative to body.position. + * @property boundingRadius + * @type {Number} + */ + this.boundingRadius = 0; + + /** + * Determines if bodies do interact. "collide" event is still triggered. + * @property sensor + * @type {Boolean} + */ + this.sensor = false; + if (options.sensor) { + this.sensor = options.sensor; + } + this.wlambda = new Vec3(); if(options.shape){ @@ -5493,6 +5795,15 @@ function Body(options){ Body.prototype = new EventTarget(); Body.prototype.constructor = Body; +/** + * Dispatched after two bodies collide. This event is dispatched on each + * of the two bodies involved in the collision. + * @event collide + * @param {Body} body The body that was involved in the collision. + * @param {ContactEquation} contact The details of the collision. + */ +Body.COLLIDE_EVENT_NAME = "collide"; + /** * 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 @@ -5542,6 +5853,14 @@ Body.SLEEPING = 2; Body.idCounter = 0; +/** + * Dispatched after a sleeping body has woken up. + * @event wakeup + */ +Body.wakeupEvent = { + type: "wakeup" +}; + /** * Wake the body up. * @method wakeUp @@ -5549,8 +5868,9 @@ Body.idCounter = 0; Body.prototype.wakeUp = function(){ var s = this.sleepState; this.sleepState = 0; + this._wakeUpAfterNarrowphase = false; if(s === Body.SLEEPING){ - this.dispatchEvent({type:"wakeup"}); + this.dispatchEvent(Body.wakeupEvent); } }; @@ -5562,12 +5882,21 @@ Body.prototype.sleep = function(){ this.sleepState = Body.SLEEPING; this.velocity.set(0,0,0); this.angularVelocity.set(0,0,0); + this._wakeUpAfterNarrowphase = false; }; +/** + * Dispatched after a body has gone in to the sleepy state. + * @event sleepy + */ Body.sleepyEvent = { type: "sleepy" }; +/** + * Dispatched after a body has fallen asleep. + * @event sleep + */ Body.sleepEvent = { type: "sleep" }; @@ -5672,8 +6001,8 @@ 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 + * @param {Vec3} [_offset] + * @param {Quaternion} [_orientation] * @return {Body} The body object, for chainability. */ Body.prototype.addShape = function(shape, _offset, _orientation){ @@ -5695,6 +6024,8 @@ Body.prototype.addShape = function(shape, _offset, _orientation){ this.aabbNeedsUpdate = true; + shape.body = this; + return this; }; @@ -5742,15 +6073,12 @@ Body.prototype.computeAABB = function(){ 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); + bodyQuat.vmult(shapeOffsets[i], offset); offset.vadd(this.position, offset); - // vec2.rotate(offset, shapeOffsets[i], bodyAngle); - // vec2.add(offset, offset, this.position); + // Get shape world quaternion + shapeOrientations[i].mult(bodyQuat, orientation); // Get shape AABB shape.calculateWorldAABB(offset, orientation, shapeAABB.lowerBound, shapeAABB.upperBound); @@ -5789,35 +6117,25 @@ Body.prototype.updateInertiaWorld = function(force){ 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. + * @param {Vec3} relativePoint A point relative to the center of mass 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){ +Body.prototype.applyForce = function(force,relativePoint){ + if(this.type !== Body.DYNAMIC){ // Needed? 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); + relativePoint.cross(force,rotForce); // Add linear force this.force.vadd(force,this.force); @@ -5833,39 +6151,38 @@ Body.prototype.applyForce = function(force,worldPoint){ * @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(); +var Body_applyLocalForce_relativePointWorld = new Vec3(); Body.prototype.applyLocalForce = function(localForce, localPoint){ if(this.type !== Body.DYNAMIC){ return; } var worldForce = Body_applyLocalForce_worldForce; - var worldPoint = Body_applyLocalForce_worldPoint; + var relativePointWorld = Body_applyLocalForce_relativePointWorld; // Transform the force vector to world space this.vectorToWorldFrame(localForce, worldForce); - this.pointToWorldFrame(localPoint, worldPoint); + this.vectorToWorldFrame(localPoint, relativePointWorld); - this.applyForce(worldForce, worldPoint); + this.applyForce(worldForce, relativePointWorld); }; /** * 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. + * @param {Vec3} relativePoint A point relative to the center of mass 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){ +Body.prototype.applyImpulse = function(impulse, relativePoint){ if(this.type !== Body.DYNAMIC){ return; } // Compute point position relative to the body center - var r = Body_applyImpulse_r; - worldPoint.vsub(this.position,r); + var r = relativePoint; // Compute produced central impulse velocity var velo = Body_applyImpulse_velo; @@ -5897,20 +6214,20 @@ Body.prototype.applyImpulse = function(impulse, worldPoint){ * @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(); +var Body_applyLocalImpulse_relativePoint = new Vec3(); Body.prototype.applyLocalImpulse = function(localImpulse, localPoint){ if(this.type !== Body.DYNAMIC){ return; } var worldImpulse = Body_applyLocalImpulse_worldImpulse; - var worldPoint = Body_applyLocalImpulse_worldPoint; + var relativePointWorld = Body_applyLocalImpulse_relativePoint; // Transform the force vector to world space this.vectorToWorldFrame(localImpulse, worldImpulse); - this.pointToWorldFrame(localPoint, worldPoint); + this.vectorToWorldFrame(localPoint, relativePointWorld); - this.applyImpulse(worldImpulse, worldPoint); + this.applyImpulse(worldImpulse, relativePointWorld); }; var Body_updateMassProperties_halfExtents = new Vec3(); @@ -5958,7 +6275,73 @@ Body.prototype.getVelocityAtWorldPoint = function(worldPoint, 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 torque = new Vec3(); +var invI_tau_dt = new Vec3(); +var w = new Quaternion(); +var wq = new Quaternion(); + +/** + * Move the body forward in time. + * @param {number} dt Time step + * @param {boolean} quatNormalize Set to true to normalize the body quaternion + * @param {boolean} quatNormalizeFast If the quaternion should be normalized using "fast" quaternion normalization + */ +Body.prototype.integrate = function(dt, quatNormalize, quatNormalizeFast){ + + // Save previous position + this.previousPosition.copy(this.position); + this.previousQuaternion.copy(this.quaternion); + + if(!(this.type === Body.DYNAMIC || this.type === Body.KINEMATIC) || this.sleepState === Body.SLEEPING){ // Only for dynamic + return; + } + + var velo = this.velocity, + angularVelo = this.angularVelocity, + pos = this.position, + force = this.force, + torque = this.torque, + quat = this.quaternion, + invMass = this.invMass, + invInertia = this.invInertiaWorld, + linearFactor = this.linearFactor; + + var iMdt = invMass * dt; + velo.x += force.x * iMdt * linearFactor.x; + velo.y += force.y * iMdt * linearFactor.y; + velo.z += force.z * iMdt * linearFactor.z; + + var e = invInertia.elements; + var angularFactor = this.angularFactor; + var tx = torque.x * angularFactor.x; + var ty = torque.y * angularFactor.y; + var tz = torque.z * angularFactor.z; + angularVelo.x += dt * (e[0] * tx + e[1] * ty + e[2] * tz); + angularVelo.y += dt * (e[3] * tx + e[4] * ty + e[5] * tz); + angularVelo.z += dt * (e[6] * tx + e[7] * ty + e[8] * tz); + + // Use new velocity - leap frog + pos.x += velo.x * dt; + pos.y += velo.y * dt; + pos.z += velo.z * dt; + + quat.integrate(this.angularVelocity, dt, this.angularFactor, quat); + + if(quatNormalize){ + if(quatNormalizeFast){ + quat.normalizeFast(); + } else { + quat.normalize(); + } + } + + this.aabbNeedsUpdate = true; + + // Update world inertia + this.updateInertiaWorld(); +}; + +},{"../collision/AABB":3,"../material/Material":26,"../math/Mat3":28,"../math/Quaternion":29,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Shape":44,"../utils/EventTarget":50}],33:[function(_dereq_,module,exports){ var Body = _dereq_('./Body'); var Vec3 = _dereq_('../math/Vec3'); var Quaternion = _dereq_('../math/Quaternion'); @@ -6087,7 +6470,7 @@ RaycastVehicle.prototype.setBrake = function(brake, wheelIndex){ */ RaycastVehicle.prototype.addToWorld = function(world){ var constraints = this.constraints; - world.add(this.chassisBody); + world.addBody(this.chassisBody); var that = this; this.preStepCallback = function(){ that.updateVehicle(world.dt); @@ -6149,7 +6532,7 @@ RaycastVehicle.prototype.updateVehicle = function(timeStep){ wheel.raycastResult.hitNormalWorld.scale(suspensionForce * timeStep, impulse); wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, relpos); - chassisBody.applyImpulse(impulse, wheel.raycastResult.hitPointWorld/*relpos*/); + chassisBody.applyImpulse(impulse, relpos); } this.updateFriction(timeStep); @@ -6539,9 +6922,9 @@ RaycastVehicle.prototype.updateFriction = function(timeStep) { var wheel = wheelInfos[i]; var rel_pos = new Vec3(); - //wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, rel_pos); + wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, rel_pos); // cannons applyimpulse is using world coord for the position - rel_pos.copy(wheel.raycastResult.hitPointWorld); + //rel_pos.copy(wheel.raycastResult.hitPointWorld); if (wheel.forwardImpulse !== 0) { var impulse = new Vec3(); @@ -6553,16 +6936,16 @@ RaycastVehicle.prototype.updateFriction = function(timeStep) { var groundObject = wheel.raycastResult.body; var rel_pos2 = new Vec3(); - //wheel.raycastResult.hitPointWorld.vsub(groundObject.position, rel_pos2); - rel_pos2.copy(wheel.raycastResult.hitPointWorld); + 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); + chassisBody.vectorToLocalFrame(rel_pos, rel_pos); rel_pos['xyz'[this.indexUpAxis]] *= wheel.rollInfluence; - chassisBody.pointToWorldFrame(rel_pos, rel_pos); + chassisBody.vectorToWorldFrame(rel_pos, rel_pos); chassisBody.applyImpulse(sideImp, rel_pos); //apply friction impulse on the ground @@ -6662,7 +7045,7 @@ function resolveSingleBilateral(body1, pos1, body2, pos2, normal, impulse){ return impulse; } -},{"../collision/Ray":9,"../collision/RaycastResult":10,"../math/Quaternion":28,"../math/Vec3":30,"../objects/WheelInfo":36,"./Body":31}],33:[function(_dereq_,module,exports){ +},{"../collision/Ray":10,"../collision/RaycastResult":11,"../math/Quaternion":29,"../math/Vec3":31,"../objects/WheelInfo":37,"./Body":32}],34:[function(_dereq_,module,exports){ var Body = _dereq_('./Body'); var Sphere = _dereq_('../shapes/Sphere'); var Box = _dereq_('../shapes/Box'); @@ -6834,7 +7217,7 @@ RigidVehicle.prototype.addToWorld = function(world){ var bodies = this.wheelBodies.concat([this.chassisBody]); for (var i = 0; i < bodies.length; i++) { - world.add(bodies[i]); + world.addBody(bodies[i]); } for (var i = 0; i < constraints.length; i++) { @@ -6884,7 +7267,7 @@ RigidVehicle.prototype.getWheelSpeed = function(wheelIndex){ return w.dot(worldAxis); }; -},{"../constraints/HingeConstraint":15,"../math/Vec3":30,"../shapes/Box":37,"../shapes/Sphere":44,"./Body":31}],34:[function(_dereq_,module,exports){ +},{"../constraints/HingeConstraint":16,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Sphere":45,"./Body":32}],35:[function(_dereq_,module,exports){ module.exports = SPHSystem; var Shape = _dereq_('../shapes/Shape'); @@ -7099,7 +7482,7 @@ SPHSystem.prototype.nablaw = function(r){ 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){ +},{"../material/Material":26,"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Particle":42,"../shapes/Shape":44}],36:[function(_dereq_,module,exports){ var Vec3 = _dereq_('../math/Vec3'); module.exports = Spring; @@ -7294,7 +7677,7 @@ Spring.prototype.applyForce = function(){ bodyB.torque.vadd(rj_x_f,bodyB.torque); }; -},{"../math/Vec3":30}],36:[function(_dereq_,module,exports){ +},{"../math/Vec3":31}],37:[function(_dereq_,module,exports){ var Vec3 = _dereq_('../math/Vec3'); var Transform = _dereq_('../math/Transform'); var RaycastResult = _dereq_('../collision/RaycastResult'); @@ -7577,7 +7960,7 @@ WheelInfo.prototype.updateWheel = function(chassis){ this.clippedInvContactDotSuspension = 1.0; } }; -},{"../collision/RaycastResult":10,"../math/Transform":29,"../math/Vec3":30,"../utils/Utils":53}],37:[function(_dereq_,module,exports){ +},{"../collision/RaycastResult":11,"../math/Transform":30,"../math/Vec3":31,"../utils/Utils":54}],38:[function(_dereq_,module,exports){ module.exports = Box; var Shape = _dereq_('./Shape'); @@ -7593,9 +7976,9 @@ var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); * @extends Shape */ function Box(halfExtents){ - Shape.call(this); - - this.type = Shape.types.BOX; + Shape.call(this, { + type: Shape.types.BOX + }); /** * @property halfExtents @@ -7814,7 +8197,7 @@ Box.prototype.calculateWorldAABB = function(pos,quat,min,max){ // }); }; -},{"../math/Vec3":30,"./ConvexPolyhedron":38,"./Shape":43}],38:[function(_dereq_,module,exports){ +},{"../math/Vec3":31,"./ConvexPolyhedron":39,"./Shape":44}],39:[function(_dereq_,module,exports){ module.exports = ConvexPolyhedron; var Shape = _dereq_('./Shape'); @@ -7842,9 +8225,9 @@ var Transform = _dereq_('../math/Transform'); * @todo Automatically merge coplanar polygons in constructor. */ function ConvexPolyhedron(points, faces, uniqueAxes) { - var that = this; - Shape.call(this); - this.type = Shape.types.CONVEXPOLYHEDRON; + Shape.call(this, { + type: Shape.types.CONVEXPOLYHEDRON + }); /** * Array of Vec3 @@ -8742,7 +9125,7 @@ ConvexPolyhedron.project = function(hull, axis, pos, quat, result){ result[1] = min; }; -},{"../math/Quaternion":28,"../math/Transform":29,"../math/Vec3":30,"./Shape":43}],39:[function(_dereq_,module,exports){ +},{"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"./Shape":44}],40:[function(_dereq_,module,exports){ module.exports = Cylinder; var Shape = _dereq_('./Shape'); @@ -8818,13 +9201,12 @@ function Cylinder( radiusTop, radiusBottom, height , numSegments ) { } faces.push(temp); - this.type = Shape.types.CONVEXPOLYHEDRON; ConvexPolyhedron.call( this, verts, faces, axes ); } Cylinder.prototype = new ConvexPolyhedron(); -},{"../math/Quaternion":28,"../math/Vec3":30,"./ConvexPolyhedron":38,"./Shape":43}],40:[function(_dereq_,module,exports){ +},{"../math/Quaternion":29,"../math/Vec3":31,"./ConvexPolyhedron":39,"./Shape":44}],41:[function(_dereq_,module,exports){ var Shape = _dereq_('./Shape'); var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); var Vec3 = _dereq_('../math/Vec3'); @@ -8843,6 +9225,7 @@ module.exports = Heightfield; * @param {Number} [options.maxValue] Maximum value. * @param {Number} [options.elementSize=0.1] World spacing between the data points in X direction. * @todo Should be possible to use along all axes, not just y + * @todo should be possible to scale along all axes * * @example * // Generate some height data (y-values). @@ -8901,12 +9284,13 @@ function Heightfield(data, options){ this.cacheEnabled = true; - Shape.call(this); + Shape.call(this, { + type: Shape.types.HEIGHTFIELD + }); this.pillarConvex = new ConvexPolyhedron(); this.pillarOffset = new Vec3(); - this.type = Shape.types.HEIGHTFIELD; this.updateBoundingSphereRadius(); // "i_j_isUpper" => { convex: ..., offset: ... } @@ -9015,6 +9399,8 @@ Heightfield.prototype.getRectMinMax = function (iMinX, iMinY, iMaxX, iMaxY, resu 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 @@ -9051,16 +9437,119 @@ Heightfield.prototype.getIndexOfPosition = function (x, y, result, clamp) { 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); +var getHeightAt_idx = []; +var getHeightAt_weights = new Vec3(); +var getHeightAt_a = new Vec3(); +var getHeightAt_b = new Vec3(); +var getHeightAt_c = new Vec3(); - return (minmax[0] + minmax[1]) / 2; // average -}; +Heightfield.prototype.getTriangleAt = function(x, y, edgeClamp, a, b, c){ + var idx = getHeightAt_idx; + this.getIndexOfPosition(x, y, idx, edgeClamp); + var xi = idx[0]; + var yi = idx[1]; + + var data = this.data; + if(edgeClamp){ + xi = Math.min(data.length - 2, Math.max(0, xi)); + yi = Math.min(data[0].length - 2, Math.max(0, yi)); + } + + var elementSize = this.elementSize; + var lowerDist2 = Math.pow(x / elementSize - xi, 2) + Math.pow(y / elementSize - yi, 2); + var upperDist2 = Math.pow(x / elementSize - (xi + 1), 2) + Math.pow(y / elementSize - (yi + 1), 2); + var upper = lowerDist2 > upperDist2; + this.getTriangle(xi, yi, upper, a, b, c); + return upper; +}; + +var getNormalAt_a = new Vec3(); +var getNormalAt_b = new Vec3(); +var getNormalAt_c = new Vec3(); +var getNormalAt_e0 = new Vec3(); +var getNormalAt_e1 = new Vec3(); +Heightfield.prototype.getNormalAt = function(x, y, edgeClamp, result){ + var a = getNormalAt_a; + var b = getNormalAt_b; + var c = getNormalAt_c; + var e0 = getNormalAt_e0; + var e1 = getNormalAt_e1; + this.getTriangleAt(x, y, edgeClamp, a, b, c); + b.vsub(a, e0); + c.vsub(a, e1); + e0.cross(e1, result); + result.normalize(); +}; + + +/** + * Get an AABB of a square in the heightfield + * @param {number} xi + * @param {number} yi + * @param {AABB} result + */ +Heightfield.prototype.getAabbAtIndex = function(xi, yi, result){ + var data = this.data; + var elementSize = this.elementSize; + + result.lowerBound.set( + xi * elementSize, + yi * elementSize, + data[xi][yi] + ); + result.upperBound.set( + (xi + 1) * elementSize, + (yi + 1) * elementSize, + data[xi + 1][yi + 1] + ); +}; + + +/** + * Get the height in the heightfield at a given position + * @param {number} x + * @param {number} y + * @param {boolean} edgeClamp + * @return {number} + */ +Heightfield.prototype.getHeightAt = function(x, y, edgeClamp){ + var data = this.data; + var a = getHeightAt_a; + var b = getHeightAt_b; + var c = getHeightAt_c; + var idx = getHeightAt_idx; + + this.getIndexOfPosition(x, y, idx, edgeClamp); + var xi = idx[0]; + var yi = idx[1]; + if(edgeClamp){ + xi = Math.min(data.length - 2, Math.max(0, xi)); + yi = Math.min(data[0].length - 2, Math.max(0, yi)); + } + var upper = this.getTriangleAt(x, y, edgeClamp, a, b, c); + barycentricWeights(x, y, a.x, a.y, b.x, b.y, c.x, c.y, getHeightAt_weights); + + var w = getHeightAt_weights; + + if(upper){ + + // Top triangle verts + return data[xi + 1][yi + 1] * w.x + data[xi][yi + 1] * w.y + data[xi + 1][yi] * w.z; + + } else { + + // Top triangle verts + return data[xi][yi] * w.x + data[xi + 1][yi] * w.y + data[xi][yi + 1] * w.z; + } +}; + +// from https://en.wikipedia.org/wiki/Barycentric_coordinate_system +function barycentricWeights(x, y, ax, ay, bx, by, cx, cy, result){ + result.x = ((by - cy) * (x - cx) + (cx - bx) * (y - cy)) / ((by - cy) * (ax - cx) + (cx - bx) * (ay - cy)); + result.y = ((cy - ay) * (x - cx) + (ax - cx) * (y - cy)) / ((by - cy) * (ax - cx) + (cx - bx) * (ay - cy)); + result.z = 1 - result.x - result.y; +} Heightfield.prototype.getCacheConvexTrianglePillarKey = function(xi, yi, getUpperTriangle){ return xi + '_' + yi + '_' + (getUpperTriangle ? 1 : 0); @@ -9081,6 +9570,59 @@ Heightfield.prototype.clearCachedConvexTrianglePillar = function(xi, yi, getUppe delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)]; }; +/** + * Get a triangle from the heightfield + * @param {number} xi + * @param {number} yi + * @param {boolean} upper + * @param {Vec3} a + * @param {Vec3} b + * @param {Vec3} c + */ +Heightfield.prototype.getTriangle = function(xi, yi, upper, a, b, c){ + var data = this.data; + var elementSize = this.elementSize; + + if(upper){ + + // Top triangle verts + a.set( + (xi + 1) * elementSize, + (yi + 1) * elementSize, + data[xi + 1][yi + 1] + ); + b.set( + xi * elementSize, + (yi + 1) * elementSize, + data[xi][yi + 1] + ); + c.set( + (xi + 1) * elementSize, + yi * elementSize, + data[xi + 1][yi] + ); + + } else { + + // Top triangle verts + a.set( + xi * elementSize, + yi * elementSize, + data[xi][yi] + ); + b.set( + (xi + 1) * elementSize, + yi * elementSize, + data[xi + 1][yi] + ); + c.set( + xi * elementSize, + (yi + 1) * elementSize, + data[xi][yi + 1] + ); + } +}; + /** * Get a triangle in the terrain in the form of a triangular convex shape. * @method getConvexTrianglePillar @@ -9310,7 +9852,47 @@ Heightfield.prototype.updateBoundingSphereRadius = function(){ 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){ +/** + * Sets the height values from an image. Currently only supported in browser. + * @method setHeightsFromImage + * @param {Image} image + * @param {Vec3} scale + */ +Heightfield.prototype.setHeightsFromImage = function(image, scale){ + var canvas = document.createElement('canvas'); + canvas.width = image.width; + canvas.height = image.height; + var context = canvas.getContext('2d'); + context.drawImage(image, 0, 0); + var imageData = context.getImageData(0, 0, image.width, image.height); + + var matrix = this.data; + matrix.length = 0; + this.elementSize = Math.abs(scale.x) / imageData.width; + for(var i=0; i size) { + objects.pop(); + } + + while (objects.length < size) { + objects.push(this.constructObject()); + } + + return this; +}; + + +},{}],53:[function(_dereq_,module,exports){ module.exports = TupleDictionary; /** @@ -10938,7 +11585,7 @@ TupleDictionary.prototype.reset = function() { } }; -},{}],53:[function(_dereq_,module,exports){ +},{}],54:[function(_dereq_,module,exports){ function Utils(){} module.exports = Utils; @@ -10963,7 +11610,7 @@ Utils.defaults = function(options, defaults){ return options; }; -},{}],54:[function(_dereq_,module,exports){ +},{}],55:[function(_dereq_,module,exports){ module.exports = Vec3Pool; var Vec3 = _dereq_('../math/Vec3'); @@ -10989,10 +11636,11 @@ Vec3Pool.prototype.constructObject = function(){ return new Vec3(); }; -},{"../math/Vec3":30,"./Pool":51}],55:[function(_dereq_,module,exports){ +},{"../math/Vec3":31,"./Pool":52}],56:[function(_dereq_,module,exports){ module.exports = Narrowphase; var AABB = _dereq_('../collision/AABB'); +var Body = _dereq_('../objects/Body'); var Shape = _dereq_('../shapes/Shape'); var Ray = _dereq_('../collision/Ray'); var Vec3 = _dereq_('../math/Vec3'); @@ -11043,9 +11691,15 @@ function Narrowphase(world){ /** * Make a contact object, by using the internal pool or creating a new one. * @method createContactEquation + * @param {Body} bi + * @param {Body} bj + * @param {Shape} si + * @param {Shape} sj + * @param {Shape} overrideShapeA + * @param {Shape} overrideShapeB * @return {ContactEquation} */ -Narrowphase.prototype.createContactEquation = function(bi, bj, si, sj, rsi, rsj){ +Narrowphase.prototype.createContactEquation = function(bi, bj, si, sj, overrideShapeA, overrideShapeB){ var c; if(this.contactPointPool.length){ c = this.contactPointPool.pop(); @@ -11073,8 +11727,8 @@ Narrowphase.prototype.createContactEquation = function(bi, bj, si, sj, rsi, rsj) c.restitution = matA.restitution * matB.restitution; } - c.si = rsi || si; - c.sj = rsj || sj; + c.si = overrideShapeA || si; + c.sj = overrideShapeB || sj; return c; }; @@ -11162,19 +11816,19 @@ Narrowphase.prototype.createFrictionFromAverage = function(numContacts){ 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); + averageNormal.vadd(c.ni, averageNormal); + averageContactPointA.vadd(c.ri, averageContactPointA); 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); + averageNormal.vsub(c.ni, averageNormal); + averageContactPointA.vadd(c.rj, averageContactPointA); 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); + averageContactPointA.scale(invNumContacts, f1.ri); + averageContactPointB.scale(invNumContacts, f1.rj); f2.ri.copy(f1.ri); // Should be the same f2.rj.copy(f1.rj); averageNormal.normalize(); @@ -11221,6 +11875,16 @@ Narrowphase.prototype.getContacts = function(p1, p2, world, result, oldcontacts, bodyContactMaterial = world.getContactMaterial(bi.material,bj.material) || null; } + var justTest = ( + ( + (bi.type & Body.KINEMATIC) && (bj.type & Body.STATIC) + ) || ( + (bi.type & Body.STATIC) && (bj.type & Body.KINEMATIC) + ) || ( + (bi.type & Body.KINEMATIC) && (bj.type & Body.KINEMATIC) + ) + ); + for (var i = 0; i < bi.shapes.length; i++) { bi.quaternion.mult(bi.shapeOrientations[i], qi); bi.quaternion.vmult(bi.shapeOffsets[i], xi); @@ -11235,6 +11899,10 @@ Narrowphase.prototype.getContacts = function(p1, p2, world, result, oldcontacts, xj.vadd(bj.position, xj); var sj = bj.shapes[j]; + if(!((si.collisionFilterMask & sj.collisionFilterGroup) && (sj.collisionFilterMask & si.collisionFilterGroup))){ + continue; + } + if(xi.distanceTo(xj) > si.boundingSphereRadius + sj.boundingSphereRadius){ continue; } @@ -11250,10 +11918,17 @@ Narrowphase.prototype.getContacts = function(p1, p2, world, result, oldcontacts, // Get contacts var resolver = this[si.type | sj.type]; if(resolver){ + var retval = false; if (si.type < sj.type) { - resolver.call(this, si, sj, xi, xj, qi, qj, bi, bj, si, sj); + retval = resolver.call(this, si, sj, xi, xj, qi, qj, bi, bj, si, sj, justTest); } else { - resolver.call(this, sj, si, xj, xi, qj, qi, bj, bi, si, sj); + retval = resolver.call(this, sj, si, xj, xi, qj, qi, bj, bi, si, sj, justTest); + } + + if(retval && justTest){ + // Register overlap + world.shapeOverlapKeeper.set(si.id, sj.id); + world.bodyOverlapKeeper.set(bi.id, bj.id); } } } @@ -11275,26 +11950,26 @@ function warn(msg){ } Narrowphase.prototype[Shape.types.BOX | Shape.types.BOX] = -Narrowphase.prototype.boxBox = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.boxBox = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ 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); + return this.convexConvex(si.convexPolyhedronRepresentation,sj.convexPolyhedronRepresentation,xi,xj,qi,qj,bi,bj,si,sj,justTest); }; Narrowphase.prototype[Shape.types.BOX | Shape.types.CONVEXPOLYHEDRON] = -Narrowphase.prototype.boxConvex = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.boxConvex = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ si.convexPolyhedronRepresentation.material = si.material; si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; - this.convexConvex(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj); + return this.convexConvex(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj,justTest); }; Narrowphase.prototype[Shape.types.BOX | Shape.types.PARTICLE] = -Narrowphase.prototype.boxParticle = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.boxParticle = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ si.convexPolyhedronRepresentation.material = si.material; si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; - this.convexParticle(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj); + return this.convexParticle(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj,justTest); }; /** @@ -11309,9 +11984,13 @@ Narrowphase.prototype.boxParticle = function(si,sj,xi,xj,qi,qj,bi,bj){ * @param {Body} bj */ Narrowphase.prototype[Shape.types.SPHERE] = -Narrowphase.prototype.sphereSphere = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.sphereSphere = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + if(justTest){ + return xi.distanceSquared(xj) < Math.pow(si.radius + sj.radius, 2); + } + // We will have only one contact in this case - var r = this.createContactEquation(bi,bj,si,sj); + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); // Contact normal xj.vsub(xi, r.ni); @@ -11357,7 +12036,10 @@ Narrowphase.prototype.planeTrimesh = function( planeQuat, trimeshQuat, planeBody, - trimeshBody + trimeshBody, + rsi, + rsj, + justTest ){ // Make contacts! var v = new Vec3(); @@ -11382,7 +12064,11 @@ Narrowphase.prototype.planeTrimesh = function( var dot = normal.dot(relpos); if(dot <= 0.0){ - var r = this.createContactEquation(planeBody,trimeshBody,planeShape,trimeshShape); + if(justTest){ + return true; + } + + var r = this.createContactEquation(planeBody,trimeshBody,planeShape,trimeshShape,rsi,rsj); r.ni.copy(normal); // Contact normal is the plane normal @@ -11441,7 +12127,10 @@ Narrowphase.prototype.sphereTrimesh = function ( sphereQuat, trimeshQuat, sphereBody, - trimeshBody + trimeshBody, + rsi, + rsj, + justTest ) { var edgeVertexA = sphereTrimesh_edgeVertexA; @@ -11493,7 +12182,11 @@ Narrowphase.prototype.sphereTrimesh = function ( v.vsub(spherePos, relpos); - var r = this.createContactEquation(sphereBody,trimeshBody,sphereShape,trimeshShape); + if(justTest){ + return true; + } + + var r = this.createContactEquation(sphereBody,trimeshBody,sphereShape,trimeshShape,rsi,rsj); r.ni.copy(relpos); r.ni.normalize(); @@ -11543,7 +12236,12 @@ Narrowphase.prototype.sphereTrimesh = function ( // 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); + + if(justTest){ + return true; + } + + var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape,rsi,rsj); tmp.vsub(localSpherePos, r.ni); r.ni.normalize(); @@ -11578,7 +12276,10 @@ Narrowphase.prototype.sphereTrimesh = function ( // 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); + if(justTest){ + return true; + } + var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape,rsi,rsj); tmp.vsub(localSpherePos, r.ni); r.ni.normalize(); @@ -11613,9 +12314,9 @@ var plane_to_sphere_ortho = new Vec3(); * @param {Body} bj */ Narrowphase.prototype[Shape.types.SPHERE | Shape.types.PLANE] = -Narrowphase.prototype.spherePlane = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.spherePlane = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ // We will have one contact in this case - var r = this.createContactEquation(bi,bj,si,sj); + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); // Contact normal r.ni.set(0,0,1); @@ -11633,6 +12334,10 @@ Narrowphase.prototype.spherePlane = function(si,sj,xi,xj,qi,qj,bi,bj){ if(-point_on_plane_to_sphere.dot(r.ni) <= si.radius){ + if(justTest){ + return true; + } + // Make it relative to the body var ri = r.ri; var rj = r.rj; @@ -11709,7 +12414,7 @@ var sphereBox_side_ns2 = new Vec3(); * @param {Body} bj */ Narrowphase.prototype[Shape.types.SPHERE | Shape.types.BOX] = -Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj){ +Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ var v3pool = this.v3pool; // we refer to the box as body j @@ -11765,13 +12470,17 @@ Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj){ side_ns1.copy(ns1); side_ns2.copy(ns2); side_penetrations++; + + if(justTest){ + return true; + } } } } } if(side_penetrations){ found = true; - var r = this.createContactEquation(bi,bj,si,sj); + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); side_ns.mult(-R,r.ri); // Sphere r r.ni.copy(side_ns); r.ni.negate(r.ni); // Normal should be out of sphere @@ -11819,8 +12528,11 @@ Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj){ sphere_to_corner.vsub(xi,sphere_to_corner); if(sphere_to_corner.norm2() < R*R){ + if(justTest){ + return true; + } found = true; - var r = this.createContactEquation(bi,bj,si,sj); + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); r.ri.copy(sphere_to_corner); r.ri.normalize(); r.ni.copy(r.ri); @@ -11879,8 +12591,11 @@ Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj){ var ndist = dist.norm(); if(tdist < sides[l].norm() && ndist 0 && dot*dot si.boundingSphereRadius + sj.boundingSphereRadius){ @@ -12266,6 +12997,9 @@ Narrowphase.prototype.convexConvex = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,fa si.clipAgainstHull(xi,qi,sj,xj,qj,sepAxis,-100,100,res); var numContacts = 0; for(var j = 0; j !== res.length; j++){ + if(justTest){ + return true; + } var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj), ri = r.ri, rj = r.rj; @@ -12395,7 +13129,7 @@ var particlePlane_projected = new Vec3(); * @param {Body} bj */ Narrowphase.prototype[Shape.types.PLANE | Shape.types.PARTICLE] = -Narrowphase.prototype.planeParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ +Narrowphase.prototype.planeParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ var normal = particlePlane_normal; normal.set(0,0,1); bj.quaternion.vmult(normal,normal); // Turn normal according to plane orientation @@ -12403,7 +13137,12 @@ Narrowphase.prototype.planeParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ xi.vsub(bj.position,relpos); var dot = normal.dot(relpos); if(dot <= 0.0){ - var r = this.createContactEquation(bi,bj,si,sj); + + if(justTest){ + return true; + } + + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); r.ni.copy(normal); // Contact normal is the plane normal r.ni.negate(r.ni); r.ri.set(0,0,0); // Center of particle @@ -12436,7 +13175,7 @@ var particleSphere_normal = new Vec3(); * @param {Body} bj */ Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.SPHERE] = -Narrowphase.prototype.sphereParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ +Narrowphase.prototype.sphereParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ // The normal is the unit vector from sphere center to particle center var normal = particleSphere_normal; normal.set(0,0,1); @@ -12444,7 +13183,10 @@ Narrowphase.prototype.sphereParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ var lengthSquared = normal.norm2(); if(lengthSquared <= sj.radius * sj.radius){ - var r = this.createContactEquation(bi,bj,si,sj); + if(justTest){ + return true; + } + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); normal.normalize(); r.rj.copy(normal); r.rj.mult(sj.radius,r.rj); @@ -12477,7 +13219,7 @@ var convexParticle_worldPenetrationVec = new Vec3(); * @param {Body} bj */ Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.CONVEXPOLYHEDRON] = -Narrowphase.prototype.convexParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ +Narrowphase.prototype.convexParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ var penetratedFaceIndex = -1; var penetratedFaceNormal = convexParticle_penetratedFaceNormal; var worldPenetrationVec = convexParticle_worldPenetrationVec; @@ -12511,6 +13253,11 @@ Narrowphase.prototype.convexParticle = function(sj,si,xj,xi,qj,qi,bj,bi){ xi.vsub(verts[0],convexParticle_vertexToParticle); var penetration = -normal.dot(convexParticle_vertexToParticle); if(minPenetration===null || Math.abs(penetration)= dt && substeps < maxSubSteps) { + // Do fixed steps to catch up this.internalStep(dt); - if(performance.now() - t0 > dt * 1000){ - // We are slower than real-time. Better bail out. - break; - } + this.accumulator -= dt; + substeps++; } - // 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); - } + var t = (this.accumulator % dt) / dt; + for(var j=0; j !== this.bodies.length; j++){ + var b = this.bodies[j]; + b.previousPosition.lerp(b.position, t, b.interpolatedPosition); + b.previousQuaternion.slerp(b.quaternion, t, b.interpolatedQuaternion); + b.previousQuaternion.normalize(); } + this.time += timeSinceLastCalled; } }; -/** - * Step the simulation - * @method step - * @param {Number} dt - */ -var World_step_postStepEvent = {type:"postStep"}, // Reusable event objects to save memory +var + /** + * Dispatched after the world has stepped forward in time. + * @event postStep + */ + World_step_postStepEvent = {type:"postStep"}, // Reusable event objects to save memory + /** + * Dispatched before the world steps forward in time. + * @event preStep + */ World_step_preStepEvent = {type:"preStep"}, - World_step_collideEvent = {type:"collide", body:null, contact:null }, + World_step_collideEvent = {type:Body.COLLIDE_EVENT_NAME, body:null, contact:null }, World_step_oldContacts = [], // Pools for unused objects World_step_frictionEquationPool = [], World_step_p1 = [], // Reusable arrays for collision pairs @@ -13302,7 +14116,7 @@ World.prototype.internalStep = function(dt){ // Add gravity to all objects for(i=0; i!==N; i++){ var bi = bodies[i]; - if(bi.type & DYNAMIC){ // Only for dynamic bodies + if(bi.type === DYNAMIC){ // Only for dynamic bodies var f = bi.force, m = bi.mass; f.x += m*gx; f.y += m*gy; @@ -13502,7 +14316,13 @@ World.prototype.internalStep = function(dt){ World_step_collideEvent.body = bi; bj.dispatchEvent(World_step_collideEvent); } + + this.bodyOverlapKeeper.set(bi.id, bj.id); + this.shapeOverlapKeeper.set(si.id, sj.id); } + + this.emitContactEvents(); + if(doProfiling){ profile.makeContactConstraints = performance.now() - profilingStart; profilingStart = performance.now(); @@ -13570,69 +14390,12 @@ World.prototype.internalStep = function(dt){ 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 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(); - } - } + bodies[i].integrate(dt, quatNormalize, quatNormalizeFast); } this.clearForces(); @@ -13665,6 +14428,97 @@ World.prototype.internalStep = function(dt){ } }; +World.prototype.emitContactEvents = (function(){ + var additions = []; + var removals = []; + var beginContactEvent = { + type: 'beginContact', + bodyA: null, + bodyB: null + }; + var endContactEvent = { + type: 'endContact', + bodyA: null, + bodyB: null + }; + var beginShapeContactEvent = { + type: 'beginShapeContact', + bodyA: null, + bodyB: null, + shapeA: null, + shapeB: null + }; + var endShapeContactEvent = { + type: 'endShapeContact', + bodyA: null, + bodyB: null, + shapeA: null, + shapeB: null + }; + return function(){ + var hasBeginContact = this.hasAnyEventListener('beginContact'); + var hasEndContact = this.hasAnyEventListener('endContact'); + + if(hasBeginContact || hasEndContact){ + this.bodyOverlapKeeper.getDiff(additions, removals); + } + + if(hasBeginContact){ + for (var i = 0, l = additions.length; i < l; i += 2) { + beginContactEvent.bodyA = this.getBodyById(additions[i]); + beginContactEvent.bodyB = this.getBodyById(additions[i+1]); + this.dispatchEvent(beginContactEvent); + } + beginContactEvent.bodyA = beginContactEvent.bodyB = null; + } + + if(hasEndContact){ + for (var i = 0, l = removals.length; i < l; i += 2) { + endContactEvent.bodyA = this.getBodyById(removals[i]); + endContactEvent.bodyB = this.getBodyById(removals[i+1]); + this.dispatchEvent(endContactEvent); + } + endContactEvent.bodyA = endContactEvent.bodyB = null; + } + + additions.length = removals.length = 0; + + var hasBeginShapeContact = this.hasAnyEventListener('beginShapeContact'); + var hasEndShapeContact = this.hasAnyEventListener('endShapeContact'); + + if(hasBeginShapeContact || hasEndShapeContact){ + this.shapeOverlapKeeper.getDiff(additions, removals); + } + + if(hasBeginShapeContact){ + for (var i = 0, l = additions.length; i < l; i += 2) { + var shapeA = this.getShapeById(additions[i]); + var shapeB = this.getShapeById(additions[i+1]); + beginShapeContactEvent.shapeA = shapeA; + beginShapeContactEvent.shapeB = shapeB; + beginShapeContactEvent.bodyA = shapeA.body; + beginShapeContactEvent.bodyB = shapeB.body; + this.dispatchEvent(beginShapeContactEvent); + } + beginShapeContactEvent.bodyA = beginShapeContactEvent.bodyB = beginShapeContactEvent.shapeA = beginShapeContactEvent.shapeB = null; + } + + if(hasEndShapeContact){ + for (var i = 0, l = removals.length; i < l; i += 2) { + var shapeA = this.getShapeById(removals[i]); + var shapeB = this.getShapeById(removals[i+1]); + endShapeContactEvent.shapeA = shapeA; + endShapeContactEvent.shapeB = shapeB; + endShapeContactEvent.bodyA = shapeA.body; + endShapeContactEvent.bodyB = shapeB.body; + this.dispatchEvent(endShapeContactEvent); + } + endShapeContactEvent.bodyA = endShapeContactEvent.bodyB = endShapeContactEvent.shapeA = endShapeContactEvent.shapeB = null; + } + + }; +})(); + /** * Sets all body forces in the world to zero. * @method clearForces @@ -13682,6 +14536,6 @@ World.prototype.clearForces = function(){ } }; -},{"../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]) +},{"../collision/AABB":3,"../collision/ArrayCollisionMatrix":4,"../collision/NaiveBroadphase":7,"../collision/OverlapKeeper":9,"../collision/Ray":10,"../collision/RaycastResult":11,"../equations/ContactEquation":20,"../equations/FrictionEquation":22,"../material/ContactMaterial":25,"../material/Material":26,"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Shape":44,"../solver/GSSolver":47,"../utils/EventTarget":50,"../utils/TupleDictionary":53,"./Narrowphase":56}]},{},[2]) (2) }); \ No newline at end of file diff --git a/build/cannon.min.js b/build/cannon.min.js index 01a53bc6d..f9a439138 100644 --- a/build/cannon.min.js +++ b/build/cannon.min.js @@ -1,3 +1,5 @@ +// Mon, 15 Jul 2019 22:31:53 GMT + /* * Copyright (c) 2015 cannon.js Authors * @@ -21,8 +23,4 @@ * 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)}); \ No newline at end of file +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&false)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.CANNON=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c||a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g (http://steffe.se)",keywords:["cannon.js","cannon","physics","engine","3d"],main:"./src/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(a,b,c){b.exports={version:a("../package.json").version,AABB:a("./collision/AABB"),ArrayCollisionMatrix:a("./collision/ArrayCollisionMatrix"),Body:a("./objects/Body"),Box:a("./shapes/Box"),Broadphase:a("./collision/Broadphase"),Constraint:a("./constraints/Constraint"),ContactEquation:a("./equations/ContactEquation"),Narrowphase:a("./world/Narrowphase"),ConeTwistConstraint:a("./constraints/ConeTwistConstraint"),ContactMaterial:a("./material/ContactMaterial"),ConvexPolyhedron:a("./shapes/ConvexPolyhedron"),Cylinder:a("./shapes/Cylinder"),DistanceConstraint:a("./constraints/DistanceConstraint"),Equation:a("./equations/Equation"),EventTarget:a("./utils/EventTarget"),FrictionEquation:a("./equations/FrictionEquation"),GSSolver:a("./solver/GSSolver"),GridBroadphase:a("./collision/GridBroadphase"),Heightfield:a("./shapes/Heightfield"),HingeConstraint:a("./constraints/HingeConstraint"),LockConstraint:a("./constraints/LockConstraint"),Mat3:a("./math/Mat3"),Material:a("./material/Material"),NaiveBroadphase:a("./collision/NaiveBroadphase"),ObjectCollisionMatrix:a("./collision/ObjectCollisionMatrix"),Pool:a("./utils/Pool"),Particle:a("./shapes/Particle"),Plane:a("./shapes/Plane"),PointToPointConstraint:a("./constraints/PointToPointConstraint"),Quaternion:a("./math/Quaternion"),Ray:a("./collision/Ray"),RaycastVehicle:a("./objects/RaycastVehicle"),RaycastResult:a("./collision/RaycastResult"),RigidVehicle:a("./objects/RigidVehicle"),RotationalEquation:a("./equations/RotationalEquation"),RotationalMotorEquation:a("./equations/RotationalMotorEquation"),SAPBroadphase:a("./collision/SAPBroadphase"),SPHSystem:a("./objects/SPHSystem"),Shape:a("./shapes/Shape"),Solver:a("./solver/Solver"),Sphere:a("./shapes/Sphere"),SplitSolver:a("./solver/SplitSolver"),Spring:a("./objects/Spring"),Transform:a("./math/Transform"),Trimesh:a("./shapes/Trimesh"),Vec3:a("./math/Vec3"),Vec3Pool:a("./utils/Vec3Pool"),World:a("./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":10,"./collision/RaycastResult":11,"./collision/SAPBroadphase":12,"./constraints/ConeTwistConstraint":13,"./constraints/Constraint":14,"./constraints/DistanceConstraint":15,"./constraints/HingeConstraint":16,"./constraints/LockConstraint":17,"./constraints/PointToPointConstraint":18,"./equations/ContactEquation":20,"./equations/Equation":21,"./equations/FrictionEquation":22,"./equations/RotationalEquation":23,"./equations/RotationalMotorEquation":24,"./material/ContactMaterial":25,"./material/Material":26,"./math/Mat3":28,"./math/Quaternion":29,"./math/Transform":30,"./math/Vec3":31,"./objects/Body":32,"./objects/RaycastVehicle":33,"./objects/RigidVehicle":34,"./objects/SPHSystem":35,"./objects/Spring":36,"./shapes/Box":38,"./shapes/ConvexPolyhedron":39,"./shapes/Cylinder":40,"./shapes/Heightfield":41,"./shapes/Particle":42,"./shapes/Plane":43,"./shapes/Shape":44,"./shapes/Sphere":45,"./shapes/Trimesh":46,"./solver/GSSolver":47,"./solver/Solver":48,"./solver/SplitSolver":49,"./utils/EventTarget":50,"./utils/Pool":52,"./utils/Vec3Pool":55,"./world/Narrowphase":56,"./world/World":57}],3:[function(a,b,c){function d(a){a=a||{},this.lowerBound=new e,a.lowerBound&&this.lowerBound.copy(a.lowerBound),this.upperBound=new e,a.upperBound&&this.upperBound.copy(a.upperBound)}var e=a("../math/Vec3");a("../utils/Utils");b.exports=d;var f=new e;d.prototype.setFromPoints=function(a,b,c,d){var e=this.lowerBound,g=this.upperBound,h=c;e.copy(a[0]),h&&h.vmult(e,e),g.copy(e);for(var i=1;ig.x&&(g.x=j.x),j.xg.y&&(g.y=j.y),j.yg.z&&(g.z=j.z),j.z=e.x&&b.y<=d.y&&c.y>=e.y&&b.z<=d.z&&c.z>=e.z},d.prototype.getCorners=function(a,b,c,d,e,f,g,h){var i=this.lowerBound,j=this.upperBound;a.copy(i),b.set(j.x,i.y,i.z),c.set(j.x,j.y,i.z),d.set(i.x,j.y,j.z),e.set(j.x,i.y,i.z),f.set(i.x,j.y,i.z),g.set(i.x,i.y,j.z),h.copy(j)};var g=[new e,new e,new e,new e,new e,new e,new e,new e];d.prototype.toLocalFrame=function(a,b){var c=g,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=c[5],k=c[6],l=c[7];this.getCorners(d,e,f,h,i,j,k,l);for(var m=0;8!==m;m++){var n=c[m];a.pointToLocal(n,n)}return b.setFromPoints(c)},d.prototype.toWorldFrame=function(a,b){var c=g,d=c[0],e=c[1],f=c[2],h=c[3],i=c[4],j=c[5],k=c[6],l=c[7];this.getCorners(d,e,f,h,i,j,k,l);for(var m=0;8!==m;m++){var n=c[m];a.pointToWorld(n,n)}return b.setFromPoints(c)},d.prototype.overlapsRay=function(a){var b=1/a._direction.x,c=1/a._direction.y,d=1/a._direction.z,e=(this.lowerBound.x-a.from.x)*b,f=(this.upperBound.x-a.from.x)*b,g=(this.lowerBound.y-a.from.y)*c,h=(this.upperBound.y-a.from.y)*c,i=(this.lowerBound.z-a.from.z)*d,j=(this.upperBound.z-a.from.z)*d,k=Math.max(Math.max(Math.min(e,f),Math.min(g,h)),Math.min(i,j)),l=Math.min(Math.min(Math.max(e,f),Math.max(g,h)),Math.max(i,j));return!(l<0)&&!(k>l)}},{"../math/Vec3":31,"../utils/Utils":54}],4:[function(a,b,c){function d(){this.matrix=[]}b.exports=d,d.prototype.get=function(a,b){if(a=a.index,(b=b.index)>a){var c=b;b=a,a=c}return this.matrix[(a*(a+1)>>1)+b-1]},d.prototype.set=function(a,b,c){if(a=a.index,(b=b.index)>a){var d=b;b=a,a=d}this.matrix[(a*(a+1)>>1)+b-1]=c?1:0},d.prototype.reset=function(){for(var a=0,b=this.matrix.length;a!==b;a++)this.matrix[a]=0},d.prototype.setNumObjects=function(a){this.matrix.length=a*(a-1)>>1}},{}],5:[function(a,b,c){function d(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}var e=a("../objects/Body"),f=a("../math/Vec3"),g=a("../math/Quaternion");a("../shapes/Shape"),a("../shapes/Plane");b.exports=d,d.prototype.collisionPairs=function(a,b,c){throw new Error("collisionPairs not implemented for this BroadPhase class!")},d.prototype.needBroadphaseCollision=function(a,b){return 0!=(a.collisionFilterGroup&b.collisionFilterMask)&&0!=(b.collisionFilterGroup&a.collisionFilterMask)&&(0==(a.type&e.STATIC)&&a.sleepState!==e.SLEEPING||0==(b.type&e.STATIC)&&b.sleepState!==e.SLEEPING)},d.prototype.intersectionTest=function(a,b,c,d){this.useBoundingBoxes?this.doBoundingBoxBroadphase(a,b,c,d):this.doBoundingSphereBroadphase(a,b,c,d)};var h=new f;new f,new g,new f;d.prototype.doBoundingSphereBroadphase=function(a,b,c,d){var e=h;b.position.vsub(a.position,e);var f=Math.pow(a.boundingRadius+b.boundingRadius,2);e.norm2()c.norm2()},d.prototype.aabbQuery=function(a,b,c){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},{"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Plane":43,"../shapes/Shape":44}],6:[function(a,b,c){function d(a,b,c,d,g){e.apply(this),this.nx=c||10,this.ny=d||10,this.nz=g||10,this.aabbMin=a||new f(100,100,100),this.aabbMax=b||new f(-100,-100,-100);var h=this.nx*this.ny*this.nz;if(h<=0)throw"GridBroadphase: Each dimension's n must be >0";this.bins=[],this.binLengths=[],this.bins.length=h,this.binLengths.length=h;for(var i=0;i=k&&(h=k-1),i<0?i=0:i>=l&&(i=l-1),j<0?j=0:j>=m&&(j=m-1),q<0?q=0:q>=k&&(q=k-1),r<0?r=0:r>=l&&(r=l-1),s<0?s=0:s>=m&&(s=m-1),h*=n,i*=o,j*=p,q*=n,r*=o,s*=p;for(var z=h;z<=q;z+=n)for(var A=i;A<=r;A+=o)for(var B=j;B<=s;B+=p){var C=z+A+B;G[C][H[C]++]=g}}for(var e=a.numObjects(),f=a.bodies,i=this.aabbMax,j=this.aabbMin,k=this.nx,l=this.ny,m=this.nz,n=l*m,o=m,p=1,q=i.x,r=i.y,s=i.z,t=j.x,u=j.y,v=j.z,w=k/(q-t),x=l/(r-u),y=m/(s-v),z=(q-t)/k,A=(r-u)/l,B=(s-v)/m,C=.5*Math.sqrt(z*z+A*A+B*B),D=g.types,E=D.SPHERE,F=D.PLANE,G=(D.BOX,D.COMPOUND,D.CONVEXPOLYHEDRON,this.bins),H=this.binLengths,I=this.bins.length,J=0;J!==I;J++)H[J]=0;for(var K=Math.ceil,j=Math.min,i=Math.max,J=0;J!==e;J++){var L=f[J],M=L.shape;switch(M.type){case E:var N=L.position.x,O=L.position.y,P=L.position.z,Q=M.radius;d(N-Q,O-Q,P-Q,N+Q,O+Q,P+Q,L);break;case F:M.worldNormalNeedsUpdate&&M.computeWorldNormal(L.quaternion);var R=M.worldNormal,S=t+.5*z-L.position.x,T=u+.5*A-L.position.y,U=v+.5*B-L.position.z,V=h;V.set(S,T,U);for(var W=0,X=0;W!==k;W++,X+=n,V.y=T,V.x+=z)for(var Y=0,Z=0;Y!==l;Y++,Z+=o,V.z=U,V.y+=A)for(var $=0,_=0;$!==m;$++,_+=p,V.z+=B)if(V.dot(R)1)for(var ca=G[J],W=0;W!==ba;W++)for(var L=ca[W],Y=0;Y!==W;Y++){var da=ca[Y];this.needBroadphaseCollision(L,da)&&this.intersectionTest(L,da,b,c)}}this.makePairsUnique(b,c)}},{"../math/Vec3":31,"../shapes/Shape":44,"./Broadphase":5}],7:[function(a,b,c){function d(){e.apply(this)}b.exports=d;var e=a("./Broadphase"),f=a("./AABB");d.prototype=new e,d.prototype.constructor=d,d.prototype.collisionPairs=function(a,b,c){var d,e,f,g,h=a.bodies,i=h.length;for(d=0;d!==i;d++)for(e=0;e!==d;e++)f=h[d],g=h[e],this.needBroadphaseCollision(f,g)&&this.intersectionTest(f,g,b,c)};new f;d.prototype.aabbQuery=function(a,b,c){c=c||[];for(var d=0;da){var c=b;b=a,a=c}return a+"-"+b in this.matrix},d.prototype.set=function(a,b,c){if(a=a.id,(b=b.id)>a){var d=b;b=a,a=d}c?this.matrix[a+"-"+b]=!0:delete this.matrix[a+"-"+b]},d.prototype.reset=function(){this.matrix={}},d.prototype.setNumObjects=function(a){}},{}],9:[function(a,b,c){function d(){this.current=[],this.previous=[]}function e(a,b){a.push((4294901760&b)>>16,65535&b)}b.exports=d,d.prototype.getKey=function(a,b){if(bd[e];)e++;if(c!==d[e]){for(var b=d.length-1;b>=e;b--)d[b+1]=d[b];d[e]=c}},d.prototype.tick=function(){var a=this.current;this.current=this.previous,this.previous=a,this.current.length=0},d.prototype.getDiff=function(a,b){for(var c=this.current,d=this.previous,f=c.length,g=d.length,h=0,i=0;id[h];)h++;j=k===d[h],j||e(a,k)}h=0;for(var i=0;ic[h];)h++;j=c[h]===l,j||e(b,l)}}},{}],10:[function(a,b,c){function d(a,b){this.from=a?a.clone():new g,this.to=b?b.clone():new g,this._direction=new g,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=d.ANY,this.result=new j,this.hasHit=!1,this.callback=function(a){}}function e(a,b,c,d){d.vsub(b,M),c.vsub(b,o),a.vsub(b,p);var e,f,g=M.dot(M),h=M.dot(o),i=M.dot(p),j=o.dot(o),k=o.dot(p);return(e=j*i-h*k)>=0&&(f=g*k-h*i)>=0&&e+fa.boundingSphereRadius)){var e=this[a.type];e&&e.call(this,a,b,c,d,a)}};var s=(new g,new g,new g),t=new g,u=new g,v=new g;new g,new j;d.prototype.intersectBox=function(a,b,c,d,e){return this.intersectConvex(a.convexPolyhedronRepresentation,b,c,d,e)},d.prototype[k.types.BOX]=d.prototype.intersectBox,d.prototype.intersectPlane=function(a,b,c,d,e){var f=this.from,h=this.to,i=this._direction,j=new g(0,0,1);b.vmult(j,j);var k=new g;f.vsub(c,k);var l=k.dot(j);if(h.vsub(c,k),!(l*k.dot(j)>0||f.distanceTo(h)=0&&o<=1&&(f.lerp(g,o,m),m.vsub(c,n),n.normalize(),this.reportIntersection(n,m,e,d,-1)),this.result._shouldStop)return;p>=0&&p<=1&&(f.lerp(g,p,m),m.vsub(c,n),n.normalize(),this.reportIntersection(n,m,e,d,-1))}},d.prototype[k.types.SPHERE]=d.prototype.intersectSphere;var C=new g,D=(new g,new g,new g);d.prototype.intersectConvex=function(a,b,c,d,f,g){for(var h=C,i=D,j=g&&g.faceList||null,k=a.faces,l=a.vertices,m=a.faceNormals,n=this._direction,o=this.from,p=this.to,q=o.distanceTo(p),r=j?j.length:k.length,w=this.result,x=0;!w._shouldStop&&xq||this.reportIntersection(h,s,f,d,y)}}}}},d.prototype[k.types.CONVEXPOLYHEDRON]=d.prototype.intersectConvex;var E=new g,F=new g,G=new g,H=new g,I=new g,J=new g,K=(new l,[]),L=new i;d.prototype.intersectTrimesh=function(a,b,c,d,f,g){var h=E,j=K,k=L,l=D,m=F,n=G,o=H,p=J,q=I,r=(g&&g.faceList,a.indices),w=(a.vertices,a.faceNormals,this.from),x=this.to,y=this._direction;k.position.copy(c),k.quaternion.copy(b),i.vectorToLocalFrame(c,b,y,m),i.pointToLocalFrame(c,b,w,n),i.pointToLocalFrame(c,b,x,o),o.x*=a.scale.x,o.y*=a.scale.y,o.z*=a.scale.z,n.x*=a.scale.x,n.y*=a.scale.y,n.z*=a.scale.z,o.vsub(n,m),m.normalize();var z=n.distanceSquared(o);a.tree.rayQuery(this,k,j);for(var A=0,B=j.length;!this.result._shouldStop&&A!==B;A++){var C=j[A];a.getNormal(C,h),a.getVertex(r[3*C],t),t.vsub(n,l);var M=m.dot(h),N=h.dot(l)/M;if(!(N<0)){m.scale(N,s),s.vadd(n,s),a.getVertex(r[3*C+1],u),a.getVertex(r[3*C+2],v);var O=s.distanceSquared(n);!e(s,u,t,v)&&!e(s,t,u,v)||O>z||(i.vectorToWorldFrame(b,h,q),i.pointToWorldFrame(c,b,s,p),this.reportIntersection(q,p,f,d,C))}}j.length=0},d.prototype[k.types.TRIMESH]=d.prototype.intersectTrimesh,d.prototype.reportIntersection=function(a,b,c,e,f){var g=this.from,h=this.to,i=g.distanceTo(b),j=this.result;if(!(this.skipBackfaces&&a.dot(this._direction)>0))switch(j.hitFaceIndex=void 0!==f?f:-1,this.mode){case d.ALL:this.hasHit=!0,j.set(g,h,a,b,c,e,i),j.hasHit=!0,this.callback(j);break;case d.CLOSEST:(i=0&&!(a[e].aabb.lowerBound.x<=d.aabb.lowerBound.x);e--)a[e+1]=a[e];a[e+1]=d}return a},d.insertionSortY=function(a){for(var b=1,c=a.length;b=0&&!(a[e].aabb.lowerBound.y<=d.aabb.lowerBound.y);e--)a[e+1]=a[e];a[e+1]=d}return a},d.insertionSortZ=function(a){for(var b=1,c=a.length;b=0&&!(a[e].aabb.lowerBound.z<=d.aabb.lowerBound.z);e--)a[e+1]=a[e];a[e+1]=d}return a},d.prototype.collisionPairs=function(a,b,c){var e,f,g=this.axisList,h=g.length,i=this.axisIndex;for(this.dirty&&(this.sortList(),this.dirty=!1),e=0;e!==h;e++){var j=g[e];for(f=e+1;fp?o>q?0:2:p>q?1:2},d.prototype.aabbQuery=function(a,b,c){c=c||[],this.dirty&&(this.sortList(),this.dirty=!1);var d=this.axisIndex,e="x";1===d&&(e="y"),2===d&&(e="z");for(var f=this.axisList,g=(b.lowerBound[e],b.upperBound[e],0);g.499&&(c=2*Math.atan2(f,i),d=Math.PI/2,e=0),j<-.499&&(c=-2*Math.atan2(f,i),d=-Math.PI/2,e=0),isNaN(c)){var k=f*f,l=g*g,m=h*h;c=Math.atan2(2*g*i-2*f*h,1-2*l-2*m),d=Math.asin(2*j),e=Math.atan2(2*f*i-2*g*h,1-2*k-2*m)}break;default:throw new Error("Euler order "+b+" not supported yet.")}a.y=c,a.z=d,a.x=e},d.prototype.setFromEuler=function(a,b,c,d){d=d||"XYZ";var e=Math.cos(a/2),f=Math.cos(b/2),g=Math.cos(c/2),h=Math.sin(a/2),i=Math.sin(b/2),j=Math.sin(c/2);return"XYZ"===d?(this.x=h*f*g+e*i*j,this.y=e*i*g-h*f*j,this.z=e*f*j+h*i*g,this.w=e*f*g-h*i*j):"YXZ"===d?(this.x=h*f*g+e*i*j,this.y=e*i*g-h*f*j,this.z=e*f*j-h*i*g,this.w=e*f*g+h*i*j):"ZXY"===d?(this.x=h*f*g-e*i*j,this.y=e*i*g+h*f*j,this.z=e*f*j+h*i*g,this.w=e*f*g-h*i*j):"ZYX"===d?(this.x=h*f*g-e*i*j,this.y=e*i*g+h*f*j,this.z=e*f*j-h*i*g,this.w=e*f*g+h*i*j):"YZX"===d?(this.x=h*f*g+e*i*j,this.y=e*i*g+h*f*j,this.z=e*f*j-h*i*g,this.w=e*f*g-h*i*j):"XZY"===d&&(this.x=h*f*g-e*i*j,this.y=e*i*g-h*f*j,this.z=e*f*j+h*i*g,this.w=e*f*g+h*i*j),this},d.prototype.clone=function(){return new d(this.x,this.y,this.z,this.w)},d.prototype.slerp=function(a,b,c){c=c||new d;var e,f,g,h,i,j=this.x,k=this.y,l=this.z,m=this.w,n=a.x,o=a.y,p=a.z,q=a.w;return f=j*n+k*o+l*p+m*q,f<0&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-b)*e)/g,i=Math.sin(b*e)/g):(h=1-b,i=b),c.x=h*j+i*n,c.y=h*k+i*o,c.z=h*l+i*p,c.w=h*m+i*q,c},d.prototype.integrate=function(a,b,c,e){e=e||new d;var f=a.x*c.x,g=a.y*c.y,h=a.z*c.z,i=this.x,j=this.y,k=this.z,l=this.w,m=.5*b;return e.x+=m*(f*l+g*k-h*j),e.y+=m*(g*l+h*i-f*k),e.z+=m*(h*l+f*j-g*i),e.w+=m*(-f*i-g*j-h*k),e}},{"./Vec3":31}],30:[function(a,b,c){function d(a){a=a||{},this.position=new e,a.position&&this.position.copy(a.position),this.quaternion=new f,a.quaternion&&this.quaternion.copy(a.quaternion)}var e=a("./Vec3"),f=a("./Quaternion");b.exports=d;var g=new f;d.pointToLocalFrame=function(a,b,c,d){var d=d||new e;return c.vsub(a,d),b.conjugate(g),g.vmult(d,d),d},d.prototype.pointToLocal=function(a,b){return d.pointToLocalFrame(this.position,this.quaternion,a,b)},d.pointToWorldFrame=function(a,b,c,d){var d=d||new e;return b.vmult(c,d),d.vadd(a,d),d},d.prototype.pointToWorld=function(a,b){return d.pointToWorldFrame(this.position,this.quaternion,a,b)},d.prototype.vectorToWorldFrame=function(a,b){var b=b||new e;return this.quaternion.vmult(a,b),b},d.vectorToWorldFrame=function(a,b,c){return a.vmult(b,c),c},d.vectorToLocalFrame=function(a,b,c,d){var d=d||new e;return b.w*=-1,b.vmult(c,d),b.w*=-1,d}},{"./Quaternion":29,"./Vec3":31}],31:[function(a,b,c){function d(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0}b.exports=d;var e=a("./Mat3");d.ZERO=new d(0,0,0),d.UNIT_X=new d(1,0,0),d.UNIT_Y=new d(0,1,0),d.UNIT_Z=new d(0,0,1),d.prototype.cross=function(a,b){var c=a.x,e=a.y,f=a.z,g=this.x,h=this.y,i=this.z;return b=b||new d,b.x=h*f-i*e,b.y=i*c-g*f,b.z=g*e-h*c,b},d.prototype.set=function(a,b,c){return this.x=a,this.y=b,this.z=c,this},d.prototype.setZero=function(){this.x=this.y=this.z=0},d.prototype.vadd=function(a,b){if(!b)return new d(this.x+a.x,this.y+a.y,this.z+a.z);b.x=a.x+this.x,b.y=a.y+this.y,b.z=a.z+this.z},d.prototype.vsub=function(a,b){if(!b)return new d(this.x-a.x,this.y-a.y,this.z-a.z);b.x=this.x-a.x,b.y=this.y-a.y,b.z=this.z-a.z},d.prototype.crossmat=function(){return new e([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])},d.prototype.normalize=function(){var a=this.x,b=this.y,c=this.z,d=Math.sqrt(a*a+b*b+c*c);if(d>0){var e=1/d;this.x*=e,this.y*=e,this.z*=e}else this.x=0,this.y=0,this.z=0;return d},d.prototype.unit=function(a){a=a||new d;var b=this.x,c=this.y,e=this.z,f=Math.sqrt(b*b+c*c+e*e);return f>0?(f=1/f,a.x=b*f,a.y=c*f,a.z=e*f):(a.x=1,a.y=0,a.z=0),a},d.prototype.norm=function(){var a=this.x,b=this.y,c=this.z;return Math.sqrt(a*a+b*b+c*c)},d.prototype.length=d.prototype.norm,d.prototype.norm2=function(){return this.dot(this)},d.prototype.lengthSquared=d.prototype.norm2,d.prototype.distanceTo=function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;return Math.sqrt((e-b)*(e-b)+(f-c)*(f-c)+(g-d)*(g-d))},d.prototype.distanceSquared=function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;return(e-b)*(e-b)+(f-c)*(f-c)+(g-d)*(g-d)},d.prototype.mult=function(a,b){b=b||new d;var c=this.x,e=this.y,f=this.z;return b.x=a*c,b.y=a*e,b.z=a*f,b},d.prototype.vmul=function(a,b){return b=b||new d,b.x=a.x*this.x,b.y=a.y*this.y,b.z=a.z*this.z,b},d.prototype.scale=d.prototype.mult,d.prototype.addScaledVector=function(a,b,c){return c=c||new d,c.x=this.x+a*b.x,c.y=this.y+a*b.y,c.z=this.z+a*b.z,c},d.prototype.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z},d.prototype.isZero=function(){return 0===this.x&&0===this.y&&0===this.z},d.prototype.negate=function(a){return a=a||new d,a.x=-this.x,a.y=-this.y,a.z=-this.z,a};var f=new d,g=new d;d.prototype.tangents=function(a,b){var c=this.norm();if(c>0){var d=f,e=1/c;d.set(this.x*e,this.y*e,this.z*e);var h=g;Math.abs(d.x)<.9?(h.set(1,0,0),d.cross(h,a)):(h.set(0,1,0),d.cross(h,a)),d.cross(a,b)}else a.set(1,0,0),b.set(0,1,0)},d.prototype.toString=function(){return this.x+","+this.y+","+this.z},d.prototype.toArray=function(){return[this.x,this.y,this.z]},d.prototype.copy=function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this},d.prototype.lerp=function(a,b,c){var d=this.x,e=this.y,f=this.z;c.x=d+(a.x-d)*b,c.y=e+(a.y-e)*b,c.z=f+(a.z-f)*b},d.prototype.almostEquals=function(a,b){return void 0===b&&(b=1e-6),!(Math.abs(this.x-a.x)>b||Math.abs(this.y-a.y)>b||Math.abs(this.z-a.z)>b)},d.prototype.almostZero=function(a){return void 0===a&&(a=1e-6),!(Math.abs(this.x)>a||Math.abs(this.y)>a||Math.abs(this.z)>a)};var h=new d;d.prototype.isAntiparallelTo=function(a,b){return this.negate(h),h.almostEquals(a,b)},d.prototype.clone=function(){return new d(this.x,this.y,this.z)}},{"./Mat3":28}],32:[function(a,b,c){function d(a){a=a||{},e.apply(this),this.id=d.idCounter++,this.world=null,this.preStep=null,this.postStep=null,this.vlambda=new f,this.collisionFilterGroup="number"==typeof a.collisionFilterGroup?a.collisionFilterGroup:1,this.collisionFilterMask="number"==typeof a.collisionFilterMask?a.collisionFilterMask:-1,this.collisionResponse=!0,this.position=new f,this.previousPosition=new f,this.interpolatedPosition=new f,this.initPosition=new f,a.position&&(this.position.copy(a.position),this.previousPosition.copy(a.position),this.interpolatedPosition.copy(a.position),this.initPosition.copy(a.position)),this.velocity=new f,a.velocity&&this.velocity.copy(a.velocity),this.initVelocity=new f,this.force=new f;var b="number"==typeof a.mass?a.mass:0;this.mass=b,this.invMass=b>0?1/b:0,this.material=a.material||null,this.linearDamping="number"==typeof a.linearDamping?a.linearDamping:.01,this.type=b<=0?d.STATIC:d.DYNAMIC,typeof a.type==typeof d.STATIC&&(this.type=a.type),this.allowSleep=void 0===a.allowSleep||a.allowSleep,this.sleepState=0,this.sleepSpeedLimit=void 0!==a.sleepSpeedLimit?a.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==a.sleepTimeLimit?a.sleepTimeLimit:1,this.timeLastSleepy=0,this._wakeUpAfterNarrowphase=!1,this.torque=new f,this.quaternion=new h,this.initQuaternion=new h,this.previousQuaternion=new h,this.interpolatedQuaternion=new h,a.quaternion&&(this.quaternion.copy(a.quaternion),this.initQuaternion.copy(a.quaternion),this.previousQuaternion.copy(a.quaternion),this.interpolatedQuaternion.copy(a.quaternion)),this.angularVelocity=new f,a.angularVelocity&&this.angularVelocity.copy(a.angularVelocity),this.initAngularVelocity=new f,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new f,this.invInertia=new f,this.invInertiaWorld=new g,this.invMassSolve=0,this.invInertiaSolve=new f,this.invInertiaWorldSolve=new g,this.fixedRotation=void 0!==a.fixedRotation&&a.fixedRotation,this.angularDamping=void 0!==a.angularDamping?a.angularDamping:.01,this.linearFactor=new f(1,1,1),a.linearFactor&&this.linearFactor.copy(a.linearFactor),this.angularFactor=new f(1,1,1),a.angularFactor&&this.angularFactor.copy(a.angularFactor),this.aabb=new i,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.sensor=!1,a.sensor&&(this.sensor=a.sensor),this.wlambda=new f,a.shape&&this.addShape(a.shape),this.updateMassProperties()}b.exports=d;var e=a("../utils/EventTarget"),f=(a("../shapes/Shape"),a("../math/Vec3")),g=a("../math/Mat3"),h=a("../math/Quaternion"),i=(a("../material/Material"),a("../collision/AABB")),j=a("../shapes/Box");d.prototype=new e,d.prototype.constructor=d,d.COLLIDE_EVENT_NAME="collide",d.DYNAMIC=1,d.STATIC=2,d.KINEMATIC=4,d.AWAKE=0,d.SLEEPY=1,d.SLEEPING=2,d.idCounter=0,d.wakeupEvent={type:"wakeup"},d.prototype.wakeUp=function(){var a=this.sleepState;this.sleepState=0,this._wakeUpAfterNarrowphase=!1,a===d.SLEEPING&&this.dispatchEvent(d.wakeupEvent)},d.prototype.sleep=function(){this.sleepState=d.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this._wakeUpAfterNarrowphase=!1},d.sleepyEvent={type:"sleepy"},d.sleepEvent={type:"sleep"},d.prototype.sleepTick=function(a){if(this.allowSleep){var b=this.sleepState,c=this.velocity.norm2()+this.angularVelocity.norm2(),e=Math.pow(this.sleepSpeedLimit,2);b===d.AWAKE&&ce?this.wakeUp():b===d.SLEEPY&&a-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(d.sleepEvent))}},d.prototype.updateSolveMassProperties=function(){this.sleepState===d.SLEEPING||this.type===d.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))},d.prototype.pointToLocalFrame=function(a,b){var b=b||new f;return a.vsub(this.position,b),this.quaternion.conjugate().vmult(b,b),b},d.prototype.vectorToLocalFrame=function(a,b){var b=b||new f;return this.quaternion.conjugate().vmult(a,b),b},d.prototype.pointToWorldFrame=function(a,b){var b=b||new f;return this.quaternion.vmult(a,b),b.vadd(this.position,b),b},d.prototype.vectorToWorldFrame=function(a,b){var b=b||new f;return this.quaternion.vmult(a,b),b};var k=new f,l=new h;d.prototype.addShape=function(a,b,c){var d=new f,e=new h;return b&&d.copy(b),c&&e.copy(c),this.shapes.push(a),this.shapeOffsets.push(d),this.shapeOrientations.push(e),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,a.body=this,this},d.prototype.updateBoundingRadius=function(){for(var a=this.shapes,b=this.shapeOffsets,c=a.length,d=0,e=0;e!==c;e++){var f=a[e];f.updateBoundingSphereRadius();var g=b[e].norm(),h=f.boundingSphereRadius;g+h>d&&(d=g+h)}this.boundingRadius=d};var m=new i;d.prototype.computeAABB=function(){for(var a=this.shapes,b=this.shapeOffsets,c=this.shapeOrientations,d=a.length,e=k,f=l,g=this.quaternion,h=this.aabb,i=m,j=0;j!==d;j++){var n=a[j];g.vmult(b[j],e),e.vadd(this.position,e),c[j].mult(g,f),n.calculateWorldAABB(e,f,i.lowerBound,i.upperBound),0===j?h.copy(i):h.extend(i)}this.aabbNeedsUpdate=!1};var n=new g,o=new g;new g;d.prototype.updateInertiaWorld=function(a){var b=this.invInertia;if(b.x!==b.y||b.y!==b.z||a){var c=n,d=o;c.setRotationFromQuaternion(this.quaternion),c.transpose(d),c.scale(b,c),c.mmult(d,this.invInertiaWorld)}else;};var p=(new f,new f);d.prototype.applyForce=function(a,b){if(this.type===d.DYNAMIC){var c=p;b.cross(a,c),this.force.vadd(a,this.force),this.torque.vadd(c,this.torque)}};var q=new f,r=new f;d.prototype.applyLocalForce=function(a,b){if(this.type===d.DYNAMIC){var c=q,e=r;this.vectorToWorldFrame(a,c),this.vectorToWorldFrame(b,e),this.applyForce(c,e)}};var s=(new f,new f),t=new f;d.prototype.applyImpulse=function(a,b){if(this.type===d.DYNAMIC){var c=b,e=s;e.copy(a),e.mult(this.invMass,e),this.velocity.vadd(e,this.velocity);var f=t;c.cross(a,f),this.invInertiaWorld.vmult(f,f),this.angularVelocity.vadd(f,this.angularVelocity)}};var u=new f,v=new f;d.prototype.applyLocalImpulse=function(a,b){if(this.type===d.DYNAMIC){var c=u,e=v;this.vectorToWorldFrame(a,c),this.vectorToWorldFrame(b,e),this.applyImpulse(c,e)}};var w=new f;d.prototype.updateMassProperties=function(){var a=w;this.invMass=this.mass>0?1/this.mass:0;var b=this.inertia,c=this.fixedRotation;this.computeAABB(),a.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),j.calculateInertia(a,this.mass,b),this.invInertia.set(b.x>0&&!c?1/b.x:0,b.y>0&&!c?1/b.y:0,b.z>0&&!c?1/b.z:0),this.updateInertiaWorld(!0)},d.prototype.getVelocityAtWorldPoint=function(a,b){var c=new f;return a.vsub(this.position,c),this.angularVelocity.cross(c,b),this.velocity.vadd(b,b),b};new f,new f,new h,new h;d.prototype.integrate=function(a,b,c){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),(this.type===d.DYNAMIC||this.type===d.KINEMATIC)&&this.sleepState!==d.SLEEPING){var e=this.velocity,f=this.angularVelocity,g=this.position,h=this.force,i=this.torque,j=this.quaternion,k=this.invMass,l=this.invInertiaWorld,m=this.linearFactor,n=k*a;e.x+=h.x*n*m.x,e.y+=h.y*n*m.y,e.z+=h.z*n*m.z;var o=l.elements,p=this.angularFactor,q=i.x*p.x,r=i.y*p.y,s=i.z*p.z;f.x+=a*(o[0]*q+o[1]*r+o[2]*s),f.y+=a*(o[3]*q+o[4]*r+o[5]*s),f.z+=a*(o[6]*q+o[7]*r+o[8]*s),g.x+=e.x*a,g.y+=e.y*a,g.z+=e.z*a,j.integrate(this.angularVelocity,a,this.angularFactor,j),b&&(c?j.normalizeFast():j.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}},{"../collision/AABB":3,"../material/Material":26,"../math/Mat3":28,"../math/Quaternion":29,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Shape":44,"../utils/EventTarget":50}],33:[function(a,b,c){function d(a){this.chassisBody=a.chassisBody,this.wheelInfos=[],this.sliding=!1,this.world=null,this.indexRightAxis=void 0!==a.indexRightAxis?a.indexRightAxis:1,this.indexForwardAxis=void 0!==a.indexForwardAxis?a.indexForwardAxis:0,this.indexUpAxis=void 0!==a.indexUpAxis?a.indexUpAxis:2}function e(a,b,c,d,e){var g=0,h=c,i=u,j=v,k=w;return a.getVelocityAtWorldPoint(h,i),b.getVelocityAtWorldPoint(h,j),i.vsub(j,k),g=-d.dot(k)*(1/(f(a,c,d)+f(b,c,d))),e1.1)return 0;var g=B,h=C,i=D;return a.getVelocityAtWorldPoint(b,g),c.getVelocityAtWorldPoint(d,h),g.vsub(h,i),-.2*e.dot(i)*(1/(a.invMass+c.invMass))}var h=(a("./Body"),a("../math/Vec3")),i=a("../math/Quaternion"),j=(a("../collision/RaycastResult"),a("../collision/Ray")),k=a("../objects/WheelInfo");b.exports=d;var l=(new h,new h,new h,new h),m=new h,n=new h;new j;d.prototype.addWheel=function(a){a=a||{};var b=new k(a),c=this.wheelInfos.length;return this.wheelInfos.push(b),c},d.prototype.setSteeringValue=function(a,b){this.wheelInfos[b].steering=a};new h;d.prototype.applyEngineForce=function(a,b){this.wheelInfos[b].engineForce=a},d.prototype.setBrake=function(a,b){this.wheelInfos[b].brake=a},d.prototype.addToWorld=function(a){this.constraints;a.addBody(this.chassisBody);var b=this;this.preStepCallback=function(){b.updateVehicle(a.dt)},a.addEventListener("preStep",this.preStepCallback),this.world=a},d.prototype.getVehicleAxisWorld=function(a,b){b.set(0===a?1:0,1===a?1:0,2===a?1:0),this.chassisBody.vectorToWorldFrame(b,b)},d.prototype.updateVehicle=function(a){for(var b=this.wheelInfos,c=b.length,d=this.chassisBody,e=0;ej.maxSuspensionForce&&(k=j.maxSuspensionForce),j.raycastResult.hitNormalWorld.scale(k*a,g),j.raycastResult.hitPointWorld.vsub(d.position,i),d.applyImpulse(g,i)}this.updateFriction(a);var l=new h,m=new h,n=new h;for(e=0;e0?1:-1)*j.customSlidingRotationalSpeed*a),Math.abs(j.brake)>Math.abs(j.engineForce)&&(j.deltaRotation=0),j.rotation+=j.deltaRotation,j.deltaRotation*=.99}},d.prototype.updateSuspension=function(a){for(var b=this.chassisBody,c=b.mass,d=this.wheelInfos,e=d.length,f=0;fn&&(a.suspensionLength=n,a.raycastResult.reset());var q=a.raycastResult.hitNormalWorld.dot(a.directionWorld),r=new h;d.getVelocityAtWorldPoint(a.raycastResult.hitPointWorld,r);var s=a.raycastResult.hitNormalWorld.dot(r);if(q>=-.1)a.suspensionRelativeVelocity=0,a.clippedInvContactDotSuspension=10;else{var t=-1/q;a.suspensionRelativeVelocity=s*t,a.clippedInvContactDotSuspension=t}}else a.suspensionLength=a.suspensionRestLength+0*a.maxSuspensionTravel,a.suspensionRelativeVelocity=0,a.directionWorld.scale(-1,a.raycastResult.hitNormalWorld),a.clippedInvContactDotSuspension=1;return e},d.prototype.updateWheelTransformWorld=function(a){a.isInContact=!1;var b=this.chassisBody;b.pointToWorldFrame(a.chassisConnectionPointLocal,a.chassisConnectionPointWorld),b.vectorToWorldFrame(a.directionLocal,a.directionWorld),b.vectorToWorldFrame(a.axleLocal,a.axleWorld)},d.prototype.updateWheelTransform=function(a){var b=l,c=m,d=n,e=this.wheelInfos[a];this.updateWheelTransformWorld(e),e.directionLocal.scale(-1,b),c.copy(e.axleLocal),b.cross(c,d),d.normalize(),c.normalize();var f=e.steering,g=new i;g.setFromAxisAngle(b,f);var h=new i;h.setFromAxisAngle(c,e.rotation);var j=e.worldTransform.quaternion;this.chassisBody.quaternion.mult(g,j),j.mult(h,j),j.normalize();var k=e.worldTransform.position;k.copy(e.directionWorld),k.scale(e.suspensionLength,k),k.vadd(e.chassisConnectionPointWorld,k)};var q=[new h(1,0,0),new h(0,1,0),new h(0,0,1)];d.prototype.getWheelTransformWorld=function(a){return this.wheelInfos[a].worldTransform};var r=new h,s=[],t=[];d.prototype.updateFriction=function(a){for(var b=r,c=this.wheelInfos,d=c.length,f=this.chassisBody,i=t,j=s,k=0,l=0;lD){this.sliding=!0,m.sliding=!0;var A=B/Math.sqrt(G);m.skidInfo*=A}}}if(this.sliding)for(var l=0;lthis.particles.length&&this.neighbors.pop())};var f=new e;d.prototype.getNeighbors=function(a,b){for(var c=this.particles.length,d=a.id,e=this.smoothingRadius*this.smoothingRadius,g=f,h=0;h!==c;h++){var i=this.particles[h];i.position.vsub(a.position,g),d!==i.id&&g.norm2()=-.1)this.suspensionRelativeVelocity=0,this.clippedInvContactDotSuspension=10;else{var e=-1/c;this.suspensionRelativeVelocity=d*e,this.clippedInvContactDotSuspension=e}}else b.suspensionLength=this.suspensionRestLength,this.suspensionRelativeVelocity=0,b.directionWorld.scale(-1,b.hitNormalWorld),this.clippedInvContactDotSuspension=1}},{"../collision/RaycastResult":11,"../math/Transform":30,"../math/Vec3":31,"../utils/Utils":54}],38:[function(a,b,c){function d(a){e.call(this,{type:e.types.BOX}),this.halfExtents=a,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}b.exports=d;var e=a("./Shape"),f=a("../math/Vec3"),g=a("./ConvexPolyhedron");d.prototype=new e,d.prototype.constructor=d,d.prototype.updateConvexPolyhedronRepresentation=function(){var a=this.halfExtents.x,b=this.halfExtents.y,c=this.halfExtents.z,d=f,e=[new d(-a,-b,-c),new d(a,-b,-c),new d(a,b,-c),new d(-a,b,-c),new d(-a,-b,c),new d(a,-b,c),new d(a,b,c),new d(-a,b,c)],h=[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],i=(new d(0,0,1),new d(0,1,0),new d(1,0,0),new g(e,h));this.convexPolyhedronRepresentation=i,i.material=this.material},d.prototype.calculateLocalInertia=function(a,b){return b=b||new f,d.calculateInertia(this.halfExtents,a,b),b},d.calculateInertia=function(a,b,c){var d=a;c.x=1/12*b*(2*d.y*2*d.y+2*d.z*2*d.z),c.y=1/12*b*(2*d.x*2*d.x+2*d.z*2*d.z),c.z=1/12*b*(2*d.y*2*d.y+2*d.x*2*d.x)},d.prototype.getSideNormals=function(a,b){var c=a,d=this.halfExtents;if(c[0].set(d.x,0,0),c[1].set(0,d.y,0),c[2].set(0,0,d.z),c[3].set(-d.x,0,0),c[4].set(0,-d.y,0),c[5].set(0,0,-d.z),void 0!==b)for(var e=0;e!==c.length;e++)b.vmult(c[e],c[e]);return c},d.prototype.volume=function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z},d.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.halfExtents.norm()};var h=new f;new f;d.prototype.forEachWorldCorner=function(a,b,c){for(var d=this.halfExtents,e=[[d.x,d.y,d.z],[-d.x,d.y,d.z],[-d.x,-d.y,d.z],[-d.x,-d.y,-d.z],[d.x,-d.y,-d.z],[d.x,d.y,-d.z],[-d.x,d.y,-d.z],[d.x,-d.y,d.z]],f=0;fd.x&&(d.x=h),j>d.y&&(d.y=j),k>d.z&&(d.z=k),hn&&(n=p,m=o)}for(var q=[],r=c.faces[m],s=r.length,t=0;t=0&&this.clipFaceAgainstHull(g,a,b,q,h,i,j)};var l=new f,m=new f,n=new f,o=new f,p=new f,q=new f;d.prototype.findSeparatingAxis=function(a,b,c,d,e,f,g,h){var i=l,j=m,k=n,r=o,s=p,t=q,u=Number.MAX_VALUE,v=this,w=0;if(v.uniqueAxes)for(var x=0;x!==v.uniqueAxes.length;x++){c.vmult(v.uniqueAxes[x],i);var y=v.testSepAxis(i,a,b,c,d,e);if(!1===y)return!1;y0&&f.negate(f),!0};var r=[],s=[];d.prototype.testSepAxis=function(a,b,c,e,f,g){var h=this;d.project(h,a,c,e,r),d.project(b,a,f,g,s);var i=r[0],j=r[1],k=s[0],l=s[1];if(ib&&(b=e)}this.maxValue=b},d.prototype.setHeightValueAtIndex=function(a,b,c){this.data[a][b]=c,this.clearCachedConvexTrianglePillar(a,b,!1),a>0&&(this.clearCachedConvexTrianglePillar(a-1,b,!0),this.clearCachedConvexTrianglePillar(a-1,b,!1)),b>0&&(this.clearCachedConvexTrianglePillar(a,b-1,!0),this.clearCachedConvexTrianglePillar(a,b-1,!1)),b>0&&a>0&&this.clearCachedConvexTrianglePillar(a-1,b-1,!0)},d.prototype.getRectMinMax=function(a,b,c,d,e){e=e||[];for(var f=this.data,g=this.minValue,h=a;h<=c;h++)for(var i=b;i<=d;i++){var j=f[h][i];j>g&&(g=j)}e[0]=this.minValue,e[1]=g},d.prototype.getIndexOfPosition=function(a,b,c,d){var e=this.elementSize,f=this.data,g=Math.floor(a/e),h=Math.floor(b/e);return c[0]=g,c[1]=h,d&&(g<0&&(g=0),h<0&&(h=0),g>=f.length-1&&(g=f.length-1),h>=f[0].length-1&&(h=f[0].length-1)),!(g<0||h<0||g>=f.length-1||h>=f[0].length-1)};var j=[],k=new h,l=new h,m=new h,n=new h;d.prototype.getTriangleAt=function(a,b,c,d,e,f){var g=j;this.getIndexOfPosition(a,b,g,c);var h=g[0],i=g[1],k=this.data;c&&(h=Math.min(k.length-2,Math.max(0,h)),i=Math.min(k[0].length-2,Math.max(0,i)));var l=this.elementSize,m=Math.pow(a/l-h,2)+Math.pow(b/l-i,2),n=Math.pow(a/l-(h+1),2)+Math.pow(b/l-(i+1),2),o=m>n;return this.getTriangle(h,i,o,d,e,f),o};var o=new h,p=new h,q=new h,r=new h,s=new h;d.prototype.getNormalAt=function(a,b,c,d){var e=o,f=p,g=q,h=r,i=s;this.getTriangleAt(a,b,c,e,f,g),f.vsub(e,h),g.vsub(e,i),h.cross(i,d),d.normalize()},d.prototype.getAabbAtIndex=function(a,b,c){var d=this.data,e=this.elementSize;c.lowerBound.set(a*e,b*e,d[a][b]),c.upperBound.set((a+1)*e,(b+1)*e,d[a+1][b+1])},d.prototype.getHeightAt=function(a,b,c){var d=this.data,f=l,g=m,h=n,i=j;this.getIndexOfPosition(a,b,i,c);var o=i[0],p=i[1];c&&(o=Math.min(d.length-2,Math.max(0,o)),p=Math.min(d[0].length-2,Math.max(0,p)));var q=this.getTriangleAt(a,b,c,f,g,h);e(a,b,f.x,f.y,g.x,g.y,h.x,h.y,k);var r=k;return q?d[o+1][p+1]*r.x+d[o][p+1]*r.y+d[o+1][p]*r.z:d[o][p]*r.x+d[o+1][p]*r.y+d[o][p+1]*r.z},d.prototype.getCacheConvexTrianglePillarKey=function(a,b,c){return a+"_"+b+"_"+(c?1:0)},d.prototype.getCachedConvexTrianglePillar=function(a,b,c){return this._cachedPillars[this.getCacheConvexTrianglePillarKey(a,b,c)]},d.prototype.setCachedConvexTrianglePillar=function(a,b,c,d,e){this._cachedPillars[this.getCacheConvexTrianglePillarKey(a,b,c)]={convex:d,offset:e}},d.prototype.clearCachedConvexTrianglePillar=function(a,b,c){delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(a,b,c)]},d.prototype.getTriangle=function(a,b,c,d,e,f){var g=this.data,h=this.elementSize;c?(d.set((a+1)*h,(b+1)*h,g[a+1][b+1]),e.set(a*h,(b+1)*h,g[a][b+1]),f.set((a+1)*h,b*h,g[a+1][b])):(d.set(a*h,b*h,g[a][b]),e.set((a+1)*h,b*h,g[a+1][b]),f.set(a*h,(b+1)*h,g[a][b+1]))},d.prototype.getConvexTrianglePillar=function(a,b,c){var d=this.pillarConvex,e=this.pillarOffset;if(this.cacheEnabled){var f=this.getCachedConvexTrianglePillar(a,b,c);if(f)return this.pillarConvex=f.convex,void(this.pillarOffset=f.offset);d=new g,e=new h,this.pillarConvex=d,this.pillarOffset=e}var f=this.data,i=this.elementSize,j=d.faces;d.vertices.length=6;for(var k=0;k<6;k++)d.vertices[k]||(d.vertices[k]=new h);j.length=5;for(var k=0;k<5;k++)j[k]||(j[k]=[]);var l=d.vertices,m=(Math.min(f[a][b],f[a+1][b],f[a][b+1],f[a+1][b+1])-this.minValue)/2+this.minValue;c?(e.set((a+.75)*i,(b+.75)*i,m),l[0].set(.25*i,.25*i,f[a+1][b+1]-m),l[1].set(-.75*i,.25*i,f[a][b+1]-m),l[2].set(.25*i,-.75*i,f[a+1][b]-m),l[3].set(.25*i,.25*i,-m-1),l[4].set(-.75*i,.25*i,-m-1),l[5].set(.25*i,-.75*i,-m-1),j[0][0]=0,j[0][1]=1,j[0][2]=2,j[1][0]=5,j[1][1]=4,j[1][2]=3,j[2][0]=2,j[2][1]=5,j[2][2]=3,j[2][3]=0,j[3][0]=3,j[3][1]=4,j[3][2]=1,j[3][3]=0,j[4][0]=1,j[4][1]=4,j[4][2]=5,j[4][3]=2):(e.set((a+.25)*i,(b+.25)*i,m),l[0].set(-.25*i,-.25*i,f[a][b]-m),l[1].set(.75*i,-.25*i,f[a+1][b]-m),l[2].set(-.25*i,.75*i,f[a][b+1]-m),l[3].set(-.25*i,-.25*i,-m-1),l[4].set(.75*i,-.25*i,-m-1),l[5].set(-.25*i,.75*i,-m-1),j[0][0]=0,j[0][1]=1,j[0][2]=2,j[1][0]=5,j[1][1]=4,j[1][2]=3,j[2][0]=0,j[2][1]=2,j[2][2]=5,j[2][3]=3,j[3][0]=1,j[3][1]=0,j[3][2]=3,j[3][3]=4,j[4][0]=4,j[4][1]=5,j[4][2]=2,j[4][3]=1),d.computeNormals(),d.computeEdges(),d.updateBoundingSphereRadius(),this.setCachedConvexTrianglePillar(a,b,c,d,e)},d.prototype.calculateLocalInertia=function(a,b){return b=b||new h,b.set(0,0,0),b},d.prototype.volume=function(){return Number.MAX_VALUE},d.prototype.calculateWorldAABB=function(a,b,c,d){c.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),d.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},d.prototype.updateBoundingSphereRadius=function(){var a=this.data,b=this.elementSize;this.boundingSphereRadius=new h(a.length*b,a[0].length*b,Math.max(Math.abs(this.maxValue),Math.abs(this.minValue))).norm()},d.prototype.setHeightsFromImage=function(a,b){var c=document.createElement("canvas");c.width=a.width,c.height=a.height;var d=c.getContext("2d");d.drawImage(a,0,0);var e=d.getImageData(0,0,a.width,a.height),f=this.data;f.length=0,this.elementSize=Math.abs(b.x)/e.width;for(var g=0;gc.x&&(c.x=e.x),e.yc.y&&(c.y=e.y),e.zc.z&&(c.z=e.z)},d.prototype.updateAABB=function(){this.computeLocalAABB(this.aabb)},d.prototype.updateBoundingSphereRadius=function(){for(var a=0,b=this.vertices,c=new f,d=0,e=b.length/3;d!==e;d++){this.getVertex(d,c);var g=c.norm2();g>a&&(a=g)}this.boundingSphereRadius=Math.sqrt(a)};var u=(new f,new g),v=new h;d.prototype.calculateWorldAABB=function(a,b,c,d){var e=u,f=v;e.position=a,e.quaternion=b,this.aabb.toWorldFrame(e,f),c.copy(f.lowerBound),d.copy(f.upperBound)},d.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},d.createTorus=function(a,b,c,e,f){a=a||1,b=b||.5,c=c||8,e=e||6,f=f||2*Math.PI;for(var g=[],h=[],i=0;i<=c;i++)for(var j=0;j<=e;j++){var k=j/e*f,l=i/c*Math.PI*2,m=(a+b*Math.cos(l))*Math.cos(k),n=(a+b*Math.cos(l))*Math.sin(k),o=b*Math.sin(l);g.push(m,n,o)}for(var i=1;i<=c;i++)for(var j=1;j<=e;j++){var p=(e+1)*i+j-1,q=(e+1)*(i-1)+j-1,r=(e+1)*(i-1)+j,s=(e+1)*i+j;h.push(p,q,s),h.push(q,r,s)}return new d(g,h)}},{"../collision/AABB":3,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../utils/Octree":51,"./Shape":44}],47:[function(a,b,c){function d(){e.call(this),this.iterations=10,this.tolerance=1e-7}b.exports=d;var e=(a("../math/Vec3"),a("../math/Quaternion"),a("./Solver"));d.prototype=new e;var f=[],g=[],h=[];d.prototype.solve=function(a,b){var c,d,e,i,j,k,l=0,m=this.iterations,n=this.tolerance*this.tolerance,o=this.equations,p=o.length,q=b.bodies,r=q.length,s=a;if(0!==p)for(var t=0;t!==r;t++)q[t].updateSolveMassProperties();var u=g,v=h,w=f;u.length=p,v.length=p,w.length=p;for(var t=0;t!==p;t++){var x=o[t];w[t]=0,v[t]=x.computeB(s),u[t]=1/x.computeC()}if(0!==p){for(var t=0;t!==r;t++){var y=q[t],z=y.vlambda,A=y.wlambda;z.set(0,0,0),A.set(0,0,0)}for(l=0;l!==m;l++){i=0;for(var B=0;B!==p;B++){var x=o[B];c=v[B],d=u[B],k=w[B],j=x.computeGWlambda(),e=d*(c-j-x.eps*k),k+ex.maxForce&&(e=x.maxForce-k),w[B]+=e,i+=e>0?e:-e,x.addToWlambda(e)}if(i*i=0;c--)b.children[c].data.length||b.children.splice(c,1);Array.prototype.push.apply(a,b.children)}}},{"../collision/AABB":3,"../math/Vec3":31}],52:[function(a,b,c){function d(){this.objects=[],this.type=Object}b.exports=d,d.prototype.release=function(){for(var a=arguments.length,b=0;b!==a;b++)this.objects.push(arguments[b]);return this},d.prototype.get=function(){return 0===this.objects.length?this.constructObject():this.objects.pop()},d.prototype.constructObject=function(){throw new Error("constructObject() not implemented in this Pool subclass yet!")},d.prototype.resize=function(a){for(var b=this.objects;b.length>a;)b.pop();for(;b.lengthb){var c=b;b=a,a=c}return this.data[a+"-"+b]},d.prototype.set=function(a,b,c){if(a>b){var d=b;b=a,a=d}var e=a+"-"+b;this.get(a,b)||this.data.keys.push(e),this.data[e]=c},d.prototype.reset=function(){for(var a=this.data,b=a.keys;b.length>0;){delete a[b.pop()]}}},{}],54:[function(a,b,c){function d(){}b.exports=d,d.defaults=function(a,b){a=a||{};for(var c in b)c in a||(a[c]=b[c]);return a}},{}],55:[function(a,b,c){function d(){f.call(this),this.type=e}b.exports=d;var e=a("../math/Vec3"),f=a("./Pool");d.prototype=new f,d.prototype.constructObject=function(){return new e}},{"../math/Vec3":31,"./Pool":52}],56:[function(a,b,c){function d(a){this.contactPointPool=[],this.frictionEquationPool=[],this.result=[],this.frictionResult=[],this.v3pool=new m,this.world=a,this.currentContactMaterial=null,this.enableFrictionReduction=!1}function e(a,b,c){for(var d=null,e=a.length,f=0;f!==e;f++){var g=a[f],h=Q;a[(f+1)%e].vsub(g,h);var i=R;h.cross(b,i);var j=S;c.vsub(g,j);var k=i.dot(j);if(!(null===d||k>0&&!0===d||k<=0&&!1===d))return!1;null===d&&(d=k>0)}return!0}b.exports=d;var f=a("../collision/AABB"),g=a("../objects/Body"),h=a("../shapes/Shape"),i=a("../collision/Ray"),j=a("../math/Vec3"),k=a("../math/Transform"),l=(a("../shapes/ConvexPolyhedron"),a("../math/Quaternion")),m=(a("../solver/Solver"),a("../utils/Vec3Pool")),n=a("../equations/ContactEquation"),o=a("../equations/FrictionEquation");d.prototype.createContactEquation=function(a,b,c,d,e,f){var g;this.contactPointPool.length?(g=this.contactPointPool.pop(),g.bi=a,g.bj=b):g=new n(a,b),g.enabled=a.collisionResponse&&b.collisionResponse&&c.collisionResponse&&d.collisionResponse;var h=this.currentContactMaterial;g.restitution=h.restitution,g.setSpookParams(h.contactEquationStiffness,h.contactEquationRelaxation,this.world.dt);var i=c.material||a.material,j=d.material||b.material;return i&&j&&i.restitution>=0&&j.restitution>=0&&(g.restitution=i.restitution*j.restitution),g.si=e||c,g.sj=f||d,g},d.prototype.createFrictionEquationsFromContact=function(a,b){var c=a.bi,d=a.bj,e=a.si,f=a.sj,g=this.world,h=this.currentContactMaterial,i=h.friction,j=e.material||c.material,k=f.material||d.material;if(j&&k&&j.friction>=0&&k.friction>=0&&(i=j.friction*k.friction),i>0){var l=i*g.gravity.length(),m=c.invMass+d.invMass;m>0&&(m=1/m);var n=this.frictionEquationPool,p=n.length?n.pop():new o(c,d,l*m),q=n.length?n.pop():new o(c,d,l*m);return p.bi=q.bi=c,p.bj=q.bj=d,p.minForce=q.minForce=-l*m,p.maxForce=q.maxForce=l*m,p.ri.copy(a.ri),p.rj.copy(a.rj),q.ri.copy(a.ri),q.rj.copy(a.rj),a.ni.tangents(p.t,q.t),p.setSpookParams(h.frictionEquationStiffness,h.frictionEquationRelaxation,g.dt),q.setSpookParams(h.frictionEquationStiffness,h.frictionEquationRelaxation,g.dt),p.enabled=q.enabled=a.enabled,b.push(p,q),!0}return!1};var p=new j,q=new j,r=new j;d.prototype.createFrictionFromAverage=function(a){var b=this.result[this.result.length-1];if(this.createFrictionEquationsFromContact(b,this.frictionResult)&&1!==a){var c=this.frictionResult[this.frictionResult.length-2],d=this.frictionResult[this.frictionResult.length-1];p.setZero(),q.setZero(),r.setZero();for(var e=b.bi,f=(b.bj,0);f!==a;f++)b=this.result[this.result.length-1-f],b.bodyA!==e?(p.vadd(b.ni,p),q.vadd(b.ri,q),r.vadd(b.rj,r)):(p.vsub(b.ni,p),q.vadd(b.rj,q),r.vadd(b.ri,r));var g=1/a;q.scale(g,c.ri),r.scale(g,c.rj),d.ri.copy(c.ri),d.rj.copy(c.rj),p.normalize(),p.tangents(c.t,d.t)}};var s=new j,t=new j,u=new l,v=new l;d.prototype.getContacts=function(a,b,c,d,e,f,h){this.contactPointPool=e,this.frictionEquationPool=h,this.result=d,this.frictionResult=f;for(var i=u,j=v,k=s,l=t,m=0,n=a.length;m!==n;m++){var o=a[m],p=b[m],q=null;o.material&&p.material&&(q=c.getContactMaterial(o.material,p.material)||null);for(var r=o.type&g.KINEMATIC&&p.type&g.STATIC||o.type&g.STATIC&&p.type&g.KINEMATIC||o.type&g.KINEMATIC&&p.type&g.KINEMATIC,w=0;wx.boundingSphereRadius+z.boundingSphereRadius)){var A=null;x.material&&z.material&&(A=c.getContactMaterial(x.material,z.material)||null),this.currentContactMaterial=A||q||c.defaultContactMaterial;var B=this[x.type|z.type];if(B){var C=!1;C=x.type0&&S<0){r.vsub(n,s),q.copy(p),q.normalize(),T=s.dot(q),q.scale(T,s),s.vadd(n,s);var U=s.distanceTo(r);if(U0){var C=V,D=W;C.copy(m[(x+1)%3]),D.copy(m[(x+2)%3]);var E=C.norm(),F=D.norm();C.normalize(),D.normalize();var G=T.dot(C),H=T.dot(D);if(G-E&&H-F){var I=Math.abs(B-A-n);if((null===w||I0){for(var G=[],H=0,I=z.length;H!==I;H++){var J=m.get();g.vmult(p[z[H]],J),d.vadd(J,J),G.push(J)}if(e(G,A,c)){if(l)return!0;w=!0;var v=this.createContactEquation(h,i,a,b,j,k);A.mult(-q,v.ri),A.negate(v.ni);var K=m.get();A.mult(-E,K);var L=m.get();A.mult(-q,L),c.vsub(d,v.rj),v.rj.vadd(L,v.rj),v.rj.vadd(K,v.rj),v.rj.vadd(d,v.rj),v.rj.vsub(i.position,v.rj),v.ri.vadd(c,v.ri),v.ri.vsub(h.position,v.ri),m.release(K),m.release(L),this.result.push(v),this.createFrictionEquationsFromContact(v,this.frictionResult);for(var H=0,M=G.length;H!==M;H++)m.release(G[H]);return}for(var H=0;H!==z.length;H++){var N=m.get(),O=m.get();g.vmult(p[z[(H+1)%z.length]],N),g.vmult(p[z[(H+2)%z.length]],O),d.vadd(N,N),d.vadd(O,O);var P=ba;O.vsub(N,P);var Q=ca;P.unit(Q);var R=m.get(),S=m.get();c.vsub(N,S);var T=S.dot(Q);Q.mult(T,R),R.vadd(N,R);var U=m.get();if(R.vsub(c,U),T>0&&T*Ta.boundingSphereRadius+b.boundingSphereRadius)&&a.findSeparatingAxis(b,c,e,d,f,n,l,m)){var o=[],p=pa;a.clipAgainstHull(c,e,b,d,f,n,-100,100,o);for(var q=0,r=0;r!==o.length;r++){if(k)return!0;var s=this.createContactEquation(g,h,a,b,i,j),t=s.ri,u=s.rj;n.negate(s.ni),o[r].normal.negate(p),p.mult(o[r].depth,p),o[r].point.vadd(p,t),u.copy(o[r].point),t.vsub(c,t),u.vsub(d,u),t.vadd(c,t),t.vsub(g.position,t),u.vadd(d,u),u.vsub(h.position,u),this.result.push(s),q++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(s,this.frictionResult)}this.enableFrictionReduction&&q&&this.createFrictionFromAverage(q)}};var qa=new j,ra=new j,sa=new j;d.prototype[h.types.PLANE|h.types.PARTICLE]=d.prototype.planeParticle=function(a,b,c,d,e,f,g,h,i,j,k){var l=qa;l.set(0,0,1),g.quaternion.vmult(l,l);var m=ra;if(d.vsub(g.position,m),l.dot(m)<=0){if(k)return!0;var n=this.createContactEquation(h,g,b,a,i,j);n.ni.copy(l),n.ni.negate(n.ni),n.ri.set(0,0,0);var o=sa;l.mult(l.dot(d),o),d.vsub(o,o),n.rj.copy(o),this.result.push(n),this.createFrictionEquationsFromContact(n,this.frictionResult)}};var ta=new j;d.prototype[h.types.PARTICLE|h.types.SPHERE]=d.prototype.sphereParticle=function(a,b,c,d,e,f,g,h,i,j,k){var l=ta;if(l.set(0,0,1),d.vsub(c,l),l.norm2()<=a.radius*a.radius){if(k)return!0;var m=this.createContactEquation(h,g,b,a,i,j);l.normalize(),m.rj.copy(l),m.rj.mult(a.radius,m.rj),m.ni.copy(l),m.ni.negate(m.ni),m.ri.set(0,0,0),this.result.push(m),this.createFrictionEquationsFromContact(m,this.frictionResult)}};var ua=new l,va=new j,wa=(new j,new j),xa=new j,ya=new j;d.prototype[h.types.PARTICLE|h.types.CONVEXPOLYHEDRON]=d.prototype.convexParticle=function(a,b,c,d,e,f,g,h,i,j,k){var l=-1,m=wa,n=ya,o=null,p=0,q=va;if(q.copy(d),q.vsub(c,q),e.conjugate(ua),ua.vmult(q,q),a.pointIsInside(q)){a.worldVerticesNeedsUpdate&&a.computeWorldVertices(c,e),a.worldFaceNormalsNeedsUpdate&&a.computeWorldFaceNormals(e);for(var r=0,s=a.faces.length;r!==s;r++){var t=[a.worldVertices[a.faces[r][0]]],u=a.worldFaceNormals[r];d.vsub(t[0],xa);var v=-u.dot(xa);if(null===o||Math.abs(v)m.length||u>m[0].length)){s<0&&(s=0),t<0&&(t=0),u<0&&(u=0),v<0&&(v=0),s>=m.length&&(s=m.length-1),t>=m.length&&(t=m.length-1),v>=m[0].length&&(v=m[0].length-1),u>=m[0].length&&(u=m[0].length-1);var w=[];b.getRectMinMax(s,u,t,v,w);var x=w[0],y=w[1];if(!(r.z-o>y||r.z+om.length||u>m[0].length)){r<0&&(r=0),s<0&&(s=0),t<0&&(t=0),u<0&&(u=0),r>=m.length&&(r=m.length-1),s>=m.length&&(s=m.length-1),u>=m[0].length&&(u=m[0].length-1),t>=m[0].length&&(t=m[0].length-1);var v=[];b.getRectMinMax(r,t,s,u,v);var w=v[0],x=v[1];if(!(q.z-n>x||q.z+n2)return}}}},{"../collision/AABB":3,"../collision/Ray":10,"../equations/ContactEquation":20,"../equations/FrictionEquation":22,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../objects/Body":32,"../shapes/ConvexPolyhedron":39,"../shapes/Shape":44,"../solver/Solver":48,"../utils/Vec3Pool":55}],57:[function(a,b,c){function d(a){a=a||{},i.apply(this),this.dt=-1,this.allowSleep=!!a.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=void 0!==a.quatNormalizeSkip?a.quatNormalizeSkip:0,this.quatNormalizeFast=void 0!==a.quatNormalizeFast&&a.quatNormalizeFast,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new e,a.gravity&&this.gravity.copy(a.gravity),this.broadphase=void 0!==a.broadphase?a.broadphase:new s,this.bodies=[],this.solver=void 0!==a.solver?a.solver:new g,this.constraints=[],this.narrowphase=new h(this),this.collisionMatrix=new j,this.collisionMatrixPrevious=new j,this.bodyOverlapKeeper=new k,this.shapeOverlapKeeper=new k,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new o,this.defaultMaterial=new l("default"),this.defaultContactMaterial=new m(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}b.exports=d;var e=(a("../shapes/Shape"),a("../math/Vec3")),f=a("../math/Quaternion"),g=a("../solver/GSSolver"),h=(a("../equations/ContactEquation"),a("../equations/FrictionEquation"),a("./Narrowphase")),i=a("../utils/EventTarget"),j=a("../collision/ArrayCollisionMatrix"),k=a("../collision/OverlapKeeper"),l=a("../material/Material"),m=a("../material/ContactMaterial"),n=a("../objects/Body"),o=a("../utils/TupleDictionary"),p=a("../collision/RaycastResult"),q=a("../collision/AABB"),r=a("../collision/Ray"),s=a("../collision/NaiveBroadphase");d.prototype=new i;var t=(new q,new r);if(d.prototype.getContactMaterial=function(a,b){return this.contactMaterialTable.get(a.id,b.id)},d.prototype.numObjects=function(){return this.bodies.length},d.prototype.collisionMatrixTick=function(){var a=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=a,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()},d.prototype.add=d.prototype.addBody=function(a){-1===this.bodies.indexOf(a)&&(a.index=this.bodies.length,this.bodies.push(a),a.world=this,a.initPosition.copy(a.position),a.initVelocity.copy(a.velocity),a.timeLastSleepy=this.time,a instanceof n&&(a.initAngularVelocity.copy(a.angularVelocity),a.initQuaternion.copy(a.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=a,this.idToBodyMap[a.id]=a,this.dispatchEvent(this.addBodyEvent))},d.prototype.addConstraint=function(a){this.constraints.push(a)},d.prototype.removeConstraint=function(a){var b=this.constraints.indexOf(a);-1!==b&&this.constraints.splice(b,1)},d.prototype.rayTest=function(a,b,c){c instanceof p?this.raycastClosest(a,b,{skipBackfaces:!0},c):this.raycastAll(a,b,{skipBackfaces:!0},c)},d.prototype.raycastAll=function(a,b,c,d){return c.mode=r.ALL,c.from=a,c.to=b,c.callback=d,t.intersectWorld(this,c)},d.prototype.raycastAny=function(a,b,c,d){return c.mode=r.ANY,c.from=a,c.to=b,c.result=d,t.intersectWorld(this,c)},d.prototype.raycastClosest=function(a,b,c,d){return c.mode=r.CLOSEST,c.from=a,c.to=b,c.result=d,t.intersectWorld(this,c)},d.prototype.remove=function(a){a.world=null;var b=this.bodies.length-1,c=this.bodies,d=c.indexOf(a);if(-1!==d){c.splice(d,1);for(var e=0;e!==c.length;e++)c[e].index=e;this.collisionMatrix.setNumObjects(b),this.removeBodyEvent.body=a,delete this.idToBodyMap[a.id],this.dispatchEvent(this.removeBodyEvent)}},d.prototype.removeBody=d.prototype.remove,d.prototype.getBodyById=function(a){return this.idToBodyMap[a]},d.prototype.getShapeById=function(a){for(var b=this.bodies,c=0,d=b.length;c=a&&d=0;G-=1)(F.bodyA===d[G]&&F.bodyB===e[G]||F.bodyB===d[G]&&F.bodyA===e[G])&&(d.splice(G,1),e.splice(G,1))}this.collisionMatrixTick(),j&&(b=performance.now());var H=y,I=c.length;for(s=0;s!==I;s++)H.push(c[s]);c.length=0;var J=this.frictionEquations.length;for(s=0;s!==J;s++)o.push(this.frictionEquations[s]);this.frictionEquations.length=0,this.narrowphase.getContacts(d,e,this,c,H,this.frictionEquations,o),j&&(k.narrowphase=performance.now()-b),j&&(b=performance.now());for(var s=0;s=0&&N.material.friction>=0&&t.material.friction*N.material.friction,t.material.restitution>=0&&N.material.restitution>=0&&(F.restitution=t.material.restitution*N.material.restitution)),h.addEquation(F),t.allowSleep&&t.type===n.DYNAMIC&&t.sleepState===n.SLEEPING&&N.sleepState===n.AWAKE&&N.type!==n.STATIC){N.velocity.norm2()+N.angularVelocity.norm2()>=2*Math.pow(N.sleepSpeedLimit,2)&&(t._wakeUpAfterNarrowphase=!0)}if(N.allowSleep&&N.type===n.DYNAMIC&&N.sleepState===n.SLEEPING&&t.sleepState===n.AWAKE&&t.type!==n.STATIC){t.velocity.norm2()+t.angularVelocity.norm2()>=2*Math.pow(t.sleepSpeedLimit,2)&&(N._wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(t,N,!0),this.collisionMatrixPrevious.get(t,N)||(x.body=N,x.contact=F,t.dispatchEvent(x),x.body=t,N.dispatchEvent(x)),this.bodyOverlapKeeper.set(t.id,N.id),this.shapeOverlapKeeper.set(O.id,P.id)}for(this.emitContactEvents(),j&&(k.makeContactConstraints=performance.now()-b,b=performance.now()),s=0;s!==f;s++){var t=g[s];t._wakeUpAfterNarrowphase&&(t.wakeUp(),t._wakeUpAfterNarrowphase=!1)}var E=m.length;for(s=0;s!==E;s++){var F=m[s];F.update();for(var G=0,Q=F.equations.length;G!==Q;G++){var R=F.equations[G];h.addEquation(R)}}h.solve(a,this),j&&(k.solve=performance.now()-b),h.removeAllEquations();var S=Math.pow;for(s=0;s!==f;s++){var t=g[s];if(t.type&l){var T=S(1-t.linearDamping,a),U=t.velocity;U.mult(T,U);var V=t.angularVelocity;if(V){var W=S(1-t.angularDamping,a);V.mult(W,V)}}}for(this.dispatchEvent(w),s=0;s!==f;s++){var t=g[s];t.preStep&&t.preStep.call(t)}j&&(b=performance.now());var X=this.stepnumber,Y=X%(this.quatNormalizeSkip+1)==0,Z=this.quatNormalizeFast;for(s=0;s!==f;s++)g[s].integrate(a,Y,Z);for(this.clearForces(),this.broadphase.dirty=!0,j&&(k.integrate=performance.now()-b),this.time+=a,this.stepnumber+=1,this.dispatchEvent(v),s=0;s!==f;s++){var t=g[s],$=t.postStep;$&&$.call(t)}if(this.allowSleep)for(s=0;s!==f;s++)g[s].sleepTick(this.time)},d.prototype.emitContactEvents=function(){var a=[],b=[],c={type:"beginContact",bodyA:null,bodyB:null},d={type:"endContact",bodyA:null,bodyB:null},e={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},f={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};return function(){var g=this.hasAnyEventListener("beginContact"),h=this.hasAnyEventListener("endContact");if((g||h)&&this.bodyOverlapKeeper.getDiff(a,b),g){for(var i=0,j=a.length;i=2.2.7 <3" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "acorn": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", + "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true + }, + "acorn-node": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.7.0.tgz", + "integrity": "sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw==", + "dev": true, + "requires": { + "acorn": "^6.1.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-walk": "^6.1.1", + "xtend": "^4.0.1" + } + }, + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", + "dev": true, + "requires": { + "underscore": "~1.7.0", + "underscore.string": "~2.4.0" + }, + "dependencies": { + "underscore.string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=", + "dev": true + } + } + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "^4.0.3" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "async": { + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", + "integrity": "sha1-D8GqoIig4+8Ovi2IMbqw3PiEUGE=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/aws-sign/-/aws-sign-0.3.0.tgz", + "integrity": "sha1-PYHKabR0seFlGHKLUcJP8Lvtxuk=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.3.0.tgz", + "integrity": "sha512-BWaaD7alyGZVEBBwSTYx4iJF5DswIGzK17o8ai9w4iKRbYpk3EOiprRHMRRA8DCZFmFeOdx7A385w2XdFvxWmg==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "builtins": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz", + "integrity": "sha1-NVIZzWzxjb58Acx/0tznZc/cVJo=", + "dev": true + }, + "bytes": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz", + "integrity": "sha1-qtM+wU49wsp06OfUUfm6BTrU96A=", + "dev": true + }, + "cached-path-relative": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", + "dev": true + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chokidar": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-0.8.4.tgz", + "integrity": "sha1-OytQZoFwhlNLqBoJK9z0viW4vuA=", + "dev": true, + "requires": { + "fsevents": "github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138", + "recursive-readdir": "0.0.2" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "clean-yaml-object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/cli/-/cli-0.4.3.tgz", + "integrity": "sha1-5oGcjV+qlX9k+Y9mqFBiaMHR8X0=", + "dev": true, + "requires": { + "glob": ">= 3.1.4" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "coffee-script": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=", + "dev": true + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", + "dev": true + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "commondir": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-0.0.1.tgz", + "integrity": "sha1-ifAP3NUbUZxXhzP+xWPmptp/W+I=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "connect": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/connect/-/connect-2.7.5.tgz", + "integrity": "sha1-E5ERtLA/BTOlJJJ6iKZGrkZ7LAI=", + "dev": true, + "requires": { + "buffer-crc32": "0.1.1", + "bytes": "0.2.0", + "cookie": "0.0.5", + "cookie-signature": "1.0.0", + "debug": "*", + "formidable": "1.0.11", + "fresh": "0.1.0", + "pause": "0.0.1", + "qs": "0.5.1", + "send": "0.1.0" + }, + "dependencies": { + "buffer-crc32": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.1.1.tgz", + "integrity": "sha1-fhENyZU5CKt8MqzccMn5RbHLxSY=", + "dev": true + }, + "qs": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.5.1.tgz", + "integrity": "sha1-n2v12axsdjhOldNtFbSJgOXkrdA=", + "dev": true + } + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "cookie": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.0.5.tgz", + "integrity": "sha1-+az521frdWjJ/MWWJWt7si4wfIE=", + "dev": true + }, + "cookie-jar": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz", + "integrity": "sha1-vJon1OK5fhhs1XyeIGPLmfpozMw=", + "dev": true + }, + "cookie-signature": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.0.tgz", + "integrity": "sha1-AETzMqxiPfhRyRTojqzFfwyXBP4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "coveralls": { + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.3.tgz", + "integrity": "sha512-iiAmn+l1XqRwNLXhW8Rs5qHZRFMYp9ZIPjEOVRpC/c4so6Y/f4/lFi0FfR5B9cCqgyhkJ5cZmbvcVRfP8MHchw==", + "dev": true, + "requires": { + "js-yaml": "3.6.1", + "lcov-parse": "0.0.10", + "log-driver": "1.2.5", + "minimist": "1.2.0", + "request": "2.79.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "js-yaml": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^2.6.0" + } + } + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + }, + "dependencies": { + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.x.x" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "ctype": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz", + "integrity": "sha1-/oCR1Gijc6Cwyf+Lv7NCXACXOh0=", + "dev": true + }, + "dash-ast": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz", + "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "1.0.2-1.2.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", + "integrity": "sha1-sCIMAt6YYXQztyhRz0fePfLNvuk=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-equal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.2.2.tgz", + "integrity": "sha1-hLdFiW80xoTpjyzg5Cq69Du6AX0=", + "dev": true + }, + "deeper": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/deeper/-/deeper-2.1.0.tgz", + "integrity": "sha1-vFZOX3MXT98gHgiwADDooU2nQ2g=", + "dev": true + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "derequire": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/derequire/-/derequire-0.8.0.tgz", + "integrity": "sha1-wffx2izt5Ere3gRzePA/RE6cTA0=", + "dev": true, + "requires": { + "esprima-fb": "^3001.1.0-dev-harmony-fb", + "esrefactor": "~0.1.0", + "estraverse": "~1.5.0" + }, + "dependencies": { + "esprima-fb": { + "version": "3001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz", + "integrity": "sha1-t303q8046gt3Qmu4vCkizmtCZBE=", + "dev": true + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detective": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "dev": true, + "requires": { + "acorn-node": "^1.6.1", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diff": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "entities": "^1.1.1" + }, + "dependencies": { + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "elliptic": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.1.0.tgz", + "integrity": "sha1-xmOSP24gqtSNDA+knzHG1PSTYM8=", + "dev": true, + "requires": { + "esprima": "~1.0.4", + "estraverse": "~1.5.0", + "esutils": "~1.0.0", + "source-map": "~0.1.30" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "escope": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/escope/-/escope-0.0.16.tgz", + "integrity": "sha1-QYx6CvynIdr+ZZGT/Zhig+dGU48=", + "dev": true, + "requires": { + "estraverse": ">= 0.0.2" + } + }, + "esprima": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", + "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=", + "dev": true + }, + "esrefactor": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/esrefactor/-/esrefactor-0.1.0.tgz", + "integrity": "sha1-0UJ5WigjOauB6Ta1t6IbEb8ZexM=", + "dev": true, + "requires": { + "escope": "~0.0.13", + "esprima": "~1.0.2", + "estraverse": "~0.0.4" + }, + "dependencies": { + "estraverse": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-0.0.4.tgz", + "integrity": "sha1-AaCTLf7ldGhKWYr1pnw7+bZCjbI=", + "dev": true + } + } + }, + "estraverse": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=", + "dev": true + }, + "esutils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "events": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "dev": true + }, + "events-to-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz", + "integrity": "sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "express": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/express/-/express-3.1.2.tgz", + "integrity": "sha1-UqAsjbjyK7+g10eNhHzUUWH5hfc=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.1", + "commander": "0.6.1", + "connect": "2.7.5", + "cookie": "0.0.5", + "cookie-signature": "1.0.0", + "debug": "*", + "fresh": "0.1.0", + "methods": "0.0.1", + "mkdirp": "~0.3.4", + "range-parser": "0.0.4", + "send": "0.1.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "findup-sync": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", + "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", + "dev": true, + "requires": { + "glob": "~3.2.9", + "lodash": "~2.4.1" + }, + "dependencies": { + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "requires": { + "inherits": "2", + "minimatch": "0.3" + } + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + }, + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.11.tgz", + "integrity": "sha1-aPYzJaA15kS297s9ESQ7l2HeGzA=", + "dev": true + }, + "fresh": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.1.0.tgz", + "integrity": "sha1-A+SwF4Qk5MLV0ZpU2IFM3JeTSFA=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138", + "from": "github:pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138", + "dev": true, + "optional": true, + "requires": { + "nan": "~0.8.0" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dev": true, + "requires": { + "is-property": "^1.0.2" + } + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "^1.0.0" + } + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "dev": true + }, + "grunt": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", + "integrity": "sha1-VpN81RlDJK3/bSB2MYMqnWuk5/A=", + "dev": true, + "requires": { + "async": "~0.1.22", + "coffee-script": "~1.3.3", + "colors": "~0.6.2", + "dateformat": "1.0.2-1.2.3", + "eventemitter2": "~0.4.13", + "exit": "~0.1.1", + "findup-sync": "~0.1.2", + "getobject": "~0.1.0", + "glob": "~3.1.21", + "grunt-legacy-log": "~0.1.0", + "grunt-legacy-util": "~0.2.0", + "hooker": "~0.2.3", + "iconv-lite": "~0.2.11", + "js-yaml": "~2.0.5", + "lodash": "~0.9.2", + "minimatch": "~0.2.12", + "nopt": "~1.0.10", + "rimraf": "~2.2.8", + "underscore.string": "~2.2.1", + "which": "~1.0.5" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "dev": true, + "requires": { + "graceful-fs": "~1.2.0", + "inherits": "1", + "minimatch": "~0.2.11" + } + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + }, + "grunt-browserify": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/grunt-browserify/-/grunt-browserify-2.1.4.tgz", + "integrity": "sha1-jMkbd1dk4bmzB3nS4JRDBl+iEis=", + "dev": true, + "requires": { + "async": "^0.7", + "browserify": "^4.2.1", + "glob": "^3.2", + "lodash": "^2.4", + "resolve": "^0.6", + "watchify": "^0.10" + }, + "dependencies": { + "JSONStream": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", + "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "assert": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.1.2.tgz", + "integrity": "sha1-raoExGu1jG3R8pTaPrJuYijrbkQ=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "async": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.7.0.tgz", + "integrity": "sha1-RCng5i9d4KVPN0WMSfC4l+tSraU=", + "dev": true + }, + "base64-js": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.7.tgz", + "integrity": "sha1-VEANyR1pbOwyqKR5AvlxUi/uj0g=", + "dev": true + }, + "browser-pack": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-2.0.1.tgz", + "integrity": "sha1-XRxSf1bFgmd0EcTbKhKGSP9r8VA=", + "dev": true, + "requires": { + "JSONStream": "~0.6.4", + "combine-source-map": "~0.3.0", + "through": "~2.3.4" + }, + "dependencies": { + "JSONStream": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.6.4.tgz", + "integrity": "sha1-SyyAY/j1Enh7I3X37p22kgj6Lcs=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + } + } + }, + "browserify": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-4.2.3.tgz", + "integrity": "sha1-Dg2PmObfamZKosBVEg84SCRu5NA=", + "dev": true, + "requires": { + "JSONStream": "~0.8.3", + "assert": "~1.1.0", + "browser-pack": "~2.0.0", + "browser-resolve": "^1.3.0", + "browserify-zlib": "~0.1.2", + "buffer": "^2.3.0", + "builtins": "~0.0.3", + "commondir": "0.0.1", + "concat-stream": "~1.4.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~0.0.1", + "crypto-browserify": "^2.1.8", + "deep-equal": "~0.2.1", + "defined": "~0.0.0", + "deps-sort": "~0.1.1", + "derequire": "~0.8.0", + "domain-browser": "~1.1.0", + "duplexer": "~0.1.1", + "events": "~1.0.0", + "glob": "~3.2.8", + "http-browserify": "^1.4.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "~6.0.0", + "module-deps": "~2.1.1", + "os-browserify": "~0.1.1", + "parents": "~0.0.1", + "path-browserify": "~0.0.0", + "process": "^0.7.0", + "punycode": "~1.2.3", + "querystring-es3": "~0.2.0", + "readable-stream": "^1.0.27-1", + "resolve": "~0.7.1", + "shallow-copy": "0.0.1", + "shell-quote": "~0.0.1", + "stream-browserify": "^1.0.0", + "stream-combiner": "~0.0.2", + "string_decoder": "~0.0.0", + "subarg": "0.0.1", + "syntax-error": "^1.1.1", + "through2": "^1.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "umd": "~2.1.0", + "url": "~0.10.1", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^3.0.0" + }, + "dependencies": { + "resolve": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.7.4.tgz", + "integrity": "sha1-OVqe+ehz+/4SvRRAi9kbuTYAPWk=", + "dev": true + } + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "~0.2.0" + } + }, + "buffer": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-2.8.2.tgz", + "integrity": "sha1-1zwhTAM0OE3CmwTuD/X1Unx5dOc=", + "dev": true, + "requires": { + "base64-js": "0.0.7", + "ieee754": "^1.1.4", + "is-array": "^1.0.1" + } + }, + "combine-source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.3.0.tgz", + "integrity": "sha1-2edPWT2c1DgHMSy12EbUUe+qnrc=", + "dev": true, + "requires": { + "convert-source-map": "~0.3.0", + "inline-source-map": "~0.3.0", + "source-map": "~0.1.31" + } + }, + "concat-stream": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.11.tgz", + "integrity": "sha512-X3JMh8+4je3U1cQpG87+f9lXHDrqcb2MVLg9L7o8b1UZ0DzhRrUpdn65ttzu10PpJPPI3MQNkis+oha6TSA9Mw==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "~1.1.9", + "typedarray": "~0.0.5" + } + }, + "constants-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz", + "integrity": "sha1-kld9tSe6bEzwpFaNhLwDH0QeIfI=", + "dev": true + }, + "convert-source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", + "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=", + "dev": true + }, + "crypto-browserify": { + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-2.1.10.tgz", + "integrity": "sha1-TyymMRhDzwh83wCOQ6TzaG725rs=", + "dev": true, + "requires": { + "ripemd160": "0.2.0", + "sha.js": "2.1.6" + } + }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", + "dev": true + }, + "deps-sort": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-0.1.2.tgz", + "integrity": "sha1-2qL7YUoXyWN9gB4vVTOa43DzYRo=", + "dev": true, + "requires": { + "JSONStream": "~0.6.4", + "minimist": "~0.0.1", + "through": "~2.3.4" + }, + "dependencies": { + "JSONStream": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.6.4.tgz", + "integrity": "sha1-SyyAY/j1Enh7I3X37p22kgj6Lcs=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + } + } + }, + "detective": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-3.1.0.tgz", + "integrity": "sha1-d3gkRKt1K4jKG+Lp0KA5Xx2iXu0=", + "dev": true, + "requires": { + "escodegen": "~1.1.0", + "esprima-fb": "3001.1.0-dev-harmony-fb" + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "~1.1.9" + } + }, + "esprima-fb": { + "version": "3001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz", + "integrity": "sha1-t303q8046gt3Qmu4vCkizmtCZBE=", + "dev": true + }, + "events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/events/-/events-1.0.2.tgz", + "integrity": "sha1-dYSdz+k9EPsFfDAFWv29UdBqjiQ=", + "dev": true + }, + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "requires": { + "inherits": "2", + "minimatch": "0.3" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "inline-source-map": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.3.1.tgz", + "integrity": "sha1-pSi1FOaJ/OkNswiehw2S9Sestes=", + "dev": true, + "requires": { + "source-map": "~0.3.0" + }, + "dependencies": { + "source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.3.0.tgz", + "integrity": "sha1-hYb7mloAXltQHiHNGLbyG0V60fk=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "insert-module-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-6.0.0.tgz", + "integrity": "sha1-7orrne4WgZ4zqhRYilWIJK8MFdw=", + "dev": true, + "requires": { + "JSONStream": "~0.7.1", + "concat-stream": "~1.4.1", + "lexical-scope": "~1.1.0", + "process": "~0.6.0", + "through": "~2.3.4", + "xtend": "^3.0.0" + }, + "dependencies": { + "JSONStream": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.7.4.tgz", + "integrity": "sha1-c0KQ5BUR7qfCz+FR+/mlY6l7l4Y=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "process": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/process/-/process-0.6.0.tgz", + "integrity": "sha1-fdm+gP+q7dTLYo8YJ/HLq23AkY8=", + "dev": true + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "jsonparse": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz", + "integrity": "sha1-MwVCrT8KZUZlt3jz6y2an6UHrGQ=", + "dev": true + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "module-deps": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-2.1.5.tgz", + "integrity": "sha1-N1qbyATM1kzrs8Yu5kN1Xws8zyk=", + "dev": true, + "requires": { + "JSONStream": "~0.7.1", + "browser-resolve": "~1.2.4", + "concat-stream": "~1.4.5", + "detective": "~3.1.0", + "duplexer2": "0.0.2", + "inherits": "~2.0.1", + "minimist": "~0.0.9", + "parents": "0.0.2", + "readable-stream": "^1.0.27-1", + "resolve": "~0.6.3", + "stream-combiner": "~0.1.0", + "subarg": "0.0.1", + "through2": "~0.4.1" + }, + "dependencies": { + "JSONStream": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.7.4.tgz", + "integrity": "sha1-c0KQ5BUR7qfCz+FR+/mlY6l7l4Y=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "browser-resolve": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.2.4.tgz", + "integrity": "sha1-Wa54IKgpVezTL1+3xGisIcRyOAY=", + "dev": true, + "requires": { + "resolve": "0.6.3" + } + }, + "parents": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/parents/-/parents-0.0.2.tgz", + "integrity": "sha1-ZxR4JuSX1AdZqvW6TJllm2A00wI=", + "dev": true + }, + "stream-combiner": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.1.0.tgz", + "integrity": "sha1-DcOJo8ID+PTVY2j5Xd5S65Jptb4=", + "dev": true, + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", + "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", + "dev": true, + "requires": { + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parents/-/parents-0.0.3.tgz", + "integrity": "sha1-+iEvAk2fpjGNu2tM5nbIvkk7nEM=", + "dev": true, + "requires": { + "path-platform": "^0.0.1" + } + }, + "path-platform": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.0.1.tgz", + "integrity": "sha1-tVhdfDxGPYmqAGDYZhHPGv1hfio=", + "dev": true + }, + "process": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/process/-/process-0.7.0.tgz", + "integrity": "sha1-xSIIFho0rfOBI0SuhdPmFQRpOJ0=", + "dev": true + }, + "punycode": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.2.4.tgz", + "integrity": "sha1-VACKyXKux0F13vnLpt9/qdORh0A=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + }, + "dependencies": { + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "resolve": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", + "integrity": "sha1-3ZV5gufnNt699TtYpN2RdUV13UY=", + "dev": true + }, + "ripemd160": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", + "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", + "dev": true + }, + "sha.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.1.6.tgz", + "integrity": "sha1-IObrgfPmbwgd34TdjwRkvqbAL9Q=", + "dev": true, + "requires": { + "buffer": "~2.3.2" + }, + "dependencies": { + "buffer": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-2.3.4.tgz", + "integrity": "sha1-fkr1ojwV4T/L/VxaHsl0y2Fmikw=", + "dev": true, + "requires": { + "base64-js": "~0.0.4", + "ieee754": "~1.1.1" + } + } + } + }, + "shell-quote": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-0.0.1.tgz", + "integrity": "sha1-GkEZbzwDM8SCMjWT1ohuzxU92YY=", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "stream-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz", + "integrity": "sha1-v5tKv7QrJ011FHnkTg/yZWtvEZM=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^1.0.27-1" + } + }, + "string_decoder": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.0.1.tgz", + "integrity": "sha1-9UctCo0WUOyCN1LSTm/WJ7Ob8UE=", + "dev": true + }, + "subarg": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-0.0.1.tgz", + "integrity": "sha1-PVawfaz7xFu7Y/dnK0O2PkY2jjo=", + "dev": true, + "requires": { + "minimist": "~0.0.7" + } + }, + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "dev": true, + "requires": { + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, + "uglify-js": { + "version": "2.4.24", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", + "integrity": "sha1-+tV1XB4Vd2WLsG/5q25UjJW+vW4=", + "dev": true, + "requires": { + "async": "~0.2.6", + "source-map": "0.1.34", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.5.4" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "source-map": { + "version": "0.1.34", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", + "integrity": "sha1-p8/omux7FoLDsZjQrPtH19CQVms=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "umd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/umd/-/umd-2.1.0.tgz", + "integrity": "sha1-SmMHt2LxfwLSAbX6FU5nM5bCY88=", + "dev": true, + "requires": { + "rfile": "~1.0.0", + "ruglify": "~1.0.0", + "through": "~2.3.4", + "uglify-js": "~2.4.0" + } + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", + "dev": true + } + } + }, + "grunt-contrib-concat": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-0.1.3.tgz", + "integrity": "sha1-35oam8jXX80AeUs9D22K6CeFI6w=", + "dev": true + }, + "grunt-contrib-jshint": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-0.1.1.tgz", + "integrity": "sha1-qeJYFB5rL0Z8V39Wctl+xk7yWD0=", + "dev": true, + "requires": { + "jshint": "~0.9.0" + }, + "dependencies": { + "jshint": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz", + "integrity": "sha1-/zLsfwn4QAH3SY7q/WPJ5Puy3A4=", + "dev": true, + "requires": { + "cli": "0.4.3", + "minimatch": "0.0.x" + } + }, + "lru-cache": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.6.tgz", + "integrity": "sha1-qlD5cEdCKsclQ72hd6nJ0BjZhFI=", + "dev": true + }, + "minimatch": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.0.5.tgz", + "integrity": "sha1-lrtJC707poNrv6wRGt91MBsVhN4=", + "dev": true, + "requires": { + "lru-cache": "~1.0.2" + } + } + } + }, + "grunt-contrib-nodeunit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-nodeunit/-/grunt-contrib-nodeunit-0.4.1.tgz", + "integrity": "sha1-lDOT7l1msc2ttJqbI6ruREVQlbI=", + "dev": true, + "requires": { + "hooker": "~0.2.3", + "nodeunit": "~0.9.0" + } + }, + "grunt-contrib-uglify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.5.1.tgz", + "integrity": "sha1-FfCqXo6LpCGuqYCHnuUFvHErbN4=", + "dev": true, + "requires": { + "chalk": "^0.5.1", + "lodash": "^2.4.1", + "maxmin": "^0.2.0", + "uglify-js": "^2.4.0" + }, + "dependencies": { + "ansi-regex": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "dev": true + }, + "ansi-styles": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", + "dev": true + }, + "chalk": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", + "dev": true, + "requires": { + "ansi-styles": "^1.1.0", + "escape-string-regexp": "^1.0.0", + "has-ansi": "^0.1.0", + "strip-ansi": "^0.3.0", + "supports-color": "^0.2.0" + } + }, + "has-ansi": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.0" + } + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + }, + "strip-ansi": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.1" + } + }, + "supports-color": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + } + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "grunt-contrib-yuidoc": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/grunt-contrib-yuidoc/-/grunt-contrib-yuidoc-0.5.2.tgz", + "integrity": "sha1-NQJyR+8pB6obPhEG4ZQvK/xUKG8=", + "dev": true, + "requires": { + "yuidocjs": "~0.3.45" + } + }, + "grunt-legacy-log": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", + "integrity": "sha1-7ClCboAwIa9ZAp+H0vnNczWgVTE=", + "dev": true, + "requires": { + "colors": "~0.6.2", + "grunt-legacy-log-utils": "~0.1.1", + "hooker": "~0.2.3", + "lodash": "~2.4.1", + "underscore.string": "~2.3.3" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + }, + "underscore.string": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=", + "dev": true + } + } + }, + "grunt-legacy-log-utils": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", + "integrity": "sha1-wHBrndkGThFvNvI/5OawSGcsD34=", + "dev": true, + "requires": { + "colors": "~0.6.2", + "lodash": "~2.4.1", + "underscore.string": "~2.3.3" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + }, + "underscore.string": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=", + "dev": true + } + } + }, + "grunt-legacy-util": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", + "integrity": "sha1-kzJIhNv343qf98Am3/RR2UqeVUs=", + "dev": true, + "requires": { + "async": "~0.1.22", + "exit": "~0.1.1", + "getobject": "~0.1.0", + "hooker": "~0.2.3", + "lodash": "~0.9.2", + "underscore.string": "~2.2.1", + "which": "~1.0.5" + } + }, + "gzip-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-0.2.0.tgz", + "integrity": "sha1-46KhkSBf5W7jJvXCcUNd+uz7Phw=", + "dev": true, + "requires": { + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" + }, + "dependencies": { + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "~0.2.0" + } + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + } + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "commander": "^2.9.0", + "is-my-json-valid": "^2.12.4", + "pinkie-promise": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "http-browserify": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz", + "integrity": "sha1-M3la3nLfiKz7/TZ3PO/tp2RzWyA=", + "dev": true, + "requires": { + "Base64": "~0.2.0", + "inherits": "~2.0.1" + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "iconv-lite": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", + "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg=", + "dev": true + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, + "insert-module-globals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + } + }, + "is-array": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz", + "integrity": "sha1-6YUMwsyGDDvAl36EzPDdRkWEJ5o=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, + "is-my-json-valid": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.0.tgz", + "integrity": "sha512-XTHBZSIIxNsIsZXg7XB5l8z/OBFosl1Wao4tXLpeC7eKU4Vm/kdop2azkPqULwnfGQjmeDIyey9g7afMMtdWAA==", + "dev": true, + "requires": { + "generate-function": "^2.0.0", + "generate-object-property": "^1.1.0", + "is-my-ip-valid": "^1.0.0", + "jsonpointer": "^4.0.0", + "xtend": "^4.0.0" + } + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "integrity": "sha1-NvPiLmB1CSD15yQaR2qMakInWtA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-yaml": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", + "integrity": "sha1-olrmUJmZ6X3yeMZxnaEb0Gh3Q6g=", + "dev": true, + "requires": { + "argparse": "~ 0.1.11", + "esprima": "~ 1.0.2" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jshint": { + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz", + "integrity": "sha512-e7KZgCSXMJxznE/4WULzybCMNXNAd/bf5TSrvVEq78Q/K8ZwFpmBqQeDtNiHc3l49nV4E/+YeHU/JZjSUIrLAA==", + "dev": true, + "requires": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.11", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" + }, + "dependencies": { + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "^7.1.1" + } + }, + "lodash": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", + "dev": true + } + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "labeled-stream-splicer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", + "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "stream-splicer": "^2.0.0" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, + "lexical-scope": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.1.1.tgz", + "integrity": "sha1-3rrBBnQ18TWdkPz9npS8su5Hsr8=", + "dev": true, + "requires": { + "astw": "^2.0.0" + } + }, + "lodash": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", + "integrity": "sha1-jzSZxSRdNG1oLlsNO0B2fgnxqSw=", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "log-driver": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "marked": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.2.10.tgz", + "integrity": "sha1-1f1oJxyq5hxV0pHQe9UDTP9ec+4=", + "dev": true + }, + "maxmin": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-0.2.2.tgz", + "integrity": "sha1-o2ztjMIuOrzRCM+3l6OktAJ1WT8=", + "dev": true, + "requires": { + "chalk": "^0.5.0", + "figures": "^1.0.1", + "gzip-size": "^0.2.0", + "pretty-bytes": "^0.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "dev": true + }, + "ansi-styles": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", + "dev": true + }, + "chalk": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", + "dev": true, + "requires": { + "ansi-styles": "^1.1.0", + "escape-string-regexp": "^1.0.0", + "has-ansi": "^0.1.0", + "strip-ansi": "^0.3.0", + "supports-color": "^0.2.0" + } + }, + "has-ansi": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.0" + } + }, + "strip-ansi": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.1" + } + }, + "supports-color": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", + "dev": true + } + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "methods": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz", + "integrity": "sha1-J3yQ+L7zlwlkWoNxxRw7bGSOBow=", + "dev": true + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.6.tgz", + "integrity": "sha1-sfhsdowCX6h7SAdfFwnyiuryA2U=", + "dev": true + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, + "requires": { + "mime-db": "1.40.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "module-deps": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.1.tgz", + "integrity": "sha512-UnEn6Ah36Tu4jFiBbJVUtt0h+iXqxpLqDvPS8nllbw5RZFmNJ1+Mz5BjYnM9ieH80zyxHkARGLnMIHlPK5bu6A==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.2", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-0.8.0.tgz", + "integrity": "sha1-AiqPpen+hCCWSsH7PclOF/RJ9f0=", + "dev": true, + "optional": true + }, + "nodeunit": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/nodeunit/-/nodeunit-0.9.5.tgz", + "integrity": "sha1-C2MjaAB9lGUczwoYmZgHmC8HOGY=", + "dev": true, + "requires": { + "tap": "^7.0.0" + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "nyc": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-7.1.0.tgz", + "integrity": "sha1-jhSXHzoV0au+x6xhDvVMuInp/7Q=", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "caching-transform": "^1.0.0", + "convert-source-map": "^1.3.0", + "default-require-extensions": "^1.0.0", + "find-cache-dir": "^0.1.1", + "find-up": "^1.1.2", + "foreground-child": "^1.5.3", + "glob": "^7.0.3", + "istanbul-lib-coverage": "^1.0.0-alpha.4", + "istanbul-lib-hook": "^1.0.0-alpha.4", + "istanbul-lib-instrument": "^1.1.0-alpha.3", + "istanbul-lib-report": "^1.0.0-alpha.3", + "istanbul-lib-source-maps": "^1.0.0-alpha.10", + "istanbul-reports": "^1.0.0-alpha.8", + "md5-hex": "^1.2.0", + "micromatch": "^2.3.11", + "mkdirp": "^0.5.0", + "pkg-up": "^1.0.0", + "resolve-from": "^2.0.0", + "rimraf": "^2.5.4", + "signal-exit": "^3.0.0", + "spawn-wrap": "^1.2.4", + "test-exclude": "^1.1.0", + "yargs": "^4.8.1", + "yargs-parser": "^2.4.1" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "ansi-regex": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "0.3.0", + "bundled": true, + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "async": { + "version": "1.5.2", + "bundled": true, + "dev": true + }, + "babel-code-frame": { + "version": "6.11.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.0.0", + "chalk": "^1.1.0", + "esutils": "^2.0.2", + "js-tokens": "^2.0.0" + } + }, + "babel-generator": { + "version": "6.11.4", + "bundled": true, + "dev": true, + "requires": { + "babel-messages": "^6.8.0", + "babel-runtime": "^6.9.0", + "babel-types": "^6.10.2", + "detect-indent": "^3.0.1", + "lodash": "^4.2.0", + "source-map": "^0.5.0" + } + }, + "babel-messages": { + "version": "6.8.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.0.0" + } + }, + "babel-runtime": { + "version": "6.9.2", + "bundled": true, + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.9.5" + } + }, + "babel-template": { + "version": "6.9.0", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.9.0", + "babel-traverse": "^6.9.0", + "babel-types": "^6.9.0", + "babylon": "^6.7.0", + "lodash": "^4.2.0" + } + }, + "babel-traverse": { + "version": "6.11.4", + "bundled": true, + "dev": true, + "requires": { + "babel-code-frame": "^6.8.0", + "babel-messages": "^6.8.0", + "babel-runtime": "^6.9.0", + "babel-types": "^6.9.0", + "babylon": "^6.7.0", + "debug": "^2.2.0", + "globals": "^8.3.0", + "invariant": "^2.2.0", + "lodash": "^4.2.0" + } + }, + "babel-types": { + "version": "6.11.1", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.9.1", + "babel-traverse": "^6.9.0", + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^1.0.1" + } + }, + "babylon": { + "version": "6.8.4", + "bundled": true, + "dev": true, + "requires": { + "babel-runtime": "^6.0.0" + } + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.6", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "bundled": true, + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true, + "dev": true + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "md5-hex": "^1.2.0", + "mkdirp": "^0.5.1", + "write-file-atomic": "^1.1.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.3.0", + "bundled": true, + "dev": true + }, + "core-js": { + "version": "2.4.1", + "bundled": true, + "dev": true + }, + "cross-spawn": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "debug": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "^2.0.0" + } + }, + "detect-indent": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "get-stdin": "^4.0.1", + "minimist": "^1.1.0", + "repeating": "^1.1.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true + } + } + }, + "error-ex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true, + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "bundled": true, + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "filename-regex": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "for-in": { + "version": "0.1.5", + "bundled": true, + "dev": true + }, + "for-own": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "requires": { + "for-in": "^0.1.5" + } + }, + "foreground-child": { + "version": "1.5.3", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "bundled": true, + "dev": true + }, + "glob": { + "version": "7.0.5", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "bundled": true, + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "8.18.0", + "bundled": true, + "dev": true + }, + "graceful-fs": { + "version": "4.1.4", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.0.5", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "hosted-git-info": { + "version": "2.1.5", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "invariant": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-buffer": { + "version": "1.1.3", + "bundled": true, + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-dotfile": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-finite": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "isobject": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.0.0-alpha.4", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.0.0-alpha.4", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "^0.3.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.1.0-alpha.4", + "bundled": true, + "dev": true, + "requires": { + "babel-generator": "^6.11.3", + "babel-template": "^6.9.0", + "babel-traverse": "^6.9.0", + "babel-types": "^6.10.2", + "babylon": "^6.8.1", + "istanbul-lib-coverage": "^1.0.0-alpha.4" + } + }, + "istanbul-lib-report": { + "version": "1.0.0-alpha.3", + "bundled": true, + "dev": true, + "requires": { + "async": "^1.4.2", + "istanbul-lib-coverage": "^1.0.0-alpha", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "rimraf": "^2.4.3", + "supports-color": "^3.1.2" + }, + "dependencies": { + "supports-color": { + "version": "3.1.2", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.0.0-alpha.10", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.0.0-alpha.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.4.4", + "source-map": "^0.5.3" + } + }, + "istanbul-reports": { + "version": "1.0.0-alpha.8", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "js-tokens": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "kind-of": { + "version": "3.0.3", + "bundled": true, + "dev": true, + "requires": { + "is-buffer": "^1.0.2" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.13.1", + "bundled": true, + "dev": true + }, + "lodash.assign": { + "version": "4.0.9", + "bundled": true, + "dev": true, + "requires": { + "lodash.keys": "^4.0.0", + "lodash.rest": "^4.0.0" + } + }, + "lodash.keys": { + "version": "4.0.7", + "bundled": true, + "dev": true + }, + "lodash.rest": { + "version": "4.0.3", + "bundled": true, + "dev": true + }, + "longest": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "loose-envify": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "js-tokens": "^1.0.1" + }, + "dependencies": { + "js-tokens": { + "version": "1.0.3", + "bundled": true, + "dev": true + } + } + }, + "lru-cache": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true, + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "bundled": true, + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "minimatch": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.0.0" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "0.7.1", + "bundled": true, + "dev": true + }, + "normalize-package-data": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "number-is-nan": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "object.omit": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "for-own": "^0.1.3", + "is-extendable": "^0.1.1" + } + }, + "once": { + "version": "1.3.3", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "os-homedir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true, + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true, + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0" + } + }, + "pkg-up": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0" + } + }, + "preserve": { + "version": "0.2.0", + "bundled": true, + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "randomatic": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "requires": { + "is-number": "^2.0.2", + "kind-of": "^3.0.2" + } + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "regenerator-runtime": { + "version": "0.9.5", + "bundled": true, + "dev": true + }, + "regex-cache": { + "version": "0.4.3", + "bundled": true, + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3", + "is-primitive": "^2.0.0" + } + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true, + "dev": true + }, + "repeat-string": { + "version": "1.5.4", + "bundled": true, + "dev": true + }, + "repeating": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.5.4", + "bundled": true, + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "slide": { + "version": "1.1.6", + "bundled": true, + "dev": true + }, + "source-map": { + "version": "0.5.6", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "^1.3.3", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.3.3", + "signal-exit": "^2.0.0", + "which": "^1.2.4" + }, + "dependencies": { + "signal-exit": { + "version": "2.1.2", + "bundled": true, + "dev": true + } + } + }, + "spdx-correct": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "spdx-license-ids": "^1.0.2" + } + }, + "spdx-exceptions": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "^1.0.4", + "spdx-license-ids": "^1.0.0" + } + }, + "spdx-license-ids": { + "version": "1.2.1", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "supports-color": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "arrify": "^1.0.1", + "lodash.assign": "^4.0.9", + "micromatch": "^2.3.8", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + } + }, + "to-fast-properties": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uglify-js": { + "version": "2.7.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "async": "~0.2.6", + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "bundled": true, + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" + } + }, + "which": { + "version": "1.2.10", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^1.1.1" + } + }, + "which-module": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "4.8.1", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + }, + "dependencies": { + "cliui": { + "version": "3.2.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "window-size": { + "version": "0.2.0", + "bundled": true, + "dev": true + } + } + }, + "yargs-parser": { + "version": "2.4.1", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "bundled": true, + "dev": true + } + } + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "only-shallow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/only-shallow/-/only-shallow-1.2.0.tgz", + "integrity": "sha1-cc7O26kyS8BRiu8Q7AgNMkncJGU=", + "dev": true + }, + "opener": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", + "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", + "dev": true + }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "dev": true, + "requires": { + "wordwrap": "~0.0.2" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", + "dev": true + }, + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pretty-bytes": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-0.1.2.tgz", + "integrity": "sha1-zZApTVihyk6KXQ+5yCJZmIgazwA=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz", + "integrity": "sha1-wEJ//vUcEKy6B4KkbJYC50T/Ygs=", + "dev": true + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "recursive-readdir": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-0.0.2.tgz", + "integrity": "sha1-C8R9xIOOZG3M+6BQe15X/7/zX3w=", + "dev": true, + "optional": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~2.0.6", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "qs": "~6.3.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "~0.4.1", + "uuid": "^3.0.0" + } + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "rfile": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rfile/-/rfile-1.0.0.tgz", + "integrity": "sha1-WXCM+Qyh50xUw8/Fw2/bmBBDUmE=", + "dev": true, + "requires": { + "callsite": "~1.0.0", + "resolve": "~0.3.0" + }, + "dependencies": { + "resolve": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz", + "integrity": "sha1-NMY0R8ZkxwWY0cmxJvxDsqJDEKQ=", + "dev": true + } + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "ruglify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ruglify/-/ruglify-1.0.0.tgz", + "integrity": "sha1-3Ikw4qlUSidDAcyZcldMDQmGtnU=", + "dev": true, + "requires": { + "rfile": "~1.0", + "uglify-js": "~2.2" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "uglify-js": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz", + "integrity": "sha1-puAqcNg5eSuXgEiLe4sYTAlcmcc=", + "dev": true, + "requires": { + "optimist": "~0.3.5", + "source-map": "~0.1.7" + } + } + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "send": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.1.0.tgz", + "integrity": "sha1-z7COvTzsm3/Bo32f+eh1qXHPRkA=", + "dev": true, + "requires": { + "debug": "*", + "fresh": "0.1.0", + "mime": "1.2.6", + "range-parser": "0.0.4" + } + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=", + "dev": true + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" + } + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "stack-utils": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-0.4.0.tgz", + "integrity": "sha1-lAy4L8z6hOj/Lz/fKT/ngBa+zNE=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "dev": true, + "requires": { + "duplexer": "~0.1.1" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", + "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "stringstream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, + "tap": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/tap/-/tap-7.1.2.tgz", + "integrity": "sha1-36w+zxSshUe7rSW70Wzyw3Q/Zc8=", + "dev": true, + "requires": { + "bluebird": "^3.3.1", + "clean-yaml-object": "^0.1.0", + "color-support": "^1.1.0", + "coveralls": "^2.11.2", + "deeper": "^2.1.0", + "foreground-child": "^1.3.3", + "glob": "^7.0.0", + "isexe": "^1.0.0", + "js-yaml": "^3.3.1", + "nyc": "^7.1.0", + "only-shallow": "^1.0.2", + "opener": "^1.4.1", + "os-homedir": "1.0.1", + "readable-stream": "^2.0.2", + "signal-exit": "^3.0.0", + "stack-utils": "^0.4.0", + "tap-mocha-reporter": "^2.0.0", + "tap-parser": "^2.2.0", + "tmatch": "^2.0.1" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, + "tap-mocha-reporter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-2.0.1.tgz", + "integrity": "sha1-xwMWFz1uOhbFjhupLV1s2N5YoS4=", + "dev": true, + "requires": { + "color-support": "^1.1.0", + "debug": "^2.1.3", + "diff": "^1.3.2", + "escape-string-regexp": "^1.0.3", + "glob": "^7.0.5", + "js-yaml": "^3.3.1", + "readable-stream": "^2.1.5", + "tap-parser": "^2.0.0", + "unicode-length": "^1.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, + "tap-parser": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-2.2.3.tgz", + "integrity": "sha1-rebpbje/04zg8WLaBn80A08GiwE=", + "dev": true, + "requires": { + "events-to-array": "^1.0.1", + "js-yaml": "^3.2.7", + "readable-stream": "^2" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, + "tmatch": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/tmatch/-/tmatch-2.0.1.tgz", + "integrity": "sha1-DFYkbzPzDaG409colauvFmYPOM8=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dev": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uglify-js": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "dev": true, + "requires": { + "commander": "~2.20.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "undeclared-identifiers": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz", + "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "dash-ast": "^1.0.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "underscore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", + "dev": true + }, + "underscore.string": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", + "integrity": "sha1-18D6KvXVoaZ/QlPa7pgTLnM/Dxk=", + "dev": true + }, + "unicode-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", + "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", + "dev": true, + "requires": { + "punycode": "^1.3.2", + "strip-ansi": "^3.0.1" + } + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "watchify": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-0.10.2.tgz", + "integrity": "sha1-Y8nwtaaK1zNlx0OIDBkWNhDY6sM=", + "dev": true, + "requires": { + "browserify": "4.x", + "chokidar": "^0.8.1", + "optimist": "~0.5.0", + "shallow-copy": "0.0.1", + "through": "~2.3.4" + }, + "dependencies": { + "JSONStream": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", + "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "assert": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.1.2.tgz", + "integrity": "sha1-raoExGu1jG3R8pTaPrJuYijrbkQ=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "base64-js": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.7.tgz", + "integrity": "sha1-VEANyR1pbOwyqKR5AvlxUi/uj0g=", + "dev": true + }, + "browser-pack": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-2.0.1.tgz", + "integrity": "sha1-XRxSf1bFgmd0EcTbKhKGSP9r8VA=", + "dev": true, + "requires": { + "JSONStream": "~0.6.4", + "combine-source-map": "~0.3.0", + "through": "~2.3.4" + }, + "dependencies": { + "JSONStream": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.6.4.tgz", + "integrity": "sha1-SyyAY/j1Enh7I3X37p22kgj6Lcs=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + } + } + }, + "browserify": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-4.2.3.tgz", + "integrity": "sha1-Dg2PmObfamZKosBVEg84SCRu5NA=", + "dev": true, + "requires": { + "JSONStream": "~0.8.3", + "assert": "~1.1.0", + "browser-pack": "~2.0.0", + "browser-resolve": "^1.3.0", + "browserify-zlib": "~0.1.2", + "buffer": "^2.3.0", + "builtins": "~0.0.3", + "commondir": "0.0.1", + "concat-stream": "~1.4.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~0.0.1", + "crypto-browserify": "^2.1.8", + "deep-equal": "~0.2.1", + "defined": "~0.0.0", + "deps-sort": "~0.1.1", + "derequire": "~0.8.0", + "domain-browser": "~1.1.0", + "duplexer": "~0.1.1", + "events": "~1.0.0", + "glob": "~3.2.8", + "http-browserify": "^1.4.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "~6.0.0", + "module-deps": "~2.1.1", + "os-browserify": "~0.1.1", + "parents": "~0.0.1", + "path-browserify": "~0.0.0", + "process": "^0.7.0", + "punycode": "~1.2.3", + "querystring-es3": "~0.2.0", + "readable-stream": "^1.0.27-1", + "resolve": "~0.7.1", + "shallow-copy": "0.0.1", + "shell-quote": "~0.0.1", + "stream-browserify": "^1.0.0", + "stream-combiner": "~0.0.2", + "string_decoder": "~0.0.0", + "subarg": "0.0.1", + "syntax-error": "^1.1.1", + "through2": "^1.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "umd": "~2.1.0", + "url": "~0.10.1", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^3.0.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "~0.2.0" + } + }, + "buffer": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-2.8.2.tgz", + "integrity": "sha1-1zwhTAM0OE3CmwTuD/X1Unx5dOc=", + "dev": true, + "requires": { + "base64-js": "0.0.7", + "ieee754": "^1.1.4", + "is-array": "^1.0.1" + } + }, + "combine-source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.3.0.tgz", + "integrity": "sha1-2edPWT2c1DgHMSy12EbUUe+qnrc=", + "dev": true, + "requires": { + "convert-source-map": "~0.3.0", + "inline-source-map": "~0.3.0", + "source-map": "~0.1.31" + } + }, + "concat-stream": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.11.tgz", + "integrity": "sha512-X3JMh8+4je3U1cQpG87+f9lXHDrqcb2MVLg9L7o8b1UZ0DzhRrUpdn65ttzu10PpJPPI3MQNkis+oha6TSA9Mw==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "~1.1.9", + "typedarray": "~0.0.5" + } + }, + "constants-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz", + "integrity": "sha1-kld9tSe6bEzwpFaNhLwDH0QeIfI=", + "dev": true + }, + "convert-source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", + "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=", + "dev": true + }, + "crypto-browserify": { + "version": "2.1.10", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-2.1.10.tgz", + "integrity": "sha1-TyymMRhDzwh83wCOQ6TzaG725rs=", + "dev": true, + "requires": { + "ripemd160": "0.2.0", + "sha.js": "2.1.6" + } + }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", + "dev": true + }, + "deps-sort": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-0.1.2.tgz", + "integrity": "sha1-2qL7YUoXyWN9gB4vVTOa43DzYRo=", + "dev": true, + "requires": { + "JSONStream": "~0.6.4", + "minimist": "~0.0.1", + "through": "~2.3.4" + }, + "dependencies": { + "JSONStream": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.6.4.tgz", + "integrity": "sha1-SyyAY/j1Enh7I3X37p22kgj6Lcs=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + } + } + }, + "detective": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-3.1.0.tgz", + "integrity": "sha1-d3gkRKt1K4jKG+Lp0KA5Xx2iXu0=", + "dev": true, + "requires": { + "escodegen": "~1.1.0", + "esprima-fb": "3001.1.0-dev-harmony-fb" + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "~1.1.9" + } + }, + "esprima-fb": { + "version": "3001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz", + "integrity": "sha1-t303q8046gt3Qmu4vCkizmtCZBE=", + "dev": true + }, + "events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/events/-/events-1.0.2.tgz", + "integrity": "sha1-dYSdz+k9EPsFfDAFWv29UdBqjiQ=", + "dev": true + }, + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "requires": { + "inherits": "2", + "minimatch": "0.3" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "inline-source-map": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.3.1.tgz", + "integrity": "sha1-pSi1FOaJ/OkNswiehw2S9Sestes=", + "dev": true, + "requires": { + "source-map": "~0.3.0" + }, + "dependencies": { + "source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.3.0.tgz", + "integrity": "sha1-hYb7mloAXltQHiHNGLbyG0V60fk=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "insert-module-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-6.0.0.tgz", + "integrity": "sha1-7orrne4WgZ4zqhRYilWIJK8MFdw=", + "dev": true, + "requires": { + "JSONStream": "~0.7.1", + "concat-stream": "~1.4.1", + "lexical-scope": "~1.1.0", + "process": "~0.6.0", + "through": "~2.3.4", + "xtend": "^3.0.0" + }, + "dependencies": { + "JSONStream": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.7.4.tgz", + "integrity": "sha1-c0KQ5BUR7qfCz+FR+/mlY6l7l4Y=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "process": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/process/-/process-0.6.0.tgz", + "integrity": "sha1-fdm+gP+q7dTLYo8YJ/HLq23AkY8=", + "dev": true + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "jsonparse": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz", + "integrity": "sha1-MwVCrT8KZUZlt3jz6y2an6UHrGQ=", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "module-deps": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-2.1.5.tgz", + "integrity": "sha1-N1qbyATM1kzrs8Yu5kN1Xws8zyk=", + "dev": true, + "requires": { + "JSONStream": "~0.7.1", + "browser-resolve": "~1.2.4", + "concat-stream": "~1.4.5", + "detective": "~3.1.0", + "duplexer2": "0.0.2", + "inherits": "~2.0.1", + "minimist": "~0.0.9", + "parents": "0.0.2", + "readable-stream": "^1.0.27-1", + "resolve": "~0.6.3", + "stream-combiner": "~0.1.0", + "subarg": "0.0.1", + "through2": "~0.4.1" + }, + "dependencies": { + "JSONStream": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.7.4.tgz", + "integrity": "sha1-c0KQ5BUR7qfCz+FR+/mlY6l7l4Y=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": ">=2.2.7 <3" + } + }, + "browser-resolve": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.2.4.tgz", + "integrity": "sha1-Wa54IKgpVezTL1+3xGisIcRyOAY=", + "dev": true, + "requires": { + "resolve": "0.6.3" + } + }, + "parents": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/parents/-/parents-0.0.2.tgz", + "integrity": "sha1-ZxR4JuSX1AdZqvW6TJllm2A00wI=", + "dev": true + }, + "resolve": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", + "integrity": "sha1-3ZV5gufnNt699TtYpN2RdUV13UY=", + "dev": true + }, + "stream-combiner": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.1.0.tgz", + "integrity": "sha1-DcOJo8ID+PTVY2j5Xd5S65Jptb4=", + "dev": true, + "requires": { + "duplexer": "~0.1.1", + "through": "~2.3.4" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", + "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", + "dev": true, + "requires": { + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "optimist": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.5.2.tgz", + "integrity": "sha1-hcjBRUszFeSniUfoV7HfAzRQv7w=", + "dev": true, + "requires": { + "wordwrap": "~0.0.2" + } + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parents/-/parents-0.0.3.tgz", + "integrity": "sha1-+iEvAk2fpjGNu2tM5nbIvkk7nEM=", + "dev": true, + "requires": { + "path-platform": "^0.0.1" + } + }, + "path-platform": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.0.1.tgz", + "integrity": "sha1-tVhdfDxGPYmqAGDYZhHPGv1hfio=", + "dev": true + }, + "process": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/process/-/process-0.7.0.tgz", + "integrity": "sha1-xSIIFho0rfOBI0SuhdPmFQRpOJ0=", + "dev": true + }, + "punycode": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.2.4.tgz", + "integrity": "sha1-VACKyXKux0F13vnLpt9/qdORh0A=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + }, + "dependencies": { + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "resolve": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.7.4.tgz", + "integrity": "sha1-OVqe+ehz+/4SvRRAi9kbuTYAPWk=", + "dev": true + }, + "ripemd160": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", + "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", + "dev": true + }, + "sha.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.1.6.tgz", + "integrity": "sha1-IObrgfPmbwgd34TdjwRkvqbAL9Q=", + "dev": true, + "requires": { + "buffer": "~2.3.2" + }, + "dependencies": { + "buffer": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-2.3.4.tgz", + "integrity": "sha1-fkr1ojwV4T/L/VxaHsl0y2Fmikw=", + "dev": true, + "requires": { + "base64-js": "~0.0.4", + "ieee754": "~1.1.1" + } + } + } + }, + "shell-quote": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-0.0.1.tgz", + "integrity": "sha1-GkEZbzwDM8SCMjWT1ohuzxU92YY=", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "stream-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz", + "integrity": "sha1-v5tKv7QrJ011FHnkTg/yZWtvEZM=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^1.0.27-1" + } + }, + "string_decoder": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.0.1.tgz", + "integrity": "sha1-9UctCo0WUOyCN1LSTm/WJ7Ob8UE=", + "dev": true + }, + "subarg": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-0.0.1.tgz", + "integrity": "sha1-PVawfaz7xFu7Y/dnK0O2PkY2jjo=", + "dev": true, + "requires": { + "minimist": "~0.0.7" + } + }, + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "dev": true, + "requires": { + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, + "uglify-js": { + "version": "2.4.24", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", + "integrity": "sha1-+tV1XB4Vd2WLsG/5q25UjJW+vW4=", + "dev": true, + "requires": { + "async": "~0.2.6", + "source-map": "0.1.34", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.5.4" + }, + "dependencies": { + "source-map": { + "version": "0.1.34", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", + "integrity": "sha1-p8/omux7FoLDsZjQrPtH19CQVms=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "umd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/umd/-/umd-2.1.0.tgz", + "integrity": "sha1-SmMHt2LxfwLSAbX6FU5nM5bCY88=", + "dev": true, + "requires": { + "rfile": "~1.0.0", + "ruglify": "~1.0.0", + "through": "~2.3.4", + "uglify-js": "~2.4.0" + } + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", + "dev": true + } + } + }, + "which": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=", + "dev": true + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.5.4.tgz", + "integrity": "sha1-2K/49mXpTDS9JZvevRv68N3TU2E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "decamelize": "^1.0.0", + "window-size": "0.1.0", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "yui": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/yui/-/yui-3.14.1.tgz", + "integrity": "sha1-h+wcINkcEvV5/2T2OO65GQASkYM=", + "dev": true, + "requires": { + "request": "~2.21.0" + }, + "dependencies": { + "asn1": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", + "dev": true + }, + "assert-plus": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz", + "integrity": "sha1-2T/9u2esVQd3m+MWp9ZRRkF77vg=", + "dev": true + }, + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "boom": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", + "dev": true, + "requires": { + "hoek": "0.9.x" + }, + "dependencies": { + "hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", + "dev": true + } + } + }, + "combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "dev": true, + "requires": { + "delayed-stream": "0.0.5" + } + }, + "cryptiles": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "dev": true, + "requires": { + "boom": "0.4.x" + } + }, + "delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", + "dev": true + }, + "forever-agent": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "integrity": "sha1-bQ4JxJIflKJ/Y9O0nF/v8epMUTA=", + "dev": true + }, + "form-data": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.0.8.tgz", + "integrity": "sha1-CJDNEAXFzOzAudJKiAUskkQtDbU=", + "dev": true, + "requires": { + "async": "~0.2.7", + "combined-stream": "~0.0.4", + "mime": "~1.2.2" + } + }, + "hawk": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-0.13.1.tgz", + "integrity": "sha1-NheViCH1gxHk1/beKR/KZitBLvQ=", + "dev": true, + "requires": { + "boom": "0.4.x", + "cryptiles": "0.2.x", + "hoek": "0.8.x", + "sntp": "0.2.x" + } + }, + "hoek": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.8.5.tgz", + "integrity": "sha1-Hp/XcO9+vgJ0rfy1sIBqAlpeTp8=", + "dev": true + }, + "http-signature": { + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.9.11.tgz", + "integrity": "sha1-nognFFcjFeZ5Cl0KeVXv/x8Z5lM=", + "dev": true, + "requires": { + "asn1": "0.1.11", + "assert-plus": "0.1.2", + "ctype": "0.5.2" + } + }, + "json-stringify-safe": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-4.0.0.tgz", + "integrity": "sha1-d8JxqupUMC5o7+rMtWq78GqbGlQ=", + "dev": true + }, + "mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "dev": true + }, + "node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", + "dev": true + }, + "oauth-sign": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz", + "integrity": "sha1-y1QPk7srIqfVlBaRoojWDo6pOG4=", + "dev": true + }, + "qs": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "integrity": "sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc=", + "dev": true + }, + "request": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.21.0.tgz", + "integrity": "sha1-VyirnEXlqHyZ2szVMCmLZnOoaNc=", + "dev": true, + "requires": { + "aws-sign": "~0.3.0", + "cookie-jar": "~0.3.0", + "forever-agent": "~0.5.0", + "form-data": "0.0.8", + "hawk": "~0.13.0", + "http-signature": "~0.9.11", + "json-stringify-safe": "~4.0.0", + "mime": "~1.2.9", + "node-uuid": "~1.4.0", + "oauth-sign": "~0.3.0", + "qs": "~0.6.0", + "tunnel-agent": "~0.3.0" + } + }, + "sntp": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "dev": true, + "requires": { + "hoek": "0.9.x" + }, + "dependencies": { + "hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", + "dev": true + } + } + }, + "tunnel-agent": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz", + "integrity": "sha1-rWgbaPUyGtKCfEz7G31d8s/pQu4=", + "dev": true + } + } + }, + "yuidocjs": { + "version": "0.3.50", + "resolved": "https://registry.npmjs.org/yuidocjs/-/yuidocjs-0.3.50.tgz", + "integrity": "sha1-kGCl92Wog7EAtWPsatEFxdUzacE=", + "dev": true, + "requires": { + "express": "~3.1.2", + "graceful-fs": "2.x", + "marked": "~0.2.8", + "minimatch": "~0.2.11", + "rimraf": "2.x", + "yui": "3.14.1" + }, + "dependencies": { + "graceful-fs": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "integrity": "sha1-fNLNsiiko/Nule+mzBQt59GhNtA=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + } + } +} diff --git a/src/objects/Body.js b/src/objects/Body.js index 671905db3..874e601a4 100644 --- a/src/objects/Body.js +++ b/src/objects/Body.js @@ -368,7 +368,17 @@ function Body(options){ * @property boundingRadius * @type {Number} */ - this.boundingRadius = 0; + this.boundingRadius = 0; + + /** + * Determines if bodies do interact. "collide" event is still triggered. + * @property sensor + * @type {Boolean} + */ + this.sensor = false; + if (options.sensor) { + this.sensor = options.sensor; + } this.wlambda = new Vec3(); diff --git a/src/solver/Solver.js b/src/solver/Solver.js index 38c6d2a4a..1b0ca7c14 100644 --- a/src/solver/Solver.js +++ b/src/solver/Solver.js @@ -32,7 +32,9 @@ Solver.prototype.solve = function(dt,world){ */ Solver.prototype.addEquation = function(eq){ if (eq.enabled) { - this.equations.push(eq); + if (!(eq.bi.sensor || eq.bj.sensor)) { + this.equations.push(eq); + } } };