Skip to content

Conversation

Brackets-Coder
Copy link
Contributor

@Brackets-Coder Brackets-Coder commented Feb 25, 2025

Ammo Physics

A physics extension based on the ammo.js physics library, which is a direct port of the world-renowned 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:

  • Shapes
    • Boxes
    • Spheres
    • Cylinders
    • Cones
    • Capsules
    • Convex Hulls
    • Triangle Meshes
    • Compound bodies
    • There are some others (planes, heightfields), but I don't want to support these
  • Physical Materials (friction, restitution, etc.)
  • [ ] Constraints (All types)
  • Collision:
    • Collision Detection
    • Raycasting
    • Enable/disable collision response
  • Manual Impact forces (like "push with force" block in Box2D)
  • Bug fixing

Things I'm considering now or for a later update:

  • Vehicle support
  • Debug rendering support
  • Soft Bodies

Miscellaneous Notes Mainly for Moderators:

  • ChatGPT was used to assist and enhance the making of this extension, simply because I couldn't find good quality, coherent documentation of Ammo.js, and attempting to figure out how to use it via the developer inspector isn't fun. It did not write the code for me and I am still the main author of this extension. It just helped me learn Ammo.js. Hope this doesn't cause conflicts.
  • I'm not good at graphic design so if someone wants to make a banner/thumbnail that'd be great
  • Still have to incorporate Scratch.Cast where necessary, right now I'm just working on functionality though

Put an emoji (👍, 🚀) if you like this extension

@Brackets-Coder Brackets-Coder marked this pull request as draft February 25, 2025 22:31
@github-actions github-actions bot added the pr: new extension Pull requests that add a new extension label Feb 25, 2025
@WAYLIVES
Copy link

WAYLIVES commented Mar 4, 2025

Wow! It's very cool and useful for people like me)

@Brackets-Coder
Copy link
Contributor Author

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).

@Brackets-Coder Brackets-Coder changed the title Ammo Physics Ammo Physics (3D Physics Extension) Mar 19, 2025
@Brackets-Coder
Copy link
Contributor Author

Added partial support compound bodies - all child shape types.
Also working on convex and concave mesh support... it'll be a while.

@WAYLIVES
Copy link

wow

@Brackets-Coder
Copy link
Contributor Author

Brackets-Coder commented Apr 2, 2025

Finally got convex hulls working 🥳 🎉

video.mp4

Still have to optimize and bug fix everything and add more features

@Brackets-Coder

This comment was marked as outdated.

@Xeltalliv

This comment was marked as resolved.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder

This comment was marked as resolved.

@Xeltalliv

This comment was marked as resolved.

@Brackets-Coder

This comment was marked as resolved.

@unknown07724
Copy link

I feel like merging this with the simple3D extension might work, not sure

@Brackets-Coder
Copy link
Contributor Author

I feel like merging this with the simple3D extension might work, not sure

Personally, it probably wouldn't work considering all of the custom transformations that Simple3D relies on. Additionally, it's a different category of extension, so instead of bloating it just keeping it independent will make it more accessible for integration into other 3D renderers.

I highly considered accessing Simple3D's i_will_not_ask_for_help_when_this_breaks API to manually update transformations upon simulation step, but it's integration requirements with the vast possibilities of Simple3D doesn't make it feasible or logistical. How do I know what objects are what? I can't just assume meshes because those could be instanced, and a project could have any number of ways of implementing that, etc...

So I find it best that users integrate both extensions manually for a custom-tailored experience that they're familiar with their own code.

@Brackets-Coder

This comment was marked as outdated.

@Brackets-Coder Brackets-Coder marked this pull request as ready for review October 8, 2025 17:06
@Brackets-Coder

This comment was marked as resolved.

@Brackets-Coder Brackets-Coder marked this pull request as draft October 9, 2025 00:46
@Brackets-Coder

This comment was marked as resolved.

@Brackets-Coder Brackets-Coder marked this pull request as ready for review October 9, 2025 02:46
@Brackets-Coder

This comment was marked as resolved.

@Brackets-Coder
Copy link
Contributor Author

Brackets-Coder commented Oct 9, 2025

Screenshot 2025-10-09 at 8

@GarboMuffin and/or @CubesterYT after merging upstream I'm getting this error when doing npm run dev EDIT: the same issue is happening for validate too
Anyone have any idea what's going on

@Brackets-Coder Brackets-Coder marked this pull request as draft October 9, 2025 23:37
@Brackets-Coder
Copy link
Contributor Author

Oops meshes being weird

@Brackets-Coder Brackets-Coder marked this pull request as ready for review October 10, 2025 15:36
@Brackets-Coder
Copy link
Contributor Author

video.mov

Yeah I think it's working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new extension Pull requests that add a new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants