update pointers properly when flattening characters

This commit is contained in:
David Rose 2007-02-14 17:24:51 +00:00
parent 0d45017e81
commit 62d290fd00
4 changed files with 18 additions and 3 deletions

View File

@ -318,7 +318,18 @@ control_activated(AnimControl *control) {
}
}
////////////////////////////////////////////////////////////////////
// Function: PartBundle::set_node
// Access: Protected, Virtual
// Description: Changes the PartBundleNode pointer associated with
// the PartBundle. Normally called only by the
// PartBundleNode itself, for instance when the bundle
// is flattened with another node.
////////////////////////////////////////////////////////////////////
void PartBundle::
set_node(PartBundleNode *node) {
_node = node;
}
////////////////////////////////////////////////////////////////////
// Function: PartBundle::do_set_control_effect

View File

@ -127,6 +127,9 @@ public:
// bunch of friends.
virtual void control_activated(AnimControl *control);
protected:
virtual void set_node(PartBundleNode *node);
private:
class CData;

View File

@ -76,7 +76,7 @@ void PartBundleNode::
add_bundle(PartBundle *bundle) {
nassertv(bundle->_node == NULL);
_bundles.push_back(bundle);
bundle->_node = this;
bundle->set_node(this);
}
////////////////////////////////////////////////////////////////////
@ -91,7 +91,7 @@ steal_bundles(PartBundleNode *other) {
for (bi = other->_bundles.begin(); bi != other->_bundles.end(); ++bi) {
PartBundle *bundle = (*bi);
_bundles.push_back(bundle);
bundle->_node = this;
bundle->set_node(this);
}
other->_bundles.clear();
}

View File

@ -140,6 +140,7 @@ private:
static TypeHandle _type_handle;
friend class Character;
friend class CharacterJointBundle;
};
#include "partGroup.I"