airstruck wrote:How is world gravity measured in love.physics? Is it meters per second per second? Setting the world gravity to (0, 9.8) feels really floaty, what's going on?
Probably that you need to call [wiki]love.physics.setMeter[/wiki] before [wiki]love.physics.newWorld[/wiki]. The default is 30 I think.
No, it's not m/s², it's unit/s², where "unit" is whatever is defined using setMeter. So by default, with a scale of 30, that means 30*9.8=294 would act like earth gravity, if indeed you use 30px/meter.
Got it, was just playing around with it and 300 felt about right. Not sure what the rationale is behind this, it seems pretty counterintuitive to be honest. For things that deal with positions, scaling up or down makes things easier for the user, but this just seems to make things more complex. /2¢
Bartbes is right, my bad. I tend to think that setMeter is the pixels per metre conversion and that's not quite correct. It's actually for length unit conversion. Setting it to 1/0.0254, for example, would make your length unit be inches (mass is still kg, though).
In my opinion, the only weird thing is the default value of 30.
bartbes wrote:Why? Everything is in the same unit, mixing units would make things weird.
I suppose. My gut feeling is that it would be less weird / more convenient / more intuitive if "setMeter units" were only used for stuff that actually benefit from setMeter being a "convenient way to draw the objects directly to the screen without the need for graphics transformations." Maybe it would just be weird though, I don't know. I do hope that if the simplified physics API that's been discussed is ever put into place, setMeter moves over there and the current physics API ditches all the Physics:scale* stuff and switches over to meters for everything.
Someguynamedpie wrote:You can also make the units inches, feet, kilometers, lightyears, there is no real "unit" unless you make it yourself.
Box2d uses meters, I'm suggesting that it might be good for love.physics to do the same in some cases, and not just use "setMeter units" everywhere.
Someguynamedpie wrote:I know box2d uses meters but the point is you can "use" whatever you want because they're just numbers
Yes, I understand the point you're making, but I don't see how it's relevant to the conversation. I don't care what the units are interpreted as in my own or anyone else's user code, I'm talking about what units love.physics expects values to be in, relative to everything else love.physics is doing.