From 48aaf1aae15098810406aa25f4795bb9258acbad Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 6 Sep 2001 22:07:42 +0000 Subject: [PATCH] fix bug with tflips loading out-of-order --- panda/src/egg2sg/eggLoader.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/panda/src/egg2sg/eggLoader.cxx b/panda/src/egg2sg/eggLoader.cxx index ea92352844..4c1f4eb13f 100644 --- a/panda/src/egg2sg/eggLoader.cxx +++ b/panda/src/egg2sg/eggLoader.cxx @@ -1244,6 +1244,19 @@ make_node(EggPrimitive *egg_prim, NamedNode *parent) { assert(!parent->is_of_type(GeomNode::get_class_type())); if (egg_prim->cleanup()) { + if (parent->is_of_type(SwitchNode::get_class_type())) { + // If we're putting a primitive under a SwitchNode of some kind, + // its exact position within the group is relevant, so we need + // to create a placeholder now. + NamedNode *group = new NamedNode(egg_prim->get_name()); + make_nonindexed_primitive(egg_prim, group); + return new RenderRelation(parent, group); + } + + // Otherwise, we don't really care what the position of this + // primitive is within its parent's list of children, and in fact + // we want to allow it to be combined with other polygons added to + // the same parent. make_nonindexed_primitive(egg_prim, parent); } return (RenderRelation *)NULL;