update bindings

This commit is contained in:
Nick Fisher
2024-09-20 14:53:34 +08:00
parent 77147cbafd
commit 0e3db2635f
2 changed files with 21 additions and 4 deletions

View File

@@ -1236,6 +1236,16 @@ external void set_material_property_float4(
double4 value,
);
@ffi.Native<
ffi.Void Function(
ffi.Pointer<ffi.Void>, EntityId, ffi.Int, ffi.Bool)>(isLeaf: true)
external void set_material_depth_write(
ffi.Pointer<ffi.Void> sceneManager,
int entity,
int materialIndex,
bool enabled,
);
@ffi.Native<
ffi.Void Function(
ffi.Pointer<ffi.Void>,

View File

@@ -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<Uint8List> unproject(ThermionEntity entity, Uint8List input,
int inputWidth, int inputHeight, int outWidth, int outHeight) async {
final outPtr = Uint8List(outWidth * outHeight * 4);