Physical

from panda3d.physics import Physical
class Physical

Bases: TypedReferenceCount

Defines a set of physically modeled attributes. If you want physics applied to your class, derive it from this.

Inheritance diagram

Inheritance diagram of Physical

__init__(copy: Physical)

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

__init__(total_objects: int, pre_alloc: bool)

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(f: AngularForce)

Adds an angular force to the force list

addLinearForce(f: LinearForce)

Adds a linear force to the force list

addPhysicsObject(po: PhysicsObject)

Adds an object to the physics object vector

property angular_forcesSequence[PointerTo_AngularForce]
clearAngularForces()

Erases the angular force list

clearLinearForces()

Erases the linear force list

clearPhysicsObjects()

Erases the object list

getAngularForce(index: int)AngularForce
getAngularForces()list
static getClassType()panda3d.core.TypeHandle
getLinearForce(index: int)LinearForce
getLinearForces()list
getNumAngularForces()int
getNumLinearForces()int
getObjects()PhysicsObjectCollection
getPhysBody()PhysicsObject
getPhysicalNode()PhysicalNode
getPhysicalNodePath()panda3d.core.NodePath
getPhysicsManager()PhysicsManager

helpers

getViscosity()float

Get the local viscosity.

property linear_forcesSequence[PointerTo_LinearForce]
property objectsPhysicsObjectCollection
output(out: panda3d.core.ostream)

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

removeAngularForce(f: AngularForce)

removes an angular force from the force list

removeLinearForce(f: LinearForce)

removes a linear force from the force list

setViscosity(viscosity: float)

Set the local viscosity.

property viscosityfloat

Get the local viscosity.

write(out: panda3d.core.ostream, indent: int)

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

writeAngularForces(out: panda3d.core.ostream, indent: int)

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

writeLinearForces(out: panda3d.core.ostream, indent: int)

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

writePhysicsObjects(out: panda3d.core.ostream, indent: int)

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