Panda3D

zSpinParticle.h

00001 // Filename: zSpinParticle.h
00002 // Created by:  charles (16Aug00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef ZSPINPARTICLE_H
00016 #define ZSPINPARTICLE_H
00017 
00018 #include "baseParticle.h"
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //       Class : ZSpinParticle
00022 // Description : describes a particle that spins along its z axis.
00023 //               this is kind of an intermediary class- if you're
00024 //               using a SpriteParticleRenderer and you want your
00025 //               sprites to spin without having them be full-blown
00026 //               oriented (i.e. angry quat math), use this.
00027 ////////////////////////////////////////////////////////////////////
00028 class EXPCL_PANDAPHYSICS ZSpinParticle : public BaseParticle {
00029 public:
00030   ZSpinParticle();
00031   ZSpinParticle(const ZSpinParticle &copy);
00032   virtual ~ZSpinParticle();
00033 
00034   virtual PhysicsObject *make_copy() const;
00035 
00036   virtual void init();
00037   virtual void update();
00038   virtual void die();
00039 
00040   virtual PN_stdfloat get_theta() const;
00041 
00042   INLINE void set_initial_angle(PN_stdfloat t);
00043   INLINE PN_stdfloat get_initial_angle() const;
00044 
00045   INLINE void set_final_angle(PN_stdfloat t);
00046   INLINE PN_stdfloat get_final_angle() const;
00047 
00048   // 'set_final_angle' and 'angular_velocity' are mutually exclusive apis
00049   // if angular-velocity is specified, final_angle is ignored
00050   INLINE void  set_angular_velocity(PN_stdfloat v);
00051   INLINE PN_stdfloat get_angular_velocity() const;
00052 
00053   INLINE void enable_angular_velocity(bool bEnabled);
00054   INLINE bool get_angular_velocity_enabled() const;
00055 
00056   virtual void output(ostream &out) const;
00057   virtual void write(ostream &out, int indent=0) const;
00058 
00059 private:
00060   PN_stdfloat _initial_angle;
00061   PN_stdfloat _final_angle;
00062   PN_stdfloat _cur_angle;
00063   PN_stdfloat _angular_velocity;
00064   bool  _bUseAngularVelocity;
00065 };
00066 
00067 #include "zSpinParticle.I"
00068 
00069 #endif // ZSPINPARTICLE_H
 All Classes Functions Variables Enumerations