fix flattening 2-d objects

This commit is contained in:
David Rose 2007-01-17 02:27:36 +00:00
parent a08852341c
commit 28110b2774
3 changed files with 16 additions and 3 deletions

View File

@ -426,9 +426,8 @@ flatten_siblings(PandaNode *parent_node, int combine_siblings_bits) {
do_flatten_siblings(parent_node, child1, child2);
if (new_node != (PandaNode *)NULL) {
// We successfully collapsed a node.
(*ai1_hold) = new_node;
nodes.erase(ai2_hold);
nodes.erase(ai1_hold);
nodes.push_back(new_node);
ai1 = nodes.begin();
ai2 = nodes.end();
num_nodes++;

View File

@ -122,6 +122,19 @@ make_copy() const {
return new PGEntry(*this);
}
////////////////////////////////////////////////////////////////////
// Function: PGEntry::xform
// Access: Public, Virtual
// Description: Transforms the contents of this node by the indicated
// matrix, if it means anything to do so. For most
// kinds of nodes, this does nothing.
////////////////////////////////////////////////////////////////////
void PGEntry::
xform(const LMatrix4f &mat) {
PGItem::xform(mat);
_text_render_root.set_mat(_text_render_root.get_mat() * mat);
}
////////////////////////////////////////////////////////////////////
// Function: PGEntry::cull_callback
// Access: Protected, Virtual

View File

@ -51,7 +51,8 @@ protected:
PGEntry(const PGEntry &copy);
public:
virtual PandaNode *make_copy() const;
virtual PandaNode *make_copy() const;
virtual void xform(const LMatrix4f &mat);
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
virtual void press(const MouseWatcherParameter &param, bool background);