Merge branch 'master' into develop

This commit is contained in:
Nick Fisher
2024-10-25 11:42:00 +08:00
14 changed files with 882 additions and 913 deletions

View File

@@ -3,6 +3,81 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 2024-10-25
### 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.12`](#thermion_dart---v021-dev0012)
- [`thermion_flutter` - `v0.2.1-dev.12`](#thermion_flutter---v021-dev12)
- [`thermion_flutter_web` - `v0.2.0+3`](#thermion_flutter_web---v0203)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.12`](#thermion_flutter_platform_interface---v021-dev12)
- [`thermion_flutter_ffi` - `v0.2.1-dev.12`](#thermion_flutter_ffi---v021-dev12)
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.2.0+3`
- `thermion_flutter_platform_interface` - `v0.2.1-dev.12`
- `thermion_flutter_ffi` - `v0.2.1-dev.12`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.12`
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FEAT**: add SCALE2_MOVE InputType.
- **FEAT**: add SCALE2_MOVE InputType.
#### `thermion_flutter` - `v0.2.1-dev.12`
- **FIX**: (flutter) (windows) remove deleted source file from Windows CMakeLists.
## 2024-10-25
### 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.12`](#thermion_dart---v021-dev0012)
- [`thermion_flutter_web` - `v0.2.0+2`](#thermion_flutter_web---v0202)
- [`thermion_flutter_platform_interface` - `v0.2.1-dev.11`](#thermion_flutter_platform_interface---v021-dev11)
- [`thermion_flutter_ffi` - `v0.2.1-dev.11`](#thermion_flutter_ffi---v021-dev11)
- [`thermion_flutter` - `v0.2.1-dev.11`](#thermion_flutter---v021-dev11)
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.2.0+2`
- `thermion_flutter_platform_interface` - `v0.2.1-dev.11`
- `thermion_flutter_ffi` - `v0.2.1-dev.11`
- `thermion_flutter` - `v0.2.1-dev.11`
---
#### `thermion_dart` - `v0.2.1-dev.0.0.12`
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FEAT**: add SCALE2_MOVE InputType.
## 2024-10-24
### Changes

View File

@@ -1,3 +1,15 @@
## 0.2.1-dev.0.0.12
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FEAT**: add SCALE2_MOVE InputType.
- **FEAT**: add SCALE2_MOVE InputType.
## 0.2.1-dev.0.0.12
- **FIX**: properly pass through loadResourcesAsync flag for loadGlbFromBuffer.
- **FEAT**: add SCALE2_MOVE InputType.
## 0.2.1-dev.0.0.11
> Note: This release has breaking changes.

View File

@@ -1,6 +1,6 @@
name: thermion_dart
description: 3D rendering toolkit for Dart.
version: 0.2.1-dev.0.0.11
version: 0.2.1-dev.0.0.12
homepage: https://thermion.dev
repository: https://github.com/nmfisher/thermion

File diff suppressed because it is too large Load Diff

View File

@@ -1,81 +0,0 @@
import 'dart:ffi';
import 'dart:io';
import 'dart:math';
import 'package:ffi/ffi.dart';
import 'package:test/test.dart';
import 'swift/swift_bindings.g.dart';
import 'package:thermion_dart/src/utils/src/dart_resources.dart';
import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart';
import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart';
import 'package:thermion_dart/thermion_dart.dart';
import 'package:vector_math/vector_math_64.dart';
/// Test files are run in a variety of ways, find this package root in all.
///
/// Test files can be run from source from any working directory. The Dart SDK
/// `tools/test.py` runs them from the root of the SDK for example.
///
/// Test files can be run from dill from the root of package. `package:test`
/// does this.
Uri findPackageRoot(String packageName) {
final script = Platform.script;
final fileName = script.name;
// We're likely running from source.
var directory = script.resolve('.');
while (true) {
final dirName = directory.name;
if (dirName == packageName) {
return directory;
}
final parent = directory.resolve('..');
if (parent == directory) break;
directory = parent;
}
throw StateError("Could not find package root for package '$packageName'. "
'Tried finding the package root via Platform.script '
"'${Platform.script.toFilePath()}' and Directory.current "
"'${Directory.current.uri.toFilePath()}'.");
}
extension on Uri {
String get name => pathSegments.where((e) => e != '').last;
}
late String testDir;
void main() async {
final packageUri = findPackageRoot('thermion_dart');
testDir = Directory("${packageUri.toFilePath()}/test").path;
final lib = ThermionTexture1(DynamicLibrary.open(
'${packageUri.toFilePath()}/native/lib/macos/swift/libthermion_swift.dylib'));
final object = ThermionTexture.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);
group('viewport', () {
test('viewport', () async {
var entity = await viewer.createGeometry(GeometryHelper.cube());
await viewer.setCameraPosition(0.0, 0.0, 4.0);
await viewer.setCameraRotation(Quaternion.axisAngle(Vector3(0,0,1), pi/2));
await viewer.queueRelativePositionUpdateWorldAxis(
entity, 250.0, 250.0, 1, 0, 0);
});
});
}

View File

@@ -1,69 +0,0 @@
import 'dart:ffi';
import 'dart:io';
import 'package:ffi/ffi.dart';
import 'swift/swift_bindings.g.dart';
import 'package:thermion_dart/src/utils/src/dart_resources.dart';
import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart';
import 'package:thermion_dart/src/viewer/src/ffi/thermion_viewer_ffi.dart';
/// Test files are run in a variety of ways, find this package root in all.
///
/// Test files can be run from source from any working directory. The Dart SDK
/// `tools/test.py` runs them from the root of the SDK for example.
///
/// Test files can be run from dill from the root of package. `package:test`
/// does this.
Uri findPackageRoot(String packageName) {
final script = Platform.script;
final fileName = script.name;
// We're likely running from source.
var directory = script.resolve('.');
while (true) {
final dirName = directory.name;
if (dirName == packageName) {
return directory;
}
final parent = directory.resolve('..');
if (parent == directory) break;
directory = parent;
}
throw StateError("Could not find package root for package '$packageName'. "
'Tried finding the package root via Platform.script '
"'${Platform.script.toFilePath()}' and Directory.current "
"'${Directory.current.uri.toFilePath()}'.");
}
extension on Uri {
String get name => pathSegments.where((e) => e != '').last;
}
late String testDir;
void main() async {
final packageUri = findPackageRoot('thermion_dart');
testDir = Directory("${packageUri.toFilePath()}/test").path;
final lib = ThermionTexture1(DynamicLibrary.open(
'${packageUri.toFilePath()}/native/lib/macos/swift/libthermion_swift.dylib'));
final object = ThermionTexture.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);
}

View File

@@ -1,3 +1,11 @@
## 0.2.1-dev.12
- **FIX**: (flutter) (windows) remove deleted source file from Windows CMakeLists.
## 0.2.1-dev.11
- Update a dependency to the latest release.
## 0.2.1-dev.10
> Note: This release has breaking changes.

View File

@@ -1,6 +1,6 @@
name: thermion_flutter
description: Flutter plugin for 3D rendering with the Thermion toolkit.
version: 0.2.1-dev.10
version: 0.2.1-dev.12
homepage: https://thermion.dev
repository: https://github.com/nmfisher/thermion
@@ -17,10 +17,10 @@ dependencies:
plugin_platform_interface: ^2.0.0
ffi: ^2.1.2
animation_tools_dart: ^0.1.0
thermion_dart: ^0.2.1-dev.0.0.11
thermion_flutter_platform_interface: ^0.2.1-dev.10
thermion_flutter_ffi: ^0.2.1-dev.10
thermion_flutter_web: ^0.2.0+1
thermion_dart: ^0.2.1-dev.0.0.12
thermion_flutter_platform_interface: ^0.2.1-dev.12
thermion_flutter_ffi: ^0.2.1-dev.12
thermion_flutter_web: ^0.2.0+3
logging: ^1.2.0
web: ^1.0.0

View File

@@ -1,3 +1,11 @@
## 0.2.1-dev.12
- Update a dependency to the latest release.
## 0.2.1-dev.11
- Update a dependency to the latest release.
## 0.2.1-dev.10
- Update a dependency to the latest release.

View File

@@ -1,7 +1,7 @@
name: thermion_flutter_ffi
description: An FFI implementation for thermion_flutter (i.e. all platforms except web).
repository: https://github.com/nmfisher/thermion_flutter/thermion_flutter
version: 0.2.1-dev.10
version: 0.2.1-dev.12
environment:
sdk: ">=3.3.0 <4.0.0"
@@ -23,8 +23,8 @@ dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.1.0
thermion_flutter_platform_interface: ^0.2.1-dev.10
thermion_dart: ^0.2.1-dev.0.0.11
thermion_flutter_platform_interface: ^0.2.1-dev.12
thermion_dart: ^0.2.1-dev.0.0.12
logging: ^1.2.0
dev_dependencies:

View File

@@ -1,3 +1,11 @@
## 0.2.1-dev.12
- Update a dependency to the latest release.
## 0.2.1-dev.11
- Update a dependency to the latest release.
## 0.2.1-dev.10
- Update a dependency to the latest release.

View File

@@ -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.1-dev.10
version: 0.2.1-dev.12
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.1-dev.0.0.11
thermion_dart: ^0.2.1-dev.0.0.12
dev_dependencies:
flutter_test:

View File

@@ -1,3 +1,11 @@
## 0.2.0+3
- Update a dependency to the latest release.
## 0.2.0+2
- Update a dependency to the latest release.
## 0.2.0+1
- Update a dependency to the latest release.

View File

@@ -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.2.0+1
version: 0.2.0+3
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.1-dev.0.0.11
thermion_flutter_platform_interface: ^0.2.1-dev.10
thermion_dart: ^0.2.1-dev.0.0.12
thermion_flutter_platform_interface: ^0.2.1-dev.12
flutter_web_plugins:
sdk: flutter