Panda3D
 All Classes Functions Variables Enumerations
shaderInput.I
00001 // Filename: shaderInput.I
00002 // Created by: jyelon (01Sep05)
00003 // Updated by: fperazzi, PandaSE (06Apr10)
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 //     Function: ShaderInput::Destructor
00017 //       Access: Public
00018 //  Description: 
00019 ////////////////////////////////////////////////////////////////////
00020 INLINE ShaderInput::
00021 ~ShaderInput()
00022 {
00023 }
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //     Function: ShaderInput::Constructor
00027 //       Access: Published
00028 //  Description: 
00029 ////////////////////////////////////////////////////////////////////
00030 INLINE ShaderInput::
00031 ShaderInput(const InternalName *name, int priority) :
00032   _name(name),
00033   _type(M_invalid),
00034   _priority(priority)
00035 {
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: ShaderInput::Constructor
00040 //       Access: Published
00041 //  Description: 
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE ShaderInput::
00044 ShaderInput(const InternalName *name, Texture *tex, int priority) :
00045   _name(name),
00046   _type(M_texture),
00047   _priority(priority),
00048   _stored_texture(tex)
00049 {
00050 }
00051 
00052 ////////////////////////////////////////////////////////////////////
00053 //     Function: ShaderInput::Constructor
00054 //       Access: Published
00055 //  Description: 
00056 ////////////////////////////////////////////////////////////////////
00057 INLINE ShaderInput::
00058 ShaderInput(const InternalName *name, const NodePath &np, int priority) :
00059   _name(name),
00060   _type(M_nodepath),
00061   _priority(priority),
00062   _stored_nodepath(np)
00063 {
00064 }
00065 
00066 ////////////////////////////////////////////////////////////////////
00067 //     Function: ShaderInput::Constructor
00068 //       Access: Published
00069 //  Description: 
00070 ////////////////////////////////////////////////////////////////////
00071 INLINE ShaderInput::
00072 ShaderInput(const InternalName *name, const PTA_float &ptr, int priority) : 
00073   _name(name),
00074   _type(M_numeric),
00075   _priority(priority),
00076   _stored_ptr(ptr)
00077 {
00078 }
00079 
00080 ////////////////////////////////////////////////////////////////////
00081 //     Function: ShaderInput::Constructor
00082 //       Access: Published
00083 //  Description: 
00084 ////////////////////////////////////////////////////////////////////
00085 INLINE ShaderInput::
00086 ShaderInput(const InternalName *name, const PTA_LVecBase4f &ptr, int priority) : 
00087   _name(name),
00088   _type(M_numeric),
00089   _priority(priority),
00090   _stored_ptr(ptr)
00091 {
00092 }
00093 
00094 ////////////////////////////////////////////////////////////////////
00095 //     Function: ShaderInput::Constructor
00096 //       Access: Published
00097 //  Description: 
00098 ////////////////////////////////////////////////////////////////////
00099 INLINE ShaderInput::
00100 ShaderInput(const InternalName *name, const PTA_LVecBase3f &ptr, int priority) : 
00101   _name(name),
00102   _type(M_numeric),
00103   _priority(priority),
00104   _stored_ptr(ptr)
00105 {
00106 }
00107 
00108 ////////////////////////////////////////////////////////////////////
00109 //     Function: ShaderInput::Constructor
00110 //       Access: Published
00111 //  Description: 
00112 ////////////////////////////////////////////////////////////////////
00113 INLINE ShaderInput::
00114 ShaderInput(const InternalName *name, const PTA_LVecBase2f &ptr, int priority) :
00115   _name(name),
00116   _type(M_numeric),
00117   _priority(priority),
00118   _stored_ptr(ptr)
00119 {
00120 }
00121 
00122 ////////////////////////////////////////////////////////////////////
00123 //     Function: ShaderInput::Constructor
00124 //       Access: Published
00125 //  Description: 
00126 ////////////////////////////////////////////////////////////////////
00127 INLINE ShaderInput::
00128 ShaderInput(const InternalName *name, const LVecBase4f &vec, int priority) :
00129   _name(name),
00130   _type(M_numeric),
00131   _priority(priority),
00132   _stored_ptr(vec),
00133   _stored_vector(LCAST(PN_stdfloat, vec))
00134 {
00135 }
00136 
00137 ////////////////////////////////////////////////////////////////////
00138 //     Function: ShaderInput::Constructor
00139 //       Access: Published
00140 //  Description: 
00141 ////////////////////////////////////////////////////////////////////
00142 INLINE ShaderInput::
00143 ShaderInput(const InternalName *name, const LVecBase3f &vec, int priority) :
00144   _name(name),
00145   _type(M_numeric),
00146   _priority(priority),
00147   _stored_ptr(vec),
00148   _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0)
00149 {
00150 }
00151 
00152 ////////////////////////////////////////////////////////////////////
00153 //     Function: ShaderInput::Constructor
00154 //       Access: Published
00155 //  Description: 
00156 ////////////////////////////////////////////////////////////////////
00157 INLINE ShaderInput::
00158 ShaderInput(const InternalName *name, const LVecBase2f &vec, int priority) :
00159   _name(name),
00160   _type(M_numeric),
00161   _priority(priority),
00162   _stored_ptr(vec),
00163   _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0)
00164 {
00165 }
00166 
00167 ////////////////////////////////////////////////////////////////////
00168 //     Function: ShaderInput::Constructor
00169 //       Access: Published
00170 //  Description: 
00171 ////////////////////////////////////////////////////////////////////
00172 INLINE ShaderInput::
00173 ShaderInput(const InternalName *name, const PTA_LMatrix4f &ptr, int priority) : 
00174   _name(name),
00175   _type(M_numeric),
00176   _priority(priority),
00177   _stored_ptr(ptr)
00178 {
00179 }
00180 
00181 ////////////////////////////////////////////////////////////////////
00182 //     Function: ShaderInput::Constructor
00183 //       Access: Published
00184 //  Description: 
00185 ////////////////////////////////////////////////////////////////////
00186 INLINE ShaderInput::
00187 ShaderInput(const InternalName *name, const PTA_LMatrix3f &ptr, int priority) : 
00188   _name(name),
00189   _type(M_numeric),
00190   _priority(priority),
00191   _stored_ptr(ptr)
00192 {
00193 }
00194 
00195 ////////////////////////////////////////////////////////////////////
00196 //     Function: ShaderInput::Constructor
00197 //       Access: Published
00198 //  Description: 
00199 ////////////////////////////////////////////////////////////////////
00200 INLINE ShaderInput::
00201 ShaderInput(const InternalName *name, const LMatrix4f &mat, int priority) :
00202   _name(name),
00203   _type(M_numeric),
00204   _priority(priority),
00205   _stored_ptr(mat)
00206 {
00207 }
00208 
00209 ////////////////////////////////////////////////////////////////////
00210 //     Function: ShaderInput::Constructor
00211 //       Access: Published
00212 //  Description: 
00213 ////////////////////////////////////////////////////////////////////
00214 INLINE ShaderInput::
00215 ShaderInput(const InternalName *name, const LMatrix3f &mat, int priority) :
00216   _name(name),
00217   _type(M_numeric),
00218   _priority(priority),
00219   _stored_ptr(mat)
00220 {
00221 }
00222 
00223 ////////////////////////////////////////////////////////////////////
00224 //     Function: ShaderInput::Constructor
00225 //       Access: Published
00226 //  Description: 
00227 ////////////////////////////////////////////////////////////////////
00228 INLINE ShaderInput::
00229 ShaderInput(const InternalName *name, const PTA_double &ptr, int priority) : 
00230   _name(name),
00231   _type(M_numeric),
00232   _priority(priority),
00233   _stored_ptr(ptr)
00234 {
00235 }
00236 
00237 ////////////////////////////////////////////////////////////////////
00238 //     Function: ShaderInput::Constructor
00239 //       Access: Published
00240 //  Description: 
00241 ////////////////////////////////////////////////////////////////////
00242 INLINE ShaderInput::
00243 ShaderInput(const InternalName *name, const PTA_LVecBase4d &ptr, int priority) : 
00244   _name(name),
00245   _type(M_numeric),
00246   _priority(priority),
00247   _stored_ptr(ptr)
00248 {
00249 }
00250 
00251 ////////////////////////////////////////////////////////////////////
00252 //     Function: ShaderInput::Constructor
00253 //       Access: Published
00254 //  Description: 
00255 ////////////////////////////////////////////////////////////////////
00256 INLINE ShaderInput::
00257 ShaderInput(const InternalName *name, const PTA_LVecBase3d &ptr, int priority) : 
00258   _name(name),
00259   _type(M_numeric),
00260   _priority(priority),
00261   _stored_ptr(ptr)
00262 {
00263 }
00264 
00265 ////////////////////////////////////////////////////////////////////
00266 //     Function: ShaderInput::Constructor
00267 //       Access: Published
00268 //  Description: 
00269 ////////////////////////////////////////////////////////////////////
00270 INLINE ShaderInput::
00271 ShaderInput(const InternalName *name, const PTA_LVecBase2d &ptr, int priority) :
00272   _name(name),
00273   _type(M_numeric),
00274   _priority(priority),
00275   _stored_ptr(ptr)
00276 {
00277 }
00278 
00279 ////////////////////////////////////////////////////////////////////
00280 //     Function: ShaderInput::Constructor
00281 //       Access: Published
00282 //  Description: 
00283 ////////////////////////////////////////////////////////////////////
00284 INLINE ShaderInput::
00285 ShaderInput(const InternalName *name, const LVecBase4d &vec, int priority) :
00286   _name(name),
00287   _type(M_numeric),
00288   _priority(priority),
00289   _stored_ptr(vec),
00290   _stored_vector(LCAST(PN_stdfloat, vec))
00291 {
00292 }
00293 
00294 ////////////////////////////////////////////////////////////////////
00295 //     Function: ShaderInput::Constructor
00296 //       Access: Published
00297 //  Description: 
00298 ////////////////////////////////////////////////////////////////////
00299 INLINE ShaderInput::
00300 ShaderInput(const InternalName *name, const LVecBase3d &vec, int priority) :
00301   _name(name),
00302   _type(M_numeric),
00303   _priority(priority),
00304   _stored_ptr(vec),
00305   _stored_vector(vec.get_x(), vec.get_y(), vec.get_z(), 0.0)
00306 {
00307 }
00308 
00309 ////////////////////////////////////////////////////////////////////
00310 //     Function: ShaderInput::Constructor
00311 //       Access: Published
00312 //  Description: 
00313 ////////////////////////////////////////////////////////////////////
00314 INLINE ShaderInput::
00315 ShaderInput(const InternalName *name, const LVecBase2d &vec, int priority) :
00316   _name(name),
00317   _type(M_numeric),
00318   _priority(priority),
00319   _stored_ptr(vec),
00320   _stored_vector(vec.get_x(), vec.get_y(), 0.0, 0.0)
00321 {
00322 }
00323 
00324 ////////////////////////////////////////////////////////////////////
00325 //     Function: ShaderInput::Constructor
00326 //       Access: Published
00327 //  Description: 
00328 ////////////////////////////////////////////////////////////////////
00329 INLINE ShaderInput::
00330 ShaderInput(const InternalName *name, const PTA_LMatrix4d &ptr, int priority) : 
00331   _name(name),
00332   _type(M_numeric),
00333   _priority(priority),
00334   _stored_ptr(ptr)
00335 {
00336 }
00337 
00338 ////////////////////////////////////////////////////////////////////
00339 //     Function: ShaderInput::Constructor
00340 //       Access: Published
00341 //  Description: 
00342 ////////////////////////////////////////////////////////////////////
00343 INLINE ShaderInput::
00344 ShaderInput(const InternalName *name, const PTA_LMatrix3d &ptr, int priority) : 
00345   _name(name),
00346   _type(M_numeric),
00347   _priority(priority),
00348   _stored_ptr(ptr)
00349 {
00350 }
00351 
00352 ////////////////////////////////////////////////////////////////////
00353 //     Function: ShaderInput::Constructor
00354 //       Access: Published
00355 //  Description: 
00356 ////////////////////////////////////////////////////////////////////
00357 INLINE ShaderInput::
00358 ShaderInput(const InternalName *name, const LMatrix4d &mat, int priority) :
00359   _name(name),
00360   _type(M_numeric),
00361   _priority(priority),
00362   _stored_ptr(mat)
00363 {
00364 }
00365 
00366 ////////////////////////////////////////////////////////////////////
00367 //     Function: ShaderInput::Constructor
00368 //       Access: Published
00369 //  Description: 
00370 ////////////////////////////////////////////////////////////////////
00371 INLINE ShaderInput::
00372 ShaderInput(const InternalName *name, const LMatrix3d &mat, int priority) :
00373   _name(name),
00374   _type(M_numeric),
00375   _priority(priority),
00376   _stored_ptr(mat)
00377 {
00378 }
00379 
00380 ////////////////////////////////////////////////////////////////////
00381 //     Function: ShaderInput::get_name
00382 //       Access: Published
00383 //  Description: 
00384 ////////////////////////////////////////////////////////////////////
00385 INLINE const InternalName *ShaderInput::
00386 get_name() const {
00387   return _name;
00388 }
00389 
00390 ////////////////////////////////////////////////////////////////////
00391 //     Function: ShaderInput::get_value_type
00392 //       Access: Published
00393 //  Description: 
00394 ////////////////////////////////////////////////////////////////////
00395 INLINE int ShaderInput::
00396 get_value_type() const {
00397   return _type;
00398 }
00399 
00400 ////////////////////////////////////////////////////////////////////
00401 //     Function: ShaderInput::get_priority
00402 //       Access: Published
00403 //  Description: 
00404 ////////////////////////////////////////////////////////////////////
00405 INLINE int ShaderInput::
00406 get_priority() const {
00407   return _priority;
00408 }
00409 
00410 ////////////////////////////////////////////////////////////////////
00411 //     Function: ShaderInput::get_texture
00412 //       Access: Published
00413 //  Description: 
00414 ////////////////////////////////////////////////////////////////////
00415 INLINE Texture *ShaderInput::
00416 get_texture() const {
00417   return _stored_texture;
00418 }
00419 
00420 ////////////////////////////////////////////////////////////////////
00421 //     Function: ShaderInput::get_ptr
00422 //       Access: Published
00423 //  Description: 
00424 ////////////////////////////////////////////////////////////////////
00425 INLINE const Shader::ShaderPtrData &ShaderInput::
00426 get_ptr() const {
00427   return _stored_ptr;
00428 }
00429 
00430 ////////////////////////////////////////////////////////////////////
00431 //     Function: ShaderInput::get_nodepath
00432 //       Access: Published
00433 //  Description: 
00434 ////////////////////////////////////////////////////////////////////
00435 INLINE const NodePath &ShaderInput::
00436 get_nodepath() const {
00437   return _stored_nodepath;
00438 }
00439 
00440 ////////////////////////////////////////////////////////////////////
00441 //     Function: ShaderInput::get_vector
00442 //       Access: Published
00443 //  Description: 
00444 ////////////////////////////////////////////////////////////////////
00445 INLINE const LVecBase4 &ShaderInput::
00446 get_vector() const {
00447   return _stored_vector;
00448 }
00449 
 All Classes Functions Variables Enumerations