Ah family, it’s good to see you again
I said I would and I’m on it! BJS6 this weekend! MEGA UPGRADE WEEKEND!!!
Problem number one:
The docs give a super simples example of using a PhysicsAggregate, but that accepts a transform acording to the type, so I think the example will throw a type error if we try and pass in a mesh, or rather it’s throwing a type error haha.
var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter: 2, segments: 32}, scene);
sphere.position.y = 4;
var hk = new BABYLON.HavokPlugin();
scene.enablePhysics(new BABYLON.Vector3(0, -9.8, 0), hk);
//PhysicsAggregate doesn't accept mesh as the first argument.
var sphereAggregate = new BABYLON.PhysicsAggregate(sphere, BABYLON.PhysicsShapeType.SPHERE, { mass: 1, restitution:0.75}, scene);
The second random thing and this could totally be an issue with vite build, but the havoc .wasm will try to get loaded from node_modules/.vite/deps , I fell into a HUGE rabbit hole trying to solve something similar with ammo wasm, because when you build it with emscripten, it builds for a node environment and obivously we’re in the browser so path and fs won’t be available there will be much pain and serious trauma.
I haven’t spent more than a second trying to solve this yet, but like the other solider, I’ve just copied the .wam to a mock node_modules/.vite/deps dir for now.