Panda3D
 All Classes Functions Variables Enumerations
colorAttrib.I
1 // Filename: colorAttrib.I
2 // Created by: drose (22Feb02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: ColorAttrib::Constructor
18 // Access: Private
19 // Description: Use ColorAttrib::make() to construct a new
20 // ColorAttrib object.
21 ////////////////////////////////////////////////////////////////////
22 INLINE ColorAttrib::
23 ColorAttrib(ColorAttrib::Type type, const LColor &color) :
24  _type(type),
25  _color(color)
26 {
27  quantize_color();
28 }
29 
30 ////////////////////////////////////////////////////////////////////
31 // Function: ColorAttrib::get_color_type
32 // Access: Published
33 // Description: Returns the type of color specified by this
34 // ColorAttrib. The options are:
35 //
36 // T_vertex - use the vertex color specified in the
37 // geometry itself.
38 //
39 // T_flat - use the color specified in this
40 // ColorAttrib for all geometry. You can get this
41 // color via get_color().
42 //
43 // T_off - use the color white.
44 ////////////////////////////////////////////////////////////////////
45 INLINE ColorAttrib::Type ColorAttrib::
46 get_color_type() const {
47  return _type;
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: ColorAttrib::get_color
52 // Access: Published
53 // Description: If the type is T_flat or T_off, this returns the
54 // color that will be applied to geometry. If the type
55 // is T_vertex, this is meaningless.
56 ////////////////////////////////////////////////////////////////////
57 INLINE const LColor &ColorAttrib::
58 get_color() const {
59  return _color;
60 }
Type get_color_type() const
Returns the type of color specified by this ColorAttrib.
Definition: colorAttrib.I:46
const LColor & get_color() const
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
Definition: colorAttrib.I:58
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111