Thanks @carolhmj and @RaananW
I will try to use this today or tomorrow.
Just a thought, Raanan, shouldn’t the BabylonJS handle it somehow differently? Eg. maybe it could check the context of function being called, like in this example it is node environment, and then instead of doing XML HTTP Request do something else, eg. try to do fs.readFile() or whatever is an node-like substitute?
if you pass a URL babylon will try downloading it. Instead of that you might want to load the file beforehand and convert it to a base64 data URL. Passing a data URL will avoid using any network requests.
EDIT:
Okay, I’ve found out that I was missing sphereAggregate and groundAggregate on the server so it’s better but still it behaves differently. I’ll investigate futher
After successfully making working Havok with the NullEngine (I mean having no errors) I added heightmap on the client and it looks like the physics is not working properly on the server. @RaananW can you look at this maybe?
I managed to get havok working on the server in terms that it runs without errors. I try to make client and server havok instances identical to be sure if there is some server related issue, at least it looks like that to me at this point. But I could make some error in the code so I’ll prepare that identical client and server instances and verify it.
The issue here is the lack of support for image loading in babylon when using the null engine in node.js. As node is missing a few functions that Babylon needs to process the image.
I tried working with node-canvas and others, but seems to be a little bigger than that.
We can look into that in the future, but for now we sadly don’t support it.