Allows tilt and wobble control, solving issue #244 #250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expose tilt & wobble parameters for finer animation control, solving issue #244
This PR adds four new options that let callers tune particle orientation and path wobble:
tiltRange[min,max]radians[-Math.PI/2, Math.PI/2]tiltSpeed[min,max]rad ∙ tick⁻¹[0.05, 0.4]wobbleRange[min,max]px[5, 10]wobbleSpeed[min,max]rad ∙ tick⁻¹[0.1, 0.2]No code changes are required for existing users; omitted fields keep current behaviour, and
flat: truestill disables all 3‑D motion.Quick example
Implementation highlights
defaults extended with the four ranges.
randomPhysics() now pulls values from those ranges (or defaults) and stores wobble, wobbleSpeed, tiltAngle, tiltIncrement on each particle.
updateFetti() uses those fields instead of hard‑coded constants.
Tests
Back‑compat visual suite – all legacy tests still green.
Motion test – freezes velocity & gravity, fires one particle, captures two frames 100 ms apart, asserts centroid moved ≥ 8 px while palette stayed the same.
Parameter presence test – with front end testing, confirms particles receive the exact wobble/tilt values passed in.