Panda3D
 All Classes Functions Variables Enumerations
drawCullHandler.cxx
00001 // Filename: drawCullHandler.cxx
00002 // Created by:  drose (25Feb02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "drawCullHandler.h"
00016 #include "cullableObject.h"
00017 #include "geom.h"
00018 #include "transformState.h"
00019 #include "renderState.h"
00020 #include "graphicsStateGuardianBase.h"
00021 #include "config_pgraph.h"
00022 
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: DrawCullHandler::record_object
00026 //       Access: Public, Virtual
00027 //  Description: This callback function is intended to be overridden
00028 //               by a derived class.  This is called as each Geom is
00029 //               discovered by the CullTraverser.
00030 ////////////////////////////////////////////////////////////////////
00031 void DrawCullHandler::
00032 record_object(CullableObject *object, const CullTraverser *traverser) {
00033   // Munge vertices as needed for the GSG's requirements, and the
00034   // object's current state.
00035   bool force = !_gsg->get_effective_incomplete_render();
00036   Thread *current_thread = traverser->get_current_thread();
00037 
00038   if (object->munge_geom(_gsg, _gsg->get_geom_munger(object->_state, current_thread), traverser, force)) {
00039     // Now we can immediately draw the object.
00040     draw(object, _gsg, force, current_thread);
00041   }
00042 
00043   // Dispense with the object.
00044   delete object;
00045 }
 All Classes Functions Variables Enumerations