19 nassertv(p && p->_physics_manager ==
nullptr);
20 p->_physics_manager =
this;
21 PhysicalsVector::iterator found;
22 found = find(_physicals.begin(), _physicals.end(), p);
23 if (found == _physicals.end()) {
24 _physicals.push_back(p);
34 LinearForceVector::iterator found;
36 found = find(_linear_forces.begin(), _linear_forces.end(), ptlf);
37 if (found == _linear_forces.end()) {
38 _linear_forces.push_back(f);
47 std::cerr<<
"attach_physicalnode (aka attachPhysicalnode) has been" 48 <<
"replaced with attach_physical_node (aka attachPhysicalNode)." 49 <<
" Please change the spelling of the function in your code." 60 for (
size_t i = 0; i < p->get_num_physicals(); ++i) {
70 _linear_forces.erase(_linear_forces.begin(), _linear_forces.end());
79 AngularForceVector::iterator found;
81 found = find(_angular_forces.begin(), _angular_forces.end(), ptaf);
82 if (found == _angular_forces.end())
83 _angular_forces.push_back(f);
91 _angular_forces.erase(_angular_forces.begin(), _angular_forces.end());
99 _physicals.erase(_physicals.begin(), _physicals.end());
107 _viscosity=viscosity;
124 _linear_integrator = i;
133 _angular_integrator = i;
PN_stdfloat get_viscosity() const
Get the global viscosity.
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.
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.