ModelNode.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  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/Collision/Aabb.h>
  8. #include <AnKi/Util/WeakArray.h>
  9. namespace anki
  10. {
  11. // Forward
  12. class RenderQueueDrawContext;
  13. class RayTracingInstanceQueueElement;
  14. /// @addtogroup scene
  15. /// @{
  16. /// The model scene node.
  17. class ModelNode : public SceneNode
  18. {
  19. public:
  20. ModelNode(SceneGraph* scene, CString name);
  21. ~ModelNode();
  22. Error frameUpdate(Second prevUpdateTime, Second crntTime) override;
  23. private:
  24. class FeedbackComponent;
  25. class RenderProxy;
  26. Aabb m_aabbLocal;
  27. DynamicArray<RenderProxy> m_renderProxies; ///< The size matches the number of render components.
  28. Bool m_deferredRenderComponentUpdate = false;
  29. void feedbackUpdate();
  30. void draw(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData, U32 modelPatchIdx) const;
  31. void setupRayTracingInstanceQueueElement(U32 lod, U32 modelPatchIdx, RayTracingInstanceQueueElement& el) const;
  32. void initRenderComponents();
  33. };
  34. /// @}
  35. } // end namespace anki