BsCLightProbeVolume.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 "BsLightProbeVolume.h"
  6. #include "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::renderProbe() */
  32. void renderProbe(UINT32 handle);
  33. /** @copydoc LightProbeVolume::renderProbes() */
  34. void renderProbes();
  35. /** @copydoc LightProbeVolume::resize() */
  36. void resize(const AABox& volume, const Vector3I& cellCount = { 1, 1, 1 }) { mInternal->resize(volume, cellCount); }
  37. /** @copydoc LightProbeVolume::clip() */
  38. void clip() { mInternal->clip(); }
  39. /** @copydoc LightProbeVolume::reset() */
  40. void reset() { mInternal->reset(); }
  41. /** @name Internal
  42. * @{
  43. */
  44. /** Returns the light probe volume that this component wraps. */
  45. SPtr<LightProbeVolume> _getInternal() const { return mInternal; }
  46. /** @} */
  47. protected:
  48. mutable SPtr<LightProbeVolume> mInternal;
  49. // Only valid during construction
  50. AABox mVolume;
  51. Vector3I mCellCount;
  52. /************************************************************************/
  53. /* COMPONENT OVERRIDES */
  54. /************************************************************************/
  55. protected:
  56. friend class SceneObject;
  57. /** @copydoc Component::onInitialized */
  58. void onInitialized() override;
  59. /** @copydoc Component::onDestroyed */
  60. void onDestroyed() override;
  61. /** @copydoc Component::update */
  62. void update() override { }
  63. /************************************************************************/
  64. /* RTTI */
  65. /************************************************************************/
  66. public:
  67. friend class CLightProbeVolumeRTTI;
  68. static RTTITypeBase* getRTTIStatic();
  69. RTTITypeBase* getRTTI() const override;
  70. protected:
  71. CLightProbeVolume(); // Serialization only
  72. };
  73. /** @} */
  74. }