add clearAssets method to viewer

This commit is contained in:
Nick Fisher
2022-08-14 21:30:58 +10:00
parent 0e38ebc8fc
commit e778c097db
8 changed files with 59 additions and 3 deletions

View File

@@ -194,5 +194,9 @@ extern "C" {
void remove_asset(void* viewer, void* asset) {
((FilamentViewer*)viewer)->removeAsset((SceneAsset*)asset);
}
void clear_assets(void* viewer) {
((FilamentViewer*)viewer)->clearAssets();
}
}

View File

@@ -64,6 +64,8 @@ interface FilamentInterop : Library {
fun remove_asset(viewer:Pointer, asset:Pointer);
fun clear_assets(viewer:Pointer);
fun remove_skybox(viewer:Pointer);
fun remove_ibl(viewer:Pointer);

View File

@@ -331,6 +331,10 @@ PlatformView {
_lib.remove_asset(_viewer!!, Pointer(call.arguments as Long))
result.success("OK");
}
"clearAssets" -> {
_lib.clear_assets(_viewer!!)
result.success("OK");
}
"playAnimation" -> {
val args = call.arguments as ArrayList<Any?>
_lib.play_animation(Pointer(args[0] as Long), args[1] as Int, args[2] as Boolean)