Additional CullWorker fixes
@@ -160,13 +160,15 @@ namespace carto {
cglib::vec2<float> screenPos = screenPoses[i] + (screenPoses[j] - screenPoses[i]) * (static_cast<float>(n) / tesselationLevel);
cglib::vec3<double> pos0 = cglib::transform_point(cglib::vec3<double>(screenPos(0), screenPos(1), -1), invMVPMat);
cglib::vec3<double> pos1 = cglib::transform_point(cglib::vec3<double>(screenPos(0), screenPos(1), 1), invMVPMat);
- cglib::ray3<double> ray(pos0, pos1 - pos0);
+ cglib::ray3<double> ray(pos0, cglib::unit(pos1 - pos0));
double t = 0;
if (projectionSurface->calculateHitPoint(ray, 0, t)) {
- mapPoses.push_back(projectionSurface->calculateMapPos(ray(t > 0 ? t : _viewState.getFar())));
+ MapPos mapPos = projectionSurface->calculateMapPos(ray(t > 0 ? t : _viewState.getFar()));
+ mapPoses.emplace_back(mapPos.getX(), mapPos.getY());
} else {
- mapPoses.push_back(projectionSurface->calculateMapPos(projectionSurface->calculateNearestPoint(ray, 0, t)));
+ MapPos mapPos = projectionSurface->calculateMapPos(projectionSurface->calculateNearestPoint(ray, 0, t))
+ mapPoses.emplace_back(mapPos.getX(), mapPos.getY());
}
}
}
