00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00019 #ifndef CYCLONE_WORLD_H
00020 #define CYCLONE_WORLD_H
00021
00022 #include "body.h"
00023 #include "contacts.h"
00024
00025 namespace cyclone {
00027
00032 class World
00033 {
00036
00039
00043 bool calculateIterations;
00044
00046
00049 struct BodyRegistration
00050 {
00051 RigidBody *body;
00052 BodyRegistration * next;
00053 };
00054
00058 BodyRegistration *firstBody;
00059
00061
00064 ContactResolver resolver;
00065
00069 struct ContactGenRegistration
00070 {
00071 ContactGenerator *gen;
00072 ContactGenRegistration *next;
00073 };
00074
00078 ContactGenRegistration *firstContactGen;
00079
00084 Contact *contacts;
00085
00090 unsigned maxContacts;
00091
00092 public:
00100 World(unsigned maxContacts, unsigned iterations=0);
00101 ~World();
00102
00107 unsigned generateContacts();
00108
00110
00113 void runPhysics(real duration);
00115
00117
00123 void startFrame();
00125
00127 };
00129
00130 }
00131
00132 #endif // CYCLONE_PWORLD_H