BsMeshProxy.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsBounds.h"
  4. #include "BsSubMesh.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * Mesh proxy keeps a copy of Mesh data that is used by the Renderer. It
  9. * also contains some Renderer specific data. Essentially it is a class that
  10. * links Mesh and Renderer.
  11. */
  12. // TODO UNDOCUMENTED
  13. class BS_CORE_EXPORT MeshProxy
  14. {
  15. public:
  16. MeshProxy() {}
  17. MeshProxy(const std::shared_ptr<VertexData>& vertexData, const IndexBufferPtr& indexBuffer,
  18. const SubMesh& subMesh);
  19. void addRenderableProxy(RenderableSubProxy* proxy);
  20. void removeRenderableProxy(RenderableSubProxy* proxy);
  21. void updateBounds(const Bounds& bounds);
  22. Bounds getBounds() const { return mBounds; }
  23. void updateData(const std::shared_ptr<VertexData>& vertexData, const IndexBufferPtr& indexBuffer, const SubMesh& subMesh);
  24. std::shared_ptr<VertexData> getVertexData() const { return mVertexData; }
  25. IndexBufferPtr getIndexBuffer() const { return mIndexBuffer; }
  26. SubMesh getSubMesh() const { return mSubMesh; }
  27. private:
  28. std::shared_ptr<VertexData> mVertexData;
  29. IndexBufferPtr mIndexBuffer;
  30. SubMesh mSubMesh;
  31. Vector<RenderableSubProxy*> mRenderableProxies;
  32. Bounds mBounds;
  33. };
  34. }