1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsCorePrerequisites.h"
6#include "Renderer/BsSkybox.h"
7#include "Scene/BsComponent.h"
8
9namespace bs
10{
11 /** @addtogroup Components-Core
12 * @{
13 */
14
15 /**
16 * @copydoc Skybox
17 *
18 * @note Wraps Skybox as a Component.
19 */
20 class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Rendering,n:Skybox) CSkybox : public Component
21 {
22 public:
23 CSkybox(const HSceneObject& parent);
24 virtual ~CSkybox();
25
26 /** @copydoc Skybox::getTexture */
27 BS_SCRIPT_EXPORT(n:Texture,pr:getter)
28 HTexture getTexture() const { return mInternal->getTexture(); }
29
30 /** @copydoc Skybox::setTexture */
31 BS_SCRIPT_EXPORT(n:Texture,pr:setter)
32 void setTexture(const HTexture& texture) { mInternal->setTexture(texture); }
33
34 /** @copydoc Skybox::setBrightness */
35 BS_SCRIPT_EXPORT(n:Brightness,pr:setter)
36 void setBrightness(float brightness) { mInternal->setBrightness(brightness); }
37
38 /** @copydoc Skybox::getBrightness */
39 BS_SCRIPT_EXPORT(n:Brightness,pr:getter)
40 float getBrightness() const { return mInternal->getBrightness(); }
41
42 /** @name Internal
43 * @{
44 */
45
46 /** Returns the skybox that this component wraps. */
47 SPtr<Skybox> _getSkybox() const { return mInternal; }
48
49 /** @} */
50
51 protected:
52 mutable SPtr<Skybox> mInternal;
53
54 /************************************************************************/
55 /* COMPONENT OVERRIDES */
56 /************************************************************************/
57 protected:
58 friend class SceneObject;
59
60 /** @copydoc Component::onInitialized */
61 void onInitialized() override;
62
63 /** @copydoc Component::onDestroyed */
64 void onDestroyed() override;
65
66 /** @copydoc Component::update */
67 void update() override { }
68
69 /************************************************************************/
70 /* RTTI */
71 /************************************************************************/
72 public:
73 friend class CSkyboxRTTI;
74 static RTTITypeBase* getRTTIStatic();
75 RTTITypeBase* getRTTI() const override;
76
77 protected:
78 CSkybox(); // Serialization only
79 };
80
81 /** @} */
82}