earslap Posted June 10, 2017 Share Posted June 10, 2017 The regular requestAnimationFrame function is sent in a high res timestamp as an argument by the browser so that we can accurately calculate the interval between frames. This value is needed for doing fluid animations, accurate physics etc. that are not tied to a framerate. I assume that babylon renderloop uses requestAnimationFrame; is there a particular reason why this value is not exposed to the user? Is there another way / convention of getting it? Also, would it be unwise to use requestAnimationFrame directly to render our scenes bypassing the render loop of babylon? Would this have any unintended consequences? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 10, 2017 Share Posted June 10, 2017 There is no problem to NOT use the babylon.js render loop. You are free to call scene.render() when you want The requestAnimationFrame timestamp is not exposed but this is something easy to do Quote Link to comment Share on other sites More sharing options...
earslap Posted June 10, 2017 Author Share Posted June 10, 2017 Thank you David, should I open an issue in the tracker for this? I'm not very familiar with babylon.js source but if you think it is trivial enough I might attempt a PR soon if you want, if you think sending in the time as an argument is a good idea that is. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 10, 2017 Share Posted June 10, 2017 Please do:) I really appreciate when people help with PR Quote Link to comment Share on other sites More sharing options...
earslap Posted June 10, 2017 Author Share Posted June 10, 2017 Ok, I'll see if I can figure it out! GameMonetize 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.