Show HN: Gravitle – 2D soft-body engine built with Rust for the web

(loicbourgois.github.io)

95 points | by bourgoisloic 1768 days ago

14 comments

  • markdog12 1768 days ago
    Site freezes on Moto G4, latest Chrome after about a second. At least back button still worked.
  • gitgud 1768 days ago
    How do I use this on mobile? The controls mention touchscreen...
    • connicpu 1767 days ago
      Idk if it breaks on other platforms, but Firefox on Android it's working to tap and hold the middle of the screen for the center thruster, left for left thruster, and right for right thruster
  • slavik81 1768 days ago
    How do you ensure stability? Based on the "learn more" section, I would presume the soft body is made up of vertices stitched together with damped springs. Is that accurate?
  • xchip 1768 days ago
    I landed my first job 20 years ago by writing a similar demo. It was in ASM on a 80286, I was rendering a torus in 3D and applying physics using a spring/mass model.
    • electricslpnsld 1768 days ago
      What was the context? Where people still using 286s in 1999?
      • michaelgrafl 1768 days ago
        Nope. Probably meant to say 30 years ago.
  • neetodavid 1766 days ago
    Verlet physics are so nifty. A basic implementation with points, springs, gravity, and a simple floor (a Math.max check) produces stunning motion. Going from trying to tune angular momentum calculations to getting believable rotation 'for free' felt like a revelation
  • andai 1768 days ago
    Man this is great fun! I got all scrunched up by the circles of doom.
  • rgovostes 1768 days ago
    This works in Chrome, but not Safari (macOS 10.14.5).
    • boardwaalk 1768 days ago
      It indeed works on Safari with WebGL 2.0 enabled (Developer -> Experimental Features)
    • bourgoisloic 1768 days ago
      Thank you for the feedback. I will look into this. Maybe the issue is only related to WebGL rendering.
  • emilfihlman 1768 days ago
    Doesn't work in Chrome : /

    E: And started to work, could just have been some fringe issue, the page was just a white screen and didn't respond.

  • Narishma 1768 days ago
    Doesn't work in Firefox 67 on Windows.
    • faitswulff 1768 days ago
      Firefox 69.0a1 (2019-06-22) (64-bit) chugging along just fine on macOS
    • NikkiA 1767 days ago
      Running fine on FF 67.0.4 on win 10 here.
    • rectang 1768 days ago
      Freezes Firefox 67.0.4 on Mac.
  • boomskats 1768 days ago
    This is very nice. It works perfectly on a BlackBerry K2 - with full keyboard support :)
  • mdonahoe 1767 days ago
    Didn’t work on my iphone
  • sidewinder128 1768 days ago
    It would be possible to use SDL2 with rust for rendering too.
  • aloer 1768 days ago
    super interesting. Is there a blog post somewhere?

    how much better is the performance due to rust/wasm compared to implementing the physics in JS?

  • hu3 1768 days ago
    Freezes in Firefox mobile on a LG G5.