Creation of Switch Node, Fixed Primitives inheritance, and added

Blending to Shader.
This commit is contained in:
brunoherbelin
2020-04-02 00:06:55 +02:00
parent 37a6754de2
commit fc256693dc
13 changed files with 229 additions and 55 deletions

23
Scene.h
View File

@@ -72,14 +72,31 @@ public:
virtual void draw ( glm::mat4 modelview, glm::mat4 projection) override;
virtual void accept(Visitor& v) override;
virtual void addChild ( Node *child );
virtual Node* getChild ( int i );
virtual int numChildren();
void addChild ( Node *child );
Node* getChild ( uint i );
uint numChildren() const;
protected:
std::vector< Node* > children_;
};
class Switch : public Group {
public:
Switch() : Group(), active_(0) {}
virtual void update ( float dt ) override;
virtual void draw ( glm::mat4 modelview, glm::mat4 projection) override;
virtual void accept(Visitor& v) override;
void setActiveIndex(uint index);
uint activeIndex() const { return active_; }
Node* activeNode();
protected:
uint active_;
};
// A scene contains a root node and gives a simplified API to add nodes
class Scene {