Skip to content

Enhance multi-screen playback and improve panel source logic#8

Open
shima004 wants to merge 4 commits into
mainfrom
feature/multi-panel
Open

Enhance multi-screen playback and improve panel source logic#8
shima004 wants to merge 4 commits into
mainfrom
feature/multi-panel

Conversation

@shima004

@shima004 shima004 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to camera synchronization and animation in the SimMap.svelte component, and adds a new interpolation utility for smooth entity movement. The main focus is on enabling precise camera state sharing and external control, as well as improving the smoothness of entity transitions.

Camera synchronization and control enhancements:

  • Introduced a SimCamera type to encapsulate camera state (target and zoom), and added utility functions for extracting and applying camera state from OrthographicViewState. This enables consistent camera state management and sharing. [1] [2]
  • Implemented broadcastCamera, __simscope_getCamera, and __simscope_setCamera to allow external scripts or parent windows to get/set the camera state and receive camera updates, supporting both direct function calls and postMessage API. [1] [2]
  • Added logic to suppress redundant camera broadcasts when the camera is being set remotely, preventing feedback loops during synchronization.

Camera state consistency improvements:

  • Ensured that currentTarget and currentZoom are always updated when the camera is moved (including during follow mode and focus changes), so the camera state remains accurate and in sync with the view. [1] [2] [3]

Entity interpolation utility:

  • Added a new interpolateEntities function in interpolation.ts that uses Catmull-Rom spline interpolation (with ease-in-out timing) for smooth movement of entities along their position history, falling back to linear interpolation when history is insufficient. This function returns a new set of entities with interpolated positions for smooth animation between simulation steps.

@shima004 shima004 self-assigned this Jun 3, 2026
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.

1 participant