Skip to content

Commit 03bd2aa

Browse files
committed
2.1.0 pre-built releases.
1 parent 133ffd5 commit 03bd2aa

13 files changed

Lines changed: 124843 additions & 228 deletions

build/custom/p2.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13646,11 +13646,17 @@ Phaser.Physics.P2 = function (game, config) {
1364613646
config = { gravity: [0, 0], broadphase: new p2.SAPBroadphase() };
1364713647
}
1364813648

13649+
/**
13650+
* @property {object} config - The p2 World configuration object.
13651+
* @protected
13652+
*/
13653+
this.config = config;
13654+
1364913655
/**
1365013656
* @property {p2.World} world - The p2 World in which the simulation is run.
1365113657
* @protected
1365213658
*/
13653-
this.world = new p2.World(config);
13659+
this.world = new p2.World(this.config);
1365413660

1365513661
/**
1365613662
* @property {number} frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property.
@@ -14434,10 +14440,12 @@ Phaser.Physics.P2.prototype = {
1443414440
* @param {Phaser.Sprite|Phaser.Physics.P2.Body|p2.Body} bodyA - First connected body.
1443514441
* @param {Phaser.Sprite|Phaser.Physics.P2.Body|p2.Body} bodyB - Second connected body.
1443614442
* @param {number} distance - The distance to keep between the bodies.
14443+
* @param {Array} [localAnchorA] - The anchor point for bodyA, defined locally in bodyA frame. Defaults to [0,0].
14444+
* @param {Array} [localAnchorB] - The anchor point for bodyB, defined locally in bodyB frame. Defaults to [0,0].
1443714445
* @param {number} [maxForce] - The maximum force that should be applied to constrain the bodies.
1443814446
* @return {Phaser.Physics.P2.DistanceConstraint} The constraint
1443914447
*/
14440-
createDistanceConstraint: function (bodyA, bodyB, distance, maxForce) {
14448+
createDistanceConstraint: function (bodyA, bodyB, distance, localAnchorA, localAnchorB, maxForce) {
1444114449

1444214450
bodyA = this.getBody(bodyA);
1444314451
bodyB = this.getBody(bodyB);
@@ -14448,7 +14456,7 @@ Phaser.Physics.P2.prototype = {
1444814456
}
1444914457
else
1445014458
{
14451-
return this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this, bodyA, bodyB, distance, maxForce));
14459+
return this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this, bodyA, bodyB, distance, localAnchorA, localAnchorB, maxForce));
1445214460
}
1445314461

1445414462
},
@@ -16856,15 +16864,15 @@ Phaser.Physics.P2.Body.prototype = {
1685616864
*
1685716865
* @method Phaser.Physics.P2.Body#addCapsule
1685816866
* @param {number} length - The distance between the end points in pixels.
16859-
* @param {number} radius - Radius of the capsule in radians.
16867+
* @param {number} radius - Radius of the capsule in pixels.
1686016868
* @param {number} [offsetX=0] - Local horizontal offset of the shape relative to the body center of mass.
1686116869
* @param {number} [offsetY=0] - Local vertical offset of the shape relative to the body center of mass.
1686216870
* @param {number} [rotation=0] - Local rotation of the shape relative to the body center of mass, specified in radians.
1686316871
* @return {p2.Capsule} The Capsule shape that was added to the Body.
1686416872
*/
1686516873
addCapsule: function (length, radius, offsetX, offsetY, rotation) {
1686616874

16867-
var shape = new p2.Capsule(this.world.pxm(length), radius);
16875+
var shape = new p2.Capsule(this.world.pxm(length), this.world.pxm(radius));
1686816876

1686916877
return this.addShape(shape, offsetX, offsetY, rotation);
1687016878

build/custom/p2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)