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