"Questions that don't deserve their own thread" thread

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Locked
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: "Questions that don't deserve their own thread" thread

Post by pgimeno »

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.

Edit: Yes, the units are m/s².

(Been there myself)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by bartbes »

pgimeno wrote: Edit: Yes, the units are m/s².
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.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: "Questions that don't deserve their own thread" thread

Post by airstruck »

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¢
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by slime »

Someguynamedpie wrote:Not so much that as its just not defined in the spec IIRC creating undefined behavior.
It's not defined in the spec because desktop GPU hardware works in a way that prevents that from working as you'd expect. :)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: "Questions that don't deserve their own thread" thread

Post by bartbes »

airstruck wrote:Not sure what the rationale is behind this, it seems pretty counterintuitive to be honest.
Why? Everything is in the same unit, mixing units would make things weird.
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: "Questions that don't deserve their own thread" thread

Post by pgimeno »

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.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: "Questions that don't deserve their own thread" thread

Post by Someguynamedpie »

You can also make the units inches, feet, kilometers, lightyears, there is no real "unit" unless you make it yourself.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: "Questions that don't deserve their own thread" thread

Post by airstruck »

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.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: "Questions that don't deserve their own thread" thread

Post by Someguynamedpie »

I know box2d uses meters but the point is you can "use" whatever you want because they're just numbers
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: "Questions that don't deserve their own thread" thread

Post by airstruck »

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.
Locked

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests