Browse Source

more bugfixes

David Rose 18 years ago
parent
commit
5a8d63954b

+ 19 - 0
panda/src/chan/animChannelMatrixFixed.cxx

@@ -41,6 +41,25 @@ AnimChannelMatrixFixed(AnimGroup *parent, const AnimChannelMatrixFixed &copy) :
 {
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: AnimChannelMatrixFixed::Constructor
+//       Access: Public
+//  Description: This flavor creates an AnimChannelMatrixFixed that
+//               *is* in a hierarchy.
+////////////////////////////////////////////////////////////////////
+AnimChannelMatrixFixed::
+AnimChannelMatrixFixed(AnimGroup *parent, const string &name, 
+                       const LMatrix4f &value)
+  : AnimChannelFixed<ACMatrixSwitchType>(parent, name, value)
+{
+  // Decompose the matrix into components in case we will be blending.
+  decompose_matrix(_value, _scale, _shear, _hpr, _pos);
+  compose_matrix(_value_no_scale_shear, LVecBase3f(1.0f, 1.0f, 1.0f),
+                 _hpr, _pos);
+
+  _quat.set_hpr(_hpr);
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: AnimChannelMatrixFixed::Constructor
 //       Access: Public

+ 1 - 0
panda/src/chan/animChannelMatrixFixed.h

@@ -36,6 +36,7 @@ protected:
   AnimChannelMatrixFixed(AnimGroup *parent, const AnimChannelMatrixFixed &copy);
 
 public:
+  AnimChannelMatrixFixed(AnimGroup *parent, const string &name, const LMatrix4f &value);
   AnimChannelMatrixFixed(const string &name, const LMatrix4f &value);
 
 

+ 3 - 1
panda/src/chan/animGroup.cxx

@@ -254,7 +254,7 @@ make_child_fixed(const string &name, const LMatrix4f &mat) {
       if (child->is_of_type(AnimChannelMatrix::get_class_type())) {
         AnimChannelMatrix *mchild = DCAST(AnimChannelMatrix, child);
         AnimChannelMatrixFixed *new_mchild = 
-          new AnimChannelMatrixFixed(name, mat);
+          new AnimChannelMatrixFixed(this, name, mat);
         new_child = new_mchild;
       } 
 
@@ -289,6 +289,8 @@ make_child_fixed(const string &name, const LMatrix4f &mat) {
           }
           new_children.swap(_children);
         }
+
+        return;
       }
     }
     child->make_child_fixed(name, mat);