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 {(string|array)} vertexSets - The vertices data. Either a path string or an array of vertices.
179
179
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation.
180
180
* @param {boolean} [flagInternal=false] - Flag internal edges (coincident part edges)
* @param {number} yOffsetA - The vertical offset of the BodyA constraint. This is a percentage based on the body size, not a world position.
414
431
* @param {number} xOffsetB - The horizontal offset of the BodyB constraint. This is a percentage based on the body size, not a world position.
415
432
* @param {number} yOffsetB - The vertical offset of the BodyB constraint. This is a percentage based on the body size, not a world position.
416
-
* @param {object} options - An optional Constraint configuration object passed to the newly created constraints.
433
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
417
434
*
418
435
* @return {MatterJS.Composite} The original composite that was passed to this method.
419
436
*/
@@ -432,7 +449,7 @@ var Factory = new Class({
432
449
* @param {number} columns - The number of columns in the mesh.
433
450
* @param {number} rows - The number of rows in the mesh.
434
451
* @param {boolean} crossBrace - Create cross braces for the mesh as well?
435
-
* @param {object} options - An optional Constraint configuration object passed to the newly created constraints.
452
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
436
453
*
437
454
* @return {MatterJS.Composite} The original composite that was passed to this method.
438
455
*/
@@ -501,8 +518,8 @@ var Factory = new Class({
501
518
* @param {number} rowGap - The distance between each row.
502
519
* @param {boolean} crossBrace - `true` to create cross braces between the bodies, or `false` to create just straight braces.
503
520
* @param {number} particleRadius - The radius of this circlular composite.
* @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [particleOptions] - An optional Body configuration object that is used to set initial Body properties on creation.
522
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [constraintOptions] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
506
523
*
507
524
* @return {MatterJS.Composite} A new composite simple soft body.
508
525
*/
@@ -516,7 +533,20 @@ var Factory = new Class({
516
533
},
517
534
518
535
/**
519
-
* [description]
536
+
* This method is an alias for `Factory.constraint`.
537
+
*
538
+
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
539
+
* between two bodies, or a body and a fixed world-space position.
540
+
*
541
+
* The stiffness of constraints can be modified to create springs or elastic.
542
+
*
543
+
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
544
+
* value (e.g. `0.7` or above).
545
+
*
546
+
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
547
+
* `constraintIterations` within the Matter Config.
548
+
*
549
+
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
520
550
*
521
551
* @method Phaser.Physics.Matter.Factory#joint
522
552
* @since 3.0.0
@@ -525,7 +555,7 @@ var Factory = new Class({
525
555
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
526
556
* @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`.
527
557
* @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.
528
-
* @param {object} [options={}] - [description]
558
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
529
559
*
530
560
* @return {MatterJS.Constraint} A Matter JS Constraint.
531
561
*/
@@ -535,7 +565,20 @@ var Factory = new Class({
535
565
},
536
566
537
567
/**
538
-
* [description]
568
+
* This method is an alias for `Factory.constraint`.
569
+
*
570
+
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
571
+
* between two bodies, or a body and a fixed world-space position.
572
+
*
573
+
* The stiffness of constraints can be modified to create springs or elastic.
574
+
*
575
+
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
576
+
* value (e.g. `0.7` or above).
577
+
*
578
+
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
579
+
* `constraintIterations` within the Matter Config.
580
+
*
581
+
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
539
582
*
540
583
* @method Phaser.Physics.Matter.Factory#spring
541
584
* @since 3.0.0
@@ -544,7 +587,7 @@ var Factory = new Class({
544
587
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
545
588
* @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`.
546
589
* @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.
547
-
* @param {object} [options={}] - [description]
590
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
548
591
*
549
592
* @return {MatterJS.Constraint} A Matter JS Constraint.
550
593
*/
@@ -554,7 +597,18 @@ var Factory = new Class({
554
597
},
555
598
556
599
/**
557
-
* [description]
600
+
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
601
+
* between two bodies, or a body and a fixed world-space position.
602
+
*
603
+
* The stiffness of constraints can be modified to create springs or elastic.
604
+
*
605
+
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
606
+
* value (e.g. `0.7` or above).
607
+
*
608
+
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
609
+
* `constraintIterations` within the Matter Config.
610
+
*
611
+
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
* @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to.
564
618
* @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`.
565
619
* @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.
566
-
* @param {object} [options={}] - [description]
620
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
567
621
*
568
622
* @return {MatterJS.Constraint} A Matter JS Constraint.
569
623
*/
@@ -590,15 +644,29 @@ var Factory = new Class({
590
644
},
591
645
592
646
/**
593
-
* [description]
647
+
* Constraints (or joints) are used for specifying that a fixed distance must be maintained
648
+
* between two bodies, or a body and a fixed world-space position.
649
+
*
650
+
* A world constraint has only one body, you should specify a `pointA` position in
651
+
* the constraint options parameter to attach the constraint to the world.
652
+
*
653
+
* The stiffness of constraints can be modified to create springs or elastic.
654
+
*
655
+
* To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness`
656
+
* value (e.g. `0.7` or above).
657
+
*
658
+
* If the constraint is unstable, try lowering the `stiffness` value and / or increasing
659
+
* `constraintIterations` within the Matter Config.
660
+
*
661
+
* For compound bodies, constraints must be applied to the parent body and not one of its parts.
* @param {MatterJS.Body} body - The Matter `Body` that this constraint is attached to.
599
667
* @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`.
600
668
* @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.
601
-
* @param {object} [options={}] - [description]
669
+
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
602
670
*
603
671
* @return {MatterJS.Constraint} A Matter JS Constraint.
604
672
*/
@@ -624,12 +692,21 @@ var Factory = new Class({
624
692
},
625
693
626
694
/**
627
-
* [description]
695
+
* This method is an alias for `Factory.pointerConstraint`.
696
+
*
697
+
* A Pointer Constraint is a special type of constraint that allows you to click
698
+
* and drag bodies in a Matter World. It monitors the active Pointers in a Scene,
699
+
* and when one is pressed down it checks to see if that hit any part of any active
700
+
* body in the world. If it did, and the body has input enabled, it will begin to
701
+
* drag it until either released, or you stop it via the `stopDrag` method.
702
+
*
703
+
* You can adjust the stiffness, length and other properties of the constraint via
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
633
710
*
634
711
* @return {MatterJS.Constraint} A Matter JS Constraint.
635
712
*/
@@ -639,12 +716,19 @@ var Factory = new Class({
639
716
},
640
717
641
718
/**
642
-
* [description]
719
+
* A Pointer Constraint is a special type of constraint that allows you to click
720
+
* and drag bodies in a Matter World. It monitors the active Pointers in a Scene,
721
+
* and when one is pressed down it checks to see if that hit any part of any active
722
+
* body in the world. If it did, and the body has input enabled, it will begin to
723
+
* drag it until either released, or you stop it via the `stopDrag` method.
724
+
*
725
+
* You can adjust the stiffness, length and other properties of the constraint via
* @param {Phaser.Types.Physics.Matter.MatterConstraintConfig} [options] - An optional Constraint configuration object that is used to set initial Constraint properties on creation.
648
732
*
649
733
* @return {MatterJS.Constraint} A Matter JS Constraint.
650
734
*/
@@ -693,21 +777,28 @@ var Factory = new Class({
693
777
},
694
778
695
779
/**
696
-
* [description]
780
+
* Creates a wrapper around a Tile that provides access to a corresponding Matter body. A tile can only
781
+
* have one Matter body associated with it. You can either pass in an existing Matter body for
782
+
* the tile or allow the constructor to create the corresponding body for you. If the Tile has a
783
+
* collision group (defined in Tiled), those shapes will be used to create the body. If not, the
784
+
* tile's rectangle bounding box will be used.
785
+
*
786
+
* The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody.
787
+
*
788
+
* Note: not all Tiled collision shapes are supported. See
789
+
* Phaser.Physics.Matter.TileBody#setFromTileCollision for more information.
697
790
*
698
791
* @method Phaser.Physics.Matter.Factory#tileBody
699
792
* @since 3.0.0
700
793
*
701
794
* @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body.
702
795
* @param {Phaser.Types.Physics.Matter.MatterTileOptions} [options] - Options to be used when creating the Matter body.
0 commit comments