2
0

BsCReflectionProbe.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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/BsReflectionProbe.h"
  6. #include "Scene/BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components
  10. * @{
  11. */
  12. /**
  13. * @copydoc ReflectionProbe
  14. *
  15. * @note Wraps ReflectionProbe as a Component.
  16. */
  17. class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Rendering,n:ReflectionProbe) CReflectionProbe : public Component
  18. {
  19. public:
  20. CReflectionProbe(const HSceneObject& parent);
  21. virtual ~CReflectionProbe();
  22. /** @copydoc ReflectionProbe::getType */
  23. BS_SCRIPT_EXPORT(n:Type,pr:getter)
  24. ReflectionProbeType getType() const { return mInternal->getType(); }
  25. /** @copydoc ReflectionProbe::setType */
  26. BS_SCRIPT_EXPORT(n:Type,pr:setter)
  27. void setType(ReflectionProbeType type) { mInternal->setType(type); }
  28. /** @copydoc ReflectionProbe::getRadius */
  29. BS_SCRIPT_EXPORT(n:Radius,pr:getter)
  30. float getRadius() const { return mInternal->getRadius(); }
  31. /** @copydoc ReflectionProbe::setRadius */
  32. BS_SCRIPT_EXPORT(n:Radius,pr:setter)
  33. void setRadius(float radius) { mInternal->setRadius(radius); }
  34. /** @copydoc ReflectionProbe::getExtents */
  35. BS_SCRIPT_EXPORT(n:Extents,pr:getter)
  36. Vector3 getExtents() const { return mInternal->getExtents(); }
  37. /** @copydoc ReflectionProbe::setExtents */
  38. BS_SCRIPT_EXPORT(n:Extents,pr:setter)
  39. void setExtents(const Vector3& extents) { mInternal->setExtents(extents); }
  40. /** Retrieves transition distance set by setTransitionDistance(). */
  41. float getTransitionDistance() const { return mInternal->getTransitionDistance(); }
  42. /** @copydoc ReflectionProbe::setTransitionDistance */
  43. void setTransitionDistance(float distance) { mInternal->setTransitionDistance(distance); }
  44. /** @copydoc ReflectionProbe::getCustomTexture */
  45. BS_SCRIPT_EXPORT(n:CustomTexture,pr:getter)
  46. HTexture getCustomTexture() const { return mInternal->getCustomTexture(); }
  47. /** @copydoc ReflectionProbe::setCustomTexture */
  48. BS_SCRIPT_EXPORT(n:CustomTexture,pr:setter)
  49. void setCustomTexture(const HTexture& texture) { mInternal->setCustomTexture(texture); }
  50. /** @copydoc ReflectionProbe::getBounds */
  51. Sphere getBounds() const;
  52. /** @copydoc ReflectionProbe::capture */
  53. BS_SCRIPT_EXPORT(n:Capture)
  54. void capture() { mInternal->capture(); }
  55. /** @name Internal
  56. * @{
  57. */
  58. /** Returns the reflection probe that this component wraps. */
  59. SPtr<ReflectionProbe> _getReflectionProbe() const { return mInternal; }
  60. /** @} */
  61. protected:
  62. mutable SPtr<ReflectionProbe> mInternal;
  63. /************************************************************************/
  64. /* COMPONENT OVERRIDES */
  65. /************************************************************************/
  66. protected:
  67. friend class SceneObject;
  68. /** @copydoc Component::onInitialized */
  69. void onInitialized() override;
  70. /** @copydoc Component::onDestroyed */
  71. void onDestroyed() override;
  72. /** @copydoc Component::update */
  73. void update() override { }
  74. /************************************************************************/
  75. /* RTTI */
  76. /************************************************************************/
  77. public:
  78. friend class CReflectionProbeRTTI;
  79. static RTTITypeBase* getRTTIStatic();
  80. RTTITypeBase* getRTTI() const override;
  81. protected:
  82. CReflectionProbe(); // Serialization only
  83. };
  84. /** @} */
  85. }