Until Mr Doob's Code Editor. At least, that is the hope.
The Physijs physics engine is loaded like any other script:
<head> <script src="http://gamingJS.com/Three.js"> </script> <script src="http://gamingJS.com/Detector.js"> </script> <script src="http://gamingJS.com/physi.js"> </script> <title>Jumping</title> </head>But inside a Physijs script, one needs to specify the location of the underlying ammo.js physics engine as well as a web worker for doing physics calculations:
// Physics Physijs.scripts.ammo = 'http://gamingJS.com/ammo.js'; Physijs.scripts.worker = 'http://gamingJS.com/physijs_worker.js';Since I am loading the web page from a
http://localhostserver, that web worker URL will not work. And indeed, if I load the page, I get the dreaded "SECURITY_ERR: DOM Exception 18":
In fact, since my web worker resides on a different server than Mr Doob's Code Editor, I still get this error if I try to paste my code into the editor.
I see no other option but to copy Mr Doob's Code Editor into http://gamingJS.com so that both Code Editor and physics worker will be served from the same server.
So I clone the Code Editor:
➜ gamingjs git:(gh-pages) ✗ git add code-editor/ ➜ gamingjs git:(gh-pages) ✗ git ci -m "Add Mr Doob's Code Editor" ➜ gamingjs git:(gh-pages) gp origin gh-pagesWith that, I have my very own copy of Mr Doob's excellent Code Editor at http://gamingjs.com/code-editor/.
More importantly, I am able to use the physijs web worker already on gamingJS.com to make physics happen:
Best of all, since this is Mr Doob's Code Editor, I can save my code so that others can check it out.