BsCSkybox.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "Components/BsCSkybox.h"
  4. #include "RTTI/BsCSkyboxRTTI.h"
  5. #include "Scene/BsSceneManager.h"
  6. #include "Renderer/BsSkybox.h"
  7. namespace bs
  8. {
  9. CSkybox::CSkybox()
  10. {
  11. setFlag(ComponentFlag::AlwaysRun, true);
  12. setName("Skybox");
  13. }
  14. CSkybox::CSkybox(const HSceneObject& parent)
  15. : Component(parent)
  16. {
  17. setFlag(ComponentFlag::AlwaysRun, true);
  18. setName("Skybox");
  19. }
  20. CSkybox::~CSkybox()
  21. {
  22. mInternal->destroy();
  23. }
  24. void CSkybox::onInitialized()
  25. {
  26. // If mInternal already exists this means this object was deserialized,
  27. // so all we need to do is initialize it.
  28. if (mInternal != nullptr)
  29. mInternal->initialize();
  30. else
  31. mInternal = Skybox::create();
  32. }
  33. RTTITypeBase* CSkybox::getRTTIStatic()
  34. {
  35. return CSkyboxRTTI::instance();
  36. }
  37. RTTITypeBase* CSkybox::getRTTI() const
  38. {
  39. return CSkybox::getRTTIStatic();
  40. }
  41. }