Fixed upper limit bug and added new asset details to main asteroid belt

This commit is contained in:
GPayne
2020-03-02 15:45:52 -07:00
parent ce79a7031e
commit b222bb26db
3 changed files with 16 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ asset.require('./base')
local earthAsset = asset.require('scene/solarsystem/planets/earth/earth')
asset.require('scene/solarsystem/planets/earth/satellites/satellites.asset')
asset.require('scene/solarsystem/sssb/pha')
asset.require('scene/solarsystem/sssb/main_asteroid_belt')
asset.onInitialize(function ()
local now = openspace.time.currentWallTime()

View File

@@ -0,0 +1,11 @@
local assetHelper = asset.require('util/asset_helper')
local sharedSssb = asset.require('./sssb_shared')
local filepath = sharedSssb.downloadSssbDatabaseFile(asset, 'main asteroid belt', 'sssb_data_main_asteroid_belt')
local object = sharedSssb.createSssbGroupObject("sssb_data_main_asteroid_belt.csv", filepath, { 0.9, 0.3, 0.1 })
object.Renderable.Enabled = false
object.Renderable.Segments = 40
object.Renderable.Fade = 3
object.Renderable.UpperLimit = 50000
assetHelper.registerSceneGraphNodesAndExport(asset, { object })

View File

@@ -252,9 +252,9 @@ RenderableSmallBody::RenderableSmallBody(const ghoul::Dictionary& dictionary)
if (dictionary.hasKeyAndValue<glm::vec3>(LineColorInfo.identifier)) {
_appearance.lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
}
if (dictionary.hasKeyAndValue<double>("FadeInfo")) {
if (dictionary.hasKeyAndValue<double>(FadeInfo.identifier)) {
_appearance.lineFade = static_cast<float>(
dictionary.value<double>("FadeInfo")
dictionary.value<double>(FadeInfo.identifier)
);
}
else {
@@ -311,6 +311,8 @@ void RenderableSmallBody::readJplSbDb(const std::string& filename) {
std::streamoff numberOfLines = std::count(std::istreambuf_iterator<char>(file),
std::istreambuf_iterator<char>(), '\n' );
file.seekg(std::ios_base::beg); // reset iterator to beginning of file
_sbData.clear();
_sbNames.clear();
std::string line;
std::streamoff csvLine = -1;