CmRenderable.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmComponent.h"
  4. namespace CamelotEngine
  5. {
  6. class CM_EXPORT Renderable : public Component
  7. {
  8. public:
  9. void setMesh(HMesh mesh) { mMesh = mesh; }
  10. void setMaterial(HMaterial material) { mMaterial = material; }
  11. HMesh getMesh() const { return mMesh; }
  12. HMaterial getMaterial() const { return mMaterial; }
  13. private:
  14. HMesh mMesh;
  15. HMaterial mMaterial;
  16. /************************************************************************/
  17. /* COMPONENT OVERRIDES */
  18. /************************************************************************/
  19. protected:
  20. friend class SceneObject;
  21. /** Standard constructor.
  22. */
  23. Renderable(const HSceneObject& parent);
  24. public:
  25. virtual void update() {}
  26. /************************************************************************/
  27. /* RTTI */
  28. /************************************************************************/
  29. public:
  30. friend class RenderableRTTI;
  31. static RTTITypeBase* getRTTIStatic();
  32. virtual RTTITypeBase* getRTTI() const;
  33. protected:
  34. Renderable() {} // Serialization only
  35. };
  36. }