2

As can be seen in the title, when I run the example of physiJS (from github repo) it show only background, fps counter, but no physiJS functionality at all (pure three.js works fine). When I run on the: http://chandlerprall.github.io/Physijs/examples/vehicle.html everything runs ok. I have no idea right now where to start looking and where the problem is. Any ideas of what the cause could be?

Joop
  • 3,706
  • 34
  • 55

1 Answers1

0

PhysiJS uses a web worker to run the updating functionality, and web workers are not allowed on local systems as they require the loading of additional resources through JavaScript (and this is not allowed by cross-origin policies on some browsers). It's related to your browser, on my mac Safari allows it, but Chrome throws an error:

Uncaught SecurityError: Failed to construct 'Worker': Script at 'file://physijs_worker.js' cannot be accessed from origin 'null'.

The worker is required to run PhysiJS, so you should use a local server like MAMP to test it on your local machine.

somethinghere
  • 16,311
  • 2
  • 28
  • 42