Expanded the module to include luminosity and velocity data

This commit is contained in:
aniisaaden
2020-10-13 11:41:13 +02:00
parent 04b0cb9ba6
commit 07ad1ddb00
2 changed files with 44 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ local RenderablePointsCloud = {
Identifier = "RenderablePointsCloud",
Renderable = {
Type = "RenderablePointsCloud",
Color = {1.0, 1.0, 0.5},
Color = {0.0, 0.0, 0.0},
Data = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}},
Luminosity = {0.0, 0.0, 0.0}
Opacity = 0.0,

View File

@@ -214,13 +214,49 @@ namespace openspace {
float size = readFloatValue(message);
std::string guiName = readGUI(message);
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
{ "Data", pointData },
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)}
};
bool hasLuminosityData = !luminosityData.empty();
bool hasVelocityData = !velocityData.empty();
if (hasLuminosityData && hasVelocityData) {
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
{ "Data", pointData },
{ "Luminosity", luminosityData },
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)},
{ "Velocity", velocityData }
};
}
else if (hasLuminosityData && !hasVelocityData) {
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
{ "Data", pointData },
{ "Luminosity", luminosityData },
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)},
};
}
else if (!hasLuminosityData && hasVelocityData) {
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
{ "Data", pointData },
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)},
{ "Velocity", velocityData }
};
}
else {
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
{ "Data", pointData },
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)},
};
}
ghoul::Dictionary gui = {
{ "Name", guiName },