diff --git a/src/body/Body.js b/src/body/Body.js index a32ec7b..9f1f7c6 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -22,6 +22,7 @@ var Body = {}; var defaults = { id: Body.nextId(), type: 'body', + label: null, angle: 0, position: { x: 0, y: 0 }, force: { x: 0, y: 0 }, diff --git a/src/body/Composite.js b/src/body/Composite.js index 9cfae5e..b2a8bb7 100644 --- a/src/body/Composite.js +++ b/src/body/Composite.js @@ -27,7 +27,8 @@ var Composite = {}; isModified: false, bodies: [], constraints: [], - composites: [] + composites: [], + label: null }, options); }; diff --git a/src/body/World.js b/src/body/World.js index 6740155..872a181 100644 --- a/src/body/World.js +++ b/src/body/World.js @@ -20,6 +20,7 @@ var World = {}; var composite = Composite.create(); var defaults = { + label: 'World', gravity: { x: 0, y: 1 }, bounds: { min: { x: 0, y: 0 }, diff --git a/src/constraint/Constraint.js b/src/constraint/Constraint.js index ce1324b..d76f2b1 100644 --- a/src/constraint/Constraint.js +++ b/src/constraint/Constraint.js @@ -54,6 +54,7 @@ var Constraint = {}; // option defaults constraint.id = constraint.id || Constraint.nextId(); + constraint.label = constraint.label; constraint.type = 'constraint'; constraint.stiffness = constraint.stiffness || 1; constraint.angularStiffness = constraint.angularStiffness || 0; diff --git a/src/constraint/MouseConstraint.js b/src/constraint/MouseConstraint.js index a3d6a00..0c65e6c 100644 --- a/src/constraint/MouseConstraint.js +++ b/src/constraint/MouseConstraint.js @@ -20,6 +20,7 @@ var MouseConstraint = {}; var mouse = engine.input.mouse; var constraint = Constraint.create({ + label: 'Mouse Constraint', pointA: mouse.position, pointB: { x: 0, y: 0 }, length: 0.01,