Commit Graph

284 Commits

Author SHA1 Message Date
Alex Szpakowski a1a116e7a2 Fixed an uncaught exception in World:translateOrigin
--HG--
branch : box2d-2.3
2013-11-09 16:37:19 -04:00
Alex Szpakowski 5e3a0fbc6e Updated box2d from 2.2.1 to 2.3.0
--HG--
branch : box2d-2.3
2013-11-09 04:30:36 -04:00
Alex Szpakowski f03efd2dca Fixed Contact:getChildren to be 1-based 2013-10-30 18:07:41 -03:00
Alex Szpakowski 74ac2820cd Joint:enableMotor -> Joint:setMotorEnabled, Joint:enableLimit -> Joint:setLimitsEnabled, Joint:isLimitEnabled -> Joint:hasLimitsEnabled. Resolves issue #691. 2013-10-24 17:30:41 -03:00
Alex Szpakowski 951f5740bb Renamed ChainShape:setPrevVertex to ChainShape:setPreviousVertex (see issue #691) 2013-10-07 23:49:49 -03:00
Alex Szpakowski 95eedcd1be Using auto for some iterators for less dense-looking code 2013-09-30 02:35:10 -03:00
Alex Szpakowski bcee9a222b Made some float/int/unsigned char conversions explicit, fixed ParticleSystem:getColors, fixed love.mouse.isDown with x1 and x2 buttons 2013-09-26 00:36:50 -03:00
Alex Szpakowski 8d5ddb9e34 Fixed some internal documentation (thanks to clang's -Wdocumentation) 2013-09-23 21:52:28 -03:00
Alex Szpakowski ffe0485173 Removed love.window.checkMode (resolves issue #653, invalidates issue #592).
Also fixed love.window.setMode to fail instead of bug out when trying to set a fullscreen mode which is too large for the monitor.
2013-09-19 18:13:52 -03:00
Alex Szpakowski 06f80d5c08 Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729) 2013-09-05 23:17:29 -03:00
Alex Szpakowski 93a782d445 Renamed World:setAllowSleeping and World:getAllowSleeping to World:setSleepingAllowed and World:isSleepingAllowed (see issue #691, also consistent with the Body methods) 2013-08-31 21:15:09 -03:00
Alex Szpakowski ec9dec6b80 Replaced luax_newtype with luax_pushtype (and added luax_rawnewtype for the old functionality of luax_newtype.)
luax_pushtype keeps the object in a weak table and checks the table before creating a new userdata, so it re-uses the object's existing wrapper userdata if it can, whenever the object is pushed to Lua.

This fixes some subtle issues with love objects, where using them as keys in tables would not always work as expected (https://love2d.org/forums/viewtopic.php?f=4&t=39398&p=112388#p112415). It also decreases the amount of new Lua objects created, saving the garbage collector some work.
2013-08-29 00:40:06 -03:00
Alex Szpakowski 4f6e956f85 Fixed ChainShape:getChildEdge crashing 2013-08-11 17:50:57 -03:00
Alex Szpakowski 2561ace2d6 Fixed Fixture:getType crashing 2013-08-11 17:32:12 -03:00
Alex Szpakowski a4ff39e0d4 Improved error checking for some enum strings (resolves issue #690).
Also moved love.audio.newSource from Lua code into C++ code
2013-08-03 21:24:43 -03:00
Bart van Strien 259f15da6f Apply box2d heap tickler patch: make sure ChainShape:getPoints has enough stack size 2013-07-17 00:06:53 +02:00
Alex Szpakowski 3880646a6a Fixed some uncaught exceptions in love.physics 2013-07-02 02:27:08 -03:00
Bart van Strien 0a422daa75 Add Contact:getChildren (pull request #15) 2013-05-10 17:40:04 +02:00
Alex Szpakowski 668a1bfa6d Silenced some compiler warnings 2013-02-09 21:24:41 -04:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Bart van Strien 4de936ed75 Fix love.physics.getDistance 2012-11-19 21:10:28 +01:00
Bart van Strien 8234e71c74 Add an ASSERT_GUARD for World:update, catching any errors occuring there 2012-08-28 17:47:23 +02:00
Boolsheet cde5aa3307 Import box2d-contacts branch from love-experiments
Fix issues with Contact lifetime, based on the work of
Matteo "teomat" Goggi
2012-07-24 23:59:42 +02: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
Bart van Strien 2986890746 Fix Shape:testPoint's stack indices (issue #430) 2012-05-18 18:00:04 +02:00
Aidan Gauland 8a6c36231c Corrected scaling of values in RopeJoint constructor. 2012-04-17 20:55:47 +12:00
Aidan Gauland 27b62b5c9c Removed scaling of unit vectors. 2012-04-17 20:54:12 +12:00
Bart van Strien 66aef58075 Use a clearer error message when the raycast callback doesn't return a number (issue #356) 2012-03-03 12:11:06 +01:00
Bart van Strien 0c9d8f3c41 Handle masks and categories in our contact filter
Turns out, setting our own contact filter bypasses the inbuilt mask and category handling,
this means, however, that masks and categories are processed before your contact filter is
called, so if you really want to do all the filtering manually, you should just make sure
you never change the default masks and category, or restore it.
2012-02-09 20:26:18 +01:00
Bill Meltsner 57dabc9f89 Change WheelJoint:get/setSpringFrequencyHz to get/setSpringFrequency 2012-02-06 10:32:33 -05: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 31a85e81a2 Properly convert the anchor points for RopeJoints to local coordinates 2012-02-04 19:53:29 -05:00
Bill Meltsner f67d454aa3 Fix off-by-one error in Fixture:getBits 2012-02-04 19:45:38 -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 83f7002f67 Remove the unnecessary transform arguments to Fixture:rayCast that some idiot blindly copy/pasted from Shape:rayCast 2012-02-04 19:16:27 -05:00
Bill Meltsner fae16c712d make Body::applyForce(fx, fy) semantically clearer 2012-02-04 19:09:20 -05:00
Bill Meltsner 4aa3939311 Actually register Box2D worlds as contact filters 2012-02-04 19:07:24 -05:00
Bill Meltsner 2a88ed1fa5 Fix issues with Shape retention in Fixture:getShape() 2012-02-04 18:55:48 -05:00
Bill Meltsner e5cabe3b3f Remove Shape:destroy().
With the changes to Shapes rendering them mere blocks of information with no role in the World save being attached to Bodies and discarded, Shape:destroy no longer has any justification for its continued existence. Truly, on several levels, it has been hoist with its own petard.
2012-02-04 18:35:30 -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 f3d770e5e7 Scale Body inertia 2012-02-04 17:54:16 -05:00
Bill Meltsner 223f9eebef Provide a default density of 1.0 for Fixtures 2012-02-04 17:21:42 -05:00
Bill Meltsner e482f32da3 Allow vertices in either clockwise or counter-clockwise order for newPolygonShape (fixes issue #326) 2012-02-04 17:18:57 -05:00
Bill Meltsner f00b5f03f2 catch a possible Box2D exception in setMassData (fixes issue #342) 2012-02-04 16:55:09 -05:00
Bart van Strien a67b5b501f Fix a leak on destruction of a physics world 2012-01-24 23:00:18 +01:00
Bart van Strien f6e9f4cac7 Stop Body:getWorldPoints from overflowing the lua stack 2012-01-15 11:09:38 +01:00
Bart van Strien 9dc4138366 Fix a comment 2012-01-12 11:26:22 +01:00
Linus Sjögren 7f13fc47c7 Damn you, copy paste! 2012-01-10 04:24:13 +01:00
Linus Sjögren afd0ef1d9e Add a custom Body:setMass function. 2012-01-10 04:14:17 +01:00