FactoryCraftModel.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <DXBuffer.h>
  3. #include <GraphicsApi.h>
  4. #include <Model3D.h>
  5. #include <Textur.h>
  6. class FactoryCraftModel : public Framework::Model3D
  7. {
  8. private:
  9. Framework::DXBuffer* vertexLightBuffer;
  10. __int64* lightBuffer;
  11. int vertexLightBufferCount;
  12. bool visible;
  13. float destroyedState;
  14. Framework::Textur* breakTextur;
  15. bool effectAlpha;
  16. protected:
  17. void beforeRender(Framework::GraphicsApi* api,
  18. Framework::Shader* zVertexShader,
  19. Framework::Shader* zPixelShader) override;
  20. void afterRender(Framework::GraphicsApi* api,
  21. Framework::Shader* zVertexShader,
  22. Framework::Shader* zPixelShader) override;
  23. public:
  24. FactoryCraftModel();
  25. ~FactoryCraftModel();
  26. void setVertexLightBuffer(__int64* data, int vertexCount);
  27. __int64* zLightBuffer();
  28. void copyLightToGPU();
  29. void setVisible(bool visible);
  30. void setDestroyedState(float percentage);
  31. void setUseEffectAlpha(bool useAlpha);
  32. bool needRenderPolygon(int index) override;
  33. Framework::Textur* zEffectTextur() override;
  34. float getEffectPercentage() override;
  35. };