Panda3D
|
Defines a set of physically modeled attributes. More...
#include <pandadoc.hpp>
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. | |
__init__ (int total_objects, bool pre_alloc) | |
Default Constructor The idea here is that most physicals will NOT be collections of sets (i.e. | |
addAngularForce (AngularForce f) | |
Adds an angular force to the force list. | |
addLinearForce (LinearForce f) | |
Adds a linear force to the force list. | |
addPhysicsObject (PhysicsObject po) | |
Adds an object to the physics object vector. | |
clearAngularForces () | |
Erases the angular force list. | |
clearLinearForces () | |
Erases the linear force list. | |
clearPhysicsObjects () | |
Erases the object list. | |
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. | |
output (Ostream out) | |
Write a string representation of this instance to <out>. | |
removeAngularForce (AngularForce f) | |
removes an angular force from the force list | |
removeLinearForce (LinearForce f) | |
removes a linear force from the force list | |
setViscosity (float viscosity) | |
Set the local viscosity. | |
write (Ostream out, int indent) | |
Write a string representation of this instance to <out>. | |
writeAngularForces (Ostream out, int indent) | |
Write a string representation of this instance to <out>. | |
writeLinearForces (Ostream out, int indent) | |
Write a string representation of this instance to <out>. | |
writePhysicsObjects (Ostream out, int indent) | |
Write a string representation of this instance to <out>. | |
![]() | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
![]() | |
int | getRefCount () |
Returns the current reference count. | |
ref () | |
Explicitly increments the reference count. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | unref () |
Explicitly decrements the reference count. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
![]() | |
static TypeHandle | getClassType () |
Public Attributes | |
PointerToAngularForce | angular_forces [] |
PointerToLinearForce | linear_forces [] |
PhysicsObjectCollection | objects |
float | viscosity |
Get the local viscosity. | |
![]() | |
TypeHandle | type |
Returns the TypeHandle representing this object's type. | |
![]() | |
int | ref_count |
The current reference count. | |
Defines a set of physically modeled attributes.
If you want physics applied to your class, derive it from this.
__init__ | ( | const Physical | copy | ) |
copy constructor (note- does deep copy of pn's) but does NOT attach itself to its template's physicsmanager.
__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 | ( | AngularForce | f | ) |
Adds an angular force to the force list.
addLinearForce | ( | LinearForce | f | ) |
Adds a linear force to the force list.
addPhysicsObject | ( | PhysicsObject | po | ) |
Adds an object to the physics object vector.
clearAngularForces | ( | ) |
Erases the angular force list.
clearLinearForces | ( | ) |
Erases the linear force list.
clearPhysicsObjects | ( | ) |
Erases the object list.
AngularForce getAngularForce | ( | int | index | ) |
list getAngularForces | ( | ) |
|
static |
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.
output | ( | Ostream | out | ) |
Write a string representation of this instance to <out>.
removeAngularForce | ( | AngularForce | f | ) |
removes an angular force from the force list
removeLinearForce | ( | LinearForce | f | ) |
removes a linear force from the force list
setViscosity | ( | float | viscosity | ) |
Set the local viscosity.
write | ( | Ostream | out, |
int | indent ) |
Write a string representation of this instance to <out>.
writeAngularForces | ( | Ostream | out, |
int | indent ) |
Write a string representation of this instance to <out>.
writeLinearForces | ( | Ostream | out, |
int | indent ) |
Write a string representation of this instance to <out>.
writePhysicsObjects | ( | Ostream | out, |
int | indent ) |
Write a string representation of this instance to <out>.
PointerToAngularForce angular_forces[] |
PointerToLinearForce linear_forces[] |
PhysicsObjectCollection objects |
float viscosity |
Get the local viscosity.