Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PhysicsObjectCollection Class Reference

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

#include <pandadoc.hpp>

Public Member Functions

 __init__ ()
 
 __init__ (const PhysicsObjectCollection copy)
 
 addPhysicsObject (PhysicsObject physics_object)
 Adds a new PhysicsObject to the collection.
 
 addPhysicsObjectsFrom (const PhysicsObjectCollection 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+ (const PhysicsObjectCollection other)
 
PhysicsObjectCollection operator+= (const PhysicsObjectCollection other)
 
PhysicsObjectCollection operator= (const PhysicsObjectCollection copy)
 
PhysicsObject operator[] (int index)
 
 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 (const PhysicsObjectCollection 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, 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.

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

◆ operator+=()

◆ operator=()

◆ operator[]()

PhysicsObject operator[] ( int index)

◆ 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.