mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 10:59:47 -05:00
Update GLM version
Correctly initialize all values as they are no longer default-initialized
This commit is contained in:
@@ -115,58 +115,6 @@ namespace {
|
||||
|
||||
namespace openspace {
|
||||
|
||||
AtmosphereDeferredcaster::AtmosphereDeferredcaster()
|
||||
: _transmittanceProgramObject(nullptr)
|
||||
, _irradianceProgramObject(nullptr)
|
||||
, _irradianceSupTermsProgramObject(nullptr)
|
||||
, _irradianceFinalProgramObject(nullptr)
|
||||
, _inScatteringProgramObject(nullptr)
|
||||
, _inScatteringSupTermsProgramObject(nullptr)
|
||||
, _deltaEProgramObject(nullptr)
|
||||
, _deltaSProgramObject(nullptr)
|
||||
, _deltaSSupTermsProgramObject(nullptr)
|
||||
, _deltaJProgramObject(nullptr)
|
||||
, _atmosphereProgramObject(nullptr)
|
||||
, _transmittanceTableTexture(0)
|
||||
, _irradianceTableTexture(0)
|
||||
, _inScatteringTableTexture(0)
|
||||
, _deltaETableTexture(0)
|
||||
, _deltaSRayleighTableTexture(0)
|
||||
, _deltaSMieTableTexture(0)
|
||||
, _deltaJTableTexture(0)
|
||||
, _atmosphereTexture(0)
|
||||
, _atmosphereCalculated(false)
|
||||
, _ozoneEnabled(false)
|
||||
, _sunFollowingCameraEnabled(false)
|
||||
, _atmosphereRadius(0.f)
|
||||
, _atmospherePlanetRadius(0.f)
|
||||
, _planetAverageGroundReflectance(0.f)
|
||||
, _planetGroundRadianceEmittion(0.f)
|
||||
, _rayleighHeightScale(0.f)
|
||||
, _ozoneHeightScale(0.f)
|
||||
, _mieHeightScale(0.f)
|
||||
, _miePhaseConstant(0.f)
|
||||
, _sunRadianceIntensity(5.f)
|
||||
, _rayleighScatteringCoeff(glm::vec3(0.f))
|
||||
, _ozoneExtinctionCoeff(glm::vec3(0.f))
|
||||
, _mieScatteringCoeff(glm::vec3(0.f))
|
||||
, _mieExtinctionCoeff(glm::vec3(0.f))
|
||||
, _ellipsoidRadii(glm::dvec3(0.0))
|
||||
, _transmittance_table_width(256)
|
||||
, _transmittance_table_height(64)
|
||||
, _irradiance_table_width(64)
|
||||
, _irradiance_table_height(16)
|
||||
, _delta_e_table_width(64)
|
||||
, _delta_e_table_height(16)
|
||||
, _r_samples(32)
|
||||
, _mu_samples(128)
|
||||
, _mu_s_samples(32)
|
||||
, _nu_samples(8)
|
||||
, _hardShadowsEnabled(false)
|
||||
, _calculationTextureScale(1.0)
|
||||
, _saveCalculationTextures(false)
|
||||
{}
|
||||
|
||||
void AtmosphereDeferredcaster::initialize() {
|
||||
if (!_atmosphereCalculated) {
|
||||
preCalculateAtmosphereParam();
|
||||
|
||||
@@ -47,7 +47,6 @@ struct ShadowConfiguration;
|
||||
|
||||
class AtmosphereDeferredcaster : public Deferredcaster {
|
||||
public:
|
||||
AtmosphereDeferredcaster();
|
||||
virtual ~AtmosphereDeferredcaster() = default;
|
||||
|
||||
void initialize();
|
||||
@@ -140,61 +139,61 @@ private:
|
||||
hardShadows, transmittanceTexture, irradianceTexture,
|
||||
inscatterTexture) _uniformCache2;
|
||||
|
||||
GLuint _transmittanceTableTexture;
|
||||
GLuint _irradianceTableTexture;
|
||||
GLuint _inScatteringTableTexture;
|
||||
GLuint _deltaETableTexture;
|
||||
GLuint _deltaSRayleighTableTexture;
|
||||
GLuint _deltaSMieTableTexture;
|
||||
GLuint _deltaJTableTexture;
|
||||
GLuint _atmosphereTexture;
|
||||
GLuint _transmittanceTableTexture = 0;
|
||||
GLuint _irradianceTableTexture = 0;
|
||||
GLuint _inScatteringTableTexture = 0;
|
||||
GLuint _deltaETableTexture = 0;
|
||||
GLuint _deltaSRayleighTableTexture = 0;
|
||||
GLuint _deltaSMieTableTexture = 0;
|
||||
GLuint _deltaJTableTexture = 0;
|
||||
GLuint _atmosphereTexture = 0;
|
||||
|
||||
ghoul::opengl::TextureUnit _transmittanceTableTextureUnit;
|
||||
ghoul::opengl::TextureUnit _irradianceTableTextureUnit;
|
||||
ghoul::opengl::TextureUnit _inScatteringTableTextureUnit;
|
||||
|
||||
// Atmosphere Data
|
||||
bool _atmosphereCalculated;
|
||||
bool _ozoneEnabled;
|
||||
bool _sunFollowingCameraEnabled;
|
||||
float _atmosphereRadius;
|
||||
float _atmospherePlanetRadius;
|
||||
float _planetAverageGroundReflectance;
|
||||
float _planetGroundRadianceEmittion;
|
||||
float _rayleighHeightScale;
|
||||
float _ozoneHeightScale;
|
||||
float _mieHeightScale;
|
||||
float _miePhaseConstant;
|
||||
float _sunRadianceIntensity;
|
||||
bool _atmosphereCalculated = false;
|
||||
bool _ozoneEnabled = false;
|
||||
bool _sunFollowingCameraEnabled = false;
|
||||
float _atmosphereRadius = 0.f;
|
||||
float _atmospherePlanetRadius = 0.f;
|
||||
float _planetAverageGroundReflectance = 0.f;
|
||||
float _planetGroundRadianceEmittion = 0.f;
|
||||
float _rayleighHeightScale = 0.f;
|
||||
float _ozoneHeightScale = 0.f;
|
||||
float _mieHeightScale = 0.f;
|
||||
float _miePhaseConstant = 0.f;
|
||||
float _sunRadianceIntensity = 5.f;
|
||||
|
||||
glm::vec3 _rayleighScatteringCoeff;
|
||||
glm::vec3 _ozoneExtinctionCoeff;
|
||||
glm::vec3 _mieScatteringCoeff;
|
||||
glm::vec3 _mieExtinctionCoeff;
|
||||
glm::dvec3 _ellipsoidRadii;
|
||||
glm::vec3 _rayleighScatteringCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _ozoneExtinctionCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _mieScatteringCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _mieExtinctionCoeff = glm::vec3(0.0);
|
||||
glm::dvec3 _ellipsoidRadii = glm::vec3(0.0);
|
||||
|
||||
// Atmosphere Textures Dimmensions
|
||||
int _transmittance_table_width;
|
||||
int _transmittance_table_height;
|
||||
int _irradiance_table_width;
|
||||
int _irradiance_table_height;
|
||||
int _delta_e_table_width;
|
||||
int _delta_e_table_height;
|
||||
int _r_samples;
|
||||
int _mu_samples;
|
||||
int _mu_s_samples;
|
||||
int _nu_samples;
|
||||
int _transmittance_table_width = 256;
|
||||
int _transmittance_table_height = 64;
|
||||
int _irradiance_table_width = 64;
|
||||
int _irradiance_table_height = 16;
|
||||
int _delta_e_table_width = 64;
|
||||
int _delta_e_table_height = 16;
|
||||
int _r_samples = 32;
|
||||
int _mu_samples = 128;
|
||||
int _mu_s_samples = 32;
|
||||
int _nu_samples = 8;
|
||||
|
||||
glm::dmat4 _modelTransform;
|
||||
double _time = 0.0;
|
||||
|
||||
// Eclipse Shadows
|
||||
std::vector<ShadowConfiguration> _shadowConfArray;
|
||||
bool _hardShadowsEnabled;
|
||||
bool _hardShadowsEnabled = false
|
||||
|
||||
// Atmosphere Debugging
|
||||
float _calculationTextureScale;
|
||||
bool _saveCalculationTextures;
|
||||
float _calculationTextureScale = 1.f;
|
||||
bool _saveCalculationTextures = false;
|
||||
};
|
||||
|
||||
} // openspace
|
||||
|
||||
@@ -254,27 +254,6 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary)
|
||||
, _sunIntensityP(SunIntensityInfo, 50.0f, 0.1f, 1000.0f)
|
||||
, _sunFollowingCameraEnabledP(EnableSunOnCameraPositionInfo, false)
|
||||
, _hardShadowsEnabledP(EclipseHardShadowsInfo, false)
|
||||
, _atmosphereEnabled(false)
|
||||
, _ozoneLayerEnabled(false)
|
||||
, _sunFollowingCameraEnabled(false)
|
||||
, _atmosphereRadius(0.f)
|
||||
, _atmospherePlanetRadius(0.f)
|
||||
, _planetAverageGroundReflectance(0.f)
|
||||
, _planetGroundRadianceEmittion(0.f)
|
||||
, _rayleighHeightScale(0.f)
|
||||
, _ozoneHeightScale(0.f)
|
||||
, _mieHeightScale(0.f)
|
||||
, _miePhaseConstant(0.f)
|
||||
, _sunRadianceIntensity(5.f)
|
||||
, _mieScattExtPropCoefProp(1.f)
|
||||
, _mieExtinctionCoeff(glm::vec3(0.f))
|
||||
, _rayleighScatteringCoeff(glm::vec3(0.f))
|
||||
, _ozoneExtinctionCoeff(glm::vec3(0.f))
|
||||
, _mieScatteringCoeff(glm::vec3(0.f))
|
||||
, _saveCalculationsToTexture(false)
|
||||
, _preCalculatedTexturesScale(1.0)
|
||||
, _shadowEnabled(false)
|
||||
, _hardShadows(false)
|
||||
{
|
||||
ghoul_precondition(
|
||||
dictionary.hasKeyAndValue<std::string>(SceneGraphNode::KeyIdentifier),
|
||||
@@ -452,8 +431,9 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
if (!rayleighDictionary.getValue(
|
||||
keyRayleighHeightScale,
|
||||
_rayleighHeightScale))
|
||||
keyRayleighHeightScale,
|
||||
_rayleighHeightScale)
|
||||
)
|
||||
{
|
||||
errorReadingAtmosphereData = true;
|
||||
LWARNINGC(
|
||||
|
||||
@@ -59,13 +59,13 @@ struct ShadowConfiguration {
|
||||
};
|
||||
|
||||
struct ShadowRenderingStruct {
|
||||
double xu;
|
||||
double xp;
|
||||
double rs;
|
||||
double rc;
|
||||
glm::dvec3 sourceCasterVec;
|
||||
glm::dvec3 casterPositionVec;
|
||||
bool isShadowing;
|
||||
double xu = 0.0;
|
||||
double xp = 0.0;
|
||||
double rs = 0.0;
|
||||
double rc = 0.0;
|
||||
glm::dvec3 sourceCasterVec = glm::dvec3(0.0);
|
||||
glm::dvec3 casterPositionVec = glm::dvec3(0.0);
|
||||
bool isShadowing = false;
|
||||
};
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
@@ -110,35 +110,35 @@ private:
|
||||
properties::BoolProperty _sunFollowingCameraEnabledP;
|
||||
properties::BoolProperty _hardShadowsEnabledP;
|
||||
|
||||
bool _atmosphereEnabled;
|
||||
bool _ozoneLayerEnabled;
|
||||
bool _sunFollowingCameraEnabled;
|
||||
float _atmosphereRadius;
|
||||
float _atmospherePlanetRadius;
|
||||
float _planetAverageGroundReflectance;
|
||||
float _planetGroundRadianceEmittion;
|
||||
float _rayleighHeightScale;
|
||||
float _ozoneHeightScale;
|
||||
float _mieHeightScale;
|
||||
float _miePhaseConstant;
|
||||
float _sunRadianceIntensity;
|
||||
float _mieScattExtPropCoefProp;
|
||||
bool _atmosphereEnabled = false;
|
||||
bool _ozoneLayerEnabled = false;
|
||||
bool _sunFollowingCameraEnabled = false;
|
||||
float _atmosphereRadius = 0.f;
|
||||
float _atmospherePlanetRadius = 0.f;
|
||||
float _planetAverageGroundReflectance = 0.f;
|
||||
float _planetGroundRadianceEmittion = 0.f;
|
||||
float _rayleighHeightScale = 0.f;
|
||||
float _ozoneHeightScale = 0.f;
|
||||
float _mieHeightScale = 0.f;
|
||||
float _miePhaseConstant = 0.f;
|
||||
float _sunRadianceIntensity = 5.f;
|
||||
float _mieScattExtPropCoefProp = 1.f;
|
||||
|
||||
glm::vec3 _mieExtinctionCoeff;
|
||||
glm::vec3 _rayleighScatteringCoeff;
|
||||
glm::vec3 _ozoneExtinctionCoeff;
|
||||
glm::vec3 _mieScatteringCoeff;
|
||||
glm::vec3 _mieExtinctionCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _rayleighScatteringCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _ozoneExtinctionCoeff = glm::vec3(0.0);
|
||||
glm::vec3 _mieScatteringCoeff = glm::dvec3(0.0);
|
||||
|
||||
// Atmosphere Debug
|
||||
bool _saveCalculationsToTexture;
|
||||
float _preCalculatedTexturesScale;
|
||||
bool _saveCalculationsToTexture = false;
|
||||
float _preCalculatedTexturesScale = 1.f;
|
||||
|
||||
std::unique_ptr<AtmosphereDeferredcaster> _deferredcaster;
|
||||
|
||||
bool _shadowEnabled;
|
||||
bool _hardShadows;
|
||||
bool _shadowEnabled = false;
|
||||
bool _hardShadows = false;
|
||||
|
||||
glm::dmat3 _stateMatrix;
|
||||
glm::dmat3 _stateMatrix = glm::dmat3(1.0);
|
||||
|
||||
std::vector<ShadowConfiguration> _shadowConfArray;
|
||||
};
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
properties::BoolProperty _doSimplification;
|
||||
properties::OptionProperty _requestedUnit;
|
||||
|
||||
glm::dvec3 _prevPosition;
|
||||
glm::dvec3 _prevPosition = glm::dvec3(0.0);
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
||||
};
|
||||
|
||||
@@ -215,7 +215,7 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
|
||||
);
|
||||
glm::dvec3 newUp = glm::cross(normal, newRight);
|
||||
|
||||
glm::dmat4 cameraOrientedRotation;
|
||||
glm::dmat4 cameraOrientedRotation = glm::dmat4(1.0);
|
||||
cameraOrientedRotation[0] = glm::dvec4(newRight, 0.0);
|
||||
cameraOrientedRotation[1] = glm::dvec4(newUp, 0.0);
|
||||
cameraOrientedRotation[2] = glm::dvec4(normal, 0.0);
|
||||
|
||||
@@ -175,7 +175,7 @@ documentation::Documentation RenderableTrail::Documentation() {
|
||||
|
||||
RenderableTrail::Appearance::Appearance()
|
||||
: properties::PropertyOwner(AppearanceInfo)
|
||||
, lineColor(LineColorInfo, glm::vec3(1.0f, 1.0f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, lineColor(LineColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, useLineFade(EnableFadeInfo, true)
|
||||
, lineFade(FadeInfo, 1.f, 0.f, 30.f)
|
||||
, lineWidth(LineWidthInfo, 10.f, 1.f, 20.f)
|
||||
|
||||
@@ -35,25 +35,25 @@ namespace {
|
||||
"graph node that this transformation is attached to relative to its parent."
|
||||
};
|
||||
|
||||
// Conversion from rotation matrix to euler angles,
|
||||
// given that the rotation is a pure rotation matrix.
|
||||
// Inspired by:
|
||||
// https://www.learnopencv.com/rotation-matrix-to-euler-angles/
|
||||
// Conversion from rotation matrix to euler angles, given that the rotation is a pure
|
||||
// rotation matrix.
|
||||
// Inspired by: https://www.learnopencv.com/rotation-matrix-to-euler-angles/
|
||||
glm::dvec3 rotationMatrixToEulerAngles(glm::dmat4 mat) {
|
||||
double sy = glm::sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1]);
|
||||
const double sy = glm::sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1]);
|
||||
bool singular = sy < 1e-6;
|
||||
|
||||
double x, y, z;
|
||||
glm::dvec3 res;
|
||||
if (singular) {
|
||||
x = glm::atan(-mat[2][1], mat[1][1]);
|
||||
y = glm::atan(-mat[0][2], sy);
|
||||
z = 0;
|
||||
} else {
|
||||
x = glm::atan(mat[1][2], mat[2][2]);
|
||||
y = glm::atan(-mat[0][2], sy);
|
||||
z = glm::atan(mat[0][1], mat[0][0]);
|
||||
res.x = glm::atan(-mat[2][1], mat[1][1]);
|
||||
res.y = glm::atan(-mat[0][2], sy);
|
||||
res.z = 0;
|
||||
}
|
||||
return glm::dvec3(x, y, z);
|
||||
else {
|
||||
res.x = glm::atan(mat[1][2], mat[2][2]);
|
||||
res.y = glm::atan(-mat[0][2], sy);
|
||||
res.z = glm::atan(mat[0][1], mat[0][0]);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
private:
|
||||
properties::Vec3Property _eulerRotation;
|
||||
mutable glm::dmat3 _cachedMatrix;
|
||||
mutable glm::dmat3 _cachedMatrix = glm::dmat3(1.0);
|
||||
mutable bool _matrixIsDirty = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ double StaticScale::scaleValue(const UpdateData&) const {
|
||||
return _scaleValue;
|
||||
}
|
||||
|
||||
StaticScale::StaticScale() : _scaleValue(ScaleInfo, 1.0, 0.1, 100) {
|
||||
StaticScale::StaticScale() : _scaleValue(ScaleInfo, 1.f, 0.1f, 100.f) {
|
||||
addProperty(_scaleValue);
|
||||
|
||||
_scaleValue.onChange([this]() {
|
||||
|
||||
@@ -1475,7 +1475,7 @@ bool RenderableBillboardsCloud::readLabelFile() {
|
||||
std::stringstream str(line);
|
||||
|
||||
glm::vec3 position;
|
||||
for (auto j = 0; j < 3; ++j) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
str >> position[j];
|
||||
}
|
||||
|
||||
@@ -1693,7 +1693,7 @@ void RenderableBillboardsCloud::createDataSlice() {
|
||||
addPosition(position);
|
||||
}
|
||||
}
|
||||
_fadeInDistance.setMaxValue(glm::vec2(10.0f * biggestCoord));
|
||||
_fadeInDistance.setMaxValue(glm::vec2(10.f * biggestCoord));
|
||||
}
|
||||
|
||||
void RenderableBillboardsCloud::createPolygonTexture() {
|
||||
|
||||
@@ -236,12 +236,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
|
||||
//, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f)
|
||||
, _textColor(
|
||||
TextColorInfo,
|
||||
glm::vec4(1.0f, 1.0, 1.0f, 1.f),
|
||||
glm::vec4(0.f),
|
||||
glm::vec4(1.f)
|
||||
)
|
||||
, _textColor(TextColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f))
|
||||
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _drawElements(DrawElementsInfo, true)
|
||||
, _drawLabels(DrawLabelInfo, false)
|
||||
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
std::vector<std::pair<glm::vec3, std::string>> _labelData;
|
||||
int _nValuesPerAstronomicalObject = 0;
|
||||
|
||||
glm::dmat4 _transformationMatrix;
|
||||
glm::dmat4 _transformationMatrix = glm::dmat4(1.0);
|
||||
|
||||
std::unordered_map<int, glm::vec3> _meshColorMap;
|
||||
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
|
||||
|
||||
@@ -371,8 +371,8 @@ void RenderableFieldlines::loadSeedPointsFromTable() {
|
||||
LINFO("Loading provided list of seed points");
|
||||
ghoul::Dictionary seedpointsDictionary;
|
||||
_seedPointsInfo.getValue(KeySeedPointsTable, seedpointsDictionary);
|
||||
glm::vec3 seedPos;
|
||||
for (const std::string& index : seedpointsDictionary.keys()) {
|
||||
glm::vec3 seedPos;
|
||||
_fieldlineInfo.getValue(std::string(KeySeedPointsTable) + "." + index, seedPos);
|
||||
_seedPoints.push_back(seedPos);
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence(
|
||||
, _pColorTablePath(ColorTablePathInfo)
|
||||
, _pColorUniform(
|
||||
ColorUniformInfo,
|
||||
glm::vec4(0.75f, 0.5f, 0.0f, 0.5f),
|
||||
glm::vec4(0.75f, 0.5f, 0.f, 0.5f),
|
||||
glm::vec4(0.f),
|
||||
glm::vec4(1.f)
|
||||
)
|
||||
@@ -263,7 +263,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence(
|
||||
, _pDomainR(DomainRInfo)
|
||||
, _pFlowColor(
|
||||
FlowColorInfo,
|
||||
glm::vec4(0.8f, 0.7f, 0.0f, 0.6f),
|
||||
glm::vec4(0.8f, 0.7f, 0.f, 0.6f),
|
||||
glm::vec4(0.f),
|
||||
glm::vec4(1.f)
|
||||
)
|
||||
|
||||
@@ -51,7 +51,7 @@ void OctreeManager::initOctree(long long cpuRamBudget, int maxDist, int maxStars
|
||||
// Initialize the culler. The NDC.z of the comparing corners are always -1 or 1.
|
||||
globebrowsing::AABB3 box;
|
||||
box.min = glm::vec3(-1.f, -1.f, 0.f);
|
||||
box.max = glm::vec3(1.f, 1.f, 1e2);
|
||||
box.max = glm::vec3(1.f, 1.f, 100.f);
|
||||
_culler = std::make_unique<OctreeCuller>(box);
|
||||
_removedKeysInPrevCall = std::set<int>();
|
||||
_leastRecentlyFetchedNodes = std::queue<unsigned long long>();
|
||||
|
||||
@@ -2325,7 +2325,7 @@ void RenderableGaiaStars::update(const UpdateData&) {
|
||||
// Update FBO texture resolution if we haven't already.
|
||||
glm::vec2 screenSize = glm::vec2(global::renderEngine.renderingResolution());
|
||||
const bool hasChanged = glm::any(
|
||||
glm::notEqual(_fboTexture->dimensions(), glm::uvec3(screenSize, 1.0))
|
||||
glm::notEqual(_fboTexture->dimensions(), glm::uvec3(screenSize, 1))
|
||||
);
|
||||
|
||||
if (hasChanged) {
|
||||
|
||||
@@ -191,7 +191,7 @@ private:
|
||||
size_t _nRenderValuesPerStar = 0;
|
||||
int _nStarsToRender = 0;
|
||||
bool _firstDrawCalls = true;
|
||||
glm::dquat _previousCameraRotation;
|
||||
glm::dquat _previousCameraRotation = glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
bool _useVBO = false;
|
||||
long long _cpuRamBudgetInBytes = 0;
|
||||
long long _totalDatasetSizeInBytes = 0;
|
||||
|
||||
@@ -78,13 +78,13 @@ private:
|
||||
glm::dmat4 modelViewTransform(const RenderData& data);
|
||||
|
||||
BoxGeometry _boundingBox;
|
||||
float _stepSize;
|
||||
glm::mat4 _modelTransform;
|
||||
glm::vec3 _aspect;
|
||||
double _time;
|
||||
float _opacityCoefficient;
|
||||
float _absorptionMultiply;
|
||||
float _emissionMultiply;
|
||||
float _stepSize = 0.f
|
||||
glm::mat4 _modelTransform = glm::mat4(1.f);
|
||||
glm::vec3 _aspect = glm::vec3(0.f);
|
||||
double _time = 0.0;
|
||||
float _opacityCoefficient = 0.f;
|
||||
float _absorptionMultiply = 0.f;
|
||||
float _emissionMultiply = 0.f;
|
||||
ghoul::opengl::Texture& _texture;
|
||||
std::unique_ptr<ghoul::opengl::TextureUnit> _textureUnit;
|
||||
|
||||
|
||||
@@ -183,7 +183,12 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
|
||||
)
|
||||
, _enabledPointsRatio(EnabledPointsRatioInfo, 0.5f, 0.01f, 1.0f)
|
||||
, _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _rotation(RotationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(6.28f))
|
||||
, _rotation(
|
||||
RotationInfo,
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(glm::two_pi<float>())
|
||||
)
|
||||
, _downScaleVolumeRendering(DownscaleVolumeRenderingInfo, 1.f, 0.1f, 1.f)
|
||||
, _numberOfRayCastingSteps(NumberOfRayCastingStepsInfo, 1000.f, 1.f, 1000.f)
|
||||
{
|
||||
@@ -545,7 +550,7 @@ void RenderableGalaxy::update(const UpdateData& data) {
|
||||
_pointTransform = transform;
|
||||
//_pointTransform = glm::scale(transform, _pointScaling);
|
||||
|
||||
const glm::vec4 translation = glm::vec4(_translation.value()*_volumeSize, 0.0);
|
||||
const glm::vec4 translation = glm::vec4(_translation.value()*_volumeSize, 0.f);
|
||||
|
||||
// Todo: handle floating point overflow, to actually support translation.
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ private:
|
||||
Result loadPointFile(const std::string& file);
|
||||
Result loadCachedFile(const std::string& file);
|
||||
|
||||
glm::vec3 _volumeSize;
|
||||
glm::vec3 _pointScaling;
|
||||
glm::vec3 _volumeSize = glm::vec3(0.f);
|
||||
glm::vec3 _pointScaling = glm::vec3(0.f);
|
||||
properties::BoolProperty _volumeRenderingEnabled;
|
||||
properties::BoolProperty _starRenderingEnabled;
|
||||
properties::FloatProperty _stepSize;
|
||||
@@ -84,16 +84,16 @@ private:
|
||||
std::unique_ptr<ghoul::filesystem::File> _pointSpreadFunctionFile;
|
||||
|
||||
std::string _volumeFilename;
|
||||
glm::ivec3 _volumeDimensions;
|
||||
glm::ivec3 _volumeDimensions = glm::ivec3(0);
|
||||
std::string _pointsFilename;
|
||||
std::string _pointSpreadFunctionTexturePath;
|
||||
|
||||
std::unique_ptr<GalaxyRaycaster> _raycaster;
|
||||
std::unique_ptr<volume::RawVolume<glm::tvec4<GLubyte>>> _volume;
|
||||
std::unique_ptr<ghoul::opengl::Texture> _texture;
|
||||
glm::mat4 _pointTransform;
|
||||
glm::vec3 _aspect;
|
||||
float _opacityCoefficient;
|
||||
glm::mat4 _pointTransform = glm::mat4(1.f);
|
||||
glm::vec3 _aspect = glm::vec3(0.f);
|
||||
float _opacityCoefficient = 0.f
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _pointsProgram;
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _billboardsProgram;
|
||||
@@ -106,10 +106,10 @@ private:
|
||||
cameraUp, eyePosition, psfTexture
|
||||
) _uniformCacheBillboards;
|
||||
std::vector<float> _pointsData;
|
||||
size_t _nPoints;
|
||||
GLuint _pointsVao;
|
||||
GLuint _positionVbo;
|
||||
GLuint _colorVbo;
|
||||
size_t _nPoints = 0;
|
||||
GLuint _pointsVao = 0;
|
||||
GLuint _positionVbo = 0;
|
||||
GLuint _colorVbo = 0;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -86,8 +86,8 @@ void MilkywayConversionTask::perform(const Task::ProgressCallback& onProgress) {
|
||||
);
|
||||
std::function<glm::tvec4<GLfloat>(glm::ivec3)> sampleFunction =
|
||||
[&](glm::ivec3 outCoord) {
|
||||
const glm::vec3 inCoord = ((glm::vec3(outCoord) + glm::vec3(0.5)) *
|
||||
resolutionRatio) - glm::vec3(0.5);
|
||||
const glm::vec3 inCoord = ((glm::vec3(outCoord) + glm::vec3(0.5f)) *
|
||||
resolutionRatio) - glm::vec3(0.5f);
|
||||
const glm::tvec4<GLfloat> value = sampler.sample(inCoord);
|
||||
return value;
|
||||
};
|
||||
|
||||
@@ -50,10 +50,10 @@ public:
|
||||
private:
|
||||
std::string _inFilenamePrefix;
|
||||
std::string _inFilenameSuffix;
|
||||
size_t _inFirstIndex;
|
||||
size_t _inNSlices;
|
||||
size_t _inFirstIndex = 0;
|
||||
size_t _inNSlices = 0;
|
||||
std::string _outFilename;
|
||||
glm::ivec3 _outDimensions;
|
||||
glm::ivec3 _outDimensions = glm::ivec3(0);
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -147,8 +147,8 @@ public:
|
||||
|
||||
|
||||
struct TileUvTransform {
|
||||
glm::vec2 uvOffset;
|
||||
glm::vec2 uvScale;
|
||||
glm::vec2 uvOffset = glm::vec2(0.f);
|
||||
glm::vec2 uvScale = glm::vec2(0.f);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
/**
|
||||
* \param radii defines three radii for the Ellipsoid
|
||||
*/
|
||||
Ellipsoid(glm::dvec3 radii = glm::dvec3(1.0, 1.0, 1.0));
|
||||
Ellipsoid(glm::dvec3 radii = glm::dvec3(1.0));
|
||||
|
||||
/**
|
||||
* Scales a point along the geocentric normal and places it on the surface of the
|
||||
@@ -95,16 +95,16 @@ public:
|
||||
|
||||
private:
|
||||
struct EllipsoidCache {
|
||||
glm::dvec3 radiiSquared;
|
||||
glm::dvec3 oneOverRadiiSquared;
|
||||
glm::dvec3 radiiToTheFourth;
|
||||
double minimumRadius;
|
||||
double maximumRadius;
|
||||
glm::dvec3 radiiSquared = glm::dvec3(0.0);
|
||||
glm::dvec3 oneOverRadiiSquared = glm::dvec3(0.0);
|
||||
glm::dvec3 radiiToTheFourth = glm::dvec3(0.0);
|
||||
double minimumRadius = 0.0;
|
||||
double maximumRadius = 0.0;
|
||||
} _cached;
|
||||
|
||||
void updateInternalCache();
|
||||
|
||||
glm::dvec3 _radii;
|
||||
glm::dvec3 _radii = glm::dvec3(0.0);
|
||||
|
||||
// Eclipse shadows conf
|
||||
std::vector<Ellipsoid::ShadowConfiguration> _shadowConfArray;
|
||||
|
||||
@@ -72,10 +72,10 @@ private:
|
||||
// Labels Structures
|
||||
struct LabelEntry {
|
||||
char feature[256];
|
||||
float diameter;
|
||||
float latitude;
|
||||
float longitude;
|
||||
glm::vec3 geoPosition;
|
||||
float diameter = 0.f;
|
||||
float latitude = 0.f;
|
||||
float longitude = 0.f;
|
||||
glm::vec3 geoPosition = glm::vec3(0.f);
|
||||
};
|
||||
|
||||
struct Labels {
|
||||
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
RenderableGlobe* _attachedNode = nullptr;
|
||||
|
||||
mutable bool _positionIsDirty = true;
|
||||
mutable glm::dvec3 _position;
|
||||
mutable glm::dvec3 _position = glm::dvec3(0.0);
|
||||
};
|
||||
|
||||
} // namespace openspace::globebrowsing
|
||||
|
||||
@@ -94,8 +94,8 @@ private:
|
||||
LayerRenderSettings _renderSettings;
|
||||
LayerAdjustment _layerAdjustment;
|
||||
|
||||
glm::ivec2 _padTilePixelStartOffset;
|
||||
glm::ivec2 _padTilePixelSizeDifference;
|
||||
glm::ivec2 _padTilePixelStartOffset = glm::ivec2(0);
|
||||
glm::ivec2 _padTilePixelSizeDifference = glm::ivec2(0);
|
||||
|
||||
const layergroupid::GroupID _layerGroupId;
|
||||
|
||||
|
||||
@@ -253,8 +253,8 @@ private:
|
||||
SkirtedGrid _grid;
|
||||
LayerManager _layerManager;
|
||||
|
||||
glm::dmat4 _cachedModelTransform;
|
||||
glm::dmat4 _cachedInverseModelTransform;
|
||||
glm::dmat4 _cachedModelTransform = glm::dmat4(1.0);
|
||||
glm::dmat4 _cachedInverseModelTransform = glm::dmat4(1.0);
|
||||
|
||||
ghoul::ReusableTypedMemoryPool<Chunk, 256> _chunkPool;
|
||||
|
||||
|
||||
@@ -110,11 +110,11 @@ struct TextTileProvider : public TileProvider {
|
||||
|
||||
std::unique_ptr<ghoul::fontrendering::FontRenderer> fontRenderer;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> font;
|
||||
size_t fontSize;
|
||||
size_t fontSize = 0;
|
||||
|
||||
std::string text;
|
||||
glm::vec2 textPosition;
|
||||
glm::vec4 textColor;
|
||||
glm::vec2 textPosition = glm::vec2(0.f);
|
||||
glm::vec4 textColor = glm::vec4(0.f);
|
||||
|
||||
GLuint fbo = 0;
|
||||
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
|
||||
namespace openspace::globebrowsing {
|
||||
|
||||
/**
|
||||
* All information needed to create a texture used for a Tile.
|
||||
*/
|
||||
|
||||
/// All information needed to create a texture used for a Tile.
|
||||
class TileTextureInitData {
|
||||
public:
|
||||
using HashKey = uint64_t;
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace openspace {
|
||||
// This should be moved into the touch module ---abock
|
||||
struct Touch {
|
||||
bool active;
|
||||
glm::vec2 pos;
|
||||
uint32_t action;
|
||||
glm::vec2 pos = glm::vec2(0.f);
|
||||
uint32_t action = 0;
|
||||
};
|
||||
|
||||
class ImGUIModule : public OpenSpaceModule {
|
||||
|
||||
@@ -91,7 +91,7 @@ protected:
|
||||
|
||||
std::shared_ptr<DataProcessor> _dataProcessor;
|
||||
std::string _dataBuffer;
|
||||
glm::size3_t _textureDimensions;
|
||||
glm::size3_t _textureDimensions = glm::size3_t(0);
|
||||
|
||||
private:
|
||||
bool readyToRender() const override;
|
||||
|
||||
@@ -55,17 +55,17 @@ public:
|
||||
|
||||
protected:
|
||||
struct Metadata {
|
||||
int id;
|
||||
int updateTime;
|
||||
int id = -1;
|
||||
int updateTime = -1;
|
||||
std::string groupName;
|
||||
std::string path;
|
||||
std::string parent;
|
||||
std::string frame;
|
||||
glm::vec3 gridMin;
|
||||
glm::vec3 gridMax;
|
||||
glm::vec3 offset;
|
||||
glm::vec3 scale;
|
||||
glm::vec4 spatialScale;
|
||||
glm::vec3 gridMin = glm::vec3(0.f);
|
||||
glm::vec3 gridMax = glm::vec3(0.f);
|
||||
glm::vec3 offset = glm::vec3(0.f);
|
||||
glm::vec3 scale = glm::vec3(0.f);
|
||||
glm::vec4 spatialScale = glm::vec4(0.f);
|
||||
std::string scaleVariable;
|
||||
std::string coordinateType;
|
||||
};
|
||||
@@ -134,10 +134,10 @@ protected:
|
||||
glm::mat4 _rotation = glm::mat4(1.f);
|
||||
|
||||
private:
|
||||
glm::dmat3 _stateMatrix;
|
||||
glm::dmat3 _stateMatrix = glm::dmat3(1.0);
|
||||
|
||||
double _openSpaceTime;
|
||||
double _lastUpdateOpenSpaceTime;
|
||||
double _openSpaceTime = 0.0;
|
||||
double _lastUpdateOpenSpaceTime = 0.0;
|
||||
|
||||
std::chrono::milliseconds _realTime;
|
||||
std::chrono::milliseconds _lastUpdateRealTime;
|
||||
|
||||
@@ -84,10 +84,10 @@ private:
|
||||
|
||||
std::string _kwPath;
|
||||
|
||||
glm::size3_t _dimensions;
|
||||
float* _dataSlice;
|
||||
glm::size3_t _dimensions = glm::size3_t(0);
|
||||
float* _dataSlice = nullptr;
|
||||
std::string _var;
|
||||
float _scale;
|
||||
float _scale = 0.f;
|
||||
|
||||
glm::vec3 _origOffset;
|
||||
|
||||
@@ -108,8 +108,8 @@ private:
|
||||
};
|
||||
Cut _cut;
|
||||
|
||||
GLuint _quad;
|
||||
GLuint _vertexPositionBuffer;
|
||||
GLuint _quad = 0;
|
||||
GLuint _vertexPositionBuffer = 0;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -76,7 +76,7 @@ protected:
|
||||
void add(const std::vector<std::vector<float>>& optionValues,
|
||||
const std::vector<float>& sum);
|
||||
|
||||
glm::size3_t _dimensions;
|
||||
glm::size3_t _dimensions = glm::size3_t(0);
|
||||
bool _useLog = false;
|
||||
bool _useHistogram = false;
|
||||
glm::vec2 _normValues = glm::vec2(1.f);
|
||||
@@ -90,7 +90,7 @@ protected:
|
||||
std::vector<std::unique_ptr<Histogram>> _histograms;
|
||||
std::set<std::string> _coordinateVariables = { "x", "y", "z", "phi", "theta" };
|
||||
|
||||
glm::vec2 _histNormValues = glm::vec2(10.f, 10.f);
|
||||
glm::vec2 _histNormValues = glm::vec2(10.f);
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -408,10 +408,10 @@ std::string IswaManager::parseKWToLuaTable(const CdfInfo& info, const std::strin
|
||||
if (extension == "cdf") {
|
||||
KameleonWrapper kw = KameleonWrapper(absPath(info.path));
|
||||
|
||||
std::string parent = kw.parent();
|
||||
std::string frame = kw.frame();
|
||||
glm::vec3 min = kw.gridMin();
|
||||
glm::vec3 max = kw.gridMax();
|
||||
std::string parent = kw.parent();
|
||||
std::string frame = kw.frame();
|
||||
glm::vec3 min = kw.gridMin();
|
||||
glm::vec3 max = kw.gridMax();
|
||||
|
||||
|
||||
std::array<std::string, 3> gridUnits = kw.gridUnits();
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace ccmc {
|
||||
namespace openspace {
|
||||
|
||||
struct LinePoint {
|
||||
glm::vec3 position;
|
||||
glm::vec4 color;
|
||||
glm::vec3 position = glm::vec3(0.f);
|
||||
glm::vec4 color = glm::vec4(0.f);
|
||||
};
|
||||
|
||||
std::array<std::string, 3> gridVariables(ccmc::Model* model);
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
enum class Model {
|
||||
OpenGGCM,
|
||||
BATSRUS, // Magnetosphere
|
||||
ENLIL, // Heliosphere
|
||||
ENLIL, // Heliosphere
|
||||
MAS,
|
||||
Adapt3D,
|
||||
SWMF,
|
||||
@@ -145,10 +145,10 @@ private:
|
||||
ccmc::Interpolator* _interpolator = nullptr;
|
||||
|
||||
// Model parameters
|
||||
glm::vec3 _min;
|
||||
glm::vec3 _max;
|
||||
glm::vec3 _validMin;
|
||||
glm::vec3 _validMax;
|
||||
glm::vec3 _min = glm::vec3(0.f);
|
||||
glm::vec3 _max = glm::vec3(0.f);
|
||||
glm::vec3 _validMin = glm::vec3(0.f);
|
||||
glm::vec3 _validMax = glm::vec3(0.f);
|
||||
std::string _xCoordVar;
|
||||
std::string _yCoordVar;
|
||||
std::string _zCoordVar;
|
||||
|
||||
@@ -155,7 +155,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict
|
||||
}
|
||||
else {
|
||||
LWARNING("No dimensions specified for volumetric data, falling back to 32^3");
|
||||
_dimensions = glm::uvec3(32, 32, 32);
|
||||
_dimensions = glm::uvec3(32);
|
||||
}
|
||||
|
||||
_stepSize = dictionary.value<float>(KeyStepSize);
|
||||
@@ -302,7 +302,7 @@ void RenderableKameleonVolume::updateRaycasterModelTransform() {
|
||||
const glm::vec3 translation = (lBBoxBound + uBBoxBound) * 0.5f;
|
||||
|
||||
const glm::mat4 modelTransform = glm::scale(
|
||||
glm::translate(glm::mat4(1.0), translation),
|
||||
glm::translate(glm::mat4(1.f), translation),
|
||||
scale
|
||||
);
|
||||
_raycaster->setModelTransform(modelTransform);
|
||||
|
||||
@@ -48,10 +48,10 @@ private:
|
||||
|
||||
std::string _variable;
|
||||
std::string _units;
|
||||
glm::uvec3 _dimensions;
|
||||
glm::uvec3 _dimensions = glm::uvec3(0);
|
||||
bool _autoDomainBounds = false;
|
||||
glm::vec3 _lowerDomainBound;
|
||||
glm::vec3 _upperDomainBound;
|
||||
glm::vec3 _lowerDomainBound = glm::vec3(0.f);
|
||||
glm::vec3 _upperDomainBound = glm::vec3(0.f);
|
||||
};
|
||||
|
||||
} // namespace openspace::kameleon
|
||||
|
||||
@@ -340,7 +340,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
|
||||
std::vector<float> gradients(tfWidth - 1);
|
||||
for (size_t offset = 0; offset < tfWidth - 1; offset++) {
|
||||
const glm::vec4 prevRgba = tf->sample(offset);
|
||||
const glm::vec4 nextRgba = tf->sample(offset + 1);
|
||||
const glm::vec4 nextRgba = tf->sample(offset + 1);
|
||||
|
||||
const float colorDifference = glm::distance(prevRgba, nextRgba);
|
||||
const float alpha = (prevRgba.w + nextRgba.w) * 0.5f;
|
||||
|
||||
@@ -159,7 +159,7 @@ bool MultiresVolumeRaycaster::isCameraInside(const RenderData& data,
|
||||
glm::vec4 modelPos = (glm::inverse(scaledModelTransform) / divisor) * camWorldPos;
|
||||
|
||||
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5));
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5f));
|
||||
return (localPosition.x > 0 && localPosition.y > 0 && localPosition.z > 0 &&
|
||||
localPosition.x < 1 && localPosition.y < 1 && localPosition.z < 1);
|
||||
}
|
||||
|
||||
@@ -77,8 +77,8 @@ public:
|
||||
|
||||
private:
|
||||
BoxGeometry _boundingBox;
|
||||
glm::mat4 _modelTransform;
|
||||
float _stepSizeCoefficient;
|
||||
glm::mat4 _modelTransform = glm::mat4(1.f);
|
||||
float _stepSizeCoefficient = 0.f;
|
||||
|
||||
std::shared_ptr<TSP> _tsp;
|
||||
std::shared_ptr<AtlasManager> _atlasManager;
|
||||
|
||||
@@ -169,7 +169,12 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict
|
||||
, _statsToFileName(StatsToFileNameInfo)
|
||||
, _scalingExponent(ScalingExponentInfo, 1, -10, 20)
|
||||
, _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f))
|
||||
, _rotation(RotationInfo, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f))
|
||||
, _rotation(
|
||||
RotationInfo,
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(glm::two_pi<float>())
|
||||
)
|
||||
, _scaling(ScalingInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f))
|
||||
{
|
||||
if (dictionary.hasKeyAndValue<std::string>(KeyDataSource)) {
|
||||
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
GLuint _vertexPositionBuffer = 0;
|
||||
bool _planeIsDirty = false;
|
||||
|
||||
glm::vec3 _sunPosition;
|
||||
glm::vec3 _sunPosition = glm::vec3(0.f);
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -64,9 +64,9 @@ public:
|
||||
|
||||
private:
|
||||
struct Vertex {
|
||||
glm::vec3 position;
|
||||
glm::vec3 color;
|
||||
glm::vec2 texcoord;
|
||||
glm::vec3 position = glm::vec3(0.f);
|
||||
glm::vec3 color = glm::vec3(0.f);
|
||||
glm::vec2 texcoord = glm::vec2(0.f);
|
||||
};
|
||||
|
||||
struct KeplerParameters {
|
||||
@@ -83,8 +83,12 @@ private:
|
||||
|
||||
/// The layout of the VBOs
|
||||
struct TrailVBOLayout {
|
||||
float x, y, z, time;
|
||||
double epoch, period;
|
||||
float x = 0.f;
|
||||
float y = 0.f;
|
||||
float z = 0.f;
|
||||
float time = 0.f;
|
||||
double epoch = 0.0;
|
||||
dobule period = 0.0;
|
||||
};
|
||||
|
||||
KeplerTranslation _keplerTranslator;
|
||||
@@ -111,7 +115,7 @@ private:
|
||||
|
||||
RenderableTrail::Appearance _appearance;
|
||||
|
||||
glm::vec3 _position;
|
||||
glm::vec3 _position = glm::vec3(0.f);
|
||||
|
||||
UniformCache(modelView, projection, lineFade, inGameTime, color, opacity,
|
||||
numberOfSegments) _uniformCache;
|
||||
|
||||
@@ -127,12 +127,7 @@ public:
|
||||
/// Recombutes the rotation matrix used in the update method
|
||||
void computeOrbitPlane() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
/**
|
||||
* This method computes the eccentric anomaly (location of the space craft taking the
|
||||
* eccentricity into acount) based on the mean anomaly (location of the space craft
|
||||
@@ -165,10 +160,10 @@ private:
|
||||
/// Dirty flag for the _orbitPlaneRotation parameters
|
||||
mutable bool _orbitPlaneDirty = true;
|
||||
/// The rotation matrix that defines the plane of the orbit
|
||||
mutable glm::dmat3 _orbitPlaneRotation;
|
||||
mutable glm::dmat3 _orbitPlaneRotation = glm::dmat3(1.0);
|
||||
|
||||
/// The cached position for the last time with which the update method was called
|
||||
glm::dvec3 _position;
|
||||
glm::dvec3 _position = glm::vec3(0.f);
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -44,7 +44,7 @@ private:
|
||||
properties::StringProperty _observer;
|
||||
properties::StringProperty _frame;
|
||||
|
||||
glm::dvec3 _position;
|
||||
glm::dvec3 _position = glm::vec3(0.f);
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -56,8 +56,8 @@ private:
|
||||
std::string _target;
|
||||
std::string _referenceFrame;
|
||||
|
||||
glm::vec4 _lineColorBegin;
|
||||
glm::vec4 _lineColorEnd;
|
||||
glm::vec4 _lineColorBegin = glm::vec4(0.f);
|
||||
glm::vec4 _lineColorEnd = glm::vec4(0.f);
|
||||
|
||||
int _frameCounter = 0;
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
SpiceManager::AberrationCorrection aberrationCorrection;
|
||||
|
||||
std::vector<glm::dvec3> bounds;
|
||||
glm::dvec3 boresight;
|
||||
glm::dvec3 boresight = glm::dvec3(0.0);
|
||||
std::vector<std::string> potentialTargets;
|
||||
} _instrument;
|
||||
|
||||
|
||||
@@ -90,20 +90,20 @@ private:
|
||||
|
||||
std::unique_ptr<modelgeometry::ModelGeometry> _geometry;
|
||||
|
||||
glm::dmat3 _instrumentMatrix;
|
||||
glm::dmat3 _instrumentMatrix = glm::dmat3(1.0);
|
||||
|
||||
// uniforms
|
||||
glm::vec3 _up;
|
||||
glm::mat4 _transform;
|
||||
glm::mat4 _projectorMatrix;
|
||||
glm::vec3 _boresight;
|
||||
glm::vec3 _up = glm::vec3(0.f);
|
||||
glm::mat4 _transform = glm::mat4(1.f);
|
||||
glm::mat4 _projectorMatrix = glm::mat4(1.f);
|
||||
glm::vec3 _boresight = glm::vec3(0.f);
|
||||
|
||||
std::vector<Image> _imageTimes;
|
||||
double _time = -std::numeric_limits<double>::max();
|
||||
|
||||
bool _shouldCapture = false;
|
||||
|
||||
glm::vec3 _sunPosition;
|
||||
glm::vec3 _sunPosition = glm::vec3(0.f);
|
||||
properties::BoolProperty _performShading;
|
||||
};
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ void RenderablePlaneProjection::updatePlane(const Image& img, double currentTime
|
||||
|
||||
std::string frame;
|
||||
std::vector<glm::dvec3> bounds;
|
||||
glm::dvec3 boresight;
|
||||
glm::dvec3 boresight = glm::dvec3(0.0);
|
||||
try {
|
||||
SpiceManager::FieldOfViewResult r = SpiceManager::ref().fieldOfView(_instrument);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
|
||||
bool _planeIsDirty = false;
|
||||
|
||||
glm::dmat3 _stateMatrix;
|
||||
glm::dmat3 _stateMatrix = glm::dmat3(0.0);
|
||||
std::string _frame;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
|
||||
|
||||
@@ -514,7 +514,7 @@ void RenderablePlanetProjection::attitudeParameters(double time) {
|
||||
|
||||
_transform = glm::mat4(_stateMatrix);
|
||||
|
||||
glm::dvec3 bs;
|
||||
glm::dvec3 bs = glm::dvec3(0.0);
|
||||
try {
|
||||
SpiceManager::FieldOfViewResult res = SpiceManager::ref().fieldOfView(
|
||||
_projectionComponent.instrumentId()
|
||||
|
||||
@@ -100,14 +100,14 @@ private:
|
||||
|
||||
std::unique_ptr<planetgeometry::PlanetGeometry> _geometry;
|
||||
|
||||
glm::vec2 _camScaling;
|
||||
glm::vec3 _up;
|
||||
glm::mat4 _transform;
|
||||
glm::mat4 _projectorMatrix;
|
||||
glm::vec2 _camScaling = glm::vec2(0.f);
|
||||
glm::vec3 _up = glm::vec3(0.f);
|
||||
glm::mat4 _transform = glm::mat4(1.f);
|
||||
glm::mat4 _projectorMatrix = glm::mat4(1.f);
|
||||
|
||||
glm::dmat3 _stateMatrix;
|
||||
glm::dmat3 _instrumentMatrix;
|
||||
glm::vec3 _boresight;
|
||||
glm::dmat3 _stateMatrix = glm::dmat3(1.0);
|
||||
glm::dmat3 _instrumentMatrix = glm::dmat3(1.0);
|
||||
glm::vec3 _boresight = glm::vec3(0.f);
|
||||
|
||||
std::vector<Image> _imageTimes;
|
||||
|
||||
|
||||
@@ -60,10 +60,10 @@ public:
|
||||
|
||||
private:
|
||||
struct CylinderVBOLayout {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float e;
|
||||
float x = 0.f;
|
||||
float y = 0.f;
|
||||
float z = 0.f;
|
||||
float e = 0.f;
|
||||
};
|
||||
|
||||
void createCylinder(double time);
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
ghoul::opengl::ProgramObject* _shader = nullptr;
|
||||
UniformCache(modelViewProjectionTransform, shadowColor) _uniformCache;
|
||||
|
||||
glm::dmat3 _stateMatrix;
|
||||
glm::dmat3 _stateMatrix = glm::dmat3(1.0);
|
||||
|
||||
GLuint _vao = 0;
|
||||
GLuint _vbo = 0;
|
||||
|
||||
@@ -71,10 +71,10 @@ public:
|
||||
|
||||
// Stores the velocity in all 6DOF
|
||||
struct VelocityStates {
|
||||
glm::dvec2 orbit;
|
||||
double zoom;
|
||||
double roll;
|
||||
glm::dvec2 pan;
|
||||
glm::dvec2 orbit = glm::dvec2(0.0);
|
||||
double zoom = 0.0;
|
||||
double roll = 0.0;
|
||||
glm::dvec2 pan = glm::dvec2(0.0);
|
||||
};
|
||||
|
||||
/* Main function call
|
||||
@@ -225,7 +225,7 @@ private:
|
||||
SceneGraphNode* _pickingSelected = nullptr;
|
||||
DirectInputSolver _solver;
|
||||
|
||||
glm::dquat _toSlerp;
|
||||
glm::dquat _toSlerp = glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
glm::vec2 _centroid = glm::vec2(0.f);
|
||||
|
||||
FrameTimeAverage _frameTimeAvg;
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
|
||||
properties::BoolProperty _touchActive;
|
||||
// contains an id and the Point that was processed last frame
|
||||
glm::ivec2 _webPositionCallback = glm::ivec2(0,0);
|
||||
glm::ivec2 _webPositionCallback = glm::ivec2(0);
|
||||
#ifdef WIN32
|
||||
std::unique_ptr<Win32TouchHook> _win32TouchHook;
|
||||
#endif //WIN32
|
||||
|
||||
@@ -85,7 +85,12 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
|
||||
, _scalingExponent(ScalingExponentInfo, 1, -10, 20)
|
||||
, _stepSize(StepSizeInfo, 0.02f, 0.01f, 1.f )
|
||||
, _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f))
|
||||
, _rotation(RotationInfo, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0), glm::vec3(6.28f))
|
||||
, _rotation(
|
||||
RotationInfo,
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(glm::two_pi<float>())
|
||||
)
|
||||
, _color(ColorInfo, glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f))
|
||||
, _downScaleVolumeRendering(DownscaleVolumeRenderingInfo, 1.f, 0.1f, 1.f)
|
||||
{
|
||||
@@ -180,14 +185,14 @@ void RenderableToyVolume::update(const UpdateData& data) {
|
||||
std::pow(10.0f, static_cast<float>(_scalingExponent))
|
||||
);
|
||||
glm::vec3 eulerRotation = static_cast<glm::vec3>(_rotation);
|
||||
transform = glm::rotate(transform, eulerRotation.x, glm::vec3(1, 0, 0));
|
||||
transform = glm::rotate(transform, eulerRotation.y, glm::vec3(0, 1, 0));
|
||||
transform = glm::rotate(transform, eulerRotation.z, glm::vec3(0, 0, 1));
|
||||
transform = glm::rotate(transform, eulerRotation.x, glm::vec3(1.f, 0.f, 0.f));
|
||||
transform = glm::rotate(transform, eulerRotation.y, glm::vec3(0.f, 1.f, 0.f));
|
||||
transform = glm::rotate(transform, eulerRotation.z, glm::vec3(0.f, 0.f, 1.f));
|
||||
|
||||
transform = glm::scale(
|
||||
transform,
|
||||
static_cast<glm::vec3>(_size) *
|
||||
std::pow(10.0f, static_cast<float>(_scalingExponent))
|
||||
std::pow(10.f, static_cast<float>(_scalingExponent))
|
||||
);
|
||||
|
||||
_raycaster->setColor(_color);
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
ToyVolumeRaycaster::ToyVolumeRaycaster(glm::vec4 color)
|
||||
: _boundingBox(glm::vec3(1.0))
|
||||
: _boundingBox(glm::vec3(1.f))
|
||||
, _color(std::move(color))
|
||||
{}
|
||||
|
||||
@@ -118,7 +118,7 @@ bool ToyVolumeRaycaster::isCameraInside(const RenderData& data, glm::vec3& local
|
||||
glm::vec4 modelPos = glm::inverse(modelViewTransform(data)) *
|
||||
glm::vec4(0.f, 0.f, 0.f, 1.f);
|
||||
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5));
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5f));
|
||||
|
||||
return (localPosition.x > 0 && localPosition.x < 1 &&
|
||||
localPosition.y > 0 && localPosition.y < 1 &&
|
||||
|
||||
@@ -72,10 +72,10 @@ private:
|
||||
glm::dmat4 modelViewTransform(const RenderData& data);
|
||||
|
||||
BoxGeometry _boundingBox;
|
||||
glm::vec4 _color;
|
||||
glm::mat4 _modelTransform;
|
||||
float _stepSize;
|
||||
double _time;
|
||||
glm::vec4 _color = glm::vec4(0.f);
|
||||
glm::mat4 _modelTransform = glm::mat4(1.f);
|
||||
float _stepSize = 0.f;
|
||||
double _time = 0.0;
|
||||
}; // ToyVolumeRaycaster
|
||||
|
||||
} // openspace
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
glm::vec3 hexadecimalToRGBConversion(const std::string& hex) const;
|
||||
std::string hexadecimalFromVec3(const glm::vec3& vec) const;
|
||||
|
||||
glm::vec3 color;
|
||||
glm::vec3 color = glm::vec3(0.f);
|
||||
std::string colorHex;
|
||||
std::pair<float, float> position;
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
VoxelType* data();
|
||||
|
||||
private:
|
||||
glm::uvec3 _dimensions;
|
||||
glm::uvec3 _dimensions = glm::uvec3(0);
|
||||
std::vector<VoxelType> _data;
|
||||
};
|
||||
|
||||
|
||||
@@ -38,22 +38,22 @@ struct RawVolumeMetadata {
|
||||
|
||||
ghoul::Dictionary dictionary();
|
||||
|
||||
glm::uvec3 dimensions;
|
||||
glm::uvec3 dimensions = glm::uvec3(0);
|
||||
VolumeGridType gridType;
|
||||
|
||||
bool hasTime;
|
||||
double time;
|
||||
bool hasTime = false;
|
||||
double time = 0.0;
|
||||
|
||||
bool hasValueRange;
|
||||
float minValue;
|
||||
float maxValue;
|
||||
bool hasValueUnit;
|
||||
bool hasValueRange = false;
|
||||
float minValue = 0.f;
|
||||
float maxValue = 0.f;
|
||||
bool hasValueUnit = false;
|
||||
std::string valueUnit;
|
||||
|
||||
bool hasDomainBounds;
|
||||
glm::vec3 lowerDomainBound;
|
||||
glm::vec3 upperDomainBound;
|
||||
bool hasDomainUnit;
|
||||
bool hasDomainBounds = false;
|
||||
glm::vec3 lowerDomainBound = glm::vec3(0.f);
|
||||
glm::vec3 upperDomainBound = glm::vec3(0.f);
|
||||
bool hasDomainUnit = false;
|
||||
std::string domainUnit;
|
||||
};
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ public:
|
||||
glm::ivec3 indexToCoords(size_t linear) const;
|
||||
|
||||
private:
|
||||
glm::ivec3 _dimensions;
|
||||
glm::ivec3 _dimensions = glm::ivec3(0);
|
||||
std::string _path;
|
||||
size_t _bufferSize;
|
||||
size_t _bufferSize = 0;
|
||||
};
|
||||
|
||||
} // namespace openspace::volume
|
||||
|
||||
@@ -153,7 +153,7 @@ bool BasicVolumeRaycaster::isCameraInside(const RenderData& data,
|
||||
glm::vec4 modelPos = glm::inverse(modelViewTransform(data)) *
|
||||
glm::vec4(0.f, 0.f, 0.f, 1.f);
|
||||
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5));
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5f));
|
||||
|
||||
return (localPosition.x > 0 && localPosition.x < 1 &&
|
||||
localPosition.y > 0 && localPosition.y < 1 &&
|
||||
|
||||
@@ -100,14 +100,14 @@ private:
|
||||
std::shared_ptr<openspace::TransferFunction> _transferFunction;
|
||||
BoxGeometry _boundingBox;
|
||||
VolumeGridType _gridType;
|
||||
glm::mat4 _modelTransform;
|
||||
glm::mat4 _modelTransform = glm::mat4(1.f);
|
||||
float _opacity = 20.f;
|
||||
float _rNormalization = 0.f;
|
||||
float _rUpperBound = 1.f;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::TextureUnit> _tfUnit;
|
||||
std::unique_ptr<ghoul::opengl::TextureUnit> _textureUnit;
|
||||
float _stepSize;
|
||||
float _stepSize = 0.f;
|
||||
};
|
||||
|
||||
} // namespace openspace::volume
|
||||
|
||||
@@ -46,9 +46,9 @@ private:
|
||||
std::string _dictionaryOutputPath;
|
||||
std::string _time;
|
||||
|
||||
glm::uvec3 _dimensions;
|
||||
glm::vec3 _lowerDomainBound;
|
||||
glm::vec3 _upperDomainBound;
|
||||
glm::uvec3 _dimensions = glm::uvec3(0);
|
||||
glm::vec3 _lowerDomainBound = glm::vec3(0.f);
|
||||
glm::vec3 _upperDomainBound = glm::vec3(0.f);
|
||||
|
||||
std::string _valueFunctionLua;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
ghoul::opengl::Texture& getSlice(int sliceIndex) const;
|
||||
std::vector<std::string> _paths;
|
||||
mutable LinearLruCache<std::shared_ptr<ghoul::opengl::Texture>> _cache;
|
||||
glm::ivec2 _sliceDimensions;
|
||||
glm::ivec2 _sliceDimensions = glm::ivec2(0);
|
||||
bool _isInitialized = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ bool TransferFunction::createTexture(ghoul::opengl::Texture& ptr) {
|
||||
for (int i = 0; i < _width ; ++i) {
|
||||
const float position = static_cast<float>(i) / static_cast<float>(_width);
|
||||
int count = 0;
|
||||
glm::vec4 rgbFromEnvelopes(0.f, 0.f, 0.f, 0.f);
|
||||
glm::vec4 rgbFromEnvelopes(0.f);
|
||||
float alpha = 0.f;
|
||||
for (const Envelope& env : _envelopes) {
|
||||
if (env.isValueInEnvelope(position) && env.isEnvelopeValid()) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
typename VolumeType::VoxelType sample(const glm::vec3& position) const;
|
||||
|
||||
private:
|
||||
glm::ivec3 _filterSize;
|
||||
glm::ivec3 _filterSize = glm::ivec3(0);
|
||||
const VolumeType* _volume;
|
||||
};
|
||||
|
||||
|
||||
@@ -93,11 +93,11 @@ private:
|
||||
cef_key_event_type_t keyEventType(KeyAction action);
|
||||
|
||||
BrowserInstance* _browserInstance = nullptr;
|
||||
glm::vec2 _mousePosition = { 0.f, 0.f };
|
||||
glm::vec2 _mousePosition = glm::vec2(0.f);
|
||||
|
||||
struct MouseButtonState {
|
||||
bool down = false;
|
||||
glm::vec2 lastClickPosition = { 0.f, 0.f };
|
||||
glm::vec2 lastClickPosition = glm::vec2(0.f);
|
||||
std::chrono::high_resolution_clock::time_point lastClickTime;
|
||||
};
|
||||
|
||||
|
||||
@@ -61,11 +61,11 @@ public:
|
||||
void updateTexture();
|
||||
|
||||
protected:
|
||||
GLuint _texture;
|
||||
GLuint _texture = 0;
|
||||
|
||||
private:
|
||||
glm::ivec2 _windowSize;
|
||||
glm::ivec2 _browserBufferSize;
|
||||
glm::ivec2 _windowSize = glm::ivec2(0);
|
||||
glm::ivec2 _browserBufferSize = glm::ivec2(0);
|
||||
|
||||
/**
|
||||
* RGBA buffer from browser
|
||||
@@ -74,8 +74,8 @@ private:
|
||||
bool _needsRepaint = true;
|
||||
bool _textureSizeIsDirty = true;
|
||||
bool _textureIsDirty = true;
|
||||
glm::ivec2 _lowerDirtyRectBound;
|
||||
glm::ivec2 _upperDirtyRectBound;
|
||||
glm::ivec2 _lowerDirtyRectBound = glm::ivec2(0);
|
||||
glm::ivec2 _upperDirtyRectBound = glm::ivec2(0);
|
||||
|
||||
IMPLEMENT_REFCOUNTING(WebRenderHandler);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user