update example project

This commit is contained in:
Nick Fisher
2023-11-03 17:28:25 +08:00
parent 58a9542121
commit f5cc7a8174
11 changed files with 732 additions and 372 deletions

View File

@@ -39,6 +39,9 @@ class FilamentControllerFFI extends FilamentController {
@override
final rect = ValueNotifier<Rect?>(null);
@override
final hasViewer = ValueNotifier<bool>(false);
@override
Stream<FilamentEntity> get pickResult => _pickResultController.stream;
final _pickResultController = StreamController<FilamentEntity>.broadcast();
@@ -135,6 +138,7 @@ class FilamentControllerFFI extends FilamentController {
_assetManager = null;
_lib.destroy_filament_viewer_ffi(viewer!);
hasViewer.value = false;
}
@override
@@ -217,6 +221,7 @@ class FilamentControllerFFI extends FilamentController {
print("texture details ${textureDetails.value}");
_lib.update_viewport_and_camera_projection_ffi(
_viewer!, rect.value!.width.toInt(), rect.value!.height.toInt(), 1.0);
hasViewer.value = true;
}
Future<RenderingSurface> _createRenderingSurface() async {
@@ -1024,4 +1029,17 @@ class FilamentControllerFFI extends FilamentController {
calloc.free(arrayPtr);
return rotationMatrix;
}
@override
Future setCameraManipulatorOptions(
{ManipulatorMode mode = ManipulatorMode.FREE_FLIGHT,
double orbitSpeedX = 0.01,
double orbitSpeedY = 0.01,
double zoomSpeed = 0.01}) async {
if (_viewer == null) {
throw Exception("No viewer available");
}
_lib.set_camera_manipulator_options(
_viewer!, mode.index, orbitSpeedX, orbitSpeedX, zoomSpeed);
}
}