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