Panda3D
discEmitter.h
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 discEmitter.h
10  * @author charles
11  * @date 2000-06-22
12  */
13 
14 #ifndef DISCEMITTER_H
15 #define DISCEMITTER_H
16 
17 #include "baseParticleEmitter.h"
18 
19 /**
20  * Describes a planar disc region from which particles are generated
21  */
22 class EXPCL_PANDA_PARTICLESYSTEM DiscEmitter : public BaseParticleEmitter {
23 PUBLISHED:
24  DiscEmitter();
25  DiscEmitter(const DiscEmitter &copy);
26  virtual ~DiscEmitter();
27 
28  virtual BaseParticleEmitter *make_copy();
29 
30  INLINE void set_radius(PN_stdfloat r);
31  INLINE void set_outer_angle(PN_stdfloat o_angle);
32  INLINE void set_inner_angle(PN_stdfloat i_angle);
33  INLINE void set_outer_magnitude(PN_stdfloat o_mag);
34  INLINE void set_inner_magnitude(PN_stdfloat i_mag);
35  INLINE void set_cubic_lerping(bool clerp);
36 
37  INLINE PN_stdfloat get_radius() const;
38  INLINE PN_stdfloat get_outer_angle() const;
39  INLINE PN_stdfloat get_inner_angle() const;
40  INLINE PN_stdfloat get_outer_magnitude() const;
41  INLINE PN_stdfloat get_inner_magnitude() const;
42  INLINE bool get_cubic_lerping() const;
43 
44  virtual void output(std::ostream &out) const;
45  virtual void write(std::ostream &out, int indent=0) const;
46 
47 private:
48  PN_stdfloat _radius;
49 
50  // CUSTOM EMISSION PARAMETERS
51  PN_stdfloat _inner_aoe;
52  PN_stdfloat _outer_aoe;
53  PN_stdfloat _inner_magnitude;
54  PN_stdfloat _outer_magnitude;
55  bool _cubic_lerping;
56 
57  // scratch variables that carry over from position calc to velocity calc
58  PN_stdfloat _distance_from_center;
59  PN_stdfloat _sinf_theta;
60  PN_stdfloat _cosf_theta;
61 
62  virtual void assign_initial_position(LPoint3& pos);
63  virtual void assign_initial_velocity(LVector3& vel);
64 };
65 
66 #include "discEmitter.I"
67 
68 #endif // DISCEMITTER_H
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a planar disc region from which particles are generated.
Definition: discEmitter.h:22
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.