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