15 #include "baseParticleFactory.h"
23 BaseParticleFactory() :
25 _lifespan_spread(0.0),
28 _terminal_velocity_base(
PhysicsObject::_default_terminal_velocity),
29 _terminal_velocity_spread(0.0f)
40 _lifespan_base(copy._lifespan_base),
41 _lifespan_spread(copy._lifespan_spread),
42 _mass_base(copy._mass_base),
43 _mass_spread(copy._mass_spread),
44 _terminal_velocity_base(copy._terminal_velocity_base),
45 _terminal_velocity_spread(copy._terminal_velocity_spread)
64 bp->set_lifespan(_lifespan_base + SPREAD(_lifespan_spread));
65 bp->
set_mass(_mass_base + SPREAD(_mass_spread));
73 populate_child_particle(bp);
85 out<<
"BaseParticleFactory";
96 write(ostream &out,
int indent)
const {
98 out.width(indent); out<<
""; out<<
"BaseParticleFactory:\n";
99 out.width(indent+2); out<<
""; out<<
"_lifespan_base "<<_lifespan_base<<
"\n";
100 out.width(indent+2); out<<
""; out<<
"_lifespan_spread "<<_lifespan_spread<<
"\n";
101 out.width(indent+2); out<<
""; out<<
"_mass_base "<<_mass_base<<
"\n";
102 out.width(indent+2); out<<
""; out<<
"_mass_spread "<<_mass_spread<<
"\n";
103 out.width(indent+2); out<<
""; out<<
"_terminal_velocity_base "<<_terminal_velocity_base<<
"\n";
104 out.width(indent+2); out<<
""; out<<
"_terminal_velocity_spread "<<_terminal_velocity_spread<<
"\n";
void populate_particle(BaseParticle *bp)
public
Pure Virtual base class for creating particles.
A body on which physics will be applied.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual ~BaseParticleFactory()
destructor
void set_active(bool flag)
Process Flag assignment.
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
An individual, physically-modelable particle abstract base class.
void set_mass(PN_stdfloat)
Set the mass in slugs (or kilograms).
void set_terminal_velocity(PN_stdfloat tv)
tv assignment