cullHandler.I 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Filename: cullHandler.I
  2. // Created by: drose (04Mar02)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. ////////////////////////////////////////////////////////////////////
  19. // Function: CullHandler::draw
  20. // Access: Public, Static
  21. // Description: Draws the indicated CullableObject, with full support
  22. // for decals if they are attached to the object. The
  23. // appropriate state is set on the GSG before drawing
  24. // the object.
  25. ////////////////////////////////////////////////////////////////////
  26. INLINE void CullHandler::
  27. draw(CullableObject *object, GraphicsStateGuardianBase *gsg) {
  28. if (object->_next != (CullableObject *)NULL) {
  29. draw_with_decals(object, gsg);
  30. } else {
  31. gsg->set_state_and_transform(object->_state, object->_transform);
  32. object->_geom->draw(gsg);
  33. }
  34. }