mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 14:58:51 -06:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user