update example web project

This commit is contained in:
Nick Fisher committed 2024-05-21 10:15:15 +08:00
1 parent ece018b7e9
commit 90727e79c5
7 files changed
+4 -78

No files matched your search

@@ -1,25 +0,0 @@
var dart_filament = (() => {
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
if (typeof __filename != 'undefined') _scriptName ||= __filename;
return (
function(moduleArg = {}) {
var moduleRtn;
function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPU8}function GROWABLE_HEAP_I16(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAP16}function GROWABLE_HEAP_U16(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPU16}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPU32}function GROWABLE_HEAP_F32(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPF32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPF64}var Module=Object.assign({},moduleArg);var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});["getExceptionMessage","$incrementExceptionRefcount","$decrementExceptionRefcount","___indirect_function_table","_create_filament_viewer","_create_render_target","_destroy_filament_viewer","_set_background_color","_clear_background_image","_set_background_image","_set_background_image_position","_set_tone_mapping","_set_bloom","_load_skybox","_load_ibl","_rotate_ibl","_remove_skybox","_remove_ibl","_add_light","_remove_light","_clear_lights","_load_glb","_load_glb_from_buffer","_create_instance","_get_instance_count","_get_instances","_load_gltf","_set_main_camera","_get_main_camera","_set_camera","_set_camera_fov","_get_camera_model_matrix","_get_camera_view_matrix","_get_camera_projection_matrix","_get_camera_culling_projection_matrix","_set_camera_projection_matrix","_set_camera_culling","_get_camera_culling_near","_get_camera_culling_far","_get_camera_frustum","_set_camera_manipulator_options","_set_view_frustum_culling","_move_camera_to_asset","_set_camera_focus_distance","_set_camera_exposure","_set_camera_position","_set_camera_rotation","_set_camera_model_matrix","_set_camera_focal_length","_render","_set_frame_interval","_destroy_swap_chain","_create_swap_chain","_update_viewport_and_camera_projection","_scroll_update","_scroll_begin","_scroll_end","_grab_begin","_grab_update","_grab_end","_get_scene_manager","_apply_weights","_set_morph_target_weights","_set_morph_animation","_reset_to_rest_pose","_add_bone_animation","_set_post_processing","_set_antialiasing","_set_bone_transform","_play_animation","_set_animation_frame","_get_animation_duration","_get_animation_count","_get_animation_name","_get_morph_target_name_count","_get_morph_target_name","_remove_entity","_clear_entities","_set_material_color","_transform_to_unit_cube","_set_position","_set_rotation","_set_scale","_queue_position_update","_queue_rotation_update","_stop_animation","_hide_mesh","_reveal_mesh","_filament_pick","_get_name_for_entity","_get_entity_count","_get_entities","_get_entity_name_at","_set_recording","_set_recording_output_directory","_ios_dummy","_flutter_filament_free","_add_collision_component","_remove_collision_component","_add_animation_component","_create_geometry","_find_child_entity_by_name","_set_parent","_test_collisions","_set_priority","_get_gizmo","_create_filament_viewer_ffi","_destroy_filament_viewer_ffi","_create_swap_chain_ffi","_destroy_swap_chain_ffi","_create_render_target_ffi","_update_viewport_and_camera_projection_ffi","_set_rendering_ffi","_set_frame_interval_ffi","_render_ffi","_set_background_color_ffi","_load_gltf_ffi","_load_glb_ffi","_load_glb_from_buffer_ffi","_clear_background_image_ffi","_set_background_image_ffi","_set_background_image_position_ffi","_set_tone_mapping_ffi","_set_bloom_ffi","_load_skybox_ffi","_load_ibl_ffi","_remove_skybox_ffi","_remove_ibl_ffi","_add_light_ffi","_remove_light_ffi","_clear_lights_ffi","_remove_entity_ffi","_clear_entities_ffi","_set_camera_ffi","_get_morph_target_name_ffi","_get_morph_target_name_count_ffi","_play_animation_ffi","_set_animation_frame_ffi","_stop_animation_ffi","_get_animation_count_ffi","_get_animation_name_ffi","_set_post_processing_ffi","_get_name_for_entity_ffi","_set_morph_target_weights_ffi","_set_bone_transform_ffi","_reset_to_rest_pose_ffi","_add_bone_animation_ffi","_ios_dummy_ffi","_create_geometry_ffi","_flutter_filament_web_create_gl_context","___original_main","_flutter_filament_web_load_resource_callback","_flutter_filament_web_set","_flutter_filament_web_set_float","_flutter_filament_web_get_float","_flutter_filament_web_get_double","_flutter_filament_web_set_double","_flutter_filament_web_get_int32","_flutter_filament_web_set_int32","_flutter_filament_web_set_pointer","_flutter_filament_web_get_pointer","_flutter_filament_web_get","_flutter_filament_web_allocate","_flutter_filament_web_get_address","_flutter_filament_web_free","_flutter_filament_web_get_resource_loader_wrapper","_main","onRuntimeInitialized"].forEach(prop=>{if(!Object.getOwnPropertyDescriptor(Line truncated
return moduleRtn;
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = dart_filament;
else if (typeof define === 'function' && define['amd'])
define([], () => dart_filament);
var isPthread = globalThis.self?.name === 'em-pthread';
var isNode = typeof globalThis.process?.versions?.node == 'string';
if (isNode) isPthread = require('worker_threads').workerData === 'em-pthread'
// When running as a pthread, construct a new instance on startup
isPthread && dart_filament();
@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.js
@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.wasm
@@ -1,4 +0,0 @@
// This file is no longer used by emscripten and has been created as a placeholder
// to allow build systems to transition away from depending on it.
//
// Future versions of emscripten will likely stop generating this file at all.
@@ -0,0 +1 @@
../../../../dart_filament/native/web/build/build/out/dart_filament.worker.js
@@ -64,7 +64,6 @@
</head> </head>
<script type="module"> <script type="module">
let dartFilamentResolveCallback = (cb, data) => { let dartFilamentResolveCallback = (cb, data) => {
console.log("Resolving callback");
const fn = window.df.wasmTable.get(cb); const fn = window.df.wasmTable.get(cb);
if(data) { if(data) {
fn(data); fn(data);
@@ -73,7 +72,6 @@
} }
} }
window.createVoidCallback = () => { window.createVoidCallback = () => {
console.log("CREATING VOID CALLBACK IN JS");
let res; //placeholder for resolver callback, outside of promise let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
res = resolve; res = resolve;
@@ -81,7 +79,6 @@
try { try {
const callback = () => { const callback = () => {
try { try {
console.log("INVOKING CALLBACK");
res(0); res(0);
} catch(err) { } catch(err) {
console.log(err); console.log(err);
@@ -94,51 +91,8 @@
return null; return null;
} }
} }
window.createIntCallback = () => { window.createIntCallback = window.createVoidPointerCallback = window.createBoolCallback = () => {
let res;
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createVoidPointerCallback = () => {
let res; //placeholder for resolver callback, outside of promise let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (voidPtr) => {
try {
res(voidPtr);
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createBoolCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
res = resolve; res = resolve;
}); });
@@ -161,7 +161,7 @@ _12790: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12790(f,x0,x1)),
_12791: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12791(f,x0,x1)), _12791: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12791(f,x0,x1)),
_12792: f => finalizeWrapper(f,x0 => dartInstance.exports._12792(f,x0)), _12792: f => finalizeWrapper(f,x0 => dartInstance.exports._12792(f,x0)),
_12793: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12793(f,x0,x1)), _12793: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12793(f,x0,x1)),
_12794: f => finalizeWrapper(f,(x0,x1,x2,x3) => dartInstance.exports._12794(f,x0,x1,x2,x3)), _12794: f => finalizeWrapper(f,(x0,x1,x2,x3,x4) => dartInstance.exports._12794(f,x0,x1,x2,x3,x4)),
_12795: f => finalizeWrapper(f,x0 => dartInstance.exports._12795(f,x0)), _12795: f => finalizeWrapper(f,x0 => dartInstance.exports._12795(f,x0)),
_12796: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12796(f,x0,x1)), _12796: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._12796(f,x0,x1)),
_12797: f => finalizeWrapper(f,x0 => dartInstance.exports._12797(f,x0)), _12797: f => finalizeWrapper(f,x0 => dartInstance.exports._12797(f,x0)),
@@ -251,7 +251,6 @@ _12931: Function.prototype.call.bind(DataView.prototype.getInt16),
_12933: Function.prototype.call.bind(DataView.prototype.getUint32), _12933: Function.prototype.call.bind(DataView.prototype.getUint32),
_12935: Function.prototype.call.bind(DataView.prototype.getInt32), _12935: Function.prototype.call.bind(DataView.prototype.getInt32),
_12941: Function.prototype.call.bind(DataView.prototype.getFloat32), _12941: Function.prototype.call.bind(DataView.prototype.getFloat32),
_12942: Function.prototype.call.bind(DataView.prototype.setFloat32),
_12943: Function.prototype.call.bind(DataView.prototype.getFloat64), _12943: Function.prototype.call.bind(DataView.prototype.getFloat64),
_12962: (x0,x1,x2) => x0[x1] = x2, _12962: (x0,x1,x2) => x0[x1] = x2,
_12964: o => o === undefined, _12964: o => o === undefined,