Commit graph

71 commits

Author SHA1 Message Date
Christoph Dörfel
2623ddeaf7 Convenience function to remove a collision group from a P2 Body 2015-08-30 00:19:37 +02:00
photonstorm
55a7699381 Setting a P2.Body from Static or Kinematic to Dynamic will now automatically adjust the Body.mass to be 1 (thanks @wayfu #2005) 2015-08-20 11:19:30 +01:00
Richard Davey
4eb223f987 jsdocs fix. 2015-07-31 18:39:37 +01:00
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
photonstorm
a0d57544c7 P2 updates finished. 2015-07-13 14:48:33 +01:00
photonstorm
956fa493a6 The P2.Body.onBeginContact arguments have changed. It now sends 5 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array. Note that the Phaser.P2.Body may be null if you collide with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
The P2.Body.onEndContact arguments have changed. It now sends 4 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A and the p2 Shape from Body B. Note that the Phaser.P2.Body may be null if this is the end of a contact with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.

Upgraded to p2.js 0.7.0
2015-07-13 11:44:04 +01:00
Richard Davey
f57d3c19e9 P2.Body.createGroupCallback incorrectly referenced the _groupCallbackContext when deleting it (thanks @Langerz82 #1886) 2015-07-07 01:24:26 +01:00
photonstorm
17831e0103 P2.Body.loadPolygon now allows the key parameter to be passed as null - when this happens the object parameter can be the actual physics object data instead of a string pointing to the cache, allowing you to take advantage of adding multiple convex shapes with automatic adjustments for center of mass #1801 2015-06-16 19:02:28 +01:00
photonstorm
c518fa32b7 Formatting. 2015-06-16 14:16:04 +01:00
Chad Engler
b89cdd5a0c check for existence of sprite on body destroy 2015-04-12 17:30:54 -07:00
photonstorm
893d36f128 jsdoc fix. 2015-03-05 14:01:52 +00:00
photonstorm
a69e53f901 Copyright date change. 2015-02-25 03:36:23 +00:00
photonstorm
1229c791b3 Added Body.dirty flag (reserved for future use) 2015-02-17 05:13:54 +00:00
photonstorm
6081aa360f P2.Body.clearCollision default values were incorrectly set to false if no parameters were provided, even though the docs said they were true (thanks @brianbunch #1597) 2015-02-08 21:57:08 +00:00
Tom Larkworthy
4b32505383 calling adjust mass desyncs the debug graphics from the real positions of bodies 2015-01-17 21:15:10 -08:00
photonstorm
667d477a16 P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror) 2014-11-25 22:21:11 +00:00
photonstorm
96fd0ade74 JSDoc fixes. 2014-10-21 22:43:42 +01:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
photonstorm
59f7c53019 P2.Body.addCapsule didn't use to pass the radius value through pxm, but now does so you have to specify it in pixels, not meters. 2014-09-08 22:34:53 +01:00
photonstorm
dd160f004b jsdocs update for collideWorldBounds #1010 2014-08-29 01:16:05 +01:00
photonstorm
0f207c47a7 Calling P2.Body.destroy or ArcadePhysics.Body.destroy wouldn't null the parent sprite body, causing it to error in the next update (thanks @jonathanhooker #1077) 2014-08-28 03:44:02 +01:00
photonstorm
ec687868de Input.setMoveCallback has been removed due to deprecation.
BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
Pointer.moveCallback has been removed due to deprecation.
SinglePad.addButton has been removed due to deprecation.
P2.Body.loadData has been removed due to deprecation.
P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
Canvas.create noCocoon parameter has been removed due to deprecation.
Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
2014-08-28 03:40:59 +01:00
photonstorm
98ccae56de P2.Body now uses the new Body.type value instead of Body.motionState, however as P2.Body already have a property called type we have left the motionState getter/setter in for now. 2014-08-28 00:39:47 +01:00
photonstorm
9bbc8ecce3 Phaser.Physics.P2.addPolygon now takes a nested array again (thanks @wayfu #1060) 2014-07-31 13:39:26 +01:00
Petar Petrov
78771d875b Fix issue #883
Check if points is an Array before parsing arguments.
2014-07-12 22:50:48 +02:00
photonstorm
6e94aa7cde Updated applyForce docs. 2014-07-02 16:29:30 +01:00
Richard Davey
a425470f41 Merge pull request #925 from jonkelling/dev
Fix for issue #917, Physics.P2.Body#addToWorld
2014-07-01 15:52:29 +01:00
Richard Davey
ba29d5bd4b Merge pull request #910 from TatumCreative/dev
Fix null returns for play()
2014-07-01 15:39:17 +01:00
Phaiax
18229d1673 fix jshint warning 2014-06-29 18:23:43 +02:00
Phaiax
394e70db06 inverting debug getter result 2014-06-28 01:33:02 +02:00
photonstorm
cd60554c78 Added P2 body anchor docs to clarify #938 2014-06-23 23:34:27 +01:00
jonkelling
36d70697db Fix for issue #917, Physics.P2.Body#addToWorld
Fix for issue #917: Calling reset() on Sprite with a P2 body can result in body.data.world == null.
Calling addToWorld() would previously not check the _toRemove array, which could, if the timing were right, result in a Sprite being revived but then removed from the P2 World--the result of this being the Sprite's data would be in a mixed state causing it to appear visually but not function in the world.
2014-06-17 21:53:20 -05:00
Greg Tatum
50f91eae54 Shape changed not called on removeShape
It looks like a bunch of these methods that modify the body don't call shapeChanged(). If you want I can add them all and resubmit.
2014-06-17 08:36:39 -05:00
photonstorm
88306b6e12 P2 World array reset fix. 2014-05-20 10:03:00 +01:00
photonstorm
fa613c5fe1 ScaleManager seeds _check private var with null to avoid later comparison check (thanks @jflowers45, fix #782)
P2.Body.applyForce should have used pxmi instead of pxm (thanks @Trufi, fix #776)
P2 fixed creation of RevoluteConstraint by passing maxForce in the options (thanks @woutercommandeur, fix #783)
2014-04-29 19:34:38 +01:00
photonstorm
4ec5665148 Fixed #750 - Invalid typescript mapping for TileSprite.autoScroll function in TS defs.
Game checks if window.console exists before using it (should fix IE9 issues when dev tools are closed), however it is still used deeper in Pixi.
Body.loadData flagged as deprecated.
2014-04-22 23:31:07 +01:00
photonstorm
944e03ddb8 P2.Body.loadPolygon has been updated to correct center of mass issues (thanks @georgiee, fix #749) 2014-04-22 22:33:25 +01:00
Georgios Kaleadis
c0189c02c1 fixed loadPolygon center of mass 2014-04-22 19:56:25 +02:00
photonstorm
a2b2d558a5 jsdoc and jshint fixes. 2014-04-11 03:02:19 +01:00
photonstorm
77f8e5eefc P2 Fixtures Collection Class (@georgiee please test it works ok! #704) 2014-04-11 00:43:30 +01:00
Richard Davey
b7b1e7428a Merge pull request #704 from georgiee/fixture-list
P2 Fixtures Collection Class
2014-04-11 00:19:05 +01:00
photonstorm
a01cc2e1ca Objects with an InputHandler now deactivate it when the object is removed from a Group but not destroyed (fix #672)
Lots of jsdoc fixes in Body and World.
Removed un-used events from World (such as onImpact).
2014-04-11 00:06:22 +01:00
Georgios Kaleadis
1213cae0a4 additionally save fixtures by key 2014-04-10 21:28:14 +02:00
Georgios Kaleadis
d2a348f0bb return the result of body#setCircle 2014-03-28 09:48:23 +02:00
Christian Wesselhoeft
1c286c1ae5 Fix jshint issues in src/physics/p2 2014-03-25 14:56:05 -07:00
Christian Wesselhoeft
61f18b675c Trim trailing whitespace. 2014-03-25 14:56:04 -07:00
Georgios Kaleadis
c2964857a3 multiple circle shapes in a body with position 2014-03-21 20:45:25 +01:00
photonstorm
0fca997d43 P2.Body.loadPolygon no longer modifies the Cache array (fix #613) 2014-03-21 13:46:35 +00:00
Georgios Kaleadis
a4982fa6e2 better fixture handling 2014-03-20 19:38:47 +01:00
Georgios Kaleadis
277afa1415 method docs 2014-03-20 15:46:54 +01:00