Panda3D
ringEmitter.h
1 // Filename: ringEmitter.h
2 // Created by: charles (22Jun00)
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 #ifndef RINGEMITTER_H
16 #define RINGEMITTER_H
17 
18 #include "baseParticleEmitter.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : RingEmitter
22 // Description : Describes a planar ring region in which
23 // particles are generated.
24 ////////////////////////////////////////////////////////////////////
25 class EXPCL_PANDAPHYSICS RingEmitter : public BaseParticleEmitter {
26 PUBLISHED:
27  RingEmitter();
28  RingEmitter(const RingEmitter &copy);
29  virtual ~RingEmitter();
30 
31  virtual BaseParticleEmitter *make_copy();
32 
33  INLINE void set_radius(PN_stdfloat r);
34  INLINE void set_angle(PN_stdfloat angle);
35  INLINE void set_radius_spread(PN_stdfloat spread);
36  INLINE void set_uniform_emission(int uniform_emission);
37 
38  INLINE PN_stdfloat get_radius() const;
39  INLINE PN_stdfloat get_angle() const;
40  INLINE PN_stdfloat get_radius_spread() const;
41  INLINE int get_uniform_emission() const;
42 
43  virtual void output(ostream &out) const;
44  virtual void write(ostream &out, int indent=0) const;
45 
46 protected:
47  PN_stdfloat _radius;
48  PN_stdfloat _radius_spread;
49 
50  // CUSTOM EMISSION PARAMETERS
51  PN_stdfloat _aoe; // angle of elevation
52 
53  // viariables used for uniform particle emission
54  int _uniform_emission;
55  PN_stdfloat _theta;
56 
57  ///////////////////////////////
58  // scratch variables that carry over from position calc to velocity calc
59  PN_stdfloat _sin_theta;
60  PN_stdfloat _cos_theta;
61  ///////////////////////////////
62 
63 private:
64  virtual void assign_initial_position(LPoint3& pos);
65  virtual void assign_initial_velocity(LVector3& vel);
66 };
67 
68 #include "ringEmitter.I"
69 
70 #endif // RINGEMITTER_H
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
Describes a planar ring region in which particles are generated.
Definition: ringEmitter.h:25
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a physical region in space in which particles are randomly generated.