love.physics.setScale(s)?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
peaches
Prole
Posts: 9
Joined: Tue Jul 28, 2009 7:47 pm

love.physics.setScale(s)?

Post by peaches »

One annoying part of many Physics libraries, and Box2D in particular, is that they don't adaptively scale simulations to reduce numerical error. Using a coordinate system that's bigger than 100 in dimension tends to return some ugly errors. Other wrappers I've seen in Python mitigate this by adding a scale parameter which is applied to inputs and inversely applied to outputs. E.g.

Code: Select all

love.physics.setScale(0.1)
world = love.physics.newWorld(400,400) -- actually sends 40,40 to the native C++
world:setGravity(0,50) -- actually sends 0,5 to the native method
x,y = world:getGravity() -- script layer multiplies by 1/scale, returning the 50 we expect
Is there a place where I can submit this as a feature request?
User avatar
Pliskin09
Citizen
Posts: 89
Joined: Fri Jul 24, 2009 8:30 am

Re: love.physics.setScale(s)?

Post by Pliskin09 »

User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: love.physics.setScale(s)?

Post by rude »

This is already done in SVN. Will be released next version.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest