summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Pulkki <mikko.pulkki@mapbox.com>2020-04-29 12:26:57 +0300
committerMikko Pulkki <55925868+mpulkki-mapbox@users.noreply.github.com>2020-05-02 17:07:02 +0300
commitc2294ad68d0ac1a3f62cc327cc295c62c4b286eb (patch)
tree883bda2543f4f2ab07e7cfd1e493c128cde4cd7d
parent0895c698d95d8ea35cb7dc35f667736f26f0e098 (diff)
downloadqtlocation-mapboxgl-c2294ad68d0ac1a3f62cc327cc295c62c4b286eb.tar.gz
Move vector types to a public header
-rw-r--r--CMakeLists.txt1
-rw-r--r--include/mbgl/util/vectors.hpp13
-rw-r--r--src/mbgl/util/mat3.hpp4
-rw-r--r--src/mbgl/util/mat4.hpp2
4 files changed, 16 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe079f6d98..8e588c32b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -275,6 +275,7 @@ add_library(
${PROJECT_SOURCE_DIR}/include/mbgl/util/unitbezier.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/util.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/variant.hpp
+ ${PROJECT_SOURCE_DIR}/include/mbgl/util/vectors.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_request.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_task.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/work_task_impl.hpp
diff --git a/include/mbgl/util/vectors.hpp b/include/mbgl/util/vectors.hpp
new file mode 100644
index 0000000000..90371284d4
--- /dev/null
+++ b/include/mbgl/util/vectors.hpp
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <array>
+
+namespace mbgl {
+
+using vec2 = std::array<double, 2>;
+using vec3 = std::array<double, 3>;
+using vec3f = std::array<float, 3>;
+using vec3i = std::array<int, 3>;
+using vec4 = std::array<double, 4>;
+
+} // namespace mbgl \ No newline at end of file
diff --git a/src/mbgl/util/mat3.hpp b/src/mbgl/util/mat3.hpp
index 9690bab00a..cb43505ba5 100644
--- a/src/mbgl/util/mat3.hpp
+++ b/src/mbgl/util/mat3.hpp
@@ -24,12 +24,10 @@
#include <array>
#include <cmath>
+#include <mbgl/util/vectors.hpp>
namespace mbgl {
-using vec3 = std::array<double, 3>;
-using vec3f = std::array<float, 3>;
-using vec3i = std::array<int, 3>;
using mat3 = std::array<double, 9>;
inline vec3 vec3Cross(const vec3& a, const vec3& b) {
diff --git a/src/mbgl/util/mat4.hpp b/src/mbgl/util/mat4.hpp
index 438771949f..5e56ca170b 100644
--- a/src/mbgl/util/mat4.hpp
+++ b/src/mbgl/util/mat4.hpp
@@ -23,10 +23,10 @@
#pragma once
#include <array>
+#include <mbgl/util/vectors.hpp>
namespace mbgl {
-using vec4 = std::array<double, 4>;
using mat4 = std::array<double, 16>;
namespace matrix {