| 142 | } |
| 143 | |
| 144 | void TileView::setScreenCenterTile(Vec3<float> center) |
| 145 | { |
| 146 | fw().soundBackend->setListenerPosition({center.x, center.y, map.size.z / 2}); |
| 147 | Vec3<float> clampedCenter; |
| 148 | if (center.x < 0.0f) |
| 149 | clampedCenter.x = 0.0f; |
| 150 | else if (center.x > map.size.x) |
| 151 | clampedCenter.x = map.size.x; |
| 152 | else |
| 153 | clampedCenter.x = center.x; |
| 154 | if (center.y < 0.0f) |
| 155 | clampedCenter.y = 0.0f; |
| 156 | else if (center.y > map.size.y) |
| 157 | clampedCenter.y = map.size.y; |
| 158 | else |
| 159 | clampedCenter.y = center.y; |
| 160 | if (center.z < 0.0f) |
| 161 | clampedCenter.z = 0.0f; |
| 162 | else if (center.z > map.size.z) |
| 163 | clampedCenter.z = map.size.z; |
| 164 | else |
| 165 | clampedCenter.z = center.z; |
| 166 | |
| 167 | this->centerPos = clampedCenter; |
| 168 | } |
| 169 | |
| 170 | void TileView::setScreenCenterTile(Vec2<float> center) |
| 171 | { |
no test coverage detected