Advertisement
Guest User

Untitled

a guest
Aug 24th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. class SceneNode
  2. {
  3. public:
  4. SceneNode(const char *nodeName, SceneNode *parent);
  5. ~SceneNode();
  6.  
  7. SceneNode* addChildSceneNode(const char *name);
  8. void deleteChildSceneNode(const char *name);
  9. void deleteAllChildSceneNodes();
  10.  
  11. SceneNode* findFirstSceneNode(const char *name);
  12. SceneNode* getChildSceneNode(const char *name);
  13. SceneNode* getChildSceneNode(unsigned int index);
  14.  
  15. void attachRenderMeshData(RenderMeshData *renderMeshData);
  16.  
  17. void setName(const char *name) { _name = name; }
  18. void setTranformation(const glm::mat4 &transformation) {
  19. _transformation = transformation;
  20. _toRoot = (_parent ? _parent->toRootTransformation() : glm::mat4(1)) * _transformation;
  21. }
  22.  
  23. unsigned int getNumChildren() const { return _children.size(); }
  24. const char *name() const { return _name.c_str(); }
  25. SceneNode* parent() const { return _parent; }
  26. const glm::mat4& transformation() const { return _transformation; }
  27. const glm::mat4& toRootTransformation() const { return _toRoot; }
  28. const std::vector<RenderMeshData*>* renderMeshDatas() { return &_meshDatas; }
  29.  
  30. private:
  31. std::string _name;
  32.  
  33. glm::mat4 _transformation;
  34. glm::mat4 _toRoot;
  35.  
  36. SceneNode *_parent;
  37. std::vector<SceneNode*> _children;
  38. std::vector<RenderMeshData*> _meshDatas;
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement