0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-02-01 18:24:54 -05:00

added body.plugin, composite.plugin, constraint.plugin, engine.plugin properties

This commit is contained in:
liabru 2017-01-24 20:33:37 +00:00
parent 8cdbb38c91
commit b3533937d4
4 changed files with 33 additions and 1 deletions

View file

@ -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 },
@ -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.

View file

@ -35,7 +35,8 @@ var Body = require('./Body');
bodies: [],
constraints: [],
composites: [],
label: 'Composite'
label: 'Composite',
plugin: {}
}, options);
};
@ -655,4 +656,11 @@ var Body = require('./Body');
* @default []
*/
/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/
})();

View file

@ -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;
};
@ -391,4 +392,11 @@ var Common = require('../core/Common');
* @type number
*/
/**
* An object reserved for storing plugin-specific properties.
*
* @property plugin
* @type {}
*/
})();

View file

@ -51,6 +51,7 @@ var Body = require('../body/Body');
constraintIterations: 2,
enableSleeping: false,
events: [],
plugin: {},
timing: {
timestamp: 0,
timeScale: 1
@ -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 {}
*/
})();