From 9f3a384296f019b1b3719b39389ae5be995a4d37 Mon Sep 17 00:00:00 2001 From: zmiao Date: Thu, 5 Dec 2019 18:58:48 +0200 Subject: [core] Refactoring transform state (#15956) * [core] Refactoring transform state class * [core] update matrix in transform, Fix precision * [core] Make matrix mutable so that we only update them when needed * [core] Add getters for matrices --- src/mbgl/util/mat4.cpp | 2 +- src/mbgl/util/mat4.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mbgl/util') diff --git a/src/mbgl/util/mat4.cpp b/src/mbgl/util/mat4.cpp index 0ad0d371e5..2f7d35a5be 100644 --- a/src/mbgl/util/mat4.cpp +++ b/src/mbgl/util/mat4.cpp @@ -47,7 +47,7 @@ void identity(mat4& out) { out[15] = 1.0f; } -bool invert(mat4& out, mat4& a) { +bool invert(mat4& out, const mat4& a) { double a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], diff --git a/src/mbgl/util/mat4.hpp b/src/mbgl/util/mat4.hpp index 2adeba8821..438771949f 100644 --- a/src/mbgl/util/mat4.hpp +++ b/src/mbgl/util/mat4.hpp @@ -32,7 +32,7 @@ using mat4 = std::array; namespace matrix { void identity(mat4& out); -bool invert(mat4& out, mat4& a); +bool invert(mat4& out, const mat4& a); void ortho(mat4& out, double left, double right, double bottom, double top, double near, double far); void perspective(mat4& out, double fovy, double aspect, double near, double far); void copy(mat4& out, const mat4& a); -- cgit v1.2.1