chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.77k stars 455 forks source link

Error in loading ammo.js #296

Closed Gil92 closed 7 years ago

Gil92 commented 7 years ago

I'm trying to develop a project with physijs. I have encountered this type of error (from mozilla firefox console): NetworkError: Failed to load worker script at ammo.js pr

I'm trying to fix it but with no results. This is my code snippet on physijs setup: pr2

All javascript files are in js directory, except for Three.js building files (that are in build directory). I have no idea what's wrong in my code, I create only lights, ground (compoud shapes following Physijs rules) and a bag (that I want to apply a cone-twist constaint but for previous reasons doesn't work).

I add even the code that I use to initialize the scene (if in case there is something wrong): pr3

Thanks in advance

Gil92 commented 7 years ago

SOLVED I used a local web server (Three.js's reference) and changed this:

Physijs.scripts.worker = 'js/libs/physijs_worker.js'; Physijs.scripts.ammo = 'ammo.js';