You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The P2.Body.onBeginContact arguments have changed. It now sends 5 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array. Note that the Phaser.P2.Body may be null if you collide with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
The P2.Body.onEndContact arguments have changed. It now sends 4 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A and the p2 Shape from Body B. Note that the Phaser.P2.Body may be null if this is the end of a contact with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
Upgraded to p2.js 0.7.0
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,10 @@ Version 2.4 - "Katar" - in dev
245
245
* Phaser.BitmapText no longer extends PIXI.BitmapText but replaces it entirely.
246
246
* Phaser.Text no longer extends PIXI.Text but replaces it entirely. Phaser.Text now natively extends a Phaser Sprite, meaning it can be enabled for physics, damaged, etc.
247
247
* Mouse.button and MSPointer.button have been removed. They never supported complex button events (such as holding down 2 buttons and releasing just one) or any buttons other than left and right. They have been replaced with the far more robust and accurate Pointer button properties such as `Pointer.leftButton`, `Pointer.rightButton` and so on.
248
+
* The P2.Body.onBeginContact arguments have changed. It now sends 5 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array. Note that the Phaser.P2.Body may be null if you collide with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
249
+
* The P2.Body.onEndContact arguments have changed. It now sends 4 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A and the p2 Shape from Body B. Note that the Phaser.P2.Body may be null if this is the end of a contact with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
Copy file name to clipboardExpand all lines: src/physics/p2/Body.js
+29-12Lines changed: 29 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -76,15 +76,32 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
76
76
this.gravity=newPhaser.Point();
77
77
78
78
/**
79
-
* Dispatched when a first contact is created between shapes in two bodies. This event is fired during the step, so collision has already taken place.
80
-
* The event will be sent 4 parameters: The body it is in contact with, the shape from this body that caused the contact, the shape from the contact body and the contact equation data array.
79
+
* Dispatched when a first contact is created between shapes in two bodies.
80
+
* This event is fired during the step, so collision has already taken place.
81
+
*
82
+
* The event will be sent 5 arguments in this order:
83
+
*
84
+
* The Phaser.Physics.P2.Body it is in contact with. *This might be null* if the Body was created directly in the p2 world.
85
+
* The p2.Body this Body is in contact with.
86
+
* The Shape from this body that caused the contact.
87
+
* The Shape from the contact body.
88
+
* The Contact Equation data array.
89
+
*
81
90
* @property {Phaser.Signal} onBeginContact
82
91
*/
83
92
this.onBeginContact=newPhaser.Signal();
84
93
85
94
/**
86
-
* Dispatched when contact ends between shapes in two bodies. This event is fired during the step, so collision has already taken place.
87
-
* The event will be sent 3 parameters: The body it is in contact with, the shape from this body that caused the contact and the shape from the contact body.
95
+
* Dispatched when contact ends between shapes in two bodies.
96
+
* This event is fired during the step, so collision has already taken place.
97
+
*
98
+
* The event will be sent 4 arguments in this order:
99
+
*
100
+
* The Phaser.Physics.P2.Body it is in contact with. *This might be null* if the Body was created directly in the p2 world.
101
+
* The p2.Body this Body has ended contact with.
102
+
* The Shape from this body that caused the original contact.
0 commit comments