DellaFree Posted August 26, 2015 Share Posted August 26, 2015 Hi guys I would ask you a question:is there a way to update some value of mesh (i.e a ground) without stop the engine and restart again?I try to explain better :I use this peace of code $('#mapHeight').slider({ value: 0, min: 50, max: 200, slide: function (event, ui) { MAP_HEIGHT = ui.value; engine.stopRenderLoop(); startBabylon(); } });I set the global variable MAP_HEIGHT; it is used in this function :var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", 'texture/heightMap.png', 800, 800, 100, 0, MAP_HEIGHT, scene, false, null);Then I stop the renderLoop (the variable engine is global) and call the function that start all the scene (startBabylon(); ). In this way when the scene is created, I will use the vaue updated.It works, but every time I change the value with the slider, I stop the engine and start again , but ,for a fraction of second, I notice that the scene is loading (with a grey screen); so I would know if there is a way to update this value without stop the engine and make it more "fluid".Or there is another way to do this?Many thanks guys ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 26, 2015 Share Posted August 26, 2015 Hey! Why do you need to stop the engine? Everything can be done with engine running. Just dispose your previous ground: ground.dispose() and recreate a new one DellaFree 1 Quote Link to comment Share on other sites More sharing options...
DellaFree Posted August 26, 2015 Author Share Posted August 26, 2015 Oh great! I have no thought about that XD sorry for the stupid question. Many thanks !!!! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 26, 2015 Share Posted August 26, 2015 No worry DellaFree 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.