00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PHYSICSOBJECTCOLLECTION_H
00016 #define PHYSICSOBJECTCOLLECTION_H
00017
00018 #include "pandabase.h"
00019 #include "physicsObject.h"
00020 #include "pointerToArray.h"
00021
00022
00023
00024
00025
00026
00027
00028 class EXPCL_PANDAPHYSICS PhysicsObjectCollection {
00029 PUBLISHED:
00030 PhysicsObjectCollection();
00031 PhysicsObjectCollection(const PhysicsObjectCollection ©);
00032 void operator = (const PhysicsObjectCollection ©);
00033 INLINE ~PhysicsObjectCollection();
00034
00035 void add_physics_object(PT(PhysicsObject) physics_object);
00036 bool remove_physics_object(PT(PhysicsObject) physics_object);
00037 void add_physics_objects_from(const PhysicsObjectCollection &other);
00038 void remove_physics_objects_from(const PhysicsObjectCollection &other);
00039 void remove_duplicate_physics_objects();
00040 bool has_physics_object(PT(PhysicsObject) physics_object) const;
00041 void clear();
00042
00043 bool is_empty() const;
00044 int get_num_physics_objects() const;
00045 PT(PhysicsObject) get_physics_object(int index) const;
00046 MAKE_SEQ(get_physics_objects, get_num_physics_objects, get_physics_object);
00047 PT(PhysicsObject) operator [] (int index) const;
00048 int size() const;
00049 INLINE void operator += (const PhysicsObjectCollection &other);
00050 INLINE PhysicsObjectCollection operator + (const PhysicsObjectCollection &other) const;
00051
00052 void output(ostream &out) const;
00053 void write(ostream &out, int indent_level = 0) const;
00054
00055 private:
00056 typedef PTA(PT(PhysicsObject)) PhysicsObjects;
00057 PhysicsObjects _physics_objects;
00058 };
00059
00060
00061
00062
00063
00064
00065
00066 #include "physicsObjectCollection.I"
00067
00068 #endif
00069
00070