Skip to content

Commit

Permalink
updated edge build
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 1, 2015
1 parent 0933620 commit bf3f986
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
59 changes: 36 additions & 23 deletions build/matter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* matter.js 0.8.0-edge 2014-12-28
* matter.js 0.8.0-edge 2015-01-01
* http://brm.io/matter-js/
* License: MIT
*/
Expand Down Expand Up @@ -58,7 +58,8 @@ var Body = {};
Body._inertiaScale = 4;

var _nextCollidingGroupId = 1,
_nextNonCollidingGroupId = -1;
_nextNonCollidingGroupId = -1,
_nextCategory = 0x0001;

/**
* Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
Expand Down Expand Up @@ -131,6 +132,17 @@ var Body = {};
return _nextCollidingGroupId++;
};

/**
* Returns the next unique category bitfield (starting after the initial default category `0x0001`).
* There are 32 available. See `body.collisionFilter` for more information.
* @method nextCategory
* @return {Number} Unique category bitfield
*/
Body.nextCategory = function() {
_nextCategory = _nextCategory << 1;
return _nextCategory;
};

/**
* Initialises body properties.
* @method _initProperties
Expand Down Expand Up @@ -488,7 +500,6 @@ var Body = {};
continue;

// don't update out of world bodies
// TODO: viewports
if (body.bounds.max.x < worldBounds.min.x || body.bounds.min.x > worldBounds.max.x
|| body.bounds.max.y < worldBounds.min.y || body.bounds.min.y > worldBounds.max.y)
continue;
Expand Down Expand Up @@ -1729,14 +1740,15 @@ var Contact = {};
* Description
* @method id
* @param {vertex} vertex
* @return {Number} Unique contactID
* @return {string} Unique contactID
*/
Contact.id = function(vertex) {
return vertex.body.id + '_' + vertex.index;
};

})();


; // End src/collision/Contact.js


Expand Down Expand Up @@ -2296,7 +2308,7 @@ var Pair = {};
* @method id
* @param {body} bodyA
* @param {body} bodyB
* @return {number} Unique pairId
* @return {string} Unique pairId
*/
Pair.id = function(bodyA, bodyB) {
if (bodyA.id < bodyB.id) {
Expand All @@ -2308,6 +2320,7 @@ var Pair = {};

})();


; // End src/collision/Pair.js


Expand Down Expand Up @@ -3068,7 +3081,6 @@ var SAT = {};
vertexToBody.y = vertex.y - bodyAPosition.y;
distance = -Vector.dot(normal, vertexToBody);
if (distance < nearestDistance) {
nearestDistance = distance;
vertexB = vertex;
}

Expand All @@ -3077,6 +3089,7 @@ var SAT = {};

})();


; // End src/collision/SAT.js


Expand Down Expand Up @@ -3520,7 +3533,7 @@ var MouseConstraint = {};

var mouseConstraint = Common.extend(defaults, options);

Events.on(engine, 'tick', function(event) {
Events.on(engine, 'tick', function() {
var allBodies = Composite.allBodies(engine.world);
MouseConstraint.update(mouseConstraint, allBodies);
_triggerEvents(mouseConstraint);
Expand Down Expand Up @@ -3700,6 +3713,7 @@ var MouseConstraint = {};

})();


; // End src/constraint/MouseConstraint.js


Expand Down Expand Up @@ -4706,7 +4720,6 @@ var Metrics = {};
Metrics.update = function(metrics, engine) {
if (metrics.extended) {
var world = engine.world,
broadphase = engine.broadphase[engine.broadphase.current],
bodies = Composite.allBodies(world);

metrics.collisions = metrics.narrowDetections;
Expand All @@ -4716,13 +4729,15 @@ var Metrics = {};
metrics.narrowEff = (metrics.narrowDetections / (metrics.narrowphaseTests || 1)).toFixed(2);
metrics.broadEff = (1 - (metrics.broadphaseTests / (bodies.length || 1))).toFixed(2);
metrics.narrowReuse = (metrics.narrowReuseCount / (metrics.narrowphaseTests || 1)).toFixed(2);
//var broadphase = engine.broadphase[engine.broadphase.current];
//if (broadphase.instance)
// metrics.buckets = Common.keys(broadphase.instance.buckets).length;
}
};

})();


; // End src/core/Metrics.js


Expand Down Expand Up @@ -4970,7 +4985,7 @@ var Runner = {};
(function render(time){
var timing = engine.timing,
delta,
correction;
correction = 1;

timing.frameRequestId = _requestAnimationFrame(render);

Expand Down Expand Up @@ -5053,6 +5068,7 @@ var Runner = {};

})();


; // End src/core/Runner.js


Expand Down Expand Up @@ -5198,7 +5214,7 @@ var Bodies = {};
/**
* Creates a new rigid body model with a rectangle hull.
* The options parameter is an object that specifies any properties you wish to override the defaults.
* See the properites section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* @method rectangle
* @param {number} x
* @param {number} y
Expand Down Expand Up @@ -5229,7 +5245,7 @@ var Bodies = {};
/**
* Creates a new rigid body model with a trapezoid hull.
* The options parameter is an object that specifies any properties you wish to override the defaults.
* See the properites section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* @method trapezoid
* @param {number} x
* @param {number} y
Expand Down Expand Up @@ -5268,7 +5284,7 @@ var Bodies = {};
/**
* Creates a new rigid body model with a circle hull.
* The options parameter is an object that specifies any properties you wish to override the defaults.
* See the properites section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* @method circle
* @param {number} x
* @param {number} y
Expand Down Expand Up @@ -5299,7 +5315,7 @@ var Bodies = {};
/**
* Creates a new rigid body model with a regular polygon hull with the given number of sides.
* The options parameter is an object that specifies any properties you wish to override the defaults.
* See the properites section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object.
* @method polygon
* @param {number} x
* @param {number} y
Expand Down Expand Up @@ -5344,6 +5360,7 @@ var Bodies = {};

})();


; // End src/factory/Bodies.js


Expand Down Expand Up @@ -5654,7 +5671,7 @@ var Composites = {};
particleOptions = Common.extend({ inertia: Infinity }, particleOptions);
constraintOptions = Common.extend({ stiffness: 0.4 }, constraintOptions);

var softBody = Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y, column, row) {
var softBody = Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y) {
return Bodies.circle(x, y, particleRadius, particleOptions);
});

Expand Down Expand Up @@ -6122,7 +6139,7 @@ var Vertices = {};
points = [];

path.replace(pathPattern, function(match, x, y) {
points.push({ x: parseFloat(x, 10), y: parseFloat(y, 10) });
points.push({ x: parseFloat(x), y: parseFloat(y) });
});

return Vertices.create(points, body);
Expand Down Expand Up @@ -6316,8 +6333,7 @@ var Vertices = {};
qualityMin = qualityMin || 2;
qualityMax = qualityMax || 14;

var centre = Vertices.centre(vertices),
newVertices = [];
var newVertices = [];

for (var i = 0; i < vertices.length; i++) {
var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1],
Expand Down Expand Up @@ -6371,6 +6387,7 @@ var Vertices = {};

})();


; // End src/geometry/Vertices.js


Expand Down Expand Up @@ -6729,8 +6746,7 @@ var Render = {};
*/
Render.bodyShadows = function(engine, bodies, context) {
var c = context,
render = engine.render,
options = render.options;
render = engine.render;

for (var i = 0; i < bodies.length; i++) {
var body = bodies[i];
Expand Down Expand Up @@ -7018,9 +7034,7 @@ var Render = {};
* @param {RenderingContext} context
*/
Render.bodyVelocity = function(engine, bodies, context) {
var c = context,
render = engine.render,
options = render.options;
var c = context;

c.beginPath();

Expand Down Expand Up @@ -7178,7 +7192,6 @@ var Render = {};
Render.inspector = function(inspector, context) {
var engine = inspector.engine,
selected = inspector.selected,
c = context,
render = engine.render,
options = render.options,
bounds;
Expand Down
Loading

0 comments on commit bf3f986

Please sign in to comment.