Lovely Physics Sandbox

Show off your games, demos and other (playable) creations.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Lovely Physics Sandbox

Post by airstruck »

Here's a very early preview of a little physics sandbox I've been working on. This was inspired by Alexar's Box2d Helper.

This will not work fully with Love 0.10.1, you'll need the development version.

ctrl+z,x,c,v do what you expect, for the most part.

ctrl+d deletes the selected object.

ctrl+g toggles the grid.

ctrl+b or ctrl+click a shape to select the body instead of the fixture. When a body is selected, drawing more shapes will attach them to that body rather than creating a new body.

Hold alt when drawing a shape to snap to grid. Hold shift to draw around a point.

Hold ctrl when drawing a joint to collide connected bodies.

Roll mouse wheel to zoom, press it to pan.

Right click to finish drawing chains and polygons.

Known issues:
All joints available except mouse and gear. There's no "world body" yet so some joints are not really useful, like wheel. Keyboard commands not mac-friendly. Undo stack not constrained, but I haven't run out of memory yet ;)

There is also at least one thing that can't be serialized properly at the moment (reference angle for some joints, #1194). This affects the undo stack and save/load behavior. Thanks to bartbes and slime, many similar issues (#1175, #1176, #1179, and #1191) have now been addressed; I'm looking forward to seeing these in the next Love release.

If you find an issue that wasn't mentioned above, please let me know. Also, any suggestions for improving user input are welcome.
Attachments
lps.love
(78.22 KiB) Downloaded 445 times
Last edited by airstruck on Sat Aug 06, 2016 7:22 pm, edited 4 times in total.
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: Lovely Physics Sandbox

Post by pgimeno »

Looks quite promising! Great job.

Two questions:

- What will the license be?
- What functions are not available without a more recent LÖVE?
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Lovely Physics Sandbox

Post by airstruck »

Thanks! I fixed a few bugs after I posted that, I'll probably put it on github soon but I want to get some more features in first. Also I probably have a few more tickets for the issue tracker regarding ghost vertices on edge and chain shapes and I might want to see how that shakes out first.
pgimeno wrote:- What will the license be?
Probably MIT, do whatever you want with it :)
- What functions are not available without a more recent LÖVE?
See #1175, #1176, and #1179. Basically undo/redo will break if you use certain joints.
User avatar
portify
Prole
Posts: 18
Joined: Sun Feb 15, 2015 10:15 pm
Location: Locating
Contact:

Re: Lovely Physics Sandbox

Post by portify »

Heads up: I get this error when I try to change the density of a body using the slider

Image
User avatar
4aiman
Party member
Posts: 262
Joined: Sat Jan 16, 2016 10:30 am

Re: Lovely Physics Sandbox

Post by 4aiman »

What portify reported
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Lovely Physics Sandbox

Post by airstruck »

Yeah, that's what I get for refactoring at the last minute. You can change body to fixture:getBody() on that line if you want. Deleting a dynamic body while moving it will also error. Will put a new version up soon with chains, egdes and polygons and fixes for those 2 bugs. Thanks for reporting it :)
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Lovely Physics Sandbox

Post by airstruck »

Updated with the stuff mentioned in previous post. Polygons might not work like you expect. There's no fancy automatic "composite" polygons with lm.triangulate or anything, these are just straight love.physics polygon shapes (convex, max 8 points).
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Lovely Physics Sandbox

Post by airstruck »

Updated, download in top post. World saving and loading is now supported. Added a new plugin system and two example plugins. The example plugins aren't super useful, but should give you an idea of how to write your own if you want to. Plugins and saved worlds are in the appdata directory, of course (appdata path is dumped to console on startup for convenience).

Code is getting a bit messy now, next update will probably be a partial refactor, and add scriptable scenes and some cool plugins.

If anyone does happen to write any plugins, give me a heads up and I'll look at including them (that way if I break them with future changes, you won't have to worry about fixing them yourself). See airstruck/ape for an overview of how plugins work.
User avatar
AntonioModer
Party member
Posts: 202
Joined: Fri Jun 15, 2012 5:31 pm
Location: Belarus
Contact:

Re: Lovely Physics Sandbox

Post by AntonioModer »

Good GUI, good editor, keep going airstruck !!! :)
Better to move this topic in the sub-forum "Libraries and Tools".
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Lovely Physics Sandbox

Post by airstruck »

AntonioModer wrote:Good GUI, good editor, keep going airstruck !!! :)
Thanks!

I'm waiting to see what happens with #1194 before next release, this is really critical for "soft" weld joints and for revolute joints with limits. My working copy depends on that "reference angle" being exposed. I've submitted a patch, but part of the implementation is a little weird. Wasn't sure what direction to go in to make it better, just waiting for feedback there (see comments on that ticket). As soon as that's addressed I'll probably update this. :)
Better to move this topic in the sub-forum "Libraries and Tools".
When I posted this, I thought of it more as a "creation," just a thing to play around with to learn how love.physics works and try stuff out without writing a bunch of code. I suppose it's going more in the direction of a "tool" now though.
Post Reply

Who is online

Users browsing this forum: No registered users and 70 guests