mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 19:09:23 -05:00
Final Merge
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
width 1024
|
||||
lower 0.0
|
||||
upper 1.0
|
||||
|
||||
mappingkey 0.02 40 160 40 0
|
||||
mappingkey 0.14 40 40 240 50
|
||||
mappingkey 0.3 200 80 0 250
|
||||
mappingkey 0.14 40 40 240 50 63 137 197
|
||||
mappingkey 0.3 200 80 0 250
|
||||
@@ -60,14 +60,14 @@ local registerSatelliteGroupObjects = function(containingAsset, group, tleFolder
|
||||
-- The initialization with "-" is just a placeholder.
|
||||
-- (needed to be initialized)
|
||||
Segments = 160,
|
||||
EccentricityColumn = "-",
|
||||
SemiMajorAxisColumn = "-",
|
||||
SemiMajorAxisUnit = 1,
|
||||
InclinationColumn = "-",
|
||||
AscendingNodeColumn = "-",
|
||||
ArgumentOfPeriapsisColumn = "-",
|
||||
MeanAnomalyAtEpochColumn = "-",
|
||||
EpochColumn = "-",
|
||||
--EccentricityColumn = "-",
|
||||
--SemiMajorAxisColumn = "-",
|
||||
--SemiMajorAxisUnit = 1,
|
||||
--InclinationColumn = "-",
|
||||
--AscendingNodeColumn = "-",
|
||||
--ArgumentOfPeriapsisColumn = "-",
|
||||
--MeanAnomalyAtEpochColumn = "-",
|
||||
--EpochColumn = "-",
|
||||
Color = color,
|
||||
Fade = 0.5
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--asset.request('./debris/debris_asat')
|
||||
asset.request('./debris/debris_asat')
|
||||
asset.request('./debris/debris_breezem')
|
||||
--asset.request('./debris/debris_fengyun')
|
||||
--asset.request('./debris/debris_iridium33')
|
||||
--asset.request('./debris/debris_kosmos2251')
|
||||
asset.request('./debris/debris_fengyun')
|
||||
asset.request('./debris/debris_iridium33')
|
||||
asset.request('./debris/debris_kosmos2251')
|
||||
|
||||
asset.request('./satellites_debris_old')
|
||||
--asset.request('./satellites_debris_old')
|
||||
@@ -1,2 +1,5 @@
|
||||
asset.request('./debris/debris_breezem_old')
|
||||
-- asset.request('./debris/debris_asat_old')
|
||||
--asset.request('./debris/debris_breezem_old')
|
||||
--asset.request('./debris/debris_asat_old')
|
||||
--asset.request('./debris/debris_fengyum_old')
|
||||
--asset.request('./debris/debris_iridium33_old')
|
||||
--asset.request('./debris/debris_kosmos2251_old')
|
||||
@@ -74,6 +74,8 @@ assetHelper.registerInterestingNodes(asset, {
|
||||
|
||||
asset.onInitialize(function ()
|
||||
local now = openspace.time.currentWallTime()
|
||||
--local now = "2019-01-01T15:00:00"
|
||||
|
||||
-- Jump back one day to show a complete planet
|
||||
openspace.time.setTime(openspace.time.advancedTime(now, "-1d"))
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
return {{
|
||||
Type = "GenerateDebrisVolumeTask",
|
||||
Dimensions = {32, 32, 32},
|
||||
Dimensions = {50, 50, 50},
|
||||
LowerDomainBound = {-0.5, -0.5, -0.5},
|
||||
UpperDomainBound = {0.5, 0.5, 0.5},
|
||||
InputPath = "${SYNC}/url/satellite_tle_data_DebrisAll/files/allDebrisInOneTLE.txt",
|
||||
StartTime = "2018-05-04T00:00:00",
|
||||
TimeStep = "25",
|
||||
EndTime = "2018-05-04T00:01:00",
|
||||
TimeStep = "1",
|
||||
EndTime = "2018-05-04T00:00:00",
|
||||
GridType = "Cartesian",
|
||||
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generatedCartesian/singleDebris.rawvolume",
|
||||
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generatedCartesian/singleDebris.dictionary"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
return {{
|
||||
Type = "GenerateDebrisVolumeTask",
|
||||
Dimensions = {32, 32, 64},
|
||||
Dimensions = {32, 32, 64},
|
||||
LowerDomainBound = {0, 0, 0},
|
||||
UpperDomainBound = {1, math.pi, 2 * math.pi},
|
||||
InputPath = "${SYNC}/url/satellite_tle_data_DebrisAll/files/allDebrisInOneTLE.txt",
|
||||
--InputPath = "${SYNC}/url/satellite_tle_data_BreezeMBreakup(18391204735368316775)/files/2012-044.txt",
|
||||
StartTime = "2018-05-04T00:00:00",
|
||||
TimeStep = "3",
|
||||
TimeStep = "1",
|
||||
EndTime = "2018-05-04T00:00:00",
|
||||
GridType = "Spherical",
|
||||
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated/singleDebris.rawvolume",
|
||||
|
||||
@@ -33,7 +33,7 @@ struct PerformanceLayout {
|
||||
constexpr static const int8_t Version = 0;
|
||||
constexpr static const int LengthName = 256;
|
||||
constexpr static const int NumberValues = 256;
|
||||
constexpr static const int MaxValues = 1024;
|
||||
constexpr static const int MaxValues = 2048;
|
||||
|
||||
PerformanceLayout();
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ public:
|
||||
const std::vector<SceneGraphNode*>& sceneNodes);
|
||||
|
||||
void outputLogs();
|
||||
void debrisLog();
|
||||
|
||||
void writeData(std::ofstream& out, const std::vector<float>& data);
|
||||
|
||||
|
||||
@@ -32,10 +32,19 @@
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
// #include <cstring>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
namespace {
|
||||
constexpr const char* KeyFontMono = "Mono";
|
||||
constexpr const float DefaultFontSize = 10.f;
|
||||
|
||||
constexpr const char* _loggerCat = "Framrate";
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FontNameInfo = {
|
||||
"FontName",
|
||||
"Font Name",
|
||||
@@ -250,6 +259,18 @@ void DashboardItemFramerate::render(glm::vec2& penPosition) {
|
||||
FrametimeType frametimeType = FrametimeType(_frametimeType.value());
|
||||
|
||||
const std::string output = format(frametimeType);
|
||||
std::string theWholeText = output;
|
||||
|
||||
|
||||
std::size_t startHere = theWholeText.find(":");
|
||||
std::string fpsValue = theWholeText.substr(startHere+2, theWholeText.back());
|
||||
std::ofstream out("../././././fpsData.txt", std::ios::app);
|
||||
|
||||
std::size_t negative = fpsValue.find("-");
|
||||
if(negative == 0 ){
|
||||
}else
|
||||
out << fpsValue << std::endl;
|
||||
// out.close();
|
||||
|
||||
int nLines = output.empty() ? 0 :
|
||||
(std::count(output.begin(), output.end(), '\n') + 1);
|
||||
|
||||
@@ -49,26 +49,14 @@
|
||||
#include <math.h>
|
||||
#include <fstream>
|
||||
|
||||
// Todo:
|
||||
// Parse epoch correctly?
|
||||
// read distances using correct unit
|
||||
// Make the linefade go from the closest vertex to the actuall position
|
||||
// instead of to the next vertex
|
||||
|
||||
namespace {
|
||||
constexpr const char* ProgramName = "RenderableSatellites";
|
||||
constexpr const char* _loggerCat = "SpaceDebris";
|
||||
|
||||
// constexpr const std::array<const char*, 6> UniformNames = {
|
||||
// "modelViewTransform", "projectionTransform",
|
||||
// "lineFade", "inGameTime", "color", "opacity"
|
||||
// };
|
||||
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo PathInfo = {
|
||||
"Path",
|
||||
"Path",
|
||||
"The file path to the CSV file to read"
|
||||
"Path",
|
||||
"Path",
|
||||
"The file path to the TLE file to read"
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo SegmentsInfo = {
|
||||
@@ -77,18 +65,18 @@ namespace {
|
||||
"The number of segments to use for each orbit ellipse"
|
||||
};
|
||||
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
|
||||
"LineWidth",
|
||||
"Line Width",
|
||||
"This value specifies the line width of the trail if the selected rendering "
|
||||
"method includes lines. If the rendering mode is set to Points, this value is "
|
||||
"ignored."
|
||||
"LineWidth",
|
||||
"Line Width",
|
||||
"This value specifies the line width of the trail if the selected rendering "
|
||||
"method includes lines. If the rendering mode is set to Points, this value is "
|
||||
"ignored."
|
||||
};
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeInfo = {
|
||||
"Fade",
|
||||
"Line fade",
|
||||
"The fading factor that is applied to the trail if the 'EnableFade' value is "
|
||||
"'true'. If it is 'false', this setting has no effect. The higher the number, "
|
||||
"the less fading is applied."
|
||||
"Fade",
|
||||
"Line fade",
|
||||
"The fading factor that is applied to the trail if the 'EnableFade' value is "
|
||||
"'true'. If it is 'false', this setting has no effect. The higher the number, "
|
||||
"the less fading is applied."
|
||||
};
|
||||
|
||||
constexpr const char* KeyFile = "Path";
|
||||
@@ -516,16 +504,11 @@ void RenderableSatellites::initializeGL() {
|
||||
_uniformCache.projection = _programObject->uniformLocation("projectionTransform");
|
||||
_uniformCache.lineFade = _programObject->uniformLocation("lineFade");
|
||||
_uniformCache.inGameTime = _programObject->uniformLocation("inGameTime");
|
||||
|
||||
_uniformCache.color = _programObject->uniformLocation("color");
|
||||
_uniformCache.opacity = _programObject->uniformLocation("opacity");
|
||||
|
||||
_uniformCache.numberOfSegments = _programObject->uniformLocation("numberOfSegments");
|
||||
|
||||
updateBuffers();
|
||||
|
||||
//ghoul::opengl::updateUniformLocations(*_programObject, _uniformCache, UniformNames);
|
||||
|
||||
setRenderBin(Renderable::RenderBin::Overlay);
|
||||
}
|
||||
|
||||
@@ -572,8 +555,6 @@ void RenderableSatellites::render(const RenderData& data, RendererTasks&) {
|
||||
_programObject->setUniform(_uniformCache.projection, data.camera.projectionMatrix());
|
||||
_programObject->setUniform(_uniformCache.color, _appearance.lineColor);
|
||||
_programObject->setUniform(_uniformCache.lineFade, _appearance.lineFade);
|
||||
|
||||
_programObject->setUniform(_uniformCache.numberOfSegments, static_cast<int>(_nSegments));
|
||||
|
||||
glLineWidth(_appearance.lineWidth);
|
||||
|
||||
@@ -585,7 +566,6 @@ void RenderableSatellites::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
glBindVertexArray(_vertexArray);
|
||||
for (size_t i = 0; i < nrOrbits; ++i) {
|
||||
//glDrawArrays(GL_LINE_STRIP, 0, static_cast<GLsizei>(_vertexBufferData.size()));
|
||||
glDrawArrays(GL_LINE_STRIP, vertices, _nSegments + 1);
|
||||
vertices = vertices + _nSegments + 1;
|
||||
}
|
||||
@@ -633,18 +613,6 @@ void RenderableSatellites::updateBuffers() {
|
||||
_vertexBufferData[index].epoch = orbit.epoch;
|
||||
_vertexBufferData[index].period = orbit.period;
|
||||
|
||||
// The difference in the print below resulted in large differences, up to 0.35.
|
||||
// LINFO(fmt::format("diff : {} ", position.x - _vertexBufferData[index].x));
|
||||
|
||||
// So one idea was to make it very small before casting it to a float.
|
||||
// auto print = positionX-(static_cast<float>(positionX) / 10000000);
|
||||
// LINFO(fmt::format(" smaller distance? :{}", print));
|
||||
|
||||
|
||||
// LINFO(fmt::format(" x-positions float :{}", static_cast<float>(position.x)));
|
||||
// LINFO(fmt::format(" x-positions float * 10000 :{}", static_cast<float>(position.x * 10000)));
|
||||
// LINFO(fmt::format(" x-positions float * 10000 /10000 :{}", static_cast<float>(position.x * 10000)/10000));
|
||||
|
||||
}
|
||||
|
||||
++orbitindex;
|
||||
|
||||
@@ -256,40 +256,6 @@ void PerformanceManager::outputLogs() {
|
||||
}
|
||||
}
|
||||
|
||||
void PerformanceManager::debrisLog() {
|
||||
PerformanceLayout* layout = performanceData();
|
||||
const size_t writeStart = (PerformanceLayout::NumberValues - 1) - _currentTick;
|
||||
|
||||
//for (int16_t n = 0; n < layout->nScaleGraphEntries; n++) {
|
||||
for (int16_t n = 7; n < 12; n++) {
|
||||
//lol fult
|
||||
const PerformanceLayout::SceneGraphPerformanceLayout node =
|
||||
layout->sceneGraphEntries[n];
|
||||
|
||||
// Open file
|
||||
std::string filename = formatLogName(node.name);
|
||||
|
||||
std::ofstream out = std::ofstream(
|
||||
absPath(std::move(filename)),
|
||||
std::ofstream::out | std::ofstream::app
|
||||
);
|
||||
|
||||
// Comma separate data
|
||||
for (size_t i = writeStart; i < PerformanceLayout::NumberValues; i++) {
|
||||
const std::vector<float> data = {
|
||||
node.renderTime[i],
|
||||
node.updateRenderable[i],
|
||||
node.updateRotation[i],
|
||||
node.updateScaling[i],
|
||||
node.updateTranslation[i]
|
||||
};
|
||||
writeData(out, data);
|
||||
}
|
||||
out.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PerformanceManager::writeData(std::ofstream& out, const std::vector<float>& data) {
|
||||
for (size_t i = 0; i < data.size() - 1; i++) {
|
||||
out << data[i] << ",";
|
||||
@@ -427,7 +393,7 @@ void PerformanceManager::storeScenePerformanceMeasurements(
|
||||
|
||||
memset(layout->sceneGraphEntries[i].name, 0, PerformanceLayout::LengthName);
|
||||
#ifdef _MSC_VER
|
||||
strcpy_s(
|
||||
strcpy_s(
|
||||
layout->sceneGraphEntries[i].name,
|
||||
node.identifier().length() + 1,
|
||||
node.identifier().c_str()
|
||||
@@ -485,8 +451,7 @@ void PerformanceManager::storeScenePerformanceMeasurements(
|
||||
_performanceMemory->releaseLock();
|
||||
|
||||
if (_loggingEnabled && _currentTick == PerformanceLayout::NumberValues - 1) {
|
||||
//outputLogs();
|
||||
debrisLog();
|
||||
outputLogs();
|
||||
}
|
||||
|
||||
tick();
|
||||
|
||||
Reference in New Issue
Block a user