Skip to content

Commit 865c687

Browse files
committed
P2.World.getSprings used to return an empty array, but now returns all the Springs in the world (phaserjs#1134)
1 parent d26f937 commit 865c687

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ Version 2.1.0 - "Cairhien" - -in development-
170170
* CocoonJS doesn't support mouse wheel events so they've been moved into a conditional check (thanks @videlais #1151)
171171
* ScaleManager window.resize handler would constantly dispatch enterPortrait and enterLandscape events on window resizing, regardless if it actually entered that orientation or not.
172172
* Added Sound._muteVolume which stops Firefox and IE9 crashing if you try to unmute a sound that hasn't yet been muted, which can also happen as a result of a game visibility change (thanks @osmanzeki #1108 #1123)
173+
* P2.World.getSprings used to return an empty array, but now returns all the Springs in the world (#1134)
173174

174175
### p2.js 0.6.0 Changes and New Features
175176

src/physics/p2/RotationalSpring.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Phaser.Physics.P2.RotationalSpring = function (world, bodyA, bodyB, restAngle, s
4949
*/
5050
this.data = new p2.RotationalSpring(bodyA, bodyB, options);
5151

52+
this.data.parent = this;
53+
5254
};
5355

5456
Phaser.Physics.P2.Spring.prototype.constructor = Phaser.Physics.P2.Spring;

src/physics/p2/Spring.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Phaser.Physics.P2.Spring = function (world, bodyA, bodyB, restLength, stiffness,
7070
*/
7171
this.data = new p2.LinearSpring(bodyA, bodyB, options);
7272

73+
this.data.parent = this;
74+
7375
};
7476

7577
Phaser.Physics.P2.Spring.prototype.constructor = Phaser.Physics.P2.Spring;

0 commit comments

Comments
 (0)