Panda3D
pointEmitter.cxx
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 pointEmitter.cxx
10  * @author charles
11  * @date 2000-06-22
12  */
13 
14 #include "pointEmitter.h"
15 
16 /**
17  * constructor
18  */
22  _location.set(0.0f, 0.0f, 0.0f);
23 }
24 
25 /**
26  * copy constructor
27  */
29 PointEmitter(const PointEmitter &copy) :
30  BaseParticleEmitter(copy) {
31  _location = copy._location;
32 }
33 
34 /**
35  * destructor
36  */
39 }
40 
41 /**
42  * copier
43  */
46  return new PointEmitter(*this);
47 }
48 
49 /**
50  * Generates a location for a new particle
51  */
52 void PointEmitter::
53 assign_initial_position(LPoint3& pos) {
54  pos = _location;
55 }
56 
57 /**
58  * Generates a velocity for a new particle
59  */
60 void PointEmitter::
61 assign_initial_velocity(LVector3& vel) {
62  vel.set(0,0,0);
63 }
64 
65 /**
66  * Write a string representation of this instance to <out>.
67  */
68 void PointEmitter::
69 output(std::ostream &out) const {
70  #ifndef NDEBUG //[
71  out<<"PointEmitter";
72  #endif //] NDEBUG
73 }
74 
75 /**
76  * Write a string representation of this instance to <out>.
77  */
78 void PointEmitter::
79 write(std::ostream &out, int indent) const {
80  #ifndef NDEBUG //[
81  out.width(indent); out<<""; out<<"PointEmitter:\n";
82  out.width(indent+2); out<<""; out<<"_location "<<_location<<"\n";
84  #endif //] NDEBUG
85 }
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
PointEmitter()
constructor
virtual void write(std::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:22
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
virtual BaseParticleEmitter * make_copy()
copier
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.