add GPU morpher + Dart API
This commit is contained in:
@@ -2,13 +2,18 @@ import 'package:flutter/services.dart';
|
||||
|
||||
abstract class FilamentController {
|
||||
void onFilamentViewCreated(int id);
|
||||
Future initialize();
|
||||
Future initialize({String? materialPath});
|
||||
Future loadSkybox(String skyboxPath, String lightingPath);
|
||||
Future loadGlb(String path);
|
||||
Future loadGltf(String path, String relativeResourcePath);
|
||||
Future loadGltf(
|
||||
String path, String relativeResourcePath, String materialInstanceName);
|
||||
Future panStart(double x, double y);
|
||||
Future panUpdate(double x, double y);
|
||||
Future panEnd();
|
||||
Future applyWeights(List<double> weights, int primitiveIndex);
|
||||
Future createMorpher(String meshName, String entityName,
|
||||
{String? materialName});
|
||||
Future zoom(double z);
|
||||
}
|
||||
|
||||
class MimeticFilamentController extends FilamentController {
|
||||
@@ -22,8 +27,8 @@ class MimeticFilamentController extends FilamentController {
|
||||
}
|
||||
|
||||
@override
|
||||
Future initialize() async {
|
||||
await _channel.invokeMethod("initialize");
|
||||
Future initialize({String? materialPath}) async {
|
||||
await _channel.invokeMethod("initialize", materialPath);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -35,8 +40,10 @@ class MimeticFilamentController extends FilamentController {
|
||||
throw Exception();
|
||||
}
|
||||
|
||||
Future loadGltf(String path, String relativeResourcePath) async {
|
||||
await _channel.invokeMethod("loadGltf", [path, relativeResourcePath]);
|
||||
Future loadGltf(String path, String relativeResourcePath,
|
||||
String materialInstanceName) async {
|
||||
await _channel.invokeMethod(
|
||||
"loadGltf", [path, relativeResourcePath, materialInstanceName]);
|
||||
}
|
||||
|
||||
Future panStart(double x, double y) async {
|
||||
@@ -50,4 +57,18 @@ class MimeticFilamentController extends FilamentController {
|
||||
Future panEnd() async {
|
||||
await _channel.invokeMethod("panEnd");
|
||||
}
|
||||
|
||||
Future applyWeights(List<double> weights, int primitiveIndex) async {
|
||||
await _channel.invokeMethod("applyWeights", [weights, primitiveIndex]);
|
||||
}
|
||||
|
||||
Future zoom(double z) async {
|
||||
await _channel.invokeMethod("zoom", z);
|
||||
}
|
||||
|
||||
Future createMorpher(String meshName, String entityName,
|
||||
{String? materialName}) async {
|
||||
await _channel
|
||||
.invokeMethod("createMorpher", [meshName, entityName, materialName]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user