Commit graph

13743 commits

Author SHA1 Message Date
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
64b5a283f3 Update CHANGELOG.md 2019-12-12 17:15:03 +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
Richard Davey
cc0f1db18c Update CHANGELOG.md 2019-12-12 13:31:51 +00: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
a10ca052f5 Update CHANGELOG.md 2019-12-11 13:06:11 +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
3bc73425a0 Update CHANGELOG.md 2019-12-10 17:53:47 +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
36e888cc81 Update CHANGELOG.md 2019-12-10 12:07:14 +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
Chris Andrew
15ac5e736a #4903 Clarified z position documentation by linking to depth GO component. 2019-12-09 16:57:05 +00:00
Richard Davey
f18c6b5fda Update CHANGELOG.md 2019-12-09 13:22:58 +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
ea3a0f8544 Update CHANGELOG.md 2019-12-09 12:52:09 +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
074c91c43a Update README.md
Added new Cerebralfix logo - thanks guys :)
2019-12-05 11:14:36 +00:00
Richard Davey
e98a639caa Update CHANGELOG.md 2019-12-04 03:52:04 +00:00
Richard Davey
a123faafdc Added new intersects, overlap and collision filter methods. 2019-12-04 03:52:00 +00:00