23 _initial_angle = 0.0f;
26 _angular_velocity = 0.0f;
27 _bUseAngularVelocity =
false;
36 _initial_angle = copy._initial_angle;
37 _final_angle = copy._final_angle;
38 _cur_angle = copy._cur_angle;
39 _angular_velocity = copy._angular_velocity;
40 _bUseAngularVelocity = copy._bUseAngularVelocity;
74 if(_bUseAngularVelocity) {
76 _cur_angle = _initial_angle + (get_age() * _angular_velocity);
78 _cur_angle = _initial_angle + (get_parameterized_age() * (_final_angle - _initial_angle));
82 _cur_angle =
cmod(_cur_angle, (PN_stdfloat)360.0);
113 out<<
"ZSpinParticle";
123 out.width(
indent); out<<
""; out<<
"ZSpinParticle:\n";
124 out.width(
indent+2); out<<
""; out<<
"_initial_angle "<<_initial_angle<<
"\n";
125 out.width(
indent+2); out<<
""; out<<
"_final_angle "<<_final_angle<<
"\n";
126 out.width(
indent+2); out<<
""; out<<
"_cur_angle "<<_cur_angle<<
"\n";
127 out.width(
indent+2); out<<
""; out<<
"_angular_velocity "<<_angular_velocity<<
"\n";
128 out.width(
indent+2); out<<
""; out<<
"_bUseAngularVelocity "<<_bUseAngularVelocity<<
"\n";
float cmod(float x, float y)
This is similar to fmod(), but it behaves properly when x is negative: that is, it always returns a v...
virtual PhysicsObject * make_copy() const
dynamic copier
A body on which physics will be applied.
ZSpinParticle()
constructor
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
describes a particle that spins along its z axis.
virtual PN_stdfloat get_theta() const
for spriteParticleRenderer
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
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>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An individual, physically-modelable particle abstract base class.
virtual ~ZSpinParticle()
destructor