Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
splitdetector.h
1 #pragma once
2 
3 #include <list>
4 #include <vector>
5 #include <memory>
6 #include <limits>
7 
8 #include "world/helper/worldobjectmodification.h"
9 #include <stack>
10 
11 
12 class SplitData;
13 class WorldObject;
14 class Voxel;
15 
16 
18 {
19 public:
20  void searchSplitOffs(std::list<WorldObjectModification>& worldObjectModifications);
21 
22  std::vector<std::shared_ptr<SplitData>> &splitDataList();
23 
24 protected:
25  struct VoxelGroup {
26  VoxelGroup();
27  Voxel* voxel;
28  int groupId;
29  };
30 
31  std::vector<std::shared_ptr<SplitData>> m_splitDataList;
32  std::vector<VoxelGroup> m_voxelArray;
33  std::stack<glm::ivec3> m_stack;
34  int m_xy;
35  int m_x;
36  glm::ivec3 m_llf;
37  glm::ivec3 m_size;
38  int m_nextGroupId;
39 
40  void clear();
41  void findSplits(WorldObject* worldObject);
42 
43  void createSplitData(WorldObject* worldObject);
44 
45  void init(WorldObject* worldObject);
46 
47  int address(const glm::ivec3& pos);
48  VoxelGroup* voxelGroup(const glm::ivec3& pos);
49  void fillColor(const glm::ivec3& start, int groupId);
50  void visit(const glm::ivec3& p);
51 };
52 
Definition: splitdetector.h:25
Definition: splitdata.h:11
Definition: worldobject.h:43
Definition: splitdetector.h:17
Definition: voxel.h:15