Merge branch 'develop' of github.com:nmfisher/polyvox_filament into develop

This commit is contained in:
Nick Fisher
2023-10-28 15:17:32 +08:00

View File

@@ -44,11 +44,14 @@ class ExampleWidget extends StatefulWidget {
class _ExampleWidgetState extends State<ExampleWidget> {
FilamentController? _filamentController;
FilamentEntity? _shapes;
FilamentEntity? _flightHelmet;
List<String>? _animations;
FilamentEntity? _buster;
FilamentEntity? _light;
List<String>? _animations;
StreamSubscription? _pickResultListener;
String? picked;
@@ -356,6 +359,34 @@ class _ExampleWidgetState extends State<ExampleWidget> {
});
_filamentController!.setViewFrustumCulling(_frustumCulling);
}, "${_frustumCulling ? "Disable" : "Enable"} frustum culling"));
children.addAll([
_item(() async {
await Permission.microphone.request();
}, "request permissions (tests inactive->resume)"),
_item(() async {
if (_buster != null) {
await _filamentController!.removeAsset(_buster!);
}
_buster = await (_filamentController as FilamentControllerFFI)
.loadGltf("assets/BusterDrone/scene.gltf", "assets/BusterDrone",
force: true);
await _filamentController!.playAnimation(_buster!, 0, loop: true);
}, "load buster")
]);
}
if (_animations != null) {
children.addAll(_animations!.map((a) => _item(() {
_filamentController!.playAnimation(
_shapes!, _animations!.indexOf(a),
replaceActive: true, crossfade: 0.5, loop: _loop);
}, "play animation ${_animations!.indexOf(a)} (replace/fade)")));
children.addAll(_animations!.map((a) => _item(() {
_filamentController!.playAnimation(
_shapes!, _animations!.indexOf(a),
replaceActive: false, loop: _loop);
}, "play animation ${_animations!.indexOf(a)} (noreplace)")));
}
}
return Stack(children: [