[core] allow changing the orientation

You can now change the orientation of north to be to the right, bottom, left in addition to the default of top
This commit is contained in:
Konstantin Käfer
2015-11-16 16:32:09 +01:00
parent 62412af6ab
commit 4fc8226838
12 changed files with 136 additions and 7 deletions

View File

@@ -133,6 +133,10 @@ public:
void setPitch(double pitch, const Duration& = Duration::zero());
double getPitch() const;
// North Orientation
void setNorthOrientation(NorthOrientation);
NorthOrientation getNorthOrientation() const;
// Size
uint16_t getWidth() const;
uint16_t getHeight() const;

View File

@@ -50,6 +50,8 @@ private:
static std::shared_ptr<const mbgl::SpriteImage>
makeSpriteImage(int width, int height, float pixelRatio);
void nextOrientation();
void addRandomPointAnnotations(int count);
void addRandomShapeAnnotations(int count);
void addRandomCustomPointAnnotations(int count);

View File

@@ -100,6 +100,14 @@ struct MetersBounds {
}
};
// Determines the orientation of the map.
enum class NorthOrientation : uint8_t {
Upwards, // Default
Rightwards,
Downwards,
Leftwards,
};
} // namespace mbgl
#endif

View File

@@ -38,6 +38,7 @@ void perspective(mat4& out, double fovy, double aspect, double near, double far)
void copy(mat4& out, const mat4& a);
void translate(mat4& out, const mat4& a, double x, double y, double z);
void rotate_x(mat4& out, const mat4& a, double rad);
void rotate_y(mat4& out, const mat4& a, double rad);
void rotate_z(mat4& out, const mat4& a, double rad);
void scale(mat4& out, const mat4& a, double x, double y, double z);
void multiply(mat4& out, const mat4& a, const mat4& b);