Browse Source

*** empty log message ***

Mike Goslin 25 năm trước cách đây
mục cha
commit
b0b30ad602
2 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 15 0
      panda/src/physics/physicalNode.cxx
  2. 1 0
      panda/src/physics/physicalNode.h

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

@@ -75,6 +75,21 @@ add_physicals_from(const PhysicalNode &other) {
     (*last)->_physical_node = this;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function : remove_physical
+//       Access : public
+//  Description : remove operation
+////////////////////////////////////////////////////////////////////
+void PhysicalNode::
+remove_physical(Physical *physical) {
+  vector< PT(Physical) >::iterator found;
+  PT(Physical) ptp = physical;
+  found = find(_physicals.begin(), _physicals.end(), ptp);
+  if (found == _physicals.end())
+    return;
+  _physicals.erase(found);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function : remove_physical
 //       Access : public

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

@@ -39,6 +39,7 @@ PUBLISHED:
   INLINE void add_physical(Physical *physical);
 
   void add_physicals_from(const PhysicalNode &other);
+  void remove_physical(Physical *physical);
   void remove_physical(int index);
 
 public: