57 _forces.insert(_forces.end(),
58 other._forces.begin(), other._forces.end());
61 for (; last != _forces.end(); last++) {
62 (*last)->_force_node =
this;
63 (*last)->_force_node_path = node_path;
72 nassertv(index < _forces.size());
74 _forces[index]->_force_node =
nullptr;
75 _forces[index]->_force_node_path.clear();
76 _forces[index] = force;
77 force->_force_node =
this;
78 force->_force_node_path =
NodePath(
this);
86 if (index > _forces.size()) {
87 index = _forces.size();
90 _forces.insert(_forces.begin() + index, force);
91 force->_force_node =
this;
92 force->_force_node_path =
NodePath(
this);
102 found = find(_forces.begin(), _forces.end(), ptbf);
103 if (found == _forces.end())
105 _forces.erase(found);
113 nassertv(index <= _forces.size());
116 remove = _forces.begin() + index;
117 (*remove)->_force_node =
nullptr;
118 (*remove)->_force_node_path =
NodePath();
120 _forces.erase(remove);
128 PandaNode::output(out);
129 out<<
" ("<<_forces.size()<<
" forces)";
138 out.width(
indent); out<<
""<<
"_forces ("<<_forces.size()<<
" forces)"<<
"\n";
139 for (ForceVector::const_iterator i=_forces.begin();
142 out.width(
indent+2); out<<
""; out<<
"(id "<<&(*i)<<
" "<<(*i)->is_linear()<<
")\n";
154 out.width(
indent); out<<
""; out<<
"ForceNode (id "<<
this<<
") ";
158 PandaNode::write(out,
indent+4);