Commit Graph

43 Commits

Author SHA1 Message Date
Sasha Szpakowski 112a09ceb7 Shape:setDensity no longer needs Body:resetMassData unless the Body already has custom mass data.
Add Body:hasCustomMassData.
If the Body has custom mass data, attaching a Shape to it doesn't automatically reset its mass data.
2023-10-08 12:43:27 -03:00
Sasha Szpakowski ac9ae82524 love.physics: simplify Body and Shape API.
#1130

- Shapes are now directly attached to Bodies when they're created (similar to love 0.7 and older).
- Fixtures are removed.
- All methods that were in Fixtures now exist in Shapes.
- All APIs that used or returned a Fixture now do the same with a Shape.

- Add new love.physics.new*Shape variants that take a Body as the first parameter.
- Deprecate the new*Shape APIs that don't take a Body.
- Deprecate love.physics.newFixture (the deprecated function now returns a Shape).
- Replace Body:getFixture and Body:getFixtures with Body:getShape and Body:getShapes (Body:getFixtures is deprecated).
- Replace World:queryFixturesInArea and World:getFixturesInArea with World:queryShapesInArea and World:getShapesInArea (queryFixturesInArea is deprecated).
- Replace Contact:getFixtures with Contact:getShapes (Contact:getFixtures is deprecated).
- Replace all love.physics callback Fixture parameters with Shape parameters.
- Deprecate ChainShape:getChildEdge.
2023-10-07 15:17:24 -03:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04:00
Alex Szpakowski 8e7fd10b6f Update copyright year for 2022 2021-12-31 18:33:40 -04:00
Alex Szpakowski f89aabb0bb Update copyright year for 2021 2021-04-04 16:14:45 -03:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski 3ad16a70da love.physics: move internal box2d->love object map to World instances, and clean up some physics object code. Resolves issue #1465. 2019-01-04 21:36:05 -04:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski 8ea2f09a1c Fix Fixture:getShape. Resolves issue #1319.
--HG--
branch : minor
2017-09-22 20:31:24 -03:00
Alex Szpakowski 34ebe18f14 Use luaL_check/optinteger instead of luaL_check/optnumber when getting integer arguments to functions. Resolves issue #1251.
--HG--
branch : minor
2017-07-16 12:17:50 -03:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -04:00
Bart van Strien 3cb777e2b7 Add basic lua 5.3 support 2015-06-16 10:25:41 +02:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Bart van Strien 7793e7f02f CRLF to LF 2012-07-04 14:40:24 +02:00
rude 81c38e22d0 Applied the new style guidelines.
Well, sort of. Lot's more to be done, but this is a start.
2012-06-28 23:52:33 +02:00
Aidan Gauland 27b62b5c9c Removed scaling of unit vectors. 2012-04-17 20:54:12 +12:00
Bill Meltsner 20f4e567b3 Fix Fixture:getShape(), for real this time.
All the Memoizer stuff was pointless: when you create a Fixture, it clones the b2Shape, so there was never going to be a memoized Shape to find. And cloning the Shape is incorrect as well, since you should able to modify the Shape retrieved through getShape and have it affect the Fixture. Everything's much simpler now.
2012-02-05 19:22:33 -05:00
Bill Meltsner ddb1492c1f bounds check ChainShape:getPoint, and make functions that take indices 1-indexed on the Lua end of things 2012-02-04 19:38:11 -05:00
Bill Meltsner dac757b688 remove scaling for density.
while technically density is (according to the Box2D docs) in kg/m^2, it seems like a number that can be safely left un-scaled, for simplicity's sake; the concept of a shape/fixture's density seems sufficiently divorced from the MKS system as to render this a non-issue. if this proves to be a problem in use, scaling can be re-added.
2012-02-04 18:26:43 -05:00
Bill Meltsner be55579a22 Happy New Year, have an enormous diff 2012-01-09 02:41:11 -06:00
Bart van Strien 7c1e1fd0db Return nil if the raycasts don't hit anything (issue #335) 2012-01-08 13:27:10 +01:00
Bart van Strien 0aae9684b3 Automated formatting fix 2011-11-16 11:32:41 +01:00
Bill Meltsner c705063597 First attempt at implementing Memoization for certain Box2D objects
--HG--
branch : box2d-update
2011-09-24 12:20:59 -04:00
Bill Meltsner e69cafe868 Switched get/setMeter from being a World method to a love.physics function
--HG--
branch : box2d-update
2011-09-15 16:13:54 -04:00
Bill Meltsner d8f3db6682 exposed new Shape functions
--HG--
branch : box2d-update
2011-09-15 15:31:09 -04:00
Bill Meltsner 7ec64bf912 Add basic EdgeShape (todo: all edge-related functionality) and further integrated the new Joints
--HG--
branch : box2d-update
2011-09-04 13:21:57 -04:00
Bill Meltsner c3d69746c1 making a stab at updating Shapes
--HG--
branch : box2d-update
2011-03-13 09:33:32 -04:00
vrld 1c7e34715b Add NULL initializers for pointers.
Constructing invalid shapes, e.g. a rectangle with width 0, could result
in a b2Assert to fail. In turn, Shape::~Shape tried to destroy a the shape
with an uninitialized pointer, yielding a segfault. Add NULL-initializers
and checks for NULL to prevent this.
2011-01-25 13:24:39 +01:00
Bill Meltsner fde708160e bringing in the new year by changing every 2010 to 2011 2011-01-15 14:40:27 -06:00
rude 8c721ceb6a Some small fixes to make LOVE compilable in MSVC2010. 2010-09-05 12:05:05 +02:00
Bill Meltsner 73aba4bdd4 eliminated a whole bunch of gcc warnings 2010-02-09 13:21:25 -05:00
rude aa01c984b9 Updated all dates to 2010. 2010-01-31 16:54:47 +01:00
bart@bartbes.ath.cx 5f9cf99abd Fixed epic physics typo (getRestituion->getRestitution) 2010-01-07 20:36:14 +01:00
rude cd24dbcb8e Added get/setGroupIndex (#129) and get/setFixedRotation (#113). Also fixed 3000 auto.lua-related warnings in MSVC. 2010-01-04 20:02:36 +01:00
rude 86ac10c3f6 Fixed bug where destroyed objects in love.physics cause crash when collected. 2009-11-10 23:25:12 +01:00
rude 87e3c4131c Finally abstracted constants properly. Changed how the event module works; wasn't really abstract before. Removed libs we're not going to use: native, signal. 2009-10-10 11:11:04 +02:00
bart@bart 0b38be2b4c Readded get/setCategory and get/setMask 2009-09-05 14:37:44 +02:00
rude 797f536f05 Changed function names of love.physics to match Box2D. 2009-08-04 23:05:49 +02:00
rude dcb3dfd83d Initial Mercurial commit. 2009-07-26 15:46:49 +02:00