Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'drape/utils/projection.cpp')
-rw-r--r--drape/utils/projection.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/drape/utils/projection.cpp b/drape/utils/projection.cpp
new file mode 100644
index 0000000000..ba7c30c11a
--- /dev/null
+++ b/drape/utils/projection.cpp
@@ -0,0 +1,23 @@
+#include "projection.hpp"
+
+namespace dp
+{
+
+void MakeProjection(array<float, 16> & result, float left, float right, float bottom, float top)
+{
+ result.fill(0.0f);
+
+ float width = right - left;
+ float height = top - bottom;
+ float depth = maxDepth - minDepth;
+
+ result[0] = 2.0f / width;
+ result[3] = -(right + left) / width;
+ result[5] = 2.0f / height;
+ result[7] = -(top + bottom) / height;
+ result[10] = -2.0f / depth;
+ result[11] = -(maxDepth + minDepth) / depth;
+ result[15] = 1.0;
+}
+
+} // namespace dp