fenomas Posted February 4, 2015 Share Posted February 4, 2015 Is there an way to (safely) manually control the timing of render calls, instead of leaving them to engine.runRenderLoop?If I just call scene.render() directly, random bugs occur - for example, camera movement controls stop working. Apparently this is because engine.getDeltaTime() returns 0, so I'd imagine that physics and animations would break too. Is there a safe way to do this, or is runRenderLoop mandatory? Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted February 4, 2015 Share Posted February 4, 2015 Hey For what use do you want to render a scene outside of runRenderLoop ? Delta time is computed in engine.beginFrame() -> _measureFps(), it means that if you need to be synchronized with animations etc you must render your scene (if animations) between beginFrame() and endFrame() in the engine using renderLoops. You can try to set the deltaTime using engine.deltaTime = my_value ? Quote Link to comment Share on other sites More sharing options...
fenomas Posted February 4, 2015 Author Share Posted February 4, 2015 Thanks! Ok, if there's no "official" way then I'll try manually calling beginFrame and endFrame, and see if anything breaks. Seems to work so far, anyway. As for why I'm doing it, essentially I'm trying to use BJS as a dependency, in code I was already working on that managed its own render loop. So I'm trying to avoid having the higher-level loop getting called by the lower one. 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.