| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // Filename: physicsObjectCollection.h
- // Created by: joswilso (12Jul06)
- //
- ////////////////////////////////////////////////////////////////////
- //
- // PANDA 3D SOFTWARE
- // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
- //
- // All use of this software is subject to the terms of the Panda 3d
- // Software license. You should have received a copy of this license
- // along with this source code; you will also find a current copy of
- // the license at http://etc.cmu.edu/panda3d/docs/license/ .
- //
- // To contact the maintainers of this program write to
- // [email protected] .
- //
- ////////////////////////////////////////////////////////////////////
- #ifndef PHYSICSOBJECTCOLLECTION_H
- #define PHYSICSOBJECTCOLLECTION_H
- #include "pandabase.h"
- #include "physicsObject.h"
- #include "pointerToArray.h"
- ////////////////////////////////////////////////////////////////////
- // Class : PhysicsObjectCollection
- // Description : This is a set of zero or more PhysicsObjects. It's handy
- // for returning from functions that need to return
- // multiple PhysicsObjects.
- ////////////////////////////////////////////////////////////////////
- class EXPCL_PANDAPHYSICS PhysicsObjectCollection {
- PUBLISHED:
- PhysicsObjectCollection();
- PhysicsObjectCollection(const PhysicsObjectCollection ©);
- void operator = (const PhysicsObjectCollection ©);
- INLINE ~PhysicsObjectCollection();
-
- void add_physics_object(PT(PhysicsObject) physics_object);
- bool remove_physics_object(PT(PhysicsObject) physics_object);
- void add_physics_objects_from(const PhysicsObjectCollection &other);
- void remove_physics_objects_from(const PhysicsObjectCollection &other);
- void remove_duplicate_physics_objects();
- bool has_physics_object(PT(PhysicsObject) physics_object) const;
- void clear();
- bool is_empty() const;
- int get_num_physics_objects() const;
- PT(PhysicsObject) get_physics_object(int index) const;
- PT(PhysicsObject) operator [] (int index) const;
- void output(ostream &out) const;
- void write(ostream &out, int indent_level = 0) const;
- private:
- typedef PTA(PT(PhysicsObject)) PhysicsObjects;
- PhysicsObjects _physics_objects;
- };
- /*
- INLINE ostream &operator << (ostream &out, const PhysicsObjectCollection &col) {
- col.output(out);
- return out;
- }
- */
- #include "physicsObjectCollection.I"
- #endif
|