ModelNodePatch.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef MODEL_NODE_PATCH_H
  2. #define MODEL_NODE_PATCH_H
  3. #include "Vao.h"
  4. #include "Vbo.h"
  5. #include "Mesh.h" // For the Vbos enum
  6. #include "RsrcPtr.h"
  7. #include "ModelPatch.h"
  8. #include "Properties.h"
  9. #include "SceneNodePatch.h"
  10. class Material;
  11. class ModelNode;
  12. /// A fragment of the ModelNode
  13. class ModelNodePatch: public SceneNodePatch
  14. {
  15. /// VAO for MS and BS. All VBOs could be attached except for the vert weights
  16. PROPERTY_R(Vao, cpVao, getCpVao)
  17. /// VAO for depth passes. All VBOs could be attached except for the vert weights
  18. PROPERTY_R(Vao, dpVao, getDpVao)
  19. public:
  20. ModelNodePatch(const ModelNode& modelNode, const ModelPatch& modelPatch);
  21. /// @name Accessors
  22. /// @{
  23. const Material& getCpMtl() const {return modelPatchRsrc.getCpMtl();}
  24. const Material& getDpMtl() const {return modelPatchRsrc.getDpMtl();}
  25. const ModelPatch& getModelPatchRsrc() const {return modelPatchRsrc;}
  26. uint getVertIdsNum() const {return modelPatchRsrc.getMesh().getVertIdsNum();}
  27. /// @}
  28. protected:
  29. const ModelPatch& modelPatchRsrc;
  30. static void createVao(const Material& material, const boost::array<const Vbo*, Mesh::VBOS_NUM>& vbos, Vao& vao);
  31. };
  32. #endif