TAPs 0.7.7.3
TAPsPointMassDynamic.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsPointMassDynamic.hpp
00003 
00004 PointMassDynamic class is a class for a point mass reside in 3D.
00005 
00006 SUKITTI PUNAK   (07/12/2009)
00007 UPDATE          (09/21/2010)
00008 ******************************************************************************/
00009 #ifndef TAPs_POINT_MASS_DYNAMIC_HPP
00010 #define TAPs_POINT_MASS_DYNAMIC_HPP
00011 
00022 #include "../Core/TAPsCGMath.hpp"
00023 #include "TAPsPointMass.hpp"
00024 //#include "../DataStructure/TAPsSimulationFlags.hpp"
00025 
00026 BEGIN_NAMESPACE_TAPs
00027 //=============================================================================
00028 // Forward Class Declarations
00029 //=============================================================================
00030 template <typename T>
00031 class PointMassDynamic : /*virtual*/ public PointMass<T> {
00032 //=============================================================================
00033 //-----------------------------------------------------------------------------
00034 // Friend Function
00035 friend std::ostream & operator<< ( std::ostream &output, PointMassDynamic<T> const &P )
00036 {
00037     return output << P.StrInfo();
00038 }
00039 //-----------------------------------------------------------------------------
00040 
00041 //=============================================================================
00042 public:
00043     // Member Functions -------------------------------------------------------
00044 
00046     PointMassDynamic ( bool bRandomValue = false );
00047 
00049     PointMassDynamic ( 
00050         T                   mass,
00051         T                   radius          = 1,
00052         Vector3<T> const &  vPosition       = ZeroVector,
00053         Vector3<T> const &  vVelocity       = ZeroVector,
00054         Vector3<T> const &  vAcceleration   = ZeroVector,
00055         Vector3<T> const &  vForce          = ZeroVector,
00056         DS::SimulationFlags const & flags   = DS::SimulationFlags()
00057     );
00058 
00060     PointMassDynamic ( Vector3<T> const & location );
00061 
00063     PointMassDynamic ( T const location[3] );
00064 
00066     PointMassDynamic ( T locX, T locY, T locZ );
00067 
00069     PointMassDynamic ( PointMassDynamic<T> const & P );
00070 
00072     ~PointMassDynamic ();
00073 
00075     virtual std::string StrInfo () const;
00076 
00078     inline virtual void DefaultValues ();
00079 
00081     inline virtual void RandomValues ();
00082 
00083     //-------------------------------------------------------------------------
00084     // Assignment Operator
00085     PointMassDynamic<T> const & operator= ( PointMassDynamic<T> const & P );
00086 
00087     //-------------------------------------------------------------------------
00088     // Get/Set Functions
00089 
00090     // Physics Properties -------------------------------------------
00091 
00093     inline virtual Vector3<T> const & GetVelocity () const;
00095     inline virtual Vector3<T> & GetVelocity ();
00097     inline virtual void SetVelocity ( Vector3<T> const & v3 );
00099     inline virtual void SetVelocity ( T x, T y, T z );
00100 
00102     inline virtual Vector3<T> const & GetAcceleration () const;
00104     inline virtual Vector3<T> & GetAcceleration ();
00106     inline virtual void SetAcceleration ( Vector3<T> const & v3 );
00108     inline virtual void SetAcceleration ( T x, T y, T z );
00109 
00111     inline virtual Vector3<T> const & GetForce () const;
00113     inline virtual Vector3<T> & GetForce ();
00115     inline virtual void SetForce ( Vector3<T> const & v3 );
00117     inline virtual void SetForce ( T x, T y, T z );
00118 
00119     // Constraints --------------------------------------------------
00120     
00121     //-------------------------------------------------------------------------
00122 
00124     //void Update ( 
00125     //  T worldTimeDuration,        //!< duration time (sec) in the virtual world after the last update
00126     //  T tIntegrationTimeDelta     //!< integration time (sec)
00127     //);
00128 
00129     //-------------------------------------------------------------------------
00130     // Data Members -----------------------------------------------------------
00131 //=============================================================================
00132 protected:
00133     // Member Functions -------------------------------------------------------
00134     // Data Members -----------------------------------------------------------
00135     // Physics Properties -------------------------------------------
00136     Vector3<T>  m_v3Velocity;       
00137     Vector3<T>  m_v3Acceleration;   
00138     Vector3<T>  m_v3Force;          
00139     // Constraints --------------------------------------------------
00140 //=============================================================================
00141 private:
00142     // Member Functions -------------------------------------------------------
00143     // Data Members -----------------------------------------------------------
00144 //=============================================================================
00145 #if defined(__gl_h_) || defined(__GL_H__)
00146 public:
00148     virtual void Draw () const;
00150     virtual void Draw ( T scale ) const;
00151 #endif
00152 //=============================================================================
00153 }; // END CLASS PointMassDynamic
00154 //=============================================================================
00155 END_NAMESPACE_TAPs
00156 //-----------------------------------------------------------------------------
00157 #include "TAPsPointMassDynamic.cpp"
00158 //-----------------------------------------------------------------------------
00159 #endif
00160 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00161 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines