34 PandaNode(copy), _physicals(copy._physicals) {
42 PhysicalsVector::iterator it;
43 for (it = _physicals.begin(); it != _physicals.end(); ++it) {
45 nassertd(physical->_physical_node ==
this)
continue;
46 physical->_physical_node =
nullptr;
47 if (physical->_physics_manager !=
nullptr) {
68 _physicals.insert(_physicals.end(),
69 other._physicals.begin(), other._physicals.end());
71 for (; last != _physicals.end(); last++) {
72 (*last)->_physical_node =
this;
81 nassertv(index < _physicals.size());
83 _physicals[index]->_physical_node =
nullptr;
84 _physicals[index] = physical;
85 physical->_physical_node =
this;
93 if (index > _physicals.size()) {
94 index = _physicals.size();
97 _physicals.insert(_physicals.begin() + index, physical);
98 physical->_physical_node =
this;
108 found = find(_physicals.begin(), _physicals.end(), ptp);
109 if (found == _physicals.end()) {
112 _physicals.erase(found);
114 nassertv(ptp->_physical_node ==
this);
115 ptp->_physical_node =
nullptr;
123 nassertv(index <= _physicals.size());
126 remove = _physicals.begin() + index;
127 (*remove)->_physical_node =
nullptr;
129 _physicals.erase(remove);
138 out.width(
indent); out<<
""; out<<
"PhysicalNode:\n";
void add_physicals_from(const PhysicalNode &other)
append operation
A basic node of the scene graph or data graph.
PhysicalNode(const std::string &name)
default constructor
set_physical
replace operation
insert_physical
insert operation
void remove_physical(Physical *p)
takes a physical out of the object list
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
This is our own Panda specialization on the default STL vector.
Graph node that encapsulated a series of physical objects.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
remove_physical
remove operation
Defines a set of physically modeled attributes.
virtual PandaNode * make_copy() const
dynamic child copy
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual ~PhysicalNode()
destructor
TypeHandle is the identifier used to differentiate C++ class types.