00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "ribStuffTraverser.h"
00020 #include "ribGraphicsStateGuardian.h"
00021
00022 #include <textureTransition.h>
00023 #include <lightTransition.h>
00024 #include <geomNode.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033 bool RibStuffTraverser::
00034 reached_node(Node *node, AllTransitionsWrapper &state, NullLevelState &) {
00035 if (node->is_of_type(GeomNode::get_class_type())) {
00036 const TextureTransition *tex_attrib;
00037 if (!get_transition_into(tex_attrib, state)) {
00038 if (tex_attrib->is_on()) {
00039 _gsg->define_texture(tex_attrib->get_texture());
00040 }
00041 }
00042
00043 const LightTransition *light_attrib;
00044 if (!get_transition_into(light_attrib, state)) {
00045 LightTransition::const_iterator li;
00046 for (li = light_attrib->begin(); li != light_attrib->end(); ++li) {
00047 _gsg->define_light(*li);
00048 }
00049 }
00050 }
00051 return true;
00052 }