Skip to content

fix: upgrade tween.js to v25 with explicit group management#813

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
remo-lab:fix/tween-v25-upgrade
Mar 7, 2026
Merged

fix: upgrade tween.js to v25 with explicit group management#813
EdwardMoyse merged 1 commit into
HSF:mainfrom
remo-lab:fix/tween-v25-upgrade

Conversation

@remo-lab
Copy link
Copy Markdown
Contributor

@remo-lab remo-lab commented Mar 3, 2026

Summary

In this PR, I upgraded @tweenjs/tween.js from v23 to v25, which fixes #680.

In v25, tween.js removed implicit global group registration. That means tweens are no longer automatically tracked — they must be explicitly added to a Group and updated using group.update(). Without this change, all tween-based animations silently fail.

To address this:

  • I created a shared TweenGroup instance inside ThreeManager

  • Passed this shared group to AnimationsManager, ControlsManager, and SelectionManager

  • Updated all new Tween(obj) calls to explicitly pass the group:

    new Tween(obj, tweenGroup)
  • Replaced the global tweenUpdate() call with tweenGroup.update(now) inside the render loop

  • Fixed a pre-existing bug where tweenUpdate() was being called twice per frame


What Was Broken (Before This Fix)

All tween-based animations were silently failing, including:

  • “Look at Object” camera animation
  • Event collision / propagation animation
  • Double-click orbit target smooth transition
  • Camera fly-through presets

The +/- zoom buttons were unaffected because they directly manipulate the camera and don’t use tweens.


Test Plan

  • Load an event at http://localhost:4200/atlas
  • Click an object → use “Look at Object” → camera smoothly animates
  • Click animate event → collision / propagation animation plays
  • Double-click a surface → orbit target transitions smoothly
  • Verify +/- zoom buttons still work as expected

This upgrade restores all tween-driven animations and aligns the project with the new tween.js v25 architecture.

Recording.2026-03-03.153652.2.mp4

Closes HSF#680

Signed-off-by: remo-lab <remopanda7@gmail.com>
@remo-lab remo-lab force-pushed the fix/tween-v25-upgrade branch from 63f9839 to acec46c Compare March 3, 2026 10:38
@remo-lab
Copy link
Copy Markdown
Contributor Author

remo-lab commented Mar 3, 2026

@EdwardMoyse, Please give it a look whenever you have time !

@EdwardMoyse EdwardMoyse merged commit 7948a72 into HSF:main Mar 7, 2026
2 checks passed
@EdwardMoyse
Copy link
Copy Markdown
Member

Thanks! This is great!

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.

Upgrading to tween.js 25.0.0 breaks zoom

2 participants