merge direct_texture display into master
This commit is contained in:
@@ -56,10 +56,15 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.debug
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile(
|
||||
'proguard-android-optimize.txt'),
|
||||
'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
packagingOptions {
|
||||
|
||||
pickFirst "lib/**/libjnidispatch.so"
|
||||
}
|
||||
aaptOptions {
|
||||
noCompress "ktx"
|
||||
@@ -71,13 +76,10 @@ flutter {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "com.google.android.filament:filament-android:1.17.0"
|
||||
implementation "com.google.android.filament:filament-utils-android:1.17.0"
|
||||
implementation "com.google.android.filament:gltfio-android:1.17.0"
|
||||
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"
|
||||
compile 'net.java.dev.jna:jna:5.10.0@aar'
|
||||
}
|
||||
|
||||
9
example/android/app/proguard-rules.pro
vendored
Normal file
9
example/android/app/proguard-rules.pro
vendored
Normal 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 *; }
|
||||
@@ -1,18 +1,10 @@
|
||||
<?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 off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.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.Light.NoTitleBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
BIN
example/assets/background.ktx
Normal file
BIN
example/assets/background.ktx
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 132 B After Width: | Height: | Size: 572 KiB |
Binary file not shown.
1
example/ios/.gitignore
vendored
1
example/ios/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
**/dgph
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
|
||||
@@ -21,6 +21,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.0</string>
|
||||
<string>11.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,52 +1,21 @@
|
||||
PODS:
|
||||
- Filament (1.12.4):
|
||||
- Filament/camutils (= 1.12.4)
|
||||
- Filament/filamat (= 1.12.4)
|
||||
- Filament/filament (= 1.12.4)
|
||||
- Filament/filameshio (= 1.12.4)
|
||||
- Filament/gltfio_core (= 1.12.4)
|
||||
- Filament/image (= 1.12.4)
|
||||
- Filament/math (= 1.12.4)
|
||||
- Filament/utils (= 1.12.4)
|
||||
- Filament/camutils (1.12.4):
|
||||
- Filament/math
|
||||
- Filament/filamat (1.12.4):
|
||||
- Filament/math
|
||||
- Filament/utils
|
||||
- Filament/filament (1.12.4):
|
||||
- Filament/math
|
||||
- Filament/utils
|
||||
- Filament/filameshio (1.12.4):
|
||||
- Filament/filament
|
||||
- Filament/gltfio_core (1.12.4):
|
||||
- Filament/filament
|
||||
- Filament/image (1.12.4):
|
||||
- Filament/filament
|
||||
- Filament/math (1.12.4)
|
||||
- Filament/utils (1.12.4)
|
||||
- Flutter (1.0.0)
|
||||
- mimetic_filament (0.0.1):
|
||||
- Filament (~> 1.12.4)
|
||||
- polyvox_filament (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- mimetic_filament (from `.symlinks/plugins/mimetic_filament/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Filament
|
||||
- polyvox_filament (from `.symlinks/plugins/polyvox_filament/ios`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
mimetic_filament:
|
||||
:path: ".symlinks/plugins/mimetic_filament/ios"
|
||||
polyvox_filament:
|
||||
:path: ".symlinks/plugins/polyvox_filament/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Filament: 701abb8200237da11b6f74c318f2a875ef309b91
|
||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
||||
mimetic_filament: 786c54c8c204e2898f9ca33c45ea7500042df62a
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
polyvox_filament: 4be2ff351ce253eef46ac9abed088ae6d16fea32
|
||||
|
||||
PODFILE CHECKSUM: 7adbc9d59f05e1b01f554ea99b6c79e97f2214a2
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
8A41CA36A92CBF01E35DB723 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 729293464FDAFA80294C03ED /* Pods_Runner.framework */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
EE85ADA13CE47012212956FB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A258321425FD15835C0E85C8 /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@@ -30,41 +30,14 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0E69A8E4F4FBCA8CA51688D8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
729293464FDAFA80294C03ED /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
797D1F14B06B2A55521439EC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
840FCC12274298BA008E5682 /* libutils.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libutils.a; path = ../../ios/lib/libutils.a; sourceTree = "<group>"; };
|
||||
840FCC13274298BA008E5682 /* libcamutils.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcamutils.a; path = ../../ios/lib/libcamutils.a; sourceTree = "<group>"; };
|
||||
840FCC14274298BA008E5682 /* libmathio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmathio.a; path = ../../ios/lib/libmathio.a; sourceTree = "<group>"; };
|
||||
840FCC15274298BA008E5682 /* libfilamat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilamat.a; path = ../../ios/lib/libfilamat.a; sourceTree = "<group>"; };
|
||||
840FCC16274298BB008E5682 /* libfilabridge.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilabridge.a; path = ../../ios/lib/libfilabridge.a; sourceTree = "<group>"; };
|
||||
840FCC17274298BB008E5682 /* libfilaflat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilaflat.a; path = ../../ios/lib/libfilaflat.a; sourceTree = "<group>"; };
|
||||
840FCC18274298BB008E5682 /* libgltfio_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgltfio_core.a; path = ../../ios/lib/libgltfio_core.a; sourceTree = "<group>"; };
|
||||
840FCC19274298BB008E5682 /* libfilameshio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilameshio.a; path = ../../ios/lib/libfilameshio.a; sourceTree = "<group>"; };
|
||||
840FCC1A274298BB008E5682 /* libgeometry.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeometry.a; path = ../../ios/lib/libgeometry.a; sourceTree = "<group>"; };
|
||||
840FCC1B274298BB008E5682 /* libgltfio_resources_lite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgltfio_resources_lite.a; path = ../../ios/lib/libgltfio_resources_lite.a; sourceTree = "<group>"; };
|
||||
840FCC1C274298BB008E5682 /* libmath.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmath.a; path = ../../ios/lib/libmath.a; sourceTree = "<group>"; };
|
||||
840FCC1D274298BB008E5682 /* libgltfio_resources.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgltfio_resources.a; path = ../../ios/lib/libgltfio_resources.a; sourceTree = "<group>"; };
|
||||
840FCC3527429B1F008E5682 /* libviewer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libviewer.a; path = ../../ios/lib/libviewer.a; sourceTree = "<group>"; };
|
||||
840FCC3627429B1F008E5682 /* libfilament-iblprefilter.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfilament-iblprefilter.a"; path = "../../ios/lib/libfilament-iblprefilter.a"; sourceTree = "<group>"; };
|
||||
840FCC3727429B1F008E5682 /* libibl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libibl.a; path = ../../ios/lib/libibl.a; sourceTree = "<group>"; };
|
||||
840FCC3827429B1F008E5682 /* libimage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libimage.a; path = ../../ios/lib/libimage.a; sourceTree = "<group>"; };
|
||||
840FCC3D27429BEC008E5682 /* libbackend.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbackend.a; path = ../../ios/lib/libbackend.a; sourceTree = "<group>"; };
|
||||
840FCC3E27429BEC008E5682 /* libfilament.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilament.a; path = ../../ios/lib/libfilament.a; sourceTree = "<group>"; };
|
||||
840FCC4127429C5B008E5682 /* libdracodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdracodec.a; path = ../../ios/lib/libdracodec.a; sourceTree = "<group>"; };
|
||||
8444BD13275320B200A5921D /* libOSDependent.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOSDependent.a; path = ../../ios/lib/libOSDependent.a; sourceTree = "<group>"; };
|
||||
84B172F62806081B00C9FD8C /* libsmol-v.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libsmol-v.a"; path = "../../ios/lib/libsmol-v.a"; sourceTree = "<group>"; };
|
||||
84B172F72806081B00C9FD8C /* libmeshoptimizer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmeshoptimizer.a; path = ../../ios/lib/libmeshoptimizer.a; sourceTree = "<group>"; };
|
||||
84B172F82806081C00C9FD8C /* libvkshaders.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvkshaders.a; path = ../../ios/lib/libvkshaders.a; sourceTree = "<group>"; };
|
||||
84B172F92806081C00C9FD8C /* libshaders.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libshaders.a; path = ../../ios/lib/libshaders.a; sourceTree = "<group>"; };
|
||||
84B172FA2806081C00C9FD8C /* libibl-lite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libibl-lite.a"; path = "../../ios/lib/libibl-lite.a"; sourceTree = "<group>"; };
|
||||
84B172FB2806081C00C9FD8C /* libfilamat_lite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfilamat_lite.a; path = ../../ios/lib/libfilamat_lite.a; sourceTree = "<group>"; };
|
||||
84B172FC2806081C00C9FD8C /* libcivetweb.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcivetweb.a; path = ../../ios/lib/libcivetweb.a; sourceTree = "<group>"; };
|
||||
887CF3E1D8F177CD306AEE91 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -72,8 +45,8 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
C38BB8F063815E911BAE04B0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
FCA201E227680DE4C83A0A35 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
A258321425FD15835C0E85C8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E540D86FF0BEABF308A14DBB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -81,13 +54,21 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8A41CA36A92CBF01E35DB723 /* Pods_Runner.framework in Frameworks */,
|
||||
EE85ADA13CE47012212956FB /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
359B21BE5E35E51F8685F431 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A258321425FD15835C0E85C8 /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -105,8 +86,8 @@
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
B35AFB2F8AF234BCF7B9F86F /* Pods */,
|
||||
F66758AA6E5A6218A5D00433 /* Frameworks */,
|
||||
D3880C741B2115E941EC88CD /* Pods */,
|
||||
359B21BE5E35E51F8685F431 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -133,51 +114,16 @@
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B35AFB2F8AF234BCF7B9F86F /* Pods */ = {
|
||||
D3880C741B2115E941EC88CD /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
797D1F14B06B2A55521439EC /* Pods-Runner.debug.xcconfig */,
|
||||
FCA201E227680DE4C83A0A35 /* Pods-Runner.release.xcconfig */,
|
||||
C38BB8F063815E911BAE04B0 /* Pods-Runner.profile.xcconfig */,
|
||||
0E69A8E4F4FBCA8CA51688D8 /* Pods-Runner.debug.xcconfig */,
|
||||
887CF3E1D8F177CD306AEE91 /* Pods-Runner.release.xcconfig */,
|
||||
E540D86FF0BEABF308A14DBB /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F66758AA6E5A6218A5D00433 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84B172FC2806081C00C9FD8C /* libcivetweb.a */,
|
||||
84B172FB2806081C00C9FD8C /* libfilamat_lite.a */,
|
||||
84B172FA2806081C00C9FD8C /* libibl-lite.a */,
|
||||
84B172F72806081B00C9FD8C /* libmeshoptimizer.a */,
|
||||
84B172F92806081C00C9FD8C /* libshaders.a */,
|
||||
84B172F62806081B00C9FD8C /* libsmol-v.a */,
|
||||
84B172F82806081C00C9FD8C /* libvkshaders.a */,
|
||||
8444BD13275320B200A5921D /* libOSDependent.a */,
|
||||
840FCC4127429C5B008E5682 /* libdracodec.a */,
|
||||
840FCC3D27429BEC008E5682 /* libbackend.a */,
|
||||
840FCC3E27429BEC008E5682 /* libfilament.a */,
|
||||
840FCC3627429B1F008E5682 /* libfilament-iblprefilter.a */,
|
||||
840FCC3727429B1F008E5682 /* libibl.a */,
|
||||
840FCC3827429B1F008E5682 /* libimage.a */,
|
||||
840FCC3527429B1F008E5682 /* libviewer.a */,
|
||||
840FCC13274298BA008E5682 /* libcamutils.a */,
|
||||
840FCC16274298BB008E5682 /* libfilabridge.a */,
|
||||
840FCC17274298BB008E5682 /* libfilaflat.a */,
|
||||
840FCC15274298BA008E5682 /* libfilamat.a */,
|
||||
840FCC19274298BB008E5682 /* libfilameshio.a */,
|
||||
840FCC1A274298BB008E5682 /* libgeometry.a */,
|
||||
840FCC18274298BB008E5682 /* libgltfio_core.a */,
|
||||
840FCC1B274298BB008E5682 /* libgltfio_resources_lite.a */,
|
||||
840FCC1D274298BB008E5682 /* libgltfio_resources.a */,
|
||||
840FCC1C274298BB008E5682 /* libmath.a */,
|
||||
840FCC14274298BA008E5682 /* libmathio.a */,
|
||||
840FCC12274298BA008E5682 /* libutils.a */,
|
||||
729293464FDAFA80294C03ED /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -185,7 +131,7 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
3734E56921255BC0B0DCAC3C /* [CP] Check Pods Manifest.lock */,
|
||||
2ED3154DB81A6C5E50B63848 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
@@ -250,7 +196,7 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3734E56921255BC0B0DCAC3C /* [CP] Check Pods Manifest.lock */ = {
|
||||
2ED3154DB81A6C5E50B63848 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
@@ -338,9 +284,8 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -366,12 +311,10 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
@@ -382,7 +325,6 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
@@ -396,23 +338,15 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = 873X6R39HP;
|
||||
DEVELOPMENT_TEAM = TM2B4SJXNJ;
|
||||
ENABLE_BITCODE = NO;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/ios/lib",
|
||||
);
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "app.polyvox.filament-example";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.polyvox.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -423,9 +357,8 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -451,13 +384,11 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
@@ -471,11 +402,9 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -484,9 +413,8 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
@@ -512,12 +440,10 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
@@ -526,10 +452,8 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
@@ -545,23 +469,15 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = 873X6R39HP;
|
||||
DEVELOPMENT_TEAM = TM2B4SJXNJ;
|
||||
ENABLE_BITCODE = NO;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/ios/lib",
|
||||
);
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "app.polyvox.filament-example";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.polyvox.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -576,23 +492,15 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = 873X6R39HP;
|
||||
DEVELOPMENT_TEAM = TM2B4SJXNJ;
|
||||
ENABLE_BITCODE = NO;
|
||||
GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/ios/lib",
|
||||
);
|
||||
PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "app.polyvox.filament-example";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.polyvox.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Example</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -11,7 +13,7 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>polyvox_filament_example</string>
|
||||
<string>example</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
@@ -41,5 +43,9 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:polyvox_filament/filament_controller.dart';
|
||||
import 'package:polyvox_filament/view/filament_widget.dart';
|
||||
import 'package:polyvox_filament/filament_widget.dart';
|
||||
import 'package:polyvox_filament/gesture_detecting_filament_view.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
@@ -18,11 +21,15 @@ class _MyAppState extends State<MyApp> {
|
||||
|
||||
FilamentAsset? _cube;
|
||||
FilamentAsset? _flightHelmet;
|
||||
FilamentLight? _light;
|
||||
|
||||
final weights = List.filled(255, 0.0);
|
||||
List<String> _targets = [];
|
||||
List<String> _targetNames = [];
|
||||
List<String> _animationNames = [];
|
||||
bool _loop = false;
|
||||
bool _vertical = false;
|
||||
bool _rendering = true;
|
||||
int _framerate = 60;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -32,240 +39,349 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
color: Colors.transparent,
|
||||
// showPerformanceOverlay: true,
|
||||
color: Colors.white,
|
||||
home: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(children: [
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
width: 200,
|
||||
child: FilamentWidget(
|
||||
controller: _filamentController,
|
||||
))),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: PopupMenuButton<int>(
|
||||
child: const Icon(Icons.menu),
|
||||
onSelected: (int item) async {
|
||||
switch (item) {
|
||||
case 0:
|
||||
await _filamentController.setBackgroundImage(
|
||||
'assets/background.png');
|
||||
break;
|
||||
case 1:
|
||||
await _filamentController.loadSkybox(
|
||||
'assets/default_env/default_env_skybox.ktx');
|
||||
await _filamentController.loadSkybox(
|
||||
'assets/default_env/default_env_ibl.ktx');
|
||||
break;
|
||||
case 2:
|
||||
await _filamentController.removeSkybox();
|
||||
break;
|
||||
case 3:
|
||||
_cube = await _filamentController
|
||||
.loadGlb('assets/cube.glb');
|
||||
backgroundColor: Colors.white,
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: _vertical ? 200 : 400,
|
||||
height: _vertical ? 400 : 200,
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
child: FilamentGestureDetector(
|
||||
showControls: true,
|
||||
controller: _filamentController,
|
||||
child: FilamentWidget(
|
||||
controller: _filamentController,
|
||||
)),
|
||||
)),
|
||||
Text(
|
||||
"Target names : ${_targetNames.join(",")}, Animation names : ${_animationNames.join(",")}"),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.all(15),
|
||||
child: PopupMenuButton<int>(
|
||||
padding: EdgeInsets.all(50),
|
||||
iconSize: 36,
|
||||
child: const Icon(Icons.menu),
|
||||
onSelected: (int item) async {
|
||||
switch (item) {
|
||||
case -1:
|
||||
await _filamentController.initialize();
|
||||
break;
|
||||
case 0:
|
||||
await _filamentController
|
||||
.setBackgroundImage(
|
||||
'assets/background.ktx');
|
||||
break;
|
||||
case 1:
|
||||
await _filamentController.loadSkybox(
|
||||
'assets/default_env/default_env_skybox.ktx');
|
||||
await _filamentController.loadSkybox(
|
||||
'assets/default_env/default_env_ibl.ktx');
|
||||
break;
|
||||
case 2:
|
||||
await _filamentController.removeSkybox();
|
||||
break;
|
||||
case 3:
|
||||
_cube = await _filamentController
|
||||
.loadGlb('assets/cube.glb');
|
||||
|
||||
_animationNames = await _filamentController
|
||||
.getAnimationNames(_cube!);
|
||||
break;
|
||||
case 4:
|
||||
if (_cube != null) {
|
||||
await _filamentController.removeAsset(_cube!);
|
||||
_animationNames = await _filamentController
|
||||
.getAnimationNames(_cube!);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (_cube != null) {
|
||||
await _filamentController
|
||||
.removeAsset(_cube!);
|
||||
}
|
||||
_cube = await _filamentController.loadGltf(
|
||||
'assets/cube.gltf', 'assets');
|
||||
print(await _filamentController
|
||||
.getAnimationNames(_cube!));
|
||||
break;
|
||||
case 5:
|
||||
if (_flightHelmet == null) {
|
||||
_flightHelmet =
|
||||
await _filamentController.loadGltf(
|
||||
'assets/FlightHelmet/FlightHelmet.gltf',
|
||||
'assets/FlightHelmet');
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
await _filamentController
|
||||
.removeAsset(_cube!);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
await _filamentController.applyWeights(
|
||||
_cube!, List.filled(8, 1.0));
|
||||
break;
|
||||
case 8:
|
||||
await _filamentController.applyWeights(
|
||||
_cube!, List.filled(8, 0));
|
||||
break;
|
||||
case 9:
|
||||
_filamentController.playAnimations(
|
||||
_cube!,
|
||||
List.generate(
|
||||
_animationNames.length, (i) => i),
|
||||
loop: _loop);
|
||||
break;
|
||||
case 10:
|
||||
_filamentController.stopAnimation(
|
||||
_cube!, 0);
|
||||
break;
|
||||
case 11:
|
||||
setState(() {
|
||||
_loop = !_loop;
|
||||
});
|
||||
break;
|
||||
case 14:
|
||||
_filamentController.setCamera(
|
||||
_cube!, "Camera_Orientation");
|
||||
break;
|
||||
case 15:
|
||||
final framerate = 30;
|
||||
final totalSecs = 5;
|
||||
final numWeights = 8;
|
||||
final totalFrames = framerate * totalSecs;
|
||||
final frames = List.generate(
|
||||
totalFrames,
|
||||
(frame) => List.filled(
|
||||
numWeights, frame / totalFrames));
|
||||
|
||||
_filamentController.animate(
|
||||
_cube!,
|
||||
frames.reduce((a, b) => a + b),
|
||||
numWeights,
|
||||
totalFrames,
|
||||
1000 / framerate.toDouble());
|
||||
break;
|
||||
case 16:
|
||||
_targetNames = await _filamentController
|
||||
.getTargetNames(_cube!, "Cube");
|
||||
setState(() {});
|
||||
break;
|
||||
case 17:
|
||||
_animationNames = await _filamentController
|
||||
.getAnimationNames(_cube!);
|
||||
setState(() {});
|
||||
|
||||
break;
|
||||
case 18:
|
||||
await _filamentController.panStart(1, 1);
|
||||
await _filamentController.panUpdate(1, 2);
|
||||
await _filamentController.panEnd();
|
||||
break;
|
||||
case 19:
|
||||
await _filamentController.panStart(1, 1);
|
||||
await _filamentController.panUpdate(0, 0);
|
||||
await _filamentController.panEnd();
|
||||
break;
|
||||
case 20:
|
||||
await _filamentController.clearAssets();
|
||||
break;
|
||||
case 21:
|
||||
await _filamentController.setTexture(
|
||||
_cube!, "assets/background.png");
|
||||
break;
|
||||
case 22:
|
||||
await _filamentController
|
||||
.transformToUnitCube(_cube!);
|
||||
break;
|
||||
case 23:
|
||||
await _filamentController.setPosition(
|
||||
_cube!, 1.0, 1.0, -1.0);
|
||||
break;
|
||||
case 24:
|
||||
await _filamentController.setRotation(
|
||||
_cube!, pi / 2, 0.0, 1.0, 0.0);
|
||||
break;
|
||||
case 25:
|
||||
setState(() {
|
||||
_vertical = !_vertical;
|
||||
});
|
||||
break;
|
||||
case 26:
|
||||
await _filamentController.setCameraPosition(
|
||||
0, 0, 3);
|
||||
await _filamentController.setCameraRotation(
|
||||
0, 0, 1, 0);
|
||||
break;
|
||||
case 27:
|
||||
_framerate = _framerate == 60 ? 30 : 60;
|
||||
await _filamentController
|
||||
.setFrameRate(_framerate);
|
||||
break;
|
||||
case 28:
|
||||
await _filamentController
|
||||
.setBackgroundImagePosition(25, 25);
|
||||
break;
|
||||
case 29:
|
||||
_light = await _filamentController.addLight(
|
||||
2,
|
||||
6500,
|
||||
15000000,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
true);
|
||||
_light = await _filamentController.addLight(
|
||||
2,
|
||||
6500,
|
||||
15000000,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
true);
|
||||
break;
|
||||
case 30:
|
||||
if (_light != null) {
|
||||
await _filamentController
|
||||
.removeLight(_light!);
|
||||
}
|
||||
break;
|
||||
case 31:
|
||||
await _filamentController.clearLights();
|
||||
break;
|
||||
}
|
||||
_cube = await _filamentController.loadGltf(
|
||||
'assets/cube.gltf', 'assets');
|
||||
print(await _filamentController
|
||||
.getAnimationNames(_cube!));
|
||||
break;
|
||||
case 5:
|
||||
if (_flightHelmet == null) {
|
||||
_flightHelmet =
|
||||
await _filamentController.loadGltf(
|
||||
'assets/FlightHelmet/FlightHelmet.gltf',
|
||||
'assets/FlightHelmet');
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
await _filamentController.removeAsset(_cube!);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
await _filamentController.applyWeights(
|
||||
_cube!, List.filled(8, 1.0));
|
||||
break;
|
||||
case 8:
|
||||
await _filamentController.applyWeights(
|
||||
_cube!, List.filled(8, 0));
|
||||
break;
|
||||
case 9:
|
||||
_filamentController.playAnimations(
|
||||
_cube!,
|
||||
List.generate(
|
||||
_animationNames.length, (i) => i),
|
||||
loop: _loop);
|
||||
break;
|
||||
case 10:
|
||||
_filamentController.stopAnimation(_cube!);
|
||||
break;
|
||||
case 11:
|
||||
setState(() {
|
||||
_loop = !_loop;
|
||||
});
|
||||
break;
|
||||
case 12:
|
||||
_filamentController.zoom(-1.0);
|
||||
break;
|
||||
case 13:
|
||||
_filamentController.zoom(1.0);
|
||||
break;
|
||||
case 14:
|
||||
_filamentController.setCamera(
|
||||
_cube!, "Camera_Orientation");
|
||||
break;
|
||||
case 15:
|
||||
final framerate = 30;
|
||||
final totalSecs = 5;
|
||||
final numWeights = 8;
|
||||
final totalFrames = framerate * totalSecs;
|
||||
final frames = List.generate(
|
||||
totalFrames,
|
||||
(frame) => List.filled(
|
||||
numWeights, frame / totalFrames));
|
||||
|
||||
_filamentController.animate(
|
||||
_cube!,
|
||||
frames.reduce((a, b) => a + b),
|
||||
numWeights,
|
||||
totalFrames,
|
||||
1000 / framerate.toDouble());
|
||||
break;
|
||||
case 16:
|
||||
final names = await _filamentController
|
||||
.getTargetNames(_cube!, "Cube");
|
||||
|
||||
await showDialog(
|
||||
builder: (ctx) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
height: 200,
|
||||
width: 200,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: names
|
||||
.map((name) => Text(name))
|
||||
.cast<Widget>()
|
||||
.toList() +
|
||||
<Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(ctx)
|
||||
.pop(),
|
||||
child: Text("Close"))
|
||||
]));
|
||||
},
|
||||
context: context);
|
||||
break;
|
||||
case 17:
|
||||
final names = await _filamentController
|
||||
.getAnimationNames(_cube!);
|
||||
|
||||
await showDialog(
|
||||
builder: (ctx) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
height: 200,
|
||||
width: 200,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: names
|
||||
.map((name) => Text(name))
|
||||
.cast<Widget>()
|
||||
.toList() +
|
||||
<Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(ctx)
|
||||
.pop(),
|
||||
child: Text("Close"))
|
||||
]));
|
||||
},
|
||||
context: context);
|
||||
break;
|
||||
case 18:
|
||||
await _filamentController.panStart(1, 1);
|
||||
await _filamentController.panUpdate(1, 2);
|
||||
await _filamentController.panEnd();
|
||||
break;
|
||||
case 19:
|
||||
await _filamentController.panStart(1, 1);
|
||||
await _filamentController.panUpdate(0, 0);
|
||||
await _filamentController.panEnd();
|
||||
break;
|
||||
case 20:
|
||||
await _filamentController.clearAssets();
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<int>>[
|
||||
const PopupMenuItem(
|
||||
value: 0,
|
||||
child: Text("load background image")),
|
||||
const PopupMenuItem(
|
||||
value: 1,
|
||||
child: Text('load skybox'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 2,
|
||||
child: Text('remove skybox'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 3, child: Text('load cube GLB')),
|
||||
const PopupMenuItem(
|
||||
value: 4, child: Text('load cube GLTF')),
|
||||
const PopupMenuItem(
|
||||
value: 5,
|
||||
child: Text('load flight helmet')),
|
||||
const PopupMenuItem(
|
||||
value: 6, child: Text('remove cube')),
|
||||
const PopupMenuItem(
|
||||
value: 20, child: Text('remove all assets')),
|
||||
const PopupMenuItem(
|
||||
value: 7,
|
||||
child: Text('set all weights to 1')),
|
||||
const PopupMenuItem(
|
||||
value: 8,
|
||||
child: Text('set all weights to 0')),
|
||||
const PopupMenuItem(
|
||||
value: 9,
|
||||
child: Text('play all animations')),
|
||||
const PopupMenuItem(
|
||||
value: 10, child: Text('stop animations')),
|
||||
PopupMenuItem(
|
||||
value: 11,
|
||||
child: Text(
|
||||
"toggle animation loop (currently $_loop!)")),
|
||||
const PopupMenuItem(
|
||||
value: 12, child: Text('zoom in')),
|
||||
const PopupMenuItem(
|
||||
value: 13, child: Text('zoom out')),
|
||||
const PopupMenuItem(
|
||||
value: 14, child: Text('set camera')),
|
||||
const PopupMenuItem(
|
||||
value: 15, child: Text('animate weights')),
|
||||
const PopupMenuItem(
|
||||
value: 16, child: Text('get target names')),
|
||||
const PopupMenuItem(
|
||||
value: 17,
|
||||
child: Text('get animation names')),
|
||||
const PopupMenuItem(
|
||||
value: 18, child: Text('pan left')),
|
||||
const PopupMenuItem(
|
||||
value: 19, child: Text('pan right')),
|
||||
])))
|
||||
])));
|
||||
},
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<int>>[
|
||||
const PopupMenuItem(
|
||||
value: -1, child: Text("initialize")),
|
||||
const PopupMenuItem(
|
||||
value: 0,
|
||||
child: Text("load background image")),
|
||||
const PopupMenuItem(
|
||||
value: 1,
|
||||
child: Text('load skybox'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 2,
|
||||
child: Text('remove skybox'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 3, child: Text('load cube GLB')),
|
||||
const PopupMenuItem(
|
||||
value: 4,
|
||||
child: Text('load cube GLTF')),
|
||||
const PopupMenuItem(
|
||||
value: 21,
|
||||
child: Text('swap cube texture')),
|
||||
const PopupMenuItem(
|
||||
value: 22,
|
||||
child: Text('transform to unit cube')),
|
||||
const PopupMenuItem(
|
||||
value: 23,
|
||||
child:
|
||||
Text('set position to 1, 1, -1')),
|
||||
const PopupMenuItem(
|
||||
value: 24,
|
||||
child:
|
||||
Text('rotate by pi around Y axis')),
|
||||
const PopupMenuItem(
|
||||
value: 5,
|
||||
child: Text('load flight helmet')),
|
||||
const PopupMenuItem(
|
||||
value: 6, child: Text('remove cube')),
|
||||
const PopupMenuItem(
|
||||
value: 20,
|
||||
child: Text('clear all assets')),
|
||||
const PopupMenuItem(
|
||||
value: 7,
|
||||
child: Text('set all weights to 1')),
|
||||
const PopupMenuItem(
|
||||
value: 8,
|
||||
child: Text('set all weights to 0')),
|
||||
const PopupMenuItem(
|
||||
value: 9,
|
||||
child: Text('play all animations')),
|
||||
const PopupMenuItem(
|
||||
value: 10,
|
||||
child: Text('stop animations')),
|
||||
PopupMenuItem(
|
||||
value: 11,
|
||||
child: Text(_loop
|
||||
? "don't loop animation"
|
||||
: "loop animation")),
|
||||
const PopupMenuItem(
|
||||
value: 14, child: Text('set camera')),
|
||||
const PopupMenuItem(
|
||||
value: 15,
|
||||
child: Text('animate weights')),
|
||||
const PopupMenuItem(
|
||||
value: 16,
|
||||
child: Text('get target names')),
|
||||
const PopupMenuItem(
|
||||
value: 17,
|
||||
child: Text('get animation names')),
|
||||
const PopupMenuItem(
|
||||
value: 18, child: Text('pan left')),
|
||||
const PopupMenuItem(
|
||||
value: 19, child: Text('pan right')),
|
||||
PopupMenuItem(
|
||||
value: 25,
|
||||
child: Text(_vertical
|
||||
? 'set horizontal'
|
||||
: 'set vertical')),
|
||||
PopupMenuItem(
|
||||
value: 26,
|
||||
child: Text('set camera pos to 0,0,3')),
|
||||
PopupMenuItem(
|
||||
value: 27,
|
||||
child: Text('toggle framerate')),
|
||||
PopupMenuItem(
|
||||
value: 28,
|
||||
child: Text('set bg image pos')),
|
||||
PopupMenuItem(
|
||||
value: 29, child: Text('add light')),
|
||||
PopupMenuItem(
|
||||
value: 30, child: Text('remove light')),
|
||||
PopupMenuItem(
|
||||
value: 31,
|
||||
child: Text('clear all lights')),
|
||||
]))),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: Row(children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_rendering = !_rendering;
|
||||
_filamentController.setRendering(_rendering);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.all(50),
|
||||
child: Text("Rendering: $_rendering "))),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_framerate = _framerate == 60 ? 30 : 60;
|
||||
_filamentController.setFrameRate(_framerate);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.all(50),
|
||||
child: Text("$_framerate fps")))
|
||||
]))
|
||||
])));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user