compile errors

This commit is contained in:
David Rose 2007-05-31 23:54:36 +00:00
parent 81b52e39c5
commit 0284746bc2
4 changed files with 9 additions and 17 deletions

View File

@ -242,11 +242,9 @@ make_child_dynamic(const string &name) {
// This may be called before binding the animation to a // This may be called before binding the animation to a
// character to replace certain joints with // character to replace certain joints with
// frozen ones. // frozen ones.
//
// Returns NULL if the named child cannot be found.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void AnimGroup:: void AnimGroup::
void make_child_fixed(const string &name, const LMatrix4f &mat) { make_child_fixed(const string &name, const LMatrix4f &mat) {
Children::iterator ci; Children::iterator ci;
for (ci = _children.begin(); ci != _children.end(); ++ci) { for (ci = _children.begin(); ci != _children.end(); ++ci) {
AnimGroup *child = (*ci); AnimGroup *child = (*ci);
@ -256,13 +254,13 @@ void 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(this, name, mat); new AnimChannelMatrixFixed(name, mat);
new_child = new_mchild; new_child = new_mchild;
} }
if (new_child != (AnimGroup *)NULL) { if (new_child != (AnimGroup *)NULL) {
new_child->_children.swap(child->_children); new_child->_children.swap(child->_children);
nassertr(_children.back() == new_child, NULL); nassertv(_children.back() == new_child);
// The new child was appended to the end of our children list // The new child was appended to the end of our children list
// by its constructor. Reposition it to replace the original // by its constructor. Reposition it to replace the original
@ -291,17 +289,10 @@ void make_child_fixed(const string &name, const LMatrix4f &mat) {
} }
new_children.swap(_children); new_children.swap(_children);
} }
return new_child;
} }
} }
AnimGroup *result = child->make_child_fixed(name, mat); child->make_child_fixed(name, mat);
if (result != (AnimGroup *)NULL) {
return result;
} }
}
return (AnimGroup *)NULL;
} }

View File

@ -24,6 +24,7 @@
#include "typedWritableReferenceCount.h" #include "typedWritableReferenceCount.h"
#include "pointerTo.h" #include "pointerTo.h"
#include "namable.h" #include "namable.h"
#include "luse.h"
class AnimBundle; class AnimBundle;
class BamReader; class BamReader;

View File

@ -209,12 +209,11 @@ get_control_effect(AnimControl *control) const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: PartBundle::freeze_joint // Function: PartBundle::freeze_joint
// Access: Protected // Access: Published
// Description: stores away a joint freeze for bind time // Description: stores away a joint freeze for bind time
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE void PartBundle:: INLINE void PartBundle::
freeze_joint(string jointName, LMatrix4f transform) const freeze_joint(const string &jointName, const LMatrix4f &transform) {
{
JointTransform jt; JointTransform jt;
jt.name=jointName; jt.name=jointName;
jt.transform=transform; jt.transform=transform;

View File

@ -109,7 +109,8 @@ PUBLISHED:
INLINE int get_num_nodes() const; INLINE int get_num_nodes() const;
INLINE PartBundleNode *get_node(int n) const; INLINE PartBundleNode *get_node(int n) const;
INLINE void freeze_joint(string jointName, LMatrix4f transform) const; INLINE void freeze_joint(const string &jointName,
const LMatrix4f &transform);
void clear_control_effects(); void clear_control_effects();
INLINE void set_control_effect(AnimControl *control, float effect); INLINE void set_control_effect(AnimControl *control, float effect);