Panda3D
 All Classes Functions Variables Enumerations
fltVertex.I
00001 // Filename: fltVertex.I
00002 // Created by:  drose (30Aug00)
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: FltVertex::has_color
00018 //       Access: Public
00019 //  Description: Returns true if the vertex has a primary color
00020 //               indicated, false otherwise.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE bool FltVertex::
00023 has_color() const {
00024   // Even if the no_color bit is not set, if the color_index is -1,
00025   // the vertex doesn't have a color (unless we've got packed color).
00026   return ((_flags & F_no_color) == 0 &&
00027           (_color_index != -1 || ((_flags & F_packed_color) != 0)));
00028 }
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //     Function: FltVertex::set_color
00032 //       Access: Public
00033 //  Description: Sets the color of the vertex, using the packed
00034 //               color convention.  The alpha component is ignored.
00035 ////////////////////////////////////////////////////////////////////
00036 INLINE void FltVertex::
00037 set_color(const LColor &color) {
00038   set_rgb(LRGBColor(color[0], color[1], color[2]));
00039 }
 All Classes Functions Variables Enumerations