diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index c145e576b1..5173eceff5 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit c145e576b10ffeddf4ace70d0f5739362ebd8cd1 +Subproject commit 5173eceff5ac3c8f049acaa38a74c74674e4881d diff --git a/include/openspace/engine/configuration.h b/include/openspace/engine/configuration.h index 46ceb35780..322d1636c8 100644 --- a/include/openspace/engine/configuration.h +++ b/include/openspace/engine/configuration.h @@ -87,9 +87,9 @@ struct Configuration { bool usePerSceneCache = false; bool isRenderingOnMasterDisabled = false; - glm::dvec3 globalRotation; - glm::dvec3 screenSpaceRotation; - glm::dvec3 masterRotation; + glm::dvec3 globalRotation = glm::dvec3(0.0); + glm::dvec3 screenSpaceRotation = glm::dvec3(0.0); + glm::dvec3 masterRotation = glm::dvec3(0.0); bool isConsoleDisabled = false; std::map moduleConfigurations; diff --git a/include/openspace/interaction/camerainteractionstates.h b/include/openspace/interaction/camerainteractionstates.h index e4e21e0ae7..af0b8779f8 100644 --- a/include/openspace/interaction/camerainteractionstates.h +++ b/include/openspace/interaction/camerainteractionstates.h @@ -64,12 +64,12 @@ protected: void setFriction(double friction); void setVelocityScaleFactor(double scaleFactor); - glm::dvec2 previousPosition; + glm::dvec2 previousPosition = glm::dvec2(0.0); DelayedVariable velocity; }; - double _sensitivity; + double _sensitivity = 0.0; InteractionState _globalRotationState; InteractionState _localRotationState; diff --git a/include/openspace/interaction/delayedvariable.h b/include/openspace/interaction/delayedvariable.h index 88dbb6938c..f4d3134a89 100644 --- a/include/openspace/interaction/delayedvariable.h +++ b/include/openspace/interaction/delayedvariable.h @@ -46,8 +46,8 @@ public: private: ScaleType _scaleFactor; ScaleType _friction; - T _targetValue; - T _currentValue; + T _targetValue = T(0); + T _currentValue = T(0); }; } // namespace openspace::interaction diff --git a/include/openspace/interaction/inputstate.h b/include/openspace/interaction/inputstate.h index 1ff5b39b8b..0c2703c0bc 100644 --- a/include/openspace/interaction/inputstate.h +++ b/include/openspace/interaction/inputstate.h @@ -70,7 +70,7 @@ private: // Input from mouse std::vector _mouseButtonsDown; - glm::dvec2 _mousePosition; + glm::dvec2 _mousePosition = glm::dvec2(0.0); double _mouseScrollDelta; }; diff --git a/include/openspace/interaction/keyframenavigator.h b/include/openspace/interaction/keyframenavigator.h index a241815c2c..af192a79c2 100644 --- a/include/openspace/interaction/keyframenavigator.h +++ b/include/openspace/interaction/keyframenavigator.h @@ -49,8 +49,8 @@ public: BooleanType(Inclusive); struct CameraPose { - glm::dvec3 position; - glm::quat rotation; + glm::dvec3 position = glm::dvec3(0.0); + glm::quat rotation = glm::quat(1.f, 0.f, 0.f, 0.f); std::string focusNode; float scale; bool followFocusNodeRotation; diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index dcdd4df76b..abadbcf1a5 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -67,7 +67,7 @@ public: std::string anchor; std::string aim; std::string referenceFrame; - glm::dvec3 position; + glm::dvec3 position = glm::dvec3(0.0); std::optional up; double yaw = 0.0; double pitch = 0.0; diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 155bfdd1af..f1d4c16ce5 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -99,13 +99,13 @@ public: private: struct CameraRotationDecomposition { - glm::dquat localRotation; - glm::dquat globalRotation; + glm::dquat localRotation = glm::dquat(1.0, 0.0, 0.0, 0.0); + glm::dquat globalRotation = glm::dquat(1.0, 0.0, 0.0, 0.0); }; struct CameraPose { - glm::dvec3 position; - glm::dquat rotation; + glm::dvec3 position = glm::dvec3(0.0); + glm::dquat rotation = glm::dquat(1.0, 0.0, 0.0, 0.0); }; using Displacement = std::pair; diff --git a/include/openspace/interaction/scriptcamerastates.h b/include/openspace/interaction/scriptcamerastates.h index 2153dee497..fb3d794c18 100644 --- a/include/openspace/interaction/scriptcamerastates.h +++ b/include/openspace/interaction/scriptcamerastates.h @@ -42,11 +42,11 @@ public: void addGlobalRoll(const glm::dvec2& delta); private: - glm::dvec2 _localRotation; - glm::dvec2 _globalRotation; - glm::dvec2 _truckMovement; - glm::dvec2 _localRoll; - glm::dvec2 _globalRoll; + glm::dvec2 _localRotation = glm::dvec2(0.0); + glm::dvec2 _globalRotation = glm::dvec2(0.0); + glm::dvec2 _truckMovement = glm::dvec2(0.0); + glm::dvec2 _localRoll = glm::dvec2(0.0); + glm::dvec2 _globalRoll = glm::dvec2(0.0); }; } // namespace openspace::interaction diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index d1e60f7bb3..d64754c267 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -45,8 +45,8 @@ struct CameraKeyframe { deserialize(buffer); } - glm::dvec3 _position; - glm::dquat _rotation; + glm::dvec3 _position = glm::dvec3(0.0); + glm::dquat _rotation = glm::dquat(1.0, 0.0, 0.0, 0.0); bool _followNodeRotation; std::string _focusNode; float _scale; diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 046658143e..c131ff0b3f 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -90,13 +90,13 @@ protected: */ std::string luaToJson(std::string luaValue) const; - T _minimumValue; - T _maximumValue; - T _stepping; - float _exponent; + T _minimumValue = T(0); + T _maximumValue = T(0); + T _stepping = T(0); + float _exponent = 0.f; - T _interpolationStart; - T _interpolationEnd; + T _interpolationStart = T(0); + T _interpolationEnd = T(0); }; } // namespace openspace::properties diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index aa99d10ad1..da30dadbc0 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -112,7 +112,7 @@ private: void saveTextureToMemory(GLenum color_buffer_attachment, int width, int height, std::vector & memory) const; - glm::ivec2 _resolution = glm::ivec2(0, 0); + glm::ivec2 _resolution = glm::ivec2(0); bool _dirtyResolution = true; bool _dirtyRendererData = true; diff --git a/include/openspace/rendering/loadingscreen.h b/include/openspace/rendering/loadingscreen.h index 0c4a300776..96c8428535 100644 --- a/include/openspace/rendering/loadingscreen.h +++ b/include/openspace/rendering/loadingscreen.h @@ -120,8 +120,8 @@ private: ProgressInfo progress; bool hasLocation; - glm::vec2 ll; - glm::vec2 ur; + glm::vec2 ll = glm::vec2(0.f); + glm::vec2 ur = glm::vec2(0.f); std::chrono::system_clock::time_point finishedTime; }; diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 943c8a0ae0..38be13e229 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -239,9 +239,9 @@ private: std::shared_ptr _fontLog; struct { - glm::ivec4 rotation; - glm::ivec4 zoom; - glm::ivec4 roll; + glm::ivec4 rotation = glm::ivec4(0); + glm::ivec4 zoom = glm::ivec4(0); + glm::ivec4 roll = glm::ivec4(0); } _cameraButtonLocations; }; diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index abb4a498c9..0f3a0e945f 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -107,7 +107,7 @@ protected: properties::FloatProperty _alpha; properties::TriggerProperty _delete; - glm::ivec2 _objectSize; + glm::ivec2 _objectSize = glm::ivec2(0); UniformCache(alpha, modelTransform, viewProj, texture) _uniformCache; std::unique_ptr _shader; }; diff --git a/include/openspace/rendering/transferfunction.h b/include/openspace/rendering/transferfunction.h index b0f02acf21..f9c0802394 100644 --- a/include/openspace/rendering/transferfunction.h +++ b/include/openspace/rendering/transferfunction.h @@ -70,11 +70,11 @@ private: struct MappingKey { MappingKey(float p, const glm::vec4& c): position(p), color(c) {}; - MappingKey(float p): position(p), color(glm::vec4(0.0f)) {}; + MappingKey(float p): position(p), color(glm::vec4(0.f)) {}; bool operator<(const MappingKey& rhs) {return position < rhs.position;}; float position = 0.f; - glm::vec4 color = glm::vec4(0.f, 0.f, 0.f, 0.f); + glm::vec4 color = glm::vec4(0.f); }; } // namespace openspace diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index 78843a80ee..941dde4386 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -61,7 +61,7 @@ protected: private: bool _needsUpdate = true; double _cachedTime = -std::numeric_limits::max(); - glm::dmat3 _cachedMatrix; + glm::dmat3 _cachedMatrix = glm::dmat3(1.0); }; } // namespace openspace diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index eab4fd6ee6..acc9a2ce3d 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -183,14 +183,14 @@ private: std::unique_ptr _timeFrame; // Cached transform data - glm::dvec3 _worldPositionCached; - glm::dmat3 _worldRotationCached; + glm::dvec3 _worldPositionCached = glm::dvec3(0.0); + glm::dmat3 _worldRotationCached = glm::dmat3(1.0); double _worldScaleCached = 1.0; float _fixedBoundingSphere = 0.f; - glm::dmat4 _modelTransformCached; - glm::dmat4 _inverseModelTransformCached; + glm::dmat4 _modelTransformCached = glm::dmat4(1.0); + glm::dmat4 _inverseModelTransformCached = glm::dmat4(1.0); properties::BoolProperty _computeScreenSpaceValues; properties::IVec2Property _screenSpacePosition; diff --git a/include/openspace/util/blockplaneintersectiongeometry.h b/include/openspace/util/blockplaneintersectiongeometry.h index 9f3d787d05..667cfac759 100644 --- a/include/openspace/util/blockplaneintersectiongeometry.h +++ b/include/openspace/util/blockplaneintersectiongeometry.h @@ -47,12 +47,11 @@ public: private: void updateVertices(); std::vector _vertices; - // bool _isInitialized; GLuint _vaoId = 0; GLuint _vBufferId = 0; - glm::vec3 _size; - glm::vec3 _normal; - float _planeDistance; + glm::vec3 _size = glm::vec3(0.f); + glm::vec3 _normal = glm::vec3(0.f); + float _planeDistance = 0.f; }; } // namespace openspace diff --git a/include/openspace/util/boxgeometry.h b/include/openspace/util/boxgeometry.h index 6f694cae2b..a72b5877fd 100644 --- a/include/openspace/util/boxgeometry.h +++ b/include/openspace/util/boxgeometry.h @@ -41,7 +41,7 @@ public: GLuint _vaoId = 0; GLuint _vBufferId = 0; - glm::vec3 _size; + glm::vec3 _size = glm::vec3(0.f); }; } // namespace openspace diff --git a/include/openspace/util/camera.h b/include/openspace/util/camera.h index f71564dd82..f8ebae3b1e 100644 --- a/include/openspace/util/camera.h +++ b/include/openspace/util/camera.h @@ -58,9 +58,8 @@ public: */ template struct Cached { - Cached() { isDirty = true; } - T datum; - bool isDirty; + T datum = T(0); + bool isDirty = true; }; Camera() = default; @@ -125,9 +124,9 @@ public: SgctInternal() = default; SgctInternal(const SgctInternal& o); - glm::mat4 _sceneMatrix; - glm::mat4 _viewMatrix; - glm::mat4 _projectionMatrix; + glm::mat4 _sceneMatrix = glm::mat4(1.f); + glm::mat4 _viewMatrix = glm::mat4(1.f); + glm::mat4 _projectionMatrix = glm::mat4(1.f); mutable Cached _cachedViewProjectionMatrix; mutable std::mutex _mutex; @@ -155,7 +154,7 @@ private: SceneGraphNode* _parent = nullptr; // _focusPosition to be removed - glm::dvec3 _focusPosition; + glm::dvec3 _focusPosition = glm::dvec3(0.0); float _maxFov = 0.f; // Cached data diff --git a/include/openspace/util/spicemanager.h b/include/openspace/util/spicemanager.h index 634a836571..eef54ccc55 100644 --- a/include/openspace/util/spicemanager.h +++ b/include/openspace/util/spicemanager.h @@ -566,23 +566,23 @@ public: * The closest surface intercept point on the target body in Cartesian Coordinates * relative to the reference frame. */ - glm::dvec3 surfaceIntercept; + glm::dvec3 surfaceIntercept = glm::dvec3(0.0); /** * If the aberration correction is not AberrationCorrection::Type::None, this * value contains the time for which the intercept was computed. Otherwise it is * the same as the ephemerisTime. */ - double interceptEpoch; + double interceptEpoch = 0.0; /** * The vector from the observer's position to the \p surfaceIntercept position in * the provided reference frame. */ - glm::dvec3 surfaceVector; + glm::dvec3 surfaceVector = glm::dvec3(0.0); /// true if the ray intersects the body, false otherwise - bool interceptFound; + bool interceptFound = false; }; /** @@ -655,14 +655,14 @@ public: /// Struct that is used as the return value from the #targetState method struct TargetStateResult { /// The target position - glm::dvec3 position; + glm::dvec3 position = glm::dvec3(0.0); /// The target velocity - glm::dvec3 velocity; + glm::dvec3 velocity = glm::dvec3(0.0); /// One-way light time between target and observer if /// the aberration correction is enabled - double lightTime; + double lightTime = 0.0; }; /** @@ -780,7 +780,7 @@ public: std::string frameName; /// The direction towards the center of the field of view - glm::dvec3 boresightVector; + glm::dvec3 boresightVector = glm::dvec3(0.0); /// The corners of the field of view's bounding box, not necessarily unit vectors std::vector bounds; @@ -822,14 +822,14 @@ public: struct TerminatorEllipseResult { /// The vector from the target body at #targetEphemerisTime to the observer at /// the original time - glm::dvec3 observerPosition; + glm::dvec3 observerPosition = glm::dvec3(0.0); /// The full list of terminator points specified in the original reference frame std::vector terminatorPoints; /// The local ephemeris time at the target, determined by the original /// aberrationCorrection factor - double targetEphemerisTime; + double targetEphemerisTime = 0.0; }; /** diff --git a/include/openspace/util/updatestructures.h b/include/openspace/util/updatestructures.h index 406181eebc..81bd46a24d 100644 --- a/include/openspace/util/updatestructures.h +++ b/include/openspace/util/updatestructures.h @@ -36,9 +36,9 @@ class VolumeRaycaster; struct InitializeData {}; struct TransformData { - glm::dvec3 translation; - glm::dmat3 rotation; - double scale; + glm::dvec3 translation = glm::dvec3(0.0); + glm::dmat3 rotation = glm::dmat3(1.0); + double scale = 0.0; }; struct UpdateData { @@ -51,8 +51,8 @@ struct UpdateData { struct RenderData { const Camera& camera; const Time time; - bool doPerformanceMeasurement; - int renderBinMask; + bool doPerformanceMeasurement = false; + int renderBinMask = -1; TransformData modelTransform; }; @@ -72,12 +72,12 @@ struct RendererTasks { }; struct RaycastData { - int id; + int id = -1; std::string namespaceName; }; struct DeferredcastData { - int id; + int id = -1; std::string namespaceName; }; @@ -87,13 +87,13 @@ struct DeferredcastData { */ struct SurfacePositionHandle { /// Vector from the center of the object to the reference surface of the object - glm::dvec3 centerToReferenceSurface; + glm::dvec3 centerToReferenceSurface = glm::dvec3(0.0); /// Direction out from the reference. Can conincide with the surface normal but does /// not have to. - glm::dvec3 referenceSurfaceOutDirection; + glm::dvec3 referenceSurfaceOutDirection = glm::dvec3(0.0); /// Height from the reference surface out to the actual surface in the direction of /// the surface normal. Can be positive or negative. - double heightToSurface; + double heightToSurface = 0.0; }; } // namespace openspace diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index 3cb7b040ff..9a754f0a07 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -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(); diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.h b/modules/atmosphere/rendering/atmospheredeferredcaster.h index 6c0af90d37..8bde5e9624 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.h +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.h @@ -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 _shadowConfArray; - bool _hardShadowsEnabled; + bool _hardShadowsEnabled = false // Atmosphere Debugging - float _calculationTextureScale; - bool _saveCalculationTextures; + float _calculationTextureScale = 1.f; + bool _saveCalculationTextures = false; }; } // openspace diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index fd931c251f..9d1332374d 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -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(SceneGraphNode::KeyIdentifier), @@ -452,8 +431,9 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary) } if (!rayleighDictionary.getValue( - keyRayleighHeightScale, - _rayleighHeightScale)) + keyRayleighHeightScale, + _rayleighHeightScale) + ) { errorReadingAtmosphereData = true; LWARNINGC( diff --git a/modules/atmosphere/rendering/renderableatmosphere.h b/modules/atmosphere/rendering/renderableatmosphere.h index 202933b593..017b31eede 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.h +++ b/modules/atmosphere/rendering/renderableatmosphere.h @@ -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 _deferredcaster; - bool _shadowEnabled; - bool _hardShadows; + bool _shadowEnabled = false; + bool _hardShadows = false; - glm::dmat3 _stateMatrix; + glm::dmat3 _stateMatrix = glm::dmat3(1.0); std::vector _shadowConfArray; }; diff --git a/modules/base/dashboard/dashboarditemvelocity.h b/modules/base/dashboard/dashboarditemvelocity.h index 6a7d5ae5a1..9d02cd5f30 100644 --- a/modules/base/dashboard/dashboarditemvelocity.h +++ b/modules/base/dashboard/dashboarditemvelocity.h @@ -58,7 +58,7 @@ private: properties::BoolProperty _doSimplification; properties::OptionProperty _requestedUnit; - glm::dvec3 _prevPosition; + glm::dvec3 _prevPosition = glm::dvec3(0.0); std::shared_ptr _font; }; diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 922e040a7f..43613947e2 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -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); diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 51aee515ff..d1c6d862f1 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -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) diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 6b4dca540a..4cc8ffb732 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -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 diff --git a/modules/base/rotation/staticrotation.h b/modules/base/rotation/staticrotation.h index a4e43ecee9..8c675f4fec 100644 --- a/modules/base/rotation/staticrotation.h +++ b/modules/base/rotation/staticrotation.h @@ -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; }; diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index 91f2602f1c..b812602311 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -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]() { diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 9ef2a3a9a9..86324f09c9 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -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() { diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index f0e96c1bba..2c1780348c 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -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) diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index 570d0c29b0..d962947eb9 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -146,7 +146,7 @@ private: std::vector> _labelData; int _nValuesPerAstronomicalObject = 0; - glm::dmat4 _transformationMatrix; + glm::dmat4 _transformationMatrix = glm::dmat4(1.0); std::unordered_map _meshColorMap; std::unordered_map _renderingMeshesMap; diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index 8caf8d0408..c260e99dec 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -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); } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index 0e108d525f..bba008e430 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -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) ) diff --git a/modules/gaia/rendering/octreemanager.cpp b/modules/gaia/rendering/octreemanager.cpp index 63efa73a43..7b978ea45b 100644 --- a/modules/gaia/rendering/octreemanager.cpp +++ b/modules/gaia/rendering/octreemanager.cpp @@ -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(box); _removedKeysInPrevCall = std::set(); _leastRecentlyFetchedNodes = std::queue(); diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index cb7522f99d..60fa5efddb 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -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) { diff --git a/modules/gaia/rendering/renderablegaiastars.h b/modules/gaia/rendering/renderablegaiastars.h index 2583b80a52..b0f3f80c7e 100644 --- a/modules/gaia/rendering/renderablegaiastars.h +++ b/modules/gaia/rendering/renderablegaiastars.h @@ -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; diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index 4bf4e98f19..8009b51940 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -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 _textureUnit; diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index ecdd0c276f..e98a358a66 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -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()) + ) , _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. diff --git a/modules/galaxy/rendering/renderablegalaxy.h b/modules/galaxy/rendering/renderablegalaxy.h index 2f8c4ff570..2427a12b8d 100644 --- a/modules/galaxy/rendering/renderablegalaxy.h +++ b/modules/galaxy/rendering/renderablegalaxy.h @@ -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 _pointSpreadFunctionFile; std::string _volumeFilename; - glm::ivec3 _volumeDimensions; + glm::ivec3 _volumeDimensions = glm::ivec3(0); std::string _pointsFilename; std::string _pointSpreadFunctionTexturePath; std::unique_ptr _raycaster; std::unique_ptr>> _volume; std::unique_ptr _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 _pointsProgram; std::unique_ptr _billboardsProgram; @@ -106,10 +106,10 @@ private: cameraUp, eyePosition, psfTexture ) _uniformCacheBillboards; std::vector _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 diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index cedc01fb2e..e141dd95f7 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -86,8 +86,8 @@ void MilkywayConversionTask::perform(const Task::ProgressCallback& onProgress) { ); std::function(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 value = sampler.sample(inCoord); return value; }; diff --git a/modules/galaxy/tasks/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h index 0fefa0eb2b..f31eaf26dd 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -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 diff --git a/modules/globebrowsing/src/basictypes.h b/modules/globebrowsing/src/basictypes.h index e4fce70c48..39d06cd4db 100644 --- a/modules/globebrowsing/src/basictypes.h +++ b/modules/globebrowsing/src/basictypes.h @@ -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); }; diff --git a/modules/globebrowsing/src/ellipsoid.h b/modules/globebrowsing/src/ellipsoid.h index 20eb0b29ae..1fbc625d36 100644 --- a/modules/globebrowsing/src/ellipsoid.h +++ b/modules/globebrowsing/src/ellipsoid.h @@ -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 _shadowConfArray; diff --git a/modules/globebrowsing/src/globelabelscomponent.h b/modules/globebrowsing/src/globelabelscomponent.h index ed6727edcd..93222ed110 100644 --- a/modules/globebrowsing/src/globelabelscomponent.h +++ b/modules/globebrowsing/src/globelabelscomponent.h @@ -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 { diff --git a/modules/globebrowsing/src/globetranslation.h b/modules/globebrowsing/src/globetranslation.h index 91c0bdf61b..7c1dec166e 100644 --- a/modules/globebrowsing/src/globetranslation.h +++ b/modules/globebrowsing/src/globetranslation.h @@ -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 diff --git a/modules/globebrowsing/src/layer.h b/modules/globebrowsing/src/layer.h index fb8f30dfd4..502918f36e 100644 --- a/modules/globebrowsing/src/layer.h +++ b/modules/globebrowsing/src/layer.h @@ -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; diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index 8670263749..9288da6200 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -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 _chunkPool; diff --git a/modules/globebrowsing/src/tileprovider.h b/modules/globebrowsing/src/tileprovider.h index c7e3cd5196..95cfed0ce1 100644 --- a/modules/globebrowsing/src/tileprovider.h +++ b/modules/globebrowsing/src/tileprovider.h @@ -110,11 +110,11 @@ struct TextTileProvider : public TileProvider { std::unique_ptr fontRenderer; std::shared_ptr 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; diff --git a/modules/globebrowsing/src/tiletextureinitdata.h b/modules/globebrowsing/src/tiletextureinitdata.h index 6eee193c17..598cd62d35 100644 --- a/modules/globebrowsing/src/tiletextureinitdata.h +++ b/modules/globebrowsing/src/tiletextureinitdata.h @@ -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; diff --git a/modules/imgui/imguimodule.h b/modules/imgui/imguimodule.h index 1210d5ccab..1df65132af 100644 --- a/modules/imgui/imguimodule.h +++ b/modules/imgui/imguimodule.h @@ -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 { diff --git a/modules/iswa/rendering/datacygnet.h b/modules/iswa/rendering/datacygnet.h index 5a92ad3f62..5069c630e2 100644 --- a/modules/iswa/rendering/datacygnet.h +++ b/modules/iswa/rendering/datacygnet.h @@ -91,7 +91,7 @@ protected: std::shared_ptr _dataProcessor; std::string _dataBuffer; - glm::size3_t _textureDimensions; + glm::size3_t _textureDimensions = glm::size3_t(0); private: bool readyToRender() const override; diff --git a/modules/iswa/rendering/iswacygnet.h b/modules/iswa/rendering/iswacygnet.h index cf557fb91d..6bf8f94205 100644 --- a/modules/iswa/rendering/iswacygnet.h +++ b/modules/iswa/rendering/iswacygnet.h @@ -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; diff --git a/modules/iswa/rendering/kameleonplane.h b/modules/iswa/rendering/kameleonplane.h index fa358c8cc7..0a0f07de67 100644 --- a/modules/iswa/rendering/kameleonplane.h +++ b/modules/iswa/rendering/kameleonplane.h @@ -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 diff --git a/modules/iswa/util/dataprocessor.h b/modules/iswa/util/dataprocessor.h index db64deb316..8d0c8894a1 100644 --- a/modules/iswa/util/dataprocessor.h +++ b/modules/iswa/util/dataprocessor.h @@ -76,7 +76,7 @@ protected: void add(const std::vector>& optionValues, const std::vector& 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> _histograms; std::set _coordinateVariables = { "x", "y", "z", "phi", "theta" }; - glm::vec2 _histNormValues = glm::vec2(10.f, 10.f); + glm::vec2 _histNormValues = glm::vec2(10.f); }; } // namespace openspace diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 9f3c06a697..0970946784 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -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 gridUnits = kw.gridUnits(); diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 1965a3cae5..126acfca27 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -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 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; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 7055a10fe9..4dcebab081 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -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(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); diff --git a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h index f2bc3095d0..b74c011ecb 100644 --- a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h +++ b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h @@ -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 diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index 0ed51a881b..63648086f2 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -340,7 +340,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() { std::vector 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; diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 2c86df53e2..fb41e1d775 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -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); } diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.h b/modules/multiresvolume/rendering/multiresvolumeraycaster.h index 9d7c78f512..bba7622fc3 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.h +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.h @@ -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; std::shared_ptr _atlasManager; diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index 3fad696506..9c96a84db9 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -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()) + ) , _scaling(ScalingInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f)) { if (dictionary.hasKeyAndValue(KeyDataSource)) { diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index ef0120fa12..284257c65f 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -79,7 +79,7 @@ private: GLuint _vertexPositionBuffer = 0; bool _planeIsDirty = false; - glm::vec3 _sunPosition; + glm::vec3 _sunPosition = glm::vec3(0.f); }; } // namespace openspace diff --git a/modules/space/rendering/renderablesatellites.h b/modules/space/rendering/renderablesatellites.h index 8f58d936d8..0b7ec2467e 100644 --- a/modules/space/rendering/renderablesatellites.h +++ b/modules/space/rendering/renderablesatellites.h @@ -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; diff --git a/modules/space/translation/keplertranslation.h b/modules/space/translation/keplertranslation.h index 20eabc3cea..389ee7e106 100644 --- a/modules/space/translation/keplertranslation.h +++ b/modules/space/translation/keplertranslation.h @@ -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 diff --git a/modules/space/translation/spicetranslation.h b/modules/space/translation/spicetranslation.h index 031faa57a6..3268388c8e 100644 --- a/modules/space/translation/spicetranslation.h +++ b/modules/space/translation/spicetranslation.h @@ -44,7 +44,7 @@ private: properties::StringProperty _observer; properties::StringProperty _frame; - glm::dvec3 _position; + glm::dvec3 _position = glm::vec3(0.f); }; } // namespace openspace diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.h b/modules/spacecraftinstruments/rendering/renderablecrawlingline.h index 7f554345d1..1c8ccc5bc4 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.h +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.h @@ -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; diff --git a/modules/spacecraftinstruments/rendering/renderablefov.h b/modules/spacecraftinstruments/rendering/renderablefov.h index 0c0c8fe725..a0d3b51f0c 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.h +++ b/modules/spacecraftinstruments/rendering/renderablefov.h @@ -116,7 +116,7 @@ private: SpiceManager::AberrationCorrection aberrationCorrection; std::vector bounds; - glm::dvec3 boresight; + glm::dvec3 boresight = glm::dvec3(0.0); std::vector potentialTargets; } _instrument; diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h index f311ae065f..04bec18ffc 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h @@ -90,20 +90,20 @@ private: std::unique_ptr _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 _imageTimes; double _time = -std::numeric_limits::max(); bool _shouldCapture = false; - glm::vec3 _sunPosition; + glm::vec3 _sunPosition = glm::vec3(0.f); properties::BoolProperty _performShading; }; diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 64b7864e70..94e9d0b223 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -203,7 +203,7 @@ void RenderablePlaneProjection::updatePlane(const Image& img, double currentTime std::string frame; std::vector bounds; - glm::dvec3 boresight; + glm::dvec3 boresight = glm::dvec3(0.0); try { SpiceManager::FieldOfViewResult r = SpiceManager::ref().fieldOfView(_instrument); diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.h b/modules/spacecraftinstruments/rendering/renderableplaneprojection.h index c68dfc18e9..76b64ec78b 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.h +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.h @@ -65,7 +65,7 @@ private: bool _planeIsDirty = false; - glm::dmat3 _stateMatrix; + glm::dmat3 _stateMatrix = glm::dmat3(0.0); std::string _frame; std::unique_ptr _shader; diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index f73ba033d8..55452be057 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -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() diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.h b/modules/spacecraftinstruments/rendering/renderableplanetprojection.h index c8c1f133c8..60235f6b07 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.h +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.h @@ -100,14 +100,14 @@ private: std::unique_ptr _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 _imageTimes; diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h index f63646c719..7b75ee5b5a 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h @@ -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; diff --git a/modules/touch/include/touchinteraction.h b/modules/touch/include/touchinteraction.h index a0f025d90b..9a9fc1098e 100644 --- a/modules/touch/include/touchinteraction.h +++ b/modules/touch/include/touchinteraction.h @@ -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; diff --git a/modules/touch/touchmodule.h b/modules/touch/touchmodule.h index 9ce8b73f92..89bf63ab7a 100644 --- a/modules/touch/touchmodule.h +++ b/modules/touch/touchmodule.h @@ -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; #endif //WIN32 diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index a5c37bf4e2..17db725798 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -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()) + ) , _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(_scalingExponent)) ); glm::vec3 eulerRotation = static_cast(_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(_size) * - std::pow(10.0f, static_cast(_scalingExponent)) + std::pow(10.f, static_cast(_scalingExponent)) ); _raycaster->setColor(_color); diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index 97d71c05bf..7110b82151 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -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 && diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.h b/modules/toyvolume/rendering/toyvolumeraycaster.h index 69ea90a422..a97015a7cf 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.h +++ b/modules/toyvolume/rendering/toyvolumeraycaster.h @@ -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 diff --git a/modules/volume/envelope.h b/modules/volume/envelope.h index 7cff391236..10b297c4e5 100644 --- a/modules/volume/envelope.h +++ b/modules/volume/envelope.h @@ -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 position; }; diff --git a/modules/volume/rawvolume.h b/modules/volume/rawvolume.h index b759b59af9..0c487c6897 100644 --- a/modules/volume/rawvolume.h +++ b/modules/volume/rawvolume.h @@ -52,7 +52,7 @@ public: VoxelType* data(); private: - glm::uvec3 _dimensions; + glm::uvec3 _dimensions = glm::uvec3(0); std::vector _data; }; diff --git a/modules/volume/rawvolumemetadata.h b/modules/volume/rawvolumemetadata.h index 7e01ad1fa6..f004e16dff 100644 --- a/modules/volume/rawvolumemetadata.h +++ b/modules/volume/rawvolumemetadata.h @@ -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; }; diff --git a/modules/volume/rawvolumewriter.h b/modules/volume/rawvolumewriter.h index 55b0221a81..16e3fa9b5b 100644 --- a/modules/volume/rawvolumewriter.h +++ b/modules/volume/rawvolumewriter.h @@ -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 diff --git a/modules/volume/rendering/basicvolumeraycaster.cpp b/modules/volume/rendering/basicvolumeraycaster.cpp index b404d97bb3..ef679e5da1 100644 --- a/modules/volume/rendering/basicvolumeraycaster.cpp +++ b/modules/volume/rendering/basicvolumeraycaster.cpp @@ -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 && diff --git a/modules/volume/rendering/basicvolumeraycaster.h b/modules/volume/rendering/basicvolumeraycaster.h index 1ab5c1ffaa..37fa4faf91 100644 --- a/modules/volume/rendering/basicvolumeraycaster.h +++ b/modules/volume/rendering/basicvolumeraycaster.h @@ -100,14 +100,14 @@ private: std::shared_ptr _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 _tfUnit; std::unique_ptr _textureUnit; - float _stepSize; + float _stepSize = 0.f; }; } // namespace openspace::volume diff --git a/modules/volume/tasks/generaterawvolumetask.h b/modules/volume/tasks/generaterawvolumetask.h index f41b5d0fc6..1b9408927d 100644 --- a/modules/volume/tasks/generaterawvolumetask.h +++ b/modules/volume/tasks/generaterawvolumetask.h @@ -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; }; diff --git a/modules/volume/textureslicevolumereader.h b/modules/volume/textureslicevolumereader.h index 452fa93f71..badf75782a 100644 --- a/modules/volume/textureslicevolumereader.h +++ b/modules/volume/textureslicevolumereader.h @@ -53,7 +53,7 @@ private: ghoul::opengl::Texture& getSlice(int sliceIndex) const; std::vector _paths; mutable LinearLruCache> _cache; - glm::ivec2 _sliceDimensions; + glm::ivec2 _sliceDimensions = glm::ivec2(0); bool _isInitialized = false; }; diff --git a/modules/volume/transferfunction.cpp b/modules/volume/transferfunction.cpp index 878287cbc0..63981f2840 100644 --- a/modules/volume/transferfunction.cpp +++ b/modules/volume/transferfunction.cpp @@ -197,7 +197,7 @@ bool TransferFunction::createTexture(ghoul::opengl::Texture& ptr) { for (int i = 0; i < _width ; ++i) { const float position = static_cast(i) / static_cast(_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()) { diff --git a/modules/volume/volumesampler.h b/modules/volume/volumesampler.h index 6bbb65e173..7f78d9179d 100644 --- a/modules/volume/volumesampler.h +++ b/modules/volume/volumesampler.h @@ -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; }; diff --git a/modules/webbrowser/include/eventhandler.h b/modules/webbrowser/include/eventhandler.h index 22cc3bbe7d..1a723e3e7f 100644 --- a/modules/webbrowser/include/eventhandler.h +++ b/modules/webbrowser/include/eventhandler.h @@ -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; }; diff --git a/modules/webbrowser/include/webrenderhandler.h b/modules/webbrowser/include/webrenderhandler.h index 2e85dcacbf..afc76f4b4b 100644 --- a/modules/webbrowser/include/webrenderhandler.h +++ b/modules/webbrowser/include/webrenderhandler.h @@ -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); }; diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index 9c85dbbd3a..e63b9b5a97 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -282,8 +282,8 @@ void NavigationHandler::applyNavigationState(const NavigationHandler::Navigation up ))); - glm::dquat pitchRotation = glm::angleAxis(ns.pitch, glm::dvec3(1.f, 0.f, 0.f)); - glm::dquat yawRotation = glm::angleAxis(ns.yaw, glm::dvec3(0.f, -1.f, 0.f)); + glm::dquat pitchRotation = glm::angleAxis(ns.pitch, glm::dvec3(1.0, 0.0, 0.0)); + glm::dquat yawRotation = glm::angleAxis(ns.yaw, glm::dvec3(0.0, -1.0, 0.0)); _camera->setPositionVec3(cameraPositionWorld); _camera->setRotation(neutralCameraRotation * yawRotation * pitchRotation); @@ -372,7 +372,7 @@ NavigationHandler::NavigationState NavigationHandler::navigationState( const double yaw = -eulerAngles.y; // Need to compensate by redisual roll left in local rotation: - const glm::dquat unroll = glm::angleAxis(eulerAngles.z, glm::dvec3(0, 0, 1)); + const glm::dquat unroll = glm::angleAxis(eulerAngles.z, glm::dvec3(0.0, 0.0, 1.0)); const glm::dvec3 neutralUp = glm::inverse(invNeutralRotation) * unroll * _camera->lookUpVectorCameraSpace(); diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 29a0e2d844..bafc2dbe1e 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -503,7 +503,7 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { glm::dquat anchorNodeRotationDiff = _previousAnchorNodeRotation.has_value() ? _previousAnchorNodeRotation.value() * glm::inverse(anchorRotation) : - glm::dquat(); + glm::dquat(1.0, 0.0, 0.0, 0.0); _previousAnchorNodeRotation = anchorRotation; diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index 4bac77e8e3..8aeac3a561 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -41,11 +41,11 @@ glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat2x2(0); + return glm::dmat2x2(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat2x2(0); + return glm::dmat2x2(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat2x2 value) { } glm::dmat2x2 fromStringConversion(const std::string& val, bool& success) { - glm::dmat2x2 result; + glm::dmat2x2 result = glm::dmat2x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat2Property, glm::dmat2x2, - glm::dmat2x2(0), + glm::dmat2x2(0.0), glm::dmat2x2(nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest()), glm::dmat2x2(nl::max(), nl::max(), nl::max(), nl::max()), glm::dmat2x2(0.01, 0.01, 0.01, 0.01), diff --git a/src/properties/matrix/dmat2x3property.cpp b/src/properties/matrix/dmat2x3property.cpp index 909cf2e73e..33770928bd 100644 --- a/src/properties/matrix/dmat2x3property.cpp +++ b/src/properties/matrix/dmat2x3property.cpp @@ -41,11 +41,11 @@ glm::dmat2x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat2x3(0); + return glm::dmat2x3(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat2x3(0); + return glm::dmat2x3(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat2x3 value) { } glm::dmat2x3 fromStringConversion(const std::string& val, bool& success) { - glm::dmat2x3 result; + glm::dmat2x3 result = glm::dmat2x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat2x3Property, glm::dmat2x3, - glm::dmat2x3(0), + glm::dmat2x3(0.0), glm::dmat2x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/dmat2x4property.cpp b/src/properties/matrix/dmat2x4property.cpp index df7faa9cb2..44febfe1bf 100644 --- a/src/properties/matrix/dmat2x4property.cpp +++ b/src/properties/matrix/dmat2x4property.cpp @@ -41,11 +41,11 @@ glm::dmat2x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat2x4(0); + return glm::dmat2x4(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat2x4(0); + return glm::dmat2x4(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat2x4 value) { } glm::dmat2x4 fromStringConversion(const std::string& val, bool& success) { - glm::dmat2x4 result; + glm::dmat2x4 result = glm::dmat2x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat2x4Property, glm::dmat2x4, - glm::dmat2x4(0), + glm::dmat2x4(0.0), glm::dmat2x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index 30c261d0d8..62c0c5d809 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -41,11 +41,11 @@ glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat3x3(0); + return glm::dmat3x3(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat3x3(0); + return glm::dmat3x3(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat3x3 value) { } glm::dmat3x3 fromStringConversion(const std::string& val, bool& success) { - glm::dmat3x3 result; + glm::dmat3x3 result = glm::dmat3x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -124,7 +124,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat3Property, glm::dmat3x3, - glm::dmat3x3(0), + glm::dmat3x3(0.0), glm::dmat3x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/dmat3x2property.cpp b/src/properties/matrix/dmat3x2property.cpp index e2a8cc7d80..1f269b84f5 100644 --- a/src/properties/matrix/dmat3x2property.cpp +++ b/src/properties/matrix/dmat3x2property.cpp @@ -41,11 +41,11 @@ glm::dmat3x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat3x2(0); + return glm::dmat3x2(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat3x2(0); + return glm::dmat3x2(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat3x2 value) { } glm::dmat3x2 fromStringConversion(const std::string& val, bool& success) { - glm::dmat3x2 result; + glm::dmat3x2 result = glm::dmat3x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat3x2Property, glm::dmat3x2, - glm::dmat3x2(0), + glm::dmat3x2(0.0), glm::dmat3x2( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest() diff --git a/src/properties/matrix/dmat3x4property.cpp b/src/properties/matrix/dmat3x4property.cpp index ccbe404c64..8b1cb010e2 100644 --- a/src/properties/matrix/dmat3x4property.cpp +++ b/src/properties/matrix/dmat3x4property.cpp @@ -41,11 +41,11 @@ glm::dmat3x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat3x4(0); + return glm::dmat3x4(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat3x4(0); + return glm::dmat3x4(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -75,7 +75,7 @@ bool toLuaConversion(lua_State* state, glm::dmat3x4 value) { glm::dmat3x4 fromStringConversion(const std::string& val, bool& success) { - glm::dmat3x4 result; + glm::dmat3x4 result = glm::dmat3x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -124,7 +124,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat3x4Property, glm::dmat3x4, - glm::dmat3x4(0), + glm::dmat3x4(0.0), glm::dmat3x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index d8d499dcf3..8b5f1db3f6 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -41,11 +41,11 @@ glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat4x4(0); + return glm::dmat4x4(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat4x4(0); + return glm::dmat4x4(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat4x4 value) { } glm::dmat4x4 fromStringConversion(const std::string& val, bool& success) { - glm::dmat4x4 result; + glm::dmat4x4 result = glm::dmat4x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat4Property, glm::dmat4x4, - glm::dmat4x4(0), + glm::dmat4x4(0.0), glm::dmat4x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/dmat4x2property.cpp b/src/properties/matrix/dmat4x2property.cpp index 2553b6c7a6..a8638c7441 100644 --- a/src/properties/matrix/dmat4x2property.cpp +++ b/src/properties/matrix/dmat4x2property.cpp @@ -41,11 +41,11 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat4x2(0); + return glm::dmat4x2(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat4x2(0); + return glm::dmat4x2(0.0); } else { result[i][j] = lua_tonumber(state, -1); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::dmat4x2 value) { } glm::dmat4x2 fromStringConversion(const std::string& val, bool& success) { - glm::dmat4x2 result; + glm::dmat4x2 result = glm::dmat4x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat4x2Property, glm::dmat4x2, - glm::dmat4x2(0), + glm::dmat4x2(0.0), glm::dmat4x2( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest() diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 13dcb05d69..5b027475ae 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -41,11 +41,11 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dmat4x3(0); + return glm::dmat4x3(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dmat4x3(0); + return glm::dmat4x3(0.0); } else { result[i][j] = lua_tonumber(state, -1); lua_pop(state, 1); @@ -73,7 +73,7 @@ bool toLuaConversion(lua_State* state, glm::dmat4x3 value) { } glm::dmat4x3 fromStringConversion(const std::string& val, bool& success) { - glm::dmat4x3 result; + glm::dmat4x3 result = glm::dmat4x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -122,7 +122,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( DMat4x3Property, glm::dmat4x3, - glm::dmat4x3(0), + glm::dmat4x3(0.0), glm::dmat4x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index 9cbecd01f3..e06bdd9bd7 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -41,11 +41,11 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat2x2(0); + return glm::mat2x2(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat2x2(0); + return glm::mat2x2(0.f); } else { result[i][j] = static_cast( lua_tonumber(state, -1) @@ -75,7 +75,7 @@ bool toLuaConversion(lua_State* state, glm::mat2x2 value) { } glm::mat2x2 fromStringConversion(const std::string& val, bool& success) { - glm::mat2x2 result; + glm::mat2x2 result = glm::mat2x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -124,7 +124,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat2Property, glm::mat2x2, - glm::mat2x2(0), + glm::mat2x2(0.f), glm::mat2x2( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest() diff --git a/src/properties/matrix/mat2x3property.cpp b/src/properties/matrix/mat2x3property.cpp index f9a55811d2..b1908cd658 100644 --- a/src/properties/matrix/mat2x3property.cpp +++ b/src/properties/matrix/mat2x3property.cpp @@ -43,11 +43,11 @@ glm::mat2x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat2x3(0); + return glm::mat2x3(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat2x3(0); + return glm::mat2x3(0.f); } else { result[i][j] @@ -77,7 +77,7 @@ bool toLuaConversion(lua_State* state, glm::mat2x3 value) { } glm::mat2x3 fromStringConversion(const std::string& val, bool& success) { - glm::mat2x3 result; + glm::mat2x3 result = glm::mat2x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -126,7 +126,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat2x3Property, glm::mat2x3, - glm::mat2x3(0), + glm::mat2x3(0.f), glm::mat2x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat2x4property.cpp b/src/properties/matrix/mat2x4property.cpp index 147999982c..c3003ffc54 100644 --- a/src/properties/matrix/mat2x4property.cpp +++ b/src/properties/matrix/mat2x4property.cpp @@ -41,11 +41,11 @@ glm::mat2x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat2x4(0); + return glm::mat2x4(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat2x4(0); + return glm::mat2x4(0.f); } else { result[i][j] @@ -75,7 +75,7 @@ bool toLuaConversion(lua_State* state, glm::mat2x4 value) { } glm::mat2x4 fromStringConversion(const std::string& val, bool& success) { - glm::mat2x4 result; + glm::mat2x4 result = glm::mat2x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -124,7 +124,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat2x4Property, glm::mat2x4, - glm::mat2x4(0), + glm::mat2x4(0.f), glm::mat2x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index 6706515643..30105a0205 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -41,11 +41,11 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat3x3(0); + return glm::mat3x3(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat3x3(0); + return glm::mat3x3(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::mat3x3 value) { } glm::mat3x3 fromStringConversion(const std::string& val, bool& success) { - glm::mat3x3 result; + glm::mat3x3 result = glm::mat3x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat3Property, glm::mat3x3, - glm::mat3x3(0), + glm::mat3x3(0.f), glm::mat3x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index 867e699293..7ce73cf189 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -41,11 +41,11 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat3x2(0); + return glm::mat3x2(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat3x2(0); + return glm::mat3x2(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::mat3x2 value) { } glm::mat3x2 fromStringConversion(const std::string& val, bool& success) { - glm::mat3x2 result; + glm::mat3x2 result = glm::mat3x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat3x2Property, glm::mat3x2, - glm::mat3x2(0), + glm::mat3x2(0.f), glm::mat3x2( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest() diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index ac163f14e2..c149e574fb 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -41,11 +41,11 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat3x4(0); + return glm::mat3x4(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat3x4(0); + return glm::mat3x4(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::mat3x4 value) { } glm::mat3x4 fromStringConversion(const std::string& val, bool& success) { - glm::mat3x4 result; + glm::mat3x4 result = glm::mat3x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat3x4Property, glm::mat3x4, - glm::mat3x4(0), + glm::mat3x4(0.f), glm::mat3x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 16b4916201..60c13fde3e 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -43,11 +43,11 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat4x4(0); + return glm::mat4x4(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat4x4(0); + return glm::mat4x4(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -76,7 +76,7 @@ bool toLuaConversion(lua_State* state, glm::mat4x4 value) { } glm::mat4x4 fromStringConversion(const std::string& val, bool& success) { - glm::mat4x4 result; + glm::mat4x4 result = glm::mat4x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -125,7 +125,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat4Property, glm::mat4x4, - glm::mat4x4(0), + glm::mat4x4(0.f), glm::mat4x4( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index 4a6e648631..49ba41c108 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -41,11 +41,11 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat4x2(0); + return glm::mat4x2(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat4x2(0); + return glm::mat4x2(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::mat4x2 value) { } glm::mat4x2 fromStringConversion(const std::string& val, bool& success) { - glm::mat4x2 result; + glm::mat4x2 result = glm::mat4x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat4x2Property, glm::mat4x2, - glm::mat4x2(0), + glm::mat4x2(0.f), glm::mat4x2( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest() diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index 31e62c9e8c..10088ac828 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -41,11 +41,11 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::mat4x3(0); + return glm::mat4x3(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::mat4x3(0); + return glm::mat4x3(0.f); } else { result[i][j] = static_cast(lua_tonumber(state, -1)); @@ -74,7 +74,7 @@ bool toLuaConversion(lua_State* state, glm::mat4x3 value) { } glm::mat4x3 fromStringConversion(const std::string& val, bool& success) { - glm::mat4x3 result; + glm::mat4x3 result = glm::mat4x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != (ghoul::glm_rows::value * ghoul::glm_cols::value)) @@ -123,7 +123,7 @@ using nl = std::numeric_limits; REGISTER_NUMERICALPROPERTY_SOURCE( Mat4x3Property, glm::mat4x3, - glm::mat4x3(0), + glm::mat4x3(0.f), glm::mat4x3( nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), nl::lowest(), diff --git a/src/properties/vector/bvec2property.cpp b/src/properties/vector/bvec2property.cpp index 13895c5562..050775eae2 100644 --- a/src/properties/vector/bvec2property.cpp +++ b/src/properties/vector/bvec2property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::bvec2 val) { } glm::bvec2 fromStringConversion(const std::string& val, bool& success) { - glm::bvec2 result; + glm::bvec2 result = glm::bvec2(false); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/bvec3property.cpp b/src/properties/vector/bvec3property.cpp index 5e20d06299..2a743084c0 100644 --- a/src/properties/vector/bvec3property.cpp +++ b/src/properties/vector/bvec3property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::bvec3 val) { } glm::bvec3 fromStringConversion(const std::string& val, bool& success) { - glm::bvec3 result; + glm::bvec3 result = glm::bvec3(false); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/bvec4property.cpp b/src/properties/vector/bvec4property.cpp index d9c33cbdf8..628bf73b04 100644 --- a/src/properties/vector/bvec4property.cpp +++ b/src/properties/vector/bvec4property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::bvec4 val) { } glm::bvec4 fromStringConversion(const std::string& val, bool& success) { - glm::bvec4 result; + glm::bvec4 result = glm::bvec4(false); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/dvec2property.cpp b/src/properties/vector/dvec2property.cpp index fbf8ee3559..b5dd01ddc1 100644 --- a/src/properties/vector/dvec2property.cpp +++ b/src/properties/vector/dvec2property.cpp @@ -39,11 +39,11 @@ glm::dvec2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dvec2(0); + return glm::dvec2(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dvec2(0); + return glm::dvec2(0.0); } else { result[i] = lua_tonumber(state, -1); @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::dvec2 value) { } glm::dvec2 fromStringConversion(const std::string& val, bool& success) { - glm::dvec2 result; + glm::dvec2 result = glm::dvec2(0.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -108,7 +108,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( DVec2Property, glm::dvec2, - glm::dvec2(0), + glm::dvec2(0.0), glm::dvec2(std::numeric_limits::lowest()), glm::dvec2(std::numeric_limits::max()), glm::dvec2(0.01), diff --git a/src/properties/vector/dvec3property.cpp b/src/properties/vector/dvec3property.cpp index fa8c0abc99..014f27539e 100644 --- a/src/properties/vector/dvec3property.cpp +++ b/src/properties/vector/dvec3property.cpp @@ -39,11 +39,11 @@ glm::dvec3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dvec3(0); + return glm::dvec3(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dvec3(0); + return glm::dvec3(0.0); } else { result[i] = lua_tonumber(state, -1); @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::dvec3 value) { } glm::dvec3 fromStringConversion(const std::string& val, bool& success) { - glm::dvec3 result; + glm::dvec3 result = glm::dvec3(0.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -108,7 +108,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( DVec3Property, glm::dvec3, - glm::dvec3(0), + glm::dvec3(0.0), glm::dvec3(std::numeric_limits::lowest()), glm::dvec3(std::numeric_limits::max()), glm::dvec3(0.01), diff --git a/src/properties/vector/dvec4property.cpp b/src/properties/vector/dvec4property.cpp index a28b64e84a..2b29ea7126 100644 --- a/src/properties/vector/dvec4property.cpp +++ b/src/properties/vector/dvec4property.cpp @@ -39,11 +39,11 @@ glm::dvec4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::dvec4(0); + return glm::dvec4(0.0); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::dvec4(0); + return glm::dvec4(0.0); } else { result[i] = lua_tonumber(state, -1); @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::dvec4 value) { } glm::dvec4 fromStringConversion(const std::string& val, bool& success) { - glm::dvec4 result; + glm::dvec4 result = glm::dvec4(0.0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -108,7 +108,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( DVec4Property, glm::dvec4, - glm::dvec4(0), + glm::dvec4(0.0), glm::dvec4(std::numeric_limits::lowest()), glm::dvec4(std::numeric_limits::max()), glm::dvec4(0.01), diff --git a/src/properties/vector/ivec2property.cpp b/src/properties/vector/ivec2property.cpp index cb2b82073c..823da7abb5 100644 --- a/src/properties/vector/ivec2property.cpp +++ b/src/properties/vector/ivec2property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::ivec2 value) { } glm::ivec2 fromStringConversion(const std::string& val, bool& success) { - glm::ivec2 result; + glm::ivec2 result = glm::ivec2(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/ivec3property.cpp b/src/properties/vector/ivec3property.cpp index 1f5f0bac9e..d847ac8b2f 100644 --- a/src/properties/vector/ivec3property.cpp +++ b/src/properties/vector/ivec3property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::ivec3 value) { } glm::ivec3 fromStringConversion(const std::string& val, bool& success) { - glm::ivec3 result; + glm::ivec3 result = glm::ivec3(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/ivec4property.cpp b/src/properties/vector/ivec4property.cpp index 123278ffac..e7f6f8112f 100644 --- a/src/properties/vector/ivec4property.cpp +++ b/src/properties/vector/ivec4property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::ivec4 value) { } glm::ivec4 fromStringConversion(const std::string& val, bool& success) { - glm::ivec4 result; + glm::ivec4 result = glm::ivec4(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/uvec2property.cpp b/src/properties/vector/uvec2property.cpp index 0e681a7dfa..b1a0c72e28 100644 --- a/src/properties/vector/uvec2property.cpp +++ b/src/properties/vector/uvec2property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::uvec2 value) { } glm::uvec2 fromStringConversion(const std::string& val, bool& success) { - glm::uvec2 result; + glm::uvec2 result = glm::uvec2(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/uvec3property.cpp b/src/properties/vector/uvec3property.cpp index ce921c1e92..74eb40bd42 100644 --- a/src/properties/vector/uvec3property.cpp +++ b/src/properties/vector/uvec3property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::uvec3 value) { } glm::uvec3 fromStringConversion(const std::string& val, bool& success) { - glm::uvec3 result; + glm::uvec3 result = glm::uvec3(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/uvec4property.cpp b/src/properties/vector/uvec4property.cpp index b7e2efbb75..cc57d15cf9 100644 --- a/src/properties/vector/uvec4property.cpp +++ b/src/properties/vector/uvec4property.cpp @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::uvec4 value) { } glm::uvec4 fromStringConversion(const std::string& val, bool& success) { - glm::uvec4 result; + glm::uvec4 result = glm::uvec4(0); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; diff --git a/src/properties/vector/vec2property.cpp b/src/properties/vector/vec2property.cpp index cb442bdd61..83a5704e5b 100644 --- a/src/properties/vector/vec2property.cpp +++ b/src/properties/vector/vec2property.cpp @@ -39,11 +39,11 @@ glm::vec2 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::vec2(0); + return glm::vec2(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::vec2(0); + return glm::vec2(0.f); } else { result[i] = static_cast(lua_tonumber(state, -1)); @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::vec2 value) { } glm::vec2 fromStringConversion(const std::string& val, bool& success) { - glm::vec2 result; + glm::vec2 result = glm::vec2(0.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -108,7 +108,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( Vec2Property, glm::vec2, - glm::vec2(0), + glm::vec2(0.f), glm::vec2(std::numeric_limits::lowest()), glm::vec2(std::numeric_limits::max()), glm::vec2(0.01f), diff --git a/src/properties/vector/vec3property.cpp b/src/properties/vector/vec3property.cpp index 157c5209cd..6cdaa5b6c7 100644 --- a/src/properties/vector/vec3property.cpp +++ b/src/properties/vector/vec3property.cpp @@ -39,11 +39,11 @@ glm::vec3 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::vec3(0); + return glm::vec3(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::vec3(0); + return glm::vec3(0.f); } else { result[i] = static_cast(lua_tonumber(state, -1)); @@ -68,7 +68,7 @@ bool toLuaConversion(lua_State* state, glm::vec3 value) { } glm::vec3 fromStringConversion(const std::string& val, bool& success) { - glm::vec3 result; + glm::vec3 result = glm::vec3(0.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -107,7 +107,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( Vec3Property, glm::vec3, - glm::vec3(0), + glm::vec3(0.f), glm::vec3(std::numeric_limits::lowest()), glm::vec3(std::numeric_limits::max()), glm::vec3(0.01f), diff --git a/src/properties/vector/vec4property.cpp b/src/properties/vector/vec4property.cpp index 7de76627cf..4e30704e53 100644 --- a/src/properties/vector/vec4property.cpp +++ b/src/properties/vector/vec4property.cpp @@ -39,11 +39,11 @@ glm::vec4 fromLuaConversion(lua_State* state, bool& success) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; - return glm::vec4(0); + return glm::vec4(0.f); } if (lua_isnumber(state, -1) != 1) { success = false; - return glm::vec4(0); + return glm::vec4(0.f); } else { result[i] = static_cast(lua_tonumber(state, -1)); @@ -69,7 +69,7 @@ bool toLuaConversion(lua_State* state, glm::vec4 value) { } glm::vec4 fromStringConversion(const std::string& val, bool& success) { - glm::vec4 result; + glm::vec4 result = glm::vec4(0.f); std::vector tokens = ghoul::tokenizeString(val, ','); if (tokens.size() != static_cast(result.length())) { success = false; @@ -108,7 +108,7 @@ namespace openspace::properties { REGISTER_NUMERICALPROPERTY_SOURCE( Vec4Property, glm::vec4, - glm::vec4(0), + glm::vec4(0.f), glm::vec4(std::numeric_limits::lowest()), glm::vec4(std::numeric_limits::max()), glm::vec4(0.01f), diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 579319a6cb..5494a1a2e9 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -1177,7 +1177,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer); } - glm::vec3 cameraPosition; + glm::vec3 cameraPosition = glm::vec3(0.f); bool isCameraInside = raycaster->isCameraInside( raycasterTask.renderData, cameraPosition diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 6ef24cdb46..fc4c6748f4 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -224,7 +224,7 @@ void LoadingScreen::render() { rendering::helper::Anchor::Center ); - glm::vec4 color; + glm::vec4 color = glm::vec4(0.f); switch (_phase) { case Phase::PreStart: break; @@ -273,8 +273,8 @@ void LoadingScreen::render() { renderer.render(*_loadingFont, loadingLl, headline); - glm::vec2 messageLl; - glm::vec2 messageUr; + glm::vec2 messageLl = glm::vec2(0.f); + glm::vec2 messageUr = glm::vec2(0.f); if (_showMessage) { std::lock_guard guard(_messageMutex); @@ -325,8 +325,8 @@ void LoadingScreen::render() { // we make use with an overlap in the worst case bool foundSpace = false; - glm::vec2 ll; - glm::vec2 ur; + glm::vec2 ll = glm::vec2(0.f); + glm::vec2 ur = glm::vec2(0.f); int i = 0; for (; i < MaxNumberLocationSamples && !foundSpace; ++i) { std::uniform_int_distribution distX( diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index d32a1ace4c..7b03d8e27d 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -142,7 +142,7 @@ LuaConsole::LuaConsole() ) , _historyTextColor( HistoryTextColorInfo, - glm::vec4(1.0f, 1.0f, 1.0f, 0.65f), + glm::vec4(1.f, 1.f, 1.f, 0.65f), glm::vec4(0.f), glm::vec4(1.f) ) @@ -646,7 +646,7 @@ void LuaConsole::render() { glDisable(GL_DEPTH_TEST); rendering::helper::renderBox( - glm::vec2(0.f, 0.f), + glm::vec2(0.f), glm::vec2(1.f, _currentHeight / res.y), _backgroundColor ); @@ -793,7 +793,7 @@ void LuaConsole::render() { }; if (_remoteScripting) { - const glm::vec4 Red(1, 0, 0, 1); + const glm::vec4 Red(1.f, 0.f, 0.f, 1.f); ParallelConnection::Status status = global::parallelPeer.status(); const int nClients = @@ -809,7 +809,7 @@ void LuaConsole::render() { const glm::vec2 loc = locationForRightJustifiedText(nClientsText); RenderFont(*_font, loc, nClientsText, Red); } else if (global::parallelPeer.isHost()) { - const glm::vec4 LightBlue(0.4, 0.4, 1, 1); + const glm::vec4 LightBlue(0.4f, 0.4f, 1.f, 1.f); const std::string localExecutionText = "Local script execution"; const glm::vec2 loc = locationForRightJustifiedText(localExecutionText); diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 5fde95806a..46f1332ee8 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -647,6 +647,7 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat case WindowDelegate::Frustum::Mono: return ""; case WindowDelegate::Frustum::LeftEye: return "(left)"; case WindowDelegate::Frustum::RightEye: return "(right)"; + default: throw std::logic_error("Unhandled case label"); } }(frustum); @@ -761,8 +762,8 @@ void RenderEngine::renderEndscreen() { glEnable(GL_BLEND); rendering::helper::renderBox( - glm::vec2(0.f, 0.f), - glm::vec2(1.f, 1.f), + glm::vec2(0.f), + glm::vec2(1.f), glm::vec4(0.f, 0.f, 0.f, 0.5f) ); @@ -1414,7 +1415,7 @@ void RenderEngine::renderScreenLog() { white ); - glm::vec4 color(glm::uninitialize); + glm::vec4 color = glm::vec4(0.f); switch (e->level) { case ghoul::logging::LogLevel::Debug: color = glm::vec4(0.f, 1.f, 0.f, alpha); diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index ce8ea4511c..844320cbe4 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -132,7 +132,7 @@ namespace { float phi = spherical.z; // Sanitize coordinates. - float theta = wrap(spherical.y, 0.0, glm::two_pi()); + float theta = wrap(spherical.y, 0.f, glm::two_pi()); if (theta > glm::pi()) { theta = glm::two_pi() - theta; phi += glm::pi(); diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index c201a392dc..f0c40544ba 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -141,7 +141,7 @@ void TransferFunction::setTextureFromTxt(std::shared_ptr upper = glm::clamp(upper, lower, 1.f); } else if (key == "mappingkey") { float intensity; - glm::vec4 rgba = glm::vec4(0.0f); + glm::vec4 rgba = glm::vec4(0.f); iss >> intensity; for(int i = 0; i < 4; ++i) { iss >> rgba[i]; diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index f56d29b136..3f949f5244 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -746,11 +746,7 @@ SurfacePositionHandle SceneGraphNode::calculateSurfacePositionHandle( return _renderable->calculateSurfacePositionHandle(targetModelSpace); } else { - return { - glm::dvec3(0.0, 0.0, 0.0), - glm::normalize(targetModelSpace), - 0.0 - }; + return { glm::dvec3(0.0), glm::normalize(targetModelSpace), 0.0 }; } } diff --git a/src/util/blockplaneintersectiongeometry.cpp b/src/util/blockplaneintersectiongeometry.cpp index 835c893dac..8533c3241d 100644 --- a/src/util/blockplaneintersectiongeometry.cpp +++ b/src/util/blockplaneintersectiongeometry.cpp @@ -120,7 +120,7 @@ void BlockPlaneIntersectionGeometry::updateVertices() { glm::vec3 vectorI = glm::normalize(intersections[i] - intersections[0]); float sinA = glm::dot(glm::cross(vector1, vectorI), _normal); float cosA = glm::dot(vector1, vectorI); - angles[i - 1] = { i, static_cast(glm::sign(sinA) * (1.0 - cosA)) }; + angles[i - 1] = { i, glm::sign(sinA) * (1.f - cosA) }; } // Sort the vectors by angle in the plane diff --git a/src/util/camera.cpp b/src/util/camera.cpp index 41cbc3500a..be427ab0ae 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -210,8 +210,8 @@ void Camera::serialize(std::ostream& os) const { void Camera::deserialize(std::istream& is) { glm::dvec3 p; - glm::dquat q; is >> p.x >> p.y >> p.z; + glm::dquat q; is >> q.x >> q.y >> q.z >> q.w; setPositionVec3(p); setRotation(q); diff --git a/src/util/sphere.cpp b/src/util/sphere.cpp index cbd3cfc4dc..8f0e2e66b4 100644 --- a/src/util/sphere.cpp +++ b/src/util/sphere.cpp @@ -71,7 +71,7 @@ Sphere::Sphere(glm::vec3 radius, int segments) glm::vec3 normal = glm::vec3(x, y, z); if (!(x == 0.f && y == 0.f && z == 0.f)) { - normal = glm::normalize(normal); + normal = glm::vec3(glm::normalize(glm::dvec3(normal))); } _varray[nr].normal[0] = normal[0]; diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index bd65b59db5..781e32fee5 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -1027,7 +1027,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, const std::set& coveredTimes = _spkCoverageTimes.find(targetId)->second; - glm::dvec3 pos; + glm::dvec3 pos = glm::dvec3(0.0); if (coveredTimes.lower_bound(ephemerisTime) == coveredTimes.begin()) { // coverage later, fetch first position spkpos_c( @@ -1062,7 +1062,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, } else { // coverage both earlier and later, interpolate these positions - glm::dvec3 posEarlier; + glm::dvec3 posEarlier = glm::dvec3(0.0); double ltEarlier; double timeEarlier = *std::prev((coveredTimes.lower_bound(ephemerisTime))); spkpos_c( @@ -1075,7 +1075,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, <Earlier ); - glm::dvec3 posLater; + glm::dvec3 posLater = glm::dvec3(0.0); double ltLater; double timeLater = *(coveredTimes.upper_bound(ephemerisTime)); spkpos_c( @@ -1106,7 +1106,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram const std::string& toFrame, double time) const { - glm::dmat3 result; + glm::dmat3 result = glm::dmat3(1.0); const int idFrame = frameId(fromFrame); if (_ckCoverageTimes.find(idFrame) == _ckCoverageTimes.end()) { @@ -1155,7 +1155,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram double earlier = *std::prev((coveredTimes.lower_bound(time))); double later = *(coveredTimes.upper_bound(time)); - glm::dmat3 earlierTransform; + glm::dmat3 earlierTransform = glm::dmat3(1.0); pxform_c( fromFrame.c_str(), toFrame.c_str(), @@ -1167,7 +1167,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram fromFrame, toFrame, time )); - glm::dmat3 laterTransform; + glm::dmat3 laterTransform = glm::dmat3(1.0); pxform_c( fromFrame.c_str(), toFrame.c_str(), diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 584fdc9c11..5e1fe7550a 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -106,9 +106,9 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix( _kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in2, &out2); return glm::dmat3( - out0.c0 , out0.c1 , out0.c2, - out1.c0 , out1.c1 , out1.c2, - out2.c0 , out2.c1 , out2.c2 + out0.c0, out0.c1, out0.c2, + out1.c0, out1.c1, out1.c2, + out2.c0, out2.c1, out2.c2 ); #else return glm::dmat3(0.0);