diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-25 23:38:03 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-25 23:38:03 (GMT) |
commit | c4bffdaf37fdf72a84a225ec584d3698fe398857 (patch) | |
tree | 503b819d69c00f007709cfee0f332c7adc7ad818 /src/state.h | |
parent | 3e64e63b0113a99666ad68aa3e82bb7b80324d9b (diff) |
Color overriding now works. The outermost color will win if multiple colors are specified for the same object
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/state.h b/src/state.h index 5dc74df..df202aa 100644 --- a/src/state.h +++ b/src/state.h @@ -9,8 +9,8 @@ class State public: State(const class AbstractNode *parent) : parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) { - m = Transform3d::Identity(); - for (int i=0;i<4;i++) this->c[i] = -1.0; + this->matrix_ = Transform3d::Identity(); + this->color_.fill(-1.0f); } virtual ~State() {} @@ -18,15 +18,15 @@ public: void setPostfix(bool on) { this->ispostfix = on; } void setNumChildren(unsigned int numc) { this->numchildren = numc; } void setParent(const AbstractNode *parent) { this->parentnode = parent; } - void setMatrix(const Transform3d &m) { this->m = m; } - void setColor(const double c[4]) { memcpy(this->c, c, 4*sizeof(double)); } + void setMatrix(const Transform3d &m) { this->matrix_ = m; } + void setColor(const Color4f &c) { this->color_ = c; } bool isPrefix() const { return this->isprefix; } bool isPostfix() const { return this->ispostfix; } unsigned int numChildren() const { return this->numchildren; } const AbstractNode *parent() const { return this->parentnode; } - const Transform3d &matrix() const { return this->m; } - const double *color() const { return this->c; } + const Transform3d &matrix() const { return this->matrix_; } + const Color4f &color() const { return this->color_; } private: const AbstractNode * parentnode; @@ -35,8 +35,8 @@ private: unsigned int numchildren; // Transformation matrix and color. FIXME: Generalize such state variables? - Transform3d m; - double c[4]; + Transform3d matrix_; + Color4f color_; }; #endif |