ModelNode.h 1.1 KB

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