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);
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
remove_force
remove operation
A basic node of the scene graph or data graph.
ForceNode(const std::string &name)
default constructor
A force that lives in the scene graph and is therefore subject to local coordinate systems.
insert_force
insert operation
pure virtual base class for all forces that could POSSIBLY exist.
This is our own Panda specialization on the default STL vector.
virtual void write_forces(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
virtual PandaNode * make_copy() const
dynamic child copy
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
set_force
replace operation
virtual ~ForceNode()
destructor
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
TypeHandle is the identifier used to differentiate C++ class types.
void add_forces_from(const ForceNode &other)
append operation
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.