{"version":3,"sources":["webpack:///../node_modules/physicsjs/dist/physicsjs-full.js"],"names":["root","window","this","module","exports","Transform","getNextSearchDir","document","Physics","world","apply","arguments","util","aabb","minX","minY","maxX","maxY","x","y","hw","hh","undefined","Math","abs","contains","pt","clone","union","aabb1","aabb2","modify","ret","max","min","overlap","min1","min2","max1","max2","ptA","ptB","dir","ABdotB","normSq","dot","ABdotA","negate","vsub","perp","cross","gjk","support","seed","checkOverlapOnly","debugFn","ab","ac","sign","tmp","noOverlap","distance","simplex","simplexLen","scratch","scratchpad","vector","axis","last","lastlast","v1","v2","iterations","push","swap","equals","zero","normalize","shift","splice","done","maxIterationsReached","closest","lambdaB","lambdaA","len","length","prev","A","L","a","b","mult","vadd","values","getClosestPoints","statistics","pushRunningAvg","v","k","m","s","pushRunningVectorAvg","invK","get","add","vect","angle","origin","o","setTranslation","setRotation","prototype","cosA","cos","sinA","sin","t","transform","sqrt","atan2","acos","TWOPI","PI","typedArrays","Float64Array","Vector","_","recalc","set","Object","defineProperties","n","sub","proj","norm","vproj","ang","NaN","angle2","left","right","x1","y1","x2","y2","dist","dx","dy","distSq","ccw","transformInv","rotate","rotateInv","translate","translateInv","component","clamp","minV","maxV","toString","_Physics","noConflict","Decorator","decorator","type","baseProto","registry","proto","extend","to","from","desc","key","getOwnPropertyDescriptor","defineProperty","isFunction","value","getProto","getPrototypeOf","__proto__","object","constructor","objectCreate","create","F","mixin","val","factory","name","parentName","cfg","result","parent","opts","init","indexOf","arr","fr","bk","clearArray","l","pop","throttle","fn","delay","scope","args","call","cb","clearTimeout","setTimeout","defaults","fnTrue","wrapRule","$eq","$in","$and","operations","Scratch","Scratchpad","scratches","numScratches","regIndex","deepCopyFn","isPlainObject","options","def","target","_def","callbacks","deep","i","onChange","pairHash","id1","id2","Function","bind","Array","slice","concat","find","collection","filter","matches","objectTypes","identity","objectClass","nativeKeys","keys","hasOwnProperty","largeArraySize","arrayPool","objectPool","maxPoolSize","keyPrefix","Date","releaseArray","array","getObject","cacheIndexOf","cache","cachePush","typeCache","isObject","index","iterable","idCounter","uniqueId","prefix","shuffle","rand","floor","random","isArray","reNative","RegExp","String","replace","shimIsPlainObject","ctor","baseUniq","isSorted","callback","isLarge","seen","first","mid","createCache","computed","releaseObject","criteria","number","string","valueOf","objProto","test","isNative","uniq","source","guard","argsIndex","argsLength","ownIndex","ownProps","sortedIndex","low","high","_active","_indexArr","maxScratches","maxIndex","join","handle","register","idx","stackname","useFactory","stack","stackIndex","getPriority","_priority_","PubSub","on","topic","priority","listeners","orig","_topics","_bindfn_","_one_","_scope_","off","listn","emit","data","handler","e","event","one","pubsub","active","ps","perf","performance","now","timing","navigationStart","requestAnimationFrame","step","time","ticker","start","stop","listener","isActive","prop","thing","next","toMatch","$ne","$nin","$at","point","body","query","Query","rules","$op","op","rule","list","$or","behavior","applyTo","_targets","getTargets","_world","_bodies","setWorld","disconnect","connect","behave","hidden","treatment","mass","restitution","cof","view","uidGen","self","offset","state","pos","vel","vx","vy","acc","angular","angularVelocity","old","_sleepAngPosMean","_sleepAngPosVariance","_sleepPosMean","_sleepPosVariance","_sleepMeanK","uid","geometry","sleep","dt","asleep","sleepIdleTime","sleepCheck","sleepDisabled","limit","r","kfac","stats","sleepSpeedLimit","asin","sleepVarianceLimit","sleepTimeLimit","accelerate","applyForce","force","p","moi","getGlobalOffset","out","toBodyCoords","toWorldCoords","getCOM","bodies","com","M","_aabb","getFarthestHullPoint","getFarthestCorePoint","margin","regularPolygonVertices","sides","radius","verts","isPolygonConvex","hull","getPolygonMOI","num","denom","isPointInPolygon","getPolygonArea","getPolygonCentroid","nearestPointOnLine","linePt1","linePt2","drag","integrator","integrate","integrateVelocities","integratePositions","meta","metaRefresh","width","height","autoResize","renderer","el","getElementById","container","parentNode","drawMeta","addEventListener","resize","offsetWidth","offsetHeight","render","beforeRender","_interpolateTime","interpolateTime","createView","styles","drawBody","execCallbacks","fns","then","timestep","maxIPF","webworker","World","_meta","fps","ipf","_behaviors","_integrator","_renderer","_paused","_warp","_time","arg","addBehavior","addBody","remove","removeBehavior","removeBody","has","_dt","toPrecision","_maxJump","wakeUpAll","getBehaviors","behaviors","getBodies","findOne","iterate","animDiff","worldDiff","warp","invWarp","animDt","animMaxJump","_animTime","_lastTime","toFixed","pause","unpause","isPaused","destroy","started","_started","dtdt","dtMul","prevDt","dtcorr","children","addChild","g","clear","ch","maxlen","setVertices","vertices","transl","_area","trans","xaxis","yaxis","xmax","xmin","ymax","ymin","mag","addChildren","refreshGeometry","w","h","strength","order","_pos","_maxDist","Infinity","_minDist","position","minDist","maxDist","j","pow","supportFnStack","checkGJK","bodyA","bodyB","inc","d","os","collision","aabbA","dimA","aabbB","dimB","hash","searchDir","tA","tB","vA","tmpv1","vB","tmpv2","useCore","marginA","marginB","getSupportFn","mtv","checkPair","checkCircles","cols","compound","other","oldPos","otherAABB","c","ll","check","channel","checkAll","pair","candidates","targets","collisions","prevContacts","contactList","collidedPreviously","mtvThreshold","bodyExtractDropoff","forceWakeupAboveOverlapThreshold","getUid","clampMTV","totalV","into","_bodyList","respond","collideBodies","normal","mtrans","contact","fixedA","fixedB","impulse","invMoiA","invMoiB","invMassA","invMassB","cor","rA","rB","angVelA","angVelB","vAB","rAproj","rAreg","rBproj","rBreg","vreg","_mtvTotal","ratio","_pushUniq","col","_oldmtvTotal","_acc","setAcceleration","checkEdgeCollide","bounds","dummy","checkGeneral","setAABB","_edges","moveThrottle","minVel","maxVel","getElementOffset","curleft","curtop","offsetParent","offsetLeft","offsetTop","top","bodyData","bodyDataByUID","grab","touchId","touch","touchIndex","changedTouches","identifier","pointerId","pageX","pageY","isGrabbed","move","release","PointerEvent","removeEventListener","_maxDistSq","_minDistSq","calcPotential","posA","posB","normsq","minDistSq","maxDistSq","comp","lll","potential","dof","encounters","tracked","pairs","intervalLists","xyz","trackBody","untrackBody","sweep","broadPhase","updateIntervals","sortIntervalLists","checkOverlaps","hole","bound","boundVal","leftVal","getPair","tr1","tr2","doCreate","id","flag","isX","collisionFlag","z","enclen","tracker","tr","intr","interval","minmax","count","trackedList","_distanceConstraints","_angleConstraints","intg","resolve","drop","distanceConstraint","stiffness","targetLength","cst","targetLengthSq","angleConstraint","bodyC","targetAngle","cstrOrId","constraints","isObj","substr","resolveAngleConstraints","coef","con","corr","invMassSum","resolveDistanceConstraints","proportion","BA","shuffleConstraints","its","getConstraints","distanceConstraints","angleConstraints","halfdtdt","Pi2","newEl","node","content","createElement","innerHTML","colors","metaEl","strokeStyle","lineWidth","fillStyle","angleIndicator","hiddenCanvas","getContext","hiddenCtx","viewport","nodeName","toUpperCase","appendChild","ctx","els","className","insertBefore","_layers","addLayer","layer","manual","follow","scale","zIndex","style","reset","addToStack","removeFromStack","clearRect","save","restore","removeLayer","idOrLayer","removeChild","setStyle","drawCircle","beginPath","arc","closePath","stroke","fill","drawPolygon","vert","moveTo","lineTo","drawRect","rect","drawLine","draw","circle","src","Image","toDataURL","drawImage","thePrefix","tmpdiv","pfx","arrayOfPrefixes","match","px","cssTransform","borderRadius","overflow","pointProperties","marginLeft","marginTop","circleProperties","rectangleProperties","chel","attach","detach","nodeType","par","fontStyles","font","align","fillAlpha","strokeAlpha","alpha","isTransparent","PIXI","color","stage","Stage","autoDetectRenderer","transparent","resolution","devicePixelRatio","Graphics","loadSpriteSheets","assetsToLoad","loader","AssetLoader","load","evt","assetsLoaded","pivot","rotation","setStyles","graphics","beginFill","lineStyle","createCircle","endFill","createRect","createPolygon","createLine","Sprite","fromImage","anchor","chview","cacheAsBitmap","loaded","setText","Text","createDisplay","texture","Texture","tex","frames","fromFrame","MovieClip","centerAnchor"],"mappings":";0FAYC,IAAUA,IAWS,oBAAXC,OAAyBA,OAASC,KARnCC,EAAOC,QAQkC,WAEjD,aAEA,IA4nBQC,EAnaAC,EAzNJL,EAASC,KACTK,EAAWN,EAAOM,SAoBlBC,EAAU,SAASA,IAEnB,OAAOA,EAAQC,MAAMC,MAAMF,EAASG,YAQxCH,EAAQI,KAAO,GAyCXJ,EAAQK,KAAO,SAAUC,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y-to-use physics engine for javascript\n * http://wellcaffeinated.net/PhysicsJS\n *\n * Copyright (c) 2014 Jasper Palfree \n * Licensed MIT\n */\n\n// ---\n// inside: src/intro.js\n\n(function (root, factory) {\n if (typeof exports === 'object') {\n // Node.\n module.exports = factory.call(root);\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(function(){ return factory.call(root) });\n } else {\n // Browser globals (root is window)\n root.Physics = factory.call(root);\n }\n}(typeof window !== 'undefined' ? window : this, function () {\n\n'use strict';\n\nvar window = this;\nvar document = window.document;\n\n/** related to: Physics.world\n * Physics\n *\n * The top-level namespace. All of PhysicsJS is contained in\n * the `Physics` namespace.\n *\n * It may (and should) be invoked as a function to create a world instance. For all intensive purposes, [[Physics]] and [[Physics.world]] are the same thing.\n *\n * See [[new Physics.world]] for config options and function signature.\n *\n * Example:\n *\n * ```javascript\n * Physics( cfg, function( world ) {\n * // use world\n * }); // -> world\n * ```\n **/\nvar Physics = function Physics(){\n\n return Physics.world.apply(Physics, arguments);\n};\n\n/**\n * Physics.util\n *\n * Namespace for utility functions.\n **/\nPhysics.util = {};\n\n/**\n * == Special ==\n *\n * This section contains miscellaneous functionality.\n **/\n\n\n// ---\n// inside: src/math/aabb.js\n\n(function(){\n\n /**\n * Physics.aabb( minX, minY, maxX, maxY ) -> Object\n * Physics.aabb( pt1, pt2 ) -> Object\n * Physics.aabb( width, height[, pt] ) -> Object\n * - minX (Number): The x coord of the \"top left\" point\n * - minY (Number): The y coord of the \"top left\" point\n * - maxX (Number): The x coord of the \"bottom right\" point\n * - maxY (Number): The y coord of the \"bottom right\" point\n * - pt1 (Vectorish): The first corner\n * - pt2 (Vectorish): The opposite corner\n * - width (Number): The width of the bounding box\n * - height (Number): The height of the bounding box\n * - pt (Vectorish): The center point of the bounding box\n *\n * Create an Axis Aligned Bounding Box.\n *\n * Signature:\n *\n * ```javascript\n * {\n * x: Number, // the x coord of the center point\n * y: Number, // the y coord of the center point\n * hw: Number, // the half-width\n * hh: Number, // the half-height\n * }\n * ```\n **/\n Physics.aabb = function( minX, minY, maxX, maxY ){\n\n var aabb = { x: 0, y: 0, hw: 0, hh: 0 };\n\n if ( minX === undefined ){\n return aabb;\n }\n\n if ( minX && minX.x !== undefined ){\n // we have a point specified as first arg\n maxX = minY.x;\n maxY = minY.y;\n minY = minX.y;\n minX = minX.x;\n }\n\n if ( maxY === undefined && minX !== undefined && minY !== undefined ){\n\n aabb.hw = minX * 0.5;\n aabb.hh = minY * 0.5;\n\n if ( maxX && maxX.x !== undefined ){\n // we have a point specified as the third arg\n // so we assume it's the center point\n aabb.x = maxX.x;\n aabb.y = maxX.y;\n }\n\n return aabb;\n }\n\n // here, we should have all the arguments as numbers\n aabb.hw = Math.abs(maxX - minX) * 0.5;\n aabb.hh = Math.abs(maxY - minY) * 0.5;\n aabb.x = (maxX + minX) * 0.5;\n aabb.y = (maxY + minY) * 0.5;\n\n return aabb;\n };\n\n /**\n * Physics.aabb.contains( aabb, pt ) -> Boolean\n * - aabb (Object): The aabb\n * - pt (Vectorish): The point\n * + (Boolean): `true` if `pt` is inside `aabb`, `false` otherwise\n *\n * Check if a point is inside an aabb.\n **/\n Physics.aabb.contains = function contains( aabb, pt ){\n\n return (pt.x > (aabb.x - aabb.hw)) &&\n (pt.x < (aabb.x + aabb.hw)) &&\n (pt.y > (aabb.y - aabb.hh)) &&\n (pt.y < (aabb.y + aabb.hh));\n };\n\n /**\n * Physics.aabb.clone( aabb ) -> Object\n * - aabb (Object): The aabb to clone\n * + (Object): The clone\n *\n * Clone an aabb.\n **/\n Physics.aabb.clone = function( aabb ){\n return {\n x: aabb.x,\n y: aabb.y,\n hw: aabb.hw,\n hh: aabb.hh\n };\n };\n\n /**\n * Physics.aabb.union( aabb1, aabb2[, modify] ) -> Object\n * - aabb1 (Object): The first aabb (returned if modify is `true`)\n * - aabb2 (Object): The second aabb\n * + (Object): The union of two aabbs. If modify is `true`, then the first aabb will be modified and returned.\n *\n * Get the union of two aabbs.\n **/\n Physics.aabb.union = function( aabb1, aabb2, modify ){\n\n var ret = modify === true ? aabb1 : {}\n ,maxX = Math.max( aabb1.x + aabb1.hw, aabb2.x + aabb2.hw )\n ,maxY = Math.max( aabb1.y + aabb1.hh, aabb2.y + aabb2.hh )\n ,minX = Math.min( aabb1.x - aabb1.hw, aabb2.x - aabb2.hw )\n ,minY = Math.min( aabb1.y - aabb1.hh, aabb2.y - aabb2.hh )\n ;\n\n ret.hw = Math.abs(maxX - minX) * 0.5;\n ret.hh = Math.abs(maxY - minY) * 0.5;\n ret.x = (maxX + minX) * 0.5;\n ret.y = (maxY + minY) * 0.5;\n\n return ret;\n };\n\n\n /**\n * Physics.aabb.overlap( aabb1, aabb2 ) -> Boolean\n * - aabb1 (Object): The first aabb\n * - aabb2 (Object): The second aabb\n * + (Boolean): `true` if they overlap, `false` otherwise\n *\n * Check if two AABBs overlap.\n **/\n Physics.aabb.overlap = function( aabb1, aabb2 ){\n\n var min1 = aabb1.x - aabb1.hw\n ,min2 = aabb2.x - aabb2.hw\n ,max1 = aabb1.x + aabb1.hw\n ,max2 = aabb2.x + aabb2.hw\n ;\n\n // first check x-axis\n\n if ( (min2 <= max1 && max1 <= max2) || (min1 <= max2 && max2 <= max1) ){\n // overlap in x-axis\n // check y...\n min1 = aabb1.y - aabb1.hh;\n min2 = aabb2.y - aabb2.hh;\n max1 = aabb1.y + aabb1.hh;\n max2 = aabb2.y + aabb2.hh;\n\n return (min2 <= max1 && max1 <= max2) || (min1 <= max2 && max2 <= max1);\n }\n\n // they don't overlap\n return false;\n };\n\n}());\n\n\n// ---\n// inside: src/math/gjk.js\n\n(function(){\n\n // the algorithm doesn't always converge for curved shapes.\n // need these constants to dictate how accurate we want to be.\n var gjkAccuracy = 0.0001;\n var gjkMaxIterations = 100;\n\n // get the next search direction from two simplex points\n var getNextSearchDir = function getNextSearchDir( ptA, ptB, dir ){\n\n var ABdotB = ptB.normSq() - ptB.dot( ptA )\n ,ABdotA = ptB.dot( ptA ) - ptA.normSq()\n ;\n\n // if the origin is farther than either of these points\n // get the direction from one of those points to the origin\n if ( ABdotB < 0 ){\n\n return dir.clone( ptB ).negate();\n\n } else if ( ABdotA > 0 ){\n\n return dir.clone( ptA ).negate();\n\n // otherwise, use the perpendicular direction from the simplex\n } else {\n\n // dir = AB = B - A\n dir.clone( ptB ).vsub( ptA );\n // if (left handed coordinate system)\n // A cross AB < 0 then get perpendicular counterclockwise\n return dir.perp( (ptA.cross( dir ) > 0) );\n }\n };\n\n /** hide\n * getClosestPoints( simplex ) -> Object\n * - simplex (Array): The simplex\n *\n * Figure out the closest points on the original objects\n * from the last two entries of the simplex\n **/\n var getClosestPoints = function getClosestPoints( simplex ){\n\n // see http://www.codezealot.org/archives/153\n // for algorithm details\n\n // we know that the position of the last point\n // is very close to the previous. (by nature of the distance test)\n // this won't give great results for the closest\n // points algorithm, so let's use the previous two\n var len = simplex.length\n ,last = simplex[ len - 2 ]\n ,prev = simplex[ len - 3 ]\n ,scratch = Physics.scratchpad()\n ,A = scratch.vector().clone( last.pt )\n // L = B - A\n ,L = scratch.vector().clone( prev.pt ).vsub( A )\n ,lambdaB\n ,lambdaA\n ;\n\n if ( L.equals(Physics.vector.zero) ){\n\n // oh.. it's a zero vector. So A and B are both the closest.\n // just use one of them\n return scratch.done({\n\n a: last.a,\n b: last.b\n });\n }\n\n lambdaB = - L.dot( A ) / L.normSq();\n lambdaA = 1 - lambdaB;\n\n if ( lambdaA <= 0 ){\n // woops.. that means the closest simplex point\n // isn't on the line it's point B itself\n return scratch.done({\n a: prev.a,\n b: prev.b\n });\n } else if ( lambdaB <= 0 ){\n // vice versa\n return scratch.done({\n a: last.a,\n b: last.b\n });\n }\n\n // guess we'd better do the math now...\n return scratch.done({\n // a closest = lambdaA * Aa + lambdaB * Ba\n a: A.clone( last.a ).mult( lambdaA ).vadd( L.clone( prev.a ).mult( lambdaB ) ).values(),\n // b closest = lambdaA * Ab + lambdaB * Bb\n b: A.clone( last.b ).mult( lambdaA ).vadd( L.clone( prev.b ).mult( lambdaB ) ).values()\n });\n };\n\n /**\n * Physics.gjk( support(axis)[, seed, checkOverlapOnly, debugFn] ) -> Object\n * - support (Function): The support function. Must return an object containing\n the witness points (`.a`, `.b`) and the support point (`.pt`).\n Recommended to use simple objects.\n Eg:\n ```javascript\n return {\n a: { x: 1, y:2 },\n b: { x: 3, y: 4 },\n pt: { x: 2, y: 2 }\n };\n ```\n * - axis (Physics.vector): The axis to search\n * - seed (Physics.vector): The starting direction for the simplex (defaults to x-axis)\n * - checkOverlapOnly (Boolean): only check whether there is an overlap, don't calculate the depth\n * - debugFn (Function): For debugging. Called at every iteration with the current simplex.\n *\n * Implementation agnostic GJK function.\n *\n * Gilbert–Johnson–Keerthi object collison algorithm\n * For general information about GJK see:\n * - [www.codezealot.org/archives/88](http://www.codezealot.org/archives/88)\n * - [mollyrocket.com/849](http://mollyrocket.com/849)\n *\n * The algorithm information returned:\n * ```javascript\n * {\n * overlap: Boolean,\n * simplex: [] // array containing simplex points as simple x/y objects\n * }\n * ```\n **/\n var gjk = function gjk( support, seed, checkOverlapOnly, debugFn ){\n\n var overlap = false\n ,noOverlap = false // if we're sure we're not overlapping\n ,distance = false\n ,simplex = []\n ,simplexLen = 1\n // setup a scratchpad of temporary cheap objects\n ,scratch = Physics.scratchpad()\n // use seed as starting direction or use x axis\n ,dir = scratch.vector().clone(seed || Physics.vector.axis[ 0 ])\n ,last = scratch.vector()\n ,lastlast = scratch.vector()\n // some temp vectors\n ,v1 = scratch.vector()\n ,v2 = scratch.vector()\n ,ab\n ,ac\n ,sign\n ,tmp\n ,iterations = 0\n ;\n\n // get the first Minkowski Difference point\n tmp = support( dir );\n simplexLen = simplex.push( tmp );\n last.clone( tmp.pt );\n // negate d for the next point\n dir.negate();\n\n // start looping\n while ( ++iterations ) {\n\n // swap last and lastlast, to save on memory/speed\n last.swap(lastlast);\n // push a new point to the simplex because we haven't terminated yet\n tmp = support( dir );\n simplexLen = simplex.push( tmp );\n last.clone( tmp.pt );\n\n if ( debugFn ){\n debugFn( simplex );\n }\n\n if ( last.equals(Physics.vector.zero) ){\n // we happened to pick the origin as a support point... lucky.\n overlap = true;\n break;\n }\n\n // check if the last point we added actually passed the origin\n if ( !noOverlap && last.dot( dir ) <= 0.0 ) {\n // if the point added last was not past the origin in the direction of d\n // then the Minkowski difference cannot possibly contain the origin since\n // the last point added is on the edge of the Minkowski Difference\n\n // if we just need the overlap...\n if ( checkOverlapOnly ){\n break;\n }\n\n noOverlap = true;\n }\n\n // if it's a line...\n if ( simplexLen === 2 ){\n\n // otherwise we need to determine if the origin is in\n // the current simplex and act accordingly\n\n dir = getNextSearchDir( last, lastlast, dir );\n // continue...\n\n // if it's a triangle... and we're looking for the distance\n } else if ( noOverlap ){\n\n // if we know there isn't any overlap and\n // we're just trying to find the distance...\n // make sure we're getting closer to the origin\n dir.normalize();\n tmp = lastlast.dot( dir );\n if ( Math.abs(tmp - last.dot( dir )) < gjkAccuracy ){\n\n distance = -tmp;\n break;\n }\n\n // if we are still getting closer then only keep\n // the points in the simplex that are closest to\n // the origin (we already know that last is closer\n // than the previous two)\n // the norm is the same as distance(origin, a)\n // use norm squared to avoid the sqrt operations\n if (lastlast.normSq() < v1.clone(simplex[ 0 ].pt).normSq()) {\n\n simplex.shift();\n\n } else {\n\n simplex.splice(1, 1);\n }\n\n dir = getNextSearchDir( v1.clone(simplex[ 1 ].pt), v2.clone(simplex[ 0 ].pt), dir );\n // continue...\n\n // if it's a triangle\n } else {\n\n // we need to trim the useless point...\n\n ab = ab || scratch.vector();\n ac = ac || scratch.vector();\n\n // get the edges AB and AC\n ab.clone( lastlast ).vsub( last );\n ac.clone( simplex[ 0 ].pt ).vsub( last );\n\n // here normally people think about this as getting outward facing\n // normals and checking dot products. Since we're in 2D\n // we can be clever...\n sign = ab.cross( ac ) > 0;\n\n if ( sign ^ (last.cross( ab ) > 0) ){\n\n // ok... so there's an XOR here... don't freak out\n // remember last = A = -AO\n // if AB cross AC and AO cross AB have the same sign\n // then the origin is along the outward facing normal of AB\n // so if AB cross AC and A cross AB have _different_ (XOR) signs\n // then this is also the case... so we proceed...\n\n // point C is dead to us now...\n simplex.shift();\n\n // if we haven't deduced that we've enclosed the origin\n // then we know which way to look...\n // morph the ab vector into its outward facing normal\n ab.perp( !sign );\n\n // swap\n dir.swap( ab );\n\n // continue...\n\n // if we get to this if, then it means we can continue to look along\n // the other outward normal direction (ACperp)\n // if we don't see the origin... then we must have it enclosed\n } else if ( sign ^ (ac.cross( last ) > 0) ){\n // then the origin is along the outward facing normal\n // of AC; (ACperp)\n\n // point B is dead to us now...\n simplex.splice(1, 1);\n\n ac.perp( sign );\n\n // swap\n dir.swap( ab );\n\n // continue...\n\n } else {\n\n // we have enclosed the origin!\n overlap = true;\n // fewf... take a break\n break;\n }\n }\n\n // woah nelly... that's a lot of iterations.\n // Stop it!\n if (iterations > gjkMaxIterations){\n scratch.done();\n return {\n simplex: simplex,\n iterations: iterations,\n distance: 0,\n maxIterationsReached: true\n };\n }\n }\n\n // free workspace\n scratch.done();\n\n tmp = {\n overlap: overlap,\n simplex: simplex,\n iterations: iterations\n };\n\n if ( distance !== false ){\n\n tmp.distance = distance;\n tmp.closest = getClosestPoints( simplex );\n }\n\n return tmp;\n };\n\n Physics.gjk = gjk;\n\n})();\n\n\n// ---\n// inside: src/math/statistics.js\n\n(function(){\n\n Physics.statistics = {\n /**\n * Physics.statistics.pushRunningAvg( v, k, m, s ) -> Array\n * - v (Number): is value to push\n * - k (Number): is num elements\n * - m (Number): is current mean\n * - s (Number): is current s value\n * + (Array): Returns a 2 element array containing the next mean, and s value\n *\n * Push a value to a running average calculation.\n * see [http://www.johndcook.com/blog/standard_deviation]\n *\n * Note: variance can be calculated from the \"s\" value by multiplying it by `1/(k-1)`\n **/\n pushRunningAvg: function( v, k, m, s ){\n\n var x = v - m;\n\n // Mk = Mk-1+ (xk – Mk-1)/k\n // Sk = Sk-1 + (xk – Mk-1)*(xk – Mk).\n m += x / k;\n s += x * (v - m);\n return [m, s];\n },\n\n /**\n * Physics.statistics.pushRunningVectorAvg( v, k, m[, s] )\n * - v (Physics.vector): is vector to push\n * - k (Number): is num elements\n * - m (Physics.vector): is current mean\n * - s (Physics.vector): is current s value\n *\n * Push a vector to a running vector average calculation.\n * see [http://www.johndcook.com/blog/standard_deviation]\n *\n * Calculations are done in place. The `m` and `s` parameters are altered.\n *\n * Note: variance can be calculated from the \"s\" vector by multiplying it by `1/(k-1)`\n *\n * If s value is ommitted it won't be used.\n **/\n pushRunningVectorAvg: function( v, k, m, s ){\n var invK = 1/k\n ,x = v.get(0) - m.get(0)\n ,y = v.get(1) - m.get(1)\n ;\n\n // Mk = Mk-1+ (xk – Mk-1)/k\n // Sk = Sk-1 + (xk – Mk-1)*(xk – Mk).\n m.add( x * invK, y * invK );\n\n if ( s ){\n x *= v.get(0) - m.get(0);\n y *= v.get(1) - m.get(1);\n\n s.add( x, y );\n }\n }\n };\n})();\n\n\n// ---\n// inside: src/math/transform.js\n\n(function(){\n \n /**\n * class Physics.transform\n * \n * Vector Transformations class for rotating and translating vectors\n **/\n\n /**\n * new Physics.transform( [vect, angle, origin] )\n * new Physics.transform( transform )\n * - vect (Vectorish): Translation vector\n * - transform (Physics.transform): Transform to copy\n * - angle (Number): Angle (radians) to use for rotation\n * - origin (Vectorish): Origin of the rotation\n * \n * Transform Constructor / Factory\n **/\n var Transform = function Transform( vect, angle, origin ) {\n\n if (!(this instanceof Transform)){\n return new Transform( vect, angle );\n }\n\n this.v = new Physics.vector();\n this.o = new Physics.vector(); // origin of rotation\n \n if ( vect instanceof Transform ){\n\n this.clone( vect );\n return;\n }\n\n if (vect){\n this.setTranslation( vect );\n }\n\n this.setRotation( angle || 0, origin );\n };\n\n /**\n * Physics.transform#setTranslation( vect ) -> this\n * - vect (Vectorish): The translation vector\n * \n * Set the translation portion of the transform.\n **/\n Transform.prototype.setTranslation = function( vect ){\n\n this.v.clone( vect );\n return this;\n };\n\n /**\n * Physics.transform#setRotation( angle[, origin ] ) -> this\n * - angle (Number): Angle (radians) to use for rotation\n * - origin (Vectorish): Origin of the rotation\n *\n * Set the rotation portion of the transform\n **/\n Transform.prototype.setRotation = function( angle, origin ){\n\n this.cosA = Math.cos( angle );\n this.sinA = Math.sin( angle );\n\n if ( origin ){\n this.o.clone( origin );\n } else {\n this.o.zero();\n }\n\n return this;\n };\n\n /**\n * Physics.transform#clone( [transform] ) -> this|Physics.transform\n * - transform (Physics.transform): Transform to copy\n * + (this): For chaining\n * + (Physics.transform): New copy of `this` if none is specified as an argument\n * \n * Clone another transform. Or clone self into new transform.\n **/\n Transform.prototype.clone = function( t ){\n\n if ( t ){\n\n this.setTranslation( t.v );\n this.cosA = t.cosA;\n this.sinA = t.sinA;\n this.o.clone( t.o );\n\n return this;\n }\n\n return new Transform( this );\n };\n\n Physics.transform = Transform;\n\n})();\n\n// ---\n// inside: src/math/vector.js\n\n(function(window){\n\n // http://jsperf.com/vector-storage-test/2\n\n // cached math functions\n // TODO: might be faster not to do this???\n var sqrt = Math.sqrt\n ,min = Math.min\n ,max = Math.max\n ,acos = Math.acos\n ,atan2 = Math.atan2\n ,TWOPI = Math.PI * 2\n ,typedArrays = !!window.Float64Array\n ;\n\n /**\n * class Physics.vector\n *\n * The vector class and factory function.\n *\n * Call `Physics.vector` with the same arguments as\n * [[new Physics.vector]] to create an instance.\n *\n * The vector methods mostly modify the vector instance.\n * This makes computations faster because creating vectors\n * is avoided.\n *\n * Creating vectors is generally an expensive operation\n * so try to avoid doing this in the simulation loop.\n * Instead you can use [[Physics.scratchpad]] to get\n * temporary vectors for use in performance critical\n * code.\n *\n * _Note_: The coordinate system is left-handed, meaning that\n * the clockwise angular direction is positive. This has implications\n * for the cross-product rule.\n **/\n\n /** section: Special\n * class Vectorish\n *\n * Any object with `.x` and `.y` properties.\n *\n * A `Vectorish` isn't really a class. In this documentation, when\n * an argument is specified as a `Vectorish` it means either a true\n * [[Physics.vector]] instance, or an object literal with `.x` and `.y`\n * properties.\n **/\n\n /**\n * new Physics.vector( x, y )\n * new Physics.vector( vect )\n * - x (Number): The x coordinate\n * - y (Number): The y coordinate\n * - vect (Vectorish): A vector-like object to clone\n *\n * Vector Constructor.\n **/\n var Vector = function Vector( x, y ) {\n\n // enforce instantiation\n if ( !(this instanceof Vector) ){\n\n return new Vector( x, y );\n }\n\n // arrays to store values\n // x = _[0]\n // y = _[1]\n // norm = _[3]\n // normsq = _[4]\n\n /** internal\n * Physics.vector#_\n *\n * Private storage array for data.\n *\n * Do not access this directly. Private. Keep out.\n **/\n if (typedArrays){\n this._ = new Float64Array(5);\n } else {\n this._ = [];\n }\n\n if (x && (x.x !== undefined || x._ && x._.length)){\n\n this.clone( x );\n\n } else {\n\n this.recalc = true; //whether or not recalculate norms\n this.set( x, y );\n }\n };\n\n Object.defineProperties( Vector.prototype, {\n /**\n * Physics.vector#x\n *\n * Getter/setter property for the x coordinate.\n **/\n x: {\n get: function(){\n return +this._[0];\n },\n set: function( x ){\n x = +x || 0;\n this.recalc = ( x === this._[0] );\n this._[0] = x;\n }\n },\n /**\n * Physics.vector#y\n *\n * Getter/setter property for the y coordinate.\n **/\n y: {\n get: function(){\n return +this._[1];\n },\n set: function( y ){\n y = +y || 0;\n this.recalc = ( y === this._[1] );\n this._[1] = y;\n }\n }\n });\n\n //\n // Methods\n //\n\n /**\n * Physics.vector#set( x, y ) -> this\n * - x (Number): x coordinate\n * - y (Number): y coordinate\n *\n * Sets the x and y components of this vector.\n **/\n Vector.prototype.set = function( x, y ) {\n\n this.recalc = true;\n\n this._[0] = +x || 0;\n this._[1] = +y || 0;\n return this;\n };\n\n /** deprecated: 0.6.0..1.0.0\n * Physics.vector#get( idx ) -> Number\n * - idx (Number): The coordinate index (0 or 1)\n *\n * Get the x or y component by index.\n **/\n Vector.prototype.get = function( n ){\n\n return this._[ n ];\n };\n\n /**\n * Physics.vector#vadd( v ) -> this\n * - v (Physics.vector): vector to add\n *\n * Add a [[Physics.vector]] to `this`.\n **/\n Vector.prototype.vadd = function( v ) {\n\n this.recalc = true;\n\n this._[0] += v._[0];\n this._[1] += v._[1];\n return this;\n };\n\n /**\n * Physics.vector#vsub( v ) -> this\n * - v (Physics.vector): vector to subtract\n *\n * Subtract a [[Physics.vector]] from `this`.\n **/\n Vector.prototype.vsub = function( v ) {\n\n this.recalc = true;\n\n this._[0] -= v._[0];\n this._[1] -= v._[1];\n return this;\n };\n\n /**\n * Physics.vector#add( x, y ) -> this\n * - x (Number): amount to add to the x coordinate\n * - y (Number): amount to add to the y coordinate\n *\n * Add scalars [[Physics.vector]] to the coordinates.\n **/\n Vector.prototype.add = function( x, y ){\n\n this.recalc = true;\n\n this._[0] += +x || 0;\n this._[1] += +y || 0;\n return this;\n };\n\n /**\n * Physics.vector#sub( x, y ) -> this\n * - x (Number): amount to subtract from the x coordinate\n * - y (Number): amount to subtract from the y coordinate\n *\n * Subtract scalars [[Physics.vector]] from the coordinates.\n **/\n Vector.prototype.sub = function( x, y ){\n\n this.recalc = true;\n\n this._[0] -= x;\n this._[1] -= y === undefined? 0 : y;\n return this;\n };\n\n /**\n * Physics.vector#mult( m ) -> this\n * - m (Number): amount to multiply this vector by\n *\n * Multiply this by a scalar quantity.\n *\n * Same as scaling the vector by an amount `m`.\n **/\n Vector.prototype.mult = function( m ) {\n\n if ( !this.recalc ){\n\n this._[4] *= m * m;\n this._[3] *= m;\n }\n\n this._[0] *= m;\n this._[1] *= m;\n return this;\n };\n\n /**\n * Physics.vector#dot( v ) -> Number\n * - v (Physics.vector): The other vector\n *\n * Compute the dot product of this vector with `v`.\n **/\n Vector.prototype.dot = function( v ) {\n\n return (this._[0] * v._[0]) + (this._[1] * v._[1]);\n };\n\n /**\n * Physics.vector#cross( v ) -> Number\n * - v (Physics.vector): The other vector\n *\n * Compute the (left-handed) cross product of this vector with `v`.\n **/\n Vector.prototype.cross = function( v ) {\n\n return ( - this._[0] * v._[1]) + (this._[1] * v._[0]);\n };\n\n /**\n * Physics.vector#proj( v ) -> Number\n * - v (Physics.vector): The other vector\n *\n * Compute the [scalar projection](http://en.wikipedia.org/wiki/Vector_projection#Scalar_projection_2) of this along `v`.\n **/\n Vector.prototype.proj = function( v ){\n\n return this.dot( v ) / v.norm();\n };\n\n\n /**\n * Physics.vector#vproj( v ) -> this\n * - v (Physics.vector): The other vector\n *\n * Compute the [vector projection](http://en.wikipedia.org/wiki/Vector_projection#Vector_projection_2) of this along `v` and copy the result into this vector.\n **/\n Vector.prototype.vproj = function( v ){\n\n var m = this.dot( v ) / v.normSq();\n return this.clone( v ).mult( m );\n };\n\n /**\n * Physics.vector#angle( [v] ) -> Number\n * - v (Physics.vector): The other vector\n * + (Number): The angle in radians between this vector and the x-axis OR `v` if specified\n *\n * Compute the angle between `this` and vector `v` or this and x axis.\n **/\n Vector.prototype.angle = function( v ){\n\n var ang;\n\n if ( this.equals( Vector.zero ) ){\n\n if ( v ){\n return v.angle();\n } else {\n return NaN;\n }\n\n } else {\n\n if ( v && !v.equals( Vector.zero ) ){\n ang = atan2( this._[1] * v._[0] - this._[0] * v._[1], this._[0] * v._[0] + this._[1] * v._[1]);\n } else {\n ang = atan2( this._[ 1 ], this._[ 0 ] );\n }\n }\n\n while (ang > Math.PI){\n ang -= TWOPI;\n }\n\n while (ang < -Math.PI){\n ang += TWOPI;\n }\n\n return ang;\n };\n\n /**\n * Physics.vector#angle2( left, right ) -> Number\n * - left (Physics.vector): The position on the left\n * - right (Physics.vector): The position on the right\n *\n * Compute the angle created between three points; left -> this -> right.\n **/\n Vector.prototype.angle2 = function( left, right ){\n\n var x1 = left._[0] - this._[0]\n ,y1 = left._[1] - this._[1]\n ,x2 = right._[0] - this._[0]\n ,y2 = right._[1] - this._[1]\n ,ang = atan2( y1 * x2 - x1 * y2, x1 * x2 + y1 * y2)\n ;\n\n while (ang > Math.PI){\n ang -= TWOPI;\n }\n\n while (ang < -Math.PI){\n ang += TWOPI;\n }\n\n return ang;\n };\n\n /**\n * Physics.vector#norm() -> Number\n *\n * Compute the norm (length) of this vector.\n **/\n Vector.prototype.norm = function() {\n\n if (this.recalc){\n this.recalc = false;\n this._[4] = (this._[0] * this._[0] + this._[1] * this._[1]);\n this._[3] = sqrt( this._[4] );\n }\n\n return this._[3];\n };\n\n /**\n * Physics.vector#normSq() -> Number\n *\n * Compute the norm (length) squared of this vector.\n **/\n Vector.prototype.normSq = function() {\n\n if (this.recalc){\n this.recalc = false;\n this._[4] = (this._[0] * this._[0] + this._[1] * this._[1]);\n this._[3] = sqrt( this._[4] );\n }\n\n return this._[4];\n };\n\n /**\n * Physics.vector#dist( v ) -> Number\n * - v (Physics.vector): The other vector\n *\n * Compute the distance from this vector to another vector `v`.\n **/\n Vector.prototype.dist = function( v ) {\n\n var dx, dy;\n return sqrt(\n (dx = (v._[0] - this._[0])) * dx +\n (dy = (v._[1] - this._[1])) * dy\n );\n };\n\n /**\n * Physics.vector#distSq( v ) -> Number\n * - v (Physics.vector): The other vector\n *\n * Compute the distance squared from this vector to another vector `v`.\n **/\n Vector.prototype.distSq = function( v ) {\n\n var dx, dy;\n return (\n (dx = (v._[0] - this._[0])) * dx +\n (dy = (v._[1] - this._[1])) * dy\n );\n };\n\n /**\n * Physics.vector#perp( [ccw] ) -> this\n * - ccw (Boolean): flag to indicate that we should rotate counterclockwise\n *\n * Change this vector into a vector that will be perpendicular.\n *\n * In other words, rotate by (+-) 90 degrees.\n **/\n Vector.prototype.perp = function( ccw ) {\n\n var tmp = this._[0]\n ;\n\n if ( ccw ){\n\n // x <-> y\n // negate y\n this._[0] = this._[1];\n this._[1] = -tmp;\n\n } else {\n\n // x <-> y\n // negate x\n this._[0] = -this._[1];\n this._[1] = tmp;\n }\n\n return this;\n };\n\n /**\n * Physics.vector#normalize() -> this\n *\n * Normalise this vector, making it a unit vector.\n **/\n Vector.prototype.normalize = function() {\n\n var m = this.norm();\n\n // means it's a zero Vector\n if ( m === 0 ){\n return this;\n }\n\n m = 1/m;\n\n this._[0] *= m;\n this._[1] *= m;\n\n this._[3] = 1.0;\n this._[4] = 1.0;\n\n return this;\n };\n\n /**\n * Physics.vector#transform( t ) -> this\n * - t (Physics.transform): The transformation to apply\n *\n * Apply a [[Physics.transform]] to this vector.\n **/\n Vector.prototype.transform = function( t ){\n\n var sinA = t.sinA\n ,cosA = t.cosA\n ,x = t.o._[ 0 ]\n ,y = t.o._[ 1 ]\n ;\n\n this._[ 0 ] -= x;\n this._[ 1 ] -= y;\n\n // rotate about origin \"o\" then translate\n return this.set(\n this._[ 0 ] * cosA - this._[ 1 ] * sinA + x + t.v._[ 0 ],\n this._[ 0 ] * sinA + this._[ 1 ] * cosA + y + t.v._[ 1 ]\n );\n };\n\n /**\n * Physics.vector#transformInv( t ) -> this\n * - t (Physics.transform): The transformation to apply the inverse of\n *\n * Apply an inverse [[Physics.transform]] to this vector.\n **/\n Vector.prototype.transformInv = function( t ){\n\n var sinA = t.sinA\n ,cosA = t.cosA\n ,x = t.o._[ 0 ]\n ,y = t.o._[ 1 ]\n ;\n\n this._[ 0 ] -= x + t.v._[ 0 ];\n this._[ 1 ] -= y + t.v._[ 1 ];\n\n // inverse translate then inverse rotate about origin \"o\"\n return this.set(\n this._[ 0 ] * cosA + this._[ 1 ] * sinA + x,\n - this._[ 0 ] * sinA + this._[ 1 ] * cosA + y\n );\n };\n\n /**\n * Physics.vector#rotate( t ) -> this\n * Physics.vector#rotate( ang[, o] ) -> this\n * - t (Physics.transform): The transformation to apply the rotational part of\n * - ang (Number): The angle (in radians), to rotate by\n * - o (Vectorish): The point of origin of the rotation\n *\n * Rotate this vector.\n *\n * An angle and rotation origin can be specified,\n * or a transform can be specified and only the rotation\n * portion of that transform will be applied\n **/\n Vector.prototype.rotate = function( t, o ){\n\n var sinA\n ,cosA\n ,x = 0\n ,y = 0\n ;\n\n if ( typeof t === 'number' ){\n sinA = Math.sin( t );\n cosA = Math.cos( t );\n\n if ( o ){\n x = o.x;\n y = o.y;\n }\n } else {\n sinA = t.sinA;\n cosA = t.cosA;\n\n x = t.o._[ 0 ];\n y = t.o._[ 1 ];\n }\n\n this._[ 0 ] -= x;\n this._[ 1 ] -= y;\n\n return this.set(\n this._[ 0 ] * cosA - this._[ 1 ] * sinA + x,\n this._[ 0 ] * sinA + this._[ 1 ] * cosA + y\n );\n };\n\n /**\n * Physics.vector#rotateInv( t ) -> this\n * - t (Physics.transform): The transformation to apply the inverse rotational part of\n *\n * Apply the inverse rotation of a transform.\n *\n * Only the inverse rotation portion of\n * that transform will be applied.\n **/\n Vector.prototype.rotateInv = function( t ){\n\n return this.set(\n (this._[ 0 ] - t.o._[ 0 ]) * t.cosA + (this._[ 1 ] - t.o._[ 1 ]) * t.sinA + t.o._[ 0 ],\n -(this._[ 0 ] - t.o._[ 0 ]) * t.sinA + (this._[ 1 ] - t.o._[ 1 ]) * t.cosA + t.o._[ 1 ]\n );\n };\n\n /**\n * Physics.vector#translate( t ) -> this\n * - t (Physics.transform): The transformation to apply the translational part of\n *\n * Apply the translation of a transform.\n *\n * Only the translation portion of\n * that transform will be applied.\n **/\n Vector.prototype.translate = function( t ){\n\n return this.vadd( t.v );\n };\n\n /**\n * Physics.vector#translateInv( t ) -> this\n * - t (Physics.transform): The transformation to apply the inverse translational part of\n *\n * Apply the inverse translation of a transform.\n *\n * Only the inverse translation portion of\n * that transform will be applied.\n **/\n Vector.prototype.translateInv = function( t ){\n\n return this.vsub( t.v );\n };\n\n\n /**\n * Physics.vector#clone( [v] ) -> this|Physics.vector\n * - v (Vectorish): The vector-like object to clone\n * + (this): If `v` is specified as an argument\n * + (Physics.vector): A new vector instance that clones this vector, if no argument is specified\n *\n * Create a clone of this vector, or clone another vector into this instance.\n *\n * This is especially useful in vector algorithms\n * that use temporary vectors (which most should).\n * You can create temporary vectors and then do things like...\n * ```\n * temp.clone( otherVector );\n * // compute things with temp...\n * // then save the result\n * result.clone( tmp );\n * ```\n **/\n Vector.prototype.clone = function( v ) {\n\n // http://jsperf.com/vector-storage-test\n\n if ( v ){\n\n if (!v._){\n\n return this.set( v.x, v.y );\n }\n\n this.recalc = v.recalc;\n\n if (!v.recalc){\n this._[3] = v._[3];\n this._[4] = v._[4];\n }\n\n this._[0] = v._[0];\n this._[1] = v._[1];\n\n return this;\n }\n\n return new Vector( this );\n };\n\n /**\n * Physics.vector#swap( v ) -> this\n * - v (Physics.vector): The other vector\n *\n * Swap values with other vector.\n **/\n Vector.prototype.swap = function( v ){\n\n var _ = this._;\n this._ = v._;\n v._ = _;\n\n _ = this.recalc;\n this.recalc = v.recalc;\n v.recalc = _;\n return this;\n };\n\n /**\n * Physics.vector#values() -> Object\n *\n * Get the coordinate values as an object literal.\n **/\n Vector.prototype.values = function(){\n\n return {\n x: this._[0],\n y: this._[1]\n };\n };\n\n\n /**\n * Physics.vector#zero() -> this\n *\n * Set the coordinates of this vector to zero.\n **/\n Vector.prototype.zero = function() {\n\n this._[3] = 0.0;\n this._[4] = 0.0;\n\n this._[0] = 0.0;\n this._[1] = 0.0;\n return this;\n };\n\n /**\n * Physics.vector#negate() -> this\n *\n * Flip this vector in the opposite direction.\n **/\n Vector.prototype.negate = function( component ){\n\n if (component !== undefined){\n\n this._[ component ] = -this._[ component ];\n return this;\n }\n\n this._[0] = -this._[0];\n this._[1] = -this._[1];\n return this;\n };\n\n /**\n * Physics.vector#clamp( minV, maxV ) -> this\n * - minV (Vectorish): The minimum vector\n * - maxV (Vectorish): The maximum vector\n *\n * Constrain vector components to minima and maxima.\n *\n * The vector analog of [scalar clamping](http://en.wikipedia.org/wiki/Clamping_(graphics)).\n **/\n Vector.prototype.clamp = function( minV, maxV ){\n\n this._[0] = min(max(this._[0], minV.x), maxV.x);\n this._[1] = min(max(this._[1], minV.y), maxV.y);\n this.recalc = true;\n return this;\n };\n\n /**\n * Physics.vector#toString() -> String\n *\n * Get a formatted string of this vector's coordinates.\n **/\n Vector.prototype.toString = function(){\n\n return '('+this._[0] + ', ' + this._[1]+')';\n };\n\n\n /**\n * Physics.vector#equals( v ) -> Boolean\n * - v (Physics.vector): The other vector\n *\n * Determine if this vector equals another.\n **/\n Vector.prototype.equals = function( v ){\n\n return this._[0] === v._[0] &&\n this._[1] === v._[1] &&\n this._[2] === v._[2];\n };\n\n /**\n * Physics.vector.axis = Array\n *\n * Read-only axis vectors for general reference.\n *\n * Example:\n *\n * ```javascript\n * Physics.vector.axis[0]; // The x axis unit vector\n * Physics.vector.axis[1]; // The y axis unit vector\n * ```\n **/\n Vector.axis = [\n new Vector(1.0, 0.0),\n new Vector(0.0, 1.0)\n ];\n\n /**\n * Physics.vector.zero = zeroVector\n *\n * Read-only zero vector for reference\n **/\n Vector.zero = new Vector(0, 0);\n\n // assign\n Physics.vector = Vector;\n\n}(this)); // end Vector class\n\n\n// ---\n// inside: src/util/noconflict.js\n\n(function( window ){\n\n var _Physics = window.Physics;\n\n /**\n * Physics.noConflict() -> Physics\n * \n * Restore the original reference to the global window.Physics variable.\n * \n * Does nothing if PhysicsJS doesn't have a reference in global scope\n **/\n Physics.noConflict = function(){\n\n if ( window.Physics === Physics ) {\n window.Physics = _Physics;\n }\n \n return Physics;\n };\n\n})( this );\n\n// ---\n// inside: src/util/decorator.js\n\n/** related to: factory\n * Physics.util.decorator( type [, protoDef ] ) -> Function\n * - type (String): The name of the factory you are creating\n * - protoDef (Object): The top-level prototype\n * + (Function): The factory function\n *\n * Facilitates creation of decorator factory functions.\n *\n * See the [[factory]] definition for the factory signatures.\n * [For full documentation and examples, please visit the wiki](https://github.com/wellcaffeinated/PhysicsJS/wiki/Fundamentals#the-factory-pattern).\n *\n * Example:\n *\n * ```javascript\n * var factory = Physics.util.decorator('factory', {\n * // prototype methods...\n * method: function( args ){\n * }\n * });\n *\n * // define\n * factory( 'name', 'parent-name', function( parent ){\n *\n * // extend further...\n * return {\n * // overrides\n * init: function( cfg ){\n * parent.init.call(this, cfg);\n * }\n * };\n * });\n *\n * // instantiate\n * var options = { key: 'val' };\n * var instance = factory( 'name', options );\n * ```\n **/\nvar Decorator = Physics.util.decorator = function Decorator( type, baseProto ){\n\n var registry = {}\n ,proto = {}\n ;\n\n // extend that supports getters/setters\n // only extends functions\n var extend = function extend( to, from ){\n var desc, key;\n for ( key in from ){\n desc = Object.getOwnPropertyDescriptor( from, key );\n if ( desc.get || desc.set ){\n\n Object.defineProperty( to, key, desc );\n\n } else if ( Physics.util.isFunction( desc.value ) ){\n\n to[ key ] = desc.value;\n }\n }\n return to;\n };\n\n // http://ejohn.org/blog/objectgetprototypeof/\n /* jshint -W103 */\n var getProto = Object.getPrototypeOf;\n if ( typeof getProto !== 'function' ) {\n if ( typeof 'test'.__proto__ === 'object' ) {\n getProto = function(object){\n return object.__proto__;\n };\n } else {\n getProto = function(object){\n // May break if the constructor has been tampered with\n return object.constructor.prototype;\n };\n }\n }\n /* jshint +W103 */\n\n var objectCreate = Object.create;\n if (typeof objectCreate !== 'function') {\n objectCreate = function (o) {\n function F() {}\n F.prototype = o;\n return new F();\n };\n }\n\n /*\n * mixin( key, val )\n * mixin( obj )\n * - key (String): The method name\n * - val (Function): The function to assign\n * - obj (Object): object with many `key: fn` pairs\n *\n * Apply mixin methods to decorator base.\n */\n var mixin = function mixin( key, val ){\n\n if ( typeof key === 'object' ){\n proto = extend(proto, key);\n proto.type = type;\n return;\n }\n\n if ( key !== 'type' && Physics.util.isFunction( val ) ){\n proto[ key ] = val;\n }\n };\n\n // @TODO: not sure of the best way to make the constructor names\n // transparent and readable in debug consoles...\n mixin( baseProto );\n\n /** belongs to: Physics.util.decorator\n * factory( name[, parentName], decorator[, cfg] )\n * factory( name, cfg ) -> Object\n * - name (String): The class name\n * - parentName (String): The name of parent class to extend\n * - decorator (Function): The decorator function that should define and return methods to extend (decorate) the base class\n * - cfg (Object): The configuration to pass to the class initializer\n *\n * Factory function for definition and instantiation of subclasses.\n *\n * Use the first signature (once) to define it first.\n * If defining without the \"cfg\" parameter, void will be returned. Otherwise the class instance will be returned.\n *\n * See [[Physics.util.decorator]] for more information.\n **/\n var factory = function factory( name, parentName, decorator, cfg ){\n\n var instance\n ,result\n ,parent = proto\n ,tmp\n ;\n\n // set parent if specified\n if ( typeof parentName !== 'string' ){\n\n // ... otherwise reassign parameters\n cfg = decorator;\n decorator = parentName;\n\n } else {\n\n // extend the specified module\n parent = registry[ parentName ];\n\n if ( !parent ){\n\n throw 'Error: \"' + parentName + '\" ' + type + ' not defined';\n }\n\n parent = parent.prototype;\n }\n\n if ( typeof decorator === 'function' ){\n\n result = registry[ name ];\n\n if ( result ){\n\n result.prototype = extend(result.prototype, decorator( getProto(result.prototype) ));\n\n } else {\n // newly defined\n // store the new class\n result = registry[ name ] = function constructor( opts ){\n if (this.init){\n this.init( opts );\n }\n };\n\n result.prototype = objectCreate( parent );\n result.prototype = extend(result.prototype, decorator( parent, result.prototype ));\n }\n\n result.prototype.type = type;\n result.prototype.name = name;\n\n } else {\n\n cfg = decorator || {};\n result = registry[ name ];\n if (!result){\n\n throw 'Error: \"' + name + '\" ' + type + ' not defined';\n }\n }\n\n if ( cfg ) {\n\n // create a new instance from the provided decorator\n return new result( cfg );\n }\n };\n\n factory.mixin = mixin;\n\n return factory;\n};\n\n\n// ---\n// inside: src/util/helpers.js\n\n/**\n * Physics.util.indexOf( arr, value ) -> Number\n * - arr (Array): The array to search\n * - value (Mixed): The value to find\n * + (Number): The index of `value` in the array OR `-1` if not found\n *\n * Fast indexOf implementation.\n **/\nPhysics.util.indexOf = function indexOf(arr, value) {\n var fr = 0, bk = arr.length;\n while (fr < bk) {\n bk--;\n if (arr[ fr ] === value) {\n return fr;\n }\n if (arr[ bk ] === value) {\n return bk;\n }\n fr++;\n }\n return -1;\n};\n\n\n// http://jsperf.com/array-destroy/87\n/**\n * Physics.util.clearArray( arr ) -> Array\n * - arr (Array): The array to clear\n * + (Array): The array passed in\n *\n * Quickly clear an array.\n **/\nPhysics.util.clearArray = function clearArray(arr){\n var l = arr.length;\n while( l-- ){\n arr.pop();\n }\n return arr;\n};\n\n/**\n * Physics.util.throttle( fn, delay ) -> Function\n * - fn (Function): The function to throttle\n * - delay (Number): Time in milliseconds\n *\n * Ensure a function is only called once every specified time span.\n **/\nPhysics.util.throttle = function throttle( fn, delay, scope ){\n var to\n ,call = false\n ,args\n ,cb = function(){\n clearTimeout( to );\n if ( call ){\n call = false;\n to = setTimeout(cb, delay);\n fn.apply(scope, args);\n } else {\n to = false;\n }\n }\n ;\n\n scope = scope || null;\n\n return function(){\n call = true;\n args = arguments;\n if ( !to ){\n cb();\n }\n };\n};\n\n/**\n * Physics.util.options( def[, target] ) -> Function\n * - def (Object): Default options to set\n * - target (Object): Where to copy the options to. Defaults to the returned function.\n * + (Function): The options function\n *\n * Options helper to keep track of options. Call it with a config object. Access options directly on the function.\n *\n * Example:\n *\n * ```javascript\n * this.options = Physics.util.options({ foo: 'bar', opt: 'def' });\n * this.options({ opt: 'myVal' });\n *\n * this.options.foo; // === 'bar'\n * this.options.def; // === 'myVal'\n *\n * // can also change defaults later\n * this.options.defaults({ foo: 'baz' });\n *\n * // can add a change callback\n * this.options.onChange(function( opts ){\n * // some option changed\n * // opts is the target\n * });\n * ```\n **/\n// deep copy callback to extend deeper into options\nvar deepCopyFn = function( a, b ){\n\n if ( Physics.util.isPlainObject( b ) ){\n\n return Physics.util.extend({}, a, b, deepCopyFn );\n }\n\n return b !== undefined ? b : a;\n};\nPhysics.util.options = function( def, target ){\n\n var _def = {}\n ,fn\n ,callbacks = []\n ;\n\n // set options\n fn = function fn( options, deep ){\n\n Physics.util.extend(target, options, deep ? deepCopyFn : null);\n for ( var i = 0, l = callbacks.length; i < l; ++i ){\n callbacks[ i ]( target );\n }\n return target;\n };\n\n // add defaults\n fn.defaults = function defaults( def, deep ){\n Physics.util.extend( _def, def, deep ? deepCopyFn : null );\n Physics.util.defaults( target, _def, deep ? deepCopyFn : null );\n return _def;\n };\n\n fn.onChange = function( cb ){\n callbacks.push( cb );\n };\n\n target = target || fn;\n\n fn.defaults( def );\n\n return fn;\n};\n\n/**\n * Physics.util.pairHash( id1, id2 ) -> Number\n * - id1 (Number): The id of the first thing\n * - id2 (Number): The id of the second thing\n * + (Number): A unique numeric hash (valid for values < 2^16)\n *\n * Generate a unique numeric hash from two input IDs.\n *\n * Useful for speedy indexing of pairs.\n **/\nPhysics.util.pairHash = function( id1, id2 ){\n id1 = id1|0;\n id2 = id2|0;\n\n if ( (id1|0) === (id2|0) ){\n\n return -1;\n }\n\n // valid for values < 2^16\n return ((id1|0) > (id2|0) ?\n (id1 << 16) | (id2 & 0xFFFF) :\n (id2 << 16) | (id1 & 0xFFFF))|0\n ;\n};\n\n/**\n * Physics.util.bind( fn, scope[, args... ] ) -> Function\n * - fn (Function): The function to bind scope to\n * - scope (Object): The scope to give to `fn`\n * - args (Mixed): Arguments to send to `fn`\n *\n * Bind a scope to a function.\n *\n * Basically the same functionality as [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n **/\nif ( !Function.prototype.bind ){\n Physics.util.bind = function( fn, scope, args ){\n args = Array.prototype.slice.call( arguments, 2 );\n return function(){\n return fn.apply( scope, args.concat( Array.prototype.slice.call(arguments) ) );\n };\n };\n} else {\n Physics.util.bind = function( fn, scope, args ){\n args = Array.prototype.slice.call( arguments, 1 );\n return Function.prototype.bind.apply( fn, args );\n };\n}\n\n/**\n * Physics.util.find( collection, fn( value, index, collection ) ) -> Mixed\n * - collection (Array): Collection of values to test\n * - fn (Function): The test function\n * - value (Mixed): The value to test\n * - index (Number): The index of value in collection\n * - collection (Array): The input collection\n *\n * Test an array of values against a test function\n * and return the first value for which the function\n * returns true.\n **/\nPhysics.util.find = function( collection, fn ){\n var i\n ,l = collection.length\n ,val\n ;\n\n for ( i = 0; i < l; i++ ){\n val = collection[ i ];\n if ( fn( val, i, collection ) ){\n return val;\n }\n }\n};\n\n/**\n * Physics.util.filter( collection, fn( value, index, collection ) ) -> Array\n * - collection (Array): Collection of values to test\n * - fn (Function): The test function\n * - value (Mixed): The value to test\n * - index (Number): The index of value in collection\n * - collection (Array): The input collection\n *\n * Test an array of values against a test function\n * and return another array of values for which\n * the test function returns true.\n **/\nPhysics.util.filter = function( collection, fn ){\n var i\n ,l = collection.length\n ,val\n ,matches = []\n ;\n\n for ( i = 0; i < l; i++ ){\n val = collection[ i ];\n if ( fn( val, i, collection ) ){\n matches.push( val );\n }\n }\n\n return matches;\n};\n\n// lodash methods\n\n(function(){\n/*\n * @license\n * Modified version of:\n * Lo-Dash 2.4.1 (Custom Build) \n * Copyright 2012-2013 The Dojo Foundation \n * Based on Underscore.js 1.5.2 \n * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/* Used to determine if values are of the language type Object */\nvar objectTypes = {\n 'boolean': false,\n 'function': true,\n 'object': true,\n 'number': false,\n 'string': false,\n 'undefined': false\n};\nvar identity = function(a){ return a; };\nvar arrayClass = '[object Array]';\nvar objectClass = '[object Object]';\nvar nativeKeys = Object.keys;\nvar toString = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* Used as the size when optimizations are enabled for large arrays */\nvar largeArraySize = 75;\n/* Used to pool arrays and objects used internally */\nvar arrayPool = [],\n objectPool = [];\n/* Used as the max size of the `arrayPool` and `objectPool` */\nvar maxPoolSize = 40;\nvar keyPrefix = +new Date() + '';\n\nfunction releaseArray(array) {\n Physics.util.clearArray( array );\n if (arrayPool.length < maxPoolSize) {\n arrayPool.push(array);\n }\n}\n\nfunction releaseObject(object) {\n var cache = object.cache;\n if (cache) {\n releaseObject(cache);\n }\n object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;\n if (objectPool.length < maxPoolSize) {\n objectPool.push(object);\n }\n}\n\nfunction getObject() {\n return objectPool.pop() || {\n 'array': null,\n 'cache': null,\n 'criteria': null,\n 'false': false,\n 'index': 0,\n 'null': false,\n 'number': null,\n 'object': null,\n 'push': null,\n 'string': null,\n 'true': false,\n 'undefined': false,\n 'value': null\n };\n}\n\nfunction getArray() {\n return arrayPool.pop() || [];\n}\n\nfunction cacheIndexOf(cache, value) {\n var type = typeof value;\n cache = cache.cache;\n\n if (type === 'boolean' || value == null) {\n return cache[value] ? 0 : -1;\n }\n if (type !== 'number' && type !== 'string') {\n type = 'object';\n }\n var key = type === 'number' ? value : keyPrefix + value;\n cache = (cache = cache[type]) && cache[key];\n\n return type === 'object' ?\n (cache && Physics.util.indexOf(cache, value) > -1 ? 0 : -1) :\n (cache ? 0 : -1);\n}\n\nfunction cachePush(value) {\n var cache = this.cache,\n type = typeof value;\n\n if (type === 'boolean' || value == null) {\n cache[value] = true;\n } else {\n if (type !== 'number' && type !== 'string') {\n type = 'object';\n }\n var key = type === 'number' ? value : keyPrefix + value,\n typeCache = cache[type] || (cache[type] = {});\n\n if (type === 'object') {\n (typeCache[key] || (typeCache[key] = [])).push(value);\n } else {\n typeCache[key] = true;\n }\n }\n}\n\nfunction createCache(array) {\n var index = -1,\n length = array.length,\n first = array[0],\n mid = array[(length / 2) | 0],\n last = array[length - 1];\n\n if (first && typeof first === 'object' &&\n mid && typeof mid === 'object' && last && typeof last === 'object') {\n return false;\n }\n var cache = getObject();\n cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false;\n\n var result = getObject();\n result.array = array;\n result.cache = cache;\n result.push = cachePush;\n\n while (++index < length) {\n result.push(array[index]);\n }\n return result;\n}\n\nvar shimKeys = function(object) {\n var index, iterable = object, result = [];\n if (!iterable){ return result; }\n if (!(objectTypes[typeof object])){ return result; }\n for (index in iterable) {\n if (hasOwnProperty.call(iterable, index)) {\n result.push(index);\n }\n }\n return result;\n};\n\nvar keys = !nativeKeys ? shimKeys : function(object) {\n if (!Physics.util.isObject(object)) {\n return [];\n }\n return nativeKeys(object);\n};\n\nvar idCounter = 0;\n/**\n * Physics.util.uniqueId( [prefix] ) -> String\n * - prefix (String): Prefix to the id\n *\n * Generate a unique id, optionally prefixed.\n **/\nPhysics.util.uniqueId = function uniqueId(prefix) {\n var id = ++idCounter;\n return '' + (prefix || '') + id;\n};\n\n/*\n * The base implementation of `_.random` without argument juggling or support\n * for returning floating-point numbers.\n *\n * @private\n * @param {number} min The minimum possible value.\n * @param {number} max The maximum possible value.\n * @returns {number} Returns a random number.\n */\nfunction baseRandom(min, max) {\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n\n/*\n * Creates an array of shuffled values, using a version of the Fisher-Yates\n * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.\n *\n * @static\n * @memberOf _\n * @category Collections\n * @param {Array|Object|string} collection The collection to shuffle.\n * @returns {Array} Returns a new shuffled collection.\n * @example\n *\n * _.shuffle([1, 2, 3, 4, 5, 6]);\n * // => [4, 1, 6, 3, 5, 2]\n */\nPhysics.util.shuffle = function(collection) {\n var index = -1\n ,length = collection ? collection.length : 0\n ,result = Array(typeof length === 'number' ? length : 0)\n ,i\n ,l\n ,value\n ,rand\n ;\n\n for ( i = 0, l = collection.length; i < l; i++ ){\n value = collection[ i ];\n rand = baseRandom(0, ++index);\n result[index] = result[rand];\n result[rand] = value;\n }\n return result;\n};\n\n/**\n * Physics.util.isObject( val ) -> Boolean\n * - val (Mixed): The value to test\n *\n * Test if a value is an object.\n **/\nPhysics.util.isObject = function isObject(value) {\n // check if the value is the ECMAScript language type of Object\n // http://es5.github.io/#x8\n // and avoid a V8 bug\n // http://code.google.com/p/v8/issues/detail?id=2291\n return !!(value && objectTypes[typeof value]);\n};\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Physics.util.isFunction( val ) -> Boolean\n * - val (Mixed): The value to test\n *\n * Test if a value is a function.\n **/\nPhysics.util.isFunction = isFunction;\n\n/**\n * Physics.util.isArray( val ) -> Boolean\n * - val (Mixed): The value to test\n *\n * Test if a value is an array.\n **/\nPhysics.util.isArray = Array.isArray || function(value) {\n return value && typeof value === 'object' && typeof value.length === 'number' &&\n toString.call(value) === arrayClass || false;\n};\n\nvar reNative = RegExp('^' +\n String(toString)\n .replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n .replace(/toString| for [^\\]]+/g, '.*?') + '$'\n);\nfunction isNative(value) {\n return typeof value === 'function' && reNative.test(value);\n}\n\nfunction shimIsPlainObject(value) {\n var ctor,\n result;\n\n // avoid non Object objects, `arguments` objects, and DOM elements\n if (!(value && toString.call(value) === objectClass) ||\n (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) {\n return false;\n }\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n for (var key in value){\n result = key;\n }\n return typeof result === 'undefined' || hasOwnProperty.call(value, result);\n}\n\n/**\n * Physics.util.isPlainObject( val ) -> Boolean\n * - val (Mixed): The value to test\n *\n * Test if a value is a plain javascript object.\n **/\nPhysics.util.isPlainObject = !Object.getPrototypeOf ? shimIsPlainObject : function(value) {\n if (!(value && toString.call(value) === objectClass)) {\n return false;\n }\n var valueOf = value.valueOf,\n objProto = isNative(valueOf) && (objProto = Object.getPrototypeOf(valueOf)) && Object.getPrototypeOf(objProto);\n\n return objProto ?\n (value === objProto || Object.getPrototypeOf(value) === objProto) :\n shimIsPlainObject(value);\n};\n\nfunction baseUniq(array, isSorted, callback) {\n var index = -1,\n indexOf = Physics.util.indexOf,\n length = array ? array.length : 0,\n result = [];\n\n var isLarge = !isSorted && length >= largeArraySize && indexOf === Physics.util.indexOf,\n seen = (callback || isLarge) ? getArray() : result;\n\n if (isLarge) {\n var cache = createCache(seen);\n indexOf = cacheIndexOf;\n seen = cache;\n }\n while (++index < length) {\n var value = array[index],\n computed = callback ? callback(value, index, array) : value;\n\n if (isSorted ?\n !index || seen[seen.length - 1] !== computed :\n indexOf(seen, computed) < 0\n ) {\n if (callback || isLarge) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n if (isLarge) {\n releaseArray(seen.array);\n releaseObject(seen);\n } else if (callback) {\n releaseArray(seen);\n }\n return result;\n}\n\n/**\n * Physics.util.uniq( array, [isSorted, callback] ) -> Array\n * - array (Array): The array\n * - isSorted (Boolean): Flag to indicate the array is sorted\n * - callback (Function): Mapping function\n *\n * Create an array without duplicates.\n **/\nPhysics.util.uniq = function uniq(array, isSorted, callback) {\n // juggle arguments\n if (typeof isSorted !== 'boolean' && isSorted != null) {\n callback = isSorted;\n isSorted = false;\n }\n return baseUniq(array, isSorted, callback);\n};\n\nvar assign = function(object, source, guard) {\n var index, iterable = object, result = iterable;\n if (!iterable) { return result; }\n var args = arguments,\n argsIndex = 0,\n callback,\n argsLength = typeof guard === 'number' ? 2 : args.length;\n if (argsLength > 2 && typeof args[argsLength - 1] === 'function') {\n callback = args[--argsLength];\n }\n while (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n result[index] = callback ? callback(result[index], iterable[index]) : iterable[index];\n }\n }\n }\n return result;\n};\n\n/**\n * Physics.util.extend( object, source...[, callback] ) -> Object\n * - object (Object): The destination object\n * - source (Object): The source objects\n * - callback (Function): The function to customize assigning values\n *\n * Implementation of [lodash.extend](http://lodash.com/docs#assign)\n **/\nPhysics.util.extend = assign;\n\n/**\n * Physics.util.defaults( object, source...[, callback] ) -> Object\n * - object (Object): The destination object\n * - source (Object): The source objects\n * - callback (Function): The function to customize assigning values\n *\n * Implementation of [lodash.defaults](http://lodash.com/docs#defaults).\n **/\nPhysics.util.defaults = function(object, source, guard) {\n var index, iterable = object, result = iterable;\n if (!iterable){ return result; }\n var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard === 'number' ? 2 : args.length;\n while (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n if (typeof result[index] === 'undefined') {\n result[index] = iterable[index];\n }\n }\n }\n }\n return result;\n};\n\n/**\n * Physics.util.sortedIndex( array, value[, callback] ) -> Number\n * - array (Array): The array to inspect\n * - value (Mixed): The value to evaluate\n * - callback (Function): Function called per iteration\n *\n * Implementation of [lodash.sortedIndex](http://lodash.com/docs#sortedIndex).\n **/\nPhysics.util.sortedIndex = function sortedIndex(array, value, callback) {\n var low = 0,\n high = array ? array.length : low;\n\n // explicitly reference `identity` for better inlining in Firefox\n callback = callback || identity;\n value = callback(value);\n\n /* jshint -W030 */\n while (low < high) {\n var mid = (low + high) >>> 1;\n (callback(array[mid]) < value) ?\n low = mid + 1 :\n high = mid;\n }\n /* jshint +W030 */\n return low;\n};\n\n})();\n\n\n// ---\n// inside: src/util/scratchpad.js\n\n/*\n * scratchpad\n * thread-safe management of temporary (voletile)\n * objects for use in calculations\n * https://github.com/wellcaffeinated/scratchpad.js\n */\nPhysics.scratchpad = (function(){\n\n // Errors\n var SCRATCH_USAGE_ERROR = 'Error: Scratchpad used after .done() called. (Could it be unintentionally scoped?)';\n var SCRATCH_INDEX_OUT_OF_BOUNDS = 'Error: Scratchpad usage space out of bounds. (Did you forget to call .done()?)';\n var SCRATCH_MAX_REACHED = 'Error: Too many scratchpads created. (Did you forget to call .done()?)';\n var ALREADY_DEFINED_ERROR = 'Error: Object is already registered.';\n\n // cache previously created scratches\n var scratches = [];\n var numScratches = 0;\n var Scratch, Scratchpad;\n\n var regIndex = 0;\n\n\n /** belongs to: Physics.scratchpad\n * class Scratch\n *\n * A scratchpad session.\n *\n * This class keeps track of temporary objects used\n * in this session and releases them when finished (call to `.done()`).\n *\n * Use this to retrieve temporary objects:\n * - `.vector()`: retrieve a temporary [[Physics.vector]]\n * - `.transform()`: retrieve a temporary [[Physics.transform]]\n *\n * See [[Physics.scratchpad]] for more info.\n **/\n Scratch = function Scratch(){\n\n // private variables\n this._active = false;\n this._indexArr = [];\n\n if (++numScratches >= Scratchpad.maxScratches){\n throw SCRATCH_MAX_REACHED;\n }\n };\n\n Scratch.prototype = {\n\n /**\n * Scratch#done( [val] ) -> Mixed\n * - val (Mixed): No effect on this method, just passed on to the return value so you can do things like:\n return scratch.done( myReturnVal );\n * + (Mixed): Whatever you specified as `val`\n *\n * Declare that your work is finished.\n *\n * Release temp objects for use elsewhere. Must be called when immediate work is done.\n *\n * You can wrap the return value in scratch.done() so that you don't forget to call it.\n *\n * Example:\n *\n * ```javascript\n * return scratch.done( myReturnValue );\n * ```\n **/\n done: function( val ){\n\n this._active = false;\n var s;\n for ( var i = 0; i < regIndex; ++i ){\n\n this[ i ] = 0;\n }\n\n // add it back to the scratch stack for future use\n scratches.push( this );\n return val;\n }\n };\n\n\n // API\n\n /**\n * Physics.scratchpad( [fn] ) -> Scratch|Function\n * - fn (Function): Some function you'd like to wrap in a scratch session. First argument is the scratch instance.\n * + (Function): The wrapped function (if `fn` arg specified) that can be reused like the original minus the first (scratch) parameter.\n * + (Scratch): The scratch session.\n *\n * Get a new scratch session to work from or wrap a function in a scratch session.\n *\n * Call `.done()` on it when finished.\n *\n * Example:\n *\n * ```javascript\n * // get a scratch session manually\n * var myAlg = function( scratch, arg1, arg2, ... ){\n * var scratch = Physics.scratchpad()\n * ,vec = scratch.vector().set( 0, 0 ) // need to reinitialize... it's recycled!\n * ;\n * // ...\n * return scratch.done( result );\n * };\n * // later...\n * while( awesome ){\n * myAlg( arg1, arg2, ... );\n * }\n * ```\n *\n * Example:\n *\n * ```javascript\n * // wrap a function in a scratch session\n * var myAlg = Physics.scratchpad(function( scratch, arg1, arg2, ... ){\n * var vec = scratch.vector().set( 0, 0 ); // need to reinitialize... it's recycled!\n * //...\n * return result;\n * });\n * // later...\n * while( awesome ){\n * myAlg( arg1, arg2, ... );\n * }\n * ```\n **/\n Scratchpad = function Scratchpad( fn ){\n\n if ( fn ){\n return Scratchpad.fn( fn );\n }\n\n var scratch = scratches.pop() || new Scratch();\n scratch._active = true;\n return scratch;\n };\n\n // options\n Scratchpad.maxScratches = 100; // maximum number of scratches\n Scratchpad.maxIndex = 20; // maximum number of any type of temp objects\n\n /**\n * Physics.scratchpad.fn( fn ) -> Function\n * - fn (Function): Some function you'd like to wrap in a scratch session. First argument is the scratch instance. See [[Physics.scratchpad]].\n * + (Function): The wrapped function that can be reused like the original minus the first (scratch) parameter.\n *\n * Wrap a function in a scratch session.\n *\n * Same as calling `Physics.scratchpad( fn )` with a function specified.\n **/\n Scratchpad.fn = function( fn ){\n\n var args = [];\n for ( var i = 0, l = fn.length; i < l; i++ ){\n args.push( i );\n }\n\n args = 'a' + args.join(',a');\n /* jshint -W054 */\n var handle = new Function('fn, scratches, Scratch', 'return function('+args+'){ '+\n 'var scratch = scratches.pop() || new Scratch( scratches );'+\n 'scratch._active = true;'+\n 'return scratch.done( fn(scratch, '+args+') );'+\n '};'\n );\n /* jshint +W054 */\n\n return handle(fn, scratches, Scratch);\n };\n\n /**\n * Physics.scratchpad.register( name, constructor )\n * - name (String): Name of the object class\n * - constructor (Function): The object constructor\n *\n * Register a new object to be included in scratchpads.\n *\n * Example:\n *\n * ```javascript\n * // register a hypothetical vector class...\n * Physics.scratchpad.register('vector', Vector);\n * ```\n **/\n Scratchpad.register = function register( name, constructor, options ){\n\n var proto = Scratch.prototype\n ,idx = regIndex++ // increase the scratch type index\n ,stackname = '_' + name + 'Stack' // the name of the array stack\n ,useFactory = options && options.useFactory\n ;\n\n if ( name in proto ) {\n throw ALREADY_DEFINED_ERROR;\n }\n\n // create a new function on the prototype\n Scratch.prototype[ name ] = function(){\n\n // get the stack (or initialize it)\n var stack = this[ stackname ] || (this[ stackname ] = [])\n // we increase this index every time a voletile object is requested\n // seems weird to store it on this as a number (ie: this.0, this.1)...\n // but actually it's faster...\n ,stackIndex = this[ idx ] | 0\n ;\n\n this[ idx ] = stackIndex + 1;\n\n // if used after calling done...\n if (!this._active){\n throw SCRATCH_USAGE_ERROR;\n }\n\n // if too many objects created...\n if (stackIndex >= Scratchpad.maxIndex){\n throw SCRATCH_INDEX_OUT_OF_BOUNDS;\n }\n\n // return or create new instance\n return stack[ stackIndex ] ||\n (stack[ stackIndex ] = useFactory ? constructor() : new constructor() );\n };\n\n };\n\n // register some classes\n Scratchpad.register('vector', Physics.vector);\n Scratchpad.register('transform', Physics.transform);\n\n return Scratchpad;\n\n})();\n\n\n// ---\n// inside: src/util/pubsub.js\n\n(function(){\n\n var defaultPriority = 1;\n\n function getPriority( val ){\n return val._priority_;\n }\n\n // register a new scratch object so we can reuse event data\n Physics.scratchpad.register('event', function(){ return {}; }, { useFactory: true });\n\n /**\n * class Physics.util.pubsub\n *\n * Fast pubsub implementation.\n *\n * Can be mixed into other classes easily.\n **/\n var PubSub = function PubSub(){\n\n if (!(this instanceof PubSub)){\n return new PubSub();\n }\n };\n\n PubSub.prototype = {\n\n /**\n * Physics.util.pubsub#on( topic, fn( data, event )[, scope, priority] ) -> this\n * Physics.util.pubsub#on( topicConfig[, scope, priority] ) -> this\n * - topic (String): The topic name\n * - topicConfig (Object): A config with key/value pairs of `{ topic: callbackFn, ... }`\n * - fn (Function): The callback function (if not using Object as previous argument)\n * - data (Mixed): The data sent from the call to `.emit()`\n * - event (Object): Event data, holding `.topic`, the topic, and `.handler`, the `fn` callback.\n * - scope (Object): The scope to bind callback to\n * - priority (Number): The priority of the callback (higher is earlier)\n *\n * Subscribe callback(s) to a topic(s).\n **/\n on: function( topic, fn, scope, priority ){\n\n var listeners\n ,orig\n ,idx\n ;\n\n // ensure topics hash is initialized\n this._topics = this._topics || (this._topics = {});\n\n // check if we're subscribing to multiple topics\n // with an object\n if ( Physics.util.isObject( topic ) ){\n\n for ( var t in topic ){\n\n this.on( t, topic[ t ], fn, scope );\n }\n\n return this;\n }\n\n listeners = this._topics[ topic ] || (this._topics[ topic ] = []);\n orig = fn;\n\n if ( Physics.util.isObject( scope ) ){\n\n fn = Physics.util.bind( fn, scope );\n fn._bindfn_ = orig;\n fn._one_ = orig._one_;\n fn._scope_ = scope;\n\n } else if ( priority === undefined ) {\n\n priority = scope;\n }\n\n fn._priority_ = priority === undefined ? defaultPriority : priority;\n\n idx = Physics.util.sortedIndex( listeners, fn, getPriority );\n\n listeners.splice( idx, 0, fn );\n return this;\n },\n\n /**\n * Physics.util.pubsub#off( topic, fn[, scope] ) -> this\n * Physics.util.pubsub#off( topicCfg ) -> this\n * - topic (String): topic The topic name. Specify `true` to remove all listeners for all topics\n * - topicCfg (Object): A config with key/value pairs of `{ topic: callbackFn, ... }`\n * - fn (Function): The original callback function. Specify `true` to remove all listeners for specified topic\n * - scope (Object): The scope the callback was bound to. This is important if you are binding methods that come from object prototypes.\n *\n * Unsubscribe callback(s) from topic(s).\n **/\n off: function( topic, fn, scope ){\n\n var listeners\n ,listn\n ;\n\n if ( !this._topics ){\n // nothing subscribed\n return this;\n }\n\n if ( topic === true ){\n // purge all listeners\n this._topics = {};\n return this;\n }\n\n // check if we're subscribing to multiple topics\n // with an object\n if ( Physics.util.isObject( topic ) ){\n\n for ( var t in topic ){\n\n this.off( t, topic[ t ] );\n }\n\n return this;\n }\n\n listeners = this._topics[ topic ];\n\n if (!listeners){\n return this;\n }\n\n if ( fn === true ){\n // purge all listeners for topic\n this._topics[ topic ] = [];\n return this;\n }\n\n for ( var i = 0, l = listeners.length; i < l; i++ ){\n\n listn = listeners[ i ];\n\n if (\n (listn._bindfn_ === fn || listn === fn) &&\n ( (!scope) || listn._scope_ === scope) // check the scope too if specified\n ){\n listeners.splice( i, 1 );\n break;\n }\n }\n\n return this;\n },\n\n /**\n * Physics.util.pubsub#emit( topic[, data] ) -> this\n * - topic (String): The topic name\n * - data (Mixed): The data to send\n *\n * Publish data to a topic.\n **/\n emit: function( topic, data ){\n\n if ( !this._topics ){\n // nothing subscribed\n return this;\n }\n\n var listeners = this._topics[ topic ]\n ,l = listeners && listeners.length\n ,handler\n ,e\n ,scratch = Physics.scratchpad()\n ;\n\n if ( !l ){\n return scratch.done(this);\n }\n\n e = scratch.event();\n // event data\n e.topic = topic;\n e.handler = handler;\n\n // reverse iterate so priorities work out correctly\n while ( l-- ){\n\n handler = listeners[ l ];\n handler( data, e );\n\n // if _one_ flag is set, the unsubscribe\n if ( handler._one_ ){\n listeners.splice( l, 1 );\n }\n }\n\n return scratch.done(this);\n },\n\n /**\n * Physics.util.pubsub#one( topic, fn( data, event )[, scope, priority] ) -> this\n * Physics.util.pubsub#one( topicConfig[, scope, priority] ) -> this\n * - topic (String): The topic name\n * - topicConfig (Object): A config with key/value pairs of `{ topic: callbackFn, ... }`\n * - fn (Function): The callback function (if not using Object as previous argument)\n * - data (Mixed): The data sent from the call to `.emit()`\n * - event (Object): Event data, holding `.topic`, the topic, and `.handler`, the `fn` callback.\n * - scope (Object): The scope to bind callback to\n * - priority (Number): The priority of the callback (higher is earlier)\n *\n * Subscribe callback(s) to a topic(s), but only ONCE.\n **/\n one: function( topic, fn, scope ){\n\n // check if we're subscribing to multiple topics\n // with an object\n if ( Physics.util.isObject( topic ) ){\n\n for ( var t in topic ){\n\n this.one( t, topic[ t ], fn, scope );\n }\n\n return this;\n }\n\n // set the _one_ flag\n fn._one_ = true;\n this.on( topic, fn, scope );\n\n return this;\n }\n };\n\n Physics.util.pubsub = PubSub;\n})();\n\n\n// ---\n// inside: src/util/ticker.js\n\n/**\n * class Physics.util.ticker\n *\n * The Ticker _singleton_ for easily binding callbacks to animation loops (requestAnimationFrame).\n *\n * Requires window.requestAnimationFrame... so polyfill it if you need to.\n **/\n(function(window){\n\n var active = true\n ,ps = Physics.util.pubsub()\n ,perf = window.performance\n ;\n\n function now(){\n // http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n return (perf && perf.now) ?\n (perf.now() + perf.timing.navigationStart) :\n Date.now();\n }\n\n /*\n * step( time )\n * - time (Number): The current time\n *\n * Publish a tick to subscribed callbacks\n */\n function step(){\n\n var time;\n\n window.requestAnimationFrame( step );\n\n if (!active){\n return;\n }\n\n time = now();\n\n if (!time){\n return;\n }\n\n ps.emit( 'tick', time );\n }\n\n // start stepping if we can\n if ( window.requestAnimationFrame ){\n step();\n } else {\n active = false;\n }\n\n /**\n * Physics.util.ticker.start() -> this\n *\n * Start the ticker\n **/\n function start(){\n\n active = true;\n return this;\n }\n\n /**\n * Physics.util.ticker.stop() -> this\n *\n * Stop the ticker\n **/\n function stop(){\n\n active = false;\n return this;\n }\n\n /**\n * Physics.util.ticker.on( listener( time ) ) -> this\n * - listener (Function): The callback function\n * - time (Number): The current timestamp\n *\n * Subscribe a callback to the ticker.\n **/\n function on( listener ){\n\n ps.on('tick', listener);\n return this;\n }\n\n /**\n * Physics.util.ticker.off( listener ) -> this\n * - listener (Function): The callback function previously bound\n *\n * Unsubscribe a callback from the ticker.\n **/\n function off( listener ){\n\n ps.off('tick', listener);\n return this;\n }\n\n /**\n * Physics.util.ticker.isActive() -> Boolean\n * + (Boolean): `true` if running, `false` otherwise.\n *\n * Determine if ticker is currently running.\n **/\n function isActive(){\n\n return !!active;\n }\n\n // API\n Physics.util.ticker = {\n now: now,\n start: start,\n stop: stop,\n on: on,\n off: off,\n isActive: isActive\n };\n\n}(this));\n\n\n// ---\n// inside: src/core/query.js\n\n(function (window) {\n\n /*\n * Group helpers\n */\n var fnTrue = function(){ return !0; }; // return true\n \n var indexOf = Physics.util.indexOf;\n\n /** hide\n * wrapRule( fn( propVal ), prop ) -> Function\n * - fn (Function): The test function\n * - prop (String): The property name to test\n * - propVal (Mixed): The property value\n * \n * Get test function to test on sub property.\n **/\n var wrapRule = function wrapRule( fn, prop ){\n return function( thing ){\n return fn( thing[ prop ] );\n };\n };\n\n /** hide\n * $eq( toMatch[, prop] ) -> Function\n * - toMatch (Mixed): The value to match\n * - prop (String): The property name to test\n * \n * Get an equality test function.\n **/\n var $eq = function $eq( toMatch, prop ){\n return function( thing ){\n \n thing = prop ? thing[ prop ] : thing;\n\n var fr = 0\n ,bk\n ;\n \n if ( Physics.util.isArray( thing ) ){\n\n if ( Physics.util.isArray( toMatch ) ){\n // match all\n bk = thing.length;\n\n // check lengths\n if ( bk !== toMatch.length ){\n return false;\n }\n\n while ( fr < bk ){\n bk--;\n if (\n // check front\n (indexOf(toMatch, thing[ fr ]) === -1) ||\n // check back\n (indexOf(toMatch, thing[ bk ]) === -1)\n ) {\n return false;\n }\n fr++;\n }\n return true;\n } else {\n // find in array\n return (indexOf( thing, toMatch ) > -1);\n }\n }\n\n // exact match\n return (thing === toMatch);\n };\n };\n\n /** hide\n * $ne( toMatch[, prop] ) -> Function\n * - toMatch (Mixed): The value to match\n * - prop (String): The property name to test\n * \n * Get a NOT equality test function.\n **/\n var $ne = function $ne( toMatch, prop ){\n var fn = $eq( toMatch, prop );\n return function( thing ){\n return !fn( thing );\n };\n };\n\n /** hide\n * $in( toMatch[, prop] ) -> Function\n * - toMatch (Array): The array to match\n * - prop (String): The property name to test\n * \n * Get a test function for matching ANY in array\n **/\n var $in = function $in( toMatch, prop ){\n return function( thing ){\n\n thing = prop ? thing[ prop ] : thing;\n \n var fr = 0\n ,bk\n ;\n\n if ( Physics.util.isArray( thing ) ){\n bk = thing.length;\n\n while( fr < bk ){\n bk--;\n if (\n // check front\n (indexOf(toMatch, thing[ fr ]) > -1) ||\n // check back\n (indexOf(toMatch, thing[ bk ]) > -1)\n ) {\n return true;\n }\n fr++;\n }\n return false;\n }\n\n // if thing matches any in array\n return (indexOf(toMatch, thing) > -1);\n };\n };\n\n /** hide\n * $nin( toMatch[, prop] ) -> Function\n * - toMatch (Array): The array to match\n * - prop (String): The property name to test\n * \n * Get a test function for matching NOT ANY in array\n **/\n var $nin = function $nin( toMatch, prop ){\n var fn = $in( toMatch, prop );\n return function( thing ){\n return !fn( thing );\n };\n };\n\n /** hide\n * $at( point ) -> Function\n * - point (Vectorish): The point to check\n * \n * Get a test function to match any body who's aabb intersects point\n **/\n var $at = function $at( point ){\n point = new Physics.vector( point );\n return function( body ){\n var aabb = body.aabb();\n return Physics.aabb.contains( aabb, point );\n };\n };\n\n /** hide\n * $and( first ) -> Function\n * - first (Function): First function node. `first.next` should have the next function, and so on.\n * \n * Get an AND test function.\n **/\n var $and = function $and( first ){\n return first.next ? function( thing ){\n var fn = first;\n while ( fn ){\n\n if ( !fn( thing ) ){\n return false;\n }\n fn = fn.next;\n }\n return true;\n } : first;\n };\n\n /** hide\n * $or( first ) -> Function\n * - first (Function): First function node. `first.next` should have the next function, and so on.\n * \n * Get an OR test function.\n **/\n var $or = function $or( first ){\n return first.next ? function( thing ){\n var fn = first;\n while ( fn ){\n\n if ( fn( thing ) ){\n return true;\n }\n fn = fn.next;\n }\n return false;\n } : first;\n };\n\n // operation hash\n var operations = {\n // $and and $or are separate\n $eq: $eq\n ,$ne: $ne\n ,$in: $in\n ,$nin: $nin\n ,$at: $at\n };\n\n /** related to: Physics.world#find\n * Physics.query( rules ) -> Function\n * - rules (Object): The mongodb-like search rules. (See description).\n * + (Function): The test function\n * \n * Creates a function that can be used to perform tests on objects.\n *\n * The test function will return a [[Boolean]]; `true` if the object matches the tests.\n *\n * Query rules are mongodb-like. You can specify a hash of values to match like this:\n *\n * ```javascript\n * {\n * foo: 'bar',\n * baz: 2,\n * some: {\n * nested: 'value'\n * }\n * }\n * ```\n *\n * And they will all need to match (it's an AND rule).\n *\n * You can also use operators for more versatility. The operators you can use include:\n *\n * - $eq: Test if some property is equal to a value (this is done by default, and is thus redundant)\n * - $ne: Test if some property is _NOT_ equal to a value\n * - $in: Test if some value (or array of values) is one of the specified array of values\n * - $nin: Test if some value (or array of values) is _NOT_ one of the specified array of values\n * - $at: Test if a body's [[Physics.aabb]] includes specified point. It's a primative hit-test.\n * \n * Example:\n *\n * ```javascript\n * var wheelsArray = [];\n * \n * var queryFn = Physics.query({\n * name: 'circle', // only circles\n * $nin: wheelsArray, // not in the wheelsArray\n * labels: { $in: [ 'player', 'monster' ] } // that have player OR monster labels\n * });\n *\n * var obj = {\n * name: 'circle',\n * labels: [ 'round' ]\n * };\n *\n * queryFn( obj ); // -> false\n * // give it a player tag\n * obj.labels.push('player');\n * queryFn( obj ); // -> true\n * // put it inside the wheelsArray\n * wheelsArray.push( obj );\n * queryFn( obj ); // -> false\n * ```\n **/\n var Query = function Query( rules, /* internal use */ $op ){\n\n var op\n ,l\n ,rule\n ,first\n ,list\n ,fn\n ;\n\n if ( $op ){\n \n // parse operation choice\n if ( $op === '$or' || $op === '$and' ){\n\n // expect a rules array\n for ( op = 0, l = rules.length; op < l; ++op ){\n \n fn = Query( rules[ op ] );\n // if first hasn't been set yet, set it and start the list there\n // otherwise set the next node of the list\n list = list ? list.next = fn : first = fn;\n }\n\n return ($op === '$or') ? $or( first ) : $and( first );\n } else if ( op = operations[ $op ] ){\n\n return op( rules );\n\n } else {\n // does not compute...\n throw 'Unknown query operation: ' + $op;\n }\n }\n\n // loop through rules\n for ( op in rules ){\n rule = rules[ op ];\n \n if ( op[0] === '$' ){\n // it's an operation rule\n fn = Query( rule, op );\n \n } else if ( Physics.util.isPlainObject( rule ) ) {\n // it's an object so parse subrules\n fn = wrapRule( Query( rule ), op );\n } else {\n // simple equality rule\n fn = $eq( rule, op );\n }\n\n // if first hasn't been set yet, set it and start the list there\n // otherwise set the next node of the list\n list = list ? list.next = fn : first = fn;\n }\n\n // return the rules test\n return $and( first || fnTrue );\n };\n\n Physics.query = Query;\n\n})(this);\n\n\n// ---\n// inside: src/core/behavior.js\n\n(function(){\n\n var defaults = {\n priority: 0\n };\n\n /** related to: Physics.util.decorator\n * Physics.behavior( name[, options] ) -> Behavior\n * - name (String): The name of the behavior to create\n * - options (Object): The configuration for that behavior ( depends on behavior ).\n Available options and defaults:\n \n ```javascript\n {\n priority: 0 // the priority of this body\n }\n ```\n *\n * Factory function for creating Behaviors.\n *\n * Visit [the PhysicsJS wiki on Behaviors](https://github.com/wellcaffeinated/PhysicsJS/wiki/Behaviors)\n * for usage documentation.\n **/\n Physics.behavior = Decorator('behavior', {\n\n /** belongs to: Physics.behavior\n * class Behavior\n *\n * The base class for behaviors created by [[Physics.behavior]] factory function.\n **/\n\n /** internal\n * Behavior#init( options )\n * - options (Object): The configuration options passed by the factory\n * \n * Initialization. Internal use.\n **/\n init: function( options ){\n \n /** related to: Physics.util.options\n * Behavior#options( options ) -> Object\n * - options (Object): The options to set as an object\n * + (Object): The options\n * \n * Set options on this instance. \n * \n * Access options directly from the options object.\n * \n * Example:\n *\n * ```javascript\n * this.options.someOption;\n * ```\n * \n **/\n this.options = Physics.util.options( defaults );\n this.options( options );\n },\n\n /**\n * Behavior#applyTo( arr ) -> this\n * - arr (Array): Array of bodies to apply this behavior to. Specify `true` for all objects in world.\n * \n * Apply the behavior to a group of bodies.\n **/\n applyTo: function( arr ){\n\n if ( arr === true ){\n this._targets = null;\n } else {\n this._targets = Physics.util.uniq( arr );\n }\n return this;\n },\n\n /**\n * Behavior#getTargets() -> Array\n * + (Array): The array of bodies (by reference!) this behavior is applied to.\n * \n * Get the array of bodies (by reference!) this behavior is applied to.\n **/\n getTargets: function(){\n \n return this._targets || ( this._world ? this._world._bodies : [] );\n },\n\n /**\n * Behavior#setWorld( world ) -> this\n * - world (Object): The world (or null)\n *\n * Set which world to apply to.\n *\n * Usually this is called internally. Shouldn't be a need to call this yourself usually.\n **/\n setWorld: function( world ){\n\n if ( this.disconnect && this._world ){\n this.disconnect( this._world );\n }\n\n this._world = world;\n\n if ( this.connect && world ){\n this.connect( world );\n }\n\n return this;\n },\n\n /**\n * Behavior#connect( world )\n * - world (Physics.world): The world to connect to\n * \n * Connect to a world.\n *\n * Extend this when creating behaviors if you need to specify pubsub management.\n * Automatically called when added to world by the [[Behavior#setWorld]] method.\n **/\n connect: function( world ){\n\n if (this.behave){\n world.on('integrate:positions', this.behave, this, this.options.priority);\n }\n },\n\n /**\n * Behavior#disconnect( world )\n * - world (Physics.world): The world to disconnect from\n * \n * Disconnect from a world.\n *\n * Extend this when creating behaviors if you need to specify pubsub management.\n * Automatically called when added to world by the [[Behavior#setWorld]] method.\n **/\n disconnect: function( world ){\n\n if (this.behave){\n world.off('integrate:positions', this.behave, this);\n }\n },\n\n /**\n * Behavior#behave( data )\n * - data (Object): The pubsub `integrate:positions` event data\n * \n * Default method run on every world integration.\n *\n * You _must_ extend this when creating a behavior,\n * unless you extend the [[Behavior#connect]] and [[Behavior#disconnect]] methods.\n **/\n behave: null\n });\n\n}());\n\n// ---\n// inside: src/core/body.js\n\n(function(){\n\n var defaults = {\n\n // is the body hidden (not to be rendered)?\n hidden: false,\n // is the body `dynamic`, `kinematic` or `static`?\n // http://www.box2d.org/manual.html#_Toc258082973\n treatment: 'dynamic',\n // body mass\n mass: 1.0,\n // body restitution. How \"bouncy\" is it?\n restitution: 1.0,\n // what is its coefficient of friction with another surface with COF = 1?\n cof: 0.8,\n // what is the view object (mixed) that should be used when rendering?\n view: null\n };\n\n var uidGen = 1;\n\n var Pi2 = Math.PI * 2;\n function cycleAngle( ang ){\n return ((ang % Pi2) + Pi2) % Pi2;\n }\n\n /** related to: Physics.util.decorator\n * Physics.body( name[, options] ) -> Body\n * - name (String): The name of the body to create\n * - options (Object): The configuration for that body ( depends on body ).\n Available options and defaults:\n\n ```javascript\n {\n // is the body hidden (not to be rendered)?\n hidden: false,\n // is the body `dynamic`, `kinematic` or `static`?\n // http://www.box2d.org/manual.html#_Toc258082973\n treatment: 'dynamic',\n // body mass\n mass: 1.0,\n // body restitution. How \"bouncy\" is it?\n restitution: 1.0,\n // what is its coefficient of friction with another surface with COF = 1?\n cof: 0.8,\n // what is the view object (mixed) that should be used when rendering?\n view: null,\n // the vector offsetting the geometry from its center of mass\n offset: Physics.vector(0,0)\n }\n ```\n *\n * Factory function for creating Bodies.\n *\n * Visit [the PhysicsJS wiki on Bodies](https://github.com/wellcaffeinated/PhysicsJS/wiki/Bodies)\n * for usage documentation.\n **/\n Physics.body = Decorator('body', {\n\n /** belongs to: Physics.body\n * class Body\n *\n * The base class for bodies created by [[Physics.body]] factory function.\n **/\n\n /** internal\n * Body#init( options )\n * - options (Object): The configuration options passed by the factory\n *\n * Initialization. Internal use.\n **/\n init: function( options ){\n\n var self = this;\n var vector = Physics.vector;\n\n /** related to: Physics.util.options\n * Body#options( options ) -> Object\n * - options (Object): The options to set as an object\n * + (Object): The options\n *\n * Set options on this instance.\n *\n * Access options directly from the options object.\n *\n * Example:\n *\n * ```javascript\n * this.options.someOption;\n * ```\n *\n **/\n // all options get copied onto the body.\n this.options = Physics.util.options( defaults, this );\n this.options.onChange(function( opts ){\n self.offset = new vector( opts.offset );\n });\n this.options( options );\n\n /**\n * Body#state\n *\n * The physical state container.\n *\n * - ``this.state.pos`` ([[Physics.vector]]) The position vector.\n * - ``this.state.vel`` ([[Physics.vector]]) The velocity vector.\n * - ``this.state.acc`` ([[Physics.vector]]) The acceleration vector.\n * - ``this.state.angular.pos`` ([[Number]]) The angular position (in radians, positive is clockwise starting along the x axis)\n * - ``this.state.angular.vel`` ([[Number]]) The angular velocity\n * - ``this.state.angular.acc`` ([[Number]]) The angular acceleration\n *\n * Properties from the previous timestep are stored in:\n * ```javascript\n * this.state.old; // .pos, .vel, ...\n * ```\n **/\n this.state = {\n pos: new vector( this.x, this.y ),\n vel: new vector( this.vx, this.vy ),\n acc: new vector(),\n angular: {\n pos: this.angle || 0.0,\n vel: this.angularVelocity || 0.0,\n acc: 0.0\n },\n old: {\n pos: new vector(),\n vel: new vector(),\n acc: new vector(),\n angular: {\n pos: 0.0,\n vel: 0.0,\n acc: 0.0\n }\n }\n };\n\n // private storage for sleeping\n this._sleepAngPosMean = 0;\n this._sleepAngPosVariance = 0;\n this._sleepPosMean = new vector();\n this._sleepPosVariance = new vector();\n this._sleepMeanK = 0;\n\n // cleanup\n delete this.x;\n delete this.y;\n delete this.vx;\n delete this.vy;\n delete this.angle;\n delete this.angularVelocity;\n\n if (this.mass === 0){\n throw \"Error: Bodies must have non-zero mass\";\n }\n\n /**\n * Body#uid = Number\n *\n * The unique id for the body\n **/\n this.uid = uidGen++;\n\n /** related to: Physics.geometry\n * Body#geometry\n *\n * The geometry for this body.\n *\n * By default it is a `point` geometry which gets overridden.\n **/\n this.geometry = Physics.geometry('point');\n\n /**\n * Body#mass = 1.0\n *\n * The mass.\n **/\n\n /**\n * Body#offset\n *\n * The vector offsetting the body's shape from its center of mass.\n **/\n\n /**\n * Body#restitution = 1.0\n *\n * The restitution.\n *\n * This is the \"bounciness\" of the body.\n * It's a number between `0` and `1`.\n *\n * A restitution of 1 is the bounciest.\n *\n * A restitution of 0 is not bouncy.\n *\n * When colliding the restitutions of bodies are\n * multiplied together to get the restitution between two\n * bodies.\n *\n **/\n\n /**\n * Body#cof = 0.8\n *\n * The coefficient of friction of the body.\n *\n * It's how much \"slide\" it has during collisions.\n *\n * A `cof` of `0` will really slidy.\n *\n * A `cof` of `1` has no slide.\n *\n * This is a very simplistic implementation at the moment.\n * What would be better is to have both static and kinetic\n * friction. But that's not done yet.\n **/\n\n /**\n * Body#treatment = String\n *\n * How the body is treated by the simulation.\n *\n * The body can be `dynamic`, `kinematic` or `static` as\n * described by the [analogous box2d docs](http://www.box2d.org/manual.html#_Toc258082973).\n *\n * * _dynamic_ bodies are treated \"normally\". They are integrated, and collide, and all that.\n * * _kinematic_ bodies are bodies that move at a specified velocity. Other bodies collide with them, but they don't bounce off of other bodies.\n * * _static_ bodies just stand still. They are like obstacles.\n **/\n\n /**\n * Body#hidden = false\n *\n * Determines whether the body should be hidden by the renderer.\n **/\n\n /** related to: Physics.renderer\n * Body#view = it_depends\n *\n * Storage for use by the renderer.\n *\n * The type of renderer will put different things in the view property.\n * Basically, this is how the body \"looks\". It could be a HTMLElement, or\n * an Image, etc...\n *\n * If your body changes appearance (shape), you should modify this somehow\n * otherwise the renderer will keep using this same view. If you're letting\n * the renderer create the view for you, just set this to `undefined` if the\n * body gets modified in shape during the simulation.\n **/\n\n /** related to: Physics.renderer\n * Body#styles\n *\n * The styles the renderer should use for creating the view.\n *\n * The styles depend on the renderer. See [[Renderer#createView]] for style options.\n **/\n },\n\n /**\n * Body#sleep( [dt] ) -> Boolean\n * - dt (Number): Time to advance the idle time\n * - dt (Boolean): If `true`, the body will be forced to sleep. If `false`, the body will be forced to awake.\n *\n * Get and/or set whether the body is asleep.\n *\n * If called with a time (in ms), the time will be added to the idle time and sleep conditions will be checked.\n **/\n sleep: function( dt ){\n\n if ( dt === true ){\n // force sleep\n this.asleep = true;\n\n } else if ( dt === false ){\n // force wakup\n this.asleep = false;\n this._sleepMeanK = 0;\n this._sleepAngPosMean = 0;\n this._sleepAngPosVariance = 0;\n this._sleepPosMean.zero();\n this._sleepPosVariance.zero();\n this.sleepIdleTime = 0;\n\n } else if ( dt && !this.asleep ) {\n\n this.sleepCheck( dt );\n }\n\n return this.asleep;\n },\n\n /**\n * Body#sleepCheck( [dt] )\n * - dt (Number): Time to advance the idle time\n *\n * Check if the body should be sleeping.\n *\n * Call with no arguments if some event could possibly wake up the body. This will force the body to recheck.\n **/\n sleepCheck: function( dt ){\n\n var opts = this._world && this._world.options;\n\n // if sleeping disabled. stop.\n if ( this.sleepDisabled || (opts && opts.sleepDisabled) ){\n return;\n }\n\n var limit\n ,v\n ,d\n ,r\n ,aabb\n ,scratch = Physics.scratchpad()\n ,diff = scratch.vector()\n ,diff2 = scratch.vector()\n ,kfac\n ,stats\n ;\n\n dt = dt || 0;\n aabb = this.geometry.aabb();\n r = Math.max(aabb.hw, aabb.hh);\n\n if ( this.asleep ){\n // check velocity\n v = this.state.vel.norm() + Math.abs(r * this.state.angular.vel);\n limit = this.sleepSpeedLimit || (opts && opts.sleepSpeedLimit) || 0;\n\n if ( v >= limit ){\n this.sleep( false );\n return scratch.done();\n }\n }\n\n this._sleepMeanK++;\n kfac = this._sleepMeanK > 1 ? 1/(this._sleepMeanK - 1) : 0;\n Physics.statistics.pushRunningVectorAvg( this.state.pos, this._sleepMeanK, this._sleepPosMean, this._sleepPosVariance );\n // we take the sin because that maps the discontinuous angle to a continuous value\n // then the statistics calculations work better\n stats = Physics.statistics.pushRunningAvg( Math.sin(this.state.angular.pos), this._sleepMeanK, this._sleepAngPosMean, this._sleepAngPosVariance );\n this._sleepAngPosMean = stats[0];\n this._sleepAngPosVariance = stats[1];\n v = this._sleepPosVariance.norm() + Math.abs(r * Math.asin(stats[1]));\n v *= kfac;\n limit = this.sleepVarianceLimit || (opts && opts.sleepVarianceLimit) || 0;\n // console.log(v, limit, kfac, this._sleepPosVariance.norm(), stats[1])\n if ( v <= limit ){\n // check idle time\n limit = this.sleepTimeLimit || (opts && opts.sleepTimeLimit) || 0;\n this.sleepIdleTime = (this.sleepIdleTime || 0) + dt;\n\n if ( this.sleepIdleTime > limit ){\n this.asleep = true;\n }\n } else {\n this.sleep( false );\n }\n\n scratch.done();\n },\n\n /**\n * Body#setWorld( world ) -> this\n * - world (Object): The world (or null)\n *\n * Set which world to apply to.\n *\n * Usually this is called internally. Shouldn't be a need to call this yourself usually.\n **/\n setWorld: function( world ){\n\n if ( this.disconnect && this._world ){\n this.disconnect( this._world );\n }\n\n this._world = world;\n\n if ( this.connect && world ){\n this.connect( world );\n }\n\n return this;\n },\n\n /**\n * Body#accelerate( acc ) -> this\n * - acc (Physics.vector): The acceleration vector\n *\n * Accelerate the body by adding supplied vector to its current acceleration\n **/\n accelerate: function( acc ){\n\n if ( this.treatment === 'dynamic' ){\n this.state.acc.vadd( acc );\n }\n\n return this;\n },\n\n /**\n * Body#applyForce( force[, p] ) -> this\n * - force (Vectorish): The force vector\n * - p (Vectorish): The point vector from the COM at which to apply the force\n *\n * Apply a force at center of mass, or at point `p` relative to the center of mass\n **/\n applyForce: function( force, p ){\n\n if ( this.treatment !== 'dynamic' ){\n return this;\n }\n\n var scratch = Physics.scratchpad()\n ,r = scratch.vector()\n ,state\n ;\n\n // if no point at which to apply the force... apply at center of mass\n if ( p && this.moi ){\n\n // apply torques\n state = this.state;\n r.clone( p );\n // r cross F\n this.state.angular.acc -= r.cross( force ) / this.moi;\n }\n\n this.accelerate( r.clone( force ).mult( 1/this.mass ) );\n\n scratch.done();\n return this;\n },\n\n /** related to: Body#offset\n * Body#getGlobalOffset( [out] ) -> Physics.vector\n * - out (Physics.vector): A vector to use to put the result into. One is created if `out` isn't specified.\n * + (Physics.vector): The offset in global coordinates\n *\n * Get the body offset vector (from the center of mass) for the body's shape in global coordinates.\n **/\n getGlobalOffset: function( out ){\n\n out = out || new Physics.vector();\n out.clone( this.offset ).rotate( this.state.angular.pos );\n return out;\n },\n\n /** related to: Physics.aabb\n * Body#aabb() -> Object\n * + (Object): The aabb of this body\n *\n * Get the Axis aligned bounding box for the body in its current position and rotation\n **/\n aabb: function(){\n\n var angle = this.state.angular.pos\n ,scratch = Physics.scratchpad()\n ,v = scratch.vector()\n ,aabb = this.geometry.aabb( angle )\n ;\n\n this.getGlobalOffset( v );\n\n aabb.x += this.state.pos._[0] + v._[0];\n aabb.y += this.state.pos._[1] + v._[1];\n\n return scratch.done( aabb );\n },\n\n /**\n * Body#toBodyCoords( v ) -> Physics.vector\n * - v (Physics.vector): The vector to transform\n * + (Physics.vector): The transformed vector\n *\n * Transform a vector into coordinates relative to this body.\n **/\n toBodyCoords: function( v ){\n return v.vsub( this.state.pos ).rotate( -this.state.angular.pos );\n },\n\n /**\n * Body#toWorldCoords( v ) -> Physics.vector\n * - v (Physics.vector): The vector to transform\n * + (Physics.vector): The transformed vector\n *\n * Transform a vector from body coordinates into world coordinates.\n **/\n toWorldCoords: function( v ){\n return v.rotate( this.state.angular.pos ).vadd( this.state.pos );\n },\n\n /**\n * Body#recalc() -> this\n *\n * Recalculate properties.\n *\n * Intended to be overridden by subclasses. Call when body physical properties are changed.\n **/\n recalc: function(){\n // override to recalculate properties\n return this;\n }\n });\n\n /**\n * Body.getCOM( bodies[, com] ) -> Physics.vector\n * - bodies (Array): The list of bodies\n * - com (Physics.vector): The vector to put result into. A new vector will be created if not provided.\n * + (Physics.vector): The center of mass position\n *\n * Get center of mass position from list of bodies.\n **/\n Physics.body.getCOM = function( bodies, com ){\n // @TODO add a test for this fn\n var b\n ,pos\n ,i\n ,l = bodies && bodies.length\n ,M = 0\n ;\n\n com = com || new Physics.vector();\n\n if ( !l ){\n return com.zero();\n }\n\n if ( l === 1 ){\n return com.clone( bodies[0].state.pos );\n }\n\n com.zero();\n\n for ( i = 0; i < l; i++ ){\n b = bodies[ i ];\n pos = b.state.pos;\n com.add( pos._[0] * b.mass, pos._[1] * b.mass );\n M += b.mass;\n }\n\n com.mult( 1 / M );\n\n return com;\n };\n\n}());\n\n\n// ---\n// inside: src/core/geometry.js\n\n(function(){\n /** related to: Physics.util.decorator\n * Physics.geometry( name[, options] ) -> Geometry\n * - name (String): The name of the geometry to create\n * - options (Object): The configuration for that geometry ( depends on geometry ).\n *\n * Factory function for creating Geometries.\n *\n * Visit [the PhysicsJS wiki on Geometries](https://github.com/wellcaffeinated/PhysicsJS/wiki/Geometries)\n * for usage documentation.\n **/\n Physics.geometry = Decorator('geometry', {\n\n /** belongs to: Physics.geometry\n * class Geometry\n *\n * The base class for geometries created by [[Physics.geometry]] factory function.\n **/\n\n /** internal\n * Geometry#init( options )\n * - options (Object): The configuration options passed by the factory\n * \n * Initialization. Internal use.\n **/\n init: function( options ){\n\n /** related to: Physics.util.options\n * Geometry#options( options ) -> Object\n * - options (Object): The options to set as an object\n * + (Object): The options\n * \n * Set options on this instance. \n * \n * Access options directly from the options object.\n * \n * Example:\n *\n * ```javascript\n * this.options.someOption;\n * ```\n * \n **/\n this.options = Physics.util.options();\n this.options( options );\n\n this._aabb = new Physics.aabb();\n },\n \n /** related to: Physics.aabb\n * Geometry#aabb( angle ) -> Object\n * - angle (Number): The angle to rotate the geometry\n * + (Object): Bounding box values\n * \n * Get axis-aligned bounding box for this object (rotated by angle if specified).\n **/\n aabb: function( angle ){\n\n return Physics.aabb.clone(this._aabb);\n },\n\n /**\n * Geometry#getFarthestHullPoint( dir[, result] ) -> Physics.vector\n * - dir (Physics.vector): Direction to look\n * - result (Physics.vector): A vector to write result to. Speeds up calculations.\n * + (Physics.vector): The farthest hull point in local coordinates\n * \n * Get farthest point on the hull of this geometry\n * along the direction vector `dir`\n * returns local coordinates. Replaces result if provided.\n *\n * Assume all coordinates are relative to the geometry \n * centroid (IE: in the body frame).\n * \n * This should take a direction vector then it should\n * calculate the location (in that frame of reference)\n * of the point on the perimeter (hull) if you traveled\n * in a straight line from the centroid in the provided\n * direction. The result should be returned/set just like\n * it is in the other geometries.\n **/\n getFarthestHullPoint: function( dir, result ){\n\n result = result || new Physics.vector();\n\n // not implemented.\n return result.set( 0, 0 );\n },\n\n /** related to: Geometry#getFarthestHullPoint\n * Geometry#getFarthestCorePoint( dir[, result] ) -> Physics.vector\n * - dir (Physics.vector): Direction to look\n * - result (Physics.vector): A vector to write result to. Speeds up calculations.\n * + (Physics.vector): The farthest hull point in local coordinates\n * \n * Get farthest point on the core shape of this geometry\n * along the direction vector `dir`\n * returns local coordinates. Replaces result if provided.\n *\n * This does almost the same thing as [[Geometry#getFarthestHullPoint]]\n * but shrinks the shape by subtracting \"margin\" from it.\n * Return the position of the point on the \"core\" shape.\n **/\n getFarthestCorePoint: function( dir, result, margin ){\n\n result = result || new Physics.vector();\n\n // not implemented.\n return result.set( 0, 0 );\n }\n });\n\n}());\n\n// ---\n// inside: src/core/geometry-helpers.js\n\n/*\n * Geometry helper functions\n */\n\n/**\n * Physics.geometry.regularPolygonVertices( sides, radius ) -> Array\n * - sides (Number): Number of sides the polygon has\n * - radius (Number): Size from center to a vertex\n * + (Array): A list of [[Vectorish]] objects representing the vertices\n *\n * Generate a list of vertices for a regular polygon of any number of sides.\n **/\nPhysics.geometry.regularPolygonVertices = function( sides, radius ){\n var verts = []\n ,angle = Math.PI * 2 / sides\n ,a = 0\n ,i\n ;\n\n for ( i = 0; i < sides; i++ ){\n verts.push({\n x: radius * Math.cos( a )\n ,y: radius * Math.sin( a )\n });\n\n a += angle;\n }\n\n return verts;\n};\n\n/**\n * Physics.geometry.isPolygonConvex( hull ) -> Boolean\n * - hull (Array): Array of ([[Vectorish]]) vertices\n * + (Boolean): `true` if the polygon is convex. `false` otherwise.\n *\n * Determine if polygon hull is convex\n **/\nPhysics.geometry.isPolygonConvex = function( hull ){\n\n var scratch = Physics.scratchpad()\n ,prev = scratch.vector()\n ,next = scratch.vector()\n ,tmp = scratch.vector()\n ,ret = true\n ,sign = false\n ,l = hull.length\n ;\n\n if ( !hull || !l ){\n return false;\n }\n\n if ( l < 3 ){\n // it must be a point or a line...\n // which are convex\n scratch.done();\n return ret;\n }\n\n prev.clone( hull[ 0 ] ).vsub( tmp.clone( hull[ l - 1 ] ) );\n\n // loop over the edges of the hull and construct vectors of the current\n // edge and retain the last edge\n // add two to the length to do a full cycle\n for ( var i = 1; i <= l; ++i ){\n\n next.clone( hull[ i % l ] ).vsub( tmp.clone( hull[ (i - 1) % l ] ) );\n\n if ( sign === false ){\n\n // first check the sign of the first cross product\n sign = prev.cross( next );\n\n } else if ( (sign > 0) ^ (prev.cross( next ) > 0) ){\n\n // if the cross products are different signs it's not convex\n ret = false;\n break;\n }\n\n // remember the last edge\n next.swap( prev );\n }\n\n scratch.done();\n return ret;\n};\n\n/**\n * Physics.geometry.getPolygonMOI( hull ) -> Number\n * - hull (Array): Array of ([[Vectorish]]) vertices\n * + (Number): The polygon's moment of inertia\n *\n * Gets the moment of inertia of a convex polygon\n *\n * See [List of moments of inertia](http://en.wikipedia.org/wiki/List_of_moments_of_inertia)\n * for more information.\n *\n * _Note_: we make the following assumpations:\n * * mass is unitary (== 1)\n * * axis of rotation is the origin\n **/\nPhysics.geometry.getPolygonMOI = function( hull ){\n\n var scratch = Physics.scratchpad()\n ,prev = scratch.vector()\n ,next = scratch.vector()\n ,num = 0\n ,denom = 0\n ,tmp\n ,l = hull.length\n ;\n\n if ( l < 2 ){\n // it must be a point\n // moi = 0\n scratch.done();\n return 0;\n }\n\n if ( l === 2 ){\n // it's a line\n // get length squared\n tmp = next.clone( hull[ 1 ] ).distSq( prev.clone( hull[ 0 ] ) );\n scratch.done();\n return tmp / 12;\n }\n\n prev.clone( hull[ 0 ] );\n\n for ( var i = 1; i < l; ++i ){\n\n next.clone( hull[ i ] );\n\n tmp = Math.abs( next.cross( prev ) );\n num += tmp * ( next.normSq() + next.dot( prev ) + prev.normSq() );\n denom += tmp;\n\n prev.swap( next );\n }\n\n scratch.done();\n return num / ( 6 * denom );\n};\n\n/**\n * Physics.geometry.isPointInPolygon( pt, hull ) -> Boolean\n * - pt (Vectorish): The point to test\n * - hull (Array): Array of ([[Vectorish]]) vertices\n * + (Boolean): `true` if point `pt` is inside the polygon\n *\n * Check if point is inside polygon hull.\n **/\nPhysics.geometry.isPointInPolygon = function( pt, hull ){\n\n var scratch = Physics.scratchpad()\n ,point = scratch.vector().clone( pt )\n ,prev = scratch.vector()\n ,next = scratch.vector()\n ,ang = 0\n ,l = hull.length\n ;\n\n if ( l < 2 ){\n // it's a point...\n ang = point.equals( prev.clone( hull[ 0 ] ));\n scratch.done();\n return ang;\n }\n\n if ( l === 2 ){\n // it's a line\n ang = point.angle( prev.clone( hull[ 0 ] ));\n ang += point.angle( prev.clone( hull[ 1 ] ));\n scratch.done();\n return ( Math.abs(ang) === Math.PI );\n }\n\n prev.clone( hull[ 0 ] ).vsub( point );\n\n // calculate the sum of angles between vector pairs\n // from point to vertices\n for ( var i = 1; i <= l; ++i ){\n\n next.clone( hull[ i % l ] ).vsub( point );\n ang += next.angle( prev );\n prev.swap( next );\n }\n\n scratch.done();\n return ( Math.abs(ang) > 1e-6 );\n};\n\n/**\n * Physics.geometry.getPolygonArea( hull ) -> Number\n * - hull (Array): Array of ([[Vectorish]]) vertices\n * + (Number): The area (positive for clockwise ordering)\n *\n * Get the signed area of the polygon.\n **/\nPhysics.geometry.getPolygonArea = function getPolygonArea( hull ){\n\n var scratch = Physics.scratchpad()\n ,prev = scratch.vector()\n ,next = scratch.vector()\n ,ret = 0\n ,l = hull.length\n ;\n\n if ( l < 3 ){\n // it must be a point or a line\n // area = 0\n scratch.done();\n return 0;\n }\n\n prev.clone( hull[ l - 1 ] );\n\n for ( var i = 0; i < l; ++i ){\n\n next.clone( hull[ i ] );\n\n ret += prev.cross( next );\n\n prev.swap( next );\n }\n\n scratch.done();\n return ret / 2;\n};\n\n/**\n * Physics.geometry.getPolygonCentroid( hull ) -> Physics.vector\n * - hull (Array): Array of ([[Vectorish]]) vertices\n * + (Physics.vector): The centroid\n *\n * Get the coordinates of the centroid.\n **/\nPhysics.geometry.getPolygonCentroid = function getPolygonCentroid( hull ){\n\n var scratch = Physics.scratchpad()\n ,prev = scratch.vector()\n ,next = scratch.vector()\n ,ret = new Physics.vector()\n ,tmp\n ,l = hull.length\n ;\n\n if ( l < 2 ){\n // it must be a point\n scratch.done();\n return new Physics.vector( hull[0] );\n }\n\n if ( l === 2 ){\n // it's a line\n // get the midpoint\n scratch.done();\n return new Physics.vector((hull[ 1 ].x + hull[ 0 ].x)/2, (hull[ 1 ].y + hull[ 0 ].y)/2 );\n }\n\n prev.clone( hull[ l - 1 ] );\n\n for ( var i = 0; i < l; ++i ){\n\n next.clone( hull[ i ] );\n\n tmp = prev.cross( next );\n prev.vadd( next ).mult( tmp );\n ret.vadd( prev );\n\n prev.swap( next );\n }\n\n tmp = 1 / (6 * Physics.geometry.getPolygonArea( hull ));\n\n scratch.done();\n return ret.mult( tmp );\n};\n\n/**\n * Physics.geometry.nearestPointOnLine( pt, linePt1, linePt2 ) -> Physics.vector\n * - pt (Vectorish): The point\n * - linePt1 (Vectorish): The first endpoint of the line\n * - linePt2 (Vectorish): The second endpoint of the line\n * + (Vector): The closest point\n *\n * Get the closest point on a discrete line to specified point.\n **/\nPhysics.geometry.nearestPointOnLine = function nearestPointOnLine( pt, linePt1, linePt2 ){\n\n var scratch = Physics.scratchpad()\n ,p = scratch.vector().clone( pt )\n ,A = scratch.vector().clone( linePt1 ).vsub( p )\n ,L = scratch.vector().clone( linePt2 ).vsub( p ).vsub( A )\n ,lambdaB\n ,lambdaA\n ;\n\n if ( L.equals(Physics.vector.zero) ){\n // oh.. it's a zero vector. So A and B are both the closest.\n // just use one of them\n scratch.done();\n return new Physics.vector( linePt1 );\n }\n\n lambdaB = - L.dot( A ) / L.normSq();\n lambdaA = 1 - lambdaB;\n\n if ( lambdaA <= 0 ){\n // woops.. that means the closest simplex point\n // isn't on the line it's point B itself\n scratch.done();\n return new Physics.vector( linePt2 );\n } else if ( lambdaB <= 0 ){\n // vice versa\n scratch.done();\n return new Physics.vector( linePt1 );\n }\n\n // guess we'd better do the math now...\n p = new Physics.vector( linePt2 ).mult( lambdaB ).vadd( A.clone( linePt1 ).mult( lambdaA ) );\n scratch.done();\n return p;\n};\n\n\n// ---\n// inside: src/core/integrator.js\n\n(function(){\n\n var defaults = {\n\n // drag applied during integration\n // 0 means vacuum\n // 0.9 means molasses\n drag: 0\n };\n\n /** related to: Physics.util.decorator\n * Physics.integrator( name[, options] ) -> Integrator\n * - name (String): The name of the integrator to create\n * - options (Object): The configuration for that integrator ( depends on integrator ).\n Available options and defaults:\n\n ```javascript\n {\n // drag applied during integration\n // 0 means vacuum\n // 0.9 means molasses\n drag: 0\n }\n ```\n *\n * Factory function for creating Integrators.\n *\n * Visit [the PhysicsJS wiki on Integrators](https://github.com/wellcaffeinated/PhysicsJS/wiki/Integrators)\n * for usage documentation.\n **/\n Physics.integrator = Decorator('integrator', {\n\n /** belongs to: Physics.integrator\n * class Integrator\n *\n * The base class for integrators created by [[Physics.integrator]] factory function.\n **/\n\n /** internal\n * Integrator#init( options )\n * - options (Object): The configuration options passed by the factory\n *\n * Initialization. Internal use.\n **/\n init: function( options ){\n\n /** related to: Physics.util.options\n * Integrator#options( options ) -> Object\n * - options (Object): The options to set as an object\n * + (Object): The options\n *\n * Set options on this instance.\n *\n * Access options directly from the options object.\n *\n * Example:\n *\n * ```javascript\n * this.options.someOption;\n * ```\n *\n **/\n this.options = Physics.util.options( defaults );\n this.options( options );\n },\n\n /**\n * Integrator#setWorld( world ) -> this\n * - world (Object): The world (or null)\n *\n * Set which world to apply to.\n *\n * Usually this is called internally. Shouldn't be a need to call this yourself usually.\n **/\n setWorld: function( world ){\n\n if ( this.disconnect && this._world ){\n this.disconnect( this._world );\n }\n\n this._world = world;\n\n if ( this.connect && world ){\n this.connect( world );\n }\n\n return this;\n },\n\n /**\n * Integrator#integrate( bodies, dt ) -> this\n * - bodies (Array): List of bodies to integrate\n * - dt (Number): Timestep size\n *\n * Integrate bodies by timestep.\n *\n * Will emit `integrate:velocities` and `integrate:positions`\n * events on the world.\n **/\n integrate: function( bodies, dt ){\n\n var world = this._world;\n\n this.integrateVelocities( bodies, dt );\n\n if ( world ){\n world.emit('integrate:velocities', {\n bodies: bodies,\n dt: dt\n });\n }\n\n this.integratePositions( bodies, dt );\n\n if ( world ){\n world.emit('integrate:positions', {\n bodies: bodies,\n dt: dt\n });\n }\n\n return this;\n },\n\n /**\n * Integrator#connect( world )\n * - world (Physics.world): The world to connect to\n *\n * Connect to a world.\n *\n * Extend this when creating integrators if you need to specify pubsub management.\n * Automatically called when added to world by the [[Integrator#setWorld]] method.\n **/\n connect: null,\n\n /**\n * Integrator#disconnect( world )\n * - world (Physics.world): The world to disconnect from\n *\n * Disconnect from a world.\n *\n * Extend this when creating integrators if you need to specify pubsub management.\n * Automatically called when added to world by the [[Integrator#setWorld]] method.\n **/\n disconnect: null,\n\n /**\n * Integrator#integrateVelocities( bodies, dt )\n * - bodies (Array): List of bodies to integrate\n * - dt (Number): Timestep size\n *\n * Just integrate the velocities.\n *\n * Should be overridden when creating integrators.\n **/\n integrateVelocities: function( bodies, dt ){\n\n throw 'The integrator.integrateVelocities() method must be overriden';\n },\n\n /**\n * Integrator#integratePositions( bodies, dt )\n * - bodies (Array): List of bodies to integrate\n * - dt (Number): Timestep size\n *\n * Just integrate the positions.\n *\n * Called after [[Integrator#integrateVelocities]].\n *\n * Should be overridden when creating integrators.\n **/\n integratePositions: function( bodies, dt ){\n\n throw 'The integrator.integratePositions() method must be overriden';\n }\n });\n\n}());\n\n\n// ---\n// inside: src/core/renderer.js\n\n(function(){\n\n var defaults = {\n // draw meta data (fps, steps, etc)\n meta: false,\n // refresh rate of meta info\n metaRefresh: 200,\n\n // width of viewport\n width: 600,\n // height of viewport\n height: 600,\n // automatically resize the renderer\n autoResize: true\n };\n\n /** related to: Physics.util.decorator\n * Physics.renderer( name[, options] ) -> Renderer\n * - name (String): The name of the renderer to create\n * - options (Object): The configuration for that renderer ( depends on renderer ).\n Available options and defaults:\n\n ```javascript\n {\n // draw meta data (fps, steps, etc)\n meta: false,\n // refresh rate of meta info\n metaRefresh: 200,\n\n // width of viewport\n width: 600,\n // height of viewport\n height: 600\n // automatically resize the renderer\n autoResize: true\n }\n ```\n *\n * Factory function for creating Renderers.\n *\n * Visit [the PhysicsJS wiki on Renderers](https://github.com/wellcaffeinated/PhysicsJS/wiki/Renderers)\n * for usage documentation.\n **/\n Physics.renderer = Decorator('renderer', {\n\n /** belongs to: Physics.renderer\n * class Renderer\n *\n * The base class for renderers created by [[Physics.renderer]] factory function.\n **/\n\n /** internal\n * Renderer#init( options )\n * - options (Object): The configuration options passed by the factory\n *\n * Initialization. Internal use.\n **/\n init: function( options ){\n\n var self = this\n ,el = typeof options.el === 'string' ? document.getElementById(options.el) : options.el\n ;\n\n this.options = Physics.util.options(defaults);\n this.options( options );\n\n this.el = el ? el : document.body;\n this.container = el && el.parentNode ? el.parentNode : document.body;\n this.drawMeta = Physics.util.throttle( Physics.util.bind(this.drawMeta, this), this.options.metaRefresh );\n\n window.addEventListener('resize', Physics.util.throttle(function(){\n if ( self.options.autoResize ){\n self.resize();\n }\n }), 100);\n },\n\n /**\n * Renderer#resize( [width, height] ) -> this\n * - width (Number): The width in px\n * - height (Number): The height in px\n *\n * Set the dimensions of the renderer.\n *\n * If no dimensions are specified it will auto resize.\n **/\n resize: function( width, height ){\n\n if ( width === undefined && height === undefined ){\n width = this.container.offsetWidth;\n height = this.container.offsetHeight;\n }\n\n this.width = width || 0;\n this.height = height || 0;\n // should be implemented in renderers\n },\n\n /**\n * Renderer#setWorld( world ) -> this\n * - world (Object): The world (or null)\n *\n * Set which world to apply to.\n *\n * Usually this is called internally. Shouldn't be a need to call this yourself usually.\n **/\n setWorld: function( world ){\n\n if ( this.disconnect && this._world ){\n this.disconnect( this._world );\n }\n\n this._world = world;\n\n if ( this.connect && world ){\n this.connect( world );\n }\n\n return this;\n },\n\n /**\n * Renderer#render( bodies, meta ) -> this\n * - bodies (Array): Array of bodies in the world (by reference!)\n * - meta (Object): meta information\n *\n * Render the world bodies and meta. Called by world.render()\n **/\n render: function( bodies, meta ){\n\n var body\n ,view\n ,pos\n ;\n\n if (this.beforeRender){\n\n this.beforeRender();\n }\n\n this._world.emit('beforeRender', {\n renderer: this,\n bodies: bodies,\n meta: meta\n });\n\n if (this.options.meta){\n this.drawMeta( meta );\n }\n\n this._interpolateTime = meta.interpolateTime;\n\n for ( var i = 0, l = bodies.length; i < l; ++i ){\n\n body = bodies[ i ];\n view = body.view || ( body.view = this.createView(body.geometry, body.styles) );\n\n if ( !body.hidden ){\n this.drawBody( body, view );\n }\n }\n\n return this;\n },\n\n /**\n * Renderer#createView( geometry, styles ) -> Mixed\n * - geometry (Geometry): geometry The geometry\n * - styles (Object|String): The styles configuration\n * + (Mixed): Whatever the renderer needs to render the body.\n *\n * Create a view for the specified geometry.\n *\n * The view is used to render the body. It is a cached version\n * of the body that gets moved and rotated according to the simulation.\n *\n * The styles are used to modify the appearance of the view.\n * They depend on the renderer.\n *\n * Override this when creating renderers.\n **/\n createView: function( geometry, styles ){\n\n // example:\n // var el = document.createElement('div');\n // el.style.height = geometry.height + 'px';\n // el.style.width = geometry.width + 'px';\n // return el;\n throw 'You must override the renderer.createView() method.';\n },\n\n /**\n * Renderer#drawMeta( meta )\n * - meta (Object): The meta data\n *\n * Draw the meta data.\n *\n * The meta data will look like this:\n *\n * ```javascript\n * meta = {\n * fps: 60, // the frames per second\n * ipf: 4 // the number of iterations per frame\n * };\n * ```\n *\n * Override this when creating renderers.\n **/\n drawMeta: function( meta ){\n\n // example:\n // this.els.fps.innerHTML = meta.fps.toFixed(2);\n // this.els.steps.innerHTML = meta.steps;\n throw 'You must override the renderer.drawMeta() method.';\n },\n\n /**\n * Renderer#drawBody( body, view )\n * - body (Object): The body to draw\n * - view (Object): The view for the body\n *\n * Draw specified body using specified view.\n *\n * Override this when creating renderers.\n **/\n drawBody: function( body, view ){\n\n // example (pseudocode):\n // view.angle = body.state.angle\n // view.position = body.state.position\n throw 'You must override the renderer.drawBody() method.';\n }\n\n\n });\n\n}());\n\n\n// ---\n// inside: src/core/world.js\n\n/** related to: Physics\n * class Physics.world\n *\n * The world class and factory function.\n *\n * Use [[Physics]] to create worlds.\n **/\n(function(){\n\n var execCallbacks = function execCallbacks( fns, scope, args ){\n\n var fn\n ,ret\n ,cb = function(){\n return execCallbacks( fns, scope, args );\n }\n ;\n\n while ( fn = fns.shift() ){\n\n ret = fn.apply(scope, args);\n\n if (ret && ret.then){\n return ret.then( cb );\n }\n }\n };\n\n var defaults = {\n\n // default timestep\n timestep: 6,\n // maximum number of iterations per step\n maxIPF: 4,\n webworker: false, // NOT YET IMPLEMENTED\n\n // default integrator\n integrator: 'verlet',\n\n // is sleeping disabled?\n sleepDisabled: false,\n // speed at which bodies wake up\n sleepSpeedLimit: 0.05,\n // variance in position below which bodies fall asleep\n sleepVarianceLimit: 0.02,\n // time (ms) before sleepy bodies fall asleep\n sleepTimeLimit: 500\n };\n\n // begin world definitions\n\n /** alias of: Physics\n * new Physics.world([options, fn(world, Physics)])\n * - options (Object): configuration options (see description)\n * - fn (Function|Array): Callback function or array of callbacks called with this === world\n * - world (Physics.world): The current world created\n * - Physics (Physics): The Physics namespace\n *\n * World Constructor.\n *\n * Use [[Physics]] to create worlds.\n *\n * Configuration options and defaults:\n *\n * ```javascript\n * {\n * // default timestep\n * timestep: 6,\n * // maximum number of iterations per step\n * maxIPF: 4,\n *\n * // default integrator\n * integrator: 'verlet',\n *\n * // is sleeping disabled?\n * sleepDisabled: false,\n * // speed at which bodies wake up\n * sleepSpeedLimit: 0.1,\n * // variance in position below which bodies fall asleep\n * sleepVarianceLimit: 2,\n * // time (ms) before sleepy bodies fall asleep\n * sleepTimeLimit: 500\n * }\n * ```\n *\n * If called with an array of functions, and any functions\n * return a [promise-like object](http://promises-aplus.github.io/promises-spec/),\n * each remaining callback will be called only when that promise is resolved.\n *\n * Example:\n *\n * ```javascript\n * // hypothetical resources need to be loaded...\n * Physics( cfg, [\n * function( world ){\n * var dfd = $.Deferred()\n * ,images = []\n * ,toLoad = myImages.length\n * ,callback = function(){\n * toLoad--;\n * // wait for all images to be loaded\n * if ( toLoad <= 0 ){\n * dfd.resolve();\n * }\n * }\n * ;\n *\n * // load images\n * $.each(myImages, function( src ){\n * var img = new Image();\n * img.onload = callback;\n * img.src = src;\n * });\n *\n * return dfd.promise();\n * },\n * function( world ){\n * // won't be executed until images are loaded\n * // initialize world... etc...\n * }\n * ]);\n * ```\n **/\n var World = function World( cfg, fn ){\n\n // allow creation of world without \"new\"\n if (!(this instanceof World)){\n return new World( cfg, fn );\n }\n\n this.init( cfg, fn );\n };\n\n // extend pubsub\n World.prototype = Physics.util.extend({}, Physics.util.pubsub.prototype, {\n\n /** internal, see: new Physics.world\n * Physics.world#init( [options, fn(world, Physics)] )\n * - options (Object): configuration options (see constructor)\n * - fn (Function|Array): Callback function or array of callbacks called with this === world\n *\n * Initialization\n **/\n init: function( cfg, fn ){\n\n var self = this;\n\n if ( Physics.util.isFunction( cfg ) || Physics.util.isArray( cfg ) ){\n fn = cfg;\n cfg = {};\n }\n\n this._meta = {\n // statistics (fps, etc)\n fps: 0,\n ipf: 0\n };\n this._bodies = [];\n this._behaviors = [];\n this._integrator = null;\n this._renderer = null;\n this._paused = false;\n this._warp = 1;\n this._time = 0;\n\n // set options\n this.options = Physics.util.options( defaults );\n this.options.onChange(function( opts ){\n\n // set timestep\n self.timestep( opts.timestep );\n });\n this.options( cfg );\n\n // add integrator\n this.add(Physics.integrator( this.options.integrator ));\n\n // apply the callback function\n if ( Physics.util.isFunction( fn ) ){\n\n execCallbacks([ fn ], this, [this, Physics] );\n\n } else if ( Physics.util.isArray( fn ) ){\n\n execCallbacks(fn, this, [this, Physics] );\n }\n },\n\n /**\n * Physics.world#options( cfg ) -> Object\n * - options (Object): configuration options (see constructor)\n * + (Object): Options container\n *\n * Set config options. Also access options by `.options.