Panda3D
pointEmitter.cxx
1 // Filename: pointEmitter.cxx
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 #include "pointEmitter.h"
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function : PointEmitter
19 // Access : Public
20 // Description : constructor
21 ////////////////////////////////////////////////////////////////////
25  _location.set(0.0f, 0.0f, 0.0f);
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function : PointEmitter
30 // Access : Public
31 // Description : copy constructor
32 ////////////////////////////////////////////////////////////////////
34 PointEmitter(const PointEmitter &copy) :
35  BaseParticleEmitter(copy) {
36  _location = copy._location;
37 }
38 
39 ////////////////////////////////////////////////////////////////////
40 // Function : ~PointEmitter
41 // Access : Public
42 // Description : destructor
43 ////////////////////////////////////////////////////////////////////
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function : make_copy
50 // Access : Public
51 // Description : copier
52 ////////////////////////////////////////////////////////////////////
55  return new PointEmitter(*this);
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function : PointEmitter::assign_initial_position
60 // Access : Public
61 // Description : Generates a location for a new particle
62 ////////////////////////////////////////////////////////////////////
63 void PointEmitter::
64 assign_initial_position(LPoint3& pos) {
65  pos = _location;
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function : PointEmitter::assign_initial_velocity
70 // Access : Public
71 // Description : Generates a velocity for a new particle
72 ////////////////////////////////////////////////////////////////////
73 void PointEmitter::
74 assign_initial_velocity(LVector3& vel) {
75  vel.set(0,0,0);
76 }
77 
78 ////////////////////////////////////////////////////////////////////
79 // Function : output
80 // Access : Public
81 // Description : Write a string representation of this instance to
82 // <out>.
83 ////////////////////////////////////////////////////////////////////
84 void PointEmitter::
85 output(ostream &out) const {
86  #ifndef NDEBUG //[
87  out<<"PointEmitter";
88  #endif //] NDEBUG
89 }
90 
91 ////////////////////////////////////////////////////////////////////
92 // Function : write
93 // Access : Public
94 // Description : Write a string representation of this instance to
95 // <out>.
96 ////////////////////////////////////////////////////////////////////
97 void PointEmitter::
98 write(ostream &out, int indent) const {
99  #ifndef NDEBUG //[
100  out.width(indent); out<<""; out<<"PointEmitter:\n";
101  out.width(indent+2); out<<""; out<<"_location "<<_location<<"\n";
102  BaseParticleEmitter::write(out, indent+2);
103  #endif //] NDEBUG
104 }
PointEmitter()
constructor
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
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual ~PointEmitter()
destructor
Describes a planar ring region in which particles are generated.
Definition: pointEmitter.h:25
virtual BaseParticleEmitter * make_copy()
copier
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.