mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
remove circular reference in Physical::_physical_node_path.
This commit is contained in:
parent
3ddad3e2d2
commit
ece7ed20e1
@ -148,7 +148,7 @@ get_physical_node() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE NodePath Physical::
|
INLINE NodePath Physical::
|
||||||
get_physical_node_path() const {
|
get_physical_node_path() const {
|
||||||
return _physical_node_path;
|
return NodePath(_physical_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -49,5 +49,4 @@ INLINE void PhysicalNode::
|
|||||||
add_physical(Physical *physical) {
|
add_physical(Physical *physical) {
|
||||||
_physicals.push_back(physical);
|
_physicals.push_back(physical);
|
||||||
physical->_physical_node = this;
|
physical->_physical_node = this;
|
||||||
physical->_physical_node_path = NodePath(this);
|
|
||||||
}
|
}
|
||||||
|
@ -69,10 +69,8 @@ add_physicals_from(const PhysicalNode &other) {
|
|||||||
_physicals.insert(_physicals.end(),
|
_physicals.insert(_physicals.end(),
|
||||||
other._physicals.begin(), other._physicals.end());
|
other._physicals.begin(), other._physicals.end());
|
||||||
|
|
||||||
NodePath node_path(this);
|
|
||||||
for (; last != _physicals.end(); last++) {
|
for (; last != _physicals.end(); last++) {
|
||||||
(*last)->_physical_node = this;
|
(*last)->_physical_node = this;
|
||||||
(*last)->_physical_node_path = node_path;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +101,6 @@ remove_physical(int index) {
|
|||||||
pvector< PT(Physical) >::iterator remove;
|
pvector< PT(Physical) >::iterator remove;
|
||||||
remove = _physicals.begin() + index;
|
remove = _physicals.begin() + index;
|
||||||
(*remove)->_physical_node = (PhysicalNode *) NULL;
|
(*remove)->_physical_node = (PhysicalNode *) NULL;
|
||||||
(*remove)->_physical_node_path = NodePath();
|
|
||||||
|
|
||||||
_physicals.erase(remove);
|
_physicals.erase(remove);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user