-
Notifications
You must be signed in to change notification settings - Fork 287
Ammo Physics (3D Physics Extension) #1974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Wow! It's very cool and useful for people like me) |
Thank you! I've been making steady progress, but it probably won't be ready for a while (which is why this is a draft). |
Added partial support compound bodies - all child shape types. |
wow |
Finally got convex hulls working 🥳 🎉 video.mp4Still have to optimize and bug fix everything and add more features |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Also, Ammo.js seems to support wireframe debug rendering. I might want to add a layer to the canvas that can show contacts, convex hulls, velocities, etc. |
This looks like a faulty collision detection. Changing framerate, sub-steps and solver iterations is mostly useful when you have a lot of bodies interacting in a chain reaction, which isn't the case here.
Not sure exactly what you are referring to, because there isn't much documentation, but I asked ChatGPT how to correctly use |
I'm already registering the GImpactCollisionAlgorithm, but ChatGPT suggests using a more narrow phase parent collision algorithm... I don't really think that will affect anything. Looking at the official demos,
|
there's no freaking documentation writing constraints is a pain 😞 |
@CubesterYT I'm pretty sure this isn't possible but the best ammo.js projects use WebAssembly / Web workers to let the physics run async in the background so it doesn't hinder rendering processes, etc, also have more memory capacity. I'm assuming this isn't possible in TW and it has to be native JS? |
@wiktorlaskowski and @WAYLIVES might want to take a look at the placeholder banner and see if it's acceptable |
woah thats awsome |
What the banner? |
- Improves some of the comments or expands on them for self future reference - Fixes an issue where the step simulation block would not behave correctly at 0 FPS, it now implies the screen refresh rate as Turbowarp does
@GarboMuffin and/or @CubesterYT I'd like this extension to be able to support WebAssembly as it has much higher performance and much lower memory limitations. The extension would check if that file exists, if so load the WASM ammo with it, if not fall back to the default offline native JS version (at the cost of performance). This way there's no external domains and the extension should always load with some kind of Ammo. In practice, it looks like this: would something like this even work? |
I'll just be real with you. The likelihood that I would tolerate merging a 2MB extension is really low right now |
This comment was marked as outdated.
This comment was marked as outdated.
Alternatively, I could build my own version of Ammo without the extra stuff that is much smaller than the prebuilt library, but it would probably remove things like the wireframe debug drawer which might be nice (but a lot of work and size) to implement later... |
I could probably half the file size if I did that though |
Hello Mr. Weber, This makes it run faster, have "infinite" memory limitations (can be both good or bad, but it fixes the crashing Out of Memory issue), and the entire extension size is now only 1.2 MB (with all the blocks and stuff too). Is that good with you or should I compress further? What is the preferred size? I could probably get it a few hundred kilobytes, but that would be more aggressive and I don't think I can go further than that. |
- WebAssembly Embedded into JS for higher performance and scalable memory (Fixes the Aborted: Out of Memory error) - Remove soft bodies and debug drawer for half the size - And something else IDK
!format |
The formatting bot didn't find any formatting issues. It currently only checks the extensions folder. The author or a maintainer can run terminal command 'npm run format' manually to format all files. |
@CubesterYT since the last commit where I made a custom build of the library, format is failing even though |
it's because of the prettier update pull request you merged where now your local prettier doesn't match what's on your pull request branch that's why the pull request wasn't merged for a long time rebase, reinstall, reformat, itll go away |
!format prettier updates are now blocked from dependabot so that mistake won't be possible to make again |
The formatting bot didn't find any formatting issues. It currently only checks the extensions folder. The author or a maintainer can run terminal command 'npm run format' manually to format all files. |
Oops sorry just trying to help |
this extension is super cool!! |
Thanks! Apparently though, it's too large, so I'll have to find some way to compress the library further |
Previous commit reduces the file size ≈0.2 MB |
Ammo Physics
A work-in-progress extension based on the ammo.js physics library, which is based on the C++ Bullet Physics SDK.
The goal is to provide feature-complete, advanced, and performant 3D physics in a simple-to-understand manner. This extension aims to be consistent with Box2D and Simple3D.
video.mp4
Task list:
Things I'm considering now or for a later update:
Debug rendering supportSoft BodiesMiscellaneous Notes Mainly for Moderators:
I'm not good at graphic design so if someone wants to make a banner/thumbnail that'd be greatStill have to incorporateScratch.Cast
where necessary, right now I'm just working on functionality thoughPut an emoji (👍, 🚀) if you like this extension