Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
CollectEntity.h
Go to the documentation of this file.
1 
8 #ifndef RECAST_SERVER_COLLECTENTITY_H
9 #define RECAST_SERVER_COLLECTENTITY_H
10 
11 #include <vector>
12 #include <Box2D/Box2D.h>
13 #include "world/wrappers/Entity.h"
14 
15 class CollectEntity : public b2QueryCallback {
16 public:
17  bool ReportFixture(b2Fixture *fixture) {
18  b2Body *body = fixture->GetBody();
19  if (body->GetType() == b2_dynamicBody)
20  entitys.push_back(Entity(fixture));
21 
22  return true;
23  }
24 
25  std::vector<Entity> getEntitys() const { return entitys; }
26 
27 private:
28  std::vector<Entity> entitys;
29 };
30 
31 
32 #endif //RECAST_SERVER_COLLECTENTITY_H
Definition: CollectEntity.h:15
bool ReportFixture(b2Fixture *fixture)
Definition: CollectEntity.h:17
Definition: Entity.h:21
std::vector< Entity > getEntitys() const
Definition: CollectEntity.h:25