Physics demo messed up?

I am trying to use the softbody example, and when I change parameters (different ones), I get the same error:

b_free is not a function


Perhaps this is an issue in old scene cleanup when creating a new scene after code changes?

Save your changes and then refresh the page rather than running the script again, and it seems to work.

Weirdly, if I try to save it I get that error as well… so… I think it is legit broken?

Save, and refresh the page. It works for me, on firefox. I think the cleanup is broken though.

@Cedric @RaananW Any ideas?

Its the softbody.


so… does that mean softbodies are broken? how should I proceed if I want to experiment with them?

I think it may be a bug. I’m hoping @Cedric or @RaananW can investigate when they get a chance.

1 Like

I’ve put the task on my list. I’ll take a look shortly.

It doesn’t repro with latest ammojs build found on the official repo. I don’t know if version on babylonjs repo is (still) built with different parameters as the official one. Do you know @Evgeni_Popov @sebavan @MackeyK24 ?

@MackeyK24 should definitely know as I can not remember if since latest we are now all good with the default build ?

1 Like

I build ammo.js with these params

cmake -B builds -DCLOSURE=1 -DTOTAL_MEMORY=134217728
cmake --build builds

There are a few classes for btSmoothTriangle mesh that are in the version i build for BabylonJS. If you just dump my builds, that will break the UnityGLTF prepared content.

btSmoothTriangle mesh is a class I created to implement the various smoothing techniques for Bullet Collisions like the internal edge issues and vehicle wheel raycasting using barycentric interpolation… so we still need that in our BJS builds.

What is the problem with the build ?

I can re build the BabylonJS version using a fresh build of kripen/ammojs …

We should really have a babylon fork of ammo.js and i can update our fork with the btSmoothTriangle mesh so we can merge the update from kripen/ammo and just fix any conflicts (if any)

I don’t know yet if it’s a build problem. Latest ammojs from the official repo does work when deallocating softbodies. With ammojs in Babylonjs repo, there is a crash.
Can you please try the PG mentioned earlier with an up to date ammojs custom build?
And which version of Emscripten do you use?

OK… So I have mentioned forking kripken/ammo.js. Still have not got a response. So @Deltakosh and @Cedric … I forked a version and created a BabylonJS/Ammo.js branch.

This is the source from which i will build the ammo.js builds for BabylonJS dist preview folder

A few of the team members are on vacation, including @Cedric now. Please be patient. :slight_smile:

@saitogroup … I have made fresh kripken babylon ammo builds

So when they go thru you can get the updated versions in the babylonjs/dist/preview release folder

1 Like