Cyclone Cyclone: C:/data/physeng_code/include/cyclone/world.h Source File

C:/data/physeng_code/include/cyclone/world.h

Go to the documentation of this file.
00001 /*
00002  * Interface file for the rigid body world structure.
00003  *
00004  * Part of the Cyclone physics system.
00005  *
00006  * Copyright (c) Icosagon 2003. All Rights Reserved.
00007  *
00008  * This software is distributed under licence. Use of this software
00009  * implies agreement with all terms and conditions of the accompanying
00010  * software licence.
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         // ... other World data as before ...
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 } // namespace cyclone
00131 
00132 #endif // CYCLONE_PWORLD_H