Fix comments on PR

This commit is contained in:
Ylva Selling
2022-07-21 12:38:59 -04:00
parent 787e91a892
commit 7ec6c247cc
4 changed files with 11 additions and 13 deletions

View File

@@ -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();

View File

@@ -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__

View File

@@ -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>

View File

@@ -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));