BsCLightProbeVolume.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/BsLightProbeVolume.h"
  6. #include "Scene/BsComponent.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components
  10. * @{
  11. */
  12. /**
  13. * @copydoc LightProbeVolume
  14. *
  15. * Wraps LightProbeVolume as a Component.
  16. */
  17. class BS_CORE_EXPORT CLightProbeVolume : public Component
  18. {
  19. public:
  20. CLightProbeVolume(const HSceneObject& parent, const AABox& volume = AABox::UNIT_BOX,
  21. const Vector3I& cellCount = {1, 1, 1});
  22. virtual ~CLightProbeVolume();
  23. /** @copydoc LightProbeVolume::addProbe() */
  24. UINT32 addProbe(const Vector3& position) { return mInternal->addProbe(position); }
  25. /** @copydoc LightProbeVolume::setProbePosition() */
  26. void setProbePosition(UINT32 handle, const Vector3& position) { mInternal->setProbePosition(handle, position); }
  27. /** @copydoc LightProbeVolume::getProbePosition() */
  28. Vector3 getProbePosition(UINT32 handle) const { return mInternal->getProbePosition(handle); }
  29. /** @copydoc LightProbeVolume::removeProbe() */
  30. void removeProbe(UINT32 handle) { mInternal->removeProbe(handle); }
  31. /** @copydoc LightProbeVolume::getProbes() */
  32. Vector<LightProbeInfo> getProbes() const;
  33. /** @copydoc LightProbeVolume::renderProbe() */
  34. void renderProbe(UINT32 handle);
  35. /** @copydoc LightProbeVolume::renderProbes() */
  36. void renderProbes();
  37. /** @copydoc LightProbeVolume::resize() */
  38. void resize(const AABox& volume, const Vector3I& cellCount = { 1, 1, 1 }) { mInternal->resize(volume, cellCount); }
  39. /** @copydoc LightProbeVolume::clip() */
  40. void clip() { mInternal->clip(); }
  41. /** @copydoc LightProbeVolume::reset() */
  42. void reset() { mInternal->reset(); }
  43. /** @name Internal
  44. * @{
  45. */
  46. /** Returns the light probe volume that this component wraps. */
  47. SPtr<LightProbeVolume> _getInternal() const { return mInternal; }
  48. /** @} */
  49. protected:
  50. mutable SPtr<LightProbeVolume> mInternal;
  51. // Only valid during construction
  52. AABox mVolume;
  53. Vector3I mCellCount;
  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 CLightProbeVolumeRTTI;
  70. static RTTITypeBase* getRTTIStatic();
  71. RTTITypeBase* getRTTI() const override;
  72. protected:
  73. CLightProbeVolume(); // Serialization only
  74. };
  75. /** @} */
  76. }