22 nassertv(p && p->_physics_manager == NULL);
23 p->_physics_manager =
this;
24 PhysicalsVector::iterator found;
25 found = find(_physicals.begin(), _physicals.end(), p);
26 if (found == _physicals.end()) {
27 _physicals.push_back(p);
39 LinearForceVector::iterator found;
41 found = find(_linear_forces.begin(), _linear_forces.end(), ptlf);
42 if (found == _linear_forces.end()) {
43 _linear_forces.push_back(f);
54 cerr<<
"attach_physicalnode (aka attachPhysicalnode) has been"
55 <<
"replaced with attach_physical_node (aka attachPhysicalNode)."
56 <<
" Please change the spelling of the function in your code."
69 for (
int i = 0; i < p->get_num_physicals(); ++i) {
81 _linear_forces.erase(_linear_forces.begin(), _linear_forces.end());
92 AngularForceVector::iterator found;
94 found = find(_angular_forces.begin(), _angular_forces.end(), ptaf);
95 if (found == _angular_forces.end())
96 _angular_forces.push_back(f);
106 _angular_forces.erase(_angular_forces.begin(), _angular_forces.end());
116 _physicals.erase(_physicals.begin(), _physicals.end());
126 _viscosity=viscosity;
147 _linear_integrator = i;
158 _angular_integrator = i;
Pure virtual base class for physical modeling.
void add_angular_force(AngularForce *f)
Adds a global angular force to the physics manager.
void clear_angular_forces()
Resets the physics manager force vector.
void add_linear_force(LinearForce *f)
Adds a global linear force to the physics manager.
void attach_physical(Physical *p)
Registers a Physical class with the manager.
void clear_linear_forces()
Resets the physics manager force vector.
PN_stdfloat get_viscosity() const
Get the global viscosity.
void set_viscosity(PN_stdfloat viscosity)
Set the global viscosity.
A force that acts on a PhysicsObject by way of an Integrator.
void attach_linear_integrator(LinearIntegrator *i)
Hooks a linear integrator into the manager.
Graph node that encapsulated a series of physical objects.
void attach_angular_integrator(AngularIntegrator *i)
Hooks an angular integrator into the manager.
Defines a set of physically modeled attributes.
void attach_physicalnode(PhysicalNode *p)
Please call attach_physical_node instead.
pure virtual parent of all quat-based forces.
Pure virtual base class for physical modeling.
void clear_physicals()
Resets the physics manager objects vector.
void attach_physical_node(PhysicalNode *p)
Registers a physicalnode with the manager.