Skip to content

feat: add simulation step controls#320

Merged
mattqdev merged 1 commit into
physicshub:mainfrom
nicolaszmarzagao:feat/simulation-step-controls
May 20, 2026
Merged

feat: add simulation step controls#320
mattqdev merged 1 commit into
physicshub:mainfrom
nicolaszmarzagao:feat/simulation-step-controls

Conversation

@nicolaszmarzagao
Copy link
Copy Markdown
Contributor

Summary

Closes #319

Adds Step Backward and Step Forward controls next to the Play/Pause button.

The buttons manually inject a fixed simulation delta while paused:

  • Step Backward: -0.01
  • Step Forward: +0.01

This helps users inspect simulations frame-by-frame without needing to pause at the exact moment.

Changes

  • Added a reusable StepButton control.
  • Added manual step support to the shared time system.
  • Updated simulation dt guards so negative manual steps are not ignored.
  • Updated shared physics body stepping to allow non-zero negative deltas.

Testing

  • Ran the project locally with npm run dev.
  • Confirmed step buttons appear in simulations.
  • Tested forward and backward stepping while paused.
  • Confirmed Play/Pause and Reset still work.
  • Tested across multiple simulations.

@mattqdev
Copy link
Copy Markdown
Collaborator

Hey thank you, it seems really intereseting. Can you send me please a short clip of it works?

@nicolaszmarzagao
Copy link
Copy Markdown
Contributor Author

Here is the short clip demonstrating the feature...

https://youtu.be/2WMNygiFMjI

@mattqdev
Copy link
Copy Markdown
Collaborator

Alright thank you very much for this pr!

@mattqdev mattqdev merged commit 6d5f472 into physicshub:main May 20, 2026
1 check passed
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.

[Feat]: Add "Step-by-Step" frame scrubbing buttons to simulation controls

2 participants