laya.physics3D.wasm.js 768 B

1234567891011121314151617181920212223
  1. window.Physics3D = function (initialMemory, interactive) {
  2. return new Promise((resolve) => {
  3. var mem = new WebAssembly.Memory({ initial: initialMemory });
  4. fetch("laya.physics3D.wasm.wasm").then((response) => {
  5. response.arrayBuffer().then((buffer) => {
  6. WebAssembly.instantiate(buffer, {
  7. LayaAirInteractive: interactive,
  8. wasi_unstable: {
  9. fd_close: () => { console.log('fd_close'); },
  10. fd_seek: () => { console.log('fd_seek'); },
  11. fd_write: () => { console.log('fd_write'); }
  12. },
  13. env: {
  14. memory: mem,
  15. }
  16. }).then((physics3D) => {
  17. window.Physics3D = physics3D.instance.exports;
  18. resolve();
  19. });
  20. });
  21. });
  22. });
  23. };