mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-24 22:09:10 -06:00
Fix comments on PR
This commit is contained in:
@@ -426,11 +426,11 @@ glm::dvec3 GlobeBrowsingModule::geoPosition() const {
|
||||
|
||||
const SceneGraphNode* n = global::navigationHandler->orbitalNavigator().anchorNode();
|
||||
if (!n) {
|
||||
return glm::dvec3(0);
|
||||
return glm::dvec3(0.0);
|
||||
}
|
||||
const RenderableGlobe* globe = dynamic_cast<const RenderableGlobe*>(n->renderable());
|
||||
if (!globe) {
|
||||
return glm::dvec3(0);
|
||||
return glm::dvec3(0.0);
|
||||
}
|
||||
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3();
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__
|
||||
#define __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__
|
||||
#ifndef __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__
|
||||
#define __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__
|
||||
|
||||
#include <modules/server/include/topics/topic.h>
|
||||
#include <chrono>
|
||||
@@ -53,4 +53,4 @@ private:
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_MODULE_SERVER___CAMERA_TOPIC___H__
|
||||
#endif // __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <modules/server/servermodule.h>
|
||||
|
||||
#include <modules/globebrowsing/globebrowsingmodule.h>
|
||||
#include <modules/server/include/serverinterface.h>
|
||||
#include <modules/server/include/connection.h>
|
||||
#include <modules/server/include/topics/topic.h>
|
||||
|
||||
@@ -46,7 +46,8 @@ using nlohmann::json;
|
||||
namespace openspace {
|
||||
|
||||
CameraTopic::CameraTopic()
|
||||
: _lastUpdateTime(std::chrono::system_clock::now()) {}
|
||||
: _lastUpdateTime(std::chrono::system_clock::now())
|
||||
{}
|
||||
|
||||
CameraTopic::~CameraTopic() {
|
||||
if (_dataCallbackHandle != UnsetOnChangeHandle) {
|
||||
@@ -63,10 +64,6 @@ bool CameraTopic::isDone() const {
|
||||
|
||||
void CameraTopic::handleJson(const nlohmann::json& json) {
|
||||
std::string event = json.at(EventKey).get<std::string>();
|
||||
if (event == UnsubscribeEvent) {
|
||||
_isDone = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (event != SubscribeEvent) {
|
||||
_isDone = true;
|
||||
@@ -90,13 +87,13 @@ void CameraTopic::sendCameraData() {
|
||||
|
||||
GlobeBrowsingModule* module = global::moduleEngine->module<GlobeBrowsingModule>();
|
||||
glm::dvec3 position = module->geoPosition();
|
||||
std::pair <double, std::string> altSimplified = simplifyDistance(position.z);
|
||||
std::pair<double, std::string> altSimplified = simplifyDistance(position.z);
|
||||
|
||||
nlohmann::json jsonData = {
|
||||
{ "latitude", position.x},
|
||||
{ "latitude", position.x },
|
||||
{ "longitude", position.y },
|
||||
{ "altitude", altSimplified.first },
|
||||
{ "altitudeUnit", altSimplified.second}
|
||||
{ "altitudeUnit", altSimplified.second }
|
||||
};
|
||||
|
||||
_connection->sendJson(wrappedPayload(jsonData));
|
||||
|
||||
Reference in New Issue
Block a user