I’m trying to create a nullEngine (for collision / movement) checking as serverSide.
What it should do:
Easy multiplayer game
Player press Key (forward, backward …) and this will send to the serverSide nullengine, All calculations will be done with MoveWithCollisions etc… and send back a position
Problem:
Im using at the client side CreateGroundFromHeightMap based on PNG image, When i try to load it into NullEngine for collisions and GroundY checking it wont work.
Error message:
ReferenceError: Image is not defined
at Function.e.LoadImage (\node_modules\babylonjs\babylon.js:16:56416)
at Function.e.CreateGroundFromHeightMap (\node_modules\babylonjs\babylon.js:16:1066376)
at Function.CreateGroundFromHeightMap (\node_modules\babylonjs\babylon.js:16:1787480)
at Terrain.loadMap (\server\src\World/terrain.js:49:42)
at new Loader (\server\src\World/loader.js:10:21)
at new Scene (\server\src/scene.js:12:9)
at Object.<anonymous> (c:\Program Files\XAMPP\htdocs\2darena/app.js:60:1)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Module._compile (\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:991:10)
ImageFile is in
app.ts
/server/src/
scene.ts
/World/
– heightmap.png
– Terrain.ts (Where im loading img)
I wonder if i can store vertexData into a file and load it on server Nodejs null engine
F.e.
Creating custom.app with canvas engine and create groundFromHeightMaps then loop throu position and normals then save it in file and load it at the server side.
@RaananW Okay sorry, this works for me if i m not using Arrow function, I dont know why but when i use function(newMeshes) instead of () => it works for some reason.
THanks for suggestion
— Edit: Okay im retarded prolly, Problem was in meshNames not in Arrow function.