box2d.ts VS liquidfun-play-2

Compare box2d.ts vs liquidfun-play-2 and see what are their differences.

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
box2d.ts liquidfun-play-2
1 1
1 28
- -
0.0 0.0
almost 3 years ago almost 2 years ago
TypeScript
- -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

box2d.ts

Posts with mentions or reviews of box2d.ts. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-07-29.
  • Show HN: WASM and WebGL Fluid Simulation
    11 projects | news.ycombinator.com | 29 Jul 2021
    yes, I compiled with -msimd128 to enable LLVM's auto-vectorization. I distribute both SIMD and non-SIMD, and the entrypoint picks whichever distribution your browser supports. for box2d-wasm, SIMD acceleration resulted in a 0.6–0.9% performance boost [0] when simulating a pyramid of boxes.

    liquidfun-wasm is a fork with additional algorithms for performantly simulating particles. I have not yet built a benchmark to measure the particle code, but do intend to. I am optimistic that liquidfun's particle code could auto-vectorize better than the general Box2D code.

    the Google engineers considered how to take advantage of SIMD, to the extent that they even ship a NEON SIMD algorithm[1]. I don't believe my compiler config will use that NEON algorithm (and will instead fallback to the general algorithm [2]). that's probably not a missed opportunity; many NEON features are not supported[3]. but since the engineers were thinking about SIMD, hopefully the non-NEON algorithm will try to make good use of the CPU and memory layout too, and auto-vectorize well.

    [0] https://github.com/Birch-san/box2d.ts/pull/1

    [1] https://github.com/google/liquidfun/blob/master/liquidfun/Bo...

    [2] https://github.com/google/liquidfun/blob/master/liquidfun/Bo...

    [3] https://emscripten.org/docs/porting/simd.html#compiling-simd...

liquidfun-play-2

Posts with mentions or reviews of liquidfun-play-2. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-07-29.
  • Show HN: WASM and WebGL Fluid Simulation
    11 projects | news.ycombinator.com | 29 Jul 2021
    yeah, I've played around with a few approaches for running the timestep and for some reason I don't feel like I get the same results as liquidfun.js.

    their loop [0] is pretty simple; it's scheduled by `requestAnimationFrame`, advances time by 1/60th of a second, and runs their default of 3 particle iterations. it completes the physics simulation within 3.9–5.5ms, which is easily in time for the 16ms deadline. the rendering is WebGL, which I assume fits easily into that 16ms budget too.

    my loop [1] is more complicated; I don't hardcode the timestep to 1/60 seconds, because requestAnimationFrame may be scheduled less frequently than that. so instead I advance time by the time elasped since I was last scheduled. hm, I think there's a mistake there — `lastMs = nowMs` is probably on the wrong side of the physics calculation.

    there's an additional technique I use: I put a `Math.min()` over the simulation interval, so that I don't attempt to simulate more than 20ms (this can happen if you get scheduled infrequently due to hot CPU or backgrounding the app) — simulating too much time will make us fail our frame deadline anyway.

    furthermore, if we are calculating more than 1/60th of a second, I employ more particle iterations (i.e. 3 particle iterations for every 1/60th of a second that passes). this gave me good results, but turns out it is based on incorrect assumptions (iterations are unrelated to timestep)[3]. moreover, I may be making mistakes in my decision of whether to round this fraction up/down.

    if too few particle iterations for a timestep: the particles will bounce. if too many: the particles will look too incompressible[4]. I think that's the "solid-like" structure you're describing.

    the main reason I complicated this is because the last one I did[5] made me feel motion-sick. I think if "every 1/60th, or 1/30th, or 1/20th of a second: you simulate a 1/60th of a second of time": the result (if you're not scheduled consistently) is that the world speed keeps changing. I think liquidfun.js's approach should be vulnerable to this, but for some reason it looks fine to me. maybe they get scheduled more consistently than me (even though by my measurements, my physics runs slightly faster, so should be able to achieve similar results).

    I think I need to remind myself of what happens if I program the timestep in the simple way that liquidfun.js did. will try that out at some point.

    [0] https://github.com/google/liquidfun/blob/master/liquidfun/Bo...

    [1] https://github.com/Birch-san/liquidfun-play-2/blob/master/sr...

    [2] https://github.com/Birch-san/liquidfun-play-2/blob/master/sr...

    [3] http://google.github.io/liquidfun/Programmers-Guide/html/md_...

    [4] http://google.github.io/liquidfun/Programmers-Guide/html/md_...

    [5] https://birchlabs.co.uk/box2d-wasm-liquidfun/

What are some alternatives?

When comparing box2d.ts and liquidfun-play-2 you can also consider the following projects:

box2d-wasm - Box2D physics engine compiled to WebAssembly. Supports TypeScript and ES modules.

Box2D - Box2D is a 2D physics engine for games

LiquidFun - 2D physics engine for games

VoltAir