Feature/new formatting (#547)

* Change to new logging format (closes #542)
 * Adds a screenshots folder that uses the application startup time
 * Creating focus nodes for VRT files if the info files contain location information
 * Fix issue with removing virtual properties
 * Add a method for returning the cartesian coordinates for a geolocation on a planet
This commit is contained in:
Alexander Bock
2018-03-07 18:10:32 -05:00
committed by GitHub
parent 4675554471
commit a3c849843f
131 changed files with 1229 additions and 751 deletions

View File

@@ -272,6 +272,14 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const {
"getGeoPosition",
&globebrowsing::luascriptfunctions::getGeoPosition,
{},
"name, latitude, longitude, altitude",
"Returns the specified surface position on the globe as three floating point "
"values"
},
{
"getGeoPositionForCamera",
&globebrowsing::luascriptfunctions::getGeoPositionForCamera,
{},
"void",
"Get geographic coordinates of the camera poosition in latitude, "
"longitude, and altitude"
@@ -348,6 +356,28 @@ void GlobeBrowsingModule::goToGeo(double latitude, double longitude,
);
}
glm::vec3 GlobeBrowsingModule::cartesianCoordinatesFromGeo(
globebrowsing::RenderableGlobe& globe,
double latitude, double longitude, double altitude)
{
using namespace globebrowsing;
Geodetic3 pos = {
{
Angle<double>::fromDegrees(latitude).asRadians(),
Angle<double>::fromDegrees(longitude).asRadians()
},
altitude
};
glm::dvec3 positionModelSpace = globe.ellipsoid().cartesianPosition(pos);
//glm::dmat4 modelTransform = globe.modelTransform();
//glm::dvec3 positionWorldSpace = glm::dvec3(modelTransform *
//glm::dvec4(positionModelSpace, 1.0));
return glm::vec3(positionModelSpace);
}
void GlobeBrowsingModule::goToChunk(Camera& camera, globebrowsing::TileIndex ti,
glm::vec2 uv, bool resetCameraDirection)
{
@@ -362,8 +392,9 @@ void GlobeBrowsingModule::goToChunk(Camera& camera, globebrowsing::TileIndex ti,
// Camera position in model space
glm::dvec3 camPos = camera.positionVec3();
glm::dmat4 inverseModelTransform = globe->inverseModelTransform();
glm::dvec3 cameraPositionModelSpace =
glm::dvec3(inverseModelTransform * glm::dvec4(camPos, 1));
glm::dvec3 cameraPositionModelSpace = glm::dvec3(
inverseModelTransform * glm::dvec4(camPos, 1)
);
GeodeticPatch patch(ti);
Geodetic2 corner = patch.getCorner(SOUTH_WEST);