diff --git a/.eslintrc b/.eslintrc
index e67f987..f2be9b9 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -29,7 +29,6 @@
"process": false,
"HTMLElement": false,
"require": false,
- "PIXI": false,
"$": false,
"Image": false,
"navigator": false,
@@ -59,13 +58,17 @@
"Vector": false,
"Vertices": false,
"Render": false,
- "RenderPixi": false,
"Events": false,
"Query": false,
"Runner": false,
"Svg": false,
- "Metrics": false,
- "Example": false
+ "Example": false,
+ "__MATTER_VERSION__": false,
+ "__MATTER_IS_DEV__": false,
+ "jest": false,
+ "test": false,
+ "expect": false,
+ "describe": false
},
"extends": "eslint:recommended"
}
diff --git a/.gitignore b/.gitignore
index b409461..b5b01b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,16 @@
.idea
node_modules
npm-debug.log
-doc
+docs
matter-doc-theme
build/matter-dev.js
build/matter-dev.min.js
demo/js/lib/matter-dev.js
-demo/js/Examples.js
+demo/js/Examples.min.js
examples/build
test/browser/diffs
test/browser/refs
test/node/diffs
-test/node/refs
\ No newline at end of file
+test/node/refs
+__snapshots__
+__compare__
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index fb11589..3d03717 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,10 +2,10 @@ language: node_js
sudo: false
node_js:
- "node"
-before_install:
- - npm install -g gulp
- - mkdir travis-phantomjs
- - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
- - tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
- - export PATH=$PWD/travis-phantomjs:$PATH
-install: npm install
\ No newline at end of file
+install:
+ - npm ci
+script:
+ - npm run lint
+ - npm run test
+ - npm run build
+ - npm run build-demo
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e3f202..8c8d9c8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,140 @@
+## 0.17.1 (2021-04-14)
+
+* deprecate Engine.run alias replaced by Runner.run ([5817046](https://github.com/liabru/matter-js/commit/5817046))
+
+
+
+## 0.17.0 (2021-04-11)
+
+* add Common.setDecomp and Common.getDecomp ([313c150](https://github.com/liabru/matter-js/commit/313c150))
+* add demo build config and refactor demo ([653a647](https://github.com/liabru/matter-js/commit/653a647))
+* add docs for all Matter.Render options ([ec3eecc](https://github.com/liabru/matter-js/commit/ec3eecc))
+* add title to all examples ([f4d72ba](https://github.com/liabru/matter-js/commit/f4d72ba))
+* added Common.deprecated ([ffa3193](https://github.com/liabru/matter-js/commit/ffa3193))
+* added Common.warnOnce ([6957dbf](https://github.com/liabru/matter-js/commit/6957dbf))
+* added Date.now fallback to Common.now, closes #739 ([c06c107](https://github.com/liabru/matter-js/commit/c06c107)), closes [#739](https://github.com/liabru/matter-js/issues/739)
+* added debug stats and performance monitoring to Matter.Render ([119881b](https://github.com/liabru/matter-js/commit/119881b))
+* added doc watch script ([164456b](https://github.com/liabru/matter-js/commit/164456b))
+* added docs for additional engine timing and render properties ([8017bdb](https://github.com/liabru/matter-js/commit/8017bdb))
+* added Example.stats ([9915007](https://github.com/liabru/matter-js/commit/9915007))
+* added lastDelta and lastElapsed to engine.timing ([6dc703f](https://github.com/liabru/matter-js/commit/6dc703f))
+* build demo ([0816454](https://github.com/liabru/matter-js/commit/0816454))
+* change all examples to use Composite.add instead of the alias World.add ([a3f298f](https://github.com/liabru/matter-js/commit/a3f298f))
+* changed engine.broadphase to engine.grid ([b74e400](https://github.com/liabru/matter-js/commit/b74e400))
+* changed Example.views to use render events ([3ac3498](https://github.com/liabru/matter-js/commit/3ac3498))
+* changed world.gravity to engine.gravity ([6abb3b7](https://github.com/liabru/matter-js/commit/6abb3b7))
+* deprecated Composites.car and added to car example ([cd9c5d4](https://github.com/liabru/matter-js/commit/cd9c5d4))
+* deprecated Composites.newtonsCradle and added to newtonsCradle example ([9ad980b](https://github.com/liabru/matter-js/commit/9ad980b))
+* deprecated Composites.softBody and added to softBody and cloth examples ([818f354](https://github.com/liabru/matter-js/commit/818f354))
+* improve Render.debug ([1753bf0](https://github.com/liabru/matter-js/commit/1753bf0))
+* migrate Matter.World to the equivalent Matter.Composite ([5dbec9b](https://github.com/liabru/matter-js/commit/5dbec9b))
+* remove deprecated backwards compatibility engine events from Matter.Runner ([76bf80e](https://github.com/liabru/matter-js/commit/76bf80e))
+* remove deprecated backwards compatibility render integration from Matter.Engine ([1aa8ed0](https://github.com/liabru/matter-js/commit/1aa8ed0))
+* remove deprecated backwards compatibility render integration from Matter.Runner ([6805f85](https://github.com/liabru/matter-js/commit/6805f85))
+* remove deprecated Matter.Metrics ([63a9e98](https://github.com/liabru/matter-js/commit/63a9e98))
+* remove deprecated Matter.RenderPixi ([08a515b](https://github.com/liabru/matter-js/commit/08a515b))
+* remove unused render shadow function ([e49834d](https://github.com/liabru/matter-js/commit/e49834d))
+* run all examples in browser tests ([5734bfd](https://github.com/liabru/matter-js/commit/5734bfd))
+* set render showDebug option on examples stress and stress2 ([f2ef3aa](https://github.com/liabru/matter-js/commit/f2ef3aa))
+* update matter-tools ([f8d366a](https://github.com/liabru/matter-js/commit/f8d366a))
+
+
+
+## 0.16.1 (2021-01-31)
+
+* add log capture and reporting in tests ([7bfd3c2](https://github.com/liabru/matter-js/commit/7bfd3c2))
+* add matter-wrap as dev dependency ([ef7c4c6](https://github.com/liabru/matter-js/commit/ef7c4c6))
+* catch missing plugin require in examples ([1ba1255](https://github.com/liabru/matter-js/commit/1ba1255))
+* change example matter-wrap require precedence ([aa1e4e7](https://github.com/liabru/matter-js/commit/aa1e4e7))
+* change perf threshold in test ([7b00354](https://github.com/liabru/matter-js/commit/7b00354))
+* change test worker decomp require ([5e746b0](https://github.com/liabru/matter-js/commit/5e746b0))
+* disable jest cache ([8ee0ebb](https://github.com/liabru/matter-js/commit/8ee0ebb))
+* enable useful dev server features ([839f7d9](https://github.com/liabru/matter-js/commit/839f7d9))
+* fix decomp require and improve warning message ([e87f64a](https://github.com/liabru/matter-js/commit/e87f64a))
+* fix dev server externals ([1f2f9fe](https://github.com/liabru/matter-js/commit/1f2f9fe))
+* fix named require in test ([92080ff](https://github.com/liabru/matter-js/commit/92080ff))
+* improve CI speed ([1af64eb](https://github.com/liabru/matter-js/commit/1af64eb))
+* improve docs for Bodies.fromVertices ([2ade78f](https://github.com/liabru/matter-js/commit/2ade78f))
+* improve stack examples with exact contact ([522f4e8](https://github.com/liabru/matter-js/commit/522f4e8))
+* improve test report log ([b5326f8](https://github.com/liabru/matter-js/commit/b5326f8))
+
+
+
+## 0.16.0 (2021-01-17)
+
+* added removeDuplicatePoints option from poly-decomp 0.3.0 to Bodies.fromVertices ([#639](https://github.com/liabru/matter-js/issues/639), [947cb97](https://github.com/liabru/matter-js/commit/947cb97), [a9694e6](https://github.com/liabru/matter-js/commit/a9694e6))
+* added support for > and >= operators in plugin version ranges ([0792716](https://github.com/liabru/matter-js/commit/0792716))
+* added support for example versioning in tests ([31d0ace](https://github.com/liabru/matter-js/commit/31d0ace))
+* added version targets for examples ([142b7de](https://github.com/liabru/matter-js/commit/142b7de))
+* added warning check on browser tests ([12377cc](https://github.com/liabru/matter-js/commit/12377cc))
+* changed svg and terrain example to use fetch ([5551cd5](https://github.com/liabru/matter-js/commit/5551cd5))
+* changed deprecated comments to avoid confusion ([1e73cab](https://github.com/liabru/matter-js/commit/1e73cab))
+* fixed poly-decomp external require ([882e07c](https://github.com/liabru/matter-js/commit/882e07c))
+* removed bower.json ([f71d4c0](https://github.com/liabru/matter-js/commit/f71d4c0))
+* removed unused dev dependency run-sequence ([be592fd](https://github.com/liabru/matter-js/commit/be592fd))
+* updated dev dependencies ([151eb30](https://github.com/liabru/matter-js/commit/151eb30))
+* updated matter-tools ([5c66458](https://github.com/liabru/matter-js/commit/5c66458))
+* updated matter-tools ([33e8fe8](https://github.com/liabru/matter-js/commit/33e8fe8))
+* updated demo matter-tools ([a694ae5](https://github.com/liabru/matter-js/commit/a694ae5))
+* updated demo pathseg ([9c5325b](https://github.com/liabru/matter-js/commit/9c5325b))
+* updated readme ([3089b41](https://github.com/liabru/matter-js/commit/3089b41))
+
+
+
+## 0.15.0 (2020-12-24)
+
+* add window global, stub require and handle bad values in test tools ([497ac80](https://github.com/liabru/matter-js/commit/497ac80))
+* added Body.setCentre, closes #684, closes #461, closes #679 ([2ec247b](https://github.com/liabru/matter-js/commit/2ec247b)), closes [#684](https://github.com/liabru/matter-js/issues/684) [#461](https://github.com/liabru/matter-js/issues/461) [#679](https://github.com/liabru/matter-js/issues/679)
+* added browser tests ([ceb7cd5](https://github.com/liabru/matter-js/commit/ceb7cd5))
+* Added build comparison tools and tests ([b7c938a](https://github.com/liabru/matter-js/commit/b7c938a))
+* added check for window in Common.now ([9ef9d02](https://github.com/liabru/matter-js/commit/9ef9d02))
+* added comparison output file option to test tools ([45aae25](https://github.com/liabru/matter-js/commit/45aae25))
+* Added config and test files to lint ([21e4ea6](https://github.com/liabru/matter-js/commit/21e4ea6))
+* added Constraint.pointAWorld and Constraint.pointBWorld ([3c32969](https://github.com/liabru/matter-js/commit/3c32969))
+* added examples to dev server bundle and commit built examples ([fe80478](https://github.com/liabru/matter-js/commit/fe80478))
+* added module export to examples ([f9ea799](https://github.com/liabru/matter-js/commit/f9ea799))
+* added overlap metric to test tools ([3fd674d](https://github.com/liabru/matter-js/commit/3fd674d))
+* added release scripts ([341c247](https://github.com/liabru/matter-js/commit/341c247))
+* added tag push to release task ([060283b](https://github.com/liabru/matter-js/commit/060283b))
+* added timing to engine snapshot ([e0cdbb8](https://github.com/liabru/matter-js/commit/e0cdbb8))
+* Added watch content base to dev server ([f471d4e](https://github.com/liabru/matter-js/commit/f471d4e))
+* added webpack build script ([046013e](https://github.com/liabru/matter-js/commit/046013e))
+* changed alpha build configuration ([182c84a](https://github.com/liabru/matter-js/commit/182c84a))
+* changed demo to auto populate examples with sourceLink and init ([5b0d34b](https://github.com/liabru/matter-js/commit/5b0d34b))
+* changed demo to serve without sub-directory ([823bbc0](https://github.com/liabru/matter-js/commit/823bbc0))
+* changed docs build config ([864452d](https://github.com/liabru/matter-js/commit/864452d))
+* changed example tests to use jest ([104d319](https://github.com/liabru/matter-js/commit/104d319))
+* fix decomp import in Bodies.fromVertices ([94e9614](https://github.com/liabru/matter-js/commit/94e9614))
+* fix decomp require ([0af1645](https://github.com/liabru/matter-js/commit/0af1645))
+* fix issues with render pixel ratio, closes #686, closes #687 ([d577477](https://github.com/liabru/matter-js/commit/d577477)), closes [#686](https://github.com/liabru/matter-js/issues/686) [#687](https://github.com/liabru/matter-js/issues/687)
+* fix lint ([5a0079d](https://github.com/liabru/matter-js/commit/5a0079d))
+* fix lint issues ([9ca21c1](https://github.com/liabru/matter-js/commit/9ca21c1))
+* fix path to build in test worker ([fcdb4fa](https://github.com/liabru/matter-js/commit/fcdb4fa))
+* fix preversion script ([c368c14](https://github.com/liabru/matter-js/commit/c368c14))
+* fix terrain example module export ([4a967ec](https://github.com/liabru/matter-js/commit/4a967ec))
+* Fix typo in docs ([c486635](https://github.com/liabru/matter-js/commit/c486635))
+* fixed plugins in compare ([82bb415](https://github.com/liabru/matter-js/commit/82bb415))
+* implemented threaded comparison testing ([285d70d](https://github.com/liabru/matter-js/commit/285d70d))
+* Optimized Body's hidden class ([b3220cf](https://github.com/liabru/matter-js/commit/b3220cf))
+* Optimized Events.trigger method when no event is emitted ([b17cb48](https://github.com/liabru/matter-js/commit/b17cb48))
+* remove gulp ([6a28090](https://github.com/liabru/matter-js/commit/6a28090))
+* remove old demo libs ([13c7eb5](https://github.com/liabru/matter-js/commit/13c7eb5))
+* removed unused gulp release tasks ([e5a7311](https://github.com/liabru/matter-js/commit/e5a7311))
+* removed yuidocjs dev dependency ([ee848d2](https://github.com/liabru/matter-js/commit/ee848d2))
+* Set loose build version on dev server ([1fcf292](https://github.com/liabru/matter-js/commit/1fcf292))
+* update build script ([90abab6](https://github.com/liabru/matter-js/commit/90abab6))
+* update default render theme ([d258411](https://github.com/liabru/matter-js/commit/d258411))
+* update demo and example render styles ([6dd5ec5](https://github.com/liabru/matter-js/commit/6dd5ec5))
+* update dependencies ([e1e058c](https://github.com/liabru/matter-js/commit/e1e058c)) ([5f5b8a1](https://github.com/liabru/matter-js/commit/5f5b8a1))
+* update examples build config and scripts ([69afb11](https://github.com/liabru/matter-js/commit/69afb11))
+* update package lock ([ac3da07](https://github.com/liabru/matter-js/commit/ac3da07))
+* updated build scripts ([6b698ea](https://github.com/liabru/matter-js/commit/6b698ea))
+* updated ci ([288b9cd](https://github.com/liabru/matter-js/commit/288b9cd))
+* updated docs ([50cf171](https://github.com/liabru/matter-js/commit/50cf171))
+* updated readme ([ea5c012](https://github.com/liabru/matter-js/commit/ea5c012)) ([61b1963](https://github.com/liabru/matter-js/commit/61b1963))
+
+
+
## 0.14.2 (2018-06-11)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 15d0454..b091f05 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,22 +2,51 @@
## License Agreement
-When providing any contributions, you must agree and be legally entitled to provide them for use and distribution in the project under the same terms as the [license](https://github.com/liabru/matter-js/blob/master/LICENSE), otherwise they can not be accepted.
-
-## Building
-
-To build you must first install [node.js](http://nodejs.org/) and [gulp](http://gulpjs.com/), then run
-
- npm install
-
-This will install the required build dependencies, then run
-
- gulp dev
-
-which is a task that builds the `matter-dev.js` file, spawns a development server and opens `http://localhost:8000/demo/index.html` in your browser. Any changes you make to the source will automatically rebuild `matter-dev.js` and reload your browser.
+By providing any kind of contribution to this project, **you must agree and be legally entitled** to provide them for use and distribution as a part of this project **wholly under the same terms as in the original included [license](https://github.com/liabru/matter-js/blob/master/LICENSE)**.
## Contributions
-Contributions by pull request are welcome! Please ensure they follow the same style and architecture as the rest of the code. You should run `gulp test` and ensure there are no reported errors. Please do not include any changes to the files in the `build` directory. All contributors must agree to the license agreement described at the beginning of this document.
+Contributions by pull request or issues are welcome. Please ensure they follow the same style and architecture as the rest of the code. Use `npm run lint` and see [Testing](#Testing) below before submitting. Please **do not include** any changes to the files in the `build` directory.
-If you'd like to contribute but not sure what to work on, feel free to get in touch.
\ No newline at end of file
+Before contributing please read the license agreement described at the beginning of this document.
+
+## Building
+
+To build you must first install [node.js](http://nodejs.org), then run
+
+ npm install
+
+which will install the required build dependencies, then run
+
+ npm start
+
+which will run the development server and opens `http://localhost:8000/` in your browser. Any changes you make to the source will automatically rebuild and reload the page.
+
+## Testing
+
+All contributions should pass when running the commands
+
+- `npm run lint`
+- `npm run test`
+- `npm run test-browser`
+
+The output of `npm run test` also includes a [comparison report](https://github.com/liabru/matter-js/pull/794), which highlights changes in results, performance and accuracy against the last release build.
+
+## Commands
+
+The following development commands can be run at the terminal
+
+- **npm start**
+runs development server and opens demo page
+- **npm run build**
+creates a release build
+- **npm run build-demo**
+builds the demo
+- **npm run lint**
+runs the linter
+- **npm run test**
+runs the tests and compares results
+- **npm run test-browser**
+runs the browser tests
+- **npm run doc**
+builds the documentation
diff --git a/Gulpfile.js b/Gulpfile.js
deleted file mode 100644
index 54b4674..0000000
--- a/Gulpfile.js
+++ /dev/null
@@ -1,313 +0,0 @@
-var gulp = require('gulp');
-var uglify = require('gulp-uglify');
-var rename = require('gulp-rename');
-var header = require('gulp-header');
-var eslint = require('gulp-eslint');
-var bump = require('gulp-bump');
-var changelog = require('gulp-conventional-changelog');
-var tag = require('gulp-tag-version');
-var release = require('gulp-github-release');
-var sequence = require('run-sequence');
-var gutil = require('gulp-util');
-var replace = require('gulp-replace');
-var webserver = require('gulp-webserver');
-var concat = require('gulp-concat');
-var preprocess = require('gulp-preprocess');
-var browserify = require('browserify');
-var derequire = require('gulp-derequire');
-var transform = require('vinyl-transform');
-var through2 = require('through2');
-var pkg = require('./package.json');
-var clone = require('gulp-clone');
-var livereload = require('connect-livereload');
-var es = require('event-stream');
-var path = require('path');
-var fs = require('fs');
-var watchify = require('watchify');
-var extend = require('util')._extend;
-var exec = require('child_process').exec;
-var buildDirectory = 'build';
-var server;
-
-gulp.task('default', ['build:dev']);
-
-gulp.task('dev', function(callback) {
- sequence('watch', 'serve', callback);
-});
-
-gulp.task('release', function(callback) {
- shell('git status --porcelain', function(err, stdout) {
- if (stdout && stdout.trim()) {
- throw new gutil.PluginError({
- plugin: 'release',
- message: 'cannot build release as there are uncomitted changes'
- });
- } else {
- sequence('test', 'bump', 'reload', 'build:release', 'doc', 'changelog', callback);
- }
- });
-});
-
-gulp.task('release:push', function(callback) {
- shell('git status --porcelain', function(err, stdout) {
- if (stdout && stdout.trim()) {
- throw new gutil.PluginError({
- plugin: 'release',
- message: 'cannot push release as it has not yet been committed'
- });
- } else {
- sequence('tag', 'release:push:git', 'release:push:npm', callback);
- }
- });
-});
-
-gulp.task('release:push:github', function(callback) {
- return gulp.src([
- 'CHANGELOG.md',
- 'LICENSE',
- buildDirectory + '/matter.min.js',
- buildDirectory + '/matter.js'
- ]).pipe(release({
- owner: 'liabru',
- repo: pkg.name,
- tag: pkg.version,
- name: 'Matter.js ' + pkg.version
- }));
-});
-
-gulp.task('release:push:git', function(callback) {
- shell('git push', callback);
-});
-
-gulp.task('release:push:npm', function(callback) {
- shell('npm publish', callback);
-});
-
-gulp.task('build:dev', function() {
- return build(extend(extend({}, pkg), { version: pkg.version + '-dev' }));
-});
-
-gulp.task('build:edge', function() {
- return build(extend(extend({}, pkg), { version: pkg.version + '-alpha' }));
-});
-
-gulp.task('build:release', function() {
- return build(extend(extend({}, pkg), { version: pkg.version }));
-});
-
-gulp.task('build:examples', function() {
- var options = extend(extend({}, pkg), { version: pkg.version + '-dev' });
- options.name = options.name + '-examples';
- options.date = options.date || new Date().toISOString().slice(0, 10);
- options.author = '@liabru';
-
- return gulp.src('examples/**/*.js')
- .pipe(concat('examples.js'))
- .pipe(header(banner, { context: options }))
- .pipe(gulp.dest('examples/build'));
-});
-
-gulp.task('watch', function() {
- var b = browserify({
- entries: ['src/module/main.js'],
- standalone: 'Matter',
- plugin: [watchify]
- });
-
- var bundle = function() {
- gutil.log('Updated bundle build/matter-dev.js');
- b.bundle()
- .on('error', function(err) {
- gutil.log('ERROR', err.message);
- this.emit('end');
- })
- .pipe(through2({ objectMode: true }, function(chunk, encoding, callback) {
- return callback(
- null,
- chunk.toString().replace(/@@VERSION@@/g, pkg.version + '-dev')
- );
- }))
- .pipe(fs.createWriteStream('build/matter-dev.js'));
- };
-
- b.on('update', bundle);
- bundle();
-});
-
-gulp.task('bump', function() {
- return gulp.src(['package.json', 'bower.json'])
- .pipe(bump({ type: process.argv[4] || 'minor' }))
- .pipe(gulp.dest('.'));
-});
-
-gulp.task('reload', function(callback) {
- delete require.cache[require.resolve('./package.json')];
- pkg = require('./package.json');
- callback();
-});
-
-gulp.task('tag', function() {
- return gulp.src('package.json')
- .pipe(tag({ prefix: '' }));
-});
-
-gulp.task('changelog', function () {
- return gulp.src('CHANGELOG.md')
- .pipe(changelog())
- .pipe(gulp.dest('.'));
-});
-
-gulp.task('serve', function() {
- serve(false);
-});
-
-gulp.task('serve:test', function() {
- serve(true);
-});
-
-gulp.task('serve:stop', function() {
- if (server) {
- try {
- server.emit('kill');
- } catch (e) {} // eslint-disable-line no-empty
- gutil.log('Web server stopped');
- }
-});
-
-gulp.task('test', function(callback) {
- // TODO: fix tests by switching to nightmare instead of phantom
- // sequence('serve:test', 'lint', 'build:dev', 'test:browser', 'test:node', 'serve:stop', callback);
- sequence('lint', callback);
-});
-
-gulp.task('test:browser', function(callback) {
- shell('phantomjs test/browser/TestDemo.js', callback);
-});
-
-gulp.task('test:node', function(callback) {
- shell('node test/node/TestDemo.js', callback);
-});
-
-gulp.task('lint', function() {
- return gulp.src([
- 'src/**/*.js',
- 'demo/js/*.js',
- 'examples/*.js',
- 'test/browser/TestDemo.js',
- 'test/node/TestDemo.js',
- 'Gulpfile.js'
- ])
- .pipe(eslint())
- .pipe(eslint.format())
- .pipe(eslint.failAfterError());
-});
-
-gulp.task('doc', function(callback) {
- var options = {
- paths: ['src'],
- themedir: 'matter-doc-theme',
- outdir: 'doc/build',
- linkNatives: true,
- project: {
- name: pkg.name + ' ' + pkg.version + ' Physics Engine API Docs',
- description: pkg.description,
- version: pkg.version,
- url: pkg.homepage
- }
- };
-
- var Y = require('yuidocjs');
- var json = new Y.YUIDoc(options).run();
- json.project = options.project;
-
- var builder = new Y.DocBuilder(options, json);
- builder.compile(callback);
-});
-
-var serve = function(isTest) {
- process.on('uncaughtException', function(err) {
- if (err.errno === 'EADDRINUSE') {
- gutil.log('Server already running (or port is otherwise in use)');
- }
- });
-
- server = gulp.src('.')
- .pipe(webserver({
- host: '0.0.0.0',
- livereload: {
- enable: !isTest,
- filter: function(filename) {
- return filename.match(/build|demo/);
- }
- },
- middleware: livereload(),
- open: isTest ? false : 'http://localhost:8000/demo/index.html',
- directoryListing: true
- }));
-};
-
-var build = function(options) {
- var isDev = options.version.indexOf('-dev') !== -1,
- filename = buildDirectory + (isDev ? '/matter-dev' : '/matter'),
- dest = filename + '.js',
- destMin = filename + '.min.js';
-
- options.date = options.date || new Date().toISOString().slice(0, 10);
- options.author = '@liabru';
-
- gutil.log('Building', filename, options.date);
-
- var compiled = gulp.src(['src/module/main.js'])
- .pipe(through2.obj(function(file, enc, next){
- browserify(file.path, { standalone: 'Matter' })
- .bundle(function(err, res){
- file.contents = res;
- next(null, file);
- });
- }))
- .pipe(derequire())
- .pipe(replace('@@VERSION@@', options.version));
-
- if (!isDev) {
- compiled.pipe(preprocess({ context: { DEBUG: false } }));
- }
-
- var build = compiled.pipe(clone())
- .pipe(header(banner + '\n' + license + '\n\n', { context: options }))
- .pipe(rename(dest))
- .pipe(gulp.dest('.'));
-
- var buildMin = compiled.pipe(clone())
- .pipe(uglify({ output: { max_line_len: 1000 } }))
- .pipe(header(banner, { context: options }))
- .pipe(rename(destMin))
- .pipe(gulp.dest('.'));
-
- return es.merge(build, buildMin);
-};
-
-var shell = function(command, callback) {
- var args = process.argv.slice(3).join(' '),
- proc = exec(command + ' ' + args, function(err, stdout, stderr) {
- callback(err, stdout, stderr, proc);
- });
-
- proc.stdout.on('data', function(data) {
- process.stdout.write(data);
- });
-
- proc.stderr.on('data', function(data) {
- process.stderr.write(data);
- });
-};
-
-var license = fs.readFileSync('src/module/license.js');
-
-var banner = [
- '/**',
- '* <%= context.name %> <%= context.version %> by <%= context.author %> <%= context.date %>',
- '* <%= context.homepage %>',
- '* License <%= context.license %>',
- '*/',
- ''
-].join('\n');
diff --git a/README.md b/README.md
index be9b583..b5745b5 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-
+
> *Matter.js* is a JavaScript 2D rigid body physics engine for the web
-[brm.io/matter-js](http://brm.io/matter-js/)
+[brm.io/matter-js](https://brm.io/matter-js/)
-[Demos](#demos) - [Gallery](#gallery) - [Features](#features) - [Plugins](#plugins) - [Install](#install) - [Usage](#usage) - [Examples](#examples) - [Docs](#documentation) - [Wiki](https://github.com/liabru/matter-js/wiki) - [References](#references) - [License](#license)
+[Demos](#demos) ・ [Gallery](#gallery) ・ [Features](#features) ・ [Plugins](#plugins) ・ [Install](#install) ・ [Usage](#usage) ・ [Examples](#examples) ・ [Docs](#documentation) ・ [Wiki](https://github.com/liabru/matter-js/wiki) ・ [References](#references) ・ [License](#license)
[](https://travis-ci.org/liabru/matter-js)
@@ -14,51 +14,55 @@
1?(f=a.create(s.extend({parts:m.slice(0)},o)),a.setPosition(f,{x:e,y:t}),f):m[0]}}()},{"../body/Body":1,"../core/Common":14,"../geometry/Bounds":26,"../geometry/Vector":28,"../geometry/Vertices":29}],24:[function(e,t,n){var o={};t.exports=o
-;var i=e("../body/Composite"),r=e("../constraint/Constraint"),s=e("../core/Common"),a=e("../body/Body"),l=e("./Bodies");!function(){o.stack=function(e,t,n,o,r,s,l){for(var c,d=i.create({label:"Stack"}),u=e,p=t,f=0,m=0;m