From 4afea4413c2c2946f2e0667fd6bce5d061c20353 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 15 Aug 2022 18:59:58 +1000 Subject: [PATCH] cleanup unused mat transforms --- ios/src/FilamentViewer.cpp | 40 ++---------------------------------- lib/filament_controller.dart | 5 +++++ 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/ios/src/FilamentViewer.cpp b/ios/src/FilamentViewer.cpp index e5cb8a01..43d1eaab 100644 --- a/ios/src/FilamentViewer.cpp +++ b/ios/src/FilamentViewer.cpp @@ -13,15 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include "FilamentViewer.hpp" - -#include "StreamBufferAdapter.hpp" - #include #include #include - #include #include #include @@ -41,7 +35,6 @@ #include #include - #include #include @@ -67,12 +60,13 @@ #include "Log.hpp" #include "SceneResources.hpp" #include "image/imagematerial.h" +#include "FilamentViewer.hpp" +#include "StreamBufferAdapter.hpp" using namespace filament; using namespace filament::math; using namespace gltfio; using namespace utils; - using namespace image; namespace filament { @@ -89,36 +83,6 @@ const float kAperture = 16.0f; const float kShutterSpeed = 1.0f / 125.0f; const float kSensitivity = 100.0f; -// filament::math::mat4f composeMatrix(const filament::math::float3 -// &translation, -// const filament::math::quatf &rotation, -// const filament::math::float3 &scale) -// { -// float tx = translation[0]; -// float ty = translation[1]; -// float tz = translation[2]; -// float qx = rotation[0]; -// float qy = rotation[1]; -// float qz = rotation[2]; -// float qw = rotation[3]; -// float sx = scale[0]; -// float sy = scale[1]; -// float sz = scale[2]; -// return filament::math::mat4f( -// (1 - 2 * qy * qy - 2 * qz * qz) * sx, -// (2 * qx * qy + 2 * qz * qw) * sx, -// (2 * qx * qz - 2 * qy * qw) * sx, -// 0.f, -// (2 * qx * qy - 2 * qz * qw) * sy, -// (1 - 2 * qx * qx - 2 * qz * qz) * sy, -// (2 * qy * qz + 2 * qx * qw) * sy, -// 0.f, -// (2 * qx * qz + 2 * qy * qw) * sz, -// (2 * qy * qz - 2 * qx * qw) * sz, -// (1 - 2 * qx * qx - 2 * qy * qy) * sz, -// 0.f, tx, ty, tz, 1.f); -// } - FilamentViewer::FilamentViewer(void *layer, LoadResource loadResource, FreeResource freeResource) : _layer(layer), _loadResource(loadResource), _freeResource(freeResource) { diff --git a/lib/filament_controller.dart b/lib/filament_controller.dart index e9a4cd06..c0070a26 100644 --- a/lib/filament_controller.dart +++ b/lib/filament_controller.dart @@ -28,6 +28,7 @@ abstract class FilamentController { Future playAnimations(FilamentAsset asset, List indices, {bool loop = false}); Future stopAnimation(FilamentAsset asset); Future setCamera(FilamentAsset asset, String name); + Future setTexture(FilamentAsset asset, String assetPath, { int renderableIndex=0}); /// /// Set the weights of all morph targets in the mesh to the specified weights at successive frames (where each frame requires a duration of [frameLengthInMs]. @@ -177,4 +178,8 @@ class PolyvoxFilamentController extends FilamentController { Future setCamera(FilamentAsset asset, String name) async { await _channel.invokeMethod("setCamera", [asset, name]); } + + Future setTexture(FilamentAsset asset, String assetPath, { int renderableIndex=0}) async { + await _channel.invokeMethod("setTexture", [asset, assetPath, renderableIndex]); + } }