panda3d.physics.PhysicsObjectCollection

class PhysicsObjectCollection

This is a set of zero or more PhysicsObjects. It’s handy for returning from functions that need to return multiple PhysicsObjects.

Inheritance diagram

Inheritance diagram of PhysicsObjectCollection

__init__() → None
__init__(copy: PhysicsObjectCollection) → None
assign(copy: PhysicsObjectCollection) → PhysicsObjectCollection
Return type

PhysicsObjectCollection

addPhysicsObject(physics_object: PhysicsObject) → None

Adds a new PhysicsObject to the collection.

removePhysicsObject(physics_object: PhysicsObject) → bool

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.

addPhysicsObjectsFrom(other: PhysicsObjectCollection) → None

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.

removePhysicsObjectsFrom(other: PhysicsObjectCollection) → None

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

removeDuplicatePhysicsObjects() → None

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.

hasPhysicsObject(physics_object: PhysicsObject) → bool

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

clear() → None

Removes all PhysicsObjects from the collection.

isEmpty() → bool

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

getNumPhysicsObjects() → int

Returns the number of PhysicsObjects in the collection.

getPhysicsObject(index: int) → PhysicsObject

Returns the nth PhysicsObject in the collection.

Return type

PhysicsObject

size() → int

Returns the number of physics objects in the collection. This is the same thing as getNumPhysicsObjects().

output(out: ostream) → None

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

write(out: ostream, indent_level: int) → None

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

getPhysicsObjects() → list