From b0b30ad6024d7366f38efa3c2fa3e358272766b9 Mon Sep 17 00:00:00 2001 From: Mike Goslin Date: Fri, 26 Jan 2001 20:27:41 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/physics/physicalNode.cxx | 15 +++++++++++++++ panda/src/physics/physicalNode.h | 1 + 2 files changed, 16 insertions(+) diff --git a/panda/src/physics/physicalNode.cxx b/panda/src/physics/physicalNode.cxx index c62fa4b3b6..81dcb2bff9 100644 --- a/panda/src/physics/physicalNode.cxx +++ b/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 diff --git a/panda/src/physics/physicalNode.h b/panda/src/physics/physicalNode.h index 1f4b627cad..c9f7fb17b8 100644 --- a/panda/src/physics/physicalNode.h +++ b/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: