more bugfixes

This commit is contained in:
David Rose 2007-06-01 18:35:29 +00:00
parent fc9f9fe225
commit 5a8d63954b
3 changed files with 23 additions and 1 deletions

View File

@ -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 // Function: AnimChannelMatrixFixed::Constructor
// Access: Public // Access: Public

View File

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

View File

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