8 #ifndef RECAST_SERVER_BOX2DWORLD_H
9 #define RECAST_SERVER_BOX2DWORLD_H
13 #include <unordered_map>
15 #include <Box2D/Box2D.h>
16 #include <boost/lockfree/queue.hpp>
26 class Box2DWorld :
public b2DestructionListener, b2ContactListener {
52 std::set<int> existGround;
53 std::vector<Entity *> needTickEntity;
54 std::vector<Entity *> beDestroyed;
55 std::unordered_map<int, Entity *> entitysId;
56 boost::lockfree::queue<DelayedSpellCreate *, boost::lockfree::capacity <10>> delayedSpell;
60 void checkAndCreateGround(
float x1,
float x2);
62 void checkAndCreateGround(
float x);
64 void executeAllDelayed();
68 #endif //RECAST_SERVER_BOX2DWORLD_H
Main class in Recast Server.
Definition: Server.hpp:37
SpellEntity * createSpellEntity(b2Vec2 position, Spell *spell)
Definition: Box2DWorld.cpp:119
void BeginContact(b2Contact *contact)
Definition: Box2DWorld.cpp:147
std::vector< Entity > getAllEntityInChunk(float x1, float x2)
Definition: Box2DWorld.cpp:53
Definition: DelayedSpellCreate.h:16
Definition: SpellEntity.h:16
void SayGoodbye(b2Joint *joint)
Definition: Box2DWorld.h:46
Entity * createEntity(b2BodyDef &bodyDef, b2FixtureDef &fixtureDef)
Definition: Box2DWorld.cpp:81
void update()
Definition: Box2DWorld.cpp:41
void subscribeToUpdate(Entity *entity)
Definition: Box2DWorld.h:42
Definition: Box2DWorld.h:26
void SayGoodbye(b2Fixture *fixture)
Definition: Box2DWorld.cpp:99
Entity * getEntityById(int id)
Definition: Box2DWorld.h:40
~Box2DWorld()
Definition: Box2DWorld.cpp:37
Box2DWorld(Server *server)
Definition: Box2DWorld.cpp:19
void asyncCreateSpellEntity(b2Vec2 position, Spell *spell)
Definition: Box2DWorld.cpp:115