Panda3D
 All Classes Functions Variables Enumerations
sparkleParticleRenderer.I
1 // Filename: sparkleParticleRenderer.I
2 // Created by: charles (27Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 ////////////////////////////////////////////////////////////////////
16 // Function : set_center_color
17 // Access : public
18 ////////////////////////////////////////////////////////////////////
19 INLINE void SparkleParticleRenderer::
20 set_center_color(const LColor& c) {
21  _center_color = c;
22 }
23 
24 ////////////////////////////////////////////////////////////////////
25 // Function : set_edge_color
26 // Access : public
27 ////////////////////////////////////////////////////////////////////
28 INLINE void SparkleParticleRenderer::
29 set_edge_color(const LColor& c) {
30  _edge_color = c;
31 }
32 
33 ////////////////////////////////////////////////////////////////////
34 // Function : set_life_scale
35 // Access : public
36 ////////////////////////////////////////////////////////////////////
37 INLINE void SparkleParticleRenderer::
38 set_life_scale(SparkleParticleRenderer::SparkleParticleLifeScale ls) {
39  _life_scale = ls;
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function : set_birth_radius
44 // Access : public
45 ////////////////////////////////////////////////////////////////////
46 INLINE void SparkleParticleRenderer::
47 set_birth_radius(PN_stdfloat radius) {
48  _birth_radius = radius;
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function : set_death_radius
53 // Access : public
54 ////////////////////////////////////////////////////////////////////
55 INLINE void SparkleParticleRenderer::
56 set_death_radius(PN_stdfloat radius) {
57  _death_radius = radius;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function : get_center_color
62 // Access : public
63 ////////////////////////////////////////////////////////////////////
64 INLINE const LColor& SparkleParticleRenderer::
65 get_center_color() const {
66  return _center_color;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function : get_edge_color
71 // Access : public
72 ////////////////////////////////////////////////////////////////////
73 INLINE const LColor& SparkleParticleRenderer::
74 get_edge_color() const {
75  return _edge_color;
76 }
77 
78 ////////////////////////////////////////////////////////////////////
79 // Function : get_life_scale
80 // Access : public
81 ////////////////////////////////////////////////////////////////////
82 INLINE SparkleParticleRenderer::SparkleParticleLifeScale SparkleParticleRenderer::
83 get_life_scale() const {
84  return _life_scale;
85 }
86 
87 ////////////////////////////////////////////////////////////////////
88 // Function : get_birth_radius
89 // Access : public
90 ////////////////////////////////////////////////////////////////////
91 INLINE PN_stdfloat SparkleParticleRenderer::
92 get_birth_radius() const {
93  return _birth_radius;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function : get_death_radius
98 // Access : public
99 ////////////////////////////////////////////////////////////////////
100 INLINE PN_stdfloat SparkleParticleRenderer::
101 get_death_radius() const {
102  return _death_radius;
103 }
104 
105 ////////////////////////////////////////////////////////////////////
106 // Function : get_radius
107 // Access : public
108 ////////////////////////////////////////////////////////////////////
109 INLINE PN_stdfloat SparkleParticleRenderer::
110 get_radius(BaseParticle *bp) {
111  if (_life_scale == SP_NO_SCALE)
112  return _birth_radius;
113  else {
114  PN_stdfloat s_x = CUBIC_T(bp->get_parameterized_age());
115  return LERP(s_x, _birth_radius, _death_radius);
116  }
117 }
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:26