15 #include "forceNode.h"
16 #include "config_physics.h"
68 _forces.insert(_forces.end(),
69 other._forces.begin(), other._forces.end());
72 for (; last != _forces.end(); last++) {
73 (*last)->_force_node =
this;
74 (*last)->_force_node_path = node_path;
87 found = find(_forces.begin(), _forces.end(), ptbf);
88 if (found == _forces.end())
100 nassertv(index >= 0 && index <= (
int)_forces.size());
103 remove = _forces.begin() + index;
104 (*remove)->_force_node = (
ForceNode *) NULL;
105 (*remove)->_force_node_path =
NodePath();
107 _forces.erase(
remove);
118 PandaNode::output(out);
119 out<<
" ("<<_forces.size()<<
" forces)";
131 out.width(indent); out<<
""<<
"_forces ("<<_forces.size()<<
" forces)"<<
"\n";
132 for (ForceVector::const_iterator i=_forces.begin();
135 out.width(indent+2); out<<
""; out<<
"(id "<<&(*i)<<
" "<<(*i)->is_linear()<<
")\n";
148 write(ostream &out,
unsigned int indent)
const {
150 out.width(indent); out<<
""; out<<
"ForceNode (id "<<
this<<
") ";
154 PandaNode::write(out, indent+4);
A basic node of the scene graph or data graph.
virtual PandaNode * make_copy() const
dynamic child copy
void remove_force(BaseForce *f)
remove operation
A force that lives in the scene graph and is therefore subject to local coordinate systems...
pure virtual base class for all forces that could POSSIBLY exist.
This is our own Panda specialization on the default STL vector.
ForceNode(const string &name)
default constructor
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
virtual ~ForceNode()
destructor
TypeHandle is the identifier used to differentiate C++ class types.
void add_forces_from(const ForceNode &other)
append operation
virtual void write_forces(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...