From cf7d8e45f4628c5c0b1318a7f602d938aa3b5809 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 22 Oct 2024 22:23:51 +0800 Subject: [PATCH] doc: add camera_manipulation --- docs/camera_manipulation.mdx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/camera_manipulation.mdx diff --git a/docs/camera_manipulation.mdx b/docs/camera_manipulation.mdx new file mode 100644 index 00000000..79f47394 --- /dev/null +++ b/docs/camera_manipulation.mdx @@ -0,0 +1,29 @@ +## Camera Manipulation (Flutter) + +> You can find the entire project below in the [flutter/quickstart](https://github.com/nmfisher/thermion/examples/flutter/camera_manipulation) folder. + +A `ThermionListenerWidget` is one option for manipulating the camera with an input device (e.g. mouse or touchscreen gestures). + +This will generally wrap a `ThermionWidget`, meaning the entire viewport will act as a receiver for gesture events. + +> You can position this independently (for example, stacked vertically beneath the viewport), but this will not translate picking queries correctly. + +``` +@override + Widget build(BuildContext context) { + return Stack(children: [ + if (_thermionViewer != null) + Positioned.fill( + child: ThermionListenerWidget( + inputHandler: + DelegateInputHandler.fixedOrbit(_thermionViewer!), + child: ThermionWidget( + viewer: _thermionViewer!, + ))), + ]); +``` + +`ThermionListenerWidget` is a very simple widget; it simply forwards pointer, gesture and keyboard events to an instance of [InputHandler] that you provide. + + +