Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# PhysicsObjectCollection Class Reference

This is a set of zero or more PhysicsObjects. More...

List of all members.

## Public Member Functions
| PhysicsObjectCollection ()
| PhysicsObjectCollection (PhysicsObjectCollection const copy)
| addPhysicsObject (PhysicsObject physics_object)
| Adds a new PhysicsObject to the collection.
| addPhysicsObjectsFrom (PhysicsObjectCollection const other)
| Adds all the PhysicsObjects indicated in the other collection to this collection.
| clear ()
| Removes all PhysicsObjects from the collection.
int | getNumPhysicsObjects ()
| Returns the number of PhysicsObjects in the collection.
PhysicsObject | getPhysicsObject (int index)
| Returns the nth PhysicsObject in the collection.
list | getPhysicsObjects ()
bool | hasPhysicsObject (PhysicsObject physics_object)
| Returns true if the indicated PhysicsObject appears in this collection, false otherwise.
bool | isEmpty ()
| Returns true if there are no PhysicsObjects in the collection, false otherwise.
PhysicsObjectCollection | operator+ (PhysicsObjectCollection const other)
| Returns a PhysicsObjectCollection representing the concatenation of the two lists.
PhysicsObjectCollection | operator+= (PhysicsObjectCollection const other)
| Appends the other list onto the end of this one.
PhysicsObjectCollection | operator= (PhysicsObjectCollection const copy)
PhysicsObject | operator[] (int index)
| Returns the nth PhysicsObject in the collection.
| output (ostream out)
| Writes a brief one-line description of the PhysicsObjectCollection to the indicated output stream.
| removeDuplicatePhysicsObjects ()
| Removes any duplicate entries of the same PhysicsObjects on this collection.
bool | removePhysicsObject (PhysicsObject physics_object)
| Removes the indicated PhysicsObject from the collection.
| removePhysicsObjectsFrom (PhysicsObjectCollection const other)
| Removes from this collection all of the PhysicsObjects listed in the other collection.
int | size ()
| Returns the number of physics objects in the collection.
| write (ostream out)
| Writes a complete multi-line description of the PhysicsObjectCollection to the indicated output stream.
| write (ostream out, int indent_level)
| Writes a complete multi-line description of the PhysicsObjectCollection to the indicated output stream.

## Detailed Description

This is a set of zero or more PhysicsObjects.

It's handy for returning from functions that need to return multiple PhysicsObjects.

## Constructor & Destructor Documentation

PhysicsObjectCollection | ( |  | ) |

PhysicsObjectCollection | ( | PhysicsObjectCollection const | copy | ) |

## Member Function Documentation

addPhysicsObject | ( | PhysicsObject | physics_object | ) |

Adds a new PhysicsObject to the collection.

addPhysicsObjectsFrom | ( | PhysicsObjectCollection const | other | ) |

Adds all the PhysicsObjects indicated 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.

clear | ( |  | ) |

Removes all PhysicsObjects from the collection.

int getNumPhysicsObjects | ( |  | ) |

Returns the number of PhysicsObjects in the collection.

PhysicsObject getPhysicsObject | ( | int | index | ) |

Returns the nth PhysicsObject in the collection.

list getPhysicsObjects | ( |  | ) |

bool hasPhysicsObject | ( | PhysicsObject | physics_object | ) |

Returns true if the indicated PhysicsObject appears in this collection, false otherwise.

bool isEmpty | ( |  | ) |

Returns true if there are no PhysicsObjects in the collection, false otherwise.

PhysicsObjectCollection operator+ | ( | PhysicsObjectCollection const | other | ) |

Returns a PhysicsObjectCollection representing the concatenation of the two lists.

PhysicsObjectCollection operator+= | ( | PhysicsObjectCollection const | other | ) |

Appends the other list onto the end of this one.

PhysicsObjectCollection operator= | ( | PhysicsObjectCollection const | copy | ) |

PhysicsObject operator[] | ( | int | index | ) |

Returns the nth PhysicsObject in the collection.

This is the same as get_physics_object(), but it may be a more convenient way to access it.

output | ( | ostream | out | ) |

Writes a brief one-line description of the PhysicsObjectCollection to the indicated output stream.

removeDuplicatePhysicsObjects | ( |  | ) |

Removes any duplicate entries of the same PhysicsObjects on this collection.

If a PhysicsObject appears multiple times, the first appearance is retained; subsequent appearances are removed.

bool removePhysicsObject | ( | PhysicsObject | physics_object | ) |

Removes the indicated PhysicsObject from the collection.

Returns true if the physics_object was removed, false if it was not a member of the collection.

removePhysicsObjectsFrom | ( | PhysicsObjectCollection const | other | ) |

Removes from this collection all of the PhysicsObjects listed in the other collection.

int size | ( |  | ) |

Returns the number of physics objects in the collection.

This is the same thing as get_num_physics_objects().

write | ( | ostream | out | ) |

Writes a complete multi-line description of the PhysicsObjectCollection to the indicated output stream.

write | ( | ostream | out,
|  | int | indent_level
| ) |  |

Writes a complete multi-line description of the PhysicsObjectCollection to the indicated output stream.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties