diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_asset.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_asset.dart index 78140e9d..54c00bf0 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_asset.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_asset.dart @@ -273,7 +273,7 @@ class FFIAsset extends ThermionAsset { /// /// @override - Future setBoundingBoxVisibility(bool visible) async { + Future getBoundingBoxAsset() async { if (boundingBoxAsset == null) { final boundingBox = await SceneAsset_getBoundingBox(asset); @@ -349,13 +349,12 @@ class FFIAsset extends ThermionAsset { primitiveType: PrimitiveType.LINES, ); - throw UnimplementedError(); - - // boundingBoxAsset = await viewer.createGeometry( - // geometry, - // materialInstances: [material], - // keepData: false, - // ) as FFIAsset; + boundingBoxAsset = await FilamentApp.instance!.createGeometry( + geometry, + animationManager, + materialInstances: [material], + keepData: false, + ) as FFIAsset; await boundingBoxAsset!.setCastShadows(false); await boundingBoxAsset!.setReceiveShadows(false); @@ -363,11 +362,7 @@ class FFIAsset extends ThermionAsset { TransformManager_setParent(Engine_getTransformManager(app.engine), boundingBoxAsset!.entity, entity, false); } - // if (visible) { - // await boundingBoxAsset!.addToScene(); - // } else { - // await boundingBoxAsset!.removeFromScene(); - // } + return boundingBoxAsset!; } Future getMaterialInstanceAt(