update example project to allow setting camera to GLB asset camera
This commit is contained in:
@@ -122,6 +122,10 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
|||||||
_animations = await _filamentController.getAnimationNames(_shapes!);
|
_animations = await _filamentController.getAnimationNames(_shapes!);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}, 'load shapes GLB'),
|
}, 'load shapes GLB'),
|
||||||
|
_item(() async {
|
||||||
|
_animations = await _filamentController.setCamera(_shapes!, null);
|
||||||
|
setState(() {});
|
||||||
|
}, 'set camera to first camera in shapes GLB'),
|
||||||
_item(() async {
|
_item(() async {
|
||||||
if (_coneHidden) {
|
if (_coneHidden) {
|
||||||
_filamentController.reveal(_shapes!, "Cone");
|
_filamentController.reveal(_shapes!, "Cone");
|
||||||
@@ -136,8 +140,8 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
|||||||
if (_shapes != null) {
|
if (_shapes != null) {
|
||||||
_filamentController.removeAsset(_shapes!);
|
_filamentController.removeAsset(_shapes!);
|
||||||
}
|
}
|
||||||
_shapes =
|
_shapes = await _filamentController.loadGltf(
|
||||||
await _filamentController.loadGltf('assets/shapes/shapes.gltf', 'assets/shapes');
|
'assets/shapes/shapes.gltf', 'assets/shapes');
|
||||||
}, 'load shapes GLTF'),
|
}, 'load shapes GLTF'),
|
||||||
_item(() async {
|
_item(() async {
|
||||||
_filamentController.transformToUnitCube(_shapes!);
|
_filamentController.transformToUnitCube(_shapes!);
|
||||||
@@ -232,7 +236,8 @@ class _ExampleWidgetState extends State<ExampleWidget> {
|
|||||||
_filamentController.setMorphAnimationData(_shapes!, animation);
|
_filamentController.setMorphAnimationData(_shapes!, animation);
|
||||||
}, "animate shapes morph weights #1 and #2"),
|
}, "animate shapes morph weights #1 and #2"),
|
||||||
_item(() {
|
_item(() {
|
||||||
_filamentController.setMaterialColor(_shapes!, "Cone", 0, Colors.purple);
|
_filamentController.setMaterialColor(
|
||||||
|
_shapes!, "Cone", 0, Colors.purple);
|
||||||
}, "set cone material color to purple"),
|
}, "set cone material color to purple"),
|
||||||
_item(() {
|
_item(() {
|
||||||
_loop = !_loop;
|
_loop = !_loop;
|
||||||
|
|||||||
Reference in New Issue
Block a user