ReflectionProbeComponent.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Copyright (C) 2009-2016, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <anki/scene/SceneComponent.h>
  7. namespace anki
  8. {
  9. /// @addtogroup scene
  10. /// @{
  11. /// Reflection probe component.
  12. class ReflectionProbeComponent : public SceneComponent
  13. {
  14. public:
  15. ReflectionProbeComponent(SceneNode* node)
  16. : SceneComponent(SceneComponent::Type::REFLECTION_PROBE, node)
  17. {
  18. }
  19. static Bool classof(const SceneComponent& c)
  20. {
  21. return c.getType() == Type::REFLECTION_PROBE;
  22. }
  23. const Vec4& getPosition() const
  24. {
  25. return m_pos;
  26. }
  27. void setPosition(const Vec4& pos)
  28. {
  29. m_pos = pos.xyz0();
  30. }
  31. F32 getRadius() const
  32. {
  33. ANKI_ASSERT(m_radius > 0.0);
  34. return m_radius;
  35. }
  36. void setRadius(F32 radius)
  37. {
  38. ANKI_ASSERT(radius > 0.0);
  39. m_radius = radius;
  40. }
  41. Bool getMarkedForRendering() const
  42. {
  43. return m_markedForRendering;
  44. }
  45. void setMarkedForRendering(Bool render)
  46. {
  47. m_markedForRendering = render;
  48. }
  49. private:
  50. Vec4 m_pos = Vec4(0.0);
  51. F32 m_radius = 0.0;
  52. Bool8 m_markedForRendering = false;
  53. };
  54. /// @}
  55. } // end namespace anki