3 ms·
I recently started playing around with a physics engine library and it quickly became clear to me that I had no business attempting to build my own. I thought I
by bob1029 3y ago
I recently started playing around with a physics engine library and it quickly became clear to me that I had no business attempting to build my own. I thought I was "close" with my DIY attempt and then read docs like the following:
https://github.com/bepu/bepuphysics2/blob/master/Documentation/ContinuousCollisionDetection.md https://github.com/bepu/bepuphysics2/blob/master/Documentati...
Configuring mandatory basics like "solver iterations" sent some strong signals to me that I was attempting to fight a dragon I couldn't even fully see.
- 9dev 3y agoThe most important part of this feeling is not giving in to being intimidated. By realising there is a dragon, you’ve already made a big step! Others could fight the dragon because they made the same first step at some point, not because they are so much smarter than you.
- kqr 3y agoIndeed. I've discovered with experience that one can learn surprisingly complicated things by taking one methodical step at a time and just giving it lots of time and effort. If you want to do it, go for it! Just don't expect results on day 1.
- rikroots 3y agoI've tried a number of times to build a physics engine for my 2D canvas library - the one thing that's defeated me every time has been the collision detection. In the end I gave up on building the whole thing and settled on just doing the particle part of the job; it's enough for my purposes without over-complexifying the library[1]. If people need collision detection for their canvas animation they can include a 3rd party library that does the job properly[2]. But it was definitely worth making the attempt - an excellent learning experience into an area of computing I never want to visit again! [1] - Some examples: A particle emitter - https://scrawl-v8.rikweb.org.uk/demo/particles-003.html https://scrawl-v8.rikweb.org.uk/demo/particles-003.html Emulate a flag with a net of particles - https://scrawl-v8.rikweb.org.uk/demo/particles-008.html https://scrawl-v8.rikweb.org.uk/demo/particles-008.html Position things using particles - https://scrawl-v8.rikweb.org.uk/demo/particles-012.html https://scrawl-v8.rikweb.org.uk/demo/particles-012.html [2] - My favourite JS physics library is MatterJS - https://brm.io/matter-js/ https://brm.io/matter-js/ . I want to like Rapier, which is coded in Rust and can be imported into the browser via WASM, but I haven't had the time to properly play with it - https://rapier.rs/docs/user_guides/javascript/getting_started_js/ https://rapier.rs/docs/user_guides/javascript/getting_starte...