Use current - instead of maximum - chunk level height tiles in ground collision test

This commit is contained in:
Erik Broberg
2016-06-23 20:23:08 -04:00
parent e59dd7a391
commit 0c935e5b59
3 changed files with 19 additions and 2 deletions
@@ -52,6 +52,8 @@ namespace openspace {
const ChunkIndex ChunkedLodGlobe::LEFT_HEMISPHERE_INDEX = ChunkIndex(0, 0, 1);
const ChunkIndex ChunkedLodGlobe::RIGHT_HEMISPHERE_INDEX = ChunkIndex(1, 0, 1);
const GeodeticPatch ChunkedLodGlobe::COVERAGE = GeodeticPatch(0, 0, 90, 180);
ChunkedLodGlobe::ChunkedLodGlobe(
const Ellipsoid& ellipsoid,
@@ -116,6 +118,16 @@ namespace openspace {
return false;
}
const ChunkNode& ChunkedLodGlobe::findChunkNode(const Geodetic2 p) const {
ghoul_assert(COVERAGE.contains(p), "Point must be in lat [-90, 90] and lon [-180, 180]");
return p.lon < COVERAGE.center().lon ? _leftRoot->find(p) : _rightRoot->find(p);
}
ChunkNode& ChunkedLodGlobe::findChunkNode(const Geodetic2 p) {
ghoul_assert(COVERAGE.contains(p), "Point must be in lat [-90, 90] and lon [-180, 180]");
return p.lon < COVERAGE.center().lon ? _leftRoot->find(p) : _rightRoot->find(p);
}
int ChunkedLodGlobe::getDesiredLevel(const Chunk& chunk, const RenderData& renderData) const {
int desiredLevel = 0;
if (debugOptions.levelByProjAreaElseDistance) {