Commit Graph

277 Commits

Author SHA1 Message Date
Alex Szpakowski 91d425e7e1 Fix World:getJoints to return fully resolved types for joints. 2019-01-05 10:17:11 -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
Alex Szpakowski a7d0c02058 Remove some unused love.physics Body methods, and clean up a bit of code. 2019-01-03 20:36:47 -04:00
David K b8c9bc38a1 Renamed arguments in setTransform method. Merge setters in to one lamba
--HG--
branch : bodygettransform
2018-05-26 09:54:09 +02:00
David K 0d1b2bc68a Added body:setTransform method
--HG--
branch : bodygettransform
2018-05-24 20:25:55 +02:00
David K 29b7dcf21b Added body:getTransform method
--HG--
branch : bodygettransform
2018-04-29 21:05:03 +02:00
Alex Szpakowski b934f74795 Fix Fixture:getShape() causing crashes with ChainShapes (resolves issue #1392), removed dead code that's no longer valid 2018-04-07 18:37:29 -03:00
Alex Szpakowski 4d5c4ef807 Fix Body:isTouching. 2018-01-14 14:40:46 -04:00
Alex Szpakowski 02e115c339 Add Body:isTouching(otherbody). See issue #1365. 2018-01-14 14:37:48 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski 95adf7e347 Error instead of crashing when a frequency of 0 is set on a MouseJoint. Resolves issue #1197.
--HG--
branch : minor
2017-10-08 16:24:48 -03:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00
Alex Szpakowski 8ea2f09a1c Fix Fixture:getShape. Resolves issue #1319.
--HG--
branch : minor
2017-09-22 20:31:24 -03:00
Bart van Strien 23929cab14 Rename love.physics getObjectList functions to getObjects (resolves #1305)
World:getBodyList -> World:getBodies
World:getContactList -> World:getContacts
World:getJointList -> World:getJoints

Body:getFixtureList -> Body:getFixtures
Body:getContactList -> Body:getContacts
Body:getJointList -> Body:getJoints

Marked the old functions as deprecated

--HG--
branch : minor
2017-09-13 15:48:53 +02:00
Alex Szpakowski fcd9f1526c Use different output messages for deprecated methods versus functions.
--HG--
branch : minor
2017-08-27 16:55:33 -03:00
Alex Szpakowski d8eb6e6012 Rename PrismaticJoint/RevoluteJoint:hasLimitsEnabled to areLimitsEnabled and deprecate the old methods (resolves issue #1324).
--HG--
branch : minor
2017-08-27 16:18:54 -03:00
Alex Szpakowski fee157b6b9 Functions that take a boolean argument now properly type-check for it.
--HG--
branch : minor
2017-08-14 22:56:20 -03:00
Alex Szpakowski b5f2bce0a6 Merge default into minor
--HG--
branch : minor
2017-08-06 03:48:48 -03:00
raidho36 e751278af1 Fix issue #1303 2017-08-02 02:56:02 +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 b590edf27d Merge default into minor
--HG--
branch : minor
2017-04-30 00:37:26 -03:00
raidho36 6b7172bd40 Fix Issue #1273
Added Lua index registry clear routine to `destroy` method of classes that use it.
If this is left to GC, the abandoned userdata would stay in memory for one full extra cycle.

Prettified the code slightly. Clarified some comments. Refactored `Fixture` class `udata` name.
Removed Reference class include from `Shape` (it doesn't use it).
2017-04-14 05:53:36 +03:00
Bart van Strien ac00329ddd Fix wrong default reference angle for WeldJoint/PrismaticJoint/RevoluteJoint (fixes #1258)
--HG--
branch : minor
2017-04-07 12:19:29 +02:00
Alex Szpakowski c5b7a07064 Merge default into minor.
--HG--
branch : minor
2017-01-12 22:52:24 -04:00
Alex Szpakowski abb72cb813 Happy new year! 🥂
--HG--
branch : minor
2017-01-02 01:28:29 -04:00
Bill Clagett ead4186734 Expose box2d’s RopeJoint::SetMaxLength().
--HG--
branch : fb_add_ropejoint_setmaxlength
2016-11-20 23:00:22 -05:00
Bart van Strien 9f6aa716fa Pass Type to luax_register_type by pointer instead of reference
Since the type is passed to va_start, and apparently that's undefined behaviour if it's a reference.

<Textmode> the best kind of behavior

--HG--
branch : dynamiccore2
2016-11-14 21:51:47 +01:00
Bart van Strien d967a755e5 Make love::Type handle type names
TODO: Fix undefined behaviour in luax_register_type, you can't use a va_list after a reference type

--HG--
branch : dynamiccore2
2016-11-14 21:06:53 +01:00
Bart van Strien 5d43c9601a Automatically deduce the type in luax_pushtype, if possible
--HG--
branch : dynamiccore2
2016-11-13 17:38:42 +01:00
Bart van Strien 7dd960619d Automatically deduce the type in luax_checktype, luax_getmodule, luax_optmodule and luax_totype
--HG--
branch : dynamiccore2
2016-11-13 17:13:40 +01:00
Bart van Strien c761202486 Build type information on first use (load-time), instead of using a hardcoded list
--HG--
branch : dynamiccore2
2016-11-13 16:38:57 +01:00
Alex Szpakowski ef61573cd3 Merge default into minor
--HG--
branch : minor
2016-08-29 22:41:24 -03:00
airstruck 154f7cbc7e Support reference angle on revolute, prismatic, and weld joints (fixes #1194) 2016-08-19 14:36:36 +02:00
Alex Szpakowski e9ac008f43 Merge default into minor
--HG--
branch : minor
2016-08-13 12:41:14 -03:00
Bart van Strien 57e4ec78e3 Prevent attaching a MouseJoint to a kinematic body (fixes #1185)
It turns out, calling World:update() after attaching a MouseJoint to a
kinematic body causes an exception. Normally the wrapper catches the exception,
but somehow this exception cannot be caught. Wonderful.
2016-08-02 14:26:51 +02:00
Bart van Strien 0ce44e465d Catch possible Box2D exception in Fixture:getBoundingBox() (fixes #1196) 2016-08-02 13:07:05 +02:00
Alex Szpakowski fc2c79ad5f Add EdgeShape:set/getNext/PreviousVertex. ChainShape:setNext/PreviousVertex can now take no arguments to disable ghost vertices.
Resolves issue #1191.
2016-08-01 10:15:34 -03:00
Alex Szpakowski 3157e5df7b Added ChainShape:getNext/PreviousVertex (see issue #1191). Thanks airstruck! 2016-07-31 14:25:12 -03:00
Alex Szpakowski 55cb2fad84 Fixture:setCategory and Fixture:setMask now accept a table of categories/masks (resolves issue #1178). 2016-07-31 11:51:53 -03:00
Alex Szpakowski 0a534d4751 Fixed ChainShape:setPreviousVertex. 2016-07-28 18:08:27 -03:00
Bart van Strien 877ebbf9c9 Make WheelJoint/PrismaticJoint:getAxis return a world vector (refs #1176) 2016-07-15 12:20:58 +02:00
Bart van Strien 990839383f Merge default into minor
--HG--
branch : minor
2016-07-14 18:42:42 +02:00
Bart van Strien 65f53a491f Make MouseJoint:getBodies() return only one body (fixes #1179)
Override Joint's Body getters in MouseJoint, to make the second (user-supplied) body the first body returned, and return nil for the second (internal) body
2016-07-14 16:39:29 +02:00
airstruck 9a2f99dc3d Added 2-point version of love.physics.newRevoluteJoint (fixes #1175) 2016-07-07 21:18:35 +02:00
airstruck 24da8433d0 Expose axis vector of PrismaticJoint and WheelJoint (fixes #1176) 2016-07-07 21:13:49 +02:00
Alex Szpakowski 2e5f385be3 Merge default into minor
--HG--
branch : minor
2016-03-03 21:28:30 -04:00
Alex Szpakowski f51bbb8462 Cleaned up some StrongRef-related code. 2016-03-01 18:57:17 -04:00
Alex Szpakowski 20b77bd28c Changed World:update(dt) to default to Box2D's recommended 3 internal position iterations instead of 6. Added a new variant World:update(dt, velocityiterations, positioniterations) which lets you specify the number of velocity and position iterations Box2D performs when updating the world. The defaults are 8 and 3 respectively, higher numbers increase precision and reduce performance.
Resolves issue #1135.

--HG--
branch : minor
2016-02-14 20:06:16 -04:00
Alex Szpakowski ab4cfb4a35 Added an optional 'collideconnected' boolean argument to love.physics.newMotorJoint (resolves issue #1130). 2016-02-02 08:38:07 -04:00