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
|
||||
Future<ThermionAsset> createGeometry(Geometry geometry,
|
||||
{List<MaterialInstance>? materialInstances,
|
||||
bool keepData = false,
|
||||
bool addToScene = true}) async {
|
||||
final asset = await FilamentApp.instance!.createGeometry(
|
||||
geometry, animationManager, materialInstances: materialInstances)
|
||||
as FFIAsset;
|
||||
|
||||
Future<ThermionAsset> createGeometry(
|
||||
Geometry geometry, {
|
||||
List<MaterialInstance>? materialInstances,
|
||||
bool keepData = false,
|
||||
bool addToScene = true,
|
||||
}) async {
|
||||
final asset =
|
||||
await FilamentApp.instance!.createGeometry(
|
||||
geometry,
|
||||
animationManager,
|
||||
materialInstances: materialInstances,
|
||||
)
|
||||
as FFIAsset;
|
||||
_assets.add(asset);
|
||||
if (addToScene) {
|
||||
await scene.add(asset);
|
||||
}
|
||||
|
||||
return asset;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user