Panda3D
orientedParticleFactory.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 orientedParticleFactory.cxx
10  * @author charles
11  * @date 2000-07-05
12  */
13 
15 #include "orientedParticle.h"
16 
17 /**
18  * Constructor
19  */
23 }
24 
25 /**
26  * copy Constructor
27  */
30  BaseParticleFactory(copy) {
31  _initial_orientation = copy._initial_orientation;
32  _final_orientation = copy._final_orientation;
33 }
34 
35 /**
36  * destructor
37  */
40 }
41 
42 /**
43  * child spawn
44  */
45 void OrientedParticleFactory::
46 populate_child_particle(BaseParticle *bp) const {
47  bp->set_orientation(_initial_orientation);
48 }
49 
50 /**
51  * child particle generation function
52  */
53 BaseParticle *OrientedParticleFactory::
54 alloc_particle() const {
55  return new OrientedParticle;
56 }
57 
58 /**
59  * Write a string representation of this instance to <out>.
60  */
62 output(std::ostream &out) const {
63  #ifndef NDEBUG //[
64  out<<"OrientedParticleFactory";
65  #endif //] NDEBUG
66 }
67 
68 /**
69  * Write a string representation of this instance to <out>.
70  */
72 write(std::ostream &out, int indent) const {
73  #ifndef NDEBUG //[
74  out.width(indent); out<<""; out<<"OrientedParticleFactory:\n";
76  #endif //] NDEBUG
77 }
virtual ~OrientedParticleFactory()
destructor
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Pure Virtual base class for creating particles.
Describes a particle that has angular characteristics (velocity, orientation).
Creates particles that are affected by angular forces.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:23
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.