BsCSkybox.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsSkybox.h"
  6. #include "BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components
  10. * @{
  11. */
  12. /**
  13. * @copydoc Skybox
  14. *
  15. * Wraps Skybox as a Component.
  16. */
  17. class BS_CORE_EXPORT CSkybox : public Component
  18. {
  19. public:
  20. CSkybox(const HSceneObject& parent);
  21. virtual ~CSkybox();
  22. /** @copydoc Skybox::getTexture */
  23. HTexture getTexture() const { return mInternal->getTexture(); }
  24. /** @copydoc Skybox::setTexture */
  25. void setTexture(const HTexture& texture) { mInternal->setTexture(texture); }
  26. /** @copydoc Skybox::setBrightness */
  27. void setBrightness(float brightness) { mInternal->setBrightness(brightness); }
  28. /** @copydoc Skybox::getBrightness */
  29. float getBrightness() const { return mInternal->getBrightness(); }
  30. /** @name Internal
  31. * @{
  32. */
  33. /** Returns the skybox that this component wraps. */
  34. SPtr<Skybox> _getSkybox() const { return mInternal; }
  35. /** @} */
  36. protected:
  37. mutable SPtr<Skybox> mInternal;
  38. /************************************************************************/
  39. /* COMPONENT OVERRIDES */
  40. /************************************************************************/
  41. protected:
  42. friend class SceneObject;
  43. /** @copydoc Component::onInitialized */
  44. void onInitialized() override;
  45. /** @copydoc Component::update */
  46. void update() override { }
  47. /************************************************************************/
  48. /* RTTI */
  49. /************************************************************************/
  50. public:
  51. friend class CSkyboxRTTI;
  52. static RTTITypeBase* getRTTIStatic();
  53. RTTITypeBase* getRTTI() const override;
  54. protected:
  55. CSkybox(); // Serialization only
  56. };
  57. /** @} */
  58. }