Commit graph

1507 commits

Author SHA1 Message Date
Richard Davey
468bf7821d Updated copyright year 2023-01-02 17:36:27 +00:00
Richard Davey
463b602608 Use getters 2022-12-27 16:56:05 +00:00
Bambosh
8038341c96 Compare maxSpeed with updated velocity 2022-12-24 15:26:13 +11:00
samme
09be12612b Docs: change "Constructor" types to function
- Phaser.Types.GameObjects.Group.GroupClassTypeConstructor
- Phaser.Types.GameObjects.Particles.ParticleClassConstructor
- Phaser.Types.Tilemaps.CreateFromObjectsClassTypeConstructor

Fixes #6318
2022-12-16 15:37:09 -08:00
Richard Davey
4b4473394c Debugging circle collision 2022-12-13 18:24:41 +00:00
Richard Davey
e2539824ec Update World.js 2022-12-13 13:41:17 +00:00
Richard Davey
c5c2d2b329 Fixing the separation of non-pushable circular bodies 2022-12-13 01:56:23 +00:00
samme
995edbbe85 Add maxSpeed and useDamping to physics group config 2022-11-23 09:06:44 -08:00
Richard Davey
2a8250ef60 Modified return types to 'this' 2022-11-03 16:03:51 +00:00
Richard Davey
4bd64129e9 Only checkWorldBounds in Body.reset if the Body collides with it 2022-10-11 01:45:21 +01:00
Richard Davey
d68b0b7c91
Merge pull request #6155 from ef4/better-closest-type
Improve types for ArcdePhysics.closest
2022-10-10 14:50:36 +01:00
Richard Davey
023343c789 All events have a type of string. Fix #6136 2022-09-21 22:01:03 +01:00
samme
d40b084063 Destroy debugGraphic also 2022-08-18 17:25:32 -07:00
Richard Davey
13b6598558 The Physics.Arcade.Body.reset() method will now call Body.checkWorldBounds as part of the process, moving the body outside of the bounds, should you have positioned it so they overlap during the reset. Fix #5978 2022-07-28 18:35:56 +01:00
Richard Davey
c47a40ba97 Working through making Body a passable type 2022-07-04 18:44:10 +01:00
Richard Davey
ec8f20b692 Swap the handler type and fixed staticBody 2022-07-04 16:40:13 +01:00
Richard Davey
132ab9cdbd Added isBody property 2022-07-04 16:39:53 +01:00
Richard Davey
6b55ac6b06 Made gameObject optional 2022-07-04 15:55:14 +01:00
Richard Davey
284277887f Added body and staticBody methods 2022-07-04 15:55:07 +01:00
Richard Davey
20c597738f Made gameObject optional and added setGameObject method 2022-07-04 15:54:53 +01:00
Edward Faulkner
0791302699 Improve types for ArcdePhysics.closest
This uses generics so that the return type from closest() is narrowed to match whatever type you passed in for the eligible targets.

Resulting typescript diff:

```diff
--- a/types/phaser.d.ts
+++ b/types/phaser.d.ts
@@ -70565,7 +70565,7 @@ declare namespace Phaser {
                  * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object.
                  * @param targets The targets.
                  */
-                closest(source: any, targets?: Phaser.Physics.Arcade.Body[] | Phaser.Physics.Arcade.StaticBody[] | Phaser.GameObjects.GameObject[]): Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody | Phaser.GameObjects.GameObject;
+                closest<Target extends Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|Phaser.GameObjects.GameObject>(source: Phaser.Types.Math.Vector2Like, targets?: Target[]): Target | null;

                 /**
                  * Finds the Body or Game Object farthest from a source point or object.
(END)
```
2022-06-25 17:00:02 -04:00
Richard Davey
4f005e3701 The Arcade Physics World.enableBody method will now only create and add a Body to an object if it has the Transform component, tested by checking the hasTransformComponent property. Without the Transform component, creating a Body would error with NaN values, causing the rest of the bodies in the world to fail. 2022-05-31 18:15:41 +01:00
Richard Davey
0e09776bd5 Added tileFilterOptions property 2022-05-26 18:54:55 +01:00
Richard Davey
aedf666ffc Testing filterOptions to avoid needless iterations 2022-05-25 21:01:30 +01:00
Richard Davey
c45caa86df JSDoc fix 2022-05-25 21:01:12 +01:00
Richard Davey
1020f72e4b Fixed type 2022-05-10 18:07:17 +01:00
Richard Davey
59fbcc5ca3 Updated copyright year 2022-02-28 14:29:51 +00:00
Richard Davey
7aa7187a0f
Merge pull request #5870 from samme/docs/class-types
Add GroupClassTypeConstructor and ParticleClassConstructor types
2022-02-28 13:53:39 +00:00
Richard Davey
af07ed11cf Extract flagCoincidentParts function 2022-02-04 14:49:51 +00:00
Richard Davey
50e3202a87 Set the decomp library 2022-02-04 14:49:27 +00:00
Richard Davey
749c9a8af3 Removed un-used modules and properties 2022-02-04 14:22:01 +00:00
Richard Davey
78417b3033 Upgraded Matter Physics to the v0.18 release 2022-02-03 18:44:17 +00:00
samme
3ab43f56f6 Revert "Skip intersects check by argument"
This reverts commit d80e4f5824.
2021-12-23 10:55:23 -08:00
samme
6dc89a4596 Docs: namespace ArcadePhysicsCallback 2021-11-21 20:23:31 -08:00
Richard Davey
950ba75bfc Updated jsdocs 2021-11-02 14:02:46 +00:00
Richard Davey
8a941dce98 Added optional shape config 2021-10-27 13:19:40 +01:00
samme
52e402e14e Docs: add Phaser.Types.GameObjects.Group.GroupClassTypeConstructor 2021-10-13 13:22:54 -07:00
Richard Davey
a4d8c9be47 Fix #5759 2021-09-28 15:21:13 +01:00
Richard Davey
d70b149170
Merge pull request #5793 from samme/fix/separate-tile-update-center
Update body center after tile separation
2021-09-22 11:01:28 +01:00
Richard Davey
f0eb694166
Merge pull request #5763 from samme/fix/group-double-collide
Do physics group vs. self collisions without the RTree
2021-09-21 11:44:52 +01:00
Richard Davey
2546096b64 Fixed JSDocs. Close #5836 2021-09-21 11:33:01 +01:00
samme
214a19fb7a Update body center after tile separation 2021-07-28 09:57:54 -07:00
Ikko Ashimine
21b11d8f7b
Fix typo in MatterCollisionPair.js
occured -> occurred
2021-07-07 16:40:53 +09:00
samme
abfb8c6d7d Collide group vs self as array
Fixes #5758
2021-06-29 10:46:57 -07:00
Richard Davey
f001d6db2e
Merge pull request #5577 from samme/patch-6
Docs: damping in Phaser.Physics.Arcade.Body#drag
2021-03-01 16:39:47 +00:00
Richard Davey
d22e3567c7 Fixed a conditional bug in Arcade Physics ProcessX when Body2 is Immovable and Body1 is not 2021-02-25 14:40:34 +00:00
samme
ea7a9aa132
Docs: damping in Phaser.Physics.Arcade.Body#drag 2021-02-23 09:53:42 -08:00
Richard Davey
74fd1531bc Matter.Components.Sleep.setToSleep and setAwake were documented as returning this, however they didn't return anything. Both now return this correctly. Fix #5567 2021-02-17 13:08:24 +00:00
Erik Demaine
3accf46223
Fix setPolygon documentation
The order of arguments in `Body.setPolygon`'s documentation was the opposite from the actual code.
2021-01-22 20:13:25 -05:00
Richard Davey
cbe1a3219a JSDoc improvements 2020-12-14 13:33:42 +00:00
Richard Davey
28d925b875 JSDoc fixes 2020-11-23 15:06:45 +00:00
Richard Davey
417f7684c3 More integer to number changes 2020-11-23 10:32:00 +00:00
Richard Davey
02c34cd64e Replace integer with number 2020-11-23 10:22:13 +00:00
Richard Davey
d397551b3d
Merge pull request #5391 from samme/fix/overlapR
Set Arcade.Body#overlapR in separateCircle()
2020-11-09 17:10:18 +00:00
Richard Davey
ca8f201e8a
Merge pull request #5388 from samme/feature/scale-damping
Scale damping by the physics step delta
2020-11-09 17:07:30 +00:00
Richard Davey
6c69cf3627
Merge pull request #5387 from samme/docs/static-body
Docs: StaticBody#touching etc.
2020-11-09 17:06:57 +00:00
Richard Davey
bbb397c860
Merge pull request #5350 from samme/feature/worldstep-event-delta
Add delta argument to WORLD_STEP event
2020-11-09 17:05:37 +00:00
samme
956f880fa4 Set overlapR in separateCircle() 2020-11-08 09:19:53 -08:00
samme
4185e661d7 Docs: banish StaticBody touching properties
Fixes #5381
2020-11-07 10:04:28 -08:00
samme
be558d2dca Scale damping 2020-10-22 13:59:49 -07:00
Richard Davey
675e43350d Physics.Arcade.Body.setDamping is a new method that allows you to set the useDamping property of a Body in a chainable way. Fix #5352 2020-10-16 17:57:26 +01:00
Richard Davey
8a01ae1cb7 Call the component directly to avoid lots of function diving 2020-10-15 11:47:24 +01:00
Richard Davey
8d2e7b08c5 Update World.js 2020-10-15 11:07:51 +01:00
Richard Davey
417e57c199 Update Collider.js 2020-10-15 11:07:27 +01:00
Richard Davey
00b8bb4e0f
Merge pull request #5344 from samme/fix/collisions-update-center
Correct Arcade Body center after separations
2020-10-06 09:45:41 +01:00
samme
130160f825 Update center after world bounds collision 2020-10-03 13:46:11 -07:00
Richard Davey
9caadeb364 Lint fix. #4992 2020-10-02 09:49:39 +01:00
Richard Davey
c3c35322c4
Merge pull request #4992 from svipal/master
Preliminary PR for isometric support
2020-10-02 09:42:47 +01:00
samme
2223aebffb Don't update center before separation
Should be unnecessary now
2020-10-01 10:44:40 -07:00
samme
9a348409e3 Update center after separation 2020-10-01 10:42:30 -07:00
samme
e639bb73d8 Correct Arcade Body types
For TypeScript

Fixes #5328
2020-09-28 11:42:21 -07:00
Richard Davey
1d66284a22 Removed debug logs and finished JSDocs 2020-09-28 15:25:43 +01:00
Richard Davey
34be82a20c Added processX and processY methods 2020-09-28 15:25:28 +01:00
Richard Davey
4d484e2c0c Updated to handle face blocking and all possible checks 2020-09-28 13:07:32 +01:00
Richard Davey
731e661d56 No longer needed 2020-09-28 13:07:11 +01:00
Richard Davey
4785953368 Merge branch 'master' of https://github.com/photonstorm/phaser 2020-09-28 08:07:23 +01:00
Richard Davey
09c2a2d622 Testing new separation 2020-09-28 08:07:19 +01:00
Richard Davey
30b514fc58
Merge pull request #5326 from samme/fix/body-setOffset
Remove Arcade.Body#updateCenter() in Arcade.Body#setOffset()
2020-09-26 10:19:53 +01:00
samme
639a93583f Remove updateCenter() in setOffset() 2020-09-25 14:42:56 -07:00
samme
d0f6070e14 Docs: Arcade.Body#setOffset 2020-09-25 14:37:26 -07:00
samme
13c27064a8 Docs: Arcade.Body#reset
Only game object receives the passed coordinates
2020-09-25 14:19:12 -07:00
Richard Davey
bed716e382 X Separation working properly in all cases. Now to adjust Y. 2020-09-25 21:25:01 +01:00
Richard Davey
7630b8e28d Testing new Separation logic (Y done, X in progress) 2020-09-25 18:01:40 +01:00
Richard Davey
2bcf1f70be Testing new separation logic (incomplete atm) 2020-09-24 18:10:11 +01:00
Richard Davey
da78d3ee42 Tidy up docs 2020-09-24 18:10:00 +01:00
Richard Davey
69b8458bb8 Added new pushable component 2020-09-24 18:09:49 +01:00
Richard Davey
b64d63f60e When running an Arcade Physics overlap test against a StaticBody, it will no longer set the blocked states of the dynamic body. If you are doing a collision test, they will still be set, but they're skipped for overlap-only tests. Fix #4435 2020-09-24 11:04:56 +01:00
samme
426c9632c7 Set maxVelocity in PhysicsGroupConfig 2020-09-22 16:05:21 -07:00
Svipal
299f83c13d fixed conflicts 2020-09-19 10:56:05 +02:00
svipal
79fe9abc6e finished updating culling system 2020-09-18 17:16:52 +02:00
samme
2eb505c91d Docs: Arcade.Body#setCollideWorldBounds 2020-09-17 14:20:13 -07:00
samme
7aa8f02d8c Add onWorldBounds arg in setCollideWorldBounds() 2020-09-17 14:19:57 -07:00
Richard Davey
e450bf2f1f Swap to using constants for pipeline names 2020-09-09 13:05:18 +01:00
samme
b0ce62e2d8
Docs: correct type for Body#customBoundsRectangle 2020-09-08 18:44:12 -07:00
Svipal
1994185d6f merged master 2020-09-08 22:17:04 +02:00
Richard Davey
cdd612a273 AnimationState has moved namespace to keep things logically together 2020-09-08 09:31:59 +01:00
Richard Davey
5344d39498 Better Group docs. Fix #5011 2020-09-07 16:40:05 +01:00
Richard Davey
4af38a4836
Merge pull request #5285 from samme/feature/arcade-config-fixedstep
Add ArcadeWorldConfig.fixedStep
2020-09-07 16:24:49 +01:00
Richard Davey
6eae9ca598 Fixed reference 2020-09-07 10:26:10 +01:00
samme
803c300ae4 Add ArcadeWorldConfig.fixedStep 2020-09-03 07:32:44 -07:00