Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE void SparkleParticleRenderer::
18set_center_color(const LColor& c) {
19 _center_color = c;
20}
21
22/**
23
24 */
25INLINE void SparkleParticleRenderer::
26set_edge_color(const LColor& c) {
27 _edge_color = c;
28}
29
30/**
31
32 */
33INLINE void SparkleParticleRenderer::
34set_life_scale(SparkleParticleRenderer::SparkleParticleLifeScale ls) {
35 _life_scale = ls;
36}
37
38/**
39
40 */
41INLINE void SparkleParticleRenderer::
42set_birth_radius(PN_stdfloat radius) {
43 _birth_radius = radius;
44}
45
46/**
47
48 */
49INLINE void SparkleParticleRenderer::
50set_death_radius(PN_stdfloat radius) {
51 _death_radius = radius;
52}
53
54/**
55
56 */
57INLINE const LColor& SparkleParticleRenderer::
58get_center_color() const {
59 return _center_color;
60}
61
62/**
63
64 */
65INLINE const LColor& SparkleParticleRenderer::
66get_edge_color() const {
67 return _edge_color;
68}
69
70/**
71
72 */
73INLINE SparkleParticleRenderer::SparkleParticleLifeScale SparkleParticleRenderer::
74get_life_scale() const {
75 return _life_scale;
76}
77
78/**
79
80 */
81INLINE PN_stdfloat SparkleParticleRenderer::
82get_birth_radius() const {
83 return _birth_radius;
84}
85
86/**
87
88 */
89INLINE PN_stdfloat SparkleParticleRenderer::
90get_death_radius() const {
91 return _death_radius;
92}
93
94/**
95
96 */
97INLINE PN_stdfloat SparkleParticleRenderer::
98get_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.