ReflectionProxy.h 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/SceneNode.h>
  7. #include <anki/Math.h>
  8. #include <anki/collision/Obb.h>
  9. namespace anki
  10. {
  11. /// @addtogroup scene
  12. /// @{
  13. /// Proxy used in realtime reflections.
  14. class ReflectionProxy : public SceneNode
  15. {
  16. friend class ReflectionProxyMoveFeedbackComponent;
  17. public:
  18. ReflectionProxy(SceneGraph* scene)
  19. : SceneNode(scene)
  20. {
  21. }
  22. ~ReflectionProxy()
  23. {
  24. m_quadsLSpace.destroy(getSceneAllocator());
  25. }
  26. /// Create the proxy. The points form a quad and they should be in local
  27. /// space.
  28. ANKI_USE_RESULT Error create(const CString& name, const CString& proxyMesh);
  29. private:
  30. DArray<Array<Vec4, 4>> m_quadsLSpace; ///< Quads in local space.
  31. Obb m_boxLSpace;
  32. Obb m_boxWSpace;
  33. void onMoveUpdate(const MoveComponent& move);
  34. };
  35. /// @}
  36. } // end namespace anki