diff --git a/ios/src/SceneAsset.cpp b/ios/src/SceneAsset.cpp index a8e972cf..38176038 100644 --- a/ios/src/SceneAsset.cpp +++ b/ios/src/SceneAsset.cpp @@ -290,7 +290,7 @@ void SceneAsset::transformToUnitCube() { void SceneAsset::updateTransform() { auto &tm = _engine->getTransformManager(); auto transform = - math::mat4f::scaling(_scale) * _position * _rotation; + _position * _rotation * math::mat4f::scaling(_scale); tm.setTransform(tm.getInstance(_asset->getRoot()), transform); } diff --git a/ios/src/SceneAsset.hpp b/ios/src/SceneAsset.hpp index 61e33a55..4305a0be 100644 --- a/ios/src/SceneAsset.hpp +++ b/ios/src/SceneAsset.hpp @@ -108,8 +108,12 @@ namespace polyvox { // a slot to preload textures filament::Texture* _texture = nullptr; + // initialized to identity math::mat4f _position; + + // initialized to identity math::mat4f _rotation; + float _scale = 1; void updateTransform();