Update GLM version

Correctly initialize all values as they are no longer default-initialized
This commit is contained in:
Alexander Bock
2020-02-10 00:09:31 +01:00
parent b96fa43b27
commit 24ce773da9
143 changed files with 499 additions and 569 deletions

View File

@@ -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<std::string, ghoul::Dictionary> moduleConfigurations;

View File

@@ -64,12 +64,12 @@ protected:
void setFriction(double friction);
void setVelocityScaleFactor(double scaleFactor);
glm::dvec2 previousPosition;
glm::dvec2 previousPosition = glm::dvec2(0.0);
DelayedVariable<glm::dvec2, double> velocity;
};
double _sensitivity;
double _sensitivity = 0.0;
InteractionState _globalRotationState;
InteractionState _localRotationState;

View File

@@ -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

View File

@@ -70,7 +70,7 @@ private:
// Input from mouse
std::vector<MouseButton> _mouseButtonsDown;
glm::dvec2 _mousePosition;
glm::dvec2 _mousePosition = glm::dvec2(0.0);
double _mouseScrollDelta;
};

View File

@@ -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;

View File

@@ -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<glm::dvec3> up;
double yaw = 0.0;
double pitch = 0.0;

View File

@@ -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<glm::dvec3, glm::dvec3>;

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -112,7 +112,7 @@ private:
void saveTextureToMemory(GLenum color_buffer_attachment, int width, int height,
std::vector<double> & memory) const;
glm::ivec2 _resolution = glm::ivec2(0, 0);
glm::ivec2 _resolution = glm::ivec2(0);
bool _dirtyResolution = true;
bool _dirtyRendererData = true;

View File

@@ -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;
};

View File

@@ -239,9 +239,9 @@ private:
std::shared_ptr<ghoul::fontrendering::Font> _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;
};

View File

@@ -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<ghoul::opengl::ProgramObject> _shader;
};

View File

@@ -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

View File

@@ -61,7 +61,7 @@ protected:
private:
bool _needsUpdate = true;
double _cachedTime = -std::numeric_limits<double>::max();
glm::dmat3 _cachedMatrix;
glm::dmat3 _cachedMatrix = glm::dmat3(1.0);
};
} // namespace openspace

View File

@@ -183,14 +183,14 @@ private:
std::unique_ptr<TimeFrame> _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;

View File

@@ -47,12 +47,11 @@ public:
private:
void updateVertices();
std::vector<float> _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

View File

@@ -41,7 +41,7 @@ public:
GLuint _vaoId = 0;
GLuint _vBufferId = 0;
glm::vec3 _size;
glm::vec3 _size = glm::vec3(0.f);
};
} // namespace openspace

View File

@@ -58,9 +58,8 @@ public:
*/
template<typename T>
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<glm::mat4> _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

View File

@@ -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);
/// <code>true</code> if the ray intersects the body, <code>false</code> 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 <code>target</code> and <code>observer</code> 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<glm::dvec3> 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<glm::dvec3> terminatorPoints;
/// The local ephemeris time at the target, determined by the original
/// <code>aberrationCorrection</code> factor
double targetEphemerisTime;
double targetEphemerisTime = 0.0;
};
/**

View File

@@ -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