BsCReflectionProbe.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. /** Retrieves transition distance set by setTransitionDistance(). */
  35. float getTransitionDistance() const { return mInternal->getTransitionDistance(); }
  36. /** @copydoc ReflectionProbe::setTransitionDistance */
  37. void setTransitionDistance(float distance) { mInternal->setTransitionDistance(distance); }
  38. /** @copydoc ReflectionProbe::getCustomTexture */
  39. HTexture getCustomTexture() const { return mInternal->getCustomTexture(); }
  40. /** @copydoc ReflectionProbe::setCustomTexture */
  41. void setCustomTexture(const HTexture& texture) { mInternal->setCustomTexture(texture); }
  42. /** @copydoc ReflectionProbe::getBounds */
  43. Sphere getBounds() const;
  44. /** @copydoc ReflectionProbe::generate */
  45. void generate() { mInternal->generate(); }
  46. /** @name Internal
  47. * @{
  48. */
  49. /** Returns the reflection probe that this component wraps. */
  50. SPtr<ReflectionProbe> _getReflectionProbe() const { return mInternal; }
  51. /** @} */
  52. protected:
  53. mutable SPtr<ReflectionProbe> mInternal;
  54. /************************************************************************/
  55. /* COMPONENT OVERRIDES */
  56. /************************************************************************/
  57. protected:
  58. friend class SceneObject;
  59. /** @copydoc Component::onInitialized */
  60. void onInitialized() override;
  61. /** @copydoc Component::onDestroyed */
  62. void onDestroyed() override;
  63. /** @copydoc Component::update */
  64. void update() override { }
  65. /************************************************************************/
  66. /* RTTI */
  67. /************************************************************************/
  68. public:
  69. friend class CReflectionProbeRTTI;
  70. static RTTITypeBase* getRTTIStatic();
  71. RTTITypeBase* getRTTI() const override;
  72. protected:
  73. CReflectionProbe(); // Serialization only
  74. };
  75. /** @} */
  76. }