This newly registered member has not yet activated their account.
Casey's 4Coder Smooth Scroll
3 months, 3 weeks ago Edited by braksten on Dec. 29, 2018, 11:13 p.m.
Hi Guys, I just made the switch to 4Coder from Sublime Text. I'm using Casey's 4Coder config as a base for mine, but I'm a bit lost with this set of functions that he uses for smooth scroll:
I sorta get the idea, it seems (because of the function name) like he is using a cubic function in order to non-uniformly steepen then flatten the velocity of the scroll, but I'm pretty confused as to what's actually happening.
seems to me like dt is meant to be the time step. duration is meant to be the length of the scroll? so i assume at the start every scroll has 0.1f (i guess seconds of duration)? then the cubic transform happens, followed by clamping to 0 if it hit that. i'm not sure if that's right but that's what i understand so far.
however, i am very confused with how the CubicUpdateFixedDuration1 works, and would love if I could get some insight into it, since I don't want to put it in my config without understanding. I am not super mathy, but it seems to me like he is doing some sort of derivative stuff with dC0 and dC1, etc; I don't really know what C0 - C3 and B0 - B3 are coming from at all.
EDIT: this seems, after some research, like a bezier curve equation. i think i mostly understand it, but it seems like since the end velocity is always set to 0, it would just output straight lines, so i find it odd Casey didn't just use a linear blend between start / end points + while i totally get how C0...C3 and dC0...dC3 were calculated, i don't get how B1 and B2 were done; particularly the Duration / 3.0f.