00001
00002
00003
00004
00005
00006 #ifndef OBJECTGROUP_H
00007 #define OBJECTGROUP_H
00008
00009 #include<Object.h>
00010
00011 #include<vector>
00012
00013 class World;
00014 class CollisionHull;
00015
00018 class ObjectGroup : public Object
00019 {
00020 public:
00021 virtual ~ObjectGroup();
00022
00023 void clear() {
00024 group.clear();
00025 }
00026 void add(Object *obj);
00027 Object *remove(Object *obj);
00028
00029
00030 bool update(World &world);
00031 void render(
00032 RenderContext &rc,
00033 RenderContext::Visibility visibility = RenderContext::PartlyVisible
00034 );
00035 float collide(
00036 const CollisionHull &hull, Vertex3 &nearestIntersection);
00037 real intersect(const Ray &ray) const;
00038
00039 void write(WDFFile &f);
00040 void readChunk(WDFFile::Chunk &chunk, WDFFile &f);
00041
00042 protected:
00043 typedef vector<Object*> ObjectList;
00044
00045 ObjectList group;
00046
00047 private:
00048 typedef Object super;
00049 };
00050 #endif