In the examples I’ve seen, the physics engines are specified via CDN in script tags like so:
<script src="https://preview.babylonjs.com/cannon.js"></script>
<script src="https://preview.babylonjs.com/ammo.js"></script>
And then subsequently available to be plugged in like so:
let physicsPlugin = new BABYLON.AmmoJSPlugin();
// let physicsPlugin = new BABYLON.CannonJSPlugin()
this.scene.enablePhysics(gravityVector, physicsPlugin)
Is there a way to not require the script tag upfront, but instead lazily load the plugin entirely in js? That way if I have different games that use different physics plugins, if the user only plays one game I didn’t need to load all possible physics plugins up front.