Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
worldtreequery.h
1 #pragma once
2 
3 #include <functional>
4 #include <unordered_set>
5 #include <set>
6 
7 class Voxel;
8 class WorldTree;
9 class WorldTreeNode;
10 class WorldTreeGeode;
11 class WorldObject;
12 class CollisionFilter;
13 class AbstractShape;
14 
16 public:
17  WorldTreeQuery(WorldTree* worldTree, const AbstractShape* shape, WorldTreeNode* nodeHint = nullptr, CollisionFilter* collisionFilter = nullptr);
18 
19  bool areGeodesNear();
20 
21  std::unordered_set<WorldTreeGeode*> nearGeodes();
22 
23  bool areVoxelsIntersecting();
24  std::unordered_set<Voxel*> intersectingVoxels();
25 
26  std::unordered_set<WorldObject*> intersectingWorldObjects();
27 
28 
29 protected:
30  WorldTree* m_worldTree;
31  WorldTreeNode* m_nodeHint;
32  CollisionFilter* m_collisionFilter;
33  const AbstractShape* m_shape;
34  bool m_queryInterrupted;
35 
36  WorldTreeNode* getQueryRoot(WorldTreeNode* node = nullptr) const;
37  void query(WorldTreeNode* node, std::function<void(WorldTreeGeode*)> onGeodeInteraction);
38 };
Definition: collisionfilter.h:9
Definition: worldobject.h:43
Definition: worldtreegeode.h:11
Definition: worldtreequery.h:15
Definition: voxel.h:15
Definition: worldtreenode.h:13
Definition: abstractshape.h:7
Definition: worldtree.h:13