standard order of scale/translation
This commit is contained in:
@@ -290,7 +290,7 @@ void SceneAsset::transformToUnitCube() {
|
|||||||
void SceneAsset::updateTransform() {
|
void SceneAsset::updateTransform() {
|
||||||
auto &tm = _engine->getTransformManager();
|
auto &tm = _engine->getTransformManager();
|
||||||
auto transform =
|
auto transform =
|
||||||
math::mat4f::scaling(_scale) * _position * _rotation;
|
_position * _rotation * math::mat4f::scaling(_scale);
|
||||||
tm.setTransform(tm.getInstance(_asset->getRoot()), transform);
|
tm.setTransform(tm.getInstance(_asset->getRoot()), transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,12 @@ namespace polyvox {
|
|||||||
// a slot to preload textures
|
// a slot to preload textures
|
||||||
filament::Texture* _texture = nullptr;
|
filament::Texture* _texture = nullptr;
|
||||||
|
|
||||||
|
// initialized to identity
|
||||||
math::mat4f _position;
|
math::mat4f _position;
|
||||||
|
|
||||||
|
// initialized to identity
|
||||||
math::mat4f _rotation;
|
math::mat4f _rotation;
|
||||||
|
|
||||||
float _scale = 1;
|
float _scale = 1;
|
||||||
|
|
||||||
void updateTransform();
|
void updateTransform();
|
||||||
|
|||||||
Reference in New Issue
Block a user