Make Translation, Rotation, and Scaling available as Properties in SceneGraphNode

This commit is contained in:
Alexander Bock
2016-10-28 11:52:44 +02:00
parent cfd71d6c8d
commit 4b9bed3b21
10 changed files with 75 additions and 95 deletions

View File

@@ -25,14 +25,16 @@
#ifndef __ROTATION_H__
#define __ROTATION_H__
#include <ghoul/misc/dictionary.h>
#include <openspace/util/updatestructures.h>
#include <openspace/properties/propertyowner.h>
#include <openspace/documentation/documentation.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/misc/dictionary.h>
namespace openspace {
class Rotation {
class Rotation : public properties::PropertyOwner {
public:
static Rotation* createFromDictionary(const ghoul::Dictionary& dictionary);

View File

@@ -101,13 +101,6 @@ public:
const Renderable* renderable() const;
Renderable* renderable();
// @TODO Remove once the scalegraph is in effect ---abock
void setEphemeris(Translation* eph) {
delete _translation;
_translation = eph;
}
static documentation::Documentation Documentation();
private:
@@ -129,9 +122,11 @@ private:
PowerScaledScalar _boundingSphere;
// Transformation defined by ephemeris, rotation and scale
Translation* _translation;
Rotation* _rotation;
Scale* _scale;
struct {
std::unique_ptr<Translation> translation;
std::unique_ptr<Rotation> rotation;
std::unique_ptr<Scale> scale;
} _transform;
// Cached transform data
glm::dvec3 _worldPositionCached;