changed rotation vector property to handle degrees instead of radians

This commit is contained in:
Lovisa Hassler
2019-01-23 16:34:57 -05:00
parent 27e2e1461d
commit dcf65fe784

View File

@@ -93,9 +93,9 @@ namespace {
};
constexpr openspace::properties::Property::PropertyInfo RotationVecInfo = {
"RotationVec",
"Rotation Vector",
"Rotation vector "
"RotationVector",
"Rotation Vector",
"Rotation Vector using degrees"
};
constexpr openspace::properties::Property::PropertyInfo LightSourcesInfo = {
@@ -185,7 +185,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
, _specularIntensity(SpecularIntensityInfo, 1.f, 0.f, 1.f)
, _performShading(ShadingInfo, true)
, _modelTransform(ModelTransformInfo, glm::dmat3(1.0), glm::dmat3(-1.0), glm::dmat3(1.0))
, _rotationVec(RotationVecInfo, glm::dvec3(3.14), glm::dvec3(-3.14), glm::dvec3(2*(3.1415)))
, _rotationVec(RotationVecInfo, glm::dvec3(0), glm::dvec3(0), glm::dvec3(360))
, _lightSourcePropertyOwner({ "LightSources", "Light Sources" })
{
documentation::testSpecificationAndThrow(
@@ -255,8 +255,11 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
addProperty(_rotationVec);
_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(_rotationVec));
glm::quat(radianVector));
});
}