add moveCameraToAsset

This commit is contained in:
Nick Fisher
2023-09-25 22:30:07 +08:00
parent 64cfea2952
commit 833022e4e0
15 changed files with 79 additions and 13 deletions

View File

@@ -139,7 +139,10 @@ class _ExampleWidgetState extends State<ExampleWidget> {
}, 'transform to unit cube'),
_item(() async {
_filamentController.setPosition(_cube!, 1.0, 1.0, -1.0);
}, 'set position to 1, 1, -1'),
}, 'set cube position to 1, 1, -1'),
_item(() async {
_filamentController.setPosition(_cube!, 1.0, 1.0, -1.0);
}, 'move camera to cube position'),
_item(() async {
var frameData = Float32List.fromList(
List<double>.generate(120, (i) => i / 120).expand((x) {
@@ -244,6 +247,10 @@ class _ExampleWidgetState extends State<ExampleWidget> {
_filamentController.setToneMapping(ToneMapper.LINEAR);
}, "Set tone mapping to linear"));
children.add(_item(() {
_filamentController.moveCameraToAsset(_cube!);
}, "Move camera to asset"));
return Stack(children: [
Positioned.fill(
bottom: 100,