00001 // Filename: colorAttrib.I 00002 // Created by: drose (22Feb02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: ColorAttrib::Constructor 00022 // Access: Private 00023 // Description: Use ColorAttrib::make() to construct a new 00024 // ColorAttrib object. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE ColorAttrib:: 00027 ColorAttrib(ColorAttrib::Type type, const Colorf &color) : 00028 _type(type), 00029 _color(color) 00030 { 00031 } 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Function: ColorAttrib::get_color_type 00035 // Access: Published 00036 // Description: Returns the type of color specified by this 00037 // ColorAttrib. The options are: 00038 // 00039 // T_vertex - use the vertex color specified in the 00040 // geometry itself. 00041 // 00042 // T_flat - use the color specified in this 00043 // ColorAttrib for all geometry. You can get this 00044 // color via get_color(). 00045 // 00046 // T_off - do not issue any color commands at all. 00047 // This is generally used only in contexts where the 00048 // color is meaningless, e.g. when drawing directly to 00049 // the depth buffer. 00050 //////////////////////////////////////////////////////////////////// 00051 INLINE ColorAttrib::Type ColorAttrib:: 00052 get_color_type() const { 00053 return _type; 00054 } 00055 00056 //////////////////////////////////////////////////////////////////// 00057 // Function: ColorAttrib::get_color 00058 // Access: Published 00059 // Description: If the type is T_flat, this returns the color that 00060 // will be applied to geometry. If the type is anything 00061 // else, this is meaningless. 00062 //////////////////////////////////////////////////////////////////// 00063 INLINE const Colorf &ColorAttrib:: 00064 get_color() const { 00065 return _color; 00066 }