Skip to content

Commit f62409d

Browse files
committed
Matter objects now have a reference to the world in which they were added
1 parent f88732c commit f62409d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

v3/src/physics/matter-js/MatterImage.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ var MatterImage = new Class({
1616
Components.Force,
1717
Components.Friction,
1818
Components.Mass,
19+
Components.Sensor,
20+
Components.Sleep,
1921
Components.Static,
2022
Components.Transform,
2123
Components.Velocity
@@ -49,6 +51,8 @@ var MatterImage = new Class({
4951

5052
this.body.gameObject = this;
5153

54+
this.world = world;
55+
5256
world.add(this.body);
5357

5458
this.setPosition(x, y);

v3/src/physics/matter-js/MatterSprite.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var MatterSprite = new Class({
1717
Components.Force,
1818
Components.Friction,
1919
Components.Mass,
20+
Components.Sensor,
21+
Components.Sleep,
2022
Components.Static,
2123
Components.Transform,
2224
Components.Velocity
@@ -52,6 +54,8 @@ var MatterSprite = new Class({
5254

5355
this.body.gameObject = this;
5456

57+
this.world = world;
58+
5559
world.add(this.body);
5660

5761
this.setPosition(x, y);

0 commit comments

Comments
 (0)