Panda3D
Public Member Functions | Static Public Member Functions | List of all members
Physical Class Reference

Defines a set of physically modeled attributes. More...

Inheritance diagram for Physical:
TypedReferenceCount TypedObject ReferenceCount ParticleSystem Particles

Public Member Functions

 __init__ (const Physical copy)
 copy constructor (note- does deep copy of pn's) but does NOT attach itself to its template's physicsmanager. More...
 
 __init__ (int total_objects, bool pre_alloc)
 Default Constructor The idea here is that most physicals will NOT be collections of sets (i.e. More...
 
 addAngularForce (AngularForce f)
 Adds an angular force to the force list. More...
 
 addLinearForce (LinearForce f)
 Adds a linear force to the force list. More...
 
 addPhysicsObject (PhysicsObject po)
 Adds an object to the physics object vector. More...
 
 clearAngularForces ()
 Erases the angular force list. More...
 
 clearLinearForces ()
 Erases the linear force list. More...
 
 clearPhysicsObjects ()
 Erases the object list. More...
 
AngularForce getAngularForce (int index)
 
list getAngularForces ()
 
LinearForce getLinearForce (int index)
 
list getLinearForces ()
 
int getNumAngularForces ()
 
int getNumLinearForces ()
 
const PhysicsObjectCollection getObjects ()
 
PhysicsObject getPhysBody ()
 
PhysicalNode getPhysicalNode ()
 
NodePath getPhysicalNodePath ()
 
PhysicsManager getPhysicsManager ()
 
float getViscosity ()
 Get the local viscosity. More...
 
 output (Ostream out)
 Write a string representation of this instance to <out>. More...
 
 removeAngularForce (AngularForce f)
 removes an angular force from the force list More...
 
 removeLinearForce (LinearForce f)
 removes a linear force from the force list More...
 
 setViscosity (float viscosity)
 Set the local viscosity. More...
 
 write (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writeAngularForces (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writeLinearForces (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
 writePhysicsObjects (Ostream out, int indent)
 Write a string representation of this instance to <out>. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

Detailed Description

Defines a set of physically modeled attributes.

If you want physics applied to your class, derive it from this.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const Physical  copy)

copy constructor (note- does deep copy of pn's) but does NOT attach itself to its template's physicsmanager.

◆ __init__() [2/2]

__init__ ( int  total_objects,
bool  pre_alloc 
)

Default Constructor The idea here is that most physicals will NOT be collections of sets (i.e.

particle systems and whatever else). Because of this, the default constructor, unless otherwise specified, will automatically allocate and initialize one PhysicalObject. This makes it easier for high-level work.

pre-alloc is ONLY for multiple-object physicals, and if true, fills the physics_object vector with dead nodes, pre-allocating for the speed end of the speed-vs-overhead deal.

◆ addAngularForce()

addAngularForce ( AngularForce  f)

Adds an angular force to the force list.

◆ addLinearForce()

addLinearForce ( LinearForce  f)

Adds a linear force to the force list.

◆ addPhysicsObject()

addPhysicsObject ( PhysicsObject  po)

Adds an object to the physics object vector.

◆ clearAngularForces()

clearAngularForces ( )

Erases the angular force list.

◆ clearLinearForces()

clearLinearForces ( )

Erases the linear force list.

◆ clearPhysicsObjects()

clearPhysicsObjects ( )

Erases the object list.

◆ getAngularForce()

AngularForce getAngularForce ( int  index)

◆ getAngularForces()

list getAngularForces ( )

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getLinearForce()

LinearForce getLinearForce ( int  index)

◆ getLinearForces()

list getLinearForces ( )

◆ getNumAngularForces()

int getNumAngularForces ( )

◆ getNumLinearForces()

int getNumLinearForces ( )

◆ getObjects()

const PhysicsObjectCollection getObjects ( )

◆ getPhysBody()

PhysicsObject getPhysBody ( )

◆ getPhysicalNode()

PhysicalNode getPhysicalNode ( )

◆ getPhysicalNodePath()

NodePath getPhysicalNodePath ( )

◆ getPhysicsManager()

PhysicsManager getPhysicsManager ( )

◆ getViscosity()

float getViscosity ( )

Get the local viscosity.

◆ output()

output ( Ostream  out)

Write a string representation of this instance to <out>.

◆ removeAngularForce()

removeAngularForce ( AngularForce  f)

removes an angular force from the force list

◆ removeLinearForce()

removeLinearForce ( LinearForce  f)

removes a linear force from the force list

◆ setViscosity()

setViscosity ( float  viscosity)

Set the local viscosity.

◆ write()

write ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writeAngularForces()

writeAngularForces ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writeLinearForces()

writeLinearForces ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.

◆ writePhysicsObjects()

writePhysicsObjects ( Ostream  out,
int  indent 
)

Write a string representation of this instance to <out>.