BsCReflectionProbe.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 "BsReflectionProbe.h"
  6. #include "BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components
  10. * @{
  11. */
  12. /**
  13. * @copydoc ReflectionProbe
  14. *
  15. * Wraps ReflectionProbe as a Component.
  16. */
  17. class BS_CORE_EXPORT CReflectionProbe : public Component
  18. {
  19. public:
  20. CReflectionProbe(const HSceneObject& parent);
  21. virtual ~CReflectionProbe();
  22. /** @copydoc ReflectionProbe::getType */
  23. ReflectionProbeType getType() const { return mInternal->getType(); }
  24. /** @copydoc ReflectionProbe::setType */
  25. void setType(ReflectionProbeType type) { mInternal->setType(type); }
  26. /** @copydoc ReflectionProbe::getRadius */
  27. float getRadius() const { return mInternal->getRadius(); }
  28. /** @copydoc ReflectionProbe::setRadius */
  29. void setRadius(float radius) { mInternal->setRadius(radius); }
  30. /** @copydoc ReflectionProbe::getExtents */
  31. Vector3 getExtents() const { return mInternal->getExtents(); }
  32. /** @copydoc ReflectionProbe::setExtents */
  33. void setExtents(const Vector3& extents) { mInternal->setExtents(extents); }
  34. /** @copydoc ReflectionProbe::getBounds */
  35. Sphere getBounds() const;
  36. /** @name Internal
  37. * @{
  38. */
  39. /** Returns the reflection probe that this component wraps. */
  40. SPtr<ReflectionProbe> _getReflectionProbe() const { return mInternal; }
  41. /** @} */
  42. protected:
  43. mutable SPtr<ReflectionProbe> mInternal;
  44. /************************************************************************/
  45. /* COMPONENT OVERRIDES */
  46. /************************************************************************/
  47. protected:
  48. friend class SceneObject;
  49. /** @copydoc Component::onInitialized */
  50. void onInitialized() override;
  51. /** @copydoc Component::onDestroyed */
  52. void onDestroyed() override;
  53. /** @copydoc Component::update */
  54. void update() override { }
  55. /************************************************************************/
  56. /* RTTI */
  57. /************************************************************************/
  58. public:
  59. friend class CReflectionProbeRTTI;
  60. static RTTITypeBase* getRTTIStatic();
  61. RTTITypeBase* getRTTI() const override;
  62. protected:
  63. CReflectionProbe(); // Serialization only
  64. };
  65. /** @} */
  66. }