15 #include "lineEmitter.h" 25 _endpoint1.set(1.0f, 0.0f, 0.0f);
26 _endpoint2.set(0.0f, 0.0f, 0.0f);
37 _endpoint1 = copy._endpoint1;
38 _endpoint2 = copy._endpoint2;
66 assign_initial_position(
LPoint3& pos) {
67 PN_stdfloat t = NORMALIZED_RAND();
69 LVector3 v_diff = _endpoint2 - _endpoint1;
71 PN_stdfloat lerp_x = _endpoint1[0] + t * v_diff[0];
72 PN_stdfloat lerp_y = _endpoint1[1] + t * v_diff[1];
73 PN_stdfloat lerp_z = _endpoint1[2] + t * v_diff[2];
75 pos.set(lerp_x, lerp_y, lerp_z);
84 assign_initial_velocity(
LVector3& vel) {
108 write(ostream &out,
int indent)
const {
110 out.width(indent); out<<
""; out<<
"LineEmitter:\n";
111 out.width(indent+2); out<<
""; out<<
"_endpoint1 "<<_endpoint1<<
"\n";
112 out.width(indent+2); out<<
""; out<<
"_endpoint2 "<<_endpoint2<<
"\n";
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Describes a linear region in which particles are generated.
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual BaseParticleEmitter * make_copy()
copier
virtual ~LineEmitter()
constructor
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Describes a physical region in space in which particles are randomly generated.