0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

updated builds

This commit is contained in:
liabru 2014-04-01 13:47:17 +01:00
parent d77e0f4b59
commit f6b79b0ce5
6 changed files with 4749 additions and 1200 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

8
build/matter-0.7.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
/** /**
* matter.js 0.5.0-edge 2014-03-30 * matter.js 0.7.0-edge 2014-04-01
* http://brm.io/matter-js/ * http://brm.io/matter-js/
* License: MIT * License: MIT
*/ */
@ -255,8 +255,10 @@ var Body = {};
// transform the body geometry // transform the body geometry
Vertices.translate(body.vertices, body.velocity); Vertices.translate(body.vertices, body.velocity);
Vertices.rotate(body.vertices, body.angularVelocity, body.position); if (body.angularVelocity !== 0) {
Axes.rotate(body.axes, body.angularVelocity); Vertices.rotate(body.vertices, body.angularVelocity, body.position);
Axes.rotate(body.axes, body.angularVelocity);
}
Bounds.update(body.bounds, body.vertices, body.velocity); Bounds.update(body.bounds, body.vertices, body.velocity);
}; };
@ -2048,6 +2050,7 @@ var Constraint = {};
(function() { (function() {
var _minLength = 0.000001, var _minLength = 0.000001,
_minDifference = 0.001,
_nextId = 0; _nextId = 0;
/** /**
@ -2146,7 +2149,11 @@ var Constraint = {};
var difference = (currentLength - constraint.length) / currentLength, var difference = (currentLength - constraint.length) / currentLength,
normal = Vector.div(delta, currentLength), normal = Vector.div(delta, currentLength),
force = Vector.mult(delta, difference * 0.5 * constraint.stiffness); force = Vector.mult(delta, difference * 0.5 * constraint.stiffness);
// if difference is very small, we can skip
if (Math.abs(1 - (currentLength / constraint.length)) < _minDifference)
return;
var velocityPointA, var velocityPointA,
velocityPointB, velocityPointB,
offsetA, offsetA,
@ -2262,18 +2269,19 @@ var Constraint = {};
var body = bodies[i], var body = bodies[i],
impulse = body.constraintImpulse; impulse = body.constraintImpulse;
if (impulse.x !== 0 || impulse.y !== 0 || impulse.angle !== 0) { // update geometry and reset
// update geometry Vertices.translate(body.vertices, impulse);
Vertices.translate(body.vertices, impulse);
if (impulse.angle !== 0) {
Vertices.rotate(body.vertices, impulse.angle, body.position); Vertices.rotate(body.vertices, impulse.angle, body.position);
Axes.rotate(body.axes, impulse.angle); Axes.rotate(body.axes, impulse.angle);
Bounds.update(body.bounds, body.vertices);
// reset body.constraintImpulse
impulse.x = 0;
impulse.y = 0;
impulse.angle = 0; impulse.angle = 0;
} }
Bounds.update(body.bounds, body.vertices);
impulse.x = 0;
impulse.y = 0;
} }
}; };
@ -2294,7 +2302,8 @@ var Constraint = {};
// Begin src/constraint/MouseConstraint.js // Begin src/constraint/MouseConstraint.js
/** /**
* _Internal Class_, not generally used outside of the engine's internals. * See [Demo.js](https://github.com/liabru/matter-js/blob/master/demo/js/Demo.js)
* and [DemoMobile.js](https://github.com/liabru/matter-js/blob/master/demo/js/DemoMobile.js) for usage examples.
* *
* @class MouseConstraint * @class MouseConstraint
*/ */
@ -3424,7 +3433,7 @@ var Mouse;
/** /**
* Clears all captured source events * Clears all captured source events
* @method create * @method clearSourceEvents
* @param {mouse} mouse * @param {mouse} mouse
*/ */
Mouse.clearSourceEvents = function(mouse) { Mouse.clearSourceEvents = function(mouse) {

4
build/matter.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff