Panda3D
 All Classes Functions Variables Enumerations
texGenAttrib.I
00001 // Filename: texGenAttrib.I
00002 // Created by:  masad (21Jun04)
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 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: TexGenAttrib::Constructor
00018 //       Access: Protected
00019 //  Description: Use TexGenAttrib::make() to construct a new
00020 //               TexGenAttrib object.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE TexGenAttrib::
00023 TexGenAttrib() :
00024   _num_point_sprites(0),
00025   _num_light_vectors(0),
00026   _point_geom_rendering(0),
00027   _geom_rendering(0)
00028 {
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: TexGenAttrib::Copy Constructor
00033 //       Access: Protected
00034 //  Description: Use TexGenAttrib::make() to construct a new
00035 //               TexGenAttrib object.
00036 ////////////////////////////////////////////////////////////////////
00037 INLINE TexGenAttrib::
00038 TexGenAttrib(const TexGenAttrib &copy) :
00039   _stages(copy._stages),
00040   _no_texcoords(copy._no_texcoords),
00041   _num_point_sprites(copy._num_point_sprites),
00042   _num_light_vectors(copy._num_light_vectors),
00043   _point_geom_rendering(copy._point_geom_rendering),
00044   _geom_rendering(copy._geom_rendering)
00045 {
00046 }
00047 
00048 ////////////////////////////////////////////////////////////////////
00049 //     Function: TexGenAttrib::get_geom_rendering
00050 //       Access: Published
00051 //  Description: Returns the union of the Geom::GeomRendering bits
00052 //               that will be required once this TexGenAttrib is
00053 //               applied to a geom which includes the indicated
00054 //               geom_rendering bits.
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE int TexGenAttrib::
00057 get_geom_rendering(int geom_rendering) const {
00058   if ((geom_rendering & Geom::GR_point) != 0) {
00059     geom_rendering |= _point_geom_rendering;
00060   }
00061 
00062   return geom_rendering | _geom_rendering;
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function: TexGenAttrib::get_light_vectors
00067 //       Access: Public
00068 //  Description: Returns the set of TextureStages that have
00069 //               M_light_vector in effect, as well as the associated
00070 //               Lights.
00071 ////////////////////////////////////////////////////////////////////
00072 INLINE const TexGenAttrib::LightVectors &TexGenAttrib::
00073 get_light_vectors() const {
00074   return _light_vectors;
00075 }
00076 
00077 ////////////////////////////////////////////////////////////////////
00078 //     Function: TexGenAttrib::ModeDef::Constructor
00079 //       Access: Public
00080 //  Description: 
00081 ////////////////////////////////////////////////////////////////////
00082 INLINE TexGenAttrib::ModeDef::
00083 ModeDef() :
00084   _mode(M_off)
00085 {
00086 }
00087 
00088 ////////////////////////////////////////////////////////////////////
00089 //     Function: TexGenAttrib::ModeDef::compare_to
00090 //       Access: Public
00091 //  Description: 
00092 ////////////////////////////////////////////////////////////////////
00093 INLINE int TexGenAttrib::ModeDef::
00094 compare_to(const TexGenAttrib::ModeDef &other) const {
00095   if (_mode != other._mode) {
00096     return (int)_mode < (int)other._mode ? -1 : 1;
00097   }
00098   int compare = _light.compare_to(other._light);
00099   if (compare != 0) {
00100     return compare;
00101   }
00102   compare = strcmp(_source_name.c_str(), other._source_name.c_str());
00103   if (compare != 0) {
00104     return compare;
00105   }
00106   compare = _constant_value.compare_to(other._constant_value);
00107   return compare;
00108 }
00109 
 All Classes Functions Variables Enumerations