update example project with explicit height on FilamentView and add FlightHelmet

This commit is contained in:
Nick Fisher
2022-07-10 17:53:44 +10:00
parent 31f5f2894c
commit e03b332cff

View File

@@ -16,7 +16,6 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
final FilamentController _filamentController = PolyvoxFilamentController(); final FilamentController _filamentController = PolyvoxFilamentController();
int _primitiveIndex = 0;
final weights = List.filled(255, 0.0); final weights = List.filled(255, 0.0);
List<String> _targets = []; List<String> _targets = [];
bool _loop = false; bool _loop = false;
@@ -33,17 +32,17 @@ class _MyAppState extends State<MyApp> {
appBar: AppBar( appBar: AppBar(
title: const Text('Plugin example app'), title: const Text('Plugin example app'),
), ),
body: Stack(children: [ body: Column(children: [
Positioned.fill( SizedBox(
child: FilamentWidget( height:200, width:200,
child:FilamentWidget(
controller: _filamentController, controller: _filamentController,
)), )),
Positioned.fill( Expanded(
child: Wrap( child: Wrap(
alignment: WrapAlignment.end, alignment: WrapAlignment.end,
crossAxisAlignment: WrapCrossAlignment.end, crossAxisAlignment: WrapCrossAlignment.end,
children: [ children: [
ElevatedButton( ElevatedButton(
child: const Text('load skybox'), child: const Text('load skybox'),
onPressed: () async { onPressed: () async {
@@ -55,9 +54,15 @@ class _MyAppState extends State<MyApp> {
child: const Text('load cube'), child: const Text('load cube'),
onPressed: () async { onPressed: () async {
await _filamentController.loadGltf( await _filamentController.loadGltf(
'assets/cube.gltf', 'assets'); 'assets/eloise.gltf' ,"assets");
print(await _filamentController.getAnimationNames()); print(await _filamentController.getAnimationNames());
}), }),
ElevatedButton(
child: const Text('load flight helmet'),
onPressed: () async {
await _filamentController.loadGltf(
'assets/FlightHelmet/FlightHelmet.gltf', 'assets/FlightHelmet');
}),
ElevatedButton( ElevatedButton(
child: const Text('set all weights to 1'), child: const Text('set all weights to 1'),
onPressed: () async { onPressed: () async {