Skip to content

Commit

Permalink
move require statements below module export
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Aug 13, 2015
1 parent 9e3438f commit 99c3bb3
Show file tree
Hide file tree
Showing 24 changed files with 112 additions and 112 deletions.
16 changes: 8 additions & 8 deletions src/body/Body.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Sleeping = require('../core/Sleeping');
var Render = require('../render/Render');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');
var Axes = require('../geometry/Axes');

/**
* The `Matter.Body` module contains methods for creating and manipulating body models.
* A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`.
Expand All @@ -21,6 +13,14 @@ var Body = {};

module.exports = Body;

var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Sleeping = require('../core/Sleeping');
var Render = require('../render/Render');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');
var Axes = require('../geometry/Axes');

(function() {

Body._inertiaScale = 4;
Expand Down
8 changes: 4 additions & 4 deletions src/body/Composite.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var Events = require('../core/Events');
var Common = require('../core/Common');
var Body = require('./Body');

/**
* The `Matter.Composite` module contains methods for creating and manipulating composite bodies.
* A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure.
Expand All @@ -18,6 +14,10 @@ var Composite = {};

module.exports = Composite;

var Events = require('../core/Events');
var Common = require('../core/Common');
var Body = require('./Body');

(function() {

/**
Expand Down
8 changes: 4 additions & 4 deletions src/body/World.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var Composite = require('./Composite');
var Constraint = require('../constraint/Constraint');
var Common = require('../core/Common');

/**
* The `Matter.World` module contains methods for creating and manipulating the world composite.
* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`.
Expand All @@ -20,6 +16,10 @@ var World = {};

module.exports = World;

var Composite = require('./Composite');
var Constraint = require('../constraint/Constraint');
var Common = require('../core/Common');

(function() {

/**
Expand Down
8 changes: 4 additions & 4 deletions src/collision/Detector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var SAT = require('./SAT');
var Pair = require('./Pair');
var Bounds = require('../geometry/Bounds');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -14,6 +10,10 @@ var Detector = {};

module.exports = Detector;

var SAT = require('./SAT');
var Pair = require('./Pair');
var Bounds = require('../geometry/Bounds');

(function() {

/**
Expand Down
8 changes: 4 additions & 4 deletions src/collision/Grid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var Pair = require('./Pair');
var Detector = require('./Detector');
var Common = require('../core/Common');

/**
* 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.
Expand All @@ -13,6 +9,10 @@ var Grid = {};

module.exports = Grid;

var Pair = require('./Pair');
var Detector = require('./Detector');
var Common = require('../core/Common');

(function() {

/**
Expand Down
4 changes: 2 additions & 2 deletions src/collision/Pair.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Contact = require('./Contact');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -10,6 +8,8 @@ var Pair = {};

module.exports = Pair;

var Contact = require('./Contact');

(function() {

/**
Expand Down
6 changes: 3 additions & 3 deletions src/collision/Pairs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
var Pair = require('./Pair');
var Common = require('../core/Common');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -11,6 +8,9 @@ var Pairs = {};

module.exports = Pairs;

var Pair = require('./Pair');
var Common = require('../core/Common');

(function() {

var _pairMaxIdleLife = 1000;
Expand Down
12 changes: 6 additions & 6 deletions src/collision/Query.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
var Vector = require('../geometry/Vector');
var SAT = require('./SAT');
var Bounds = require('../geometry/Bounds');
var Bodies = require('../factory/Bodies');
var Vertices = require('../geometry/Vertices');

/**
* The `Matter.Query` module contains methods for performing collision queries.
*
Expand All @@ -14,6 +8,12 @@ var Query = {};

module.exports = Query;

var Vector = require('../geometry/Vector');
var SAT = require('./SAT');
var Bounds = require('../geometry/Bounds');
var Bodies = require('../factory/Bodies');
var Vertices = require('../geometry/Vertices');

(function() {

/**
Expand Down
10 changes: 5 additions & 5 deletions src/collision/Resolver.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -13,6 +8,11 @@ var Resolver = {};

module.exports = Resolver;

var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');

(function() {

Resolver._restingThresh = 4;
Expand Down
6 changes: 3 additions & 3 deletions src/collision/SAT.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -13,6 +10,9 @@ var SAT = {};

module.exports = SAT;

var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');

(function() {

/**
Expand Down
14 changes: 7 additions & 7 deletions src/constraint/Constraint.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Sleeping = require('../core/Sleeping');
var Bounds = require('../geometry/Bounds');
var Axes = require('../geometry/Axes');
var Common = require('../core/Common');

/**
* The `Matter.Constraint` module contains methods for creating and manipulating constraints.
* Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position).
Expand All @@ -28,6 +21,13 @@ var Constraint = {};

module.exports = Constraint;

var Vertices = require('../geometry/Vertices');
var Vector = require('../geometry/Vector');
var Sleeping = require('../core/Sleeping');
var Bounds = require('../geometry/Bounds');
var Axes = require('../geometry/Axes');
var Common = require('../core/Common');

(function() {

var _minLength = 0.000001,
Expand Down
20 changes: 10 additions & 10 deletions src/constraint/MouseConstraint.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Sleeping = require('../core/Sleeping');
var Mouse = require('../core/Mouse');
var Events = require('../core/Events');
var Detector = require('../collision/Detector');
var Constraint = require('./Constraint');
var Composite = require('../body/Composite');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');

/**
* The `Matter.MouseConstraint` module contains methods for creating mouse constraints.
* Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch.
Expand All @@ -22,6 +12,16 @@ var MouseConstraint = {};

module.exports = MouseConstraint;

var Vertices = require('../geometry/Vertices');
var Sleeping = require('../core/Sleeping');
var Mouse = require('../core/Mouse');
var Events = require('../core/Events');
var Detector = require('../collision/Detector');
var Constraint = require('./Constraint');
var Composite = require('../body/Composite');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');

(function() {

/**
Expand Down
26 changes: 13 additions & 13 deletions src/core/Engine.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
var World = require('../body/World');
var Sleeping = require('./Sleeping');
var Resolver = require('../collision/Resolver');
var Render = require('../render/Render');
var Pairs = require('../collision/Pairs');
var Metrics = require('./Metrics');
var Grid = require('../collision/Grid');
var Events = require('./Events');
var Composite = require('../body/Composite');
var Constraint = require('../constraint/Constraint');
var Common = require('./Common');
var Body = require('../body/Body');

/**
* The `Matter.Engine` module contains methods for creating and manipulating engines.
* An engine is a controller that manages updating the simulation of the world.
Expand All @@ -26,6 +13,19 @@ var Engine = {};

module.exports = Engine;

var World = require('../body/World');
var Sleeping = require('./Sleeping');
var Resolver = require('../collision/Resolver');
var Render = require('../render/Render');
var Pairs = require('../collision/Pairs');
var Metrics = require('./Metrics');
var Grid = require('../collision/Grid');
var Events = require('./Events');
var Composite = require('../body/Composite');
var Constraint = require('../constraint/Constraint');
var Common = require('./Common');
var Body = require('../body/Body');

(function() {

/**
Expand Down
4 changes: 2 additions & 2 deletions src/core/Events.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Common = require('./Common');

/**
* 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.
Expand All @@ -11,6 +9,8 @@ var Events = {};

module.exports = Events;

var Common = require('./Common');

(function() {

/**
Expand Down
6 changes: 3 additions & 3 deletions src/core/Metrics.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// @if DEBUG
var Composite = require('../body/Composite');
var Common = require('./Common');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -11,6 +8,9 @@ var Metrics = {};

module.exports = Metrics;

var Composite = require('../body/Composite');
var Common = require('./Common');

(function() {

/**
Expand Down
4 changes: 2 additions & 2 deletions src/core/Mouse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Common = require('../core/Common');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -10,6 +8,8 @@ var Mouse = {};

module.exports = Mouse;

var Common = require('../core/Common');

(function() {

/**
Expand Down
8 changes: 4 additions & 4 deletions src/core/Runner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var Events = require('./Events');
var Engine = require('./Engine');
var Common = require('./Common');

/**
* The `Matter.Runner` module is an optional utility which provides a game loop,
* that handles updating and rendering a `Matter.Engine` for you within a browser.
Expand All @@ -20,6 +16,10 @@ var Runner = {};

module.exports = Runner;

var Events = require('./Events');
var Engine = require('./Engine');
var Common = require('./Common');

(function() {

if (typeof window === 'undefined') {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Sleeping.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Events = require('./Events');

/**
* _Internal Class_, not generally used outside of the engine's internals.
*
Expand All @@ -10,6 +8,8 @@ var Sleeping = {};

module.exports = Sleeping;

var Events = require('./Events');

(function() {

Sleeping._motionWakeThreshold = 0.18;
Expand Down
12 changes: 6 additions & 6 deletions src/factory/Bodies.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
var Vertices = require('../geometry/Vertices');
var Common = require('../core/Common');
var Body = require('../body/Body');
var Bounds = require('../geometry/Bounds');
var Vector = require('../geometry/Vector');

/**
* The `Matter.Bodies` module contains factory methods for creating rigid body models
* with commonly used body configurations (such as rectangles, circles and other polygons).
Expand All @@ -20,6 +14,12 @@ var Bodies = {};

module.exports = Bodies;

var Vertices = require('../geometry/Vertices');
var Common = require('../core/Common');
var Body = require('../body/Body');
var Bounds = require('../geometry/Bounds');
var Vector = require('../geometry/Vector');

(function() {

/**
Expand Down
Loading

0 comments on commit 99c3bb3

Please sign in to comment.