use decompose/composeMatrix for transforms and add mouse controls for rotation

This commit is contained in:
Nick Fisher
2024-02-03 14:11:02 +08:00
parent 63a52025dd
commit 48a1c6dc0b
10 changed files with 204 additions and 64 deletions

View File

@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:flutter_filament/entities/entity_transform_controller.dart';
///
/// A widget that translates mouse gestures to zoom/pan/rotate actions.
///
class EntityTransformMouseControllerWidget extends StatelessWidget {
final EntityTransformController? transformController;
final Widget? child;
const EntityTransformMouseControllerWidget(
{Key? key, required this.transformController, this.child})
: super(key: key);
@override
Widget build(BuildContext context) {
return Listener(
onPointerHover: (event) {
transformController?.look(event.delta.dx);
},
child: child);
}
}