Skip to content

Port configurable easing generators from #711 into this repository - #717

Closed
trusktr with Copilot wants to merge 3 commits into
mainfrom
copilot/copy-changes-from-711
Closed

trusktr with Copilot wants to merge 3 commits into
mainfrom
copilot/copy-changes-from-711

Conversation

Copilot AI commented Sep 19, 2026 •

Copy link
Copy Markdown

This brings the work from #711 onto a branch owned by tweenjs/tween.js so review and follow-up can continue here. It ports the new configurable easing generators and the supporting examples, typings, and test coverage needed to evaluate them in-repo.

  • API additions

    • add Easing.generateBack(overshoot?)
    • add Easing.generateElastic(amplitude?, period?)
    • add Easing.generateSteps(steps?)
    • keep the generators aligned with existing easing contracts at 0, 1, and 0.5 for InOut
  • Package surface

    • expose the new generators from src/Easing.ts
    • propagate the API into generated distribution bundles and TypeScript declarations
  • Examples

    • extend examples/03_graphs.html with representative graphs for:
      • generateBack(3)
      • generateElastic(1.5, 0.4)
      • generateSteps(4)
  • Coverage and follow-up cleanup

    • add assertions for default-parameter parity with Back, edge values, midpoint behavior, and stepped output semantics
    • make the existing Tween.end() final-value test deterministic by using an explicit start time
import { Easing } from '@tweenjs/tween.js'

const back = Easing.generateBack(3)
const elastic = Easing.generateElastic(1.5, 0.4)
const steps = Easing.generateSteps(4)

tween.easing(back.InOut)
tween.easing(elastic.Out)
tween.easing(steps.In)

0xTHAC0 and others added 3 commits September 19, 2026 00:21
…nerateSteps

Adds three new configurable easing generators to complement the existing
generatePow, as requested in #507:

- generateBack(overshoot): Back easing with custom overshoot (default 1.70158)
- generateElastic(amplitude, period): Elastic easing with configurable
  amplitude and period
- generateSteps(steps): Discrete step easing for staircase animations

All generators return EasingFunctionGroup (In/Out/InOut) and satisfy the
standard edge-value contracts (f(0)=0, f(1)=1, InOut(0.5)=0.5).

Includes unit tests and updates the graphs example with visual demos.

Closes #507

Co-Authored-By: Paperclip <noreply@paperclip.ing>

Co-authored-by: trusktr <297678+trusktr@users.noreply.github.com>
Co-authored-by: trusktr <297678+trusktr@users.noreply.github.com>
Co-authored-by: trusktr <297678+trusktr@users.noreply.github.com>
Copilot AI changed the title Copy PR #711 easing generator changes into repo branch Port configurable easing generators from #711 into this repository Sep 19, 2026
Copilot AI requested a review from trusktr September 19, 2026 00:25
@trusktr trusktr closed this Sep 19, 2026
@trusktr
trusktr deleted the copilot/copy-changes-from-711 branch September 19, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants