From 5bb9141f87e661d1769afbfdb795fba0cc36a64a Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Fri, 9 Dec 2022 14:43:58 +0800 Subject: [PATCH] remove setRendering call from pan/rotate/etc --- lib/filament_controller.dart | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/filament_controller.dart b/lib/filament_controller.dart index 4c83dec8..cc76fca9 100644 --- a/lib/filament_controller.dart +++ b/lib/filament_controller.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:ui'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; // this is confusing - "FilamentAsset" actually defines a pointer to a SceneAsset, whereas FilamentLight is an Entity ID. @@ -231,7 +232,6 @@ class PolyvoxFilamentController extends FilamentController { } Future panStart(double x, double y) async { - await setRendering(true); await _channel.invokeMethod("panStart", [x * _pixelRatio, y * _pixelRatio]); } @@ -242,11 +242,9 @@ class PolyvoxFilamentController extends FilamentController { Future panEnd() async { await _channel.invokeMethod("panEnd"); - await setRendering(false); } Future rotateStart(double x, double y) async { - await setRendering(true); await _channel .invokeMethod("rotateStart", [x * _pixelRatio, y * _pixelRatio]); } @@ -257,12 +255,12 @@ class PolyvoxFilamentController extends FilamentController { } Future rotateEnd() async { - await setRendering(false); await _channel.invokeMethod("rotateEnd"); } Future applyWeights(FilamentAsset asset, List weights) async { - await _channel.invokeMethod("applyWeights", [asset, weights]); + await _channel + .invokeMethod("applyWeights", [asset, Float32List.fromList(weights)]); } Future> getTargetNames( @@ -281,8 +279,13 @@ class PolyvoxFilamentController extends FilamentController { Future animate(FilamentAsset asset, List weights, int numWeights, int numFrames, double frameLengthInMs) async { - await _channel.invokeMethod("animateWeights", - [asset, weights, numWeights, numFrames, frameLengthInMs]); + await _channel.invokeMethod("animateWeights", [ + asset, + Float32List.fromList(weights), + numWeights, + numFrames, + frameLengthInMs + ]); } Future removeAsset(FilamentAsset asset) async {