mirror of
https://github.com/liabru/matter-js.git
synced 2025-02-07 19:06:26 -05:00
updated license and contributing
This commit is contained in:
parent
295cffeacf
commit
d2af721c49
7 changed files with 27 additions and 12 deletions
|
@ -1,4 +1,10 @@
|
||||||
### Building and Contributing
|
# Contributing
|
||||||
|
|
||||||
|
## 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
|
To build you must first install [node.js](http://nodejs.org/) and [gulp](http://gulpjs.com/), then run
|
||||||
|
|
||||||
|
@ -8,8 +14,10 @@ This will install the required build dependencies, then run
|
||||||
|
|
||||||
gulp dev
|
gulp dev
|
||||||
|
|
||||||
which is a task that builds the `matter-dev.js` file, spawns a `connect` and `watch` server, then opens `demo/dev.html` in your browser. Any changes you make to the source will automatically rebuild `matter-dev.js` and reload your browser for quick and easy testing.
|
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.
|
||||||
|
|
||||||
Contributions are welcome, please ensure they follow the same style and architecture as the rest of the code. You should run `gulp test` to ensure `eslint` gives no errors. Please do not include any changes to the files in the `build` directory.
|
## Contributions
|
||||||
|
|
||||||
If you'd like to contribute but not sure what to work on, feel free to message me. Thanks!
|
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.
|
||||||
|
|
||||||
|
If you'd like to contribute but not sure what to work on, feel free to get in touch.
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014 Liam Brummitt
|
Copyright (c) Liam Brummitt and contributors.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -626,6 +626,7 @@ var Axes = require('../geometry/Axes');
|
||||||
* @return {}
|
* @return {}
|
||||||
*/
|
*/
|
||||||
var _totalProperties = function(body) {
|
var _totalProperties = function(body) {
|
||||||
|
// from equations at:
|
||||||
// https://ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=st&chap_sec=07.2&page=theory
|
// https://ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=st&chap_sec=07.2&page=theory
|
||||||
// http://output.to/sideway/default.asp?qno=121100087
|
// http://output.to/sideway/default.asp?qno=121100087
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ module.exports = Common;
|
||||||
};
|
};
|
||||||
|
|
||||||
var _seededRandom = function() {
|
var _seededRandom = function() {
|
||||||
// https://gist.github.com/ngryman/3830489
|
// https://en.wikipedia.org/wiki/Linear_congruential_generator
|
||||||
Common._seed = (Common._seed * 9301 + 49297) % 233280;
|
Common._seed = (Common._seed * 9301 + 49297) % 233280;
|
||||||
return Common._seed / 233280;
|
return Common._seed / 233280;
|
||||||
};
|
};
|
||||||
|
@ -411,7 +411,9 @@ module.exports = Common;
|
||||||
* @return {array} Partially ordered set of vertices in topological order.
|
* @return {array} Partially ordered set of vertices in topological order.
|
||||||
*/
|
*/
|
||||||
Common.topologicalSort = function(graph) {
|
Common.topologicalSort = function(graph) {
|
||||||
// https://mgechev.github.io/javascript-algorithms/graphs_others_topological-sort.js.html
|
// https://github.com/mgechev/javascript-algorithms
|
||||||
|
// Copyright (c) Minko Gechev (MIT license)
|
||||||
|
// Modifications: tidy formatting and naming
|
||||||
var result = [],
|
var result = [],
|
||||||
visited = [],
|
visited = [],
|
||||||
temp = [];
|
temp = [];
|
||||||
|
|
|
@ -151,6 +151,9 @@ var Bounds = require('../geometry/Bounds');
|
||||||
|
|
||||||
var _svgPathToAbsolute = function(path) {
|
var _svgPathToAbsolute = function(path) {
|
||||||
// http://phrogz.net/convert-svg-path-to-all-absolute-commands
|
// http://phrogz.net/convert-svg-path-to-all-absolute-commands
|
||||||
|
// Copyright (c) Gavin Kistner
|
||||||
|
// http://phrogz.net/js/_ReuseLicense.txt
|
||||||
|
// Modifications: tidy formatting and naming
|
||||||
var x0, y0, x1, y1, x2, y2, segs = path.pathSegList,
|
var x0, y0, x1, y1, x2, y2, segs = path.pathSegList,
|
||||||
x = 0, y = 0, len = segs.numberOfItems;
|
x = 0, y = 0, len = segs.numberOfItems;
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ var Common = require('../core/Common');
|
||||||
j;
|
j;
|
||||||
|
|
||||||
// find the polygon's moment of inertia, using second moment of area
|
// find the polygon's moment of inertia, using second moment of area
|
||||||
// http://www.physicsforums.com/showthread.php?t=25293
|
// from equations at http://www.physicsforums.com/showthread.php?t=25293
|
||||||
for (var n = 0; n < v.length; n++) {
|
for (var n = 0; n < v.length; n++) {
|
||||||
j = (n + 1) % v.length;
|
j = (n + 1) % v.length;
|
||||||
cross = Math.abs(Vector.cross(v[j], v[n]));
|
cross = Math.abs(Vector.cross(v[j], v[n]));
|
||||||
|
@ -354,6 +354,7 @@ var Common = require('../core/Common');
|
||||||
*/
|
*/
|
||||||
Vertices.isConvex = function(vertices) {
|
Vertices.isConvex = function(vertices) {
|
||||||
// http://paulbourke.net/geometry/polygonmesh/
|
// http://paulbourke.net/geometry/polygonmesh/
|
||||||
|
// Copyright (c) Paul Bourke (use permitted)
|
||||||
|
|
||||||
var flag = 0,
|
var flag = 0,
|
||||||
n = vertices.length,
|
n = vertices.length,
|
||||||
|
@ -396,7 +397,7 @@ var Common = require('../core/Common');
|
||||||
* @return [vertex] vertices
|
* @return [vertex] vertices
|
||||||
*/
|
*/
|
||||||
Vertices.hull = function(vertices) {
|
Vertices.hull = function(vertices) {
|
||||||
// http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain
|
// http://geomalgorithms.com/a10-_hull-1.html
|
||||||
|
|
||||||
var upper = [],
|
var upper = [],
|
||||||
lower = [],
|
lower = [],
|
||||||
|
@ -411,7 +412,7 @@ var Common = require('../core/Common');
|
||||||
});
|
});
|
||||||
|
|
||||||
// build lower hull
|
// build lower hull
|
||||||
for (i = 0; i < vertices.length; i++) {
|
for (i = 0; i < vertices.length; i += 1) {
|
||||||
vertex = vertices[i];
|
vertex = vertices[i];
|
||||||
|
|
||||||
while (lower.length >= 2
|
while (lower.length >= 2
|
||||||
|
@ -423,7 +424,7 @@ var Common = require('../core/Common');
|
||||||
}
|
}
|
||||||
|
|
||||||
// build upper hull
|
// build upper hull
|
||||||
for (i = vertices.length - 1; i >= 0; i--) {
|
for (i = vertices.length - 1; i >= 0; i -= 1) {
|
||||||
vertex = vertices[i];
|
vertex = vertices[i];
|
||||||
|
|
||||||
while (upper.length >= 2
|
while (upper.length >= 2
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* The MIT License (MIT)
|
* The MIT License (MIT)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Liam Brummitt
|
* Copyright (c) Liam Brummitt and contributors.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
Loading…
Add table
Reference in a new issue