Browse Source

add EggData::merge

David Rose 23 years ago
parent
commit
baf7c22921
2 changed files with 13 additions and 0 deletions
  1. 12 0
      panda/src/egg/eggData.cxx
  2. 1 0
      panda/src/egg/eggData.h

+ 12 - 0
panda/src/egg/eggData.cxx

@@ -157,6 +157,18 @@ read(istream &in) {
   return (egg_error_count() == 0);
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: EggData::merge
+//       Access: Public
+//  Description: Appends the other egg structure to the end of this
+//               one.  The other egg structure is invalidated.
+////////////////////////////////////////////////////////////////////
+void EggData::
+merge(EggData &other) {
+  other.set_coordinate_system(get_coordinate_system());
+  steal_children(other);
+}
+
 
 ////////////////////////////////////////////////////////////////////
 //     Function: EggData::load_externals

+ 1 - 0
panda/src/egg/eggData.h

@@ -54,6 +54,7 @@ public:
 
   bool read(Filename filename);
   bool read(istream &in);
+  void merge(EggData &other);
 
   bool load_externals(const DSearchPath &searchpath = DSearchPath());
   int collapse_equivalent_textures();