Closed emilebres closed 4 years ago
Won't the self.onFrame call always be too late? I mean I don't think the react-native callback exec in sync so it's always scheduling for the next frame? At least it fixes doing too much frames.
I wonder if it should be called something like onAfterFrame because we could imagine another onFrame implementation that exec from the CPP javascriptcore runtime at the frame time, in sync. (But I have no idea if it even easily possible)
I wish @nikki93 can give his thoughts on this
This pull request adds an
onFrame
callback as described in https://github.com/expo/expo/issues/538 and https://github.com/react-community/react-native-webgl/issues/14. The implementation may have some problems but it works on both Android and iOS. I updated the Three.js example to use theonFrame
callback. Also add start/stop rotation on touch to Three.js example.