BsCSkybox.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 "Renderer/BsSkybox.h"
  6. #include "Scene/BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components
  10. * @{
  11. */
  12. /**
  13. * @copydoc Skybox
  14. *
  15. * @note Wraps Skybox as a Component.
  16. */
  17. class BS_CORE_EXPORT BS_SCRIPT_EXPORT(n:Skybox) CSkybox : public Component
  18. {
  19. public:
  20. CSkybox(const HSceneObject& parent);
  21. virtual ~CSkybox();
  22. /** @copydoc Skybox::getTexture */
  23. BS_SCRIPT_EXPORT(n:Texture,pr:getter)
  24. HTexture getTexture() const { return mInternal->getTexture(); }
  25. /** @copydoc Skybox::setTexture */
  26. BS_SCRIPT_EXPORT(n:Texture,pr:setter)
  27. void setTexture(const HTexture& texture) { mInternal->setTexture(texture); }
  28. /** @copydoc Skybox::setBrightness */
  29. BS_SCRIPT_EXPORT(n:Brightness,pr:setter)
  30. void setBrightness(float brightness) { mInternal->setBrightness(brightness); }
  31. /** @copydoc Skybox::getBrightness */
  32. BS_SCRIPT_EXPORT(n:Brightness,pr:getter)
  33. float getBrightness() const { return mInternal->getBrightness(); }
  34. /** @name Internal
  35. * @{
  36. */
  37. /** Returns the skybox that this component wraps. */
  38. SPtr<Skybox> _getSkybox() const { return mInternal; }
  39. /** @} */
  40. protected:
  41. mutable SPtr<Skybox> mInternal;
  42. /************************************************************************/
  43. /* COMPONENT OVERRIDES */
  44. /************************************************************************/
  45. protected:
  46. friend class SceneObject;
  47. /** @copydoc Component::onInitialized */
  48. void onInitialized() override;
  49. /** @copydoc Component::update */
  50. void update() override { }
  51. /************************************************************************/
  52. /* RTTI */
  53. /************************************************************************/
  54. public:
  55. friend class CSkyboxRTTI;
  56. static RTTITypeBase* getRTTIStatic();
  57. RTTITypeBase* getRTTI() const override;
  58. protected:
  59. CSkybox(); // Serialization only
  60. };
  61. /** @} */
  62. }