setFrameUpdates method
Starts or stops throttled per-frame updates, delivered to onFrameUpdate.
Each sample hit-tests the reticle position x, y (device pixels) and
includes the camera matrices. It runs natively inside the existing ARCore
frame loop, so it costs one channel message per sample rather than a
request/response round-trip per frame. hz caps the sample rate.
Implementation
Future<void> setFrameUpdates(
bool enabled, {
double x = 0,
double y = 0,
int hz = 20,
}) async {
try {
await _channel.invokeMethod<void>('setReticleEnabled', {
'enabled': enabled,
'x': x,
'y': y,
'hz': hz,
});
} catch (e) {
if (debug) {
print('setFrameUpdates failed: $e');
}
}
}