Skip to content

feat: add force field particle system demo#238

Open
surajsahani wants to merge 1 commit intogoogle:mainfrom
surajsahani:main
Open

feat: add force field particle system demo#238
surajsahani wants to merge 1 commit intogoogle:mainfrom
surajsahani:main

Conversation

@surajsahani
Copy link
Copy Markdown

Adds a new XR demo featuring curl noise-driven particles with interactive attractor, repulsor, and vortex force sources.

Math highlights:

  • 3D simplex noise with fBm for curl noise computation
  • Divergence-free vector field via central-difference curl
  • Inverse-square attractor/repulsor forces with soft-core regularization
  • Tangential vortex forces via cross product
  • Symplectic Euler integration for energy-conserving particle physics
  • 5000 GPU-instanced particles with speed-to-HSL color mapping

Files:

  • demos/forcefield/noise.ts — simplex noise + fBm
  • demos/forcefield/VectorField.ts — curl noise + force sources
  • demos/forcefield/ForceFieldParticles.ts — particle system + integrator
  • demos/forcefield/ForceFieldScene.ts — XR scene with depth mesh interaction
  • demos/forcefield/main.ts + index.html — entry point

Adds a new XR demo featuring curl noise-driven particles with
interactive attractor, repulsor, and vortex force sources.

Math highlights:
- 3D simplex noise with fBm for curl noise computation
- Divergence-free vector field via central-difference curl
- Inverse-square attractor/repulsor forces with soft-core regularization
- Tangential vortex forces via cross product
- Symplectic Euler integration for energy-conserving particle physics
- 5000 GPU-instanced particles with speed-to-HSL color mapping

Files:
- demos/forcefield/noise.ts — simplex noise + fBm
- demos/forcefield/VectorField.ts — curl noise + force sources
- demos/forcefield/ForceFieldParticles.ts — particle system + integrator
- demos/forcefield/ForceFieldScene.ts — XR scene with depth mesh interaction
- demos/forcefield/main.ts + index.html — entry point
@dli7319
Copy link
Copy Markdown
Collaborator

dli7319 commented Apr 2, 2026

I loaded this up in the simulator and on devices. I can see the particles but it doesn't seem to interact with anything. Neither depth or hands do anything. Is this expected?

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.

2 participants