Compare commits
13 Commits
thermion_f
...
thermion_f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
877eae35cd | ||
|
|
87846b68de | ||
|
|
6581ee8a2a | ||
|
|
951064e657 | ||
|
|
68ebf945a5 | ||
|
|
153817e859 | ||
|
|
ba0bc54fa7 | ||
|
|
9b99975017 | ||
|
|
e6a6862ba4 | ||
|
|
b7d3e9191a | ||
|
|
b461b2c5db | ||
|
|
8f7f48bcaa | ||
|
|
7dc8e394f7 |
80
CHANGELOG.md
80
CHANGELOG.md
@@ -3,6 +3,86 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## 2024-09-25
|
||||
|
||||
### Changes
|
||||
|
||||
---
|
||||
|
||||
Packages with breaking changes:
|
||||
|
||||
- [`thermion_dart` - `v0.2.0-dev.4.0`](#thermion_dart---v020-dev40)
|
||||
- [`thermion_flutter_web` - `v0.1.0-dev.4.0`](#thermion_flutter_web---v010-dev40)
|
||||
|
||||
Packages with other changes:
|
||||
|
||||
- [`thermion_flutter` - `v0.2.0-dev.4.0`](#thermion_flutter---v020-dev40)
|
||||
- [`thermion_flutter_platform_interface` - `v0.2.0-dev.4.0`](#thermion_flutter_platform_interface---v020-dev40)
|
||||
- [`thermion_flutter_ffi` - `v0.2.0-dev.4.0`](#thermion_flutter_ffi---v020-dev40)
|
||||
|
||||
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.2.0-dev.4.0`
|
||||
- `thermion_flutter_platform_interface` - `v0.2.0-dev.4.0`
|
||||
- `thermion_flutter_ffi` - `v0.2.0-dev.4.0`
|
||||
|
||||
---
|
||||
|
||||
#### `thermion_dart` - `v0.2.0-dev.4.0`
|
||||
|
||||
- **BREAKING** **FIX**: (web/wasm) free pick callbacks on dispose.
|
||||
- **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface.
|
||||
|
||||
#### `thermion_flutter_web` - `v0.1.0-dev.4.0`
|
||||
|
||||
- **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface.
|
||||
|
||||
|
||||
## 2024-09-25
|
||||
|
||||
### Changes
|
||||
|
||||
---
|
||||
|
||||
Packages with breaking changes:
|
||||
|
||||
- [`thermion_flutter` - `v0.2.0-dev.3.0`](#thermion_flutter---v020-dev30)
|
||||
|
||||
Packages with other changes:
|
||||
|
||||
- There are no other changes in this release.
|
||||
|
||||
---
|
||||
|
||||
#### `thermion_flutter` - `v0.2.0-dev.3.0`
|
||||
|
||||
- **BREAKING** **FIX**: remove EntityControllerMouseWidget (replace with GestureHandler).
|
||||
- **BREAKING** **CHORE**: (flutter) cleanup for pub.dev publishing.
|
||||
|
||||
|
||||
## 2024-09-25
|
||||
|
||||
### Changes
|
||||
|
||||
---
|
||||
|
||||
Packages with breaking changes:
|
||||
|
||||
- [`thermion_flutter` - `v0.2.0-dev.2.0`](#thermion_flutter---v020-dev20)
|
||||
|
||||
Packages with other changes:
|
||||
|
||||
- There are no other changes in this release.
|
||||
|
||||
---
|
||||
|
||||
#### `thermion_flutter` - `v0.2.0-dev.2.0`
|
||||
|
||||
- **BREAKING** **CHORE**: remove EntityListWidget - will replace with new Scene.
|
||||
|
||||
|
||||
## 2024-09-25
|
||||
|
||||
### Changes
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
## 0.2.0-dev.4.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
- **BREAKING** **FIX**: (web/wasm) free pick callbacks on dispose.
|
||||
- **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface.
|
||||
|
||||
## 0.2.0-dev.1.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
|
||||
class DartResourceLoader {
|
||||
static final _assets = <int, Pointer>{};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Helper function to convert double4x4 to Matrix4
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
import 'dart:ffi';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:thermion_dart/thermion_dart/utils/matrix.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ library thermion_flutter_js;
|
||||
|
||||
import 'dart:js_interop';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/web/thermion_viewer_js_shim.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/web_js/src/thermion_viewer_js_shim.dart';
|
||||
|
||||
import 'package:vector_math/vector_math_64.dart' as v64;
|
||||
import 'package:animation_tools_dart/animation_tools_dart.dart';
|
||||
@@ -400,7 +400,8 @@ class ThermionViewerJSDartBridge {
|
||||
|
||||
@JSExport()
|
||||
JSPromise<JSNumber> getMainCamera() {
|
||||
return viewer.getMainCamera().then((camera) => camera.toJS).toJS;
|
||||
throw UnimplementedError("TODO");
|
||||
// return viewer.getMainCamera().then((camera) => camera.toJS).toJS;
|
||||
}
|
||||
|
||||
@JSExport()
|
||||
@@ -8,6 +8,8 @@ import 'package:logging/logging.dart';
|
||||
import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart';
|
||||
import 'package:thermion_dart/thermion_dart/scene.dart';
|
||||
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/events.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart';
|
||||
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
import 'thermion_viewer_js_shim.dart';
|
||||
@@ -166,9 +168,8 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> loadGlb(String path, {int numInstances = 1}) async {
|
||||
Future<ThermionEntity> loadGlb(String path, {int numInstances = 1, bool keepData=false}) async {
|
||||
var entity = (await _shim.loadGlb(path, numInstances).toDart).toDartInt;
|
||||
scene.registerEntity(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -195,7 +196,7 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> loadGltf(String path, String relativeResourcePath,
|
||||
{bool force = false}) async {
|
||||
{bool keepData = false}) async {
|
||||
throw UnimplementedError();
|
||||
// final ThermionEntity jsEntity = await _shim
|
||||
// .loadGltf(path, relativeResourcePath, force: force)
|
||||
@@ -416,7 +417,7 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> getMainCamera() async {
|
||||
Future<Camera> getMainCamera() async {
|
||||
throw UnimplementedError();
|
||||
// final ThermionEntity jsEntity = await _shim.getMainCamera().toDart;
|
||||
// return ThermionEntity._fromJSObject(jsEntity).toDart;
|
||||
@@ -725,8 +726,9 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> createGeometry(
|
||||
List<double> vertices, List<int> indices,
|
||||
{String? materialPath,
|
||||
Geometry geometry,
|
||||
{
|
||||
bool keepData=false, MaterialInstance? materialInstance,
|
||||
PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async {
|
||||
throw UnimplementedError();
|
||||
// final ThermionEntity jsEntity = await _shim
|
||||
@@ -752,14 +754,6 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
await _shim.setPriority(entityId, priority).toDart;
|
||||
}
|
||||
|
||||
Scene? _scene;
|
||||
|
||||
// @override
|
||||
Scene get scene {
|
||||
_scene ??= SceneImpl(this);
|
||||
return _scene!;
|
||||
}
|
||||
|
||||
AbstractGizmo? get gizmo => null;
|
||||
|
||||
@override
|
||||
@@ -882,7 +876,7 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
double pixelRatio;
|
||||
double pixelRatio = 0.0;
|
||||
|
||||
@override
|
||||
Future createIbl(double r, double g, double b, double intensity) {
|
||||
@@ -946,7 +940,7 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
Stream<ThermionEntity> get lightsRemoved => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false}) {
|
||||
Future<ThermionEntity> loadGlbFromBuffer(Uint8List data, {int numInstances = 1, bool keepData = false, int layer=4, int priority =4 }) {
|
||||
// TODO: implement loadGlbFromBuffer
|
||||
throw UnimplementedError();
|
||||
}
|
||||
@@ -963,11 +957,6 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setCameraLensProjection(double near, double far, double aspect, double focalLength) {
|
||||
// TODO: implement setCameraLensProjection
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setCameraModelMatrix4(Matrix4 matrix) {
|
||||
@@ -1004,4 +993,91 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
// TODO: implement setStencilHighlight
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> addDirectLight(DirectLight light) {
|
||||
// TODO: implement addDirectLight
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity, {int materialIndex = 0, String parameterName = "baseColorMap"}) {
|
||||
// TODO: implement applyTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionTexture> createTexture(Uint8List data) {
|
||||
// TODO: implement createTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance> createUbershaderMaterialInstance({bool doubleSided = false, bool unlit = false, bool hasVertexColors = false, bool hasBaseColorTexture = false, bool hasNormalTexture = false, bool hasOcclusionTexture = false, bool hasEmissiveTexture = false, bool useSpecularGlossiness = false, AlphaMode alphaMode = AlphaMode.OPAQUE, bool enableDiagnostics = false, bool hasMetallicRoughnessTexture = false, int metallicRoughnessUV = 0, int baseColorUV = 0, bool hasClearCoatTexture = false, int clearCoatUV = 0, bool hasClearCoatRoughnessTexture = false, int clearCoatRoughnessUV = 0, bool hasClearCoatNormalTexture = false, int clearCoatNormalUV = 0, bool hasClearCoat = false, bool hasTransmission = false, bool hasTextureTransforms = false, int emissiveUV = 0, int aoUV = 0, int normalUV = 0, bool hasTransmissionTexture = false, int transmissionUV = 0, bool hasSheenColorTexture = false, int sheenColorUV = 0, bool hasSheenRoughnessTexture = false, int sheenRoughnessUV = 0, bool hasVolumeThicknessTexture = false, int volumeThicknessUV = 0, bool hasSheen = false, bool hasIOR = false, bool hasVolume = false}) {
|
||||
// TODO: implement createUbershaderMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance> createUnlitMaterialInstance() {
|
||||
// TODO: implement createUnlitMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future destroyMaterialInstance(covariant MaterialInstance materialInstance) {
|
||||
// TODO: implement destroyMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future destroyTexture(covariant ThermionTexture texture) {
|
||||
// TODO: implement destroyTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> getMainCameraEntity() {
|
||||
// TODO: implement getMainCameraEntity
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance?> getMaterialInstanceAt(ThermionEntity entity, int index) {
|
||||
// TODO: implement getMaterialInstanceAt
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
void requestFrame() {
|
||||
// TODO: implement requestFrame
|
||||
}
|
||||
|
||||
@override
|
||||
// TODO: implement sceneUpdated
|
||||
Stream<SceneUpdateEvent> get sceneUpdated => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future setLayerVisibility(int layer, bool visible) {
|
||||
// TODO: implement setLayerVisibility
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setMaterialPropertyInt(ThermionEntity entity, String propertyName, int materialIndex, int value) {
|
||||
// TODO: implement setMaterialPropertyInt
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setVisibilityLayer(ThermionEntity entity, int layer) {
|
||||
// TODO: implement setVisibilityLayer
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) {
|
||||
// TODO: implement setCameraLensProjection
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
library;
|
||||
|
||||
export 'src/thermion_viewer_dart_bridge.dart';
|
||||
export 'src/thermion_viewer_js_shim.dart';
|
||||
export 'src/thermion_viewer_js.dart';
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
class ThermionWasmCamera extends Camera {
|
||||
|
||||
final int pointer;
|
||||
|
||||
ThermionWasmCamera(this.pointer);
|
||||
|
||||
@override
|
||||
Future setProjectionMatrixWithCulling(
|
||||
Matrix4 projectionMatrix, double near, double far) {
|
||||
// TODO: implement setProjectionMatrixWithCulling
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:thermion_dart/thermion_dart/viewer/shared_types/material.dart';
|
||||
|
||||
class ThermionWasmMaterialInstance extends MaterialInstance {
|
||||
final int pointer;
|
||||
|
||||
ThermionWasmMaterialInstance(this.pointer);
|
||||
@override
|
||||
Future setDepthCullingEnabled(bool enabled) {
|
||||
// TODO: implement setDepthCullingEnabled
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setDepthWriteEnabled(bool enabled) {
|
||||
// TODO: implement setDepthWriteEnabled
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
@@ -7,15 +7,16 @@ import 'dart:typed_data';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:thermion_dart/thermion_dart/entities/abstract_gizmo.dart';
|
||||
import 'package:thermion_dart/thermion_dart/entities/gizmo.dart';
|
||||
import 'package:thermion_dart/thermion_dart/scene.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/events.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/shared_types/camera.dart';
|
||||
import 'package:web/web.dart';
|
||||
import 'package:animation_tools_dart/animation_tools_dart.dart';
|
||||
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
|
||||
export 'thermion_viewer_dart_bridge.dart';
|
||||
import 'camera.dart';
|
||||
import 'material_instance.dart';
|
||||
|
||||
extension type _EmscriptenModule(JSObject _) implements JSObject {
|
||||
external JSAny? ccall(String name, String returnType,
|
||||
@@ -126,8 +127,6 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
_pickCallbackPtr = _module!.addFunction(_onPickCallback.toJS, "viii");
|
||||
_pickGizmoCallbackPtr =
|
||||
_module!.addFunction(_onPickGizmoCallback.toJS, "viii");
|
||||
// _module!.removeFunction(_pickCallbackPtr);
|
||||
// _module!.removeFunction(_pickGizmoCallbackPtr);
|
||||
|
||||
var gizmoOut = _module!._malloc(4 * 4);
|
||||
|
||||
@@ -236,6 +235,8 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
await callback.call();
|
||||
}
|
||||
_onDispose.clear();
|
||||
_module!.removeFunction(_pickCallbackPtr);
|
||||
_module!.removeFunction(_pickGizmoCallbackPtr);
|
||||
}
|
||||
|
||||
void _destroyViewer() {
|
||||
@@ -588,14 +589,9 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> getMainCamera() async {
|
||||
final entityId = _module!.ccall(
|
||||
"get_main_camera", "int", ["void*".toJS].toJS, [_viewer].toJS, null)
|
||||
as JSNumber;
|
||||
if (entityId.toDartInt == -1) {
|
||||
throw Exception("Failed to get main camera");
|
||||
}
|
||||
return entityId.toDartInt;
|
||||
Future<Camera> getMainCamera() async {
|
||||
var mainCameraEntity = await getMainCameraEntity();
|
||||
return ThermionWasmCamera(mainCameraEntity);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -695,7 +691,7 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
Future<ThermionEntity> loadGlbFromBuffer(Uint8List data,
|
||||
{int numInstances = 1}) async {
|
||||
{int numInstances = 1, bool keepData= false, int layer=0, int priority=4}) async {
|
||||
if (numInstances != 1) {
|
||||
throw Exception("TODO");
|
||||
}
|
||||
@@ -717,7 +713,8 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> loadGlb(String path, {int numInstances = 1, bool keepData = false}) async {
|
||||
Future<ThermionEntity> loadGlb(String path,
|
||||
{int numInstances = 1, bool keepData = false}) async {
|
||||
final promise = _module!.ccall(
|
||||
"load_glb",
|
||||
"int",
|
||||
@@ -732,7 +729,8 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> loadGltf(String path, String relativeResourcePath, { bool keepData = false}) async {
|
||||
Future<ThermionEntity> loadGltf(String path, String relativeResourcePath,
|
||||
{bool keepData = false}) async {
|
||||
final promise = _module!.ccall(
|
||||
"load_gltf",
|
||||
"int",
|
||||
@@ -871,9 +869,6 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
Scene get scene => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future setAntiAliasing(bool msaa, bool fxaa, bool taa) async {
|
||||
_module!.ccall(
|
||||
@@ -1146,11 +1141,12 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future createGeometry(List<double> vertices, List<int> indices,
|
||||
{String? materialPath,
|
||||
Future createGeometry(Geometry geometry,
|
||||
{MaterialInstance? materialInstance,
|
||||
bool keepData = false,
|
||||
PrimitiveType primitiveType = PrimitiveType.TRIANGLES}) async {
|
||||
final verticesData = td.Float32List.fromList(vertices);
|
||||
final indicesData = Uint16List.fromList(indices);
|
||||
final verticesData = td.Float32List.fromList(geometry.vertices);
|
||||
final indicesData = Uint16List.fromList(geometry.indices);
|
||||
final verticesPtr = _module!._malloc(verticesData.lengthInBytes);
|
||||
final indicesPtr = _module!._malloc(indicesData.lengthInBytes);
|
||||
_module!.writeArrayToMemory(
|
||||
@@ -1173,11 +1169,11 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
[
|
||||
_viewer!,
|
||||
verticesPtr,
|
||||
vertices.length.toJS,
|
||||
verticesData.length.toJS,
|
||||
indicesPtr,
|
||||
indices.length.toJS,
|
||||
indicesData.length.toJS,
|
||||
primitiveType.index.toJS,
|
||||
materialPath?.toJS ?? "".toJS,
|
||||
(materialInstance as ThermionWasmMaterialInstance?)?.pointer.toJS ?? "".toJS,
|
||||
].toJS,
|
||||
null) as JSNumber;
|
||||
|
||||
@@ -2256,14 +2252,14 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
}
|
||||
|
||||
@override
|
||||
Future setLightDirection(ThermionEntity lightEntity, Vector3 direction) async {
|
||||
Future setLightDirection(
|
||||
ThermionEntity lightEntity, Vector3 direction) async {
|
||||
direction.normalize();
|
||||
_module!.ccall(
|
||||
"set_light_direction",
|
||||
"void",
|
||||
["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS,
|
||||
[_viewer!, direction.x.toJS, direction.y.toJS, direction.z.toJS]
|
||||
.toJS,
|
||||
[_viewer!, direction.x.toJS, direction.y.toJS, direction.z.toJS].toJS,
|
||||
null);
|
||||
}
|
||||
|
||||
@@ -2274,84 +2270,212 @@ class ThermionViewerWasm implements ThermionViewer {
|
||||
"set_light_position",
|
||||
"void",
|
||||
["void*".toJS, "double".toJS, "double".toJS, "double".toJS].toJS,
|
||||
[_viewer!, x.toJS,y.toJS,z.toJS]
|
||||
.toJS,
|
||||
[_viewer!, x.toJS, y.toJS, z.toJS].toJS,
|
||||
null);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future<ThermionEntity?> getAncestor(ThermionEntity entity) {
|
||||
// TODO: implement getAncestor
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future queuePositionUpdateFromViewportCoords(ThermionEntity entity, double x, double y) {
|
||||
Future queuePositionUpdateFromViewportCoords(
|
||||
ThermionEntity entity, double x, double y) {
|
||||
// TODO: implement queuePositionUpdateFromViewportCoords
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future removeStencilHighlight(ThermionEntity entity) {
|
||||
// TODO: implement removeStencilHighlight
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future setStencilHighlight(ThermionEntity entity, {double r = 1.0, double g = 0.0, double b = 0.0}) {
|
||||
Future setStencilHighlight(ThermionEntity entity,
|
||||
{double r = 1.0, double g = 0.0, double b = 0.0}) {
|
||||
// TODO: implement setStencilHighlight
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
// TODO: implement entitiesAdded
|
||||
Stream<ThermionEntity> get entitiesAdded => throw UnimplementedError();
|
||||
|
||||
|
||||
@override
|
||||
// TODO: implement entitiesRemoved
|
||||
Stream<ThermionEntity> get entitiesRemoved => throw UnimplementedError();
|
||||
|
||||
|
||||
@override
|
||||
Future<double> getCameraNear() {
|
||||
// TODO: implement getCameraNear
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future<Aabb2> getViewportBoundingBox(ThermionEntity entity) {
|
||||
// TODO: implement getViewportBoundingBox
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
// TODO: implement lightsAdded
|
||||
Stream<ThermionEntity> get lightsAdded => throw UnimplementedError();
|
||||
|
||||
|
||||
@override
|
||||
// TODO: implement lightsRemoved
|
||||
Stream<ThermionEntity> get lightsRemoved => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future setCameraLensProjection(double near, double far, double aspect, double focalLength) {
|
||||
// TODO: implement setCameraLensProjection
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future setCameraModelMatrix4(Matrix4 matrix) {
|
||||
// TODO: implement setCameraModelMatrix4
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName, int materialIndex, double value) {
|
||||
Future setMaterialPropertyFloat(ThermionEntity entity, String propertyName,
|
||||
int materialIndex, double value) {
|
||||
// TODO: implement setMaterialPropertyFloat
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName, int materialIndex, double f1, double f2, double f3, double f4) {
|
||||
Future setMaterialPropertyFloat4(ThermionEntity entity, String propertyName,
|
||||
int materialIndex, double f1, double f2, double f3, double f4) {
|
||||
// TODO: implement setMaterialPropertyFloat4
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> addDirectLight(DirectLight light) {
|
||||
// TODO: implement addDirectLight
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future applyTexture(covariant ThermionTexture texture, ThermionEntity entity,
|
||||
{int materialIndex = 0, String parameterName = "baseColorMap"}) {
|
||||
// TODO: implement applyTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionTexture> createTexture(td.Uint8List data) {
|
||||
// TODO: implement createTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance> createUbershaderMaterialInstance(
|
||||
{bool doubleSided = false,
|
||||
bool unlit = false,
|
||||
bool hasVertexColors = false,
|
||||
bool hasBaseColorTexture = false,
|
||||
bool hasNormalTexture = false,
|
||||
bool hasOcclusionTexture = false,
|
||||
bool hasEmissiveTexture = false,
|
||||
bool useSpecularGlossiness = false,
|
||||
AlphaMode alphaMode = AlphaMode.OPAQUE,
|
||||
bool enableDiagnostics = false,
|
||||
bool hasMetallicRoughnessTexture = false,
|
||||
int metallicRoughnessUV = 0,
|
||||
int baseColorUV = 0,
|
||||
bool hasClearCoatTexture = false,
|
||||
int clearCoatUV = 0,
|
||||
bool hasClearCoatRoughnessTexture = false,
|
||||
int clearCoatRoughnessUV = 0,
|
||||
bool hasClearCoatNormalTexture = false,
|
||||
int clearCoatNormalUV = 0,
|
||||
bool hasClearCoat = false,
|
||||
bool hasTransmission = false,
|
||||
bool hasTextureTransforms = false,
|
||||
int emissiveUV = 0,
|
||||
int aoUV = 0,
|
||||
int normalUV = 0,
|
||||
bool hasTransmissionTexture = false,
|
||||
int transmissionUV = 0,
|
||||
bool hasSheenColorTexture = false,
|
||||
int sheenColorUV = 0,
|
||||
bool hasSheenRoughnessTexture = false,
|
||||
int sheenRoughnessUV = 0,
|
||||
bool hasVolumeThicknessTexture = false,
|
||||
int volumeThicknessUV = 0,
|
||||
bool hasSheen = false,
|
||||
bool hasIOR = false,
|
||||
bool hasVolume = false}) {
|
||||
// TODO: implement createUbershaderMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance> createUnlitMaterialInstance() {
|
||||
// TODO: implement createUnlitMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future destroyMaterialInstance(covariant MaterialInstance materialInstance) {
|
||||
// TODO: implement destroyMaterialInstance
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future destroyTexture(covariant ThermionTexture texture) {
|
||||
// TODO: implement destroyTexture
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionEntity> getMainCameraEntity() async {
|
||||
final entityId = _module!.ccall(
|
||||
"get_main_camera", "int", ["void*".toJS].toJS, [_viewer].toJS, null)
|
||||
as JSNumber;
|
||||
if (entityId.toDartInt == -1) {
|
||||
throw Exception("Failed to get main camera");
|
||||
}
|
||||
return entityId.toDartInt;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MaterialInstance?> getMaterialInstanceAt(
|
||||
ThermionEntity entity, int index) {
|
||||
// TODO: implement getMaterialInstanceAt
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
void requestFrame() {
|
||||
// TODO: implement requestFrame
|
||||
}
|
||||
|
||||
@override
|
||||
// TODO: implement sceneUpdated
|
||||
Stream<SceneUpdateEvent> get sceneUpdated => throw UnimplementedError();
|
||||
|
||||
@override
|
||||
Future setLayerVisibility(int layer, bool visible) {
|
||||
// TODO: implement setLayerVisibility
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setMaterialPropertyInt(ThermionEntity entity, String propertyName,
|
||||
int materialIndex, int value) {
|
||||
// TODO: implement setMaterialPropertyInt
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setVisibilityLayer(ThermionEntity entity, int layer) {
|
||||
// TODO: implement setVisibilityLayer
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future setCameraLensProjection({double near = kNear, double far = kFar, double? aspect, double focalLength = kFocalLength}) {
|
||||
// TODO: implement setCameraLensProjection
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
library;
|
||||
|
||||
export 'src/thermion_viewer_wasm.dart' show ThermionViewerWasm;
|
||||
@@ -1,6 +1,6 @@
|
||||
name: thermion_dart
|
||||
description: 3D rendering toolkit for Dart.
|
||||
version: 0.2.0-dev.1.0
|
||||
version: 0.2.0-dev.4.0
|
||||
homepage: https://thermion.dev
|
||||
repository: https://github.com/nmfisher/thermion
|
||||
|
||||
@@ -21,4 +21,5 @@ dependencies:
|
||||
dev_dependencies:
|
||||
ffigen: ^12.0.0
|
||||
test:
|
||||
image:
|
||||
image:
|
||||
path:
|
||||
@@ -8,8 +8,8 @@ import 'package:thermion_dart/thermion_dart.dart';
|
||||
import 'package:thermion_dart/thermion_dart/swift/swift_bindings.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart';
|
||||
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
/// Test files are run in a variety of ways, find this package root in all.
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:animation_tools_dart/animation_tools_dart.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:thermion_dart/thermion_dart/utils/geometry.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/events.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import 'helpers.dart';
|
||||
|
||||
@@ -10,8 +10,8 @@ import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:animation_tools_dart/animation_tools_dart.dart';
|
||||
import 'package:thermion_dart/thermion_dart/utils/geometry.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
/// Test files are run in a variety of ways, find this package root in all.
|
||||
|
||||
@@ -8,8 +8,8 @@ import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:thermion_dart/thermion_dart/utils/dart_resources.dart';
|
||||
|
||||
import 'package:test/test.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/thermion_viewer_ffi.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/ffi/src/thermion_viewer_ffi.dart';
|
||||
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
## 0.2.0-dev.4.0
|
||||
|
||||
- Update a dependency to the latest release.
|
||||
|
||||
## 0.2.0-dev.3.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
- **BREAKING** **FIX**: remove EntityControllerMouseWidget (replace with GestureHandler).
|
||||
- **BREAKING** **CHORE**: (flutter) cleanup for pub.dev publishing.
|
||||
|
||||
## 0.2.0-dev.2.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
- **BREAKING** **CHORE**: remove EntityListWidget - will replace with new Scene.
|
||||
|
||||
## 0.2.0-dev.1.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
@@ -115,7 +115,6 @@ class ThermionFlutterPlugin {
|
||||
return ThermionFlutterPlatform.instance.destroyTexture(texture);
|
||||
}
|
||||
|
||||
@override
|
||||
static Future<ThermionFlutterTexture?> resizeTexture(
|
||||
ThermionFlutterTexture texture,
|
||||
int width,
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:thermion_dart/thermion_dart/entities/entity_transform_controller.dart';
|
||||
|
||||
///
|
||||
/// A widget that translates mouse gestures to zoom/pan/rotate actions.
|
||||
///
|
||||
class EntityTransformMouseControllerWidget extends StatelessWidget {
|
||||
final EntityTransformController? transformController;
|
||||
final Widget? child;
|
||||
|
||||
EntityTransformMouseControllerWidget(
|
||||
{Key? key, required this.transformController, this.child})
|
||||
: super(key: key);
|
||||
|
||||
Timer? _timer;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return Listener(
|
||||
onPointerDown: (event) {
|
||||
if (kPrimaryMouseButton & event.buttons != 0) {
|
||||
transformController?.mouse1Down();
|
||||
}
|
||||
},
|
||||
onPointerUp: (event) {
|
||||
if (kPrimaryMouseButton & event.buttons != 0) {
|
||||
transformController?.mouse1Up();
|
||||
}
|
||||
},
|
||||
onPointerHover: (event) {
|
||||
_timer?.cancel();
|
||||
if (event.position.dx < 10) {
|
||||
_timer = Timer.periodic(const Duration(milliseconds: 17), (_) {
|
||||
transformController?.look(-30);
|
||||
});
|
||||
} else if (event.position.dx > constraints.maxWidth - 10) {
|
||||
_timer = Timer.periodic(const Duration(milliseconds: 17), (_) {
|
||||
transformController?.look(30);
|
||||
});
|
||||
} else {
|
||||
transformController?.look(event.delta.dx);
|
||||
}
|
||||
},
|
||||
child: child);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:thermion_flutter/thermion/widgets/debug/child_renderable_widget.dart';
|
||||
import 'package:thermion_flutter/thermion/widgets/debug/skeleton_menu_item_widget.dart';
|
||||
|
||||
class EntityListWidget extends StatefulWidget {
|
||||
final ThermionViewer? controller;
|
||||
|
||||
const EntityListWidget({super.key, required this.controller});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _EntityListWidget();
|
||||
}
|
||||
|
||||
class _EntityListWidget extends State<EntityListWidget> {
|
||||
@override
|
||||
void didUpdateWidget(EntityListWidget oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
}
|
||||
|
||||
Widget _entity(ThermionEntity entity) {
|
||||
return FutureBuilder(
|
||||
future: widget.controller!.getAnimationNames(entity),
|
||||
builder: (_, animations) {
|
||||
if (animations.data == null) {
|
||||
return Container();
|
||||
}
|
||||
final menuController = MenuController();
|
||||
return Row(children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
widget.controller!.scene.select(entity);
|
||||
},
|
||||
child: Text(entity.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
entity == widget.controller!.scene.selected
|
||||
? FontWeight.bold
|
||||
: FontWeight.normal)))),
|
||||
MenuAnchor(
|
||||
controller: menuController,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
icon: const Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
menuController.open();
|
||||
},
|
||||
)),
|
||||
menuChildren: [
|
||||
MenuItemButton(
|
||||
child: const Text("Remove"),
|
||||
onPressed: () async {
|
||||
await widget.controller!.removeEntity(entity);
|
||||
}),
|
||||
MenuItemButton(
|
||||
child: const Text("Transform to unit cube"),
|
||||
onPressed: () async {
|
||||
await widget.controller!.transformToUnitCube(entity);
|
||||
}),
|
||||
SubmenuButton(
|
||||
child: const Text("Animations"),
|
||||
menuChildren: animations.data!
|
||||
.map((a) => SubmenuButton(
|
||||
child: Text(a),
|
||||
menuChildren: [
|
||||
MenuItemButton(
|
||||
child: Text("Play"),
|
||||
onPressed: () async {
|
||||
await widget.controller!
|
||||
.addAnimationComponent(entity);
|
||||
widget.controller!.playAnimation(entity,
|
||||
animations.data!.indexOf(a));
|
||||
},
|
||||
),
|
||||
MenuItemButton(
|
||||
child: Text("Loop"),
|
||||
onPressed: () async {
|
||||
await widget.controller!
|
||||
.addAnimationComponent(entity);
|
||||
widget.controller!.playAnimation(
|
||||
entity, animations.data!.indexOf(a),
|
||||
loop: true);
|
||||
},
|
||||
),
|
||||
MenuItemButton(
|
||||
child: Text("Stop"),
|
||||
onPressed: () async {
|
||||
await widget.controller!
|
||||
.addAnimationComponent(entity);
|
||||
widget.controller!.stopAnimation(
|
||||
entity, animations.data!.indexOf(a));
|
||||
},
|
||||
)
|
||||
]))
|
||||
.toList()),
|
||||
ChildRenderableWidget(
|
||||
controller: widget.controller!, entity: entity),
|
||||
SkeletonMenuItemWidget(
|
||||
controller: widget.controller!, entity: entity)
|
||||
])
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _light(ThermionEntity entity) {
|
||||
final controller = MenuController();
|
||||
return Row(children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
widget.controller!.scene.select(entity);
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Text("Light $entity",
|
||||
style: TextStyle(
|
||||
fontWeight: entity == widget.controller!.scene.selected
|
||||
? FontWeight.bold
|
||||
: FontWeight.normal)))),
|
||||
MenuAnchor(
|
||||
controller: controller,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: IconButton(
|
||||
icon: const Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
controller.open();
|
||||
},
|
||||
)),
|
||||
menuChildren: [
|
||||
MenuItemButton(
|
||||
child: const Text("Remove"),
|
||||
onPressed: () async {
|
||||
await widget.controller!.removeLight(entity);
|
||||
})
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.controller == null) {
|
||||
return Container(color: Colors.red);
|
||||
}
|
||||
return FutureBuilder(
|
||||
future: widget.controller!.initialized,
|
||||
builder: (_, snapshot) => snapshot.data != true
|
||||
? Container()
|
||||
: StreamBuilder(
|
||||
stream: widget.controller!.scene.onUpdated,
|
||||
builder: (_, __) => Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 30, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: Colors.white.withOpacity(0.25),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
// reverse: true,
|
||||
children: widget.controller!.scene
|
||||
.listLights()
|
||||
.map(_light)
|
||||
.followedBy(widget.controller!.scene
|
||||
.listEntities()
|
||||
.map(_entity))
|
||||
.cast<Widget>()
|
||||
.toList())))));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:js_util';
|
||||
import 'dart:ui' as ui;
|
||||
import 'dart:ui_web' as ui_web;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:thermion_flutter_web/thermion_flutter_web_options.dart';
|
||||
import 'package:web/web.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -9,9 +10,7 @@ class ThermionWidgetWeb extends StatelessWidget {
|
||||
final ThermionFlutterWebOptions options;
|
||||
|
||||
const ThermionWidgetWeb(
|
||||
{super.key,
|
||||
this.options =
|
||||
const ThermionFlutterWebOptions.empty()});
|
||||
{super.key, this.options = const ThermionFlutterWebOptions.empty()});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -30,6 +29,7 @@ class _ImageCopyingWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ImageCopyingWidgetState extends State<_ImageCopyingWidget> {
|
||||
final _logger = Logger("_ImageCopyingWidgetState");
|
||||
ui.Image? _img;
|
||||
|
||||
@override
|
||||
@@ -51,7 +51,7 @@ class _ImageCopyingWidgetState extends State<_ImageCopyingWidget> {
|
||||
capture();
|
||||
});
|
||||
} catch (err) {
|
||||
print(err);
|
||||
_logger.severe(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,5 +9,6 @@ class ThermionWidgetWeb extends StatefulWidget {
|
||||
const ThermionWidgetWeb({super.key, required this.options});
|
||||
|
||||
@override
|
||||
// ignore: no_logic_in_create_state
|
||||
State<StatefulWidget> createState() => throw Exception();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: thermion_flutter
|
||||
description: Flutter plugin for 3D rendering with the Thermion toolkit.
|
||||
version: 0.2.0-dev.1.0
|
||||
version: 0.2.0-dev.4.0
|
||||
homepage: https://thermion.dev
|
||||
repository: https://github.com/nmfisher/thermion
|
||||
|
||||
@@ -17,11 +17,12 @@ dependencies:
|
||||
plugin_platform_interface: ^2.0.0
|
||||
ffi: ^2.1.2
|
||||
animation_tools_dart: ^0.0.4
|
||||
thermion_dart: ^0.2.0-dev.1.0
|
||||
thermion_flutter_platform_interface: ^0.2.0-dev.1.0
|
||||
thermion_flutter_ffi: ^0.2.0-dev.1.0
|
||||
thermion_flutter_web: ^0.1.0-dev.1.0
|
||||
thermion_dart: ^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
|
||||
thermion_flutter_web: ^0.1.0-dev.4.0
|
||||
logging: ^1.2.0
|
||||
web: ^1.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
## 0.2.0-dev.4.0
|
||||
|
||||
- Update a dependency to the latest release.
|
||||
|
||||
## 0.2.0-dev.1.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: thermion_flutter_ffi
|
||||
description: An FFI interface for the thermion_flutter plugin (all platforms except web).
|
||||
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
|
||||
version: 0.2.0-dev.1.0
|
||||
version: 0.2.0-dev.4.0
|
||||
|
||||
environment:
|
||||
sdk: ">=3.3.0 <4.0.0"
|
||||
@@ -22,8 +22,8 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
plugin_platform_interface: ^2.1.0
|
||||
thermion_flutter_platform_interface: ^0.2.0-dev.1.0
|
||||
thermion_dart: ^0.2.0-dev.1.0
|
||||
thermion_flutter_platform_interface: ^0.2.0-dev.4.0
|
||||
thermion_dart: ^0.2.0-dev.4.0
|
||||
logging: ^1.2.0
|
||||
|
||||
dev_dependencies:
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
## 0.2.0-dev.4.0
|
||||
|
||||
- Update a dependency to the latest release.
|
||||
|
||||
## 0.2.0-dev.1.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: thermion_flutter_platform_interface
|
||||
description: A common platform interface for the thermion_flutter plugin.
|
||||
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
|
||||
version: 0.2.0-dev.1.0
|
||||
version: 0.2.0-dev.4.0
|
||||
|
||||
environment:
|
||||
sdk: ">=3.3.0 <4.0.0"
|
||||
@@ -11,7 +11,7 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
plugin_platform_interface: ^2.1.0
|
||||
thermion_dart: ^0.2.0-dev.1.0
|
||||
thermion_dart: ^0.2.0-dev.4.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
## 0.1.0-dev.4.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
- **BREAKING** **CHORE**: restructure viewer folders as libraries to only export the public interface.
|
||||
|
||||
## 0.1.0-dev.1.0
|
||||
|
||||
> Note: This release has breaking changes.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:thermion_dart/thermion_dart/compatibility/web/interop/thermion_viewer_wasm.dart';
|
||||
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
|
||||
import 'package:thermion_dart/thermion_dart/viewer/web_wasm/src/thermion_viewer_wasm.dart';
|
||||
import 'package:thermion_flutter_platform_interface/thermion_flutter_platform_interface.dart';
|
||||
import 'package:thermion_flutter_platform_interface/thermion_flutter_texture.dart';
|
||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
||||
@@ -7,6 +7,7 @@ import 'package:thermion_flutter_web/thermion_flutter_web_options.dart';
|
||||
import 'package:web/web.dart';
|
||||
|
||||
class ThermionFlutterWebPlugin extends ThermionFlutterPlatform {
|
||||
|
||||
ThermionViewerWasm? _viewer;
|
||||
|
||||
static void registerWith(Registrar registrar) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: thermion_flutter_web
|
||||
description: A web platform interface for the thermion_flutter plugin.
|
||||
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
|
||||
version: 0.1.0-dev.1.0
|
||||
version: 0.1.0-dev.4.0
|
||||
|
||||
environment:
|
||||
sdk: ">=3.3.0 <4.0.0"
|
||||
@@ -20,8 +20,8 @@ dependencies:
|
||||
sdk: flutter
|
||||
plugin_platform_interface: ^2.1.0
|
||||
web: ^1.0.0
|
||||
thermion_dart: ^0.2.0-dev.1.0
|
||||
thermion_flutter_platform_interface: ^0.2.0-dev.1.0
|
||||
thermion_dart: ^0.2.0-dev.4.0
|
||||
thermion_flutter_platform_interface: ^0.2.0-dev.4.0
|
||||
flutter_web_plugins:
|
||||
sdk: flutter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user