package name change
This commit is contained in:
19
.idea/libraries/Dart_SDK.xml
generated
Normal file
19
.idea/libraries/Dart_SDK.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Dart SDK">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/async" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/core" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/html" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/io" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/math" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||||
|
<root url="file:///Users/admin/Downloads/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
10
.idea/modules.xml
generated
Normal file
10
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/holovox_filament.iml" filepath="$PROJECT_DIR$/holovox_filament.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/android/holovox_filament_android.iml" filepath="$PROJECT_DIR$/android/holovox_filament_android.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/example/android/holovox_filament_example_android.iml" filepath="$PROJECT_DIR$/example/android/holovox_filament_example_android.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/runConfigurations/example_lib_main_dart.xml
generated
Normal file
6
.idea/runConfigurations/example_lib_main_dart.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="example/lib/main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
|
||||||
|
<option name="filePath" value="$PROJECT_DIR$/example/lib/main.dart" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
45
.idea/workspace.xml
generated
Normal file
45
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="FileEditorManager">
|
||||||
|
<leaf>
|
||||||
|
<file leaf-file-name="holovox_filament.dart" pinned="false" current-in-tab="true">
|
||||||
|
<entry file="file://$PROJECT_DIR$/lib/holovox_filament.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="main.dart" pinned="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/example/lib/main.dart">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="0">
|
||||||
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
</leaf>
|
||||||
|
</component>
|
||||||
|
<component name="ToolWindowManager">
|
||||||
|
<editor active="true" />
|
||||||
|
<layout>
|
||||||
|
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||||
|
</layout>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectView">
|
||||||
|
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||||
|
</navigator>
|
||||||
|
<panes>
|
||||||
|
<pane id="ProjectPane">
|
||||||
|
<option name="show-excluded-files" value="false" />
|
||||||
|
</pane>
|
||||||
|
</panes>
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||||
|
<property name="dart.analysis.tool.window.force.activate" value="true" />
|
||||||
|
<property name="show.migrate.to.gradle.popup" value="false" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
19
README.md
19
README.md
@@ -1,18 +1,3 @@
|
|||||||
# mimetic_filament
|
# holovox_filament
|
||||||
|
|
||||||
A new flutter plugin project.
|
3D rendering utilities for the Holovox app.
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
This project is a starting point for a Flutter
|
|
||||||
[plug-in package](https://flutter.dev/developing-packages/),
|
|
||||||
a specialized package that includes platform-specific implementation code for
|
|
||||||
Android and/or iOS.
|
|
||||||
|
|
||||||
For help getting started with Flutter, view our
|
|
||||||
[online documentation](https://flutter.dev/docs), which offers tutorials,
|
|
||||||
samples, guidance on mobile development, and a full API reference.
|
|
||||||
|
|
||||||
The plugin project was generated without specifying the `--platforms` flag, no platforms are currently supported.
|
|
||||||
To add platforms, run `flutter create -t plugin --platforms <platforms> .` under the same
|
|
||||||
directory. You can also find a detailed instruction on how to add platforms in the `pubspec.yaml` at https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms.
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
group 'com.example.mimetic_filament'
|
group 'com.example.holovox_filament'
|
||||||
version '1.0-SNAPSHOT'
|
version '1.0-SNAPSHOT'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
rootProject.name = 'mimetic_filament'
|
rootProject.name = 'holovox_filament'
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.mimetic_filament">
|
package="com.example.holovox_filament">
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.mimetic_filament
|
package com.example.holovox_filament
|
||||||
|
|
||||||
import androidx.annotation.NonNull
|
import androidx.annotation.NonNull
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ class MimeticAvatarPlugin: FlutterPlugin, MethodCallHandler {
|
|||||||
private lateinit var channel : MethodChannel
|
private lateinit var channel : MethodChannel
|
||||||
|
|
||||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "mimetic_filament")
|
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "holovox_filament")
|
||||||
channel.setMethodCallHandler(this)
|
channel.setMethodCallHandler(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.mimetic_filament
|
package com.example.holovox_filament
|
||||||
|
|
||||||
import androidx.annotation.NonNull
|
import androidx.annotation.NonNull
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ class MimeticFilamentPlugin: FlutterPlugin, MethodCallHandler {
|
|||||||
private lateinit var channel : MethodChannel
|
private lateinit var channel : MethodChannel
|
||||||
|
|
||||||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "mimetic_filament")
|
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "holovox_filament")
|
||||||
channel.setMethodCallHandler(this)
|
channel.setMethodCallHandler(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.example.mimetic_filament_example"
|
applicationId "com.example.holovox_filament_example"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.mimetic_filament_example">
|
package="com.example.holovox_filament_example">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.mimetic_filament_example">
|
package="com.example.holovox_filament_example">
|
||||||
<application
|
<application
|
||||||
android:label="mimetic_filament_example"
|
android:label="holovox_filament_example"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.mimetic_filament_example
|
package com.example.holovox_filament_example
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.mimetic_filament_example
|
package com.example.holovox_filament_example
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.mimetic_filament_example">
|
package="com.example.holovox_filament_example">
|
||||||
<!-- Flutter needs it to communicate with the running application
|
<!-- Flutter needs it to communicate with the running application
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>mimetic_filament_example</string>
|
<string>holovox_filament_example</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:mimetic_filament/filament_controller.dart';
|
import 'package:holovox_filament/filament_controller.dart';
|
||||||
import 'package:mimetic_filament/view/filament_widget.dart';
|
import 'package:holovox_filament/view/filament_widget.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: mimetic_filament_example
|
name: holovox_filament_example
|
||||||
description: Demonstrates how to use the mimetic_filament plugin.
|
description: Demonstrates how to use the holovox_filament plugin.
|
||||||
|
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
@@ -18,7 +18,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
mimetic_filament:
|
holovox_filament:
|
||||||
path: ../
|
path: ../
|
||||||
|
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'package:mimetic_filament_example/main.dart';
|
import 'package:holovox_filament_example/main.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#
|
#
|
||||||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
|
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
|
||||||
# Run `pod lib lint mimetic_filament.podspec` to validate before publishing.
|
# Run `pod lib lint holovox_filament.podspec` to validate before publishing.
|
||||||
#
|
#
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'mimetic_filament'
|
s.name = 'holovox_filament'
|
||||||
s.version = '0.0.1'
|
s.version = '0.0.1'
|
||||||
s.summary = 'A new flutter plugin project.'
|
s.summary = 'A new flutter plugin project.'
|
||||||
s.description = <<-DESC
|
s.description = <<-DESC
|
||||||
@@ -23,7 +23,7 @@ A new flutter plugin project.
|
|||||||
s.user_target_xcconfig = {
|
s.user_target_xcconfig = {
|
||||||
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
|
'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
|
||||||
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
|
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
|
||||||
'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/include" "${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/src", "${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/morph"',
|
'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/include" "${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/src", "${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/morph"',
|
||||||
'OTHER_CXXFLAGS' => '--std=c++17 -fmodules -fcxx-modules',
|
'OTHER_CXXFLAGS' => '--std=c++17 -fmodules -fcxx-modules',
|
||||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
||||||
#"CLANG_CXX_LIBRARY" => "libc++"
|
#"CLANG_CXX_LIBRARY" => "libc++"
|
||||||
@@ -33,7 +33,7 @@ A new flutter plugin project.
|
|||||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
|
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
|
||||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
||||||
'OTHER_CXXFLAGS' => '--std=c++17 -fmodules -fcxx-modules',
|
'OTHER_CXXFLAGS' => '--std=c++17 -fmodules -fcxx-modules',
|
||||||
'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/include" "${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/src", "${PODS_ROOT}/../.symlinks/plugins/mimetic_filament/ios/morph"',
|
'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/include" "${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/src", "${PODS_ROOT}/../.symlinks/plugins/holovox_filament/ios/morph"',
|
||||||
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
|
'ALWAYS_SEARCH_USER_PATHS' => 'YES',
|
||||||
}
|
}
|
||||||
s.swift_version = '5.0'
|
s.swift_version = '5.0'
|
||||||
@@ -362,7 +362,7 @@ void FilamentViewer::render() {
|
|||||||
_renderer->render(_view);
|
_renderer->render(_view);
|
||||||
_renderer->endFrame();
|
_renderer->endFrame();
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Skipping frame" << std::endl;
|
// std::cout << "Skipping frame" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,14 +396,13 @@ void FilamentViewer::updateMorphAnimation() {
|
|||||||
|
|
||||||
if(morphAnimationBuffer->frameIndex == -1) {
|
if(morphAnimationBuffer->frameIndex == -1) {
|
||||||
morphAnimationBuffer->frameIndex++;
|
morphAnimationBuffer->frameIndex++;
|
||||||
morphAnimationBuffer->lastTime = std::chrono::high_resolution_clock::now();
|
morphAnimationBuffer->startTime = std::chrono::high_resolution_clock::now();
|
||||||
applyWeights(morphAnimationBuffer->frameData, morphAnimationBuffer->numWeights);
|
applyWeights(morphAnimationBuffer->frameData, morphAnimationBuffer->numWeights);
|
||||||
} else {
|
} else {
|
||||||
duration dur = std::chrono::high_resolution_clock::now() - morphAnimationBuffer->lastTime;
|
std::chrono::duration<double, std::milli> dur = std::chrono::high_resolution_clock::now() - morphAnimationBuffer->startTime;
|
||||||
float microsElapsed = dur.count();
|
int frameIndex = dur.count() / morphAnimationBuffer->frameLength;
|
||||||
if(microsElapsed > (morphAnimationBuffer->frameLength * 1000000)) {
|
if(frameIndex != morphAnimationBuffer->frameIndex) {
|
||||||
morphAnimationBuffer->frameIndex++;
|
morphAnimationBuffer->frameIndex = frameIndex;
|
||||||
morphAnimationBuffer->lastTime = std::chrono::high_resolution_clock::now();
|
|
||||||
applyWeights(morphAnimationBuffer->frameData + (morphAnimationBuffer->frameIndex * morphAnimationBuffer->numWeights), morphAnimationBuffer->numWeights);
|
applyWeights(morphAnimationBuffer->frameData + (morphAnimationBuffer->frameIndex * morphAnimationBuffer->numWeights), morphAnimationBuffer->numWeights);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace mimetic {
|
|||||||
int frameIndex = -1;
|
int frameIndex = -1;
|
||||||
int numFrames;
|
int numFrames;
|
||||||
float frameLength;
|
float frameLength;
|
||||||
time_point_t lastTime;
|
time_point_t startTime;
|
||||||
|
|
||||||
float* frameData;
|
float* frameData;
|
||||||
int numWeights;
|
int numWeights;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class MimeticFilamentController extends FilamentController {
|
|||||||
final String materialPath;
|
final String materialPath;
|
||||||
|
|
||||||
MimeticFilamentController(
|
MimeticFilamentController(
|
||||||
{this.materialPath = "packages/mimetic_filament/assets/compiled.mat"});
|
{this.materialPath = "packages/holovox_filament/assets/compiled.mat"});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onFilamentViewCreated(int id) async {
|
void onFilamentViewCreated(int id) async {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:mimetic_filament/filament_controller.dart';
|
|
||||||
import 'package:mimetic_filament/view/filament_widget.dart';
|
import 'filament_controller.dart';
|
||||||
|
import 'view/filament_widget.dart';
|
||||||
|
|
||||||
class GestureDetectingFilamentView extends StatefulWidget {
|
class GestureDetectingFilamentView extends StatefulWidget {
|
||||||
final FilamentController controller;
|
final FilamentController controller;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:mimetic_filament/view/filament_view.dart';
|
import 'package:holovox_filament/view/filament_view.dart';
|
||||||
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
||||||
import '../../filament_controller.dart';
|
|
||||||
|
|
||||||
typedef void FilamentViewCreatedCallback(int id);
|
typedef void FilamentViewCreatedCallback(int id);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: mimetic_filament
|
name: holovox_filament
|
||||||
description: The 3D rendering layer for the Mimetic app.
|
description: The 3D rendering layer for the Mimetic app.
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
131
scratch/material.cpp
Normal file
131
scratch/material.cpp
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
|
||||||
|
|
||||||
|
//VertexBuffer* vBuf = VertexBuffer::Builder()
|
||||||
|
// .vertexCount(numVertices)
|
||||||
|
// .bufferCount(numPrimitives)
|
||||||
|
// .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT4, 0)
|
||||||
|
// .build(*engine);
|
||||||
|
|
||||||
|
//numIndices = maxIndex+1; */
|
||||||
|
//numIndices = prim.indices->count;
|
||||||
|
|
||||||
|
/*indicesBuffer = (uint32_t*)malloc(sizeof(unsigned int) * prim.indices->count);
|
||||||
|
|
||||||
|
//materialInstance->setParameter("vertexIndices", indicesBuffer, numIndices);
|
||||||
|
|
||||||
|
//.require(VertexAttribute::UV0)
|
||||||
|
//.require(MaterialBuilder.VertexAttribute.CUSTOM0)
|
||||||
|
//MaterialBuilder::init();
|
||||||
|
//MaterialBuilder builder = MaterialBuilder()
|
||||||
|
// .name("DefaultMaterial")
|
||||||
|
// .platform(MaterialBuilder::Platform::MOBILE)
|
||||||
|
// .targetApi(MaterialBuilder::TargetApi::ALL)
|
||||||
|
// .optimization(MaterialBuilderBase::Optimization::NONE)
|
||||||
|
// .shading(MaterialBuilder::Shading::LIT)
|
||||||
|
// .parameter(MaterialBuilder::UniformType::FLOAT3, "baseColor")
|
||||||
|
// .parameter(MaterialBuilder::UniformType::INT3, "dimensions")
|
||||||
|
// .parameter(MaterialBuilder::UniformType::FLOAT, numTargets, MaterialBuilder::ParameterPrecision::DEFAULT, "morphTargetWeights")
|
||||||
|
// .parameter(MaterialBuilder::SamplerType::SAMPLER_2D_ARRAY, MaterialBuilder::SamplerFormat::FLOAT, MaterialBuilder::ParameterPrecision::DEFAULT, "morphTargets")
|
||||||
|
// .vertexDomain(VertexDomain::WORLD)
|
||||||
|
// .material(R"SHADER(void material(inout MaterialInputs material) {
|
||||||
|
// prepareMaterial(material);
|
||||||
|
// material.baseColor.rgb = materialParams.baseColor;
|
||||||
|
// })SHADER")
|
||||||
|
// .materialVertex(R"SHADER(
|
||||||
|
// vec3 getMorphTarget(int vertexIndex, int morphTargetIndex) {
|
||||||
|
// // our texture is laid out as (x,y,z) where y is 1, z is the number of morph targets, and x is the number of vertices * 2 (multiplication accounts for position + normal)
|
||||||
|
// // UV coordinates are normalized to (-1,1), so we divide the current vertex index by the total number of vertices to find the correct coordinate for this vertex
|
||||||
|
// vec3 uv = vec3(
|
||||||
|
// (float(vertexIndex) + 0.5) / float(materialParams.dimensions.x),
|
||||||
|
// 0.0f,
|
||||||
|
// //(float(morphTargetIndex) + 0.5f) / float(materialParams.dimensions.z));
|
||||||
|
// float(morphTargetIndex));
|
||||||
|
// return texture(materialParams_morphTargets, uv).xyz;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// void materialVertex(inout MaterialVertexInputs material) {
|
||||||
|
// return;
|
||||||
|
// // for every morph target
|
||||||
|
// for(int morphTargetIndex = 0; morphTargetIndex < materialParams.dimensions.z; morphTargetIndex++) {
|
||||||
|
//
|
||||||
|
// // get the weight to apply
|
||||||
|
// float weight = materialParams.morphTargetWeights[morphTargetIndex];
|
||||||
|
//
|
||||||
|
// // get the ID of this vertex, which will be the x-offset of the position attribute in the texture sampler
|
||||||
|
// int vertexId = getVertexIndex();
|
||||||
|
//
|
||||||
|
// // get the position of the target for this vertex
|
||||||
|
// vec3 morphTargetPosition = getMorphTarget(vertexId, morphTargetIndex);
|
||||||
|
// // update the world position of this vertex
|
||||||
|
// material.worldPosition.xyz += (weight * morphTargetPosition);
|
||||||
|
//
|
||||||
|
// // increment the vertexID by half the size of the texture to get the x-offset of the normal (all positions stored in the first half, all normals stored in the second half)
|
||||||
|
//
|
||||||
|
// vertexId += (materialParams.dimensions.x / 2);
|
||||||
|
//
|
||||||
|
// // get the normal of this target for this vertex
|
||||||
|
// vec3 morphTargetNormal = getMorphTarget(vertexId, morphTargetIndex);
|
||||||
|
// material.worldNormal += (weight * morphTargetNormal);
|
||||||
|
// }
|
||||||
|
// mat4 transform = getWorldFromModelMatrix();
|
||||||
|
// material.worldPosition = mulMat4x4Float3(transform, material.worldPosition.xyz);
|
||||||
|
// })SHADER");
|
||||||
|
//
|
||||||
|
//Package pkg = builder.build(mAsset->mEngine->getJobSystem());
|
||||||
|
//Material* material = Material::Builder().package(pkg.getData(), pkg.getSize())
|
||||||
|
// .build(*mAsset->mEngine);
|
||||||
|
|
||||||
|
//size_t normal_size = sizeof(short4);
|
||||||
|
//assert(textureWidth * (position_size + normal_size) == textureSize);
|
||||||
|
//assert(textureWidth * position_size == textureSize);
|
||||||
|
/*__android_log_print(ANDROID_LOG_INFO, "MyTag", "Expected size %d width at level 0 %d height", Texture::PixelBufferDescriptor::computeDataSize(Texture::Format::RGB,
|
||||||
|
Texture::Type::FLOAT, 24, 1, 4), texture->getWidth(0),texture->getHeight(0)); */
|
||||||
|
|
||||||
|
/* Texture::PixelBufferDescriptor descriptor(
|
||||||
|
textureBuffer,
|
||||||
|
textureSize,
|
||||||
|
Texture::Format::RGB,
|
||||||
|
Texture::Type::FLOAT,
|
||||||
|
4, 0,0, 24,
|
||||||
|
FREE_CALLBACK,
|
||||||
|
nullptr); */
|
||||||
|
|
||||||
|
/*for(int i = 0; i < int(textureSize / sizeof(float)); i++) {
|
||||||
|
__android_log_print(ANDROID_LOG_INFO, "MyTag", "offset %d %f", i, *(textureBuffer+i));
|
||||||
|
//}*/
|
||||||
|
//std::cout << "Checking for " << materialInstanceName << std::endl;
|
||||||
|
//if(materialInstanceName) {
|
||||||
|
// for(int i = 0; i < asset->getMaterialInstanceCount(); i++) {
|
||||||
|
// const char* name = instances[i]->getName();
|
||||||
|
// std::cout << name << std::endl;
|
||||||
|
// if(strcmp(name, materialInstanceName) == 0) {
|
||||||
|
// materialInstance = instances[i];
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//} else {
|
||||||
|
// materialInstance = instances[0];
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//if(!materialInstance) {
|
||||||
|
// exit(-1);
|
||||||
|
//}
|
||||||
|
|
||||||
|
// std::cout << std::endl;
|
||||||
|
/* for (int i = 0; i < 4; i++) {
|
||||||
|
morphHelperPrim.positions[i] = gltfioPrim.morphPositions[i];
|
||||||
|
morphHelperPrim.tangents[i] = gltfioPrim.morphTangents[i];
|
||||||
|
} */
|
||||||
|
|
||||||
|
// applyTextures(materialInstance);
|
||||||
|
|
||||||
|
/* const Entity* entities = mAsset->getEntities();
|
||||||
|
for(int i=0; i < mAsset->getEntityCount();i++) {
|
||||||
|
std::cout << mAsset->getName(entities[i]);
|
||||||
|
} */
|
||||||
|
|
||||||
|
// Entity entity = mAsset->getFirstEntityByName(entityName);
|
||||||
|
// RenderableManager::Instance rInst = mAsset->mEngine->getRenderableManager().getInstance(entity);
|
||||||
|
// for(int i = 0; i<num_primitives;i++) {
|
||||||
|
// mAsset->mEngine->getRenderableManager().setMaterialInstanceAt(rInst, i, materialInstance);
|
||||||
|
// }
|
||||||
@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
const MethodChannel channel = MethodChannel('mimetic_filament');
|
const MethodChannel channel = MethodChannel('holovox_filament');
|
||||||
|
|
||||||
TestWidgetsFlutterBinding.ensureInitialized();
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user