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
2702004bb2
Add Body:getFixture.
...
Convenience method to get the first Fixture attached to the body.
2023-10-04 20:00:44 -03:00
Sasha Szpakowski
51b439822b
Add convenience functions for creating a Body+Shape+Fixture all at once.
...
#1130 .
- Add love.physics.newCircleBody(world, bodytype, x, y, radius)
- Add love.physics.newRectangleBody(world, bodytype, x, y, w, h [, angle])
- Add love.physics.newPolygonBody(world, bodytype, coords)
- Add love.physics.newEdgeBody(world, bodytype, x1, y1, x2, y2 [, onesided])
- Add love.physics.newChainBody(world, bodytype, loop, coords)
All new functions return a Body object. The body's world position is at the center of the given coordinates, and the shape's local origin is at its center.
2023-10-04 19:56:22 -03:00
Sasha Szpakowski
03b6b9ff13
Fix return value counts...
2023-10-02 14:08:21 -03:00
Sasha Szpakowski
da430d5145
World:rayCastAny and rayCastClosest also return the fixture they hit.
2023-10-02 14:05:54 -03:00
Sasha Szpakowski
6cb0287500
Add optional category bit mask to World:getFixturesInArea.
2023-10-02 12:15:26 -03:00
Sasha Szpakowski
28a898df1f
Add World:rayCastAny and World:rayCastClosest.
...
They return hit position, normal, and ray fraction (if there is a hit), and also take an optional fixture category bitmask parameter.
2023-10-02 12:11:35 -03:00
Sasha Szpakowski
c3847d5f04
Rename World:queryBoundingBox to World:queryFixturesInArea.
...
Matches the new World:getFixturesInArea function.
2023-10-02 11:06:15 -03:00
Sasha Szpakowski
d24ccde864
World:rayCast and World:queryBoundingBox have user args passed through to the callback function.
...
Fixes #1194
2023-10-02 11:00:02 -03:00
Sasha Szpakowski
b1609ed83b
love.physics: simplify some internal bookkeeping code
2023-10-01 15:55:23 -03:00
Sasha Szpakowski
95d44c2c2d
very minor compile speed improvements
2023-02-11 16:29:24 -04:00
Sasha Szpakowski
f6b74e9ce7
WheelJoint:getMotorTorque takes a dt param instead of inverse dt.
...
Matches the change made to RevoluteJoint:getMotorTorque.
2023-01-13 18:10:45 -04:00
Sasha Szpakowski
f6cdbdc868
Merge branch 'main' into 12.0-development
2022-12-31 22:46:34 -04:00
Sasha Szpakowski
0b75f6cfa5
Missed some files...
2022-12-31 22:36:48 -04:00
Sasha Szpakowski
c823dbca96
Update copyright year for 2023
2022-12-31 22:25:49 -04:00
Jack Robinson
a37803507f
Remove getters/setters for frequency from Physics joints
2022-12-04 15:06:39 +13:00
Jack Robinson
cd52af20a7
Fix #1834 : Give MouseJoint a sensible stiffness and damping initial value
2022-11-02 19:42:48 +13:00
Klonan
7595bc7edb
whitespace micro
2022-08-27 17:37:30 +02:00
Klonan
4e81a31cd1
Code style (tabs)
2022-08-27 17:35:41 +02:00
Klonan
03939299db
Added World:getFixturesInArea()
2022-08-27 17:16:51 +02:00
Alex Szpakowski
7f3538d2ba
Merge branch 'main' into 12.0-development
2022-01-05 21:10:27 -04:00
Alex Szpakowski
8e7fd10b6f
Update copyright year for 2022
2021-12-31 18:33:40 -04:00
megagrump
85894ad5e4
use dt instead of inv_dt in RevoluteJoint::getMotorTorque
2021-11-21 01:04:48 +01:00
Alex Szpakowski
433190d1df
Merge branch 'master' into 12.0-development
2021-06-06 11:43:54 -03:00
Alex Szpakowski
977c690fa9
Fix physics meter value persisting after love.event.quit("restart").
...
Fixes #1685
2021-04-11 19:53:16 -03:00
Alex Szpakowski
9b4aea8f17
Missed some copyright date updates
2021-04-07 20:34:24 -03:00
Alex Szpakowski
21f5ba86d3
Merge branch 'master' into 12.0-development
2021-04-07 20:33:44 -03:00
Alex Szpakowski
f89aabb0bb
Update copyright year for 2021
2021-04-04 16:14:45 -03:00
Alex Szpakowski
633d2fa5c8
Merge branch 'master' into 12.0-development
2021-01-06 21:49:34 -04:00
Qais Patankar
562cc6b1cb
Fix #1614 : add Body:getLocalPoints
2020-12-30 04:27:48 +00:00
Alex Szpakowski
fc2cf602f6
Fix RopeJoints not working.
2020-11-12 23:46:49 -04:00
Alex Szpakowski
cbde2ce76c
Merge pull request #1613 from thegrb93/box2d-update
...
Box2d update to 2.4.1
2020-11-02 21:27:57 -04:00
Garrett Brown
1b74b34cce
Update userdata stuff to how new box2d wants it
2020-10-17 22:30:01 -04:00
Garrett Brown
77f238767f
Update to box2d 2.4.1
2020-10-17 22:15:18 -04:00
Garrett Brown
bd6d50e2a9
Rename to get/setKinematicState
2020-09-20 21:54:02 -04:00
thegrb93
e4c7a4e777
Add getState and setState
2020-09-16 21:39:55 -04:00
Garrett Brown
a16640c89c
Added backwards compatible frequency/dampingRatio functions. Added new stiffness/damping functions.
2020-08-23 02:50:47 -04:00
Garrett Brown
ed257083c3
Revert this whitespace change
2020-08-16 22:42:29 -04:00
Garrett Brown
10002c91db
Didn't mean to change these
2020-08-16 21:20:16 -04:00
Garrett Brown
b074ae8f4c
Gotta lowercase these too
2020-08-16 19:39:36 -04:00
Garrett Brown
8f4476ca3d
Add one sided edge support. Just not sure if the ghost vertices are fine.
2020-08-16 19:12:56 -04:00
Garrett Brown
09db462fd6
Fixes
2020-08-16 19:01:59 -04:00
Garrett Brown
59a1a4b2cd
Finish wrapper function renames
2020-08-16 18:27:51 -04:00
Garrett Brown
74c6021e8d
Starting box2d update
2020-08-16 10:40:04 -04:00
Alex Szpakowski
5f9b5a21d0
Merge default into minor
...
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski
fc4847c69d
Update copyright for the new year
2020-01-03 22:40:36 -04:00
Alex Szpakowski
23db4f4a59
Remove functions that were deprecated in LÖVE 11.
...
--HG--
branch : minor
2019-12-20 00:45:20 -04:00
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