Skip to content

Commit

Permalink
added body.plugin, composite.plugin, constraint.plugin, engine.plugin…
Browse files Browse the repository at this point in the history
… properties
  • Loading branch information
liabru committed Jan 24, 2017
1 parent 8cdbb38 commit b353393
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var Axes = require('../geometry/Axes');
type: 'body',
label: 'Body',
parts: [],
plugin: {},
angle: 0,
vertices: Vertices.fromPath('L 0 0 L 40 0 L 40 40 L 0 40'),
position: { x: 0, y: 0 },
Expand Down Expand Up @@ -719,6 +720,13 @@ var Axes = require('../geometry/Axes');
* @type body[]
*/

/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/

/**
* A self reference if the body is _not_ a part of another body.
* Otherwise this is a reference to the body that this is a part of.
Expand Down
10 changes: 9 additions & 1 deletion src/body/Composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var Body = require('./Body');
bodies: [],
constraints: [],
composites: [],
label: 'Composite'
label: 'Composite',
plugin: {}
}, options);
};

Expand Down Expand Up @@ -655,4 +656,11 @@ var Body = require('./Body');
* @default []
*/

/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/

})();
8 changes: 8 additions & 0 deletions src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ var Common = require('../core/Common');
constraint.angularStiffness = constraint.angularStiffness || 0;
constraint.angleA = constraint.bodyA ? constraint.bodyA.angle : constraint.angleA;
constraint.angleB = constraint.bodyB ? constraint.bodyB.angle : constraint.angleB;
constraint.plugin = {};

return constraint;
};
Expand Down Expand Up @@ -391,4 +392,11 @@ var Common = require('../core/Common');
* @type number
*/

/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/

})();
8 changes: 8 additions & 0 deletions src/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var Body = require('../body/Body');
constraintIterations: 2,
enableSleeping: false,
events: [],
plugin: {},
timing: {
timestamp: 0,
timeScale: 1
Expand Down Expand Up @@ -491,4 +492,11 @@ var Body = require('../body/Body');
* @default a Matter.World instance
*/

/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/

})();

0 comments on commit b353393

Please sign in to comment.