Browse Source

remove circular reference in Physical::_physical_node_path.

rdb 13 years ago
parent
commit
ece7ed20e1

+ 1 - 1
panda/src/physics/physical.I

@@ -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);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 0 - 1
panda/src/physics/physicalNode.I

@@ -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);
 }
 }

+ 0 - 3
panda/src/physics/physicalNode.cxx

@@ -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);
 }
 }