diff --git a/thermion_dart/native/src/ThermionDartFFIApi.cpp b/thermion_dart/native/src/ThermionDartFFIApi.cpp index 041b45f5..a9ca6517 100644 --- a/thermion_dart/native/src/ThermionDartFFIApi.cpp +++ b/thermion_dart/native/src/ThermionDartFFIApi.cpp @@ -432,7 +432,7 @@ extern "C" } EMSCRIPTEN_KEEPALIVE void load_glb_from_buffer_ffi(void *const sceneManager, - const void *const data, + const uint8_t *const data, size_t length, int numInstances, bool keepData, @@ -866,6 +866,7 @@ extern "C" int numIndices, int primitiveType, const char *materialPath, + bool keepData, void (*callback)(EntityId)) { std::packaged_task lambda( @@ -884,4 +885,33 @@ extern "C" auto fut = _rl->add_task(lambda); } + EMSCRIPTEN_KEEPALIVE void create_geometry_with_normals_ffi( + void *const sceneManager, + float *vertices, + int numVertices, + float *normals, + int numNormals, + uint16_t *indices, + int numIndices, + int primitiveType, + const char *materialPath, + bool keepData, + void (*callback)(EntityId)) + { + std::packaged_task lambda( + [=] + { + auto entity = create_geometry_with_normals(sceneManager, vertices, numVertices, normals, numNormals, indices, numIndices, primitiveType, materialPath); + #ifdef __EMSCRIPTEN__ + MAIN_THREAD_EM_ASM({ + moduleArg.dartFilamentResolveCallback($0,$1); + }, callback, entity); + #else + callback(entity); + #endif + return entity; + }); + auto fut = _rl->add_task(lambda); + } + }