[Gravity_Particles] Add a true N-body mode (softened gravity / Barnes-Hut) and a web build
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with Math_Chaos/Gravity_Particles/main.cpp:31-56 and the gravity particles documentation at docs/src/content/docs/math-chaos/gravity-particles.mdx:20. Identify how cursor attraction and particle updates currently work, then determine how the proposed integrator, Barnes-Hut option, controls, tests, and Emscripten build fit the project. Done means the acceptance criteria pass and the documentation describes the available modes.
Written by the indexing model from the issue text.
Description
Summary
The docs already promise N-body gravity, and raylib supports Emscripten. A real N-body mode (O(N^2) for a few thousand bodies, or Barnes-Hut for more) with optional mouse attraction would match the project name and the docs. A WASM build could be embedded in the docs site.
Location
Math_Chaos/Gravity_Particles/main.cpp:31-56docs/src/content/docs/math-chaos/gravity-particles.mdx:20
Evidence
Currently there is only cursor attraction (main.cpp:37), with no particle-particle forces.
Expected
A toggle between “cursor” and “N-body” modes, configurable particle count, and an optional web build.
Proposed fix
- Add an
NBodyintegrator (leapfrog/velocity Verlet with Plummer softening). Start with O(N^2) and add a quadtree Barnes-Hut (theta = 0.5). - Add key bindings (G toggles mode, +/- changes count).
- Add an Emscripten CMake preset (
-DPLATFORM=Web) and embed the result in the docs page.
Acceptance criteria
- N-body mode conserves total momentum within 1e-3 over 1000 steps (test)
- Web build runs in a browser
Repository audit, November 2026 · Phase 9 · New features · evidence: found by code reading · ref chaos-native-055
Generated by Claude Code
- Dominant language
- C++
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ibra-kdbra/Math-Problems
-
area: security-algorithms priority: P1 size: XS type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
ibra-kdbra/Math-Problems#417 ·
-
area: math-chaos priority: P3 size: S type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ibra-kdbra/Math-Problems#397 ·
-
area: docs-site good first issue priority: P3 size: XS type: chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ibra-kdbra/Math-Problems#379 ·
-
area: docs-site good first issue priority: P3 size: XS type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ibra-kdbra/Math-Problems#378 ·
-
area: docs-site good first issue priority: P2 size: XS type: chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ibra-kdbra/Math-Problems#367 ·
All issues in ibra-kdbra/Math-Problems
Similar issues
-
TransformInteract: a circle drag through the centre sets Scale to its minimum, which can't grow backOpendifficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-supportext#311 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CachyOS/packageinstaller#211 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenEmu-Silicon/OpenEmu-Silicon#920 · 1 comment ·
Maintainers usually reply within 1 day
-
Good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100