add model/view matrix getters & manipulator options
This commit is contained in:
@@ -1,34 +1,40 @@
|
||||
PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_filament (0.0.1):
|
||||
- Flutter
|
||||
- integration_test (0.0.1):
|
||||
- Flutter
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- flutter_filament (0.0.1):
|
||||
- permission_handler_apple (9.1.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_filament (from `.symlinks/plugins/flutter_filament/ios`)
|
||||
- integration_test (from `.symlinks/plugins/integration_test/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- flutter_filament (from `.symlinks/plugins/flutter_filament/ios`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_filament:
|
||||
:path: ".symlinks/plugins/flutter_filament/ios"
|
||||
integration_test:
|
||||
:path: ".symlinks/plugins/integration_test/ios"
|
||||
path_provider_foundation:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||
flutter_filament:
|
||||
:path: ".symlinks/plugins/flutter_filament/ios"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_filament: 9d744e795935e0fc5308e46a0c5947cb91714848
|
||||
integration_test: 13825b8a9334a850581300559b8839134b124670
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
flutter_filament: 35fece7761e74c973afd80fe3aa0ca225eaace32
|
||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||
|
||||
PODFILE CHECKSUM: 7adbc9d59f05e1b01f554ea99b6c79e97f2214a2
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:flutter_filament/animations/animation_data.dart';
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:flutter_filament/filament_controller.dart';
|
||||
import 'package:flutter_filament/filament_controller_ffi.dart';
|
||||
import 'package:flutter_filament/animations/animation_builder.dart';
|
||||
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:flutter_filament/widgets/filament_gesture_detector.dart';
|
||||
import 'package:flutter_filament/widgets/filament_widget.dart';
|
||||
|
||||
@@ -45,6 +44,10 @@ class ExampleWidget extends StatefulWidget {
|
||||
class _ExampleWidgetState extends State<ExampleWidget> {
|
||||
FilamentController? _filamentController;
|
||||
|
||||
Timer? _cameraTimer;
|
||||
String? _cameraPosition;
|
||||
String? _cameraRotation;
|
||||
|
||||
FilamentEntity? _shapes;
|
||||
FilamentEntity? _flightHelmet;
|
||||
FilamentEntity? _buster;
|
||||
@@ -89,6 +92,7 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
||||
}
|
||||
|
||||
void _createController({String? uberArchivePath}) {
|
||||
_cameraTimer?.cancel();
|
||||
_filamentController =
|
||||
FilamentControllerFFI(uberArchivePath: uberArchivePath);
|
||||
_filamentController!.pickResult.listen((entityId) {
|
||||
@@ -98,6 +102,22 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
||||
});
|
||||
}
|
||||
|
||||
void _createViewer() {
|
||||
_filamentController!.createViewer();
|
||||
setState(() {
|
||||
_hasViewer = true;
|
||||
});
|
||||
|
||||
_cameraTimer =
|
||||
Timer.periodic(const Duration(milliseconds: 50), (timer) async {
|
||||
var cameraPosition = await _filamentController!.getCameraPosition();
|
||||
var cameraRotation = await _filamentController!.getCameraRotation();
|
||||
_cameraPosition = cameraPosition.toString();
|
||||
_cameraRotation = cameraRotation.toString();
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var children = <Widget>[];
|
||||
@@ -120,17 +140,11 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
||||
]);
|
||||
} else {
|
||||
if (!_hasViewer) {
|
||||
children.addAll([
|
||||
_item(() {
|
||||
_filamentController!.createViewer();
|
||||
setState(() {
|
||||
_hasViewer = true;
|
||||
});
|
||||
}, "create FilamentViewer")
|
||||
]);
|
||||
children.addAll([_item(_createViewer, "create FilamentViewer")]);
|
||||
} else {
|
||||
children.addAll([
|
||||
_item(() {
|
||||
_cameraTimer?.cancel();
|
||||
_filamentController!.destroy();
|
||||
_filamentController = null;
|
||||
setState(() {
|
||||
@@ -406,6 +420,21 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
||||
top: 50,
|
||||
child: Text(picked ?? "",
|
||||
style: const TextStyle(color: Colors.green, fontSize: 24))),
|
||||
_cameraTimer == null
|
||||
? Container()
|
||||
: Positioned(
|
||||
top: 10,
|
||||
left: 10,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(29)),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
child: Text(
|
||||
"Camera position : $_cameraPosition $_cameraRotation",
|
||||
style:
|
||||
const TextStyle(color: Colors.white, fontSize: 12)))),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: OrientationBuilder(builder: (ctx, orientation) {
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
PODS:
|
||||
- flutter_filament (0.0.1):
|
||||
- FlutterMacOS
|
||||
- FlutterMacOS (1.0.0)
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- flutter_filament (0.0.1):
|
||||
- FlutterMacOS
|
||||
|
||||
DEPENDENCIES:
|
||||
- flutter_filament (from `Flutter/ephemeral/.symlinks/plugins/flutter_filament/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- flutter_filament (from `Flutter/ephemeral/.symlinks/plugins/flutter_filament/macos`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
flutter_filament:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/flutter_filament/macos
|
||||
FlutterMacOS:
|
||||
:path: Flutter/ephemeral
|
||||
path_provider_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||
flutter_filament:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/flutter_filament/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
flutter_filament: e47abb28417d10183c856a132777e3ca08d1551d
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
flutter_filament: 410c2b06ba59f1182e2fa4338b583903631fb95f
|
||||
|
||||
PODFILE CHECKSUM: 9cc8fc8fc62b1d9a89fd6f974ad4157b35254030
|
||||
|
||||
|
||||
@@ -435,14 +435,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.10.0"
|
||||
wasm_ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: wasm_ffi
|
||||
sha256: "5da66560305dd659d62caef535c5314abd9302c122e6eef8681e6879fbbfe358"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user