track geometry assets internally to ensure they are destroyed when destroyAssets is called
This commit is contained in:
@@ -647,17 +647,24 @@ class ThermionViewerFFI extends ThermionViewer {
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
@override
|
@override
|
||||||
Future<ThermionAsset> createGeometry(Geometry geometry,
|
Future<ThermionAsset> createGeometry(
|
||||||
{List<MaterialInstance>? materialInstances,
|
Geometry geometry, {
|
||||||
bool keepData = false,
|
List<MaterialInstance>? materialInstances,
|
||||||
bool addToScene = true}) async {
|
bool keepData = false,
|
||||||
final asset = await FilamentApp.instance!.createGeometry(
|
bool addToScene = true,
|
||||||
geometry, animationManager, materialInstances: materialInstances)
|
}) async {
|
||||||
as FFIAsset;
|
final asset =
|
||||||
|
await FilamentApp.instance!.createGeometry(
|
||||||
|
geometry,
|
||||||
|
animationManager,
|
||||||
|
materialInstances: materialInstances,
|
||||||
|
)
|
||||||
|
as FFIAsset;
|
||||||
|
_assets.add(asset);
|
||||||
if (addToScene) {
|
if (addToScene) {
|
||||||
await scene.add(asset);
|
await scene.add(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
return asset;
|
return asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user