00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NODEPATHLERPS_H
00020 #define NODEPATHLERPS_H
00021
00022 #include "pandabase.h"
00023
00024 #include "lerpfunctor.h"
00025 #include "nodePath.h"
00026
00027
00028
00029
00030
00031 class EXPCL_PANDA PosLerpFunctor : public LPoint3fLerpFunctor {
00032 private:
00033 NodePath _node_path;
00034 bool _is_wrt;
00035 NodePath _wrt_path;
00036
00037 PUBLISHED:
00038 PosLerpFunctor(NodePath np, LPoint3f start, LPoint3f end)
00039 : LPoint3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {}
00040 PosLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey,
00041 float ez) : LPoint3fLerpFunctor(LPoint3f(sx, sy, sz),
00042 LPoint3f(ex, ey, ez)),
00043 _node_path(np), _is_wrt(false) {}
00044 PosLerpFunctor(NodePath np, LPoint3f start, LPoint3f end, NodePath wrt)
00045 : LPoint3fLerpFunctor(start, end), _node_path(np), _is_wrt(true),
00046 _wrt_path(wrt) {}
00047 PosLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey,
00048 float ez, NodePath wrt)
00049 : LPoint3fLerpFunctor(LPoint3f(sx, sy, sz), LPoint3f(ex, ey, ez)),
00050 _node_path(np), _is_wrt(true), _wrt_path(wrt) {}
00051
00052 public:
00053 PosLerpFunctor(const PosLerpFunctor&);
00054 virtual ~PosLerpFunctor(void);
00055 PosLerpFunctor& operator=(const PosLerpFunctor&);
00056 virtual void operator()(float);
00057
00058 public:
00059
00060 static TypeHandle get_class_type(void) {
00061 return _type_handle;
00062 }
00063 static void init_type(void) {
00064 LPoint3fLerpFunctor::init_type();
00065 register_type(_type_handle, "PosLerpFunctor",
00066 LPoint3fLerpFunctor::get_class_type());
00067 }
00068 virtual TypeHandle get_type(void) const {
00069 return get_class_type();
00070 }
00071 virtual TypeHandle force_init_type(void) {
00072 init_type();
00073 return get_class_type();
00074 }
00075 private:
00076 static TypeHandle _type_handle;
00077 };
00078
00079
00080
00081
00082
00083
00084
00085 class EXPCL_PANDA HprLerpFunctor : public LVecBase3fLerpFunctor {
00086 private:
00087 NodePath _node_path;
00088 bool _is_wrt;
00089 NodePath _wrt_path;
00090
00091 PUBLISHED:
00092 HprLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end)
00093 : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {}
00094 HprLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey,
00095 float ez) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz),
00096 LVecBase3f(ex, ey, ez)),
00097 _node_path(np), _is_wrt(false) {}
00098 HprLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end, NodePath wrt)
00099 : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(true),
00100 _wrt_path(wrt) {}
00101 HprLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey,
00102 float ez, NodePath wrt)
00103 : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)),
00104 _node_path(np), _is_wrt(true), _wrt_path(wrt) {}
00105 void take_shortest(void);
00106 void take_longest(void);
00107
00108 public:
00109 HprLerpFunctor(const HprLerpFunctor&);
00110 virtual ~HprLerpFunctor(void);
00111 HprLerpFunctor& operator=(const HprLerpFunctor&);
00112 virtual void operator()(float);
00113
00114 public:
00115
00116 static TypeHandle get_class_type(void) {
00117 return _type_handle;
00118 }
00119 static void init_type(void) {
00120 LVecBase3fLerpFunctor::init_type();
00121 register_type(_type_handle, "HprLerpFunctor",
00122 LVecBase3fLerpFunctor::get_class_type());
00123 }
00124 virtual TypeHandle get_type(void) const {
00125 return get_class_type();
00126 }
00127 virtual TypeHandle force_init_type(void) {
00128 init_type();
00129 return get_class_type();
00130 }
00131 private:
00132 static TypeHandle _type_handle;
00133 };
00134
00135
00136
00137
00138
00139 class EXPCL_PANDA ScaleLerpFunctor : public LVecBase3fLerpFunctor {
00140 private:
00141 NodePath _node_path;
00142 bool _is_wrt;
00143 NodePath _wrt_path;
00144
00145 PUBLISHED:
00146 ScaleLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end)
00147 : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {}
00148 ScaleLerpFunctor(NodePath np, float sx, float sy, float sz, float ex,
00149 float ey, float ez)
00150 : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)),
00151 _node_path(np), _is_wrt(false) {}
00152 ScaleLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end, NodePath wrt)
00153 : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(true),
00154 _wrt_path(wrt) {}
00155 ScaleLerpFunctor(NodePath np, float sx, float sy, float sz, float ex,
00156 float ey, float ez, NodePath wrt)
00157 : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)),
00158 _node_path(np), _is_wrt(true), _wrt_path(wrt) {}
00159
00160 public:
00161 ScaleLerpFunctor(const ScaleLerpFunctor&);
00162 virtual ~ScaleLerpFunctor(void);
00163 ScaleLerpFunctor& operator=(const ScaleLerpFunctor&);
00164 virtual void operator()(float);
00165
00166 public:
00167
00168 static TypeHandle get_class_type(void) {
00169 return _type_handle;
00170 }
00171 static void init_type(void) {
00172 LVecBase3fLerpFunctor::init_type();
00173 register_type(_type_handle, "ScaleLerpFunctor",
00174 LVecBase3fLerpFunctor::get_class_type());
00175 }
00176 virtual TypeHandle get_type(void) const {
00177 return get_class_type();
00178 }
00179 virtual TypeHandle force_init_type(void) {
00180 init_type();
00181 return get_class_type();
00182 }
00183 private:
00184 static TypeHandle _type_handle;
00185 };
00186
00187
00188
00189
00190
00191 class EXPCL_PANDA ColorLerpFunctor : public LVecBase4fLerpFunctor {
00192 private:
00193 NodePath _node_path;
00194 bool _is_wrt;
00195 NodePath _wrt_path;
00196
00197 PUBLISHED:
00198 ColorLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end)
00199 : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {}
00200 ColorLerpFunctor(NodePath np, float sr, float sg, float sb, float sa,
00201 float er, float eg, float eb, float ea) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa),
00202 LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(false) {}
00203 ColorLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end, NodePath wrt)
00204 : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(true),
00205 _wrt_path(wrt) {}
00206 ColorLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg,
00207 float eb, float ea, NodePath wrt)
00208 : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)),
00209 _node_path(np), _is_wrt(true), _wrt_path(wrt) {}
00210
00211 public:
00212 ColorLerpFunctor(const ColorLerpFunctor&);
00213 virtual ~ColorLerpFunctor(void);
00214 ColorLerpFunctor& operator=(const ColorLerpFunctor&);
00215 virtual void operator()(float);
00216
00217 public:
00218
00219 static TypeHandle get_class_type(void) {
00220 return _type_handle;
00221 }
00222 static void init_type(void) {
00223 LVecBase4fLerpFunctor::init_type();
00224 register_type(_type_handle, "ColorLerpFunctor",
00225 LVecBase4fLerpFunctor::get_class_type());
00226 }
00227 virtual TypeHandle get_type(void) const {
00228 return get_class_type();
00229 }
00230 virtual TypeHandle force_init_type(void) {
00231 init_type();
00232 return get_class_type();
00233 }
00234 private:
00235 static TypeHandle _type_handle;
00236 };
00237
00238
00239
00240
00241
00242
00243 class EXPCL_PANDA PosHprLerpFunctor : public LerpFunctor {
00244 private:
00245 NodePath _node_path;
00246 LPoint3f _pstart;
00247 LPoint3f _pend;
00248 LPoint3f _pdiff_cache;
00249 LVecBase3f _hstart;
00250 LVecBase3f _hend;
00251 LVecBase3f _hdiff_cache;
00252 bool _is_wrt;
00253 NodePath _wrt_path;
00254
00255 PUBLISHED:
00256 PosHprLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend,
00257 LVecBase3f hstart, LVecBase3f hend)
00258 : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend),
00259 _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend),
00260 _hdiff_cache(hend-hstart), _is_wrt(false) {}
00261 PosHprLerpFunctor(NodePath np, float psx, float psy, float psz, float pex,
00262 float pey, float pez, float hsx, float hsy, float hsz,
00263 float hex, float hey, float hez)
00264 : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz),
00265 _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart),
00266 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00267 _hdiff_cache(_hend - _hstart), _is_wrt(false) {}
00268 PosHprLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend,
00269 LVecBase3f hstart, LVecBase3f hend, NodePath wrt)
00270 : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend),
00271 _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend),
00272 _hdiff_cache(hend-hstart), _is_wrt(true), _wrt_path(wrt) {}
00273 PosHprLerpFunctor(NodePath np, float psx, float psy, float psz, float pex,
00274 float pey, float pez, float hsx, float hsy, float hsz,
00275 float hex, float hey, float hez, NodePath wrt)
00276 : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz),
00277 _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart),
00278 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00279 _hdiff_cache(_hend - _hstart), _is_wrt(true), _wrt_path(wrt) {}
00280 void take_shortest(void);
00281 void take_longest(void);
00282
00283 public:
00284 PosHprLerpFunctor(const PosHprLerpFunctor&);
00285 virtual ~PosHprLerpFunctor(void);
00286 PosHprLerpFunctor& operator=(const PosHprLerpFunctor&);
00287 virtual void operator()(float);
00288
00289 public:
00290
00291 static TypeHandle get_class_type(void) {
00292 return _type_handle;
00293 }
00294 static void init_type(void) {
00295 LerpFunctor::init_type();
00296 register_type(_type_handle, "PosHprLerpFunctor",
00297 LerpFunctor::get_class_type());
00298 }
00299 virtual TypeHandle get_type(void) const {
00300 return get_class_type();
00301 }
00302 virtual TypeHandle force_init_type(void) {
00303 init_type();
00304 return get_class_type();
00305 }
00306 private:
00307 static TypeHandle _type_handle;
00308 };
00309
00310
00311
00312
00313
00314
00315 class EXPCL_PANDA HprScaleLerpFunctor : public LerpFunctor {
00316 private:
00317 NodePath _node_path;
00318 LVecBase3f _hstart;
00319 LVecBase3f _hend;
00320 LVecBase3f _hdiff_cache;
00321 LVecBase3f _sstart;
00322 LVecBase3f _send;
00323 LVecBase3f _sdiff_cache;
00324 bool _is_wrt;
00325 NodePath _wrt_path;
00326
00327 PUBLISHED:
00328 HprScaleLerpFunctor(NodePath np,
00329 LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart,
00330 LVecBase3f send)
00331 : LerpFunctor(), _node_path(np),
00332 _hstart(hstart), _hend(hend),
00333 _hdiff_cache(hend-hstart), _sstart(sstart), _send(send),
00334 _sdiff_cache(send-sstart), _is_wrt(false) {}
00335 HprScaleLerpFunctor(NodePath np, float hsx, float hsy,
00336 float hsz, float hex, float hey, float hez, float ssx,
00337 float ssy, float ssz, float sex, float sey, float sez)
00338 : LerpFunctor(), _node_path(np),
00339 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00340 _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz),
00341 _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(false) {}
00342 HprScaleLerpFunctor(NodePath np,
00343 LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart,
00344 LVecBase3f send, NodePath wrt)
00345 : LerpFunctor(), _node_path(np), _hstart(hstart), _hend(hend),
00346 _hdiff_cache(hend-hstart), _sstart(sstart), _send(send),
00347 _sdiff_cache(send-sstart), _is_wrt(true), _wrt_path(wrt) {}
00348 HprScaleLerpFunctor(NodePath np, float hsx, float hsy,
00349 float hsz, float hex, float hey, float hez, float ssx,
00350 float ssy, float ssz, float sex, float sey, float sez,
00351 NodePath wrt)
00352 : LerpFunctor(), _node_path(np),
00353 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00354 _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz),
00355 _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(true),
00356 _wrt_path(wrt) {}
00357 void take_shortest(void);
00358 void take_longest(void);
00359
00360 public:
00361 HprScaleLerpFunctor(const HprScaleLerpFunctor&);
00362 virtual ~HprScaleLerpFunctor(void);
00363 HprScaleLerpFunctor& operator=(const HprScaleLerpFunctor&);
00364 virtual void operator()(float);
00365
00366 public:
00367
00368 static TypeHandle get_class_type(void) {
00369 return _type_handle;
00370 }
00371 static void init_type(void) {
00372 LerpFunctor::init_type();
00373 register_type(_type_handle, "HprScaleLerpFunctor",
00374 LerpFunctor::get_class_type());
00375 }
00376 virtual TypeHandle get_type(void) const {
00377 return get_class_type();
00378 }
00379 virtual TypeHandle force_init_type(void) {
00380 init_type();
00381 return get_class_type();
00382 }
00383 private:
00384 static TypeHandle _type_handle;
00385 };
00386
00387
00388
00389
00390
00391
00392 class EXPCL_PANDA PosHprScaleLerpFunctor : public LerpFunctor {
00393 private:
00394 NodePath _node_path;
00395 LPoint3f _pstart;
00396 LPoint3f _pend;
00397 LPoint3f _pdiff_cache;
00398 LVecBase3f _hstart;
00399 LVecBase3f _hend;
00400 LVecBase3f _hdiff_cache;
00401 LVecBase3f _sstart;
00402 LVecBase3f _send;
00403 LVecBase3f _sdiff_cache;
00404 bool _is_wrt;
00405 NodePath _wrt_path;
00406
00407 PUBLISHED:
00408 PosHprScaleLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend,
00409 LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart,
00410 LVecBase3f send)
00411 : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend),
00412 _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend),
00413 _hdiff_cache(hend-hstart), _sstart(sstart), _send(send),
00414 _sdiff_cache(send-sstart), _is_wrt(false) {}
00415 PosHprScaleLerpFunctor(NodePath np, float psx, float psy, float psz,
00416 float pex, float pey, float pez, float hsx, float hsy,
00417 float hsz, float hex, float hey, float hez, float ssx,
00418 float ssy, float ssz, float sex, float sey, float sez)
00419 : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz),
00420 _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart),
00421 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00422 _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz),
00423 _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(false) {}
00424 PosHprScaleLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend,
00425 LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart,
00426 LVecBase3f send, NodePath wrt)
00427 : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend),
00428 _pdiff_cache(pend-pstart), _hstart(hstart), _hend(hend),
00429 _hdiff_cache(hend-hstart), _sstart(sstart), _send(send),
00430 _sdiff_cache(send-sstart), _is_wrt(true), _wrt_path(wrt) {}
00431 PosHprScaleLerpFunctor(NodePath np, float psx, float psy, float psz,
00432 float pex, float pey, float pez, float hsx, float hsy,
00433 float hsz, float hex, float hey, float hez, float ssx,
00434 float ssy, float ssz, float sex, float sey, float sez,
00435 NodePath wrt)
00436 : LerpFunctor(), _node_path(np), _pstart(psx, psy, psz),
00437 _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart),
00438 _hstart(hsx, hsy, hsz), _hend(hex, hey, hez),
00439 _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz),
00440 _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(true),
00441 _wrt_path(wrt) {}
00442 void take_shortest(void);
00443 void take_longest(void);
00444
00445 public:
00446 PosHprScaleLerpFunctor(const PosHprScaleLerpFunctor&);
00447 virtual ~PosHprScaleLerpFunctor(void);
00448 PosHprScaleLerpFunctor& operator=(const PosHprScaleLerpFunctor&);
00449 virtual void operator()(float);
00450
00451 public:
00452
00453 static TypeHandle get_class_type(void) {
00454 return _type_handle;
00455 }
00456 static void init_type(void) {
00457 LerpFunctor::init_type();
00458 register_type(_type_handle, "PosHprScaleLerpFunctor",
00459 LerpFunctor::get_class_type());
00460 }
00461 virtual TypeHandle get_type(void) const {
00462 return get_class_type();
00463 }
00464 virtual TypeHandle force_init_type(void) {
00465 init_type();
00466 return get_class_type();
00467 }
00468 private:
00469 static TypeHandle _type_handle;
00470 };
00471
00472
00473
00474
00475
00476 class EXPCL_PANDA ColorScaleLerpFunctor : public LVecBase4fLerpFunctor {
00477 private:
00478 NodePath _node_path;
00479 bool _is_wrt;
00480 NodePath _wrt_path;
00481
00482 PUBLISHED:
00483 ColorScaleLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end)
00484 : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {}
00485 ColorScaleLerpFunctor(NodePath np, float sr, float sg, float sb, float sa,
00486 float er, float eg, float eb, float ea) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa),
00487 LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(false) {}
00488 ColorScaleLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end, NodePath wrt)
00489 : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(true),
00490 _wrt_path(wrt) {}
00491 ColorScaleLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, float er, float eg,
00492 float eb, float ea, NodePath wrt)
00493 : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)),
00494 _node_path(np), _is_wrt(true), _wrt_path(wrt) {}
00495
00496 public:
00497 ColorScaleLerpFunctor(const ColorScaleLerpFunctor&);
00498 virtual ~ColorScaleLerpFunctor(void);
00499 ColorScaleLerpFunctor& operator=(const ColorScaleLerpFunctor&);
00500 virtual void operator()(float);
00501
00502 public:
00503
00504 static TypeHandle get_class_type(void) {
00505 return _type_handle;
00506 }
00507 static void init_type(void) {
00508 LVecBase4fLerpFunctor::init_type();
00509 register_type(_type_handle, "ColorScaleLerpFunctor",
00510 LVecBase4fLerpFunctor::get_class_type());
00511 }
00512 virtual TypeHandle get_type(void) const {
00513 return get_class_type();
00514 }
00515 virtual TypeHandle force_init_type(void) {
00516 init_type();
00517 return get_class_type();
00518 }
00519 private:
00520 static TypeHandle _type_handle;
00521 };
00522
00523 #endif
00524
00525
00526
00527
00528