diff --git a/thermion_dart/lib/src/filament/src/asset.dart b/thermion_dart/lib/src/filament/src/asset.dart index 9658caa1..114e2e73 100644 --- a/thermion_dart/lib/src/filament/src/asset.dart +++ b/thermion_dart/lib/src/filament/src/asset.dart @@ -64,6 +64,13 @@ abstract class ThermionAsset { /// Future removeStencilHighlight(); + /// + /// The dimensions of the bounding box for this asset. + /// This is independent of the boundingBoxAsset (which is used to visualize + /// the bounding box in the scene); you do not need to call + /// [createBoundingBoxAsset] before this method. + Future getBoundingBox(); + /// /// The bounding box for this asset, as an actual renderable asset. /// Null by default; call [createBoundingBoxAsset] first to create. @@ -72,9 +79,9 @@ abstract class ThermionAsset { /// /// Creates the renderable bounding box for this asset. - /// This is safe to call multiple times; if [boundingBoxAsset] is non-null, + /// This is safe to call multiple times; if [boundingBoxAsset] is non-null, /// this will simply return the existing bounding box asset. - /// + /// /// You will still need to call [Scene.add] to add this to the scene. /// Future createBoundingBoxAsset(); diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/background_image.dart b/thermion_dart/lib/src/viewer/src/ffi/src/background_image.dart index ee48f7f7..8a16403b 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/background_image.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/background_image.dart @@ -1,5 +1,5 @@ import 'dart:typed_data'; - +import 'package:vector_math/vector_math_64.dart' as v64; import 'package:animation_tools_dart/src/bone_animation_data.dart'; import 'package:animation_tools_dart/src/morph_animation_data.dart'; import 'package:thermion_dart/src/filament/src/layers.dart'; @@ -63,7 +63,7 @@ class BackgroundImage extends ThermionAsset { await mi.setParameterFloat4("backgroundColor", r, g, b, a); } - Future hideImage() async { + Future hideImage() async { await mi.setParameterInt("showImage", 0); } @@ -336,18 +336,21 @@ class BackgroundImage extends ThermionAsset { // TODO: implement transformToUnitCube throw UnimplementedError(); } - + @override - Future getMaterialInstanceAt({ThermionEntity? entity, int index = 0}) { - // TODO: implement getMaterialInstanceAt + Future getMaterialInstanceAt( + {ThermionEntity? entity, int index = 0}) { throw UnimplementedError(); } - + ThermionAsset? get boundingBoxAsset => throw UnimplementedError(); - + @override Future createBoundingBoxAsset() { - // TODO: implement getBoundingBoxAsset + throw UnimplementedError(); + } + + Future getBoundingBox() { throw UnimplementedError(); } } 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 3cf886ad..9bc3a5b2 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 @@ -246,8 +246,14 @@ class FFIAsset extends ThermionAsset { throw UnimplementedError(); } + /// + /// + /// ThermionAsset? boundingBoxAsset; + /// + /// + /// Future getBoundingBox() async { final entities = []; if (RenderableManager_isRenderable(app.renderableManager, entity)) {