panda3d.physics.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) → None

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) → None

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) → None

Adds an angular force to the force list

addLinearForce(f: LinearForce) → None

Adds a linear force to the force list

addPhysicsObject(po: PhysicsObject) → None

Adds an object to the physics object vector

clearAngularForces() → None

Erases the angular force list

clearLinearForces() → None

Erases the linear force list

clearPhysicsObjects() → None

Erases the object list

getAngularForce(index: int) → AngularForce
Return type

AngularForce

getAngularForces() → list
static getClassType() → TypeHandle
Return type

TypeHandle

getLinearForce(index: int) → LinearForce
Return type

LinearForce

getLinearForces() → list
getNumAngularForces() → int
getNumLinearForces() → int
getObjects() → PhysicsObjectCollection
Return type

PhysicsObjectCollection

getPhysBody() → PhysicsObject
Return type

PhysicsObject

getPhysicalNode() → PhysicalNode
Return type

PhysicalNode

getPhysicalNodePath() → NodePath
Return type

NodePath

getPhysicsManager() → PhysicsManager

helpers

Return type

PhysicsManager

getViscosity() → float

Get the local viscosity.

output(out: ostream) → None

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

removeAngularForce(f: AngularForce) → None

removes an angular force from the force list

removeLinearForce(f: LinearForce) → None

removes a linear force from the force list

setViscosity(viscosity: float) → None

Set the local viscosity.

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

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

writeAngularForces(out: ostream, indent: int) → None

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

writeLinearForces(out: ostream, indent: int) → None

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

writePhysicsObjects(out: ostream, indent: int) → None

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