mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-03 18:19:38 -06:00
Property for rotation
This commit is contained in:
@@ -92,6 +92,12 @@ namespace {
|
||||
"all other transformations are applied."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo RotationVecInfo = {
|
||||
"RotationVec",
|
||||
"Rotation Vector",
|
||||
"Rotation vector "
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LightSourcesInfo = {
|
||||
"LightSources",
|
||||
"Light Sources",
|
||||
@@ -149,6 +155,12 @@ documentation::Documentation RenderableModel::Documentation() {
|
||||
Optional::Yes,
|
||||
ModelTransformInfo.description
|
||||
},
|
||||
{
|
||||
RotationVecInfo.identifier,
|
||||
new DoubleVector3Verifier,
|
||||
Optional::Yes,
|
||||
RotationVecInfo.description
|
||||
},
|
||||
{
|
||||
LightSourcesInfo.identifier,
|
||||
new TableVerifier({
|
||||
@@ -172,7 +184,8 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
, _diffuseIntensity(DiffuseIntensityInfo, 1.f, 0.f, 1.f)
|
||||
, _specularIntensity(SpecularIntensityInfo, 1.f, 0.f, 1.f)
|
||||
, _performShading(ShadingInfo, true)
|
||||
, _modelTransform(ModelTransformInfo, glm::mat3(1.f))
|
||||
, _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)))
|
||||
, _lightSourcePropertyOwner({ "LightSources", "Light Sources" })
|
||||
{
|
||||
documentation::testSpecificationAndThrow(
|
||||
@@ -238,6 +251,13 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
|
||||
addProperty(_diffuseIntensity);
|
||||
addProperty(_specularIntensity);
|
||||
addProperty(_performShading);
|
||||
addProperty(_modelTransform);
|
||||
addProperty(_rotationVec);
|
||||
|
||||
_rotationVec.onChange([this]() {
|
||||
_modelTransform = glm::mat4_cast(
|
||||
glm::quat(_rotationVec));
|
||||
});
|
||||
}
|
||||
|
||||
bool RenderableModel::isReady() const {
|
||||
|
||||
Reference in New Issue
Block a user