add hide/reveal entity

This commit is contained in:
Nick Fisher
2023-07-03 22:54:27 +08:00
parent 4adf8bbf80
commit 313fb9bebf
9 changed files with 288 additions and 137 deletions

View File

@@ -459,4 +459,20 @@ class FilamentController {
FilamentEntity asset, double rads, double x, double y, double z) async {
_nativeLibrary.set_rotation(_assetManager, asset, rads, x, y, z);
}
void hide(FilamentEntity asset, String meshName) {
if (_nativeLibrary.hide_mesh(
_assetManager, asset, meshName.toNativeUtf8().cast<Char>()) !=
1) {
throw Exception("Failed to hide mesh $meshName");
}
}
void reveal(FilamentEntity asset, String meshName) {
if (_nativeLibrary.reveal_mesh(
_assetManager, asset, meshName.toNativeUtf8().cast<Char>()) !=
1) {
throw Exception("Failed to unhide mesh $meshName");
}
}
}