Search code examples
javascriptbabylonjs

Enabling OimoJs in babylonJS


I've got a little project running that uses Babylonjs to render a game, I've got the game 'rendering' and am happy with the progress and have decided to add physics, I went with oimojs as its the standard and was informed that 'enabling' it was as simple referencing the oimo.js file and calling:

scene.enablePhysics();

But when I call this I get the following error:

babylonjs.js:20 Uncaught TypeError: OIMO.World is not a constructor

The only thing I can think of is if the error is perhaps the file I'm referencing is the incorrect one? I pulled the file from:

http://lo-th.github.io/labs/

Is there something new you have to do now? Am I missing something? Or am i just silly and referencing the wrong OIMO.js file?


Solution

  • This seems to be a very old question (and I wonder how I missed it so far), but just for future reference -

    Babylon.js has the oimo.js version that is tested and working directly in the repository. If you look here - https://github.com/BabylonJS/Babylon.js/tree/master/dist , the Oimo.js file you see there will work the the latest Babylon version.