mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 09:10:18 -06:00
Remove more warnings on Jenkins
This commit is contained in:
Submodule ext/ghoul updated: bc86cd17f9...38271e30e0
@@ -276,9 +276,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
|
||||
glm::dmat4 dSgctProjectionToWorldTransformMatrix(
|
||||
dProjectionToTmpRotTransformMatrix
|
||||
);
|
||||
double* mSource = reinterpret_cast<double *>(
|
||||
glm::value_ptr(dSgctProjectionToWorldTransformMatrix)
|
||||
);
|
||||
double* mSource = glm::value_ptr(dSgctProjectionToWorldTransformMatrix);
|
||||
|
||||
mSource[12] += renderData.camera.eyePositionVec3().x;
|
||||
mSource[13] += renderData.camera.eyePositionVec3().y;
|
||||
@@ -977,7 +975,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
);
|
||||
loadAtmosphereDataIntoShaderProgram(_inScatteringProgramObject);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
for (int layer = 0; layer < static_cast<int>(_r_samples); ++layer) {
|
||||
for (int layer = 0; layer < _r_samples; ++layer) {
|
||||
step3DTexture(_inScatteringProgramObject, layer);
|
||||
renderQuadForCalc(quadCalcVAO, vertexSize);
|
||||
}
|
||||
@@ -1043,7 +1041,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
_deltaSProgramObject->setUniform("deltaSMTexture", deltaSMieTableTextureUnit);
|
||||
loadAtmosphereDataIntoShaderProgram(_deltaSProgramObject);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
for (int layer = 0; layer < static_cast<int>(_r_samples); ++layer) {
|
||||
for (int layer = 0; layer < _r_samples; ++layer) {
|
||||
step3DTexture(_deltaSProgramObject, layer, false);
|
||||
renderQuadForCalc(quadCalcVAO, vertexSize);
|
||||
}
|
||||
@@ -1090,7 +1088,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
glBindTexture(GL_TEXTURE_3D, _deltaSMieTableTexture);
|
||||
_deltaJProgramObject->setUniform("deltaSMTexture", deltaSMieTableTextureUnit);
|
||||
loadAtmosphereDataIntoShaderProgram(_deltaJProgramObject);
|
||||
for (int layer = 0; layer < static_cast<int>(_r_samples); ++layer) {
|
||||
for (int layer = 0; layer < _r_samples; ++layer) {
|
||||
step3DTexture(_deltaJProgramObject, layer);
|
||||
renderQuadForCalc(quadCalcVAO, vertexSize);
|
||||
}
|
||||
@@ -1112,16 +1110,10 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
glViewport(0, 0, _delta_e_table_width, _delta_e_table_height);
|
||||
_irradianceSupTermsProgramObject->activate();
|
||||
if (scatteringOrder == 2) {
|
||||
_irradianceSupTermsProgramObject->setUniform(
|
||||
"firstIteraction",
|
||||
static_cast<int>(1)
|
||||
);
|
||||
_irradianceSupTermsProgramObject->setUniform("firstIteraction", 1);
|
||||
}
|
||||
else {
|
||||
_irradianceSupTermsProgramObject->setUniform(
|
||||
"firstIteraction",
|
||||
static_cast<int>(0)
|
||||
);
|
||||
_irradianceSupTermsProgramObject->setUniform("firstIteraction", 0);
|
||||
}
|
||||
transmittanceTableTextureUnit.activate();
|
||||
glBindTexture(GL_TEXTURE_2D, _transmittanceTableTexture);
|
||||
@@ -1173,7 +1165,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
deltaJTableTextureUnit
|
||||
);
|
||||
loadAtmosphereDataIntoShaderProgram(_inScatteringSupTermsProgramObject);
|
||||
for (int layer = 0; layer < static_cast<int>(_r_samples); ++layer) {
|
||||
for (int layer = 0; layer < _r_samples; ++layer) {
|
||||
step3DTexture(_inScatteringSupTermsProgramObject, layer);
|
||||
renderQuadForCalc(quadCalcVAO, vertexSize);
|
||||
}
|
||||
@@ -1234,7 +1226,7 @@ void AtmosphereDeferredcaster::executeCalculations(GLuint quadCalcVAO,
|
||||
deltaSRayleighTableTextureUnit
|
||||
);
|
||||
loadAtmosphereDataIntoShaderProgram(_deltaSSupTermsProgramObject);
|
||||
for (int layer = 0; layer < static_cast<int>(_r_samples); ++layer) {
|
||||
for (int layer = 0; layer < _r_samples; ++layer) {
|
||||
step3DTexture(_deltaSSupTermsProgramObject, layer, false);
|
||||
renderQuadForCalc(quadCalcVAO, vertexSize);
|
||||
}
|
||||
@@ -1335,7 +1327,7 @@ void AtmosphereDeferredcaster::createRenderQuad(GLuint* vao, GLuint* vbo, GLfloa
|
||||
GL_FLOAT,
|
||||
GL_FALSE,
|
||||
sizeof(GLfloat) * 4,
|
||||
reinterpret_cast<GLvoid*>(0)
|
||||
nullptr
|
||||
);
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
@@ -1356,22 +1348,16 @@ void AtmosphereDeferredcaster::loadAtmosphereDataIntoShaderProgram(
|
||||
shaderProg->setUniform("betaMieExtinction", _mieExtinctionCoeff);
|
||||
shaderProg->setUniform("mieG", _miePhaseConstant);
|
||||
shaderProg->setUniform("sunRadiance", _sunRadianceIntensity);
|
||||
shaderProg->setUniform(
|
||||
"TRANSMITTANCE_W",
|
||||
static_cast<int>(_transmittance_table_width)
|
||||
);
|
||||
shaderProg->setUniform(
|
||||
"TRANSMITTANCE_H",
|
||||
static_cast<int>(_transmittance_table_height)
|
||||
);
|
||||
shaderProg->setUniform("SKY_W", static_cast<int>(_irradiance_table_width));
|
||||
shaderProg->setUniform("SKY_H", static_cast<int>(_irradiance_table_height));
|
||||
shaderProg->setUniform("OTHER_TEXTURES_W", static_cast<int>(_delta_e_table_width));
|
||||
shaderProg->setUniform("OTHER_TEXTURES_H", static_cast<int>(_delta_e_table_height));
|
||||
shaderProg->setUniform("SAMPLES_R", static_cast<int>(_r_samples));
|
||||
shaderProg->setUniform("SAMPLES_MU", static_cast<int>(_mu_samples));
|
||||
shaderProg->setUniform("SAMPLES_MU_S", static_cast<int>(_mu_s_samples));
|
||||
shaderProg->setUniform("SAMPLES_NU", static_cast<int>(_nu_samples));
|
||||
shaderProg->setUniform("TRANSMITTANCE_W", _transmittance_table_width);
|
||||
shaderProg->setUniform("TRANSMITTANCE_H", _transmittance_table_height);
|
||||
shaderProg->setUniform("SKY_W", _irradiance_table_width);
|
||||
shaderProg->setUniform("SKY_H", _irradiance_table_height);
|
||||
shaderProg->setUniform("OTHER_TEXTURES_W", _delta_e_table_width);
|
||||
shaderProg->setUniform("OTHER_TEXTURES_H", _delta_e_table_height);
|
||||
shaderProg->setUniform("SAMPLES_R", _r_samples);
|
||||
shaderProg->setUniform("SAMPLES_MU", _mu_samples);
|
||||
shaderProg->setUniform("SAMPLES_MU_S", _mu_s_samples);
|
||||
shaderProg->setUniform("SAMPLES_NU", _nu_samples);
|
||||
shaderProg->setUniform("ozoneLayerEnabled", _ozoneEnabled);
|
||||
shaderProg->setUniform("HO", _ozoneHeightScale);
|
||||
shaderProg->setUniform("betaOzoneExtinction", _ozoneExtinctionCoeff);
|
||||
@@ -1463,7 +1449,7 @@ void AtmosphereDeferredcaster::step3DTexture(
|
||||
float epsilon =
|
||||
(layer == 0) ?
|
||||
0.01f :
|
||||
(layer == (static_cast<int>(_r_samples) - 1)) ? -0.001f : 0.0f;
|
||||
(layer == (_r_samples - 1)) ? -0.001f : 0.0f;
|
||||
float r = sqrtf(earth2 + ri_2 * diff) + epsilon;
|
||||
float dminG = r - _atmospherePlanetRadius;
|
||||
float dminT = _atmosphereRadius - r;
|
||||
|
||||
@@ -786,11 +786,11 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) {
|
||||
const glm::dmat4 invMVPParts = glm::inverse(modelMatrix) *
|
||||
glm::inverse(data.camera.combinedViewMatrix()) *
|
||||
glm::inverse(glm::dmat4(projectionMatrix));
|
||||
const glm::dvec3 orthoRight = glm::dvec3(
|
||||
glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0)))
|
||||
const glm::dvec3 orthoRight = glm::normalize(
|
||||
glm::dvec3(invMVPParts * glm::dvec4(1.0, 0.0, 0.0, 0.0))
|
||||
);
|
||||
const glm::dvec3 orthoUp = glm::dvec3(
|
||||
glm::normalize(glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0)))
|
||||
const glm::dvec3 orthoUp = glm::normalize(
|
||||
glm::dvec3(invMVPParts * glm::dvec4(0.0, 1.0, 0.0, 0.0))
|
||||
);
|
||||
|
||||
if (_hasSpeckFile) {
|
||||
|
||||
@@ -307,7 +307,7 @@ void RenderableFieldlines::update(const UpdateData&) {
|
||||
GL_FLOAT,
|
||||
GL_FALSE,
|
||||
sizeof(LinePoint),
|
||||
reinterpret_cast<void*>(0)
|
||||
nullptr
|
||||
);
|
||||
|
||||
GLuint colorLocation = 1;
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace openspace {
|
||||
}
|
||||
glm::vec3 volumeSize;
|
||||
if (volumeDictionary.getValue("Size", volumeSize)) {
|
||||
_volumeSize = static_cast<glm::vec3>(volumeSize);
|
||||
_volumeSize = volumeSize;
|
||||
}
|
||||
else {
|
||||
LERROR("No volume dimensions specified.");
|
||||
@@ -266,11 +266,11 @@ void RenderableGalaxy::initializeGL() {
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _positionVbo);
|
||||
glEnableVertexAttribArray(positionAttrib);
|
||||
glVertexAttribPointer(positionAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glVertexAttribPointer(positionAttrib, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _colorVbo);
|
||||
glEnableVertexAttribArray(colorAttrib);
|
||||
glVertexAttribPointer(colorAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glVertexAttribPointer(colorAttrib, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindVertexArray(0);
|
||||
@@ -299,11 +299,8 @@ void RenderableGalaxy::update(const UpdateData& data) {
|
||||
transform = glm::rotate(transform, eulerRotation.y, glm::vec3(0, 1, 0));
|
||||
transform = glm::rotate(transform, eulerRotation.z, glm::vec3(0, 0, 1));
|
||||
|
||||
glm::mat4 volumeTransform = glm::scale(
|
||||
transform,
|
||||
static_cast<glm::vec3>(_volumeSize)
|
||||
);
|
||||
_pointTransform = glm::scale(transform, static_cast<glm::vec3>(_pointScaling));
|
||||
glm::mat4 volumeTransform = glm::scale(transform, _volumeSize);
|
||||
_pointTransform = glm::scale(transform, _pointScaling);
|
||||
|
||||
const glm::vec4 translation = glm::vec4(_translation.value(), 0.0);
|
||||
|
||||
@@ -325,7 +322,7 @@ void RenderableGalaxy::render(const RenderData& data, RendererTasks& tasks) {
|
||||
|
||||
const glm::vec3 position = data.camera.position().vec3();
|
||||
const float length = safeLength(position);
|
||||
const glm::vec3 galaxySize = static_cast<glm::vec3>(_volumeSize);
|
||||
const glm::vec3 galaxySize = _volumeSize;
|
||||
|
||||
const float maxDim = std::max(std::max(galaxySize.x, galaxySize.y), galaxySize.z);
|
||||
|
||||
|
||||
@@ -42,14 +42,14 @@ Tile::Tile(ghoul::opengl::Texture* texture, std::shared_ptr<TileMetaData> metaDa
|
||||
|
||||
TileMetaData* Tile::metaData() const {
|
||||
return _metaData.get();
|
||||
};
|
||||
}
|
||||
|
||||
Tile::Status Tile::status() const {
|
||||
return _status;
|
||||
};
|
||||
}
|
||||
|
||||
ghoul::opengl::Texture* Tile::texture() const {
|
||||
return _texture;
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace openspace::globebrowsing
|
||||
|
||||
@@ -70,7 +70,7 @@ bool TileProvider::initialize() {
|
||||
|
||||
bool TileProvider::deinitialize() {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
float TileProvider::noDataValueAsFloat() {
|
||||
ghoul_assert(_isInitialized, "TileProvider was not initialized.");
|
||||
|
||||
@@ -282,7 +282,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
}
|
||||
|
||||
_deltaTime = static_cast<float>(
|
||||
convertTime(dt, TimeUnit::Second, static_cast<TimeUnit>(_deltaTimeUnit))
|
||||
convertTime(dt, TimeUnit::Second, _deltaTimeUnit)
|
||||
);
|
||||
|
||||
bool valueChanged = ImGui::InputFloat(
|
||||
@@ -308,7 +308,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
double newDeltaTime = convertTime(
|
||||
_deltaTime,
|
||||
static_cast<TimeUnit>(_deltaTimeUnit),
|
||||
_deltaTimeUnit,
|
||||
TimeUnit::Second
|
||||
);
|
||||
|
||||
@@ -373,7 +373,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
const double newDeltaTime = convertTime(
|
||||
_deltaTime + _slidingDelta,
|
||||
static_cast<TimeUnit>(_deltaTimeUnit),
|
||||
_deltaTimeUnit,
|
||||
TimeUnit::Second
|
||||
);
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ void IswaCygnet::update(const UpdateData&) {
|
||||
|
||||
void IswaCygnet::enabled(bool enabled) {
|
||||
_enabled = enabled;
|
||||
};
|
||||
}
|
||||
|
||||
void IswaCygnet::registerProperties() {}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, unsigned int o
|
||||
bool octreeLastOnly = true;
|
||||
do {
|
||||
// Visit ancestor
|
||||
if (bstNode != bstOffset || octreeNode != octreeOffset) {
|
||||
if (bstNode != static_cast<int>(bstOffset) || octreeNode != octreeOffset) {
|
||||
// Is actually an ancestor
|
||||
|
||||
std::vector<float> ancestorVoxels;
|
||||
@@ -133,9 +133,9 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, unsigned int o
|
||||
// Calculate leaf offset in ancestor sized voxels
|
||||
glm::vec3 ancestorOffset = (leafOffset * invVoxelScale) + glm::vec3(padding - 0.5);
|
||||
|
||||
for (int z = 0; z < brickDim; z++) {
|
||||
for (int y = 0; y < brickDim; y++) {
|
||||
for (int x = 0; x < brickDim; x++) {
|
||||
for (int z = 0; z < static_cast<int>(brickDim); z++) {
|
||||
for (int y = 0; y < static_cast<int>(brickDim); y++) {
|
||||
for (int x = 0; x < static_cast<int>(brickDim); x++) {
|
||||
glm::vec3 leafSamplePoint = glm::vec3(x, y, z) + glm::vec3(padding);
|
||||
glm::vec3 ancestorSamplePoint = ancestorOffset + (glm::vec3(x, y, z) + glm::vec3(0.5)) * invVoxelScale;
|
||||
float leafValue = leafValues[linearCoords(leafSamplePoint)];
|
||||
@@ -162,6 +162,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, unsigned int o
|
||||
leafOffset.z += (octreeChild / 4) * childSize;
|
||||
|
||||
octreeLevel++;
|
||||
// @TODO(emiax): This does not make sense? unsigned int check against -1
|
||||
} while (octreeNode != -1);
|
||||
|
||||
bstRightOnly &= (bstNode % 2 == 0);
|
||||
@@ -218,8 +219,8 @@ bool ErrorHistogramManager::saveToFile(const std::string& filename) {
|
||||
int nFloats = _numInnerNodes * _numBins;
|
||||
float* histogramData = new float[nFloats];
|
||||
|
||||
for (int i = 0; i < _numInnerNodes; ++i) {
|
||||
int offset = i*_numBins;
|
||||
for (unsigned int i = 0; i < _numInnerNodes; ++i) {
|
||||
int offset = i * _numBins;
|
||||
memcpy(&histogramData[offset], _histograms[i].data(), sizeof(float) * _numBins);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ public:
|
||||
int memoryBudget, int streamingBudget);
|
||||
~LocalTfBrickSelector();
|
||||
|
||||
virtual bool initialize();
|
||||
bool initialize() override;
|
||||
|
||||
void selectBricks(int timestep, std::vector<int>& bricks);
|
||||
void selectBricks(int timestep, std::vector<int>& bricks) override;
|
||||
void setMemoryBudget(int memoryBudget);
|
||||
void setStreamingBudget(int streamingBudget);
|
||||
bool calculateBrickErrors();
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace {
|
||||
"${MODULES}/multiresvolume/shaders/helper.glsl";
|
||||
constexpr const char* GlslHeaderPath =
|
||||
"${MODULES}/multiresvolume/shaders/header.glsl";
|
||||
bool registeredGlslHelpers = false;
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo StepSizeCoefficientInfo = {
|
||||
"StepSizeCoefficient",
|
||||
|
||||
@@ -137,10 +137,10 @@ bool TSP::readHeader() {
|
||||
|
||||
paddedBrickDim_ = _header.xBrickDim_ + 2 * paddingWidth_;
|
||||
// TODO support dimensions of different size
|
||||
numOTLevels_ = static_cast<unsigned int>(log((int)_header.xNumBricks_) / log(2) + 1);
|
||||
numOTLevels_ = static_cast<unsigned int>(log(static_cast<int>(_header.xNumBricks_)) / log(2) + 1);
|
||||
numOTNodes_ = static_cast<unsigned int>((pow(8, numOTLevels_) - 1) / 7);
|
||||
numBSTLevels_ = static_cast<unsigned int>(log((int)_header.numTimesteps_) / log(2) + 1);
|
||||
numBSTNodes_ = static_cast<unsigned int>(_header.numTimesteps_ * 2 - 1);
|
||||
numBSTLevels_ = static_cast<unsigned int>(log(static_cast<int>(_header.numTimesteps_)) / log(2) + 1);
|
||||
numBSTNodes_ = _header.numTimesteps_ * 2 - 1;
|
||||
numTotalNodes_ = numOTNodes_ * numBSTNodes_;
|
||||
|
||||
LDEBUG(fmt::format("Num OT levels: {}", numOTLevels_));
|
||||
@@ -160,10 +160,10 @@ bool TSP::construct() {
|
||||
LDEBUG("Constructing TSP tree");
|
||||
|
||||
// Loop over the OTs (one per BST node)
|
||||
for (unsigned int OT = 0; OT<numBSTNodes_; ++OT) {
|
||||
for (unsigned int OT = 0; OT < numBSTNodes_; ++OT) {
|
||||
|
||||
// Start at the root of each OT
|
||||
unsigned int OTNode = OT*numOTNodes_;
|
||||
unsigned int OTNode = OT * numOTNodes_;
|
||||
|
||||
// Calculate BST level (first level is level 0)
|
||||
unsigned int BSTLevel = static_cast<unsigned int>(log(OT + 1) / log(2));
|
||||
@@ -177,7 +177,7 @@ bool TSP::construct() {
|
||||
for (unsigned int i = 0; i<OTNodesInLevel; ++i) {
|
||||
|
||||
// Brick index
|
||||
data_[OTNode*NUM_DATA + BRICK_INDEX] = (int)OTNode;
|
||||
data_[OTNode*NUM_DATA + BRICK_INDEX] = static_cast<int>(OTNode);
|
||||
|
||||
// Error metrics
|
||||
//int localOTNode = (OTNode - OT*numOTNodes_);
|
||||
|
||||
@@ -81,7 +81,7 @@ void AuthorizationTopic::handleJson(const nlohmann::json& json) {
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
bool AuthorizationTopic::authorize(const std::string& key) {
|
||||
_isAuthenticated = (key == OsEng.configuration().serverPasskey);
|
||||
|
||||
@@ -34,7 +34,7 @@ LinearLruCache<ValueType>::LinearLruCache(size_t capacity, size_t nIndices)
|
||||
template <typename ValueType>
|
||||
bool LinearLruCache<ValueType>::has(size_t key) const {
|
||||
return _cache[key].first != nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
void LinearLruCache<ValueType>::set(size_t key, ValueType value) {
|
||||
|
||||
@@ -137,7 +137,7 @@ void GenerateRawVolumeTask::perform(const Task::ProgressCallback& progressCallba
|
||||
return;
|
||||
}
|
||||
|
||||
float value = luaL_checknumber(state, 1);
|
||||
float value = static_cast<float>(luaL_checknumber(state, 1));
|
||||
lua_pop(state, 1);
|
||||
rawVolume.set(cell, value);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(TransferFunctionProperty, volume::TransferFunct
|
||||
toLuaConversion,
|
||||
fromStringConversion,
|
||||
toStringConversion,
|
||||
LUA_TTABLE);
|
||||
LUA_TTABLE
|
||||
)
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -90,30 +90,30 @@ void ModuleEngine::deinitializeGL() {
|
||||
LDEBUG("Finished deinitializing OpenGL of modules");
|
||||
}
|
||||
|
||||
void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> module,
|
||||
void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> mod,
|
||||
const ghoul::Dictionary& configuration)
|
||||
{
|
||||
ghoul_assert(module, "Module must not be nullptr");
|
||||
ghoul_assert(mod, "Module must not be nullptr");
|
||||
|
||||
auto it = std::find_if(
|
||||
_modules.begin(),
|
||||
_modules.end(),
|
||||
[&module](std::unique_ptr<OpenSpaceModule>& rhs) {
|
||||
return rhs->identifier() == module->identifier();
|
||||
[&mod](std::unique_ptr<OpenSpaceModule>& rhs) {
|
||||
return rhs->identifier() == mod->identifier();
|
||||
}
|
||||
);
|
||||
if (it != _modules.end()) {
|
||||
throw ghoul::RuntimeError(
|
||||
"Module name '" + module->identifier() + "' was registered before",
|
||||
"Module name '" + mod->identifier() + "' was registered before",
|
||||
"ModuleEngine"
|
||||
);
|
||||
}
|
||||
|
||||
LDEBUG(fmt::format("Registering module '{}'", module->identifier()));
|
||||
module->initialize(this, configuration);
|
||||
addPropertySubOwner(module.get());
|
||||
LDEBUG(fmt::format("Registered module '{}'", module->identifier()));
|
||||
_modules.push_back(std::move(module));
|
||||
LDEBUG(fmt::format("Registering module '{}'", mod->identifier()));
|
||||
mod->initialize(this, configuration);
|
||||
addPropertySubOwner(mod.get());
|
||||
LDEBUG(fmt::format("Registered module '{}'", mod->identifier()));
|
||||
_modules.push_back(std::move(mod));
|
||||
}
|
||||
|
||||
std::vector<OpenSpaceModule*> ModuleEngine::modules() const {
|
||||
|
||||
@@ -156,8 +156,8 @@ OrbitalNavigator::OrbitalNavigator()
|
||||
, _mouseStates(_mouseSensitivity * 0.0001, 1 / (_friction.friction + 0.0000001))
|
||||
, _joystickStates(_joystickSensitivity * 0.1, 1 / (_friction.friction + 0.0000001))
|
||||
, _useAdaptiveStereoscopicDepth(UseAdaptiveStereoscopicDepthInfo, true)
|
||||
, _staticViewScaleExponent(StaticViewScaleExponentInfo, 0.f, -30, 10)
|
||||
, _stereoscopicDepthOfFocusSurface(StereoscopicDepthOfFocusSurfaceInfo, 8, 0.25, 100)
|
||||
, _staticViewScaleExponent(StaticViewScaleExponentInfo, 0.f, -30, 10)
|
||||
, _rotateToFocusInterpolationTime(RotateToFocusInterpolationTimeInfo, 2.0, 0.0, 10.0)
|
||||
, _stereoInterpolationTime(StereoInterpolationTimeInfo, 8.0, 0.0, 10.0)
|
||||
{
|
||||
@@ -512,22 +512,6 @@ glm::dquat OrbitalNavigator::interpolateLocalRotation(double deltaTime,
|
||||
else {
|
||||
return localCameraRotation;
|
||||
}
|
||||
|
||||
double t = _rotateToFocusNodeInterpolator.value();
|
||||
_rotateToFocusNodeInterpolator.setDeltaTime(static_cast<float>(deltaTime));
|
||||
_rotateToFocusNodeInterpolator.step();
|
||||
|
||||
glm::dquat result = glm::slerp(
|
||||
localCameraRotation,
|
||||
glm::dquat(glm::dvec3(0.0)),
|
||||
glm::min(t * _rotateToFocusNodeInterpolator.deltaTimeScaled(), 1.0)
|
||||
);
|
||||
|
||||
if (angle(result) < 0.01) {
|
||||
_rotateToFocusNodeInterpolator.end();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
double OrbitalNavigator::interpolateCameraToSurfaceDistance(double deltaTime,
|
||||
|
||||
@@ -48,8 +48,7 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) {
|
||||
return glm::dmat4x2(0);
|
||||
}
|
||||
else {
|
||||
result[i][j]
|
||||
= static_cast<glm::dmat4x2::value_type>(lua_tonumber(state, -1));
|
||||
result[i][j] = lua_tonumber(state, -1);
|
||||
lua_pop(state, 1);
|
||||
++number;
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D_MULTISAMPLE,
|
||||
_nAaSamples,
|
||||
GL_RGBA,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
true
|
||||
);
|
||||
|
||||
@@ -371,8 +371,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
GL_RGBA32F,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
0,
|
||||
GL_RGBA,
|
||||
GL_FLOAT,
|
||||
@@ -388,8 +388,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D_MULTISAMPLE,
|
||||
_nAaSamples,
|
||||
GL_RGBA32F,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
true
|
||||
);
|
||||
|
||||
@@ -399,8 +399,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D_MULTISAMPLE,
|
||||
_nAaSamples,
|
||||
GL_RGBA32F,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
true
|
||||
);
|
||||
|
||||
@@ -409,8 +409,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D_MULTISAMPLE,
|
||||
_nAaSamples,
|
||||
GL_DEPTH_COMPONENT32F,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
true
|
||||
);
|
||||
|
||||
@@ -419,8 +419,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
GL_RGBA16,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
0,
|
||||
GL_RGBA,
|
||||
GL_UNSIGNED_SHORT,
|
||||
@@ -436,8 +436,8 @@ void FramebufferRenderer::updateResolution() {
|
||||
GL_TEXTURE_2D,
|
||||
0,
|
||||
GL_DEPTH_COMPONENT32F,
|
||||
GLsizei(_resolution.x),
|
||||
GLsizei(_resolution.y),
|
||||
_resolution.x,
|
||||
_resolution.y,
|
||||
0,
|
||||
GL_DEPTH_COMPONENT,
|
||||
GL_FLOAT,
|
||||
|
||||
@@ -482,18 +482,18 @@ int removeSceneGraphNode(lua_State* L) {
|
||||
}
|
||||
|
||||
std::function<void (SceneGraphNode*, SceneGraphNode*)> removeNode =
|
||||
[&removeNode](SceneGraphNode* parent, SceneGraphNode* node) {
|
||||
std::vector<SceneGraphNode*> children = node->children();
|
||||
[&removeNode](SceneGraphNode* p, SceneGraphNode* localNode) {
|
||||
std::vector<SceneGraphNode*> children = localNode->children();
|
||||
|
||||
std::unique_ptr<SceneGraphNode> n = parent->detachChild(*node);
|
||||
ghoul_assert(n.get() == node, "Wrong node returned from detaching");
|
||||
std::unique_ptr<SceneGraphNode> n = p->detachChild(*localNode);
|
||||
ghoul_assert(n.get() == localNode, "Wrong node returned from detaching");
|
||||
|
||||
for (SceneGraphNode* c : children) {
|
||||
removeNode(n.get(), c);
|
||||
}
|
||||
|
||||
node->deinitializeGL();
|
||||
node->deinitialize();
|
||||
localNode->deinitializeGL();
|
||||
localNode->deinitialize();
|
||||
n = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -78,12 +78,12 @@ FactoryManager& FactoryManager::ref() {
|
||||
return *_manager;
|
||||
}
|
||||
|
||||
void FactoryManager::addFactory(std::unique_ptr<ghoul::TemplateFactoryBase> factory,
|
||||
std::string name
|
||||
) {
|
||||
ghoul_assert(factory, "Factory must not be nullptr");
|
||||
void FactoryManager::addFactory(std::unique_ptr<ghoul::TemplateFactoryBase> f,
|
||||
std::string name)
|
||||
{
|
||||
ghoul_assert(f, "Factory must not be nullptr");
|
||||
|
||||
_factories.push_back({ std::move(factory), std::move(name) });
|
||||
_factories.push_back({ std::move(f), std::move(name) });
|
||||
}
|
||||
|
||||
std::string FactoryManager::generateJson() const {
|
||||
|
||||
@@ -272,8 +272,7 @@ int time_advancedTime(lua_State* L) {
|
||||
lua_pop(L, 2);
|
||||
|
||||
if (usesISO) {
|
||||
Time t(j2000Seconds + dt);
|
||||
ghoul::lua::push(L, t.ISO8601());
|
||||
ghoul::lua::push(L, Time(j2000Seconds + dt).ISO8601());
|
||||
}
|
||||
else {
|
||||
ghoul::lua::push(L, j2000Seconds + dt);
|
||||
|
||||
Reference in New Issue
Block a user