Panda3D
|
00001 // Filename: shaderAttrib.I 00002 // Created by: sshodhan (10Jul04) 00003 // Updated by: weifengh, PandaSE(15Apr10) 00004 // 00005 //////////////////////////////////////////////////////////////////// 00006 // 00007 // PANDA 3D SOFTWARE 00008 // Copyright (c) Carnegie Mellon University. All rights reserved. 00009 // 00010 // All use of this software is subject to the terms of the revised BSD 00011 // license. You should have received a copy of this license along 00012 // with this source code in a file named "LICENSE." 00013 // 00014 //////////////////////////////////////////////////////////////////// 00015 00016 00017 //////////////////////////////////////////////////////////////////// 00018 // Function: ShaderAttrib::Constructor 00019 // Access: Private 00020 // Description: 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE ShaderAttrib:: 00023 ShaderAttrib() : 00024 _shader(NULL), 00025 _shader_priority(0), 00026 _auto_shader(false), 00027 _has_shader(false), 00028 _flags(0), 00029 _has_flags(0), 00030 _instance_count(0), 00031 _auto_normal_on(false), 00032 _auto_glow_on(false), 00033 _auto_gloss_on(false), 00034 _auto_ramp_on(false), 00035 _auto_shadow_on(false) 00036 { 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: ShaderAttrib::Copy Constructor 00041 // Access: Private 00042 // Description: 00043 //////////////////////////////////////////////////////////////////// 00044 INLINE ShaderAttrib:: 00045 ShaderAttrib(const ShaderAttrib ©) : 00046 _shader(copy._shader), 00047 _shader_priority(copy._shader_priority), 00048 _auto_shader(copy._auto_shader), 00049 _has_shader(copy._has_shader), 00050 _flags(copy._flags), 00051 _has_flags(copy._has_flags), 00052 _instance_count(copy._instance_count), 00053 _auto_normal_on(copy._auto_normal_on), 00054 _auto_glow_on(copy._auto_glow_on), 00055 _auto_gloss_on(copy._auto_gloss_on), 00056 _auto_ramp_on(copy._auto_ramp_on), 00057 _auto_shadow_on(copy._auto_shadow_on), 00058 _inputs(copy._inputs) 00059 { 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: ShaderAttrib::has_shader 00064 // Access: Published 00065 // Description: If true, the shader field of this attribute overrides 00066 // the shader field of the parent attribute. 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE bool ShaderAttrib:: 00069 has_shader() const { 00070 return _has_shader; 00071 } 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: ShaderAttrib::auto_shader 00075 // Access: Published 00076 // Description: If true, then this ShaderAttrib does not contain an 00077 // explicit shader - instead, it requests the automatic 00078 // generation of a shader. 00079 //////////////////////////////////////////////////////////////////// 00080 INLINE bool ShaderAttrib:: 00081 auto_shader() const { 00082 return _auto_shader; 00083 } 00084 00085 //////////////////////////////////////////////////////////////////// 00086 // Function: ShaderAttrib::get_shader_priority 00087 // Access: Published 00088 // Description: 00089 //////////////////////////////////////////////////////////////////// 00090 INLINE int ShaderAttrib:: 00091 get_shader_priority() const { 00092 return _shader_priority; 00093 } 00094 00095 //////////////////////////////////////////////////////////////////// 00096 // Function: ShaderAttrib::get_instance_count 00097 // Access: Published 00098 // Description: Returns the number of geometry instances. A value 00099 // of 0 means not to use instancing at all. 00100 //////////////////////////////////////////////////////////////////// 00101 INLINE int ShaderAttrib:: 00102 get_instance_count() const { 00103 return _instance_count; 00104 } 00105 00106 //////////////////////////////////////////////////////////////////// 00107 // Function: ShaderAttrib::get_flag 00108 // Access: Published 00109 // Description: 00110 //////////////////////////////////////////////////////////////////// 00111 INLINE bool ShaderAttrib:: 00112 get_flag(int index) const { 00113 return (_flags & (1<<index)) ? true:false; 00114 } 00115 00116 //weifengh 00117 //////////////////////////////////////////////////////////////////// 00118 // Function: ShaderAttrib::auto_normal_on 00119 // Access: Published 00120 // Description: 00121 //////////////////////////////////////////////////////////////////// 00122 INLINE bool ShaderAttrib:: 00123 auto_normal_on() const { 00124 return _auto_normal_on; 00125 } 00126 00127 //////////////////////////////////////////////////////////////////// 00128 // Function: ShaderAttrib::auto_glow_on 00129 // Access: Published 00130 // Description: 00131 //////////////////////////////////////////////////////////////////// 00132 INLINE bool ShaderAttrib:: 00133 auto_glow_on() const { 00134 return _auto_glow_on; 00135 } 00136 00137 //////////////////////////////////////////////////////////////////// 00138 // Function: ShaderAttrib::auto_gloss_on 00139 // Access: Published 00140 // Description: 00141 //////////////////////////////////////////////////////////////////// 00142 INLINE bool ShaderAttrib:: 00143 auto_gloss_on() const { 00144 return _auto_gloss_on; 00145 } 00146 00147 //////////////////////////////////////////////////////////////////// 00148 // Function: ShaderAttrib::auto_ramp_on 00149 // Access: Published 00150 // Description: 00151 //////////////////////////////////////////////////////////////////// 00152 INLINE bool ShaderAttrib:: 00153 auto_ramp_on() const { 00154 return _auto_ramp_on; 00155 } 00156 00157 //////////////////////////////////////////////////////////////////// 00158 // Function: ShaderAttrib::auto_shadow_on 00159 // Access: Published 00160 // Description: 00161 //////////////////////////////////////////////////////////////////// 00162 INLINE bool ShaderAttrib:: 00163 auto_shadow_on() const { 00164 return _auto_shadow_on; 00165 }