initial work to split into dart_filament and flutter_filament

This commit is contained in:
Nick Fisher
2024-04-30 12:07:26 +08:00
parent b81f34cd29
commit 8f9e309c34
1624 changed files with 165260 additions and 6619 deletions

View File

@@ -0,0 +1,4 @@
{
"flutterSdkVersion": "3.16.0-0.2.pre",
"flavors": {}
}

30
flutter_filament/example/.gitattributes vendored Normal file
View File

@@ -0,0 +1,30 @@
assets/lit_opaque_43.uberz filter=lfs diff=lfs merge=lfs -text
assets/BusterDrone filter=lfs diff=lfs merge=lfs -text
assets/FlightHelmet filter=lfs diff=lfs merge=lfs -text
assets/lit_opaque_32.uberz filter=lfs diff=lfs merge=lfs -text
windows/lib/**/*.* filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/12_Settonemappingtolinear.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/3_loadIBL.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/6_zoomin.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/13_Movecameratoasset.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/14_movecamerato.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/7_rotate.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/9_transformtounitcube.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/0_fresh.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/10_setshapespositionto.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/2_loadskybox.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/4_Renderingfalse.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/8_pan.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/11_Disablefrustumculling.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/15_setcameratofirstcamerainshapesGLB.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/1_createviewerdefaultubershader.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/5_loadshapesGLB.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/16_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/3_loadskybox.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/4_loadIBL.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/19_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/17_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/2_Renderingfalse.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/18_resize.png filter=lfs diff=lfs merge=lfs -text
integration_test/goldens/ios/diffs filter=lfs diff=lfs merge=lfs -text

51
flutter_filament/example/.gitignore vendored Normal file
View File

@@ -0,0 +1,51 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
/android/.cxx/**/*
# fvm
.fvm/flutter_sdk

View File

@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "12d54de962782853206992fedce29723fcb4a95b"
channel: "master"
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 12d54de962782853206992fedce29723fcb4a95b
base_revision: 12d54de962782853206992fedce29723fcb4a95b
- platform: macos
create_revision: 12d54de962782853206992fedce29723fcb4a95b
base_revision: 12d54de962782853206992fedce29723fcb4a95b
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@@ -0,0 +1,21 @@
# flutter_filament_example
Demonstrates how to use the flutter_filament plugin.
## Linux
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/usr/lib64/pkgconfig/
export CPLUS_INCLUDE_PATH=/usr/include/gtk-3.0/:/usr/include/pango-1.0/:/usr/include/harfbuzz:/usr/include/cairo/:/usr/include/gdk-pixbuf-2.0/:/usr/include/atk-1.0/
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
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.

View File

@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

View File

@@ -0,0 +1,15 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
.cxx/
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks

View File

@@ -0,0 +1,81 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 34
ndkVersion "25.2.9519653"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "app.polyvox.flutter_filament_example"
minSdkVersion 22
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
ndk {
abiFilters 'arm64-v8a' // 'x86_64' 'armeabi-v7a'
}
}
buildTypes {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.core:core:1.7.0"
implementation 'net.java.dev.jna:jna:5.10.0@aar'
}

View File

@@ -0,0 +1,9 @@
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn java.awt.*
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@@ -0,0 +1,46 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:name="${applicationName}"
android:label="flutter_filament_example"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@@ -0,0 +1,10 @@
package app.polyvox.flutter_filament_example
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.TransparencyMode
class MainActivity: FlutterActivity() {
override fun getTransparencyMode(): TransparencyMode {
return TransparencyMode.transparent
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
</resources>

View File

@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.polyvox.flutter_filament_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@@ -0,0 +1,30 @@
buildscript {
ext.kotlin_version = '1.6.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View File

@@ -0,0 +1,9 @@
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.useAndroidX=true
android.enableJetifier=true

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip

View File

@@ -0,0 +1,15 @@
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,16 @@
# 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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

View File

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

View File

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

Binary file not shown.

View File

@@ -0,0 +1,14 @@
material {
name : SolidColor,
shadingModel : unlit,
culling : none,
featureLevel : 1,
vertexDomain: object
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor = vec4(0.1f, 0.5f, 0.9f, 1.0f);
}
}

View File

@@ -0,0 +1,9 @@
#!/bin/bash
device=$1
if [ -z "$device" ]; then
echo "Usage: $0 <device_id>"
exit 1;
fi
rm -f integration_test/goldens/{ios,macos,windows,android}/diffs/*.png
flutter drive --driver=test_driver/integration_test.dart -d $1 --target=integration_test/plugin_integration_test.dart

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,190 @@
import 'dart:async';
import 'dart:io';
import 'dart:ui';
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_filament/widgets/filament_widget.dart';
import '../lib/main.dart' as app;
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
as IntegrationTestWidgetsFlutterBinding;
late String platformIdentifier;
if (Platform.isIOS) {
platformIdentifier = "ios";
} else if (Platform.isAndroid) {
platformIdentifier = "android";
} else if (Platform.isMacOS) {
platformIdentifier = "macos";
} else if (Platform.isWindows) {
platformIdentifier = "windows";
} else if (Platform.isLinux) {
platformIdentifier = "linux";
} else {
throw Exception("Unexpected platform");
}
int _counter = 0;
Future _snapshot(WidgetTester tester, String label, [int seconds = 0]) async {
await tester.pumpAndSettle(Duration(milliseconds: 16));
for (int i = 0; i < seconds; i++) {
await Future.delayed(Duration(seconds: 1));
await tester.pumpAndSettle(Duration(milliseconds: 16));
}
await tester.pumpAndSettle(Duration(milliseconds: 16));
var screenshotPath = '$platformIdentifier/${_counter}_$label';
if (Platform.isIOS) {
// this is currently hanging on Android
// see https://github.com/flutter/flutter/issues/127306
// it is also not yet implemented on Windows or MacOS
await binding.convertFlutterSurfaceToImage();
final bytes = await binding.takeScreenshot(screenshotPath);
}
_counter++;
}
Future tap(WidgetTester tester, String label, [int seconds = 0]) async {
var target = find.text(label, skipOffstage: false);
if (!target.hasFound) {
print("Couldn't find target, waiting 100ms");
await tester.pump(const Duration(milliseconds: 100));
target = find.text(label);
}
await tester.tap(target.first);
await _snapshot(tester, label.replaceAll(RegExp("[ -:]"), ""), seconds);
}
Future<void> pumpUntilFound(
WidgetTester tester,
Finder finder, {
Duration timeout = const Duration(seconds: 30),
}) async {
bool timerDone = false;
final timer = Timer(
timeout, () => throw TimeoutException("Pump until has timed out"));
while (timerDone != true) {
await tester.pump();
final found = tester.any(finder);
if (found) {
timerDone = true;
}
}
timer.cancel();
}
testWidgets('test', (WidgetTester tester) async {
app.main();
await pumpUntilFound(tester, find.byType(app.ExampleWidget));
await tester.pumpAndSettle();
await _snapshot(tester, "fresh");
await tap(tester, "Controller / Viewer");
await tap(tester, "Create FlutterFilamentPlugin (default ubershader)");
await tap(tester, "Controller / Viewer");
await tap(tester, "Create FilamentViewer",
4); // on older devices this may take a while, so let's insert a length delay
await tap(tester, "Scene");
await tap(tester, "Rendering");
await tap(tester, "Set continuous rendering to true");
await tap(tester, "Scene");
await tap(tester, "Assets");
await tap(tester, "Shapes");
await tap(tester, "Load GLB");
await tester.pump();
await tap(tester, "Scene");
await tap(tester, "Assets");
await tap(tester, "Load skybox", 1);
await tap(tester, "Scene");
await tap(tester, "Assets");
await tap(tester, "Load IBL", 1);
final Offset pointerLocation =
tester.getCenter(find.byType(FilamentWidget));
TestPointer testPointer = TestPointer(1, PointerDeviceKind.mouse);
// scroll/zoom
testPointer.hover(pointerLocation);
await tester.sendEventToBinding(testPointer.scroll(const Offset(0.0, 1.0)));
await tester.pumpAndSettle();
await tester.sendEventToBinding(testPointer.scroll(const Offset(0.0, 1.0)));
await tester.pumpAndSettle();
await _snapshot(tester, "zoomin");
// rotate
testPointer =
TestPointer(1, PointerDeviceKind.mouse, null, kTertiaryButton);
testPointer.hover(pointerLocation);
await tester.sendEventToBinding(testPointer.down(pointerLocation));
await tester.pumpAndSettle();
await tester.sendEventToBinding(
testPointer.move(pointerLocation + Offset(10.0, 10.0)));
await tester.pumpAndSettle();
await tester.sendEventToBinding(
testPointer.move(pointerLocation + Offset(20.0, 20.0)));
await tester.pumpAndSettle();
await tester.sendEventToBinding(testPointer.up());
await _snapshot(tester, "rotate", 2);
// pan
testPointer = TestPointer(1, PointerDeviceKind.mouse, null, kPrimaryButton);
testPointer.hover(pointerLocation);
await tester.sendEventToBinding(testPointer.down(pointerLocation));
await tester
.sendEventToBinding(testPointer.move(pointerLocation + Offset(0, 1.0)));
for (int i = 0; i < 60; i++) {
await tester.sendEventToBinding(testPointer
.move(pointerLocation + Offset(i.toDouble() * 2, i.toDouble() * 2)));
await tester.pumpAndSettle();
}
await tester.sendEventToBinding(testPointer.up());
await tester.pumpAndSettle();
await _snapshot(tester, "pan");
await tap(tester, "Scene");
await tap(tester, "Assets");
await tap(tester, "Shapes");
await tap(tester, "Transform to unit cube");
await tap(tester, "Scene");
await tap(tester, "Assets");
await tap(tester, "Shapes");
await tap(tester, "Set position to 1, 1, -1");
await tap(tester, "Scene");
await tap(tester, "Camera");
await tap(tester, "Disable frustum culling");
await tap(tester, "Scene");
await tap(tester, "Rendering");
await tap(tester, "Set tone mapping to linear");
await tap(tester, "Scene");
await tap(tester, "Camera");
await tap(tester, 'Set to first camera in last added asset');
await tap(tester, "Move to last added asset");
await tap(tester, "Move to 1, 1, -1");
await tap(tester, 'Toggle viewport size', 1);
await tap(tester, 'Toggle viewport size', 1);
await tap(tester, 'Toggle viewport size', 1);
});
}

34
flutter_filament/example/ios/.gitignore vendored Normal file
View File

@@ -0,0 +1,34 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

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