P2.Body.addCapsule didn't use to pass the radius value through pxm, but now does so you have to specify it in pixels, not meters.

This commit is contained in:
photonstorm 2014-09-05 16:31:52 +01:00
parent 73e9a74350
commit 59f7c53019
2 changed files with 3 additions and 2 deletions

View file

@ -188,6 +188,7 @@ Version 2.1.0 - "Cairhien" - -in development-
* Rectangle.bottom setter swapped the order of the calculation (thanks @JakeCoxon #1165)
* Phaser.Text wouldn't render the text to its local canvas if you passed the text on the constructor and didn't add it to the display list. If a string is given it now updates the local canvas on creation.
* Signal.removeAll would ignore the context parameter and remove all bindings regardless (thanks @alect #1168)
* P2.Body.addCapsule didn't use to pass the radius value through pxm, but now does so you have to specify it in pixels, not meters.
### p2.js 0.6.0 Changes and New Features

View file

@ -918,7 +918,7 @@ Phaser.Physics.P2.Body.prototype = {
*
* @method Phaser.Physics.P2.Body#addCapsule
* @param {number} length - The distance between the end points in pixels.
* @param {number} radius - Radius of the capsule in radians.
* @param {number} radius - Radius of the capsule in pixels.
* @param {number} [offsetX=0] - Local horizontal offset of the shape relative to the body center of mass.
* @param {number} [offsetY=0] - Local vertical offset of the shape relative to the body center of mass.
* @param {number} [rotation=0] - Local rotation of the shape relative to the body center of mass, specified in radians.
@ -926,7 +926,7 @@ Phaser.Physics.P2.Body.prototype = {
*/
addCapsule: function (length, radius, offsetX, offsetY, rotation) {
var shape = new p2.Capsule(this.world.pxm(length), radius);
var shape = new p2.Capsule(this.world.pxm(length), this.world.pxm(radius));
return this.addShape(shape, offsetX, offsetY, rotation);