Panda3D
zSpinParticle.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file zSpinParticle.h
10  * @author charles
11  * @date 2000-08-16
12  */
13 
14 #ifndef ZSPINPARTICLE_H
15 #define ZSPINPARTICLE_H
16 
17 #include "baseParticle.h"
18 
19 /**
20  * describes a particle that spins along its z axis. this is kind of an
21  * intermediary class- if you're using a SpriteParticleRenderer and you want
22  * your sprites to spin without having them be full-blown oriented (i.e.
23  * angry quat math), use this.
24  */
25 class EXPCL_PANDA_PARTICLESYSTEM ZSpinParticle : public BaseParticle {
26 public:
27  ZSpinParticle();
28  ZSpinParticle(const ZSpinParticle &copy);
29  virtual ~ZSpinParticle();
30 
31  virtual PhysicsObject *make_copy() const;
32 
33  virtual void init();
34  virtual void update();
35  virtual void die();
36 
37  virtual PN_stdfloat get_theta() const;
38 
39  INLINE void set_initial_angle(PN_stdfloat t);
40  INLINE PN_stdfloat get_initial_angle() const;
41 
42  INLINE void set_final_angle(PN_stdfloat t);
43  INLINE PN_stdfloat get_final_angle() const;
44 
45  // 'set_final_angle' and 'angular_velocity' are mutually exclusive apis if
46  // angular-velocity is specified, final_angle is ignored
47  INLINE void set_angular_velocity(PN_stdfloat v);
48  INLINE PN_stdfloat get_angular_velocity() const;
49 
50  INLINE void enable_angular_velocity(bool bEnabled);
51  INLINE bool get_angular_velocity_enabled() const;
52 
53  virtual void output(std::ostream &out) const;
54  virtual void write(std::ostream &out, int indent=0) const;
55 
56 private:
57  PN_stdfloat _initial_angle;
58  PN_stdfloat _final_angle;
59  PN_stdfloat _cur_angle;
60  PN_stdfloat _angular_velocity;
61  bool _bUseAngularVelocity;
62 };
63 
64 #include "zSpinParticle.I"
65 
66 #endif // ZSPINPARTICLE_H
virtual PhysicsObject * make_copy() const =0
dynamic copy.
A body on which physics will be applied.
Definition: physicsObject.h:27
describes a particle that spins along its z axis.
Definition: zSpinParticle.h:25
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual PN_stdfloat get_theta() const
for spriteParticleRenderer
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:23
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.