From 0e3db2635f4e49602405aecf1e551478554a6fcf Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Fri, 20 Sep 2024 14:53:34 +0800 Subject: [PATCH] update bindings --- .../thermion_dart/viewer/ffi/thermion_dart.g.dart | 10 ++++++++++ .../viewer/ffi/thermion_viewer_ffi.dart | 15 +++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_dart.g.dart b/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_dart.g.dart index f6438ff3..09dc272e 100644 --- a/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_dart.g.dart +++ b/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_dart.g.dart @@ -1236,6 +1236,16 @@ external void set_material_property_float4( double4 value, ); +@ffi.Native< + ffi.Void Function( + ffi.Pointer, EntityId, ffi.Int, ffi.Bool)>(isLeaf: true) +external void set_material_depth_write( + ffi.Pointer sceneManager, + int entity, + int materialIndex, + bool enabled, +); + @ffi.Native< ffi.Void Function( ffi.Pointer, diff --git a/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart b/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart index cd2109f2..b32206e2 100644 --- a/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart +++ b/thermion_dart/lib/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart @@ -1947,8 +1947,7 @@ class ThermionViewerFFI extends ThermionViewer { } /// - /// Sets the material property [propertyName] under material [materialIndex] for [entity] to [value]. - /// [entity] must have a Renderable attached. + /// /// Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, int materialIndex, double value) async { @@ -1959,8 +1958,7 @@ class ThermionViewerFFI extends ThermionViewer { } /// - /// Sets the material property [propertyName] under material [materialIndex] for [entity] to {f1,f2,f3,f4}. - /// [entity] must have a Renderable attached. + /// /// Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, int materialIndex, double f1, double f2, double f3, double f4) async { @@ -1975,6 +1973,15 @@ class ThermionViewerFFI extends ThermionViewer { allocator.free(ptr); } + /// + /// + /// + Future setMaterialDepthWrite( + ThermionEntity entity, int materialIndex, bool enabled) { + set_material_depth_write(_sceneManager!, entity, materialIndex, enabled); + return Future.value(); + } + Future unproject(ThermionEntity entity, Uint8List input, int inputWidth, int inputHeight, int outWidth, int outHeight) async { final outPtr = Uint8List(outWidth * outHeight * 4);