Panda3D
 All Classes Functions Variables Enumerations
discEmitter.h
1 // Filename: discEmitter.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 DISCEMITTER_H
16 #define DISCEMITTER_H
17 
18 #include "baseParticleEmitter.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : DiscEmitter
22 // Description : Describes a planar disc region from which particles
23 // are generated
24 ////////////////////////////////////////////////////////////////////
25 class EXPCL_PANDAPHYSICS DiscEmitter : public BaseParticleEmitter {
26 PUBLISHED:
27  DiscEmitter();
28  DiscEmitter(const DiscEmitter &copy);
29  virtual ~DiscEmitter();
30 
31  virtual BaseParticleEmitter *make_copy();
32 
33  INLINE void set_radius(PN_stdfloat r);
34  INLINE void set_outer_angle(PN_stdfloat o_angle);
35  INLINE void set_inner_angle(PN_stdfloat i_angle);
36  INLINE void set_outer_magnitude(PN_stdfloat o_mag);
37  INLINE void set_inner_magnitude(PN_stdfloat i_mag);
38  INLINE void set_cubic_lerping(bool clerp);
39 
40  INLINE PN_stdfloat get_radius() const;
41  INLINE PN_stdfloat get_outer_angle() const;
42  INLINE PN_stdfloat get_inner_angle() const;
43  INLINE PN_stdfloat get_outer_magnitude() const;
44  INLINE PN_stdfloat get_inner_magnitude() const;
45  INLINE bool get_cubic_lerping() const;
46 
47  virtual void output(ostream &out) const;
48  virtual void write(ostream &out, int indent=0) const;
49 
50 private:
51  PN_stdfloat _radius;
52 
53  // CUSTOM EMISSION PARAMETERS
54  PN_stdfloat _inner_aoe;
55  PN_stdfloat _outer_aoe;
56  PN_stdfloat _inner_magnitude;
57  PN_stdfloat _outer_magnitude;
58  bool _cubic_lerping;
59 
60  ///////////////////////////////
61  // scratch variables that carry over from position calc to velocity calc
62  PN_stdfloat _distance_from_center;
63  PN_stdfloat _sinf_theta;
64  PN_stdfloat _cosf_theta;
65  ///////////////////////////////
66 
67  virtual void assign_initial_position(LPoint3& pos);
68  virtual void assign_initial_velocity(LVector3& vel);
69 };
70 
71 #include "discEmitter.I"
72 
73 #endif // DISCEMITTER_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 disc region from which particles are generated.
Definition: discEmitter.h:25
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
Describes a physical region in space in which particles are randomly generated.