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
* @param {(MatterJS.Body|MatterJS.Body[])} body - The body, or an array of bodies, to check against the point.
686
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} body - The body, or an array of bodies, to check against the point.
675
687
* @param {number} x - The horizontal coordinate of the point.
676
688
* @param {number} y - The vertical coordinate of the point.
677
689
*
@@ -702,9 +714,9 @@ var MatterPhysics = new Class({
702
714
*
703
715
* @param {number} x - The horizontal coordinate of the point.
704
716
* @param {number} y - The vertical coordinate of the point.
705
-
* @param {MatterJS.Body[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.
717
+
* @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.
706
718
*
707
-
* @return {MatterJS.Body[]} An array of bodies which contain the given point.
719
+
* @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies which contain the given point.
708
720
*/
709
721
intersectPoint: function(x,y,bodies)
710
722
{
@@ -742,9 +754,9 @@ var MatterPhysics = new Class({
742
754
* @param {number} width - The width of the area.
743
755
* @param {number} height - The height of the area.
744
756
* @param {boolean} [outside=false] - If `false` it checks for vertices inside the area, if `true` it checks for vertices outside the area.
745
-
* @param {MatterJS.Body[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.
757
+
* @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check. If not provided it will search all bodies in the world.
746
758
*
747
-
* @return {MatterJS.Body[]} An array of bodies that intersect with the given area.
759
+
* @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies that intersect with the given area.
* @param {MatterJS.Body[]} [bodies] - An array of bodies to check the target body against. If not provided it will search all bodies in the world.
831
+
* @param {Phaser.Types.Physics.Matter.MatterBody} body - The target body.
832
+
* @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - An array of bodies to check the target body against. If not provided it will search all bodies in the world.
821
833
*
822
-
* @return {MatterJS.Body[]} An array of bodies whos vertices intersect with target body.
834
+
* @return {Phaser.Types.Physics.Matter.MatterBody[]} An array of bodies whos vertices intersect with target body.
823
835
*/
824
836
intersectBody: function(body,bodies)
825
837
{
@@ -866,8 +878,8 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} target - The target body, or array of target bodies, to check.
870
-
* @param {MatterJS.Body[]} [bodies] - The second body, or array of bodies, to check. If falsey it will check against all bodies in the world.
881
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} target - The target body, or array of target bodies, to check.
882
+
* @param {Phaser.Types.Physics.Matter.MatterBody[]} [bodies] - The second body, or array of bodies, to check. If falsey it will check against all bodies in the world.
871
883
* @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the bodies overlap.
872
884
* @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two bodies if they overlap. If this is set then `overlapCallback` will only be invoked if this callback returns `true`.
873
885
* @param {*} [callbackContext] - The context, or scope, in which to run the callbacks.
@@ -932,7 +944,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1079
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1068
1080
* @param {number} x - The horizontal linear velocity value.
1069
1081
* @param {number} y - The vertical linear velocity value.
1070
1082
*
@@ -1094,7 +1106,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1109
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1098
1110
* @param {number} x - The horizontal linear velocity value.
1099
1111
*
1100
1112
* @return {this} This Matter Physics instance.
@@ -1123,7 +1135,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1138
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1127
1139
* @param {number} y - The vertical linear velocity value.
1128
1140
*
1129
1141
* @return {this} This Matter Physics instance.
@@ -1152,7 +1164,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1167
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1156
1168
* @param {number} value - The angular velocity.
1157
1169
*
1158
1170
* @return {this} This Matter Physics instance.
@@ -1175,7 +1187,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1190
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1179
1191
* @param {Phaser.Types.Math.Vector2Like} force - A Vector that specifies the force to apply.
1180
1192
*
1181
1193
* @return {this} This Matter Physics instance.
@@ -1206,7 +1218,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1221
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1210
1222
* @param {Phaser.Types.Math.Vector2Like} position - A Vector that specifies the world-space position to apply the force at.
1211
1223
* @param {number} speed - A speed value to be applied to a directional force.
1212
1224
* @param {number} [angle] - The angle, in radians, to apply the force from. Leave undefined to use the current body angle.
@@ -1244,7 +1256,7 @@ var MatterPhysics = new Class({
* @param {(MatterJS.Body|MatterJS.Body[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1259
+
* @param {(Phaser.Types.Physics.Matter.MatterBody|Phaser.Types.Physics.Matter.MatterBody[])} bodies - Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.
1248
1260
* @param {number} speed - A speed value to be applied to a directional force.
1249
1261
* @param {number} [angle] - The angle, in radians, to apply the force from. Leave undefined to use the current body angle.
1250
1262
*
@@ -1310,90 +1322,79 @@ var MatterPhysics = new Class({
1310
1322
* The alignment takes place using the body bounds, which take into consideration things
1311
1323
* like body scale and rotation.
1312
1324
*
1313
-
* For example, if you wanted to align a body so it sat in the bottom-left of the
1325
+
* Although a Body has a `position` property, it is based on the center of mass for the body,
1326
+
* not a dimension based center. This makes aligning bodies difficult, especially if they have
1327
+
* rotated or scaled. This method will derive the correct position based on the body bounds and
1328
+
* its center of mass offset, in order to align the body with the given coordinate.
1329
+
*
1330
+
* For example, if you wanted to align a body so it sat in the bottom-center of the
0 commit comments