Skip to content

Add gravity strength slider for SPH water simulation#46

Merged
Testtesttestestes merged 1 commit into
mainfrom
codex/add-gravity-strength-slider-wtfvxn
Mar 10, 2026
Merged

Add gravity strength slider for SPH water simulation#46
Testtesttestestes merged 1 commit into
mainfrom
codex/add-gravity-strength-slider-wtfvxn

Conversation

@Testtesttestestes

Copy link
Copy Markdown
Owner

Motivation

  • Provide a user-controllable gravity multiplier so the water/SPH simulation can be tuned interactively.

Description

  • Add a new Gravity UI slider in src/App.tsx (range 0..2, step 0.01) and pass the selected value as a gravityScale prop to RealisticProgressBar.
  • Extend RealisticProgressBar (src/components/RealisticProgressBar.tsx) with a gravityScale prop, sync it via useEffect, and call SPH.setGravityScale(...) (also applied during renderer initialization).
  • Add gravity-scaling support in the SPH engine (src/sph/sph.js): introduce _gravityScale state, export setGravityScale(scale), add helper _scaledGravity(), and use the scaled gravity for initial half-step velocity, velocity-limit / timestep calculation, and the per-frame g uniform sent to the particle update shader.

Testing

  • Ran npm run build and the production bundle was built successfully.
  • Launched the dev server with npm run dev and confirmed the app is reachable for visual checks.
  • Executed an automated Playwright script that loaded the page and captured a screenshot (saved as an artifact) to visually verify the new Gravity slider and its UI integration.

Codex Task

@Testtesttestestes Testtesttestestes merged commit 2c03a34 into main Mar 10, 2026
1 check passed
@Testtesttestestes Testtesttestestes deleted the codex/add-gravity-strength-slider-wtfvxn branch March 10, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant