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
Matter.Factory.constraint wouldn't allow a zero length constraint to be created due to a falsey check of the length argument. You can now set length to be any value, including zero, or leave it undefined to have it automatically calculated
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@
16
16
### Bug Fixes
17
17
18
18
* The Scale Manager would throw the error 'TypeError: this.removeFullscreenTarget is not a function' when entering full-screen mode. It would still enter fullscreen, but the error would appear in the console. Fix #4605 (thanks @darklightcode)
19
-
19
+
*`Tilemap.renderDebug` was calling out-dated Graphics API methods, which would cause the debug to fail (thanks @Fabadiculous)
20
+
* The `Matter.Factory.constraint`, `joint` and `worldConstraint` methods wouldn't allow a zero length constraint to be created due to a falsey check of the length argument. You can now set length to be any value, including zero, or leave it undefined to have it automatically calculated (thanks @olilanz)
Copy file name to clipboardExpand all lines: src/physics/matter-js/Factory.js
+19-14Lines changed: 19 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -400,10 +400,10 @@ var Factory = new Class({
400
400
* @method Phaser.Physics.Matter.Factory#joint
401
401
* @since 3.0.0
402
402
*
403
-
* @param {MatterJS.Body} bodyA - [description]
404
-
* @param {MatterJS.Body} bodyB - [description]
405
-
* @param {number} length - [description]
406
-
* @param {number} [stiffness=1] - [description]
403
+
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
404
+
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
405
+
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
406
+
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
407
407
* @param {object} [options={}] - [description]
408
408
*
409
409
* @return {MatterJS.Constraint} A Matter JS Constraint.
@@ -421,7 +421,7 @@ var Factory = new Class({
421
421
*
422
422
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
423
423
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
424
-
* @param {number} length - A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`
424
+
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
425
425
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
* @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to.
442
+
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
443
+
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
444
+
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
445
445
* @param {object} [options={}] - [description]
446
446
*
447
447
* @return {MatterJS.Constraint} A Matter JS Constraint.
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
478
+
* @param {number} [length] - A Number that specifies the target resting length of the constraint. If not given it is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`.
479
+
* @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring.
480
480
* @param {object} [options={}] - [description]
481
481
*
482
482
* @return {MatterJS.Constraint} A Matter JS Constraint.
0 commit comments