You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

voxelmodel.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include <vector>
  3. #include <array>
  4. #include "voxelmath.h"
  5. namespace vtk {
  6. class VoxelModel {
  7. public:
  8. VoxelModel();
  9. virtual ~VoxelModel();
  10. // accepts values between 0 and 15 to be packed into the geometry of face
  11. bool packDataIntoFace(const std::vector<unsigned>& data, const int& face);
  12. bool uploadFaceToMesh(std::vector<unsigned>& mesh, const int& face);
  13. std::vector<unsigned>& getFaceMesh(const int& face);
  14. /* surrounding light is an array containing the light data around the block in the following configuration
  15. where X stands for none and any numbers stand for array indexes
  16. y = -1
  17. x -1 0 1
  18. z -1 0 1 2 9 10 11 18 19 20
  19. 0 3 4 5 12 13 14 21 22 23
  20. 1 6 7 8 15 16 17 24 25 26
  21. zero_weight controls how "smoothed" the lighting is. Read the function body for more info on how this works
  22. */
  23. void getFaceLighting(std::vector<unsigned short>& lighting, const FaceDirection& face, const std::array<unsigned short, 27>& surrounding_light, const unsigned& zero_weight);
  24. protected:
  25. // top bottom north south east west, special
  26. std::array<std::vector<unsigned>, 7> mGeometry;
  27. };
  28. } //namespace vtk