Browse Source

chan: disable AnimControl copy ctor and assignment operators

rdb 7 years ago
parent
commit
eac88fc64a
2 changed files with 5 additions and 3 deletions
  1. 2 2
      panda/src/chan/animControl.cxx
  2. 3 1
      panda/src/chan/animControl.h

+ 2 - 2
panda/src/chan/animControl.cxx

@@ -32,14 +32,14 @@ AnimControl(const std::string &name, PartBundle *part,
   Namable(name),
   Namable(name),
   _pending_lock(name),
   _pending_lock(name),
   _pending_cvar(_pending_lock),
   _pending_cvar(_pending_lock),
-  _bound_joints(BitArray::all_on())
+  _bound_joints(BitArray::all_on()),
+  _part(part)
 {
 {
 #ifdef DO_MEMORY_USAGE
 #ifdef DO_MEMORY_USAGE
   MemoryUsage::update_type(this, get_class_type());
   MemoryUsage::update_type(this, get_class_type());
 #endif
 #endif
 
 
   _pending = true;
   _pending = true;
-  _part = part;
   _anim = nullptr;
   _anim = nullptr;
   _channel_index = -1;
   _channel_index = -1;
   set_frame_rate(frame_rate);
   set_frame_rate(frame_rate);

+ 3 - 1
panda/src/chan/animControl.h

@@ -39,6 +39,8 @@ class EXPCL_PANDA_CHAN AnimControl : public TypedReferenceCount, public AnimInte
 public:
 public:
   AnimControl(const std::string &name, PartBundle *part,
   AnimControl(const std::string &name, PartBundle *part,
               double frame_rate, int num_frames);
               double frame_rate, int num_frames);
+  AnimControl(const AnimControl &copy) = delete;
+
   void setup_anim(PartBundle *part, AnimBundle *anim, int channel_index,
   void setup_anim(PartBundle *part, AnimBundle *anim, int channel_index,
                   const BitArray &bound_joints);
                   const BitArray &bound_joints);
   void set_bound_joints(const BitArray &bound_joints);
   void set_bound_joints(const BitArray &bound_joints);
@@ -82,7 +84,7 @@ private:
   // This is a PT(PartGroup) instead of a PT(PartBundle), just because we
   // This is a PT(PartGroup) instead of a PT(PartBundle), just because we
   // can't include partBundle.h for circular reasons.  But it actually keeps a
   // can't include partBundle.h for circular reasons.  But it actually keeps a
   // pointer to a PartBundle.
   // pointer to a PartBundle.
-  PT(PartGroup) _part;
+  const PT(PartGroup) _part;
   PT(AnimBundle) _anim;
   PT(AnimBundle) _anim;
   int _channel_index;
   int _channel_index;