Panda3D
Public Member Functions | List of all members
PhysicsObjectCollection Class Reference

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

Public Member Functions

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

Detailed Description

This is a set of zero or more PhysicsObjects.

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

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const PhysicsObjectCollection  copy)

◆ addPhysicsObject()

addPhysicsObject ( PhysicsObject  physics_object)

Adds a new PhysicsObject to the collection.

◆ addPhysicsObjectsFrom()

addPhysicsObjectsFrom ( const PhysicsObjectCollection  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()

clear ( )

Removes all PhysicsObjects from the collection.

◆ getNumPhysicsObjects()

int getNumPhysicsObjects ( )

Returns the number of PhysicsObjects in the collection.

◆ getPhysicsObject()

PhysicsObject getPhysicsObject ( int  index)

Returns the nth PhysicsObject in the collection.

◆ getPhysicsObjects()

list getPhysicsObjects ( )

◆ hasPhysicsObject()

bool hasPhysicsObject ( PhysicsObject  physics_object)

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

◆ isEmpty()

bool isEmpty ( )

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

◆ operator []()

PhysicsObject operator [] ( int  index)

◆ operator+()

◆ operator+=()

PhysicsObjectCollection operator+= ( const PhysicsObjectCollection  other)

◆ operator=()

◆ output()

output ( Ostream  out)

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

◆ removeDuplicatePhysicsObjects()

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.

◆ removePhysicsObject()

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()

removePhysicsObjectsFrom ( const PhysicsObjectCollection  other)

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

◆ size()

int size ( )

Returns the number of physics objects in the collection.

This is the same thing as get_num_physics_objects().

◆ write()

write ( Ostream  out,
int  indent_level 
)

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