mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Define interface for TextureTileSet.
This commit is contained in:
@@ -161,7 +161,7 @@ namespace openspace {
|
||||
_programObject->activate();
|
||||
using namespace glm;
|
||||
|
||||
const mat4& viewTransform = data.camera.combinedViewMatrix();
|
||||
mat4 viewTransform = data.camera.combinedViewMatrix();
|
||||
|
||||
// TODO : Model transform should be fetched as a matrix directly.
|
||||
mat4 modelTransform = translate(mat4(1), data.position.vec3());
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace openspace {
|
||||
// Mainly for debugging purposes @AA
|
||||
addProperty(_rotation);
|
||||
|
||||
//addSwitchValue(std::shared_ptr<ClipMapGlobe>(new ClipMapGlobe(dictionary)), 1e9);
|
||||
addSwitchValue(std::shared_ptr<ChunkLodGlobe>(new ChunkLodGlobe(dictionary)), 1e9);
|
||||
addSwitchValue(std::shared_ptr<ClipMapGlobe>(new ClipMapGlobe(dictionary)), 1e9);
|
||||
//addSwitchValue(std::shared_ptr<ChunkLodGlobe>(new ChunkLodGlobe(dictionary)), 1e9);
|
||||
addSwitchValue(std::shared_ptr<GlobeMesh>(new GlobeMesh(dictionary)), 1e10);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@ namespace openspace {
|
||||
return glm::ivec3(tileIndex, level);
|
||||
}
|
||||
|
||||
TextureTile TextureTileSet::getTile(LatLonPatch patch)
|
||||
{
|
||||
return getTile(getTileIndex(patch));
|
||||
}
|
||||
|
||||
TextureTile TextureTileSet::getTile(glm::ivec3 tileIndex)
|
||||
{
|
||||
return TextureTile();
|
||||
@@ -52,7 +57,16 @@ namespace openspace {
|
||||
|
||||
LatLonPatch TextureTileSet::getTilePositionAndScale(glm::ivec3 tileIndex)
|
||||
{
|
||||
return LatLonPatch(LatLon(), LatLon());
|
||||
LatLon tileSize = LatLon(
|
||||
sizeLevel0.lat / pow(2, tileIndex.z),
|
||||
sizeLevel0.lon / pow(2, tileIndex.z));
|
||||
LatLon northWest = LatLon(
|
||||
offsetLevel0.lat + tileIndex.y * tileSize.lat,
|
||||
offsetLevel0.lon + tileIndex.x * tileSize.lon);
|
||||
|
||||
return LatLonPatch(
|
||||
LatLon(northWest.lat + tileSize.lat / 2, northWest.lon + tileSize.lon / 2),
|
||||
LatLon(tileSize.lat / 2, tileSize.lon / 2));
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace openspace {
|
||||
/// Without the tile being smaller than the patch in lat-lon space.
|
||||
/// The tile needs to be at least as big as the patch.
|
||||
glm::ivec3 getTileIndex(LatLonPatch patch);
|
||||
TextureTile getTile(LatLonPatch patch);
|
||||
TextureTile getTile(glm::ivec3 tileIndex);
|
||||
LatLonPatch getTilePositionAndScale(glm::ivec3 tileIndex);
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user