Various code cleanup

This commit is contained in:
Alexander Bock
2019-06-18 10:47:15 +02:00
parent 8f6520ea8f
commit d0c04cfc6b
26 changed files with 154 additions and 123 deletions
@@ -407,10 +407,9 @@ std::pair<glm::dvec3, std::string> DashboardItemDistance::positionAndLabel(
if (!anchor) {
return { glm::dvec3(0.0), "Unknown" };
}
return {
global::navigationHandler.orbitalNavigator().anchorNode()->worldPosition(),
"focus"
};
else {
return { anchor->worldPosition(), "focus" };
}
}
case Type::Camera:
return { global::renderEngine.scene()->camera()->positionVec3(), "camera" };
+15 -8
View File
@@ -197,8 +197,13 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
, _specularIntensity(SpecularIntensityInfo, 1.f, 0.f, 1.f)
, _performShading(ShadingInfo, true)
, _disableFaceCulling(DisableFaceCullingInfo, false)
, _modelTransform(ModelTransformInfo, glm::dmat3(1.0), glm::dmat3(-1.0), glm::dmat3(1.0))
, _rotationVec(RotationVecInfo, glm::dvec3(0), glm::dvec3(0), glm::dvec3(360))
, _modelTransform(
ModelTransformInfo,
glm::dmat3(1.0),
glm::dmat3(-1.0),
glm::dmat3(1.0)
)
, _rotationVec(RotationVecInfo, glm::dvec3(0.0), glm::dvec3(0.0), glm::dvec3(360.0))
, _lightSourcePropertyOwner({ "LightSources", "Light Sources" })
{
documentation::testSpecificationAndThrow(
@@ -274,10 +279,12 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
_rotationVec.onChange([this]() {
glm::vec3 degreeVector = _rotationVec;
glm::vec3 radianVector = glm::vec3(glm::radians(degreeVector.x),
glm::radians(degreeVector.y), glm::radians(degreeVector.z));
_modelTransform = glm::mat4_cast(
glm::quat(radianVector));
glm::vec3 radianVector = glm::vec3(
glm::radians(degreeVector.x),
glm::radians(degreeVector.y),
glm::radians(degreeVector.z)
);
_modelTransform = glm::mat4_cast(glm::quat(radianVector));
});
}
@@ -405,13 +412,13 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
if (_disableFaceCulling) {
glDisable(GL_CULL_FACE);
}
_geometry->render();
if (_disableFaceCulling) {
glEnable(GL_CULL_FACE);
}
_program->deactivate();
}
@@ -42,7 +42,7 @@ namespace {
"This value specifies an image that is loaded from disk and is used as a texture "
"that is applied to this plane. This image has to be square."
};
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
"RenderableType",
"RenderableType",