Richard Davey
8e7c3103d8
Moved the fromJSON code to its own external parser
2020-01-10 16:24:30 +00:00
Richard Davey
88cd83a508
Fixed bug in PhysicsEditorParser where it would allow non-clockwise vertices through
2020-01-10 15:32:03 +00:00
Richard Davey
1d827c911f
0.2 is just too dim
2020-01-10 14:53:39 +00:00
Richard Davey
ea2337c091
Only if parts = 1
2020-01-10 14:53:27 +00:00
Richard Davey
282a4df811
Update Factory.js
2020-01-10 14:53:17 +00:00
Richard Davey
e07513b707
Small restructure
2020-01-10 11:20:53 +00:00
Richard Davey
4e53d74581
Removed un-used properties
2020-01-10 11:20:41 +00:00
Richard Davey
e27914792e
More robust checks
2020-01-10 10:52:54 +00:00
Richard Davey
0d66c98ff0
Added JSDocs for fromPhysicsEditor
method and tidied things up a bit.
2020-01-10 08:56:49 +00:00
Richard Davey
ea338cadaa
Fixed JSDocs and origin assignment.
2020-01-10 08:56:31 +00:00
Richard Davey
5c9c00bfdb
Removed un-used code.
2020-01-10 08:56:17 +00:00
Richard Davey
887227a313
Added centerOffset back and fixed calculations
2020-01-10 08:55:56 +00:00
Richard Davey
6c947c9677
Updated PhysicsEditor Parser
...
Now allows you to specify options object to override the loaded config. Also removed un-used parameters and fixed JSDocs. Finally, using Common.clone to avoid mutating the loaded JSON.
2020-01-10 08:55:31 +00:00
samme
eacb61e109
Check for disabled body in collideSpriteVsGroup()
2020-01-09 19:45:11 -08:00
Richard Davey
d63001d719
Testing offsets
2020-01-09 17:55:03 +00:00
Richard Davey
590256fe92
Added fromPhysicsEditor method
2020-01-09 17:54:38 +00:00
Richard Davey
d3aaff82e1
Finished JSDocs
2020-01-09 16:38:33 +00:00
Richard Davey
a8f3c3b9c0
New BodyBounds class for getting body bounds based coordinates
2020-01-09 13:18:44 +00:00
Richard Davey
fceef3ddf0
Added BodyBounds class
2020-01-09 13:18:24 +00:00
Richard Davey
d031d91f1e
Added bodyBounds class, finished alignBody and fixed typedefs
2020-01-09 13:18:13 +00:00
Richard Davey
9aeead5cc2
New Body typedef
2020-01-09 13:17:56 +00:00
Richard Davey
4de6f17a38
Formatted docs
2020-01-09 13:17:43 +00:00
Richard Davey
cfa6eeb6e2
Finished alignBody method
2020-01-09 00:43:46 +00:00
Richard Davey
4d0618232b
Only render compound bounds
2020-01-09 00:43:38 +00:00
Richard Davey
312f4dab10
Start of alignBody method
2020-01-08 17:44:02 +00:00
Richard Davey
d6e0ba9b29
MatterPhysics.getConstraintLength
is a new method that will return the length of the given constraint, as this is something you cannot get from the constraint properties directly.
2020-01-08 14:41:24 +00:00
Richard Davey
ae8bfbc013
Added missing JSDocs
2020-01-08 12:15:29 +00:00
Richard Davey
2859eb6a68
Added new Set Body Config
2020-01-08 12:15:17 +00:00
Richard Davey
4e8c676895
Full JSDocs coverage!
2020-01-08 11:55:35 +00:00
Richard Davey
49556021ef
New constraint type defs
2020-01-08 11:55:24 +00:00
Richard Davey
ac92fbe1b0
Lots of JSDoc updates. Also removed velocity and force methods as they don't belong in the Factory.
2020-01-08 11:15:30 +00:00
Richard Davey
86edd99248
inverseMass
is a required property! Also removed duplicate jsdoc
2020-01-08 11:15:02 +00:00
Richard Davey
2ac0562fb6
Updated JSDocs
2020-01-08 11:14:40 +00:00
Richard Davey
6a8bce9250
Added essential new type defs
2020-01-08 11:14:26 +00:00
Richard Davey
b908ebdda2
Added fromSVG method
2020-01-08 01:50:51 +00:00
Richard Davey
279829b414
Added JSDocs
2020-01-07 17:54:47 +00:00
Richard Davey
868d599832
Added JSDocs
2020-01-07 17:31:41 +00:00
Richard Davey
99df00244b
Reduced default anchor size
2020-01-07 17:31:29 +00:00
Richard Davey
2b1ce933af
The internal Matter Composite.setModified
function will now emit a compositeModified
event, which the Matter World listens for, if debug draw is enabled, so it can update the composite children render styles.
2020-01-07 17:20:31 +00:00
Richard Davey
a2c1377131
You can now set gravity: false
in your Matter Config and it will reset gravity from the defaults to zero.
2020-01-07 16:38:13 +00:00
Richard Davey
105fb64b4f
Removed spaces
2020-01-07 14:39:22 +00:00
Richard Davey
2b66f81d28
Final config structure and values
2020-01-07 14:02:38 +00:00
Richard Davey
8527e10d64
Added renderCollisions and renderSeparations
2020-01-07 14:02:28 +00:00
Richard Davey
c0e61cf2be
Added renderBodyVelocity
2020-01-07 12:56:30 +00:00
Richard Davey
334f17439e
Update MatterDebugConfig.js
2020-01-07 12:39:31 +00:00
Richard Davey
ad1891cd8d
Added renderBodyBounds and renderBodyAxes methods
2020-01-07 12:39:27 +00:00
Richard Davey
0a801cbac4
Added World.renderGrid method.
...
Renamed showBodyPosition to showPositions
2020-01-07 11:56:39 +00:00
Richard Davey
76d2c971f7
Added showSensor debug option
2020-01-07 00:28:37 +00:00
Richard Davey
64c12a9c60
Added showBodyPosition config option
2020-01-06 22:30:38 +00:00
Richard Davey
aa32235f5a
Added applyForceFromPosition
2020-01-06 17:56:20 +00:00
Richard Davey
5b17e0e61e
Added jsdocs
2020-01-05 23:55:45 +00:00
Richard Davey
beefcf09b6
Added jsdocs
2020-01-05 23:54:08 +00:00
Richard Davey
25339383f1
Added jsdocs
2020-01-05 23:48:49 +00:00
Richard Davey
c5675ae171
Added jsdocs
2020-01-05 23:47:25 +00:00
Richard Davey
ffb604c502
Added new setVelocity, setVelocityX, setVelocityY, setAngularVelocity, applyForce and applyForceFromAngle methods.
2020-01-04 12:31:27 +00:00
Richard Davey
ba4c82e140
Added jsdocs
2020-01-04 12:27:04 +00:00
Richard Davey
5e027f7031
Added JSDocs
2020-01-02 16:45:28 +00:00
Richard Davey
1e6e350f7f
Typo fix
2020-01-02 01:57:26 +00:00
Richard Davey
7fdcfd540c
Remove render.opacity as it's not valid for constraints
2020-01-01 20:02:15 +00:00
Richard Davey
58c8efc2e5
Added jsdocs
2020-01-01 17:33:45 +00:00
Richard Davey
64690cf987
Body.gravityScale
is a new vector property that allows you to scale the effect of world gravity on a specific Body.
2019-12-21 08:29:57 +00:00
Richard Davey
29b0e96407
Merge pull request #4909 from samme/docs/arcade-physics-3
...
Docs for Arcade Physics
2019-12-18 14:29:51 +00:00
Richard Davey
5cb7d8484f
Added Game Object level collision events
2019-12-18 02:22:37 +00:00
Richard Davey
a7c644454f
Update PhysicsEditorParser.js
2019-12-17 18:04:10 +00:00
Richard Davey
e6b43a2f48
Improves jsdocs
2019-12-17 18:03:23 +00:00
Richard Davey
efcbd1e4e5
Added helper methods for setting body collision callbacks
2019-12-17 16:42:46 +00:00
Richard Davey
f64d3e59d0
Per-body collision callbacks
2019-12-17 16:42:30 +00:00
Richard Davey
0d62f60f60
Removed un-used properties, functions and docs
2019-12-17 16:42:16 +00:00
Richard Davey
21a6458608
Added new collision pair type defs
2019-12-17 16:41:58 +00:00
Richard Davey
ac124b8e20
Better handling of the runner config
2019-12-17 13:52:57 +00:00
Richard Davey
1412e1f4f9
Added typedef for Matter Runner config
2019-12-17 13:52:46 +00:00
Richard Davey
a158b14228
Matter.World.has
is a new method that will take a Matter Body, or Game Object, and search the world for it. If found, it will return true
.
2019-12-17 13:15:15 +00:00
Richard Davey
67a6fa81f9
Added jsdocs and property
2019-12-17 13:08:32 +00:00
Richard Davey
d260643c61
Stricter checks against body removal and addition
2019-12-17 13:07:16 +00:00
Richard Davey
29525868ff
Added jsdocs
2019-12-17 13:06:11 +00:00
Richard Davey
43b111dc3e
Removed unused code and tidied up the Phaser specific additions
2019-12-17 13:06:01 +00:00
Richard Davey
9c43681b79
Added jsdocs and off handler
2019-12-17 13:05:37 +00:00
Richard Davey
37b2fbd044
Removed calcOffset
2019-12-17 13:05:16 +00:00
Richard Davey
1a50665ce1
Function not triggering properly. Adding to Body directly.
2019-12-17 02:14:54 +00:00
Richard Davey
819a6b20ae
Walking through Matter compare merge
2019-12-16 17:12:12 +00:00
Richard Davey
f9e5246af0
Refactored so ops are done when the engine udates, not when the dom updates
2019-12-13 19:41:47 +00:00
Richard Davey
87a8af35c5
Added in Matter Runner
2019-12-13 19:41:27 +00:00
Richard Davey
604531d70a
Disable sync verts for now
2019-12-13 19:41:18 +00:00
Richard Davey
e117a679d2
Still fix sleeping
2019-12-13 01:16:54 +00:00
Richard Davey
63083882d3
MatterGameObject
has a new optional boolean parameter addToWorld
which lets you control if the Body should be added to the world or not. Useful for toggling off should you be merging pre-existing bodies with Game Objects.
2019-12-12 17:15:00 +00:00
samme
fa57f74b8f
Docs for Arcade Physics
2019-12-12 08:14:53 -08:00
Richard Davey
7ba6e9fe6b
Added setCompositeRenderStyle method
2019-12-12 13:31:47 +00:00
Richard Davey
093557a6ea
Removed worldConstraint changes
2019-12-12 13:31:36 +00:00
Richard Davey
03e67e2c50
Added docs and Body level syncVerts property
2019-12-12 12:41:11 +00:00
Richard Davey
01fa4d2c54
Fix handling of centerOfMass
2019-12-11 16:06:15 +00:00
Richard Davey
7a2c434ffc
Remove deprecated code
2019-12-11 16:06:01 +00:00
Richard Davey
4032f87368
Fixed handling deeply nested bodies
2019-12-11 16:05:52 +00:00
Richard Davey
4b14e489af
Added start of fromJSON
2019-12-11 15:01:05 +00:00
Richard Davey
69eec0add9
Fixed overlap method
2019-12-11 15:00:51 +00:00
Richard Davey
c267662259
Update World.js
2019-12-11 15:00:41 +00:00
Richard Davey
30750d1208
Update PhysicsEditorParser.js
2019-12-11 13:07:04 +00:00
Richard Davey
826431c7fa
Tidying up
2019-12-11 13:06:07 +00:00
Richard Davey
19fc914a5b
PhysicsEditorParser.parseVertices
now uses Bodies.flagCoincidentParts
to avoid duplicating code.
2019-12-11 13:05:58 +00:00
Richard Davey
f5908fee8f
Matter.Bodies.flagCoincidentParts
is a new function that will flags all internal edges (coincident parts) on an array of body parts. This was previously part of the fromVertices
function, but has been made external for outside use.
2019-12-11 13:05:49 +00:00
Richard Davey
bf00d63cc6
Body.syncVerts
is a new function that will re-sync the vert positions with the body position. Called if Engine.syncVerts
is set (which is now the default)
2019-12-10 17:53:44 +00:00
Richard Davey
a910a27349
Engine.syncVerts
is a new Engine config property that allows you to run a vert re-sync at the end of the Engine step. This can help massively if you find you've got verts drifting out of alignment with the body position when using pointer contraints, or high velocity environments. Uses the new Engine._bodiesSync
function.
2019-12-10 17:52:37 +00:00
Richard Davey
444bdf116f
Debug tweaks
2019-12-10 17:50:04 +00:00
Richard Davey
c6bfaa8e4a
Vertices.calcOffset
is a new function that calculates the vert body position offset, used for keeping data in sync.
2019-12-10 17:49:41 +00:00
Richard Davey
4f3a524114
Update World.js
2019-12-10 14:02:50 +00:00
Richard Davey
b7343f3424
Bumped Matter Plugin versions to avoid console logs from Common.info and Common.warn.
2019-12-10 14:02:10 +00:00
Richard Davey
56929fb8c6
Removed use of Common.indexOf (no need for it)
2019-12-10 12:07:03 +00:00
Richard Davey
118aa3a941
Format fix
2019-12-10 12:05:12 +00:00
Richard Davey
0e95c1ad19
Merged Body.setCentre
2019-12-10 12:03:27 +00:00
Richard Davey
dc127081eb
Merged new pointAWorld and pointBWorld functions
2019-12-10 12:01:58 +00:00
Richard Davey
257c00228b
Removed un-used _requireGlobal function
2019-12-10 12:01:42 +00:00
Richard Davey
f22c3ad17d
New fromPath reg exp
2019-12-10 12:01:24 +00:00
Richard Davey
5b17e35a87
Format tidy-up
2019-12-10 12:01:14 +00:00
Richard Davey
7bdcb5a892
Temp bounds debug
2019-12-10 02:42:16 +00:00
Richard Davey
b92e8e9a60
Moved position update to earlier (was too soon)
2019-12-09 17:13:10 +00:00
Richard Davey
eb254f0c5c
If the Matter.Body
config doesn't contain a position
property, it will now default to using Vertices.centre(body.vertices)
as the position. In most cases, this is what you need, so it saves having to pass it in the config object.
2019-12-09 13:22:55 +00:00
Richard Davey
c9adc01111
The Matter.PhysicsEditorParser
has been updated so it no longer needs to set the render offsets, and instead uses the center of mass values.
2019-12-09 12:52:05 +00:00
Richard Davey
8f67dad4a5
Matter.setExistingBody
, which is called interally whenever a Body is set on a Game Object, now uses the new centerOffset
values to ensure that the texture frame is correctly centered based on the center of mass, not the Body bounds, allowing for much more accurate body to texture mapping with complex multi-part compound bodies.
2019-12-09 12:51:26 +00:00
Richard Davey
53314ca435
The Matter.Mass.centerOfMass
component property now returns the pre-calculated Body centerOfMass
property, which is much more accurate than the previous bounds offset value.
2019-12-09 12:49:55 +00:00
Richard Davey
9f012ebf86
Matter.Transform.centerOffsetX
is a new read-only property available on all Matter Game Objects that returns the horizontal offset between the center of the frame and the center of mass. This can be used to allow for accurately mapping texture centers to the body center.
2019-12-09 12:48:51 +00:00
Richard Davey
50b511e872
Matter.Body.centerOfMass
is a new property added to the Matter Body object that retains the center of mass coordinates when the Body is first created.
2019-12-09 12:45:44 +00:00
Richard Davey
7ae124ff6e
Docs fix.
2019-12-09 08:57:24 +00:00
Richard Davey
44ff20d07e
Added deltaXFinal
and deltaYFinal
methods.
2019-12-09 08:55:37 +00:00
Richard Davey
a123faafdc
Added new intersects, overlap and collision filter methods.
2019-12-04 03:52:00 +00:00
Richard Davey
e7cac4ebe9
Removed old config values and now handles opacity properly
2019-12-04 03:14:06 +00:00
Richard Davey
aeb3d5af06
Removed old properties and added new ones
2019-12-04 03:13:44 +00:00
Richard Davey
22baba0749
Updated custom render properties
2019-12-04 03:13:02 +00:00
Richard Davey
59749ab519
Skip matching a body against itself
2019-12-04 03:12:46 +00:00
Richard Davey
9b8ce1b8e3
Adjust Resolver properties from matter config
2019-12-03 16:56:29 +00:00
Richard Davey
75e2f76f8f
Update Collision.js
2019-12-03 16:56:16 +00:00
Richard Davey
76c81e19c3
Moved the render style methods to World and use them as part of the event proxy
2019-12-03 14:48:04 +00:00
Richard Davey
7d2f3b33b5
Added setBodyRenderStyle and setConstraintRenderStyle methods.
2019-12-03 14:06:32 +00:00
Richard Davey
c299b02542
Update MatterCollisionEvents.js
2019-12-03 14:06:15 +00:00
Richard Davey
9a0218b3da
Fixed line style and updated parameter names.
2019-12-03 14:06:10 +00:00
Richard Davey
f050b148ec
Rewrote plugin to tidy it up.
2019-12-03 10:43:35 +00:00
Richard Davey
e0ae756f0d
Add the new collision events plugin.
2019-12-02 19:21:04 +00:00
Richard Davey
ca293d710f
Proxy the add and remove events and better handle debug draw injection.
2019-12-02 19:20:54 +00:00
Richard Davey
bdbd74917a
Added missing plugin configs.
2019-12-02 19:20:24 +00:00
Richard Davey
b38668eb5f
Finished all the JSDocs, exposed all Matter modules and added the new point checking methods.
2019-12-02 19:20:13 +00:00
Richard Davey
d75fb5b918
Removed un-used render properties and added new ones
2019-12-02 19:19:42 +00:00
Richard Davey
c32368e03e
Added the new ADD and REMOVE Matter World events
2019-12-02 19:19:21 +00:00
Richard Davey
b71d4059a7
100% JSDoc'd!
2019-12-02 15:07:44 +00:00
Richard Davey
4f8dd24df2
Handle legacy configs for now.
2019-11-28 16:19:03 +00:00
Richard Davey
2a4dadf3a7
Update MatterWorldConfig.js
2019-11-28 16:18:53 +00:00
Richard Davey
8a844fc4d3
Create MatterDebugConfig.js
2019-11-28 16:18:49 +00:00
Richard Davey
f126f28121
Split out the debug rendering process into single methods, so they can be called externally if required
2019-11-28 10:43:26 +00:00
Richard Davey
65008266d6
Fixed worldConstraint
2019-11-27 17:49:38 +00:00
Richard Davey
4a1b9691c8
Custom render values set?
2019-11-27 17:49:30 +00:00
Richard Davey
3d46304b6a
Final new debug config added
2019-11-27 17:49:21 +00:00
Richard Davey
7b280e4fb2
Redoing debug config
2019-11-26 16:39:34 +00:00
Richard Davey
dc6b080091
Merge pull request #4874 from samme/feature/overlapCirc
...
Add ArcadePhysics#overlapCirc()
2019-11-20 22:02:15 +00:00