mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
update pointers properly when flattening characters
This commit is contained in:
parent
0d45017e81
commit
62d290fd00
@ -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
|
// Function: PartBundle::do_set_control_effect
|
||||||
|
@ -127,6 +127,9 @@ public:
|
|||||||
// bunch of friends.
|
// bunch of friends.
|
||||||
virtual void control_activated(AnimControl *control);
|
virtual void control_activated(AnimControl *control);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void set_node(PartBundleNode *node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class CData;
|
class CData;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void PartBundleNode::
|
|||||||
add_bundle(PartBundle *bundle) {
|
add_bundle(PartBundle *bundle) {
|
||||||
nassertv(bundle->_node == NULL);
|
nassertv(bundle->_node == NULL);
|
||||||
_bundles.push_back(bundle);
|
_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) {
|
for (bi = other->_bundles.begin(); bi != other->_bundles.end(); ++bi) {
|
||||||
PartBundle *bundle = (*bi);
|
PartBundle *bundle = (*bi);
|
||||||
_bundles.push_back(bundle);
|
_bundles.push_back(bundle);
|
||||||
bundle->_node = this;
|
bundle->set_node(this);
|
||||||
}
|
}
|
||||||
other->_bundles.clear();
|
other->_bundles.clear();
|
||||||
}
|
}
|
||||||
|
@ -140,6 +140,7 @@ private:
|
|||||||
static TypeHandle _type_handle;
|
static TypeHandle _type_handle;
|
||||||
|
|
||||||
friend class Character;
|
friend class Character;
|
||||||
|
friend class CharacterJointBundle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "partGroup.I"
|
#include "partGroup.I"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user