21 _radius(1.0f), _radius_spread(0.0f), _aoe(0.0f), _uniform_emission(0), _theta(0.0f)
31 _radius = copy._radius;
33 _radius_spread = copy._radius_spread;
34 _uniform_emission = copy._uniform_emission;
37 _sin_theta = copy._sin_theta;
38 _cos_theta = copy._cos_theta;
60 assign_initial_position(LPoint3& pos) {
61 if (_uniform_emission > 0)
63 _theta = _theta + 1.0/_uniform_emission;
65 _theta = _theta - 1.0;
69 _theta = NORMALIZED_RAND();
72 _cos_theta = cosf(_theta * 2.0f * MathNumbers::pi_f);
73 _sin_theta = sinf(_theta * 2.0f * MathNumbers::pi_f);
75 PN_stdfloat new_radius_spread = SPREAD(_radius_spread);
76 PN_stdfloat new_x = _cos_theta * (_radius + new_radius_spread);
77 PN_stdfloat new_y = _sin_theta * (_radius + new_radius_spread);
79 pos.set(new_x, new_y, 0.0f);
86 assign_initial_velocity(LVector3& vel) {
87 PN_stdfloat vel_z = sinf(deg_2_rad(_aoe));
88 PN_stdfloat abs_diff = fabs(1.0f - (vel_z * vel_z));
89 PN_stdfloat root_mag_minus_z_squared = sqrtf(abs_diff);
91 PN_stdfloat vel_x = _cos_theta * root_mag_minus_z_squared;
92 PN_stdfloat vel_y = _sin_theta * root_mag_minus_z_squared;
95 if((_aoe > 90.0f) && (_aoe < 270.0f))
101 vel.set(vel_x, vel_y, vel_z);
120 out.width(
indent); out<<
""; out<<
"RingEmitter:\n";
121 out.width(
indent+2); out<<
""; out<<
"_radius "<<_radius<<
"\n";
122 out.width(
indent+2); out<<
""; out<<
"_radius_spread "<<_radius_spread<<
"\n";
123 out.width(
indent+2); out<<
""; out<<
"_aoe "<<_aoe<<
"\n";
124 out.width(
indent+2); out<<
""; out<<
"_sin_theta "<<_sin_theta<<
"\n";
125 out.width(
indent+2); out<<
""; out<<
"_cos_theta "<<_cos_theta<<
"\n";
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a planar ring region in which particles are generated.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
virtual ~RingEmitter()
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.
virtual BaseParticleEmitter * make_copy()
copier