I was going to write that Love2D had an unusual drawback if you wanted to teach it to a 9-year-old: lots of third-party libraries had sexualized names.
Speaking of 2nd-order linear ODEs w/ const factor (a.k.a. mass-spring-damper systems), I wrote a blog post[0] deriving all possible general solutions in a concise matrix that makes it easily implementable in code.
The following is the complete solution in Lua:
function sprung_response(t,pos,vel,k,c,m)
local decay = c/2/m
local omega = math.sqrt(k/m)
local resid = decay*decay-omega*omega
local scale = math.sqrt(math.abs(resid))
local T1,T0 = t , 1
if resid<0 then
T1,T0 = math.sin( scale*t)/scale , math.cos( scale*t)
elseif resid>0 then
T1,T0 = math.sinh(scale*t)/scale , math.cosh(scale*t)
end
local dissipation = math.exp(-decay*t)
local evolved_pos = dissipation*( pos*(T0+T1*decay) + vel*( T1 ) )
local evolved_vel = dissipation*( pos*(-T1*omega^2) + vel*(T0-T1*decay) )
return evolved_pos , evolved_vel
end
This is a good example. That was math heavy, it took me too long to parse for basic understanding and honestly I am not sure I got it right. The LUA code was easy to understand even though those variable names force you to read all the code, and guess what is what.
It has been a long time since I did diff eq at work, and I agree with the PDF the more I knew the less I understood. I dont know why I need to have the math tainted by the unclean reality to understand, and if that hinders my understanding of them.
F is a forcing function, not the resultant force. It’s often arranged this way with all the derivatives on one side (as opposed to having the resultant force, ma, on one side of the equality by itself) so that it matches the general form of a non-homogeneous second-order linear differential equation.
(At least I assume this is what the original commenter meant!).
The friction/acceleration awkwardness can be solved by using a physically based timestep-independent formulation, which I implemented in TPMouse[0] and explained its derivation in a previous comment reply[1].
The gist of it is that the solution to a linearly damped particle is a linear system, so the x and y components can be calculated completely independently and the analytic solution is just an exponential of time.
It is a special case of the timestep-independent damped harmonic oscillator, which I previously wrote a blogpost about [10].
Namely it is the "unsprung" special case under "Overdamped"
The very same formulation is also what I used to implement LibreScroll[11] to add inertial scrolling to any mouse.
And for Windows, my https://github.com/EsportToys/TPMouse was inspired by warpd itself but more focused on making direct cursor motion more usable using momentum.
Try running the exe version with wine and see if it works on your system -- this uses only very old/stable WinAPIs so I'd imagine that wine would have it well-covered by now.
> There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.
I use the G305 which is even more barebones in the buttons, however I remapped the dpi button to be a sort of "omnifunctional activator" that I combine Lua scripting from LGS with other Autoit scripting for accessing WinAPI to achieve multitouch gestures with my mouse. The UX isn't quite refined enough to be a standalone application that I can share on GitHub yet, but eventually I'll figure out how to turn them into a self-contained package.
That’s dope! I’m macOS so I just use karabiner for all button remapping. Tho I recently got a QMK board and have been meaning to add some mouse actions to it (purely ergonomic reasons, ideally use my mouse less and less). That’s nice u have LGS tho it’s at least ostensibly better than the absolute trash ghuh is. Also pretty cool u can extend LGS with lua!
Glad that you like it! You might also find my MouseTray utility useful (which I mentioned in another comment), since seeing from your bio that you're familiar with esports you might care a bit more about configurations.
https://github.com/EsportToys/wireworld-love