Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Alphabetische Liste | Datenstrukturen | Auflistung der Dateien | Datenstruktur-Elemente | Datei-Elemente

CollisionsManager.h

gehe zur Dokumentation dieser Datei
00001 /*
00002 Autor: $Author: kunkel $ State: $State: Exp $
00003 Datum: $Date: 2005/05/30 12:35:25 $
00004 Version: $Revision: 1.1 $
00005 */
00006 
00011 #ifndef COLLISIONSMANAGMENT_H
00012 #define COLLISIONSMANAGMENT_H
00013 
00014 #include <list>
00015 
00016 #include "config.h"
00017 #include "Object.h"
00018 
00023 class Collisionspair {
00024 public:
00028     int i;
00029 
00033     int j;
00034 
00041     bool operator<(const Collisionspair &b) {
00042         if(i < b.i || (i == b.i && j < b.j))
00043             return true;
00044         return false;
00045     }
00046 
00052     bool operator==(const Collisionspair &b) {
00053         if(i == b.i && j == b.j)
00054             return true;
00055         return false;
00056     }
00057 
00063     Collisionspair(int i_, int j_) {
00064         if(i_>=j_) {
00065             i=i_;
00066             j=j_;
00067         } else {
00068             j=i_;
00069             i=j_;
00070         }
00071     }
00072 };
00073 
00080 class CollisionsManager {
00081 private:
00082 
00086     list<Collisionspair> *collisionpairs;
00087 
00091     list<Object*> *objects;
00092 
00097     inline double cubic(double x) {
00098         return ((x)*(x)*(x));
00099     }
00100 
00101 public:
00102 
00103     CollisionsManager(list<Collisionspair> *colpair, list<Object*> *obj);
00104 
00105     void collide();
00106 };
00107 
00108 #endif

Erzeugt am Mon May 30 14:31:15 2005 für Sunsystembuildingandsimulation von doxygen 1.3.6