Panda3D
 All Classes Functions Variables Enumerations
colorAttrib.I
00001 // Filename: colorAttrib.I
00002 // Created by:  drose (22Feb02)
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: ColorAttrib::Constructor
00018 //       Access: Private
00019 //  Description: Use ColorAttrib::make() to construct a new
00020 //               ColorAttrib object.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE ColorAttrib::
00023 ColorAttrib(ColorAttrib::Type type, const LColor &color) :
00024   _type(type),
00025   _color(color)
00026 {
00027   quantize_color();
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: ColorAttrib::get_color_type
00032 //       Access: Published
00033 //  Description: Returns the type of color specified by this
00034 //               ColorAttrib.  The options are:
00035 //
00036 //                 T_vertex - use the vertex color specified in the
00037 //                 geometry itself.
00038 //
00039 //                 T_flat - use the color specified in this
00040 //                 ColorAttrib for all geometry.  You can get this
00041 //                 color via get_color().
00042 //
00043 //                 T_off - use the color white.
00044 ////////////////////////////////////////////////////////////////////
00045 INLINE ColorAttrib::Type ColorAttrib::
00046 get_color_type() const {
00047   return _type;
00048 }
00049 
00050 ////////////////////////////////////////////////////////////////////
00051 //     Function: ColorAttrib::get_color
00052 //       Access: Published
00053 //  Description: If the type is T_flat or T_off, this returns the
00054 //               color that will be applied to geometry.  If the type
00055 //               is T_vertex, this is meaningless.
00056 ////////////////////////////////////////////////////////////////////
00057 INLINE const LColor &ColorAttrib::
00058 get_color() const {
00059   return _color;
00060 }
 All Classes Functions Variables Enumerations