TAPs 0.7.7.3
TAPsDynamicParticle.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsDynamicParticle.hpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (11/24/2008)
00009 UPDATE          (08/06/2010)
00010 ******************************************************************************/
00011 #ifndef TAPs_DYNAMIC_PARTICLE_HPP
00012 #define TAPs_DYNAMIC_PARTICLE_HPP
00013 
00014 #include "TAPsParticle.hpp"
00015 #include <limits>
00016 
00017 BEGIN_NAMESPACE_TAPs
00018 //=============================================================================
00019 template <typename T>
00020 class DynamicParticle : public /*virtual*/ Particle<T> {
00021 //=============================================================================
00022 //-----------------------------------------------------------------------------
00023 // Friend Function
00024 friend std::ostream & operator<< ( std::ostream &output, DynamicParticle<T> const &P )
00025 {
00026     return output << P.StrInfo();
00027 }
00028 //-----------------------------------------------------------------------------
00029 
00030 
00031 //=============================================================================
00032 public:
00033     // Member Functions -------------------------------------------------------
00034 
00036     DynamicParticle ( bool bRandomValue = false );
00037 
00039     DynamicParticle ( 
00040         T                   mass, 
00041         Vector3<T> const &  vPosition, 
00042         Vector3<T> const &  vVelocity, 
00043         Vector3<T> const &  vAcceleration, 
00044         Vector3<T> const &  vForce, 
00045         bool                fixed = false 
00046     );
00047 
00049     DynamicParticle ( DynamicParticle<T> const & P );
00050 
00052     ~DynamicParticle ();
00053 
00054     // Assignment Operator
00055     DynamicParticle<T> const & operator= ( DynamicParticle<T> const & P );
00056 
00058     virtual std::string StrInfo () const;
00059 
00060     //-------------------------------------------------------------------------
00061     // Get/Set Functions
00062     // Size
00063     inline T    GetStartSize () const;
00064     inline void SetStartSize ( T t );
00065     inline T    GetCurrentSize () const;
00066     inline void SetCurrentSize ( T t );
00067     inline T    GetEndSize () const;
00068     inline void SetEndSize ( T t );
00069     // Color
00070     inline Vector4<T> const & GetStartColor () const;
00071     inline void         SetStartColor ( Vector4<T> const & v4 );
00072     inline void         SetStartColor ( T r, T g, T b, T a );
00073     inline Vector4<T> const & GetCurrentColor () const;
00074     inline void         SetCurrentColor ( Vector4<T> const & v4 );
00075     inline void         SetCurrentColor ( T r, T g, T b, T a );
00076     inline Vector4<T> const & GetEndColor () const;
00077     inline void         SetEndColor ( Vector4<T> const & v4 );
00078     inline void         SetEndColor ( T r, T g, T b, T a );
00079     // Life Time ----------------------------------------------------
00080     inline T    GetLifeTimeElapsed () const;
00081     inline T    GetLifeTimeElapsedInUnit () const;
00082     inline void SetLifeTimeElapsed ( T t );
00083     inline T    GetLifeTimeSpan () const;
00084     inline void SetLifeTimeSpan ( T t );
00085     inline bool IsDead () const;
00086     //-------------------------------------------------------------------------
00087 
00088     //-------------------------------------------------------------------------
00089     // Simulation Functions
00091     inline bool IsDead ();
00092 
00094     void Update ( 
00095         T worldTimeDuration,        
00096         T tIntegrationTimeDelta ,   
00097         T tGravity = -9.81          
00098     );
00099     //-------------------------------------------------------------------------
00100     // Data Members -----------------------------------------------------------
00101 //=============================================================================
00102 protected:
00103     // Member Functions -------------------------------------------------------
00104     // Data Members -----------------------------------------------------------
00105     // Size
00106     T           m_tStartSize;       
00107     T           m_tCurrentSize;     
00108     T           m_tEndSize;         
00109     // Color
00110     Vector4<T>  m_v4StartColor;     
00111     Vector4<T>  m_v4CurrentColor;   
00112     Vector4<T>  m_v4EndColor;       
00113     // Life Time
00114     T           m_tLifeTimeElapsed; 
00115     T           m_tLifeTimeSpan;    
00116 //=============================================================================
00117 private:
00118     // Member Functions -------------------------------------------------------
00119     inline void DefaultValues ();
00120 public:
00121     inline void RandomValues ();
00122     // Data Members -----------------------------------------------------------
00123 //=============================================================================
00124 #if defined(__gl_h_) || defined(__GL_H__)
00125 public:
00127     virtual void Draw ();
00128 #endif
00129 //=============================================================================
00130 }; // END CLASS DynamicParticle
00131 //=============================================================================
00132 END_NAMESPACE_TAPs
00133 //-----------------------------------------------------------------------------
00134 // Include definition if TAPs_USE_EXPORT is not defined
00135 //#if !defined( TAPs_USE_EXPORT )
00136     #include "TAPsDynamicParticle.cpp"
00137 //#endif
00138 //-----------------------------------------------------------------------------
00139 #endif
00140 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00141 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines