Compare commits

...

419 Commits

Author SHA1 Message Date
Nick Fisher
1b971a859c chore(release): publish packages
- thermion_dart@0.2.1-dev.0.0.2
 - thermion_flutter_web@0.1.0+3
 - thermion_flutter_ffi@0.2.1-dev.1
 - thermion_flutter@0.2.1-dev.1
 - thermion_flutter_platform_interface@0.2.1-dev.1
2024-10-02 17:56:55 +08:00
Nick Fisher
78b697d1c2 chore: make pub.dev happy 2024-10-02 17:56:37 +08:00
Nick Fisher
9da2ce6672 chore(release): publish packages
- thermion_dart@0.2.1-dev.0.0.1
 - thermion_flutter_web@0.1.0+2
 - thermion_flutter@0.2.1-dev.0
 - thermion_flutter_platform_interface@0.2.1-dev.0
 - thermion_flutter_ffi@0.2.1-dev.0
2024-10-02 17:55:23 +08:00
Nick Fisher
39fabd501d chore: move swift bindings to test folder to make pub.dev happy 2024-10-02 17:53:31 +08:00
Nick Fisher
3f1867dd6f chore(release): publish packages
- thermion_dart@0.2.1-dev.0.0.0
 - thermion_flutter@0.2.1-dev.0.0.0
 - thermion_flutter_ffi@0.2.1-dev.0.0.0
 - thermion_flutter_platform_interface@0.2.1-dev.0.0.0
 - thermion_flutter_web@0.1.0+1
2024-10-02 17:46:54 +08:00
Nick Fisher
68d29041b0 chore(release): publish packages
- thermion_dart@0.2.0
 - thermion_flutter@0.2.0
 - thermion_flutter_ffi@0.2.0
 - thermion_flutter_platform_interface@0.2.0
 - thermion_flutter_web@0.1.0
2024-10-02 17:41:13 +08:00
Nick Fisher
b300e86962 chore(release): publish packages
- thermion_dart@0.2.0-dev.8.0.0
 - thermion_flutter@0.2.0-dev.8.0.0
 - thermion_flutter_ffi@0.2.0-dev.8.0.0
 - thermion_flutter_platform_interface@0.2.0-dev.8.0.0
 - thermion_flutter_web@0.1.0-dev.8.0.0
2024-10-02 16:50:41 +08:00
Nick Fisher
562ecf2ee5 feat: camera and resizing improvements 2024-10-02 16:47:55 +08:00
Nick Fisher
d294938a2c chore: remove EMSCRIPTEN ifdefs in *RenderThread methods (no longer used) 2024-09-30 18:24:05 +08:00
Nick Fisher
027cf23069 chore: cleanup 2024-09-30 18:20:30 +08:00
Nick Fisher
c4598637bb feat: support multiple ThermionWidget on Android 2024-09-30 18:20:05 +08:00
Nick Fisher
8a94b6a334 feat: use imported texture on iOS 2024-09-30 14:51:11 +08:00
Nick Fisher
c80c163212 feat: working implementation of multiple widgets on macos 2024-09-30 13:45:57 +08:00
Nick Fisher
921a994eb6 refactor: continual refactor to support multiple render targets 2024-09-28 18:28:05 +08:00
Nick Fisher
65e60da288 chore: upgrade Swift interop gen 2024-09-28 17:59:05 +08:00
Nick Fisher
661185083e chore: refactoring and cleanup for Gizmo 2024-09-28 13:24:28 +08:00
Nick Fisher
a2a26555e2 feat: more work on multiple views/swapchains 2024-09-28 11:19:06 +08:00
Nick Fisher
7f11250b79 refactor!: refactor to support multiple Views/Render Targets 2024-09-27 23:16:01 +08:00
Nick Fisher
a6d2f2ecf9 feat!: big refactor to support multiple swapchains 2024-09-27 18:39:20 +08:00
Nick Fisher
399d447eec chore: don't keep superfluous handle to rtDepth and rtColor 2024-09-27 16:40:30 +08:00
Nick Fisher
fb6204e47c chore: cleanup 2024-09-27 15:19:53 +08:00
Nick Fisher
566856c8fb chore: update bindings 2024-09-27 15:13:45 +08:00
Nick Fisher
d29dd207b6 feat: add rendering check to ThermionWidget ticker 2024-09-27 15:13:33 +08:00
Nick Fisher
e20489900d fix!: replace queuePosition/Rotation with queueTransforms 2024-09-27 15:12:43 +08:00
Nick Fisher
567a268ded fix!: replace queuePosition/Rotation with queueTransforms 2024-09-27 15:12:33 +08:00
Nick Fisher
6a57d242f9 feat: add setParameterFloat2 method 2024-09-27 15:12:14 +08:00
Nick Fisher
41e0851d70 feat: add setParameterFloat2 method 2024-09-27 15:12:05 +08:00
Nick Fisher
95b378348c refactor!: remove RenderThread methods no longer needed 2024-09-27 15:11:47 +08:00
Nick Fisher
1309bf7c6e fix!: replace queuePosition/Rotation with queueTransforms 2024-09-27 15:10:13 +08:00
Nick Fisher
2531b507b0 fix!: replace queuePosition/Rotation with queueTransforms 2024-09-27 15:09:49 +08:00
Nick Fisher
16dc0419e2 feat: add uvScale to unlit material 2024-09-27 15:08:30 +08:00
Nick Fisher
4e7ec6bfb4 feat: add ThirdPersonCameraDelegate 2024-09-27 15:06:51 +08:00
Nick Fisher
035ad48fe4 feat!: set baseColorIndex to -1 by default in unlit materialss 2024-09-27 15:06:32 +08:00
Nick Fisher
ff7c582157 chore: update tests 2024-09-27 15:06:02 +08:00
Nick Fisher
0876a91e17 add ThirdPersonCameraDelegate 2024-09-27 15:05:41 +08:00
Nick Fisher
a2d3c1d73e chore: getter for native camera view matrix 2024-09-26 18:49:32 +08:00
Nick Fisher
1a721deee6 more camera work 2024-09-26 18:41:34 +08:00
Nick Fisher
4355d9c83f more camera work 2024-09-26 16:51:14 +08:00
Nick Fisher
239891c400 chore: rearrange library/export structure 2024-09-26 16:35:33 +08:00
Nick Fisher
ac10aa0a1e chore: camera transform tests 2024-09-26 15:56:54 +08:00
Nick Fisher
7ecf414a47 feat: set camera model matrix directly 2024-09-26 15:52:50 +08:00
Nick Fisher
87c96d06a4 chore: rearrange library dirs, gesture handler improvements 2024-09-26 15:52:23 +08:00
Nick Fisher
26a8d9c6b5 chore: import cleanup 2024-09-26 10:48:40 +08:00
Nick Fisher
947a77f619 chore: rearrange flutter gesture/widget directory structure 2024-09-26 10:46:52 +08:00
Nick Fisher
c850513b7f chore: rearrange flutter gesture/widget directory structure 2024-09-26 10:46:10 +08:00
Nick Fisher
c47d827139 chore: rename thermion_flutter src dir 2024-09-26 10:44:47 +08:00
Nick Fisher
a2684ae47d renaming/refactoring and allow creating new cameras 2024-09-25 23:56:25 +08:00
Nick Fisher
2b1339b560 feat: expose more camera methods 2024-09-25 23:09:27 +08:00
Nick Fisher
59aec2bcc9 chore(release): publish packages
- thermion_dart@0.2.0-dev.7.0
 - thermion_flutter_web@0.1.0-dev.7.0
 - thermion_flutter@0.2.0-dev.7.0
 - thermion_flutter_platform_interface@0.2.0-dev.7.0
 - thermion_flutter_ffi@0.2.0-dev.7.0
2024-09-25 22:35:46 +08:00
Nick Fisher
61d1581b96 fix!: fix min SDK for thermion_dart 2024-09-25 22:35:30 +08:00
Nick Fisher
8e47332ce8 chore(release): publish packages
- thermion_dart@0.2.0-dev.6.0
 - thermion_flutter_web@0.1.0-dev.6.0
 - thermion_flutter@0.2.0-dev.6.0
 - thermion_flutter_platform_interface@0.2.0-dev.6.0
 - thermion_flutter_ffi@0.2.0-dev.6.0
2024-09-25 21:58:28 +08:00
Nick Fisher
ffe8bee98b chore!: cleanup deleted export 2024-09-25 21:58:19 +08:00
Nick Fisher
1e07486017 chore(release): publish packages
- thermion_flutter@0.2.0-dev.6.0
2024-09-25 21:57:38 +08:00
Nick Fisher
58da196876 chore!: remove superseded HardwareKeyboard* classes 2024-09-25 21:56:16 +08:00
Nick Fisher
78af155a6d chore(release): publish packages
- thermion_dart@0.2.0-dev.5.0
 - thermion_flutter_web@0.1.0-dev.5.0
 - thermion_flutter@0.2.0-dev.5.0
 - thermion_flutter_platform_interface@0.2.0-dev.5.0
 - thermion_flutter_ffi@0.2.0-dev.5.0
2024-09-25 21:52:58 +08:00
Nick Fisher
d7e1b3d7ba chore!: remove EntityTransformController (requires replacement) 2024-09-25 21:52:42 +08:00
Nick Fisher
877eae35cd chore(release): publish packages
- thermion_dart@0.2.0-dev.4.0
 - thermion_flutter_web@0.1.0-dev.4.0
 - thermion_flutter@0.2.0-dev.4.0
 - thermion_flutter_platform_interface@0.2.0-dev.4.0
 - thermion_flutter_ffi@0.2.0-dev.4.0
2024-09-25 21:51:19 +08:00
Nick Fisher
87846b68de fix!: (web/wasm) free pick callbacks on dispose 2024-09-25 21:50:31 +08:00
Nick Fisher
6581ee8a2a chore!: restructure viewer folders as libraries to only export the public interface 2024-09-25 21:49:15 +08:00
Nick Fisher
951064e657 chore(release): publish packages
- thermion_flutter@0.2.0-dev.3.0
2024-09-25 21:20:54 +08:00
Nick Fisher
68ebf945a5 chore: add path to dev deps 2024-09-25 21:20:34 +08:00
Nick Fisher
153817e859 chore!: (flutter) cleanup for pub.dev publishing 2024-09-25 21:20:04 +08:00
Nick Fisher
ba0bc54fa7 fix!: remove EntityControllerMouseWidget (replace with GestureHandler) 2024-09-25 21:19:41 +08:00
Nick Fisher
9b99975017 chore(release): publish packages
- thermion_flutter@0.2.0-dev.2.0
2024-09-25 21:18:00 +08:00
Nick Fisher
e6a6862ba4 chore: (flutter) web packaging fixes (use logger) 2024-09-25 21:17:38 +08:00
Nick Fisher
b7d3e9191a chore: (flutter) web packaging fixes 2024-09-25 21:17:20 +08:00
Nick Fisher
b461b2c5db chore: (flutter) web packaging fixes 2024-09-25 21:17:09 +08:00
Nick Fisher
8f7f48bcaa chore: (flutter) add package:web to flutter deps 2024-09-25 21:16:48 +08:00
Nick Fisher
7dc8e394f7 chore!: remove EntityListWidget - will replace with new Scene 2024-09-25 21:16:24 +08:00
Nick Fisher
f5c8faa5c3 chore(release): publish packages
- thermion_dart@0.2.0-dev.1.0
 - thermion_flutter@0.2.0-dev.1.0
 - thermion_flutter_ffi@0.2.0-dev.1.0
 - thermion_flutter_platform_interface@0.2.0-dev.1.0
 - thermion_flutter_web@0.1.0-dev.1.0
2024-09-25 21:06:28 +08:00
Nick Fisher
c84b4010d1 Merge pull request #68 from nmfisher/improvements
Improvements
2024-09-25 21:02:53 +08:00
Nick Fisher
b720c1294f rename Android plugin class in pubspec.yaml 2024-09-25 19:27:38 +08:00
Nick Fisher
d442ab5ce6 add namespace for build.gradle 2024-09-25 19:27:19 +08:00
Nick Fisher
61fdf300f4 add namespace for AndroidManifest.xml 2024-09-25 19:27:04 +08:00
Nick Fisher
4dabca9160 rename Android package/paths 2024-09-25 19:26:51 +08:00
Nick Fisher
85d6946645 (flutter) provide nicer implementation of FixedOrbitCameraRotationDelegate 2024-09-25 19:26:19 +08:00
Nick Fisher
4b1d8ce729 (flutter) update FreeFlight camera delegate 2024-09-24 14:24:29 +08:00
Nick Fisher
c52b0084ce add PickDelegate to DelegateGestureHandler 2024-09-24 14:21:13 +08:00
Nick Fisher
8db725d8bd add PICK_ENTITY to GestureAction 2024-09-24 14:20:49 +08:00
Nick Fisher
c67d1cbbc4 add background color tests 2024-09-24 14:20:33 +08:00
Nick Fisher
3ea4062e33 normalize direction in addLight 2024-09-24 14:20:14 +08:00
Nick Fisher
65e99b9212 set clearOptions to true 2024-09-23 13:51:18 +08:00
Nick Fisher
e83193ba0d introduce stronger native typing, camera projection/culling methods, update tests 2024-09-21 11:36:41 +08:00
Nick Fisher
835338ef63 (flutter) use scheduleFrameCallback to invoke requestFrame to match Flutter/vsync 2024-09-21 10:22:49 +08:00
Nick Fisher
57872d2e40 rename from *FFI to *RenderThread, return bool from render() to check frame timings, update render loop to wait on condition variable, add requestFrame() method 2024-09-21 10:21:46 +08:00
Nick Fisher
b5a7996769 add Dart Camera type 2024-09-21 10:18:36 +08:00
Nick Fisher
ddbb4ec5c6 rename CameraPtr to TCamera and use named arguments for setCameraLensProjection 2024-09-20 18:31:20 +08:00
Nick Fisher
7cb3080596 move MaterialInstance methods to own class 2024-09-20 18:18:08 +08:00
Nick Fisher
f6c91294aa rename setLayerEnabled to setLayerVisibility, add setVisibilityLayer method 2024-09-20 17:34:17 +08:00
Nick Fisher
412d333525 add PickDelegate 2024-09-20 14:54:18 +08:00
Nick Fisher
378dede02d add ThermionPickResult typedef 2024-09-20 14:53:48 +08:00
Nick Fisher
0e3db2635f update bindings 2024-09-20 14:53:34 +08:00
Nick Fisher
77147cbafd add setMaterialDepthWrite method 2024-09-20 14:53:16 +08:00
Nick Fisher
43e5fd7766 add setMaterialDepthWrite method 2024-09-20 14:53:06 +08:00
Nick Fisher
fc3ca3d6b3 update tests 2024-09-20 14:08:47 +08:00
Nick Fisher
51f52bb71b update stub 2024-09-20 14:08:26 +08:00
Nick Fisher
033c3f632d add createUnlitMaterialInstance, setMaterialPropertyInt methods to viewer interface 2024-09-20 14:08:16 +08:00
Nick Fisher
6d862ef36a update bindings 2024-09-20 14:07:37 +08:00
Nick Fisher
f816274fb9 replace some async methods with futures, fix setMaterialProperty4, update unproject, setMaterialPropertyInt, createUnlitMaterialInstance 2024-09-20 14:07:09 +08:00
Nick Fisher
0816286696 export geometry from thermion_dart 2024-09-20 14:05:14 +08:00
Nick Fisher
b421df5e2f remove image.mat from LFS 2024-09-20 14:04:59 +08:00
Nick Fisher
f6a136643d remove image.mat from LFS 2024-09-20 14:04:43 +08:00
Nick Fisher
b5e278183a update built unlit material 2024-09-20 14:04:27 +08:00
Nick Fisher
8e85042e37 remove old default paramsf rom UnlitMaterialProvider 2024-09-20 14:04:11 +08:00
Nick Fisher
f943756624 add setMaterialProperty for int, add create_unlit_material_instance, use double4 instead of float4 2024-09-20 14:03:50 +08:00
Nick Fisher
92814aed56 add setMaterialProperty for int, add create_unlit_material_instance 2024-09-20 14:03:29 +08:00
Nick Fisher
e8a1b976e1 set default layer for loadGlb to 0,. add setMaterialProperty for int, add SceneManager::createUnlitMaterialInstance 2024-09-20 14:02:30 +08:00
Nick Fisher
ef48dbce30 add base color/texture to unlit 2024-09-20 14:01:59 +08:00
Nick Fisher
196cc6b980 set default layer for loadGlb to 0,. add setMaterialProperty for int 2024-09-20 14:01:41 +08:00
Nick Fisher
1788c74d4c change float4 to double4 2024-09-20 14:01:02 +08:00
Nick Fisher
74e808d1dc update tests 2024-09-19 21:10:42 +08:00
Nick Fisher
72dacc5b21 update unproject texture to accept input texture 2024-09-19 21:10:28 +08:00
Nick Fisher
ebdaf65b89 update unproject texture to accept input texture 2024-09-19 21:10:22 +08:00
Nick Fisher
fa43149c98 update unproject texture to accept input texture 2024-09-19 21:10:10 +08:00
Nick Fisher
e8ae7193ee update unproject texture to accept input texture 2024-09-19 21:09:23 +08:00
Nick Fisher
aa21c0fb76 don't call clearBackgroundImage when setBackgroundImage is called (would deadlock) 2024-09-19 21:08:55 +08:00
Nick Fisher
10826466a4 set default material for geometry to baseColorIndex 0 2024-09-19 17:08:06 +08:00
Nick Fisher
3b2d7d8c47 depth pre-pass when projecting texture 2024-09-19 16:59:01 +08:00
Nick Fisher
212443cb8e add spot constructor 2024-09-19 13:44:17 +08:00
Nick Fisher
523141d54b add test cube texture image 2024-09-19 13:02:51 +08:00
Nick Fisher
d8a0859f16 update test 2024-09-19 13:00:40 +08:00
Nick Fisher
c70cc9abb5 add image methods to test helper 2024-09-19 12:53:44 +08:00
Nick Fisher
66b626e605 update showcase 2024-09-19 12:53:30 +08:00
Nick Fisher
4b28119318 test updates 2024-09-19 12:52:27 +08:00
Nick Fisher
666506aed0 widget updates 2024-09-19 12:52:16 +08:00
Nick Fisher
a55f63a428 increase min Dart SDK to 3.5 for .address FFI accessors 2024-09-19 12:51:30 +08:00
Nick Fisher
fb441e151c update ffigen with new headers 2024-09-19 12:51:09 +08:00
Nick Fisher
82d85386c0 fixes for createMaterialInstance 2024-09-19 12:50:57 +08:00
Nick Fisher
242b2f6faa gesture detector fixes 2024-09-19 09:19:23 +08:00
Nick Fisher
31d31dd583 ThermionViewer: add create/destroy materialinstance, add MaterialInstance property to createGeometry, priority/layer to loadGlbFromBuffer 2024-09-19 09:17:45 +08:00
Nick Fisher
f6077012b1 widget cleanup 2024-09-19 09:16:45 +08:00
Nick Fisher
18bb45dcd8 use TMaterialInstance for FFI API, add priority/layer params to load_glb_from_buffer 2024-09-19 09:16:06 +08:00
Nick Fisher
10b919e4f4 add priority/layer to FFI viewer, use struct for model matrix, add createUbershaderMaterialInstance and destroyMaterialInstance 2024-09-19 09:15:31 +08:00
Nick Fisher
98cedf821c update bindings 2024-09-19 09:14:10 +08:00
Nick Fisher
729f72e768 use SceneManager::LAYERS enum for Overlay, set priority/layer in loadGlbFromBuffer, add create/destroy material instance 2024-09-19 09:12:57 +08:00
Nick Fisher
d01861e949 use SceneManager::LAYERS enum for Overlay 2024-09-19 09:12:16 +08:00
Nick Fisher
adec48f253 use SceneManager::LAYERS enum for gizmo 2024-09-19 09:12:02 +08:00
Nick Fisher
27a8ce18d5 add priority/layer to load_glb_from_buffer 2024-09-19 09:11:40 +08:00
Nick Fisher
4b740a9f5a native types, add create/destroy material instance, add SceneManager::LAYERS enum 2024-09-19 09:11:20 +08:00
Nick Fisher
0b34b4546e refactor: native types 2024-09-19 09:10:24 +08:00
Nick Fisher
c17919cd97 refactor: native types 2024-09-19 09:09:42 +08:00
Nick Fisher
462f1f02bf refactor: move native types to own header, add methods for create/destroy material instance, add priority/layer to load_glb_from_buffer 2024-09-19 09:09:16 +08:00
Nick Fisher
ddc433a126 refactor: Dart types 2024-09-19 09:07:35 +08:00
Nick Fisher
ab649e860d update gitattr 2024-09-16 20:51:27 +08:00
Nick Fisher
676ddc3773 add texture methods (including unproject) 2024-09-16 20:51:14 +08:00
Nick Fisher
7d2cf3f91b don't store gizmo material in LFS 2024-09-16 11:25:21 +08:00
Nick Fisher
492d41d756 test update 2024-09-16 11:24:24 +08:00
Nick Fisher
191c2fd709 restructure viewer/types/helper folders, remove old WASM/web FFI interop, add SceneUpdated stream 2024-09-16 11:08:27 +08:00
Nick Fisher
027fc9ae04 update tests 2024-09-16 11:08:19 +08:00
Nick Fisher
b73d0e1e96 restructure viewer/types/helper folders, remove old WASM/web FFI interop, add SceneUpdated stream 2024-09-16 11:07:54 +08:00
Nick Fisher
315f2b63b9 gesture handler & delegate improvements 2024-09-13 18:32:02 +08:00
Nick Fisher
ad205679cb allow setting material property by name 2024-09-13 15:27:46 +08:00
Nick Fisher
6ef8d19e94 (flutter) export delegate gesture handler 2024-09-13 15:27:20 +08:00
Nick Fisher
6b0f25ca59 remove using namespace filament* 2024-09-13 15:27:01 +08:00
Nick Fisher
820d341f67 update bindings 2024-09-13 15:26:44 +08:00
Nick Fisher
70f904d54c allow setting material property by name 2024-09-13 15:20:45 +08:00
Nick Fisher
aee607908d remove using namespace filament* 2024-09-13 15:18:01 +08:00
Nick Fisher
c99c57e24d geometry receives/casts shadows by default 2024-09-13 14:52:20 +08:00
Nick Fisher
00d75be479 gesture handler improvements 2024-09-13 14:25:10 +08:00
Nick Fisher
3a9bd31919 remove superseded desktop/mobile gesture detector widget 2024-09-13 13:47:26 +08:00
Nick Fisher
51be1bce39 add pan camera implementation and fix velocity timer 2024-09-13 13:46:41 +08:00
Nick Fisher
822b8e14c1 add delegate-based implementations for gesture handlers 2024-09-13 13:30:00 +08:00
Nick Fisher
2ab30a7933 remove double sided from HighlightOverlay material 2024-09-13 11:09:09 +08:00
Nick Fisher
1be8a5e862 adjust gizmo size 2024-09-13 11:08:49 +08:00
Nick Fisher
98d61fa1b3 fix setCameraModelMatrix4 2024-09-13 10:36:24 +08:00
Nick Fisher
5b3d16a316 update bindings 2024-09-13 10:36:07 +08:00
Nick Fisher
b6863828b4 initialize viewportDimensions to (0,0) in ThermionViewer 2024-09-13 10:35:57 +08:00
Nick Fisher
98fefd0e52 fix winding order in GeometryHelper 2024-09-13 10:35:33 +08:00
Nick Fisher
d476d78e2b reduce size of gizmo 2024-09-13 10:35:13 +08:00
Nick Fisher
98113fb79f remove logging 2024-09-13 10:34:59 +08:00
Nick Fisher
90827ff012 culling fixes for HighlightOverlay 2024-09-13 10:34:47 +08:00
Nick Fisher
44078ba2e0 add v2 gesture handlers 2024-09-13 10:34:23 +08:00
Nick Fisher
866219ee2e add v2 gesture handlers 2024-09-13 10:34:12 +08:00
Nick Fisher
d785bd6b7e chore!: rename controller to viewer in gesture detector widgets 2024-09-12 08:54:07 +08:00
Nick Fisher
3e4e6653a8 update material building in Makefile 2024-09-11 23:09:56 +08:00
Nick Fisher
8d250e2664 update test 2024-09-11 23:09:41 +08:00
Nick Fisher
d455cea29e use opaque CameraPtr to set camera matrices/properties/etc 2024-09-11 23:09:27 +08:00
Nick Fisher
374e8eb910 rename getBoundingBox to getViewportBoundingBox and add camera methods 2024-09-11 23:08:07 +08:00
Nick Fisher
833fc74b4c rename getBoundingBox to getViewportBoundingBox 2024-09-11 23:07:47 +08:00
Nick Fisher
62417bfebd explicitly mark type of Camera for Gizmo 2024-09-11 23:07:29 +08:00
Nick Fisher
abc9ecbeee use opaque CameraPtr to set camera matrices/properties/etc 2024-09-11 23:07:03 +08:00
Nick Fisher
a1f71ab459 remove camera methods from FilamentViewer 2024-09-11 23:06:32 +08:00
Nick Fisher
d123929fb4 remove camera methods from FilamentViewer 2024-09-11 23:06:06 +08:00
Nick Fisher
141827c59c use opaque CameraPtr to set camera matrices/properties/etc 2024-09-11 23:05:40 +08:00
Nick Fisher
9fbcc9edaf mark all ffigen functions as leaf 2024-09-11 23:04:57 +08:00
Nick Fisher
83d9c5be30 remove update_viewport_and_camera_projection_ffi 2024-09-11 23:04:36 +08:00
Nick Fisher
6aadbbc3d0 remove update_viewport_and_camera_projection_ffi 2024-09-11 23:04:27 +08:00
Nick Fisher
d5bc865cf4 add matrix helper 2024-09-11 23:04:02 +08:00
Nick Fisher
d766733489 update stubbed ThermionViewer methods 2024-09-11 23:03:53 +08:00
Nick Fisher
f51c640d17 remove unused get_camera_position method 2024-09-11 20:01:21 +08:00
Nick Fisher
66f10b598a update stub ThermionViewer 2024-09-11 19:59:43 +08:00
Nick Fisher
59957650aa update bindings 2024-09-11 19:59:33 +08:00
Nick Fisher
d43fbd8964 add loadGlbFromBuffer implementation to ThermionViewerFFI 2024-09-11 19:59:25 +08:00
Nick Fisher
f5de4349bf add createGeometryWithNormals to SceneManager 2024-09-11 18:09:42 +08:00
Nick Fisher
f67e1a021d add createGeometryWithNormals to SceneManager 2024-09-11 18:09:14 +08:00
Nick Fisher
33f2c5fbf7 add normals to CustomGeometry implementation 2024-09-11 18:08:48 +08:00
Nick Fisher
6a7bde930d add normals to CustomGeometry interface 2024-09-11 18:08:35 +08:00
Nick Fisher
b827a2142b HighlightOverlay fixes 2024-09-11 18:08:13 +08:00
Nick Fisher
8bd2416bad don't set stencil highlight in Gizmo 2024-09-11 18:07:38 +08:00
Nick Fisher
3684eb248c add create_geometry_with_normals method 2024-09-11 18:07:17 +08:00
Nick Fisher
9077632d1b add create_geometry_with_normals method 2024-09-11 18:07:07 +08:00
Nick Fisher
d40261ae29 add create_geometry_with_normals_ffi method, switch load_glb_from_buffer type to uint8_t for Dart leaf compat and add keepData param 2024-09-11 18:06:50 +08:00
Nick Fisher
77dbb574c7 add create_geometry_with_normals_ffi method, switch load_glb_from_buffer type to uint8_t for Dart leaf compat and add keepData param 2024-09-11 18:06:31 +08:00
Nick Fisher
89a660144e update test helpers 2024-09-11 18:05:36 +08:00
Nick Fisher
7554af5d41 (flutter) add experimental GestureHandler widget and decouple from ThermionGestureDetectorDesktop 2024-09-11 18:05:24 +08:00
Nick Fisher
4b742fea2d (flutter) add experimental GestureHandler widget and decouple from ThermionGestureDetectorDesktop 2024-09-11 18:05:18 +08:00
Nick Fisher
a6c6cff8b6 add loadGlbFromBuffer method and normals param to ThermionViewer 2024-09-11 18:04:36 +08:00
Nick Fisher
5813753ef9 (flutter) set enablePicking to false by default in ThermionGestureDetector 2024-09-11 18:03:52 +08:00
Nick Fisher
cf0dad2631 (flutter) add const FlutterWebOptions 2024-09-11 18:03:29 +08:00
Nick Fisher
cfddb99a8b (flutter) add CameraOrientationWidget 2024-09-11 18:01:45 +08:00
Nick Fisher
845d5bf223 (flutter) add const constructor for flutter options 2024-09-11 18:01:33 +08:00
Nick Fisher
dbbd972909 add GeometryHelper 2024-09-11 17:54:21 +08:00
Nick Fisher
aba3ba24af (flutter) add CameraOrientationWidget 2024-09-11 17:54:08 +08:00
Nick Fisher
81c27dde9f feat: parent the cloned entity instance when setting stencil highlight 2024-09-08 13:55:25 +08:00
Nick Fisher
476b552fd0 feat: add getAncestor method 2024-09-08 13:52:33 +08:00
Nick Fisher
5c4d5d4b9d feat: add getAncestor method 2024-09-08 13:52:04 +08:00
Nick Fisher
ae5ef2c286 update bindings 2024-09-07 18:01:39 +08:00
Nick Fisher
b0f3c8a087 feat: set stencil highlight on gizmo attach 2024-09-07 18:01:30 +08:00
Nick Fisher
43fc7ffc65 update tests 2024-09-07 18:01:03 +08:00
Nick Fisher
ee24fca20e feat: move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector and removeStencilHighlight 2024-09-07 18:00:50 +08:00
Nick Fisher
a00fdbe042 chore: remove createGeometry method from FilamentViewer, set default view blend mode 2024-09-07 17:59:55 +08:00
Nick Fisher
c2eb28a8f5 fix: properly destroy entities/material/etc in Gizmo on destruction, remove custom scene creation logic 2024-09-07 17:59:03 +08:00
Nick Fisher
4c6c20f3de feat: move HighlightOverlay to nested class, move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector 2024-09-07 17:57:38 +08:00
Nick Fisher
b2ae8135c6 feat: add removeStencilHighlight, accept color param for setStencilHighlight, queuePositionUpdateFromViewportCoords to ThermionDartApi 2024-09-07 17:55:40 +08:00
Nick Fisher
aecde97200 feat: add removeStencilHighlight, queuePositionUpdateFromViewportCoords to ThermionViewer 2024-09-07 17:54:42 +08:00
Nick Fisher
331caccc22 chore: delete old unlit_opaque material 2024-09-07 17:54:12 +08:00
Nick Fisher
63e2b74bb1 chore: rebuild unlit material 2024-09-07 17:53:55 +08:00
Nick Fisher
433f03161c feat: add scale parameter to unlit material 2024-09-07 17:53:41 +08:00
Nick Fisher
6ec84b6249 fix: add Fence to capture() and set stencil buffer by default 2024-09-06 13:03:51 +08:00
Nick Fisher
29b6a48816 test: add test cube.glb 2024-09-06 12:44:54 +08:00
Nick Fisher
00755fd417 chore: remove old materials Makefile 2024-09-06 12:44:40 +08:00
Nick Fisher
9c5156e41a feat: add flag for keepData for gltf instancing, add highlightScene, add stencilHighlight method 2024-09-06 12:36:16 +08:00
Nick Fisher
226c45ee2e chore: minor widget fixes 2024-09-05 22:22:25 +08:00
Nick Fisher
e04390b2fe feat: add grid material 2024-09-05 22:21:19 +08:00
Nick Fisher
9a87eb4d9b feat: allow passing null options to ThermionWidget 2024-09-05 22:21:09 +08:00
Nick Fisher
2284d9d081 feat: grid uses own material 2024-09-05 22:20:27 +08:00
Nick Fisher
cf61369a8d chore: clean up old commented code 2024-09-05 22:20:11 +08:00
Nick Fisher
4e14bd2396 fix: ignore pick results directly on axis 2024-09-05 22:19:54 +08:00
Nick Fisher
0798d5c071 feat: add grid material 2024-09-05 22:19:27 +08:00
Nick Fisher
80d5b1d23f feat: expose setLightDirection and setLightPosition 2024-09-05 22:18:54 +08:00
Nick Fisher
0bd87288d1 chore: update binding 2024-09-05 17:53:24 +08:00
Nick Fisher
51e06c2eb9 chore: (js) stub missing methods 2024-09-05 17:52:53 +08:00
Nick Fisher
b29663923d chore: (wasm) add missing interop methods 2024-09-05 17:52:40 +08:00
Nick Fisher
f57a323cda feat: (flutter) (web) if importCanvasAsWidget is false, render transparency 2024-09-05 17:52:19 +08:00
Nick Fisher
03ffe85113 chore: stub ThermionWidget methods 2024-09-05 17:51:36 +08:00
Nick Fisher
4edc8aa85b feat: (flutter) move DPR calculation to resizeTexture and add createViewerWithOptions method to ThermionFlutterFFI 2024-09-05 17:51:22 +08:00
Nick Fisher
04ecb4d56f fix: (flutter) pass ThermionFlutterOptions to ThermionWidget, use dpr for resizeTexture, delete unnecessary TransparencyPainter class 2024-09-05 17:49:02 +08:00
Nick Fisher
0ac0a92024 feat: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated 2024-09-05 17:47:54 +08:00
Nick Fisher
ae1e14ddb7 feat: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated 2024-09-05 17:47:41 +08:00
Nick Fisher
aa246ab63a feat: (flutter) (web) use options to determine whether to create canvas, and set fixed position + offset 2024-09-05 17:45:49 +08:00
Nick Fisher
d4350d7d99 test: update viewport gizmo test 2024-09-05 17:44:18 +08:00
Nick Fisher
f07fe6084a chore: (flutter) export platform interface from thermion_flutter package 2024-09-05 17:43:58 +08:00
Nick Fisher
4e29055a20 chore: stub new methods 2024-09-05 17:43:35 +08:00
Nick Fisher
6d0c06a853 doc: pixelRatio 2024-09-05 17:43:19 +08:00
Nick Fisher
abe6e1fcb8 feat: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture 2024-09-05 17:43:04 +08:00
Nick Fisher
683105c4f7 fix: emscripten export visibility for add_light 2024-09-05 17:42:17 +08:00
Nick Fisher
6f2331582c chore: use float instead of float32_t in FilamentViewer 2024-09-05 17:41:55 +08:00
Nick Fisher
f0f97e310c chore: add nested PickCallbackHandler to Gizmo 2024-09-05 17:41:24 +08:00
Nick Fisher
2331f2c31a chore: update Makefile to add missing headers to resgen files 2024-08-27 21:51:29 +08:00
Nick Fisher
704b7f6734 fix: (flutter/web) use window.devicePixelRatio for viewport 2024-08-27 21:51:09 +08:00
Nick Fisher
7ac7ae43ab fix: (wasm) use correct coords for pick, free memory correctly, keep pixelratio copy 2024-08-27 21:50:07 +08:00
Nick Fisher
d52b23d6b5 fix: (flutter) desktop gesture detector changes for new Gizmo methods 2024-08-27 21:49:28 +08:00
Nick Fisher
8b17916cd9 chore: Dart Gizmo class cleanup 2024-08-27 21:49:04 +08:00
Nick Fisher
4a0f4e3ac8 feat: add setGizmoVisibility/pickGizmo methods to ThermionViewer 2024-08-27 21:48:27 +08:00
Nick Fisher
85116f43a2 feat: remove gizmo view references, exclude gizmo entities from picking, add createIbl 2024-08-27 21:47:56 +08:00
Nick Fisher
3ecb8920ea feat: createIbl 2024-08-27 21:47:02 +08:00
Nick Fisher
8923d97129 chore: init SceneManager pointers to nullptr 2024-08-27 21:46:47 +08:00
Nick Fisher
375e1cc887 fix: add more nan checks for gizmo manipulation 2024-08-27 21:46:21 +08:00
Nick Fisher
78dcbc8bb9 feat: expose API methods for create_ibl, pick/set gizmo visibility 2024-08-27 21:45:49 +08:00
Nick Fisher
a3f7b98bf7 feat: create transparent overlay for gizmo for easier picking 2024-08-27 21:45:19 +08:00
Nick Fisher
12b61e8767 feat: rescale gizmo based on distance from camera 2024-08-27 16:54:40 +08:00
Nick Fisher
0e3b014c2c feat: rescale gizmo based on distance from camera 2024-08-27 16:50:54 +08:00
Nick Fisher
10db8c39f3 fix: add check for nan NDC coordinates for viewport translation 2024-08-25 21:54:08 +08:00
Nick Fisher
371bcb3706 fix stub methods 2024-08-24 16:28:12 +08:00
Nick Fisher
714c575409 add implementations to JS bridge/shim classes 2024-08-24 16:26:05 +08:00
Nick Fisher
c0941e3b7f add missing methods to wasm viewer 2024-08-24 16:25:37 +08:00
Nick Fisher
026acb7467 feat: highlight gizmo on hover 2024-08-24 16:25:17 +08:00
Nick Fisher
3c05cc6a43 add implementations to FFI viewer 2024-08-24 16:24:59 +08:00
Nick Fisher
f1a2926bdf fix!: (flutter) pass pixelRatio to createTexture 2024-08-24 16:24:06 +08:00
Nick Fisher
88e8a138ac (flutter) (web) initialize viewer to 1x1 then resize on createTexture 2024-08-24 16:23:54 +08:00
Nick Fisher
53d0301828 feat!: (flutter) (web) upgrade package:web dep to 1.0.0 2024-08-24 16:23:00 +08:00
Nick Fisher
b10fec1963 fix!: (flutter) pass pixelRatio to createTexture 2024-08-24 16:22:31 +08:00
Nick Fisher
08e1eb7778 feat: expose setLayerEnabled, viewportDimensions and getCameraFov on ThermionView 2024-08-24 16:22:12 +08:00
Nick Fisher
d6713c090c stub out new methods 2024-08-24 16:21:35 +08:00
Nick Fisher
497ecbf881 fix!: (flutter) pass pixelRatio to createTexture 2024-08-24 16:20:06 +08:00
Nick Fisher
6f7d03737e fix!: (flutter) pass pixelRatio to createTexture 2024-08-24 16:19:50 +08:00
Nick Fisher
ad60c6bbe1 chore: update bindings 2024-08-24 16:19:07 +08:00
Nick Fisher
92fdda722b chore: add viewport test 2024-08-24 16:18:53 +08:00
Nick Fisher
3cc876f972 feat: layers, grid 2024-08-24 16:18:23 +08:00
Nick Fisher
7d1e706045 feat: layers, grid 2024-08-24 16:18:12 +08:00
Nick Fisher
11756fcedd feat: ignore grid overlay and gizmo center when picking, implement highlighting 2024-08-24 16:17:34 +08:00
Nick Fisher
2e1f2cd56d feat: SceneManager updates (setLayer, add grid, queueRelativePositionUpdateWorld 2024-08-24 16:02:54 +08:00
Nick Fisher
c08611b2c3 feat: expose set_layer_enabled, get_camera_fov and queue_relative_position_updateg_world_axis to ThermionDartApi.h 2024-08-24 16:02:06 +08:00
Nick Fisher
f87f89427d feat: add getCameraFov to FilamentViewer 2024-08-24 16:01:03 +08:00
Nick Fisher
c3319ebbf3 feat: add new grid overlay files to web CmakeLists 2024-08-24 16:00:15 +08:00
Nick Fisher
f7b765c5d0 chore: rebuild materials 2024-08-24 15:59:55 +08:00
Nick Fisher
9512b74008 fix: update material output path in Makefile 2024-08-24 15:59:36 +08:00
Nick Fisher
5a3517f953 add grid overlay 2024-08-24 15:59:04 +08:00
Nick Fisher
731c4981c9 use inactive/active color gizmo 2024-08-24 15:58:49 +08:00
Nick Fisher
8f20a8a859 chore: don't use shader to overlay gizmo 2024-08-24 15:21:36 +08:00
Nick Fisher
7693a0fe14 feat: re-implement (native) Gizmo class, expose preserveScaling parameter for setParent, add methods for getting viewport bounding box from renderable entity 2024-08-22 18:04:06 +08:00
Nick Fisher
98c3676fdf fix: (web) add emscripten guards for flushAndWait call when swapchain destroyed 2024-08-21 17:18:37 +08:00
Nick Fisher
d7664a9746 feat!: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML) 2024-08-21 17:17:58 +08:00
Nick Fisher
d868fd6970 feat: add capture() function and expose viewportDimensions on ThermionViewer (allows easier saving of captured images to PNG) 2024-08-21 14:33:48 +08:00
Nick Fisher
300396b97e feat: (web) allow table growth in emscripten module for passing C-style callback function pointers 2024-08-21 14:30:17 +08:00
Nick Fisher
1d8faa70a1 feat: (web) add capture() method and missing camera navigation controls 2024-08-21 14:29:40 +08:00
Nick Fisher
1051b1bb0e feat!: resize canvas on web 2024-08-17 11:43:43 +08:00
Nick Fisher
c367824041 feat!: update web/http dependencies 2024-08-17 11:43:03 +08:00
Nick Fisher
81cedf0d43 feat: download WASM module directly on web (no need to embed in index.html any more) and expose updateViewportAndCameraProjection 2024-08-17 11:42:25 +08:00
Nick Fisher
16c6203b97 feat: add startOffset parameter to gltf playAnimation 2024-07-29 16:13:45 +08:00
Nick Fisher
b7c0eeb7b4 chore(release): publish packages
- thermion_dart@0.1.3
 - thermion_flutter_ffi@0.1.0+12
 - thermion_flutter_web@0.0.3
 - thermion_flutter_platform_interface@0.1.0+11
 - thermion_flutter@0.1.1+13
2024-07-23 09:40:05 +08:00
Nick Fisher
fd31b4dcad docs: rename examples to showcase 2024-07-23 09:38:26 +08:00
Nick Fisher
41bf9ededa feat: add clearMorphAnimationData function 2024-07-23 09:38:26 +08:00
Hannes Hultergård
d745712650 Add example files that can be parsed by pub.dev 2024-07-23 09:38:26 +08:00
Nick Fisher
1df732be7c chore(release): publish packages
- thermion_flutter_ffi@0.1.0+11
 - thermion_flutter@0.1.1+12
2024-07-23 09:38:26 +08:00
Nick Fisher
8b413eca52 fix: add logging dependency 2024-07-23 09:38:25 +08:00
Nick Fisher
3597077d39 chore(release): publish packages
- thermion_dart@0.1.2
 - thermion_flutter_ffi@0.1.0+10
 - thermion_flutter_web@0.0.2
 - thermion_flutter@0.1.1+11
 - thermion_flutter_platform_interface@0.1.0+10
2024-07-23 09:38:25 +08:00
Nick Fisher
7704a06601 fix: manually remove leading slash for compiler path on Windows when building for Android 2024-07-23 09:38:25 +08:00
Paul Ampadu
7b3ad027bf Update quickstart.mdx 2024-07-23 09:38:25 +08:00
Nick Fisher
cde3af08aa fix: web/JS bool checks need to compare to int 2024-07-23 09:38:25 +08:00
Nick Fisher
7418fb867d feat: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths 2024-07-23 09:38:25 +08:00
Nick Fisher
ce71e09f65 fix: shadow JS<->WASM bridge methods 2024-07-23 09:38:25 +08:00
Nick Fisher
5dec13f00b chore(release): publish packages
- thermion_dart@0.1.1+5
 - thermion_flutter_web@0.0.1+9
 - thermion_flutter@0.1.1+10
 - thermion_flutter_platform_interface@0.1.0+9
 - thermion_flutter_ffi@0.1.0+9
2024-07-04 14:44:04 +08:00
Nick Fisher
7464c05483 Merge pull request #55 from nmfisher/develop
feat: shadows, web, docs, image material
2024-07-04 16:42:25 +10:00
Nick Fisher
7b97b2e6c3 save fetched resources to IndexedDB on web 2024-07-04 14:19:37 +08:00
Nick Fisher
168f46cf56 add shadow methods to wasm/js viewers 2024-07-04 14:19:04 +08:00
Nick Fisher
5622b0ce9f chore(release): publish packages
- thermion_dart@0.1.1+4
 - thermion_flutter_web@0.0.1+8
 - thermion_flutter@0.1.1+9
 - thermion_flutter_platform_interface@0.1.0+8
 - thermion_flutter_ffi@0.1.0+8
2024-07-02 16:18:17 +08:00
Nick Fisher
c7a0b2f5cc fix: defer creating image entity/material/etc until actually requested
feat: expose shadow options
2024-07-02 16:17:36 +08:00
Nick Fisher
7546b2a6c5 Merge pull request #51 from payl-ampa/patch-1
Update quickstart.mdx - Simple link fix
2024-06-30 16:15:39 +10:00
Paul Ampadu
e363c82f2d Update quickstart.mdx
Simple link fix
2024-06-29 00:13:59 -07:00
Nick Fisher
b9643dbd94 Merge pull request #49 from nmfisher/develop
docs: Update docs
2024-06-28 00:03:18 +10:00
Nick Fisher
2664e08eb3 update README 2024-06-27 21:57:23 +08:00
Nick Fisher
733ba7d439 docs: add discord link 2024-06-27 21:52:34 +08:00
Nick Fisher
2255be3a86 Merge pull request #48 from nmfisher/develop
docs: update docs
2024-06-27 23:47:10 +10:00
Nick Fisher
03f8e2e353 docs: update docs 2024-06-27 21:46:06 +08:00
Nick Fisher
be1bf3f3ca Merge pull request #47 from nmfisher/develop
docs: update docs with sidebar links
2024-06-27 23:36:22 +10:00
Nick Fisher
5f1334660e docs: update docs with sidebar links 2024-06-27 21:35:44 +08:00
Nick Fisher
ec381f43ef Merge pull request #46 from nmfisher/develop
Documentation
2024-06-27 23:16:10 +10:00
Nick Fisher
eba843535b docs: update quickstart 2024-06-27 21:15:13 +08:00
Nick Fisher
4fa286bd60 docs: update links 2024-06-27 21:14:23 +08:00
Nick Fisher
7293b0f8dd Merge pull request #45 from nmfisher/develop
Documentation
2024-06-27 23:13:20 +10:00
Nick Fisher
0279ee1985 doc: update head README 2024-06-27 21:12:16 +08:00
Nick Fisher
83053c60f9 Merge pull request #44 from nmfisher/develop
Merge develop
2024-06-27 23:10:51 +10:00
Nick Fisher
ad28e5484c chore(release): publish packages
- thermion_dart@0.1.1+3
 - thermion_flutter@0.1.1+8
 - thermion_flutter_web@0.0.1+7
 - thermion_flutter_platform_interface@0.1.0+7
 - thermion_flutter_ffi@0.1.0+7
2024-06-27 21:06:46 +08:00
Nick Fisher
b91d629b90 docs: update homepage links and minor documentation updates 2024-06-27 21:05:44 +08:00
Nick Fisher
96df3a0f35 chore: remove binary filamat files from repo 2024-06-26 15:50:22 +10:00
Nick Fisher
de8fb5e2d0 docs: remove old GETTING_STARTED and update quickstart with new repo link 2024-06-26 15:49:11 +10:00
Nick Fisher
51d79c7626 fix: bump ffigen dependency version & regenerate bindings (and revert to ffi.Int rather than ffi.Int32) 2024-06-26 12:46:56 +08:00
Nick Fisher
f7c22d2480 docs: update quickstart 2024-06-26 12:46:56 +08:00
Nick Fisher
b117a4a19c chore: move examples to separate repository 2024-06-26 12:46:56 +08:00
Nick Fisher
4955837518 chore(release): publish packages
- thermion_dart@0.1.1+2
 - thermion_flutter@0.1.1+7
 - thermion_flutter_ffi@0.1.0+6
 - thermion_flutter_platform_interface@0.1.0+6
 - thermion_flutter_web@0.0.1+6
2024-06-26 00:12:32 +08:00
Nick Fisher
0e9cf76592 chore(release): publish packages
- thermion_dart@0.1.1-dev.0+2
 - thermion_flutter@0.1.1-dev.0+7
 - thermion_flutter_platform_interface@0.1.0-dev.0+6
 - thermion_flutter_web@0.0.1-dev.0+6
 - thermion_flutter_ffi@0.1.0-dev.0+6
2024-06-26 00:10:56 +08:00
Nick Fisher
368a341b76 docs: update custom native_toolchain ref for Windows 2024-06-26 01:59:06 +10:00
Nick Fisher
5cc41a9115 docs: update 2024-06-26 01:58:35 +10:00
Nick Fisher
368ce83380 rename thermion_filament namespace to thermion_flutter for Windows 2024-06-26 01:51:31 +10:00
Nick Fisher
683b79c9a0 fix: add ResourceBuffer header directly to Windows build so I don't have to fiddle around getting the CMake path right 2024-06-26 01:50:53 +10:00
Nick Fisher
81be5e25f7 fix: revert to std::thread (pthreads not easily available on Windows) 2024-06-26 01:50:22 +10:00
Nick Fisher
e8e1684694 fix: on Windows, pass static libs via -l rather than custom linkWith property so build.dart stays compatible between published & custom versions 2024-06-26 01:49:37 +10:00
Nick Fisher
d13ecde7b6 update Windows docs 2024-06-26 01:48:08 +10:00
Nick Fisher
08c3af405e Merge pull request #43 from nmfisher/develop
Develop
2024-06-25 21:16:31 +10:00
Nick Fisher
0571f3e653 docs: add Android & Windows pages 2024-06-25 19:04:18 +08:00
Nick Fisher
f351512a78 Merge pull request #42 from Hannnes1/license
Add root LICENSE file
2024-06-25 10:48:00 +10:00
Hannes Hultergård
315b898d7c Add root LICENSE file 2024-06-24 08:28:42 +02:00
Nick Fisher
c635bd3813 chore(release): publish packages
- thermion_dart@0.1.1+1
 - thermion_flutter@0.1.1+6
 - thermion_flutter_web@0.0.1+5
 - thermion_flutter_platform_interface@0.1.0+5
 - thermion_flutter_ffi@0.1.0+5
2024-06-22 10:29:41 +08:00
Nick Fisher
b4f9a5c2af docs: update with links to playground 2024-06-22 10:29:08 +08:00
Nick Fisher
0222ba2d6c chore(release): publish packages
- thermion_dart@0.1.1
2024-06-21 17:18:43 +08:00
Nick Fisher
a066df55f9 chore(release): publish packages
- thermion_dart@0.1.0+4
 - thermion_flutter_web@0.0.1+4
 - thermion_flutter_platform_interface@0.1.0+4
 - thermion_flutter@0.1.1+5
 - thermion_flutter_ffi@0.1.0+4
2024-06-21 16:52:19 +08:00
Nick Fisher
aa85dcfa20 fix: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host 2024-06-21 16:52:10 +08:00
Nick Fisher
a3370a775f chore(release): publish packages
- thermion_dart@0.1.0+3
 - thermion_flutter_web@0.0.1+3
 - thermion_flutter@0.1.1+4
 - thermion_flutter_platform_interface@0.1.0+3
 - thermion_flutter_ffi@0.1.0+3
2024-06-21 16:21:02 +08:00
Nick Fisher
b889fddcfa fix: exit build.dart early on Linux builds so we can use the package on a Linux host 2024-06-21 16:20:42 +08:00
Nick Fisher
090c36c92b chore(release): publish packages
- thermion_dart@0.1.0+2
 - thermion_flutter_ffi@0.1.0+2
 - thermion_flutter_web@0.0.1+2
 - thermion_flutter@0.1.1+3
 - thermion_flutter_platform_interface@0.1.0+2
2024-06-21 15:24:19 +08:00
Nick Fisher
9eb2285433 refactor: rearrange some stubs/imports for easier web WASM deployment 2024-06-21 15:20:08 +08:00
Nick Fisher
c28c518057 chore(release): publish packages
- thermion_flutter@0.1.1+2
2024-06-21 14:09:24 +08:00
Nick Fisher
81ffbdd824 fix: update Flutter example project to use new API
fix: don't keep example project Podfile.lock in repo
2024-06-21 11:46:25 +08:00
Nick Fisher
55b5c7068e fix: add logging dependency to thermion_flutter 2024-06-21 11:30:23 +08:00
Nick Fisher
78a758f5d4 chore(release): publish packages
- thermion_dart@0.1.0+1
 - thermion_flutter@0.1.1+1
 - thermion_flutter_web@0.0.1+1
 - thermion_flutter_platform_interface@0.1.0+1
 - thermion_flutter_ffi@0.1.0+1
2024-06-21 11:26:34 +08:00
Nick Fisher
fd19fc1c68 fix: use preserveDrawingBuffer=true on web
using createImageFromImageBitmap to import the canvas directly into a Flutter app results in flickering unless this is set to true (as the drawing buffer is otherwise cleared after each render, which may not line up with Flutter's ticker
2024-06-21 11:19:16 +08:00
Nick Fisher
cc3020c268 remove dependency_overrides 2024-06-21 11:19:16 +08:00
Nick Fisher
6902c27d02 fix: catch exception if gizmo unavailable in ThermionGestureDestectorDesktop 2024-06-21 11:19:16 +08:00
Nick Fisher
0ec7e2af95 refactor: export ThermionViewerWasm for web and hide FFI/WASM version 2024-06-21 11:19:16 +08:00
Nick Fisher
c6c918907a rename web interop classes 2024-06-21 11:19:16 +08:00
Nick Fisher
d3891e481e fix log dir creation in build.dart 2024-06-21 11:19:16 +08:00
Nick Fisher
563ffd2902 Merge branch 'develop' of github.com:nmfisher/thermion into develop 2024-06-21 11:18:33 +08:00
Nick Fisher
2ce5cb1f62 Merge pull request #41 from Hannnes1/feature/melos
Add melos
2024-06-21 02:08:34 +10:00
Hannes
842c6b1581 Remove unnecessary files from git 2024-06-20 09:07:53 +02:00
Hannes
b833b2d288 Add melos 2024-06-19 15:47:00 +02:00
Nick Fisher
013730b108 destroy existing texture if it exists but size does match requested dimensions when createTexture is called 2024-06-19 16:39:10 +08:00
Nick Fisher
846f45bb63 don't destroy dummy image texture if clearBackgroundImage has been called without setBackgroundImage having been called first 2024-06-19 16:38:14 +08:00
Nick Fisher
735612af66 bump pubspec dependency versions 2024-06-19 13:39:43 +08:00
Nick Fisher
e823083e86 update quickstart to use new API 2024-06-19 13:32:40 +08:00
Nick Fisher
ae15f2114e update quickstart iOS project 2024-06-19 13:32:16 +08:00
Nick Fisher
cb17bf0ffd increment version number for thermion_flutter 2024-06-19 13:32:03 +08:00
Nick Fisher
84101b457f add onDispose() implementations for web viewers 2024-06-19 13:31:09 +08:00
Nick Fisher
aefedf8c00 CHANGELOG 2024-06-19 13:24:08 +08:00
Nick Fisher
ab793387bc use Unmanaged.passRetained rather than passUnretained for ThermionDartTexture 2024-06-19 13:21:47 +08:00
Nick Fisher
534e5b46a8 (Swift/macos) dont make ThermionFlutterTexture inherit from ThermionDartTexture; reuse render callbacks/resource loader functions; add check for concurrent calls to destroyTexture 2024-06-19 13:20:04 +08:00
Nick Fisher
3468e7da55 dont make ThermionFlutterTexture inherit from ThermionDartTexture 2024-06-19 13:19:04 +08:00
Nick Fisher
1f58717635 only require ThermionViewer to be passed to ThermionWidget 2024-06-19 13:17:11 +08:00
Nick Fisher
7dc0e91e6b fix RenderLoop to use (C) ResourceLoaderWrapper and destroy RL when viewer is destroyed 2024-06-19 13:16:33 +08:00
Nick Fisher
49b8e7023b free all resources in FilamentViewer destructor 2024-06-19 13:15:36 +08:00
Nick Fisher
a455e4f88a construct (C++) ResourceLoaderWrapperImpl from (C) ResourceLoaderWrapper 2024-06-19 13:13:36 +08:00
Nick Fisher
3785580b01 free all resources in SceneManager 2024-06-19 13:12:28 +08:00
Nick Fisher
6cfa86fe75 make ResourceBuffer.hpp C++ only and add constructor to create from C struct 2024-06-19 13:11:01 +08:00
Nick Fisher
dc70909715 move Scene class to own file and add dispose() method 2024-06-19 13:04:34 +08:00
Nick Fisher
89f49f98c4 replace print with Logger 2024-06-19 13:01:20 +08:00
Nick Fisher
025e39318d add implementation for onDispose to ThermionViewerFFI 2024-06-19 12:59:16 +08:00
Nick Fisher
cfa7805970 add onDispose method to ThermionViewer to register callbacks on disposal 2024-06-19 12:57:49 +08:00
Nick Fisher
31e68df1c5 make ThermionFlutterPlugin static, remove dispose() and add internal listener for ThermionViewer.onDispose 2024-06-19 12:57:16 +08:00
Nick Fisher
8e75555540 use C header for ResourceBuffer in Swift bridging 2024-06-19 12:52:58 +08:00
Nick Fisher
c8fa220362 remove dispose()/viewer getter from platform interface, rename initialize to createViewer 2024-06-19 12:52:39 +08:00
Nick Fisher
8e892a1f23 log to file for build.dart, check for SUCCESS token 2024-06-19 12:51:39 +08:00
Nick Fisher
ee8769b7d7 use C header for ResourceBuffer in Swift bridging 2024-06-19 12:50:29 +08:00
Nick Fisher
7ecf097861 reduce quickstart Dart SDK min version 2024-06-18 16:29:53 +08:00
Nick Fisher
4f4be9b7d7 rename Flutter method channels 2024-06-18 16:29:19 +08:00
Nick Fisher
338fe3bb9f Merge branch 'master' into develop 2024-06-17 14:49:02 +08:00
Nick Fisher
04b1498cd9 Merge pull request #39 from 1l0/fix-link
Fix broken links
2024-06-17 16:48:44 +10:00
Nick Fisher
1d3dab88d1 bump pubspec version 2024-06-17 14:48:13 +08:00
1l0
ec16f97023 fix link 2024-06-17 15:36:57 +09:00
Nick Fisher
436b978537 rename/export Flutter widgets 2024-06-17 13:19:24 +08:00
672 changed files with 57289 additions and 166145 deletions

5
.gitattributes vendored
View File

@@ -36,7 +36,7 @@ thermion_dart/native/lib/macos/debug/libmatlang.a filter=lfs diff=lfs merge=lfs
thermion_dart/native/lib/macos/debug/libibl.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/debug/libmikktspace.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/libmatdbg_combined.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/swift/ThermionDartTexture.h filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/swift/ThermionTexture.h filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/debug/libfilamat_combined.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/debug/libfilament.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/macos/libibl.a filter=lfs diff=lfs merge=lfs -text
@@ -153,10 +153,7 @@ thermion_dart/native/lib/ios/libibl-lite.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/ios/libimageio.a filter=lfs diff=lfs merge=lfs -text
materials/Makefile filter=lfs diff=lfs merge=lfs -text
materials/gizmo.filamat filter=lfs diff=lfs merge=lfs -text
materials/gizmo.mat filter=lfs diff=lfs merge=lfs -text
materials/image.filamat filter=lfs diff=lfs merge=lfs -text
materials/image.mat filter=lfs diff=lfs merge=lfs -text
materials/unlit_fade.mat filter=lfs diff=lfs merge=lfs -text
materials/unlit_opaque.mat filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/android/arm64-v8a/libktxreader.a filter=lfs diff=lfs merge=lfs -text
thermion_dart/native/lib/android/armeabi-v7a/libcamutils.a filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored
View File

@@ -7,3 +7,6 @@
.DS_Store
**/*/build
**/*/pubspec.lock
pubspec_overrides.yaml
/pubspec.lock
*.iml

792
CHANGELOG.md Normal file
View File

@@ -0,0 +1,792 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2024-10-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.2.1-dev.0.0.2`](#thermion_dart---v021-dev002)
- [`thermion_flutter_web` - `v0.1.0+3`](#thermion_flutter_web---v0103)
- [`thermion_flutter_ffi` - `v0.2.1-dev.1`](#thermion_flutter_ffi---v021-dev1)
- [`thermion_flutter` - `v0.2.1-dev.1`](#thermion_flutter---v021-dev1)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.1`](#thermion_flutter_platform_interface---v021-dev1)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.1.0+3`
- `thermion_flutter_ffi` - `v0.2.1-dev.1`
- `thermion_flutter` - `v0.2.1-dev.1`
- `thermion_flutter_platform_interface` - `v0.2.1-dev.1`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.2`
## 2024-10-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.2.1-dev.0.0.1`](#thermion_dart---v021-dev001)
- [`thermion_flutter_web` - `v0.1.0+2`](#thermion_flutter_web---v0102)
- [`thermion_flutter` - `v0.2.1-dev.0`](#thermion_flutter---v021-dev0)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.0`](#thermion_flutter_platform_interface---v021-dev0)
- [`thermion_flutter_ffi` - `v0.2.1-dev.0`](#thermion_flutter_ffi---v021-dev0)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.1.0+2`
- `thermion_flutter` - `v0.2.1-dev.0`
- `thermion_flutter_platform_interface` - `v0.2.1-dev.0`
- `thermion_flutter_ffi` - `v0.2.1-dev.0`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.1`
## 2024-10-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.2.1-dev.0.0.0`](#thermion_dart---v021-dev000)
- [`thermion_flutter` - `v0.2.1-dev.0.0.0`](#thermion_flutter---v021-dev000)
- [`thermion_flutter_ffi` - `v0.2.1-dev.0.0.0`](#thermion_flutter_ffi---v021-dev000)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.0.0.0`](#thermion_flutter_platform_interface---v021-dev000)
- [`thermion_flutter_web` - `v0.1.0+1`](#thermion_flutter_web---v0101)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.1.0+1`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.0`
- y
#### `thermion_flutter` - `v0.2.1-dev.0.0.0`
- y
#### `thermion_flutter_ffi` - `v0.2.1-dev.0.0.0`
- y
#### `thermion_flutter_platform_interface` - `v0.2.1-dev.0.0.0`
- y
## 2024-10-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.2.0`](#thermion_dart---v020)
- [`thermion_flutter` - `v0.2.0`](#thermion_flutter---v020)
- [`thermion_flutter_ffi` - `v0.2.0`](#thermion_flutter_ffi---v020)
- [`thermion_flutter_platform_interface` - `v0.2.0`](#thermion_flutter_platform_interface---v020)
- [`thermion_flutter_web` - `v0.1.0`](#thermion_flutter_web---v010)
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `thermion_dart` - `v0.2.0`
- `thermion_flutter` - `v0.2.0`
- `thermion_flutter_ffi` - `v0.2.0`
- `thermion_flutter_platform_interface` - `v0.2.0`
- `thermion_flutter_web` - `v0.1.0`
---
#### `thermion_dart` - `v0.2.0`
#### `thermion_flutter` - `v0.2.0`
#### `thermion_flutter_ffi` - `v0.2.0`
#### `thermion_flutter_platform_interface` - `v0.2.0`
#### `thermion_flutter_web` - `v0.1.0`
## 2024-10-02
### Changes
---
Packages with breaking changes:
- [`thermion_dart` - `v0.2.0-dev.8.0.0`](#thermion_dart---v020-dev800)
- [`thermion_flutter_ffi` - `v0.2.0-dev.8.0.0`](#thermion_flutter_ffi---v020-dev800)
Packages with other changes:
- [`thermion_flutter` - `v0.2.0-dev.8.0.0`](#thermion_flutter---v020-dev800)
- [`thermion_flutter_platform_interface` - `v0.2.0-dev.8.0.0`](#thermion_flutter_platform_interface---v020-dev800)
- [`thermion_flutter_web` - `v0.1.0-dev.8.0.0`](#thermion_flutter_web---v010-dev800)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.1.0-dev.8.0.0`
---
#### `thermion_dart` - `v0.2.0-dev.8.0.0`
- **REFACTOR**: continual refactor to support multiple render targets.
- **FEAT**: camera and resizing improvements.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: use imported texture on iOS.
- **FEAT**: working implementation of multiple widgets on macos.
- **FEAT**: more work on multiple views/swapchains.
- **FEAT**: add setParameterFloat2 method.
- **FEAT**: add setParameterFloat2 method.
- **FEAT**: add uvScale to unlit material.
- **FEAT**: add ThirdPersonCameraDelegate.
- **FEAT**: set camera model matrix directly.
- **FEAT**: expose more camera methods.
- **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets.
- **BREAKING** **REFACTOR**: remove RenderThread methods no longer needed.
- **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms.
- **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms.
- **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms.
- **BREAKING** **FIX**: replace queuePosition/Rotation with queueTransforms.
- **BREAKING** **FEAT**: big refactor to support multiple swapchains.
- **BREAKING** **FEAT**: set baseColorIndex to -1 by default in unlit materialss.
#### `thermion_flutter_ffi` - `v0.2.0-dev.8.0.0`
- **REFACTOR**: continual refactor to support multiple render targets.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: use imported texture on iOS.
- **FEAT**: working implementation of multiple widgets on macos.
- **BREAKING** **REFACTOR**: refactor to support multiple Views/Render Targets.
- **BREAKING** **FEAT**: big refactor to support multiple swapchains.
#### `thermion_flutter` - `v0.2.0-dev.8.0.0`
- **REFACTOR**: continual refactor to support multiple render targets.
- **FEAT**: camera and resizing improvements.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: use imported texture on iOS.
- **FEAT**: working implementation of multiple widgets on macos.
- **FEAT**: add rendering check to ThermionWidget ticker.
#### `thermion_flutter_platform_interface` - `v0.2.0-dev.8.0.0`
- **REFACTOR**: continual refactor to support multiple render targets.
- **FEAT**: support multiple ThermionWidget on Android.
- **FEAT**: working implementation of multiple widgets on macos.
# Change Log
v0.2.0
- **BREAKING** Dart SDK 3.6.0 required
- **BREAKING** Libraries have been restructured so you should only need to import `package:thermion_dart/thermion_dart.dart`, `package:thermion_flutter/thermion_flutter.dart`
- **BREAKING** The former GestureDetector widgets and EntityControllerMouseWidget/EntityTransformController have been removed and replaced with ThermionListenerWidget. that accepts an InputHandler.
- **BREAKING** The former debugging widgets and Scene class have been removed.
- **REFACTOR** The creation of the main camera has been refactored; the default projection & near/far planes should not have changed, but pay close attention.
- **REFACTOR**: add methods for create/destroy material instance, add priority/layer to load_glb_from_buffer.
- **FEAT**: Translation gizmo, stencil highlight & overlays.
- **FEAT**: new setLightDirection and setLightPosition.
- **FEAT**: move HighlightOverlay to nested class, move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector.
- **FEAT**: move createGeometry to SceneManager, add queueRelativePositionUpdateFromViewportVector and removeStencilHighlight.
- **FEAT**: add setGizmoVisibility/pickGizmo methods to ThermionViewer.
- **FEAT**: remove gizmo view references, exclude gizmo entities from picking, add createIbl.
- **FEAT**: set stencil highlight on gizmo attach.
- **FEAT**: add getAncestor method.
- **FEAT**: expose API methods for create_ibl, pick/set gizmo visibility.
- **FEAT**: create transparent overlay for gizmo for easier picking.
- **FEAT**: rescale gizmo based on distance from camera.
- **FEAT**: rescale gizmo based on distance from camera.
- **FEAT**: add getAncestor method.
- **FEAT**: add startOffset parameter to gltf playAnimation.
- **FEAT**: layers, grid.
- **FEAT**: layers, grid.
- **FEAT**: ignore grid overlay and gizmo center when picking, implement highlighting.
- **FEAT**: SceneManager updates (setLayer, add grid, queueRelativePositionUpdateWorld.
- **FEAT**: expose set_layer_enabled, get_camera_fov and queue_relative_position_updateg_world_axis to ThermionDartApi.h.
- **FEAT**: add getCameraFov to FilamentViewer.
- **FEAT**: add new grid overlay files to web CmakeLists.
- **FEAT**: re-implement (native) Gizmo class, expose preserveScaling parameter for setParent, add methods for getting viewport bounding box from renderable entity.
- **FEAT**: expose setLayerEnabled, viewportDimensions and getCameraFov on ThermionView.
- **FEAT**: download WASM module directly on web (no need to embed in index.html any more) and expose updateViewportAndCameraProjection.
- **FEAT**: add capture() function and expose viewportDimensions on ThermionViewer (allows easier saving of captured images to PNG).
- **FEAT**: (web) allow table growth in emscripten module for passing C-style callback function pointers.
- **FEAT**: (web) add capture() method and missing camera navigation controls.
- **FEAT**: createIbl.
- **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML).
- **BREAKING** **FEAT**: update web/http dependencies.
- **FIX**: (flutter) pass ThermionFlutterOptions to ThermionWidget, use dpr for resizeTexture, delete unnecessary TransparencyPainter class.
- **FIX**: (flutter/web) use window.devicePixelRatio for viewport.
- **FIX**: (flutter) desktop gesture detector changes for new Gizmo methods.
- **FEAT**: allow passing null options to ThermionWidget.
- **FEAT**: (flutter) (web) if importCanvasAsWidget is false, render transparency.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: highlight gizmo on hover.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML).
- **BREAKING** **FEAT**: resize canvas on web.
- **BREAKING** **CHORE**: rename controller to viewer in gesture detector widgets.
- **FEAT**: (flutter) move DPR calculation to resizeTexture and add createViewerWithOptions method to ThermionFlutterFFI.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **FEAT**: add createViewerWithOptions to ThermionFlutterPlugin and mark createViewer as deprecated.
- **FEAT**: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture.
- **BREAKING** **FIX**: (flutter) pass pixelRatio to createTexture.
- **FIX**: (flutter/web) use window.devicePixelRatio for viewport.
- **FEAT**: (flutter) (web) use options to determine whether to create canvas, and set fixed position + offset.
- **FEAT**: add ThermionFlutterOptions classes, rename interface parameter for offsetTop and ensure pixelRatio is passed to resizeTexture.
- **BREAKING** **FEAT**: (flutter) (web) upgrade package:web dep to 1.0.0.
- **BREAKING** **FEAT**: (web) (flutter) create canvas when createViewer is called (no longer need to manually add canvas element to web HTML).
- **BREAKING** **FEAT**: resize canvas on web.
## v0.1.3
- **FIX**: manually remove leading slash for compiler path on Windows when building for Android.
- **FIX**: web/JS bool checks need to compare to int.
- **FIX**: shadow JS<->WASM bridge methods.
- **FIX**: manually remove leading slash for compiler path on Windows when building for Android.
- **FIX**: web/JS bool checks need to compare to int.
- **FIX**: shadow JS<->WASM bridge methods.
- **FEAT**: add clearMorphAnimationData function.
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
#### `thermion_flutter_ffi` - `v0.1.0+12`
- **FIX**: add logging dependency.
- **FIX**: web/JS bool checks need to compare to int.
- **FIX**: add logging dependency.
- **FIX**: web/JS bool checks need to compare to int.
#### `thermion_flutter_web` - `v0.0.3`
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
## 2024-07-11
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_flutter_ffi` - `v0.1.0+11`](#thermion_flutter_ffi---v01011)
- [`thermion_flutter` - `v0.1.1+12`](#thermion_flutter---v01112)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter` - `v0.1.1+12`
---
#### `thermion_flutter_ffi` - `v0.1.0+11`
- **FIX**: add logging dependency.
## 2024-07-11
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.2`](#thermion_dart---v012)
- [`thermion_flutter_ffi` - `v0.1.0+10`](#thermion_flutter_ffi---v01010)
- [`thermion_flutter_web` - `v0.0.2`](#thermion_flutter_web---v002)
- [`thermion_flutter` - `v0.1.1+11`](#thermion_flutter---v01111)
- [`thermion_flutter_platform_interface` - `v0.1.0+10`](#thermion_flutter_platform_interface---v01010)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter` - `v0.1.1+11`
- `thermion_flutter_platform_interface` - `v0.1.0+10`
---
#### `thermion_dart` - `v0.1.2`
- **FIX**: manually remove leading slash for compiler path on Windows when building for Android.
- **FIX**: web/JS bool checks need to compare to int.
- **FIX**: shadow JS<->WASM bridge methods.
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
#### `thermion_flutter_ffi` - `v0.1.0+10`
- **FIX**: web/JS bool checks need to compare to int.
#### `thermion_flutter_web` - `v0.0.2`
- **FEAT**: allow passing assetPathPrefix to ThermionViewerWasm to account for Flutter build asset paths.
## 2024-07-04
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1+5`](#thermion_dart---v0115)
- [`thermion_flutter_web` - `v0.0.1+9`](#thermion_flutter_web---v0019)
- [`thermion_flutter` - `v0.1.1+10`](#thermion_flutter---v01110)
- [`thermion_flutter_platform_interface` - `v0.1.0+9`](#thermion_flutter_platform_interface---v0109)
- [`thermion_flutter_ffi` - `v0.1.0+9`](#thermion_flutter_ffi---v0109)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+9`
- `thermion_flutter` - `v0.1.1+10`
- `thermion_flutter_platform_interface` - `v0.1.0+9`
- `thermion_flutter_ffi` - `v0.1.0+9`
---
#### `thermion_dart` - `v0.1.1+5`
- Bump "thermion_dart" to `0.1.1+5`.
## 2024-07-02
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1+4`](#thermion_dart---v0114)
- [`thermion_flutter_web` - `v0.0.1+8`](#thermion_flutter_web---v0018)
- [`thermion_flutter` - `v0.1.1+9`](#thermion_flutter---v0119)
- [`thermion_flutter_platform_interface` - `v0.1.0+8`](#thermion_flutter_platform_interface---v0108)
- [`thermion_flutter_ffi` - `v0.1.0+8`](#thermion_flutter_ffi---v0108)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+8`
- `thermion_flutter` - `v0.1.1+9`
- `thermion_flutter_platform_interface` - `v0.1.0+8`
- `thermion_flutter_ffi` - `v0.1.0+8`
---
#### `thermion_dart` - `v0.1.1+4`
- **FIX**: defer creating image entity/material/etc until actually requested.
## 2024-06-27
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1+3`](#thermion_dart---v0113)
- [`thermion_flutter` - `v0.1.1+8`](#thermion_flutter---v0118)
- [`thermion_flutter_web` - `v0.0.1+7`](#thermion_flutter_web---v0017)
- [`thermion_flutter_platform_interface` - `v0.1.0+7`](#thermion_flutter_platform_interface---v0107)
- [`thermion_flutter_ffi` - `v0.1.0+7`](#thermion_flutter_ffi---v0107)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+7`
- `thermion_flutter_platform_interface` - `v0.1.0+7`
- `thermion_flutter_ffi` - `v0.1.0+7`
---
#### `thermion_dart` - `v0.1.1+3`
- **FIX**: bump ffigen dependency version & regenerate bindings (and revert to ffi.Int rather than ffi.Int32).
- **DOCS**: update homepage links and minor documentation updates.
#### `thermion_flutter` - `v0.1.1+8`
- **DOCS**: update homepage links and minor documentation updates.
## 2024-06-26
### Changes
---
Packages with breaking changes:
- [`thermion_dart` - `v0.1.1+2`](#thermion_dart---v0112)
- [`thermion_flutter` - `v0.1.1+7`](#thermion_flutter---v0117)
Packages with other changes:
- [`thermion_flutter_ffi` - `v0.1.0+6`](#thermion_flutter_ffi---v0106)
- [`thermion_flutter_platform_interface` - `v0.1.0+6`](#thermion_flutter_platform_interface---v0106)
- [`thermion_flutter_web` - `v0.0.1+6`](#thermion_flutter_web---v0016)
Packages graduated to a stable release (see pre-releases prior to the stable version for changelog entries):
- `thermion_dart` - `v0.1.1+2`
- `thermion_flutter` - `v0.1.1+7`
- `thermion_flutter_ffi` - `v0.1.0+6`
- `thermion_flutter_platform_interface` - `v0.1.0+6`
- `thermion_flutter_web` - `v0.0.1+6`
---
#### `thermion_dart` - `v0.1.1+2`
#### `thermion_flutter` - `v0.1.1+7`
#### `thermion_flutter_ffi` - `v0.1.0+6`
#### `thermion_flutter_platform_interface` - `v0.1.0+6`
#### `thermion_flutter_web` - `v0.0.1+6`
## 2024-06-26
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1-dev.0+2`](#thermion_dart---v011-dev02)
- [`thermion_flutter` - `v0.1.1-dev.0+7`](#thermion_flutter---v011-dev07)
- [`thermion_flutter_platform_interface` - `v0.1.0-dev.0+6`](#thermion_flutter_platform_interface---v010-dev06)
- [`thermion_flutter_web` - `v0.0.1-dev.0+6`](#thermion_flutter_web---v001-dev06)
- [`thermion_flutter_ffi` - `v0.1.0-dev.0+6`](#thermion_flutter_ffi---v010-dev06)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_platform_interface` - `v0.1.0-dev.0+6`
- `thermion_flutter_web` - `v0.0.1-dev.0+6`
- `thermion_flutter_ffi` - `v0.1.0-dev.0+6`
---
#### `thermion_dart` - `v0.1.1-dev.0+2`
- **FIX**: revert to std::thread (pthreads not easily available on Windows).
- **FIX**: on Windows, pass static libs via -l rather than custom linkWith property so build.dart stays compatible between published & custom versions.
#### `thermion_flutter` - `v0.1.1-dev.0+7`
- **FIX**: add ResourceBuffer header directly to Windows build so I don't have to fiddle around getting the CMake path right.
## 2024-06-22
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1+1`](#thermion_dart---v0111)
- [`thermion_flutter` - `v0.1.1+6`](#thermion_flutter---v0116)
- [`thermion_flutter_web` - `v0.0.1+5`](#thermion_flutter_web---v0015)
- [`thermion_flutter_platform_interface` - `v0.1.0+5`](#thermion_flutter_platform_interface---v0105)
- [`thermion_flutter_ffi` - `v0.1.0+5`](#thermion_flutter_ffi---v0105)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+5`
- `thermion_flutter_platform_interface` - `v0.1.0+5`
- `thermion_flutter_ffi` - `v0.1.0+5`
---
#### `thermion_dart` - `v0.1.1+1`
- **DOCS**: update with links to playground.
#### `thermion_flutter` - `v0.1.1+6`
- **DOCS**: update with links to playground.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.1`](#thermion_dart---v011)
---
#### `thermion_dart` - `v0.1.1`
- Bump "thermion_dart" to `0.1.1`.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+4`](#thermion_dart---v0104)
- [`thermion_flutter_web` - `v0.0.1+4`](#thermion_flutter_web---v0014)
- [`thermion_flutter_platform_interface` - `v0.1.0+4`](#thermion_flutter_platform_interface---v0104)
- [`thermion_flutter` - `v0.1.1+5`](#thermion_flutter---v0115)
- [`thermion_flutter_ffi` - `v0.1.0+4`](#thermion_flutter_ffi---v0104)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+4`
- `thermion_flutter_platform_interface` - `v0.1.0+4`
- `thermion_flutter` - `v0.1.1+5`
- `thermion_flutter_ffi` - `v0.1.0+4`
---
#### `thermion_dart` - `v0.1.0+4`
- **FIX**: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+3`](#thermion_dart---v0103)
- [`thermion_flutter_web` - `v0.0.1+3`](#thermion_flutter_web---v0013)
- [`thermion_flutter` - `v0.1.1+4`](#thermion_flutter---v0114)
- [`thermion_flutter_platform_interface` - `v0.1.0+3`](#thermion_flutter_platform_interface---v0103)
- [`thermion_flutter_ffi` - `v0.1.0+3`](#thermion_flutter_ffi---v0103)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+3`
- `thermion_flutter` - `v0.1.1+4`
- `thermion_flutter_platform_interface` - `v0.1.0+3`
- `thermion_flutter_ffi` - `v0.1.0+3`
---
#### `thermion_dart` - `v0.1.0+3`
- **FIX**: exit build.dart early on Linux builds so we can use the package on a Linux host.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+2`](#thermion_dart---v0102)
- [`thermion_flutter_ffi` - `v0.1.0+2`](#thermion_flutter_ffi---v0102)
- [`thermion_flutter_web` - `v0.0.1+2`](#thermion_flutter_web---v0012)
- [`thermion_flutter` - `v0.1.1+3`](#thermion_flutter---v0113)
- [`thermion_flutter_platform_interface` - `v0.1.0+2`](#thermion_flutter_platform_interface---v0102)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_web` - `v0.0.1+2`
- `thermion_flutter` - `v0.1.1+3`
- `thermion_flutter_platform_interface` - `v0.1.0+2`
---
#### `thermion_dart` - `v0.1.0+2`
- **REFACTOR**: rearrange some stubs/imports for easier web WASM deployment.
#### `thermion_flutter_ffi` - `v0.1.0+2`
- **REFACTOR**: rearrange some stubs/imports for easier web WASM deployment.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_flutter` - `v0.1.1+2`](#thermion_flutter---v0112)
---
#### `thermion_flutter` - `v0.1.1+2`
- **FIX**: update Flutter example project to use new API.
- **FIX**: add logging dependency to thermion_flutter.
## 2024-06-21
### Changes
---
Packages with breaking changes:
- There are no breaking changes in this release.
Packages with other changes:
- [`thermion_dart` - `v0.1.0+1`](#thermion_dart---v0101)
- [`thermion_flutter` - `v0.1.1+1`](#thermion_flutter---v0111)
- [`thermion_flutter_web` - `v0.0.1+1`](#thermion_flutter_web---v0011)
- [`thermion_flutter_platform_interface` - `v0.1.0+1`](#thermion_flutter_platform_interface---v0101)
- [`thermion_flutter_ffi` - `v0.1.0+1`](#thermion_flutter_ffi---v0101)
Packages with dependency updates only:
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `thermion_flutter_platform_interface` - `v0.1.0+1`
- `thermion_flutter_ffi` - `v0.1.0+1`
---
#### `thermion_dart` - `v0.1.0+1`
- **REFACTOR**: export ThermionViewerWasm for web and hide FFI/WASM version.
- **FIX**: use preserveDrawingBuffer=true on web.
#### `thermion_flutter` - `v0.1.1+1`
- **REFACTOR**: export ThermionViewerWasm for web and hide FFI/WASM version.
- **FIX**: catch exception if gizmo unavailable in ThermionGestureDestectorDesktop.
#### `thermion_flutter_web` - `v0.0.1+1`
- **REFACTOR**: export ThermionViewerWasm for web and hide FFI/WASM version.

View File

@@ -1,38 +0,0 @@
# Thermion
Thermion is a package for creating 3D applications with Dart and/or Flutter.
## Overview
### Packages 
The two most relevant Thermion packages are:- [thermion_dart], which contains all the code needed to create a viewer, - [thermion_flutter], which is a Flutter-only package that contains all the logic necessary to create/embed a rendering surface inside a Flutter app. 
By decoupling the Flutter-specific components from the Dart-only components, Thermion can be used for rendering in both Flutter and non-Flutter applications. As far as the latter is concerned, Thermion ships with examples for  Javascript/WASM/HTML, and for CLI/headless mode on MacOS. 
### pubspec.yaml
If you are creating a Flutter application, add [thermion_flutter] as a dependency to your `pubspec.yaml`.
```$ cd /path/to/your/flutter/project$ flutter pub add thermion_flutter```
### ThermionFlutterPlugin
Create an instance of `ThermionFlutterPlugin` in your app.
```dart
class _MyAppState extends State<MyApp> {
  late ThermionFlutterPlugin _thermionFlutterPlugin;  late Future<ThermionViewer> _thermionViewer;
  void initState() {    _thermionFlutterPlugin = ThermionFlutterPlugin();    _thermionViewer = _thermionFlutterPlugin.createViewer();  }}```
`ThermionFlutterPlugin` is a singleton, and mostly just handles creating a 3D rendering surface that can be embedded in a Flutter widget hierarchy.  [ThermionViewer] is the interface for actually interacting with the scene (loading assets, manipulating the camera, and so on). Call `createViewer` on `ThermionFlutterPlugin` to obtain a reference to `ThermionViewer` (which is also a singleton).
Note: `ThermionFlutterPlugin` and `ThermionViewer` were designed as separate classes so we can use `ThermionViewer` in non-Flutter apps.
### ThermionWidget
On most platforms[0], [ThermionWidget] is the widget where your rendered content (i.e. your viewport) will appear. This can be any size; the 3D viewport will be scaled to fit the dimensions on this widget. On most platforms, a [ThermionWidget] can be positioned above or below any other widget in the hierarchy and the Z-order will be preserved.
```class _MyAppState extends State<MyApp> {
  late ThermionFlutterPlugin _thermionFlutterPlugin;  late Future<ThermionViewer> _thermionViewer;
  void initState() {    _thermionFlutterPlugin = ThermionFlutterPlugin();    _thermionViewer = _thermionFlutterPlugin.createViewer();  }    Widget build(BuildContext context) {       return Stack(children:[      Positioned.fill(        child:ThermionWidget(          plugin:_thermionFlutterPlugin        )      )    ]);  }}```
[0] Currently, the rendering surface on Windows and Web will always appear at the bottom of the application. You still need a ThermionWidget, but this only keeps track of the dimensions of your viewport and punches a transparent hole in the hierarchy; the actual rendering surface is attached beneath the Flutter window.
`ThermionWidget` will not display the rendering surface (even an empty one) until the call to `createViewer` has been completed.
- by default a Container will be rendered with solid red. If you want to change this, pass a widget as the initial paramer to the ThermionWidget constructor.on the second frame, ThermionWidget will pass its dimensions/pixel ratio to the FilamentController
 You can then call createViewer to create:the rendering surface (on most platforms, a backing texture that will be registered with Flutter for use in a Texture widget)a rendering threada ThermionViewerFFI and an AssetManager, which will allow you to load assets/cameras/lighting/etc via the FilamentControllerafter an indeterminate number of frames, FilamentController will notify ThermionWidget when a rendering surface is available the viewportThermionWidget will replace the default initial Widget with the viewport (which will initially be solid black or white, depending on your platform).IMPORTANT: there will be a delay between adding a ThermionWidget, calling createViewer and the actual rendering viewport becoming available. This is why we fill ThermionWidget with red - to make it abundantly clear that you need to handle this asynchronous delay appropriately. Once createViewer has completed, the viewport is available for rendering.
Currently, the initial widget will also be displayed whenever the viewport is resized (including changing orientation on mobile and drag-to-resize on desktop). You probably want to change this from the default red.
Congratulations! You now have a scene. It's completely empty, so you probably want to add something visible.

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2024 Nick Fisher
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -12,6 +12,7 @@ flutter-example-web: dart-web-clean dart-web
flutter-example-macos:
cd thermion_flutter_federated/thermion_flutter/example/web && flutter run -d macos
swift-bindings:
swiftc -c thermion_flutter/thermion_flutter/macos/Classes/ThermionTexture.swift -module-name swift_module -emit-objc-header-path thermion_dart/native/include/generated/ThermionTextureSwiftObjCAPI.h -emit-library -o thermion_dart/test/libThermionTextureSwift.dylib
cd thermion_dart/ && dart --enable-experiment=native-assets run ffigen --config ffigen/swift.yaml
bindings:
cd thermion_dart/ && dart --enable-experiment=native-assets run ffigen --config ffigen/native.yaml
@@ -22,10 +23,13 @@ bindings:
#
materials: FORCE
@echo "Using Filament build from ${FILAMENT_PATH}"
${FILAMENT_PATH}/matc -a opengl -a metal -o materials/image.filamat materials/image.mat
$(FILAMENT_PATH)/resgen -c -p image -x ios/include/material/ materials/image.filamat
$(FILAMENT_PATH)/matc -a opengl -a metal -o materials/gizmo.filamat materials/gizmo.mat
$(FILAMENT_PATH)/resgen -c -p gizmo -x ios/include/material/ materials/gizmo.filamat
@for material in unlit image gizmo grid; do \
${FILAMENT_PATH}/matc -a opengl -a metal -o materials/$$material.filamat materials/$$material.mat; \
$(FILAMENT_PATH)/resgen -c -p $$material -x thermion_dart/native/include/material/ materials/$$material.filamat; \
echo '#include "'$$material'.h"' | cat - thermion_dart/native/include/material/$$material.c > thermion_dart/native/include/material/$$material.c.new; \
mv thermion_dart/native/include/material/$$material.c.new thermion_dart/native/include/material/$$material.c; \
done
#rm materials/*.filamat
FORCE: ;

View File

@@ -1,13 +1,14 @@
![Thermion Logo](docs/logo.png)
<p align="center">
<a href="https://docs.page/nmfisher/flutter_filament/quickstart">Quickstart (Flutter)</a> •
<a href="https://docs.page/nmfisher/flutter_filament">Documentation</a> •
<a href="https://github.com/nmfisher/thermion/docs/examples/">Showcase</a> •
<a href="https://thermion.dev/quickstart">Quickstart (Flutter)</a> •
<a href="https://thermion.dev/">Documentation</a> •
<a href="https://thermion.dev/examples">Showcase</a> •
<a href="https://dartpad.thermion.dev/">Playground</a> •
<a href="https://discord.gg/h2VdDK3EAQ">Discord</a>
</p>
## Cross-platform 3D engine for Dart and Flutter.
## Cross-platform 3D toolkit for Dart and Flutter.
<a href="https://pub.dev/packages/thermion_dart"><img src="https://img.shields.io/pub/v/thermion_dart?label=pub.dev&labelColor=333940&logo=dart&color=00589B" alt="pub"></a>
<a href="https://github.com/nmfisher/thermion"><img src="https://img.shields.io/github/stars/nmfisher/flutter_filament?style=flat&label=stars&labelColor=333940&color=8957e5&logo=github" alt="github"></a>
@@ -23,7 +24,7 @@
### Sponsors, Contributors & Acknowledgments
Thermion uses the [Filament](https://github.com/google/filament) physically based rendering package under the hood.
Thermion uses the [Filament](https://github.com/google/filament) Physically Based Rendering engine under the hood.
Special thanks to [odd-io](https://github.com/odd-io/) for sponsoring work on supporting Windows, raycasting, testing and documentation.

View File

@@ -10,7 +10,14 @@
["Quick Start", "/quickstart"]
]
],
["Misc.", [["Contributing", "/contributing"]]]
["Misc.", [
["Playground", "https://dartpad.thermion.dev"],
["Showcase", "/showcase"],
["Windows", "/windows"],
["Android", "/android"],
["Contributing", "/contributing"],
["Discord", "https://discord.gg/h2VdDK3EAQ"]
]]
]
}

View File

@@ -1 +0,0 @@
# Another Page

View File

@@ -1,6 +1,10 @@
## Contributing
Thermion is an open source project and we welcome all contributions from every level of experience.
Thermion is an open source project and all contributions are welcome, no matter the level of experience.
Please [join us on Discord](https://discord.gg/h2VdDK3EAQ) if you'd like some guidance or just want to chat.
Note that the Thermion project uses [Melos](https://melos.invertase.dev/) to manage the repository.
This lets us auto-generate changelogs & versioning from commit messages, so if you wish to submit a PR, please use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

View File

@@ -1,8 +0,0 @@
# Examples
Thermion is a package for creating 3D applications with Dart and/or Flutter.
## Polyvox
iOS app
## Nick Fisher (Personal Website)

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 KiB

View File

@@ -4,6 +4,10 @@ Thermion is a framework for creating cross-platform 3D applications with Dart an
## Overview
Below is a general overview of how the Thermion packages are structured to ensure a clean separation between the general Dart components, and the Flutter specific components.
If you want a more detailed explanation of how to start rendering 3D content inside a Flutter app, [click here to view the quickstart page](/quickstart).
### Package structure 
Thermion is divided into two packages:
@@ -18,8 +22,39 @@ For example, Thermion ships with examples for rendering with Dart only (no Flutt
### ThermionViewer (`thermion_dart`)
// TODO
The ThermionViewer class provides an API for creating and interacting with 3D scenes powered by the Filament rendering engine.
It allows loading 3D models in glTF format, adding lights and a skybox, manipulating the camera, animating objects, and more.
Key functionalities include:
- Scene Management: Load and manipulate entities, lights, skyboxes, and background elements within a 3D scene.
- Rendering Control: Manage rendering loop, frame rate, and post-processing effects like tone mapping and bloom.
- Camera Control: Position and orient the camera, adjust focal length, and control exposure settings.
- Animation: Play, pause, and manipulate skeletal and morph target animations.
- Entity Manipulation: Transform entities (position, rotation, scale), set material properties, and manage parent-child relationships.
- Collision Detection (experimental): Add collision components to entities and test for collisions within the scene.
- Input Handling: Interact with the scene using touch gestures for panning, rotating, and zooming.
- Developers use the ThermionViewer class to build and control the behavior of their 3D applications.
### ThermionFlutterPlugin
The ThermionFlutterPlugin class handles the platform-specific initialization required to embed a Filament rendering surface within a Flutter Widget.
This includes creating a texture and managing the application lifecycle to pause rendering when the app is inactive.
You will generally only need to interact with `ThermionFlutterPlugin` directly to create or dispose of a ThermionViewer.
### ThermionWidget (`thermion_flutter`)
// TODO
`ThermionWidget` is a Flutter widget that displays the 3D content rendered by a ThermionViewer.
It handles creating and managing the underlying platform-specific texture that Filament renders to, and provides a way to embed this texture within the Flutter widget tree.
Key features of ThermionWidget include:
- Texture Management: It creates, resizes, and destroys the ThermionFlutterTexture used to display the rendered content from the ThermionViewer.
- Platform Adaption: It handles platform-specific differences, such as texture coordinate systems, to ensure consistent rendering across different platforms.
- Initialization Handling: Displays a placeholder (configurable via the initial property) while the Filament texture is being initialized, providing a smoother user experience.
- Seamless Integration: Integrates seamlessly within the Flutter widget tree, allowing developers to combine 2D and 3D content easily.
- Resize Handling: It listens for resize events and automatically resizes the underlying texture to match, ensuring the 3D content scales correctly.

View File

@@ -1,11 +1,12 @@
## Quickstart (Flutter)
> You can find the entire project below in the [examples/flutter/quickstart](examples/flutter/quickstart) folder of the repository.
> You can find the entire project below in the [flutter/quickstart](https://github.com/nmfisher/thermion_examples/tree/master/flutter/quickstart) folder of the `thermion_examples` repository.
1. Switch to Flutter master channel, create a new project, then add `thermion_flutter` as a dependency
1. Switch to Flutter master channel, upgrade Flutter, create a new project, then add `thermion_flutter` as a dependency
```bash
$ flutter channel master
$ flutter upgrade
$ flutter config --enable-native-assets
$ flutter create thermion_sample_project && cd thermion_sample_project
$ flutter pub add thermion_flutter
@@ -13,7 +14,7 @@ $ flutter pub add thermion_flutter
2. If running on iOS or MacOS, change the minimum deployment target to OSX 13
<Accordion title="Click to iOS/MacOS instructions">
<Accordion title="Click to open iOS/MacOS instructions">
Make sure the `platform` entry refers to `13.0` in your Podfile.
@@ -38,6 +39,11 @@ and change the minimum deployment target to 13.0:
</Accordion>
<Accordion title="Click to open Windows instructions">
See the [/windows](/windows) page for steps needed to build on Windows.
</Accordion>
2. Add a folder containing your assets (glTF model + skybox ktx) to your `pubspec.yaml` asset list
```yaml
@@ -70,18 +76,21 @@ class _MyAppState extends State<MyApp> {
class _MyAppState extends State<MyApp> {
late ThermionFlutterPlugin _thermionFlutterPlugin; 
late Future<ThermionViewer> _thermionViewer;
ThermionViewer? _thermionViewer;
void initState() {   
_thermionFlutterPlugin = ThermionFlutterPlugin();
_thermionViewer = _thermionFlutterPlugin.initialize();
_thermionFlutterPlugin.createViewer().then((viewer) {
setState(() {
_thermionViewer = viewer;
});
});
}   
Widget build(BuildContext context) {
return Stack(children:[
if(_thermionViewer != null)
    Positioned.fill(
child:ThermionWidget(
plugin:_thermionFlutterPlugin
plugin:_thermionViewer!
        ) 
    )
    ]); 
@@ -104,11 +113,12 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return Stack(children:[
    if(_thermionViewer != null)
    Positioned.fill(
child:ThermionWidget(
plugin:_thermionFlutterPlugin
plugin:_thermionViewer!
        ) 
    ),
    ),
if (!_loaded)
Center(
child: ElevatedButton(
@@ -204,6 +214,8 @@ The cube still won't be visible until we add a light to the scene and tell Therm
$ flutter run -d macos
```
> You may experience a noticeable delay the very first time you run the project. Don't panic, it's not frozen! This is due to the build system downloading the prebuilt Filament binaries from Cloudflare, which can take some time (particularly on Windows). These binaries will be cached after first download, so subsequent runs will be much faster (though every time you run flutter clean, the binaries will be re-downloaded).
![Screenshot of Thermion Quickstart project](images/thermion_sample_project.png)
Your first Thermion project is complete!
Your first Thermion project is complete!

23
docs/showcase.mdx Normal file
View File

@@ -0,0 +1,23 @@
## Showcase
## DartPad Playground
A custom DartPad that lets you experiment with Thermion from your browser (currently, only Chrome is supported).
[![Screenshot of Thermion Dartpad](images/dartpad.thermion.dev_.png)](https://dartpad.thermion.dev)
## mixreel (Flutter/Web)
Create 3D worlds and translate to AI video.
[![Screenshot of the mixreeel app](images/ixlabs.app_app.png)](https://mixreel.ai)
## Nick Fisher
My personal website, where I create an interactive clone of myself with Avaturn & Cartesia (no Flutter, made with Thermion and the [Jaspr Dart UI framework](https://github.com/schultek/jaspr)).
[![Screenshot of Nick Fisher's personal website](images/nick-fisher.com.png)](https://nick-fisher.com)

View File

@@ -1,15 +1,29 @@
## Windows
## CMakeLists
You will need to disable the `/WX` compiler flag.
In your project, open the `windows/CMakeList.txt` file and find the following line:
`target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")`
Delete the `/WX`:
`target_compile_options(${TARGET} PRIVATE /W4 /wd"4100")`
## pubspec.yaml
On Windows, you will need to add a custom version of `native_toolchain_c` to your `dependency_overrides`. This is currently needed to link static libraries when building a DLL.
```
native_toolchain_c:
dependency_overrides:
native_toolchain_c:
git:
url: git@github.com:nmfisher/native.git
url: https://github.com/nmfisher/native.git
path: pkgs/native_toolchain_c
ref: 99020084c4687be4c58c7115a167088c0441d1de
ref: windows_dll_fix
```
This will eventually be fixed upstream in the `native_toolchain_c` package, so this should be a short-term/temporary issue only.

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a1d72d69da8b933bde5453ef2000612b561f8ddfa536a7ad89288ef11eb876d
size 1624

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fe0151ced8fd8609f9692f3d62dbd30890dada97cb6995572e37c7e7b4440d86
size 21304

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0f8b793f6513cf83f80ce9c63c7b51d329908b1991f17ca642911634b15b32de
size 34172

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2aafaedba913b3c5642907e4fc57f5fcd2f4f4deb0a5a6c9ad17ef2b0ae2ed1f
size 1810780

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea5425c972afb40de5b0c5caa1ae121c51592143245c4e8a39273ac26ca19d01
size 232514

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f6d208315a0b37935face8f9b159ee3bdf44d3b95bcfdf441d1725f6c81d0faa
size 543635

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5f3a5f2deb2abd7382905a2fb483071f610152f1433eecc527dc8d8ded1c98b
size 1680

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c9fe38941e09e853ab8410a84a0336d0fc1e2733a4a2b8571e5b5e47b5fd30c
size 876491

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e57477f5e57d6e3381051367dd05425327643c7bd19a972a1172275ecc675106
size 1501226

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:999903752cd80ca12b074117942a7128c1c84d27edc8cc773bb15a7f7ddcdcb9
size 197691

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d88568b3463f21a96400cd265286fbb26accdef3a11dbeb65e9faf824a441e4e
size 3868939

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a34c5fdd0696d1679f5f0464f8fdfc5f012dc2be435046218158bed1bed0f7cb
size 1369811

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8de472e97570c33f0945bb38e97fea2af779e972e21d0226145060ab3ec83fd2
size 512354

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df391e772b5ff04540d5187cdf01d5cb04adf661931b2ccbe8744909b0954100
size 628316

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:20dec60f67ea38b14ac45ae2490ddd4bbf5c108f842e244a5fe3f90c7010cc7f
size 468148

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a8b61da658f891a244ffba8a293b0b4dcf384893f99c6bcaa4ab653f981de853
size 501824

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b05a4cf63ea1c614a9385cdb902c62bad324eccbb87a6c9e3370da2b6f36f2d
size 14565

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e5567daf7a3ac83f6ebc04605f3605ac17c19a153b6b8aadd2596690209c34c
size 2778518

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd1207967131afbe2fa523c9f4bae1f6dbce1a8fdd0ebfad5ec0cf7ba6a66dc1
size 5348302

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7729882e59bc227554d1b26ffd6494bbd37357ee37ac959fad2932b16d586f79
size 825327

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c8bd17cfddecede5a3fa9e1933ac6f309ce4cc6bc85d4122b9ae39b0ba2b0d8
size 2990685

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7987620b2a90887fa1a0521bf72f84933a2eadca88965f47599204dd55dae62a
size 3974850

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7acaed3775bb6246c266c8e3dcd803391a08a528b727781bf11559f016752f61
size 3185146

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:573a3d39db8a109352d16a421aff316d37faeb52f6abf01d0ca72db279bde7d9
size 5708074

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:13e867927da090fe696248e0d884087a7d4e310dca8315cd8d4d686b95db7aef
size 17805

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3506c43687bf4bd441eef301b157761574c2edecab6c8af6b8e6a85b772abe15
size 3713769

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c34919581290d71a541697454ef9200d3f693236e8e9ddac89b49fa83c3befd9
size 3702691

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fe00edcc79fb3266f7fe61ddb3fbf08f425b731985af7543bc5b677414cbf19
size 4591738

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6f75cb920285d4b0eb1f087bc79e70d31b1801c3df4edba294351516fa98953
size 5304637

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:32afd5ae0da2f2880fc85753b993a6945da1993f4087e562f2f75e107ecbf2f3
size 755081

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c15354b40ef4f79b83d16d6aaa37cfd7654a8e281ef5e5dc5a25934d55f16f7a
size 3748216

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c821ef0709398d8bc3cccfa311572fb45d4d9198514155f940936019ad0f32fd
size 4489618

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0bc81c711f74fdfd2ef56e34d747383444a3ab6a1ee52fe62cb5838e59b0be56
size 545

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:620bfa644724e9914df19949346ad0f441357fbb176879421d66b4377705836b
size 1048644

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bedb625eca04a9abba66d1521efda591819212e44cef0ab2438631596902140c
size 585493

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0245800fa846c2a3c15cb1d2aa6ded86fcf8355e568907dcd50e073c589f85d6
size 2095464

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:40379fcd881ca3729b0fa057f66b8fedbd8ab92b8e407bc3a4fd17c1a2b6e75e
size 1572932

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5821c53850d84c5b2d0b39ad28e6cde94d8fc7e1bbb97d5d898c40733e2d4e99
size 107424

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9134594e40a4bad7601d0396bb5f2a7600656bda5d815b3cb2e855ba6c6c5e4
size 1263808

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ab0cada556723be0d138d7b1cadb5e315a273524db0468e0c4255d8d2b0c1c2d
size 1222992

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c58d82602dc9b4dabb63f378fecd7ecb9eaf6f5da5746552ec42dde4ec211d7
size 121104

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c1d3eac0151a58c3f36bea0f636691559612fd2d5ce21bb3551d43e86043e26
size 36741

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b58c687c2687f5b3b576e4f5672981fde5657519f51dd331e6e671634c77640f
size 29920

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c07d5f3b06fb763d74e4d6afa2ff933d8953e8f73828320d0c34c2105e346d97
size 38119

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2033d3f7f8e0af983d8ab237737b45db2ed476b9283c6b0fda6a6954e1a72dea
size 294

View File

@@ -1,3 +0,0 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

View File

@@ -1,3 +0,0 @@
## 1.0.0
- Initial version.

View File

@@ -1,2 +0,0 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.

View File

@@ -1,30 +0,0 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -1 +0,0 @@
../../../assets

View File

@@ -1,46 +0,0 @@
import 'dart:io';
import 'package:thermion_dart/thermion_dart/compatibility/compatibility.dart';
import 'package:thermion_dart/thermion_dart/swift/swift_bindings.g.dart';
import 'package:thermion_dart/thermion_dart/compatibility/compatibility.dart';
import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart';
import 'package:ffi/ffi.dart';
import 'package:thermion_dart/thermion_dart.dart';
void main() async {
var scriptDir = File(Platform.script.toFilePath()).parent.path;
final lib = ThermionDartTexture1(
DynamicLibrary.open("$scriptDir/libthermion_swift.dylib"));
final object = ThermionDartTexture.new1(lib);
object.initWithWidth_height_(500, 500);
final resourceLoader = calloc<ResourceLoaderWrapper>(1);
var loadToOut = NativeCallable<
Void Function(Pointer<Char>,
Pointer<ResourceBuffer>)>.listener(DartResourceLoader.loadResource);
resourceLoader.ref.loadToOut = loadToOut.nativeFunction;
var freeResource = NativeCallable<Void Function(ResourceBuffer)>.listener(
DartResourceLoader.freeResource);
resourceLoader.ref.freeResource = freeResource.nativeFunction;
var viewer = ThermionViewerFFI(resourceLoader: resourceLoader.cast<Void>());
await viewer.initialized;
await viewer.createSwapChain(500, 500);
await viewer.createRenderTarget(500, 500, object.metalTextureAddress);
await viewer.updateViewportAndCameraProjection(500, 500);
var outDir = Directory("$scriptDir/output");
if (outDir.existsSync()) {
outDir.deleteSync(recursive: true);
}
outDir.createSync();
await viewer.setRecordingOutputDirectory(outDir.path);
await viewer.setRecording(true);
await viewer.loadSkybox(
"file:///$scriptDir/assets/default_env/default_env_skybox.ktx");
await Future.delayed(Duration(milliseconds: 16));
await viewer.render();
await viewer.dispose();
}

View File

@@ -1 +0,0 @@
../../../../thermion_dart/native/lib/macos/swift/libthermion_swift.dylib

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,18 +0,0 @@
name: example_cli
description: A sample command-line application.
version: 1.0.0
# repository: https://github.com/my_org/my_repo
environment:
sdk: ^3.3.0
# Add regular dependencies here.
dependencies:
thermion_dart:
path: ../../../thermion_dart
ffi:
dev_dependencies:
ffigen: ^11.0.0
lints: ^3.0.0
test: ^1.24.0

View File

@@ -1,8 +0,0 @@
import 'package:example_cli/example_cli.dart';
import 'package:test/test.dart';
void main() {
test('calculate', () {
expect(calculate(), 42);
});
}

View File

@@ -1,3 +0,0 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

View File

@@ -1,3 +0,0 @@
## 1.0.0
- Initial version.

View File

@@ -1,2 +0,0 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.

View File

@@ -1,30 +0,0 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -1,4 +0,0 @@
example_cli.mjs
example_cli.wasm
example_cli.unopt.wasm
node_modules/**/*

View File

@@ -1,98 +0,0 @@
MAIN
initializing
gto uberarchive ptr
create void ptr callback
resolve
try
done, returning
created
got promise [object Promise]
got fn ptr address 2720
Calling create_filament_viewer_ffi
Call complete
Created viewer, waiting for initialization
Creating WebGL context.
Created WebGL context 2.0
Made WebGL context current
FEngine (32 bits) created at 0x1937d0 (threading is disabled)
[stack-gl], [ANGLE], [OpenGL ES 3.0 (WebGL 1.0 stack-gl 8.0.2)], [OpenGL ES GLSL ES 1.00 (WebGL GLSL ES 1.0 stack-gl)]
Feature level: 1
Active workarounds:
Backend feature level: 1
FEngine feature level: 1
Set frame interval to 16.666666
Setting tone mapping to ACES
Bloom is disabled on WebGL builds as it causes instability with certain drivers. setBloom will be ignored
View created
Camera aperture 16.000000 shutter 0.008000 sensitivity 100.000000
Created ubershader provider.
Added imageEntity 6
Got void ptr callback
Set viewer to true
Created viewer 1652064
Initialied
Loading GLB from buffer of length 116948
Loaded glb
Entities : [10, 11, 12]
entityName : Cone
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
morph targets : [Key 1, Key 2, Key 3, Key 4, Key 5, Key 6, Key 7, Key 8]
entityName : Cube
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
morph targets : [Key 1, Key 2]
entityName : Cylinder
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
Getting morpht arget names
No insdtance
Using asset instance
morph targets : [Key 1, Key 2, Key 3, Key 4]

View File

@@ -1,33 +0,0 @@
import 'package:thermion_dart/thermion_dart/compatibility/compatibility.dart';
import 'package:thermion_dart/thermion_dart.dart';
import 'package:animation_tools_dart/animation_tools_dart.dart';
void main(List<String> args) async {
final resourceLoader = thermion_dart_web_get_resource_loader_wrapper();
var viewer = ThermionViewerFFI(resourceLoader: resourceLoader.cast<Void>());
viewer.initialized.then((_) async {
var entity = await viewer.loadGlb(
"/Users/nickfisher/Documents/polyvox/apps/packages/thermion_flutter/thermion_flutter_federated/thermion_flutter/example/assets/shapes/shapes.glb");
var entities = await viewer.getChildEntities(entity, true);
for (final childEntity in entities) {
final childName = await viewer.getNameForEntity(childEntity);
var morphTargetNames =
await viewer.getMorphTargetNames(entity, childEntity!);
if (morphTargetNames.isNotEmpty) {
await viewer.setMorphTargetWeights(
childEntity, List<double>.filled(morphTargetNames.length, 1.0));
}
var animationData = MorphAnimationData(
List.generate(
10, (_) => List<double>.filled(morphTargetNames.length, 1.0)),
morphTargetNames);
await viewer.setMorphAnimationData(entity, animationData,
targetMeshNames: [childName!]);
}
});
while (true) {
await Future.delayed(Duration(seconds: 1));
}
}

View File

@@ -1,123 +0,0 @@
const fs = require('node:fs');
const thermion_dart = require("./thermion_dart.js")
const GLctx = require('gl')(100, 100, { preserveDrawingBuffer: true })
// queueMicrotask = (func) => {
// func();
// }
// read('thermion_dart.wasm', 'binary')
// const exports = {};
// const module = {};
const wasmBuffer = fs.readFileSync('thermion_dart.wasm');
var dartFilamentModulePromise = WebAssembly.compile(wasmBuffer);
let globalDf;
thermion_dart({
dartFilamentResolveCallback: (cb, data) => {
const fn = globalDf.wasmTable.get(cb);
if(data) {
fn(data);
} else {
fn();
}
},
ctx:GLctx}).then((df) => {
globalDf = df;
createVoidCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = () => {
try {
res({});
} catch(err) {
console.log(err);
}
}
const fnPtr = df.addFunction(callback, 'v');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
createIntCallback = () => {
let res;
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
createVoidPointerCallback = () => {
console.log("create void ptr callback");
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
console.log("resolve");
res = resolve;
});
try {
console.log("try");
const callback = (voidPtr) => {
try {
res(voidPtr);
} catch(err) {
console.log(err);
}
}
const fnPtr = df.addFunction(callback, 'vi');
console.log("done, returning");
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
createBoolCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = (val) => {
try {
res(val);
} catch(err) {
console.log(err);
}
}
const fnPtr = df.addFunction(callback, 'vi');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
import('./example_cli.mjs').then((dart2wasm_runtime) => {
var dartModulePromise = WebAssembly.compile(fs.readFileSync('./example_cli.wasm'));
const imports = {"thermion_dart": df, "ctx": GLctx};
dart2wasm_runtime.instantiate(dartModulePromise, imports).then((moduleInstance) => {
dart2wasm_runtime.invoke(moduleInstance);
});
});
});
// // dartModulePromise.then((dartModule) => { console.log(dartModule.exports); dart2wasm_runtime.invoke(dartModule, imports);}); });

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
{
"dependencies": {
"gl": "^8.0.2"
}
}

View File

@@ -1 +0,0 @@
../../../native/web/build/build/out/dart_filament.js

View File

@@ -1 +0,0 @@
../../../native/web/build/build/out/dart_filament.wasm

View File

@@ -1 +0,0 @@
../../../native/web/build/build/out/dart_filament.worker.js

View File

@@ -1,18 +0,0 @@
name: example_cli
description: A sample command-line application.
version: 1.0.0
# repository: https://github.com/my_org/my_repo
environment:
sdk: ^3.3.0
# Add regular dependencies here.
dependencies:
thermion_dart:
path: ../../
ffi:
dev_dependencies:
ffigen: ^11.0.0
lints: ^3.0.0
test: ^1.24.0

View File

@@ -1,8 +0,0 @@
import 'package:example_cli/example_cli.dart';
import 'package:test/test.dart';
void main() {
test('calculate', () {
expect(calculate(), 42);
});
}

View File

@@ -1,3 +0,0 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

View File

@@ -1,3 +0,0 @@
## 1.0.0
- Initial version.

View File

@@ -1,2 +0,0 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.

View File

@@ -1,30 +0,0 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

View File

@@ -1,16 +0,0 @@
# Flight Helmet
## Screenshot
![screenshot](screenshot/screenshot.jpg)
## License Information
Donated by Microsoft for glTF testing
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/)
To the extent possible under law, Microsoft has waived all copyright and related or neighboring rights to this asset.
Draco compression was done via Cesium tools on 27-03-2020 as follows.
gltf-pipeline -i FlightHelmet.gltf -o FlightHelmet.gltf -d -s --keep-unused-elements

View File

@@ -1 +0,0 @@
../../../../flutter_filament_federated/flutter_filament/example/assets

View File

@@ -1,57 +0,0 @@
import 'dart:js_interop';
import 'dart:js_interop_unsafe';
import 'package:thermion_dart/thermion_dart/compatibility/compatibility.dart';
import 'package:thermion_dart/thermion_dart/thermion_viewer_ffi.dart';
import 'package:web/web.dart';
void main(List<String> arguments) async {
var fc = FooChar();
final canvas = document.getElementById("canvas") as HTMLCanvasElement;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var resourceLoader = thermion_dart_web_get_resource_loader_wrapper();
var viewer = ThermionViewerFFI(resourceLoader: resourceLoader);
var mousedown = (JSObject event) {
var x = event.getProperty("clientX".toJS) as JSNumber;
var y = event.getProperty("clientY".toJS) as JSNumber;
viewer.rotateStart(x.toDartDouble, y.toDartDouble);
};
canvas.addEventListener("mousedown", mousedown.toJS);
var mousemove = (JSObject event) {
var x = event.getProperty("clientX".toJS) as JSNumber;
var y = event.getProperty("clientY".toJS) as JSNumber;
viewer.rotateUpdate(x.toDartDouble, y.toDartDouble);
};
canvas.addEventListener("mousemove", mousemove.toJS);
var mouseup = (JSObject event) {
viewer.rotateEnd();
};
canvas.addEventListener("mouseup", mousedown.toJS);
await viewer.initialized;
var width = window.innerWidth;
var height = window.innerHeight;
await viewer.createSwapChain(width.toDouble(), height.toDouble());
await viewer.setBackgroundColor(0.0, 1.0, 1.0, 1.0);
await viewer.loadSkybox("assets/default_env_skybox.ktx");
await viewer.loadIbl("assets/default_env_ibl.ktx");
await viewer.loadGltf("assets/FlightHelmet.gltf", "assets");
await viewer.updateViewportAndCameraProjection(
width.toDouble(), height.toDouble());
await viewer.setPostProcessing(true);
await viewer.setRendering(true);
while (true) {
await Future.delayed(Duration(milliseconds: 16));
}
print("Finisehd!");
}

View File

@@ -1,249 +0,0 @@
let buildArgsList;
// `modulePromise` is a promise to the `WebAssembly.module` object to be
// instantiated.
// `importObjectPromise` is a promise to an object that contains any additional
// imports needed by the module that aren't provided by the standard runtime.
// The fields on this object will be merged into the importObject with which
// the module will be instantiated.
// This function returns a promise to the instantiated module.
export const instantiate = async (modulePromise, importObjectPromise) => {
let dartInstance;
function stringFromDartString(string) {
const totalLength = dartInstance.exports.$stringLength(string);
let result = '';
let index = 0;
while (index < totalLength) {
let chunkLength = Math.min(totalLength - index, 0xFFFF);
const array = new Array(chunkLength);
for (let i = 0; i < chunkLength; i++) {
array[i] = dartInstance.exports.$stringRead(string, index++);
}
result += String.fromCharCode(...array);
}
return result;
}
function stringToDartString(string) {
const length = string.length;
let range = 0;
for (let i = 0; i < length; i++) {
range |= string.codePointAt(i);
}
if (range < 256) {
const dartString = dartInstance.exports.$stringAllocate1(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i));
}
return dartString;
} else {
const dartString = dartInstance.exports.$stringAllocate2(length);
for (let i = 0; i < length; i++) {
dartInstance.exports.$stringWrite2(dartString, i, string.charCodeAt(i));
}
return dartString;
}
}
// Prints to the console
function printToConsole(value) {
if (typeof dartPrint == "function") {
dartPrint(value);
return;
}
if (typeof console == "object" && typeof console.log != "undefined") {
console.log(value);
return;
}
if (typeof print == "function") {
print(value);
return;
}
throw "Unable to print message: " + js;
}
// Converts a Dart List to a JS array. Any Dart objects will be converted, but
// this will be cheap for JSValues.
function arrayFromDartList(constructor, list) {
const length = dartInstance.exports.$listLength(list);
const array = new constructor(length);
for (let i = 0; i < length; i++) {
array[i] = dartInstance.exports.$listRead(list, i);
}
return array;
}
buildArgsList = function(list) {
const dartList = dartInstance.exports.$makeStringList();
for (let i = 0; i < list.length; i++) {
dartInstance.exports.$listAdd(dartList, stringToDartString(list[i]));
}
return dartList;
}
// A special symbol attached to functions that wrap Dart functions.
const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction");
function finalizeWrapper(dartFunction, wrapped) {
wrapped.dartFunction = dartFunction;
wrapped[jsWrappedDartFunctionSymbol] = true;
return wrapped;
}
// Imports
const dart2wasm = {
_18: f => finalizeWrapper(f,x0 => dartInstance.exports._18(f,x0)),
_19: f => finalizeWrapper(f,x0 => dartInstance.exports._19(f,x0)),
_75: (x0,x1) => x0.getElementById(x1),
_76: f => finalizeWrapper(f,x0 => dartInstance.exports._76(f,x0)),
_77: (x0,x1,x2) => x0.addEventListener(x1,x2),
_78: f => finalizeWrapper(f,x0 => dartInstance.exports._78(f,x0)),
_79: f => finalizeWrapper(f,x0 => dartInstance.exports._79(f,x0)),
_1499: (x0,x1) => x0.width = x1,
_1501: (x0,x1) => x0.height = x1,
_1878: () => globalThis.window,
_1920: x0 => x0.innerWidth,
_1921: x0 => x0.innerHeight,
_6854: () => globalThis.document,
_12721: () => globalThis.createBoolCallback(),
_12722: () => globalThis.createVoidPointerCallback(),
_12723: () => globalThis.createVoidCallback(),
_12727: v => stringToDartString(v.toString()),
_12743: () => {
let stackString = new Error().stack.toString();
let frames = stackString.split('\n');
let drop = 2;
if (frames[0] === 'Error') {
drop += 1;
}
return frames.slice(drop).join('\n');
},
_12762: s => stringToDartString(JSON.stringify(stringFromDartString(s))),
_12763: s => printToConsole(stringFromDartString(s)),
_12777: (ms, c) =>
setTimeout(() => dartInstance.exports.$invokeCallback(c),ms),
_12781: (c) =>
queueMicrotask(() => dartInstance.exports.$invokeCallback(c)),
_12783: (a, i) => a.push(i),
_12794: a => a.length,
_12796: (a, i) => a[i],
_12797: (a, i, v) => a[i] = v,
_12799: a => a.join(''),
_12809: (s, p, i) => s.indexOf(p, i),
_12812: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length),
_12813: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length),
_12814: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length),
_12815: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length),
_12816: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length),
_12817: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length),
_12818: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length),
_12821: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length),
_12822: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length),
_12827: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength),
_12831: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get),
_12832: (b, o) => new DataView(b, o),
_12834: Function.prototype.call.bind(DataView.prototype.getUint8),
_12836: Function.prototype.call.bind(DataView.prototype.getInt8),
_12838: Function.prototype.call.bind(DataView.prototype.getUint16),
_12840: Function.prototype.call.bind(DataView.prototype.getInt16),
_12842: Function.prototype.call.bind(DataView.prototype.getUint32),
_12844: Function.prototype.call.bind(DataView.prototype.getInt32),
_12850: Function.prototype.call.bind(DataView.prototype.getFloat32),
_12852: Function.prototype.call.bind(DataView.prototype.getFloat64),
_12873: o => o === undefined,
_12874: o => typeof o === 'boolean',
_12875: o => typeof o === 'number',
_12877: o => typeof o === 'string',
_12880: o => o instanceof Int8Array,
_12881: o => o instanceof Uint8Array,
_12882: o => o instanceof Uint8ClampedArray,
_12883: o => o instanceof Int16Array,
_12884: o => o instanceof Uint16Array,
_12885: o => o instanceof Int32Array,
_12886: o => o instanceof Uint32Array,
_12887: o => o instanceof Float32Array,
_12888: o => o instanceof Float64Array,
_12889: o => o instanceof ArrayBuffer,
_12890: o => o instanceof DataView,
_12891: o => o instanceof Array,
_12892: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true,
_12896: (l, r) => l === r,
_12897: o => o,
_12898: o => o,
_12899: o => o,
_12900: b => !!b,
_12901: o => o.length,
_12904: (o, i) => o[i],
_12905: f => f.dartFunction,
_12906: l => arrayFromDartList(Int8Array, l),
_12907: l => arrayFromDartList(Uint8Array, l),
_12908: l => arrayFromDartList(Uint8ClampedArray, l),
_12909: l => arrayFromDartList(Int16Array, l),
_12910: l => arrayFromDartList(Uint16Array, l),
_12911: l => arrayFromDartList(Int32Array, l),
_12912: l => arrayFromDartList(Uint32Array, l),
_12913: l => arrayFromDartList(Float32Array, l),
_12914: l => arrayFromDartList(Float64Array, l),
_12915: (data, length) => {
const view = new DataView(new ArrayBuffer(length));
for (let i = 0; i < length; i++) {
view.setUint8(i, dartInstance.exports.$byteDataGetUint8(data, i));
}
return view;
},
_12916: l => arrayFromDartList(Array, l),
_12917: stringFromDartString,
_12918: stringToDartString,
_12921: l => new Array(l),
_12925: (o, p) => o[p],
_12929: o => String(o),
_12930: (p, s, f) => p.then(s, f),
_12949: (o, p) => o[p]
};
const baseImports = {
dart2wasm: dart2wasm,
Math: Math,
Date: Date,
Object: Object,
Array: Array,
Reflect: Reflect,
};
const jsStringPolyfill = {
"charCodeAt": (s, i) => s.charCodeAt(i),
"compare": (s1, s2) => {
if (s1 < s2) return -1;
if (s1 > s2) return 1;
return 0;
},
"concat": (s1, s2) => s1 + s2,
"equals": (s1, s2) => s1 === s2,
"fromCharCode": (i) => String.fromCharCode(i),
"length": (s) => s.length,
"substring": (s, a, b) => s.substring(a, b),
};
dartInstance = await WebAssembly.instantiate(await modulePromise, {
...baseImports,
...(await importObjectPromise),
"wasm:js-string": jsStringPolyfill,
});
return dartInstance;
}
// Call the main function for the instantiated module
// `moduleInstance` is the instantiated dart2wasm module
// `args` are any arguments that should be passed into the main function.
export const invoke = (moduleInstance, ...args) => {
const dartMain = moduleInstance.exports.$getMain();
const dartArgs = buildArgsList(args);
moduleInstance.exports.$invokeMain(dartMain, dartArgs);
}

View File

@@ -1,127 +0,0 @@
<html>
<head>
<script src="thermion_dart.js"></script>
<style>
html, body {
margin:0;
padding:0;
}
canvas {
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
width:100%;
height:100%;
}
</style>
</head>
<script type="module">
window.resolveCallback = (cb, data) => {
const fn = window.df.wasmTable.get(cb);
if(data) {
fn(data);
} else {
fn();
}
}
window.createVoidCallback = () => {
let res; //placeholder for resolver callback, outside of promise
const promise = new Promise((resolve, reject) => {
res = resolve;
});
try {
const callback = () => {
try {
res({});
} catch(err) {
console.log(err);
}
}
const fnPtr = window.df.addFunction(callback, 'v');
return [promise, fnPtr];
} catch(err) {
console.log(err);
return null;
}
}
window.createIntCallback = () => {
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
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) => {
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;
}
}
const df = await thermion_dart();
window.df = df;
const dartModulePromise = WebAssembly.compileStreaming(fetch('example_web.wasm'));
const imports = {"thermion_dart":df};
const dart2wasm_runtime = await import('./example_web.mjs');
const moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, imports);
window.example = moduleInstance;
await dart2wasm_runtime.invoke(moduleInstance);
</script>
<body>
<canvas id="canvas"></canvas>
</body>
</html>

View File

@@ -1 +0,0 @@
../../../native/web/build/build/out/dart_filament.js

Some files were not shown because too many files have changed in this diff Show More