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

@@ -1,3 +1,5 @@
// ignore_for_file: constant_identifier_names
import 'dart:async';
import 'dart:ui' as ui;
import 'package:flutter/widgets.dart';
@@ -5,10 +7,14 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_filament/animations/animation_data.dart';
import 'package:vector_math/vector_math_64.dart';
// a handle that can be safely passed back to the rendering layer to manipulate an Entity
typedef FilamentEntity = int;
enum ToneMapper { ACES, FILMIC, LINEAR }
// see filament Manipulator.h for more details
enum ManipulatorMode { ORBIT, MAP, FREE_FLIGHT }
class TextureDetails {
final int textureId;
@@ -27,6 +33,13 @@ abstract class FilamentController {
///
ValueNotifier<Rect?> get rect;
///
/// A [ValueNotifier] to indicate whether a FilamentViewer is currently available.
/// (FilamentViewer is a C++ type, hence why it is not referenced) here.
/// Call [createViewer]/[destroyViewer] to create/destroy a FilamentViewer.
///
ValueNotifier<bool> get hasViewer;
///
/// Whether a Flutter Texture widget should be inserted into the widget hierarchy.
/// This will be false on certain platforms where we use a transparent window underlay.
@@ -424,4 +437,13 @@ abstract class FilamentController {
/// Retrieves the name assigned to the given FilamentEntity (usually corresponds to the glTF mesh name).
///
String? getNameForEntity(FilamentEntity entity);
///
/// Sets the options for manipulating the camera via the viewport.
///
Future setCameraManipulatorOptions(
{ManipulatorMode mode = ManipulatorMode.FREE_FLIGHT,
double orbitSpeedX = 0.01,
double orbitSpeedY = 0.01,
double zoomSpeed = 0.01});
}