Simple game engine with complete export to scripting language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SceneNode.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef BLUECORE_SCENE_NODE_H
  2. #define BLUECORE_SCENE_NODE_H
  3. #include "Camera.h"
  4. #include "RenderQueue.h"
  5. #include "RigidBodySimulation.h"
  6. #include "ModelManager.h"
  7. #include "Utilities/Referenced.h"
  8. #include "Utilities/Named.h"
  9. #include "Utilities/Log.h"
  10. #include "Utilities/Activated.h"
  11. #include "Math/Transformation.h"
  12. #include <iostream>
  13. #include <list>
  14. namespace BlueCore
  15. {
  16. class SceneNode : public Referenced, public Named, public Activated
  17. {
  18. public:
  19. typedef std::list< ref_ptr<SceneNode> > SceneNodeList;
  20. protected:
  21. SceneNode *_Parent;
  22. SceneNodeList _Children;
  23. Transformation _RelativeTransformation;
  24. Transformation _AbsoluteTransformation;
  25. ref_ptr<RigidBody> _RigidBody;
  26. ref_ptr<Model> _Model;
  27. public:
  28. SceneNode();
  29. SceneNode(const std::string &name);
  30. virtual ~SceneNode();
  31. SceneNode *getParent() const;
  32. const SceneNodeList &getChildren() const;
  33. void setRigidBody (RigidBody* body);
  34. RigidBody* getRigidBody ();
  35. void setModel (Model* body);
  36. Model* getModel ();
  37. void attach(SceneNode *node);
  38. void detach(SceneNode *node);
  39. void detachAll();
  40. void detachFromParent();
  41. virtual void update(Scalar time);
  42. virtual void queue (RenderQueue *queue, Camera *camera);
  43. const Transformation& getRelativeTransformation();
  44. const Transformation& getAbsoluteTransformation();
  45. void setRelativeTranslation (const Vector3 &translation);
  46. void setRelativeRotation (const Quaternion &rotation);
  47. virtual void updateAbsoluteTransformation();
  48. };
  49. } // namespace BlueCore
  50. #endif