port minor collision code cleanup, fix #1705

https://github.com/mapbox/mapbox-gl-js/pull/1261
This commit is contained in:
Ansis Brammanis
2015-08-20 13:18:48 -04:00
parent 19c256e349
commit 99c5976498
11 changed files with 89 additions and 92 deletions

View File

@@ -3,13 +3,13 @@
namespace mbgl {
void CollisionTile::reset(const float _angle, const float pitch) {
CollisionTile::CollisionTile(const float angle_, const float pitch, bool debug_) :
angle(angle_), debug(debug_) {
tree.clear();
angle = _angle;
// Compute the transformation matrix.
float angle_sin = std::sin(_angle);
float angle_cos = std::cos(_angle);
float angle_sin = std::sin(angle);
float angle_cos = std::cos(angle);
rotationMatrix = {{angle_cos, -angle_sin, angle_sin, angle_cos}};
// Stretch boxes in y direction to account for the map tilt.