summaryrefslogtreecommitdiff
path: root/src/modules/spokes
AgeCommit message (Collapse)Author
2023-12-12modules/spokes: fix missing spoke in some countsVito Caputo
Due to floating point errors this loop would occasionally miss the last spoke as-is. A quick fix is to just round down the accumulator before comparing it... this function in general needs to all be cleaned up, esp. since the conversion to floats. An obvious repro of this issue, fixed by this commit: '--module=spokes,iterations=2,count=3,twist=0.125,thickness=2' \ '--video=sdl,ratio=full,fullscreen=off,vsync=on,size=640x480' The low count of 3 makes the missing spoke quite visible...
2023-12-03modules/spokes: make spokes count configurableVito Caputo
This switches the perimeter and stride math to use floating point, done in a kind of fast and nasty naive substitution manner. That's necessary for getting away from the even stride calculation / spokes calculation in favor of supporting arbitrary spoke counts, without introducing discontinuities at the boundaries of the mirrored sides The new setting is count= with a handful of reasonable presets. It's a little awkward since this is expressed as half the actual count, naming could probably be improved.
2023-12-03modules/spokes: get rid of spokes_context_t et alVito Caputo
This isn't actually needed just for the settings now that til_module_context_t.setup always has a reference to the baked setup, and always gets created even if there's no bespoke context created.
2023-12-03modules/spokes: uint setup->{thickness,iterations}Vito Caputo
Let's not handle negative values for these in the setup, even if it's all multiple choice options that don't include erroneous negatives. Technically you can feed in whatever using the ":" force prefix...
2023-12-01modules/spokes: add spokes modulePhilip J Freeman
This module started out as a way to test a line drawing algorithm, but ended up looking interesting enough to include as a module of it's own. #ZephyrCommit #BirdwalkCommit
© All Rights Reserved