00001 // Filename: fltGeometry.I 00002 // Created by: drose (28Feb01) 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: FltGeometry::has_texture 00022 // Access: Public 00023 // Description: Returns true if the face has a texture applied, false 00024 // otherwise. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE bool FltGeometry:: 00027 has_texture() const { 00028 return (_texture_index >= 0 && _header->has_texture(_texture_index)); 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: FltGeometry::get_texture 00033 // Access: Public 00034 // Description: Returns the texture applied to this face, or NULL if 00035 // no texture was applied. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE FltTexture *FltGeometry:: 00038 get_texture() const { 00039 return _header->get_texture(_texture_index); 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: FltGeometry::has_material 00044 // Access: Public 00045 // Description: Returns true if the face has a material applied, false 00046 // otherwise. 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE bool FltGeometry:: 00049 has_material() const { 00050 return (_material_index >= 0 && _header->has_material(_material_index)); 00051 } 00052 00053 //////////////////////////////////////////////////////////////////// 00054 // Function: FltGeometry::get_material 00055 // Access: Public 00056 // Description: Returns the material applied to this face, or NULL if 00057 // no material was applied. 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE FltMaterial *FltGeometry:: 00060 get_material() const { 00061 return _header->get_material(_material_index); 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: FltGeometry::has_color 00066 // Access: Public 00067 // Description: Returns true if the face has a primary color 00068 // indicated, false otherwise. 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE bool FltGeometry:: 00071 has_color() const { 00072 // Even if the no_color bit is not set, if the color_index is -1, 00073 // the face doesn't have a color (unless we've got packed color). 00074 // On the other hand, if we have a material than we always have 00075 // color. 00076 return ((_flags & F_no_color) == 0 && 00077 (_color_index != -1 || ((_flags & F_packed_color) != 0))) 00078 || has_material(); 00079 }