Is there a way I can make local edits to the babylon.js source code in a playground?
Edit: I ended up just stepping through the function calls and modifying the arguments inside the ammo.js multi sphere function call site:
What this is doing? I don’t really know. What I can say for sure is that the results of the physics sim are definitely different when I do this, versus when I don’t and let the playground run unmodified. You can try this if you want, by stepping through the code up to that function call returnValue = new this.bjsAMMO.btMultiSphereShape(positions, radii, 2);
(line 142 in ammoJSPlugin.ts)
v3 = a[0].constructor; a.push(new v3(-1, 0, -1)); a.push(new v3(-1, 0, -1)); a.push(new v3(3,2,3)); c.push(1,2,3); d = 4;
If I run that modification on the Ammo arguments to each call that creates an asteroid, it seems to actually be creating larger objects, I just can’t tell if they exactly correspond to the vectors and radii I specified in those arguments. I suppose I could run my ammo debug drawer code as well in this playground.
However, back to the Ammo multi sphere constructor:
function sD(a, c, d) {
zC();
a && "object" === typeof a && (a = a.Fz);
"object" == typeof c && (c = DC(c));
d && "object" === typeof d && (d = d.Fz);
this.Fz = Cl(a, c, d);
h(sD)[this.Fz] = this
}
So as long as I make those modifications to the arguments (a, c, d) before the zC();
invocation happens, those extra arguments do seem to have an effect. I guess trying to make sense of wasm code from JS land wasn’t such a great idea.