22 _vmin.set(-0.5f, -0.5f, -0.5f);
23 _vmax.set( 0.5f, 0.5f, 0.5f);
55 assign_initial_position(LPoint3& pos) {
56 PN_stdfloat t_x = NORMALIZED_RAND();
57 PN_stdfloat t_y = NORMALIZED_RAND();
58 PN_stdfloat t_z = NORMALIZED_RAND();
60 LVector3 v_diff = _vmax - _vmin;
62 PN_stdfloat lerp_x = _vmin[0] + t_x * v_diff[0];
63 PN_stdfloat lerp_y = _vmin[1] + t_y * v_diff[1];
64 PN_stdfloat lerp_z = _vmin[2] + t_z * v_diff[2];
66 pos.set(lerp_x, lerp_y, lerp_z);
73 assign_initial_velocity(LVector3& vel) {
93 out.width(
indent); out<<
""; out<<
"BoxEmitter:\n";
94 out.width(
indent+2); out<<
""; out<<
"_vmin "<<_vmin<<
"\n";
95 out.width(
indent+2); out<<
""; out<<
"_vmax "<<_vmax<<
"\n";
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a voluminous box region in which particles are generated.
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
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
virtual ~BoxEmitter()
destructor