Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# Physical Class Reference

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

Inheritance diagram for Physical:

List of all members.

## Public Member Functions
| Physical (Physical const copy)
| copy constructor (note- does deep copy of pn's) but does NOT attach itself to its template's physicsmanager.
| Physical (int total_objects, bool pre_alloc)
| Default Constructor.
| Physical ()
| Default Constructor.
| Physical (int total_objects)
| Default Constructor.
| 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 ()
PhysicsObjectCollection const | 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>.
| output ()
| 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)
| Write a string representation of this instance to <out>.
| write ()
| Write a string representation of this instance to <out>.
| write (ostream out, unsigned int indent)
| Write a string representation of this instance to <out>.
| writeAngularForces (ostream out)
| Write a string representation of this instance to <out>.
| writeAngularForces (ostream out, unsigned int indent)
| Write a string representation of this instance to <out>.
| writeAngularForces ()
| Write a string representation of this instance to <out>.
| writeLinearForces (ostream out, unsigned int indent)
| Write a string representation of this instance to <out>.
| writeLinearForces (ostream out)
| Write a string representation of this instance to <out>.
| writeLinearForces ()
| Write a string representation of this instance to <out>.
| writePhysicsObjects (ostream out)
| Write a string representation of this instance to <out>.
| writePhysicsObjects (ostream out, unsigned int indent)
| Write a string representation of this instance to <out>.
| writePhysicsObjects ()
| Write a string representation of this instance to <out>.
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

Defines a set of physically modeled attributes.

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

## Constructor & Destructor Documentation

Physical | ( | Physical const | copy | ) |

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

Physical | ( | 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.

Physical | ( | int | total_objects | ) |

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.

Physical | ( |  | ) |

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.

## Member Function Documentation

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 TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented in ParticleSystem.

LinearForce getLinearForce | ( | int | index | ) |

list getLinearForces | ( |  | ) |

int getNumAngularForces | ( |  | ) |

int getNumLinearForces | ( |  | ) |

PhysicsObjectCollection const 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>.

output | ( |  | ) |

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,
|  | unsigned int | indent
| ) |  |

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

write | ( |  | ) |

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

write | ( | ostream | out | ) |

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

Reimplemented in ParticleSystem.

writeAngularForces | ( | ostream | out,
|  | unsigned int | indent
| ) |  |

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

writeAngularForces | ( |  | ) |

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

writeAngularForces | ( | ostream | out | ) |

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

writeLinearForces | ( | ostream | out | ) |

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

writeLinearForces | ( |  | ) |

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

writeLinearForces | ( | ostream | out,
|  | unsigned int | indent
| ) |  |

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

writePhysicsObjects | ( | ostream | out | ) |

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

writePhysicsObjects | ( |  | ) |

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

writePhysicsObjects | ( | ostream | out,
|  | unsigned int | indent
| ) |  |

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

All Classes Namespaces Functions Variables Enumerations Enumerator Properties