Introduction of new Dictionary class (#1446)

* Adapting to introduction of new Dictionary class in Ghoul
 * Mainly replacing usage of float instead of doubles as expected
 * Adjust to the lack of the hasKeyAndValue function
This commit is contained in:
Alexander Bock
2021-01-02 15:07:11 +01:00
committed by GitHub
parent 7bf7a25401
commit 067c0f4b27
121 changed files with 2299 additions and 2160 deletions
@@ -137,11 +137,13 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
dictionary.value<ghoul::Dictionary>(keyProjection)
);
float boundingSphereRadius = 1.0e9;
dictionary.getValue(keyBoundingSphereRadius, boundingSphereRadius);
double boundingSphereRadius = 1.0e9;
if (dictionary.hasValue<double>(keyBoundingSphereRadius)) {
boundingSphereRadius = dictionary.value<double>(keyBoundingSphereRadius);
}
setBoundingSphere(boundingSphereRadius);
if (dictionary.hasKeyAndValue<bool>(PerformShadingInfo.identifier)) {
if (dictionary.hasValue<bool>(PerformShadingInfo.identifier)) {
_performShading = dictionary.value<bool>(PerformShadingInfo.identifier);
}
@@ -197,7 +199,7 @@ void RenderableModelProjection::initializeGL() {
_projectionComponent.initializeGL();
float bs = boundingSphere();
double bs = boundingSphere();
_geometry->initialize(this);
setBoundingSphere(bs); // ignore bounding sphere set by geometry.
}
@@ -436,7 +438,7 @@ void RenderableModelProjection::attitudeParameters(double time) {
const glm::vec3 cpos = p * 10000.0;
const float distance = glm::length(cpos);
const float radius = boundingSphere();
const double radius = boundingSphere();
_projectorMatrix = _projectionComponent.computeProjectorMatrix(
cpos,
@@ -445,8 +447,8 @@ void RenderableModelProjection::attitudeParameters(double time) {
_instrumentMatrix,
_projectionComponent.fieldOfViewY(),
_projectionComponent.aspectRatio(),
distance - radius,
distance + radius,
static_cast<float>(distance - radius),
static_cast<float>(distance + radius),
_boresight
);
}