Commit graph

681 commits

Author SHA1 Message Date
Richard Davey
2096729095 Missing require 2018-03-28 14:15:32 +01:00
Richard Davey
15c4334dc7 jsdoc fixes 2018-03-28 14:11:46 +01:00
Richard Davey
e7a1e3190a Matter Physics timestep adjustments (getDelta, step, set60Hz, etc)
* Matter Physics now has a new config property `getDelta` which allows you to specify your own function to calculate the delta value given to the Matter Engine when it updates.
* Matter Physics has two new methods: `set60Hz` and `set30Hz` which will set an Engine update rate of 60Hz and 30Hz respectively. 60Hz being the default.
* Matter Physics has a new config and run-time property `autoUpdate`, which defaults to `true`. When enabled the Matter Engine will update in sync with the game step (set by Request Animation Frame). The delta value given to Matter is now controlled by the `getDelta` function.
* Matter Physics has a new method `step` which manually advances the physics simulation by one iteration, using whatever delta and correction values you pass in to it. When used in combination with `autoUpdate=false` you can now explicitly control the update frequency of the physics simulation and unbind it from the game step.
2018-03-27 15:15:05 +01:00
orblazer
f42f1bf132 Change structs for generic types 2018-03-23 16:54:12 +01:00
Richard Davey
574221d6cf A new property was added to Matter.World, correction which is used in the Engine.update call and allows you to adjust the time being passed to the simulation. The default value is 1 to remain consistent with previous releases. 2018-03-23 02:19:18 +00:00
Richard Davey
d78a9d097f eslint fixes 2018-03-22 13:22:23 +00:00
orblazer
ed1f2a7011 Fix wrong types 2018-03-22 13:51:30 +01:00
Richard Davey
32d9b82f93 Spacing 2018-03-21 17:22:09 +00:00
Richard Davey
0ef92e1172 Merge branch 'pr/3439' 2018-03-21 16:06:56 +00:00
Richard Davey
c6fc61e470 Fixed class names 2018-03-21 14:41:45 +00:00
Richard Davey
72690734c3 Fixed exposure 2018-03-21 14:41:34 +00:00
orblazer
11845f9d6d Fix "object" types on Physics and Math 2018-03-21 14:15:25 +01:00
Richard Davey
db613c793a Merge branch 'master' of https://github.com/photonstorm/phaser 2018-03-21 03:17:00 +00:00
Richard Davey
2f86100f87 MatterGameObject is a new function, available via the Matter Factory in this.matter.add.gameObject, that will inject a Matter JS Body into any Game Object, such as a Text object. 2018-03-21 03:16:36 +00:00
Richard Davey
5cae6d38b3 Matter.SetBody and SetExistingBody will now set the origin of the Game Object to be the Matter JS sprite.xOffset and yOffset values, which will auto-center the Game Object to the origin of the body, regardless of shape. 2018-03-21 03:16:01 +00:00
orblazer
7fba122321 Fix "any" types 2018-03-20 17:15:49 +01:00
orblazer
dca7996179 Fix multiple types on Physics, Texture and Input 2018-03-20 16:10:19 +01:00
orblazer
4cff464555 Fix nullable types 2018-03-20 15:36:03 +01:00
orblazer
fa13b597e3 Add more callbacks 2018-03-19 23:08:05 +01:00
orblazer
f30218d3d3 Add callbacks on Physics 2018-03-19 21:42:07 +01:00
Richard Davey
19a08286c0 More types added 2018-03-19 15:01:14 +00:00
Richard Davey
620bcc6ae5 jsdoc fixes and additions 2018-03-19 13:45:00 +00:00
orblazer
ae15eca7bd Update JSDoc on "Matter.JS" physics 2018-03-19 01:10:32 +01:00
orblazer
2da6a2bffe Update JSDoc on "Impact" physics 2018-03-19 00:42:09 +01:00
orblazer
af3c03a3cb Update JSDoc on "Arcade" physics 2018-03-19 00:29:46 +01:00
Richard Davey
edeb63ebbd eslint fix 2018-03-18 14:21:53 +00:00
Richard Davey
3d4be64331 Testing MatterGameObject 2018-03-17 18:07:05 +00:00
Richard Davey
05a4385cd7 jsdoc fixes 2018-03-16 17:29:39 +00:00
Richard Davey
a524dc44b0 Expose constants. Fix #3387 2018-03-16 13:29:30 +00:00
Richard Davey
7a8e4cf5e1
Merge pull request #3366 from samme/feature/world-wrap
Add Arcade.World wrap methods and Actions.WrapInRectangle
2018-03-16 12:58:16 +00:00
Sean Bohan
4cde28fecd Forgot to devide width by 2 2018-03-16 14:02:41 +08:00
Sean Bohan
72e82ecf48 Fix debug draw of scaled arcade body 2018-03-16 14:02:41 +08:00
samme
4b25574d82 Expect v3.3.0 2018-03-12 07:29:49 -07:00
samme
66e5a72dae Add Phaser.Physics.Arcade.World#wrap and friends
- Phaser.Physics.Arcade.World#wrap
- Phaser.Physics.Arcade.World#wrapArray
- Phaser.Physics.Arcade.World#wrapObject
2018-03-10 13:36:18 -08:00
Samid\Sami
f5e471dad7 removed trailing space for JSHint validation. 2018-03-08 11:46:01 +01:00
Samid\Sami
84481da4d1 * Fix #3345 by adding beginPath and closePath when done drawing in postUpdate. 2018-03-08 11:16:04 +01:00
Patrick Galbraith
8eb82e4fcb
Fix for collideGroupVsSelf is undefined
This happens when you call collide with a single group as the first param.

Seems like the `collideGroupVsSelf` function was not implemented. I've changed it to just call the `collideGroupVsGroup` with the first object twice which worked when I tested it on my project.
2018-03-05 21:15:38 +10:30
Sean Bohan
3f2e63fc17 Fix arcade body does not align with scaled parent object.
When a game object scaled, arcade body still calculate its position based on its original size instead of scaled one.
2018-03-01 09:02:04 +08:00
Richard Davey
1cae348300
Merge pull request #3278 from nkholski/arcadeGroups
Groups arcade collision
2018-02-28 20:56:11 +00:00
Richard Davey
218b4e4a52
Merge pull request #3285 from samme/docs/onWorldBounds
Describe Arcade.Body#onWorldBounds
2018-02-28 20:48:31 +00:00
Richard Davey
921d7e317a Arcade Physics Bodies didn't apply the results of allowRotation to the parent Game Object. 2018-02-27 01:08:55 +00:00
samme
36d91e9955 Describe Arcade.Body#onWorldBounds 2018-02-26 11:27:57 -08:00
Niklas Berg
b87d71ab73 single out groups without physics 2018-02-24 08:44:38 +01:00
Niklas Berg
b9e4d15efb Groups arcade collisions 2018-02-23 23:49:12 +01:00
samme
64e5b4394a Fix 'static is a reserved word in strict mode' 2018-02-18 10:38:08 -08:00
Richard Davey
3c65121cb3 eslint fixes 2018-02-16 19:17:49 +00:00
Richard Davey
d23688c3e4 Added eslint fixes and overrides 2018-02-16 18:44:07 +00:00
Richard Davey
3f155bf8f3 World didn't import GetOverlapX or GetOverlapY, causing separateCircle to break. 2018-02-16 18:43:06 +00:00
Richard Davey
86f00eeb52 eslint fixes 2018-02-16 18:17:51 +00:00
Richard Davey
4e6df03512 Updated semver 2018-02-15 14:31:15 +00:00