BlockRenderers.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "client/rendering/block/BlockRenderers.h"
  2. const int BlockRenderers::RENDERER_AMOUNT = 4;
  3. BlockRenderer BlockRenderers::RENDERER[RENDERER_AMOUNT];
  4. BlockRenderers::BlockRenderers()
  5. {
  6. }
  7. const BlockRenderer& BlockRenderers::getBlockRenderer(BlockId id)
  8. {
  9. return RENDERER[id * (id >= 0 && id < RENDERER_AMOUNT)];
  10. }
  11. void BlockRenderers::init()
  12. {
  13. RENDERER[1].addCuboid(-1, -1, -1, 0, 0, 0,
  14. 0.25f, 0.0f, 0.3125f, 0.0625f,
  15. 0.125f, 0.0f, 0.1875f, 0.0625f,
  16. 0.1875f, 0.0f, 0.25f, 0.0625f,
  17. 0.1875f, 0.0f, 0.25f, 0.0625f,
  18. 0.1875f, 0.0f, 0.25f, 0.0625f,
  19. 0.1875f, 0.0f, 0.25f, 0.0625f);
  20. RENDERER[2].addCuboid(-1, -1, -1, 0, 0, 0,
  21. 0.125f, 0.0f, 0.1875f, 0.0625f,
  22. 0.125f, 0.0f, 0.1875f, 0.0625f,
  23. 0.125f, 0.0f, 0.1875f, 0.0625f,
  24. 0.125f, 0.0f, 0.1875f, 0.0625f,
  25. 0.125f, 0.0f, 0.1875f, 0.0625f,
  26. 0.125f, 0.0f, 0.1875f, 0.0625f);
  27. RENDERER[3].addCuboid(-1, -1, -1, 0, 0, 0,
  28. 0.0625f, 0.0f, 0.125f, 0.0625f,
  29. 0.0625f, 0.0f, 0.125f, 0.0625f,
  30. 0.0625f, 0.0f, 0.125f, 0.0625f,
  31. 0.0625f, 0.0f, 0.125f, 0.0625f,
  32. 0.0625f, 0.0f, 0.125f, 0.0625f,
  33. 0.0625f, 0.0f, 0.125f, 0.0625f);
  34. }