PhysicsObjectCollection
-
class PhysicsObjectCollection
This is a set of zero or more
PhysicsObjects. It’s handy for returning from functions that need to return multiplePhysicsObjects.Inheritance diagram
-
PhysicsObjectCollection(void)
-
PhysicsObjectCollection(PhysicsObjectCollection const ©)
-
void add_physics_object(PointerTo<PhysicsObject> physics_object)
Adds a new
PhysicsObjectto the collection.
-
void add_physics_objects_from(PhysicsObjectCollection const &other)
Adds all the
PhysicsObjectsindicated in the other collection to this collection. The other physics_objects are simply appended to the end of the physics_objects in this list; duplicates are not automatically removed.
-
void clear(void)
Removes all
PhysicsObjectsfrom the collection.
-
int get_num_physics_objects(void) const
Returns the number of
PhysicsObjectsin the collection.
-
PointerTo<PhysicsObject> get_physics_object(int index) const
Returns the nth
PhysicsObjectin the collection.
-
bool has_physics_object(PointerTo<PhysicsObject> physics_object) const
Returns true if the indicated
PhysicsObjectappears in this collection, false otherwise.
-
bool is_empty(void) const
Returns true if there are no
PhysicsObjectsin the collection, false otherwise.
-
void output(std::ostream &out) const
Writes a brief one-line description of the
PhysicsObjectCollectionto the indicated output stream.
-
void remove_duplicate_physics_objects(void)
Removes any duplicate entries of the same
PhysicsObjectson this collection. If aPhysicsObjectappears multiple times, the first appearance is retained; subsequent appearances are removed.
-
bool remove_physics_object(PointerTo<PhysicsObject> physics_object)
Removes the indicated
PhysicsObjectfrom the collection. Returns true if the physics_object was removed, false if it was not a member of the collection.
-
void remove_physics_objects_from(PhysicsObjectCollection const &other)
Removes from this collection all of the
PhysicsObjectslisted in the other collection.
-
int size(void) const
Returns the number of physics objects in the collection. This is the same thing as
get_num_physics_objects().
-
void write(std::ostream &out, int indent_level = 0) const
Writes a complete multi-line description of the
PhysicsObjectCollectionto the indicated output stream.
-
PhysicsObjectCollection(void)
