brianzinn Posted July 11, 2018 Share Posted July 11, 2018 1 hour ago, promontis said: But like I said, I'm unsure on how animations fit in this. I don't know if this is what you are asking, but here is a possible solution that works with redux-saga: You send a command to BabylonJS from your saga as you do now, like ACTION_REQUEST. Then in your saga wait on that command to "complete" in the saga with: yield take(ACTION_REQUEST_COMPLETED); In BabylonJS in the onAnimationEnd callback just use an action creator to trigger that: scene.beginAnimation(this, 0, 30, false, 1, () => { // any additional logic and notify saga with this action onComplete(); }); Additionally, I ended up writing replayable scenarios that I test with BabylonJS running, so I run a series of commands and then assert the expected results. It takes about 20 minutes to go through all the scenarios, but I use that as a sanity check. The reason I mention that is that the animations and their chain of effects (butterfly effect!) can be tested in an automated/predictable way. The physics engine plays an important role in my case, but sounds like you don't have to worry about that. I ended up pushing most of my logic into the saga for many of the same reasons as you - moving the responsibilities around is a lot of work promontis 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.