PhysicsObjectCollection
from panda3d.physics import PhysicsObjectCollection
- class PhysicsObjectCollection
Bases:
This is a set of zero or more
PhysicsObjects. It’s handy for returning from functions that need to return multiplePhysicsObjects.Inheritance diagram
- __add__(other: PhysicsObjectCollection) PhysicsObjectCollection
- __getitem__(index: int) PhysicsObject
- __iadd__(other: PhysicsObjectCollection) PhysicsObjectCollection
- __init__()
- __init__(copy: PhysicsObjectCollection)
- addPhysicsObject(physics_object: PhysicsObject)
Adds a new
PhysicsObjectto the collection.
- addPhysicsObjectsFrom(other: PhysicsObjectCollection)
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.
- assign(copy: PhysicsObjectCollection) PhysicsObjectCollection
- clear()
Removes all
PhysicsObjectsfrom the collection.
- getNumPhysicsObjects() int
Returns the number of
PhysicsObjectsin the collection.
- getPhysicsObject(index: int) PhysicsObject
Returns the nth
PhysicsObjectin the collection.
- hasPhysicsObject(physics_object: PhysicsObject) bool
Returns true if the indicated
PhysicsObjectappears in this collection, false otherwise.
- isEmpty() bool
Returns true if there are no
PhysicsObjectsin the collection, false otherwise.
- output(out: panda3d.core.ostream)
Writes a brief one-line description of the
PhysicsObjectCollectionto the indicated output stream.
- removeDuplicatePhysicsObjects()
Removes any duplicate entries of the same
PhysicsObjectson this collection. If aPhysicsObjectappears multiple times, the first appearance is retained; subsequent appearances are removed.
- removePhysicsObject(physics_object: PhysicsObject) bool
Removes the indicated
PhysicsObjectfrom the collection. Returns true if the physics_object was removed, false if it was not a member of the collection.
- removePhysicsObjectsFrom(other: PhysicsObjectCollection)
Removes from this collection all of the
PhysicsObjectslisted in the other collection.
- size() int
Returns the number of physics objects in the collection. This is the same thing as
getNumPhysicsObjects().
- write(out: panda3d.core.ostream, indent_level: int)
Writes a complete multi-line description of the
PhysicsObjectCollectionto the indicated output stream.
